Skip to content

Commit ff350e6

Browse files
Talisman Bignum levels compat
1 parent 317c751 commit ff350e6

File tree

1 file changed

+105
-115
lines changed

1 file changed

+105
-115
lines changed

items/planet.lua

Lines changed: 105 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -29,32 +29,27 @@ local timantti = {
2929
return true
3030
end,
3131
loc_vars = function(self, info_queue, center)
32-
local levelone = G.GAME.hands["High Card"].level or 1
33-
local leveltwo = G.GAME.hands["Pair"].level or 1
34-
local levelthree = G.GAME.hands["Two Pair"].level or 1
35-
local planetcolourone = G.C.HAND_LEVELS[math.min(levelone, 7)]
36-
local planetcolourtwo = G.C.HAND_LEVELS[math.min(leveltwo, 7)]
37-
local planetcolourthree = G.C.HAND_LEVELS[math.min(levelthree, 7)]
38-
if levelone == 1 or leveltwo == 1 or levelthree == 1 then --Level 1 colour is white (The background), so this sets it to black
39-
if levelone == 1 then
40-
planetcolourone = G.C.UI.TEXT_DARK
41-
end
42-
if leveltwo == 1 then
43-
planetcolourtwo = G.C.UI.TEXT_DARK
44-
end
45-
if levelthree == 1 then
46-
planetcolourthree = G.C.UI.TEXT_DARK
47-
end
48-
end
4932
return {
5033
vars = {
5134
localize("High Card", "poker_hands"),
5235
localize("Pair", "poker_hands"),
5336
localize("Two Pair", "poker_hands"),
54-
G.GAME.hands["High Card"].level,
55-
G.GAME.hands["Pair"].level,
56-
G.GAME.hands["Two Pair"].level,
57-
colours = { planetcolourone, planetcolourtwo, planetcolourthree },
37+
number_format(G.GAME.hands["High Card"].level),
38+
number_format(G.GAME.hands["Pair"].level),
39+
number_format(G.GAME.hands["Two Pair"].level),
40+
colours = {
41+
(
42+
to_big(G.GAME.hands["High Card"].level) == to_big(1) and G.C.UI.TEXT_DARK
43+
or G.C.HAND_LEVELS[to_big(math.min(7, G.GAME.hands["High Card"].level)):to_number()]
44+
),
45+
(to_big(G.GAME.hands["Pair"].level) == to_big(1) and G.C.UI.TEXT_DARK or G.C.HAND_LEVELS[to_big(
46+
math.min(7, G.GAME.hands["Pair"].level)
47+
):to_number()]),
48+
(
49+
to_big(G.GAME.hands["Two Pair"].level) == to_big(1) and G.C.UI.TEXT_DARK
50+
or G.C.HAND_LEVELS[to_big(math.min(7, G.GAME.hands["Two Pair"].level)):to_number()]
51+
),
52+
},
5853
},
5954
}
6055
end,
@@ -113,32 +108,27 @@ local klubi = {
113108
return true
114109
end,
115110
loc_vars = function(self, info_queue, center)
116-
local levelone = G.GAME.hands["Three of a Kind"].level or 1
117-
local leveltwo = G.GAME.hands["Straight"].level or 1
118-
local levelthree = G.GAME.hands["Flush"].level or 1
119-
local planetcolourone = G.C.HAND_LEVELS[math.min(levelone, 7)]
120-
local planetcolourtwo = G.C.HAND_LEVELS[math.min(leveltwo, 7)]
121-
local planetcolourthree = G.C.HAND_LEVELS[math.min(levelthree, 7)]
122-
if levelone == 1 or leveltwo == 1 or levelthree == 1 then --Level 1 colour is white (The background), so this sets it to black
123-
if levelone == 1 then
124-
planetcolourone = G.C.UI.TEXT_DARK
125-
end
126-
if leveltwo == 1 then
127-
planetcolourtwo = G.C.UI.TEXT_DARK
128-
end
129-
if levelthree == 1 then
130-
planetcolourthree = G.C.UI.TEXT_DARK
131-
end
132-
end
133111
return {
134112
vars = {
135113
localize("Three of a Kind", "poker_hands"),
136114
localize("Straight", "poker_hands"),
137115
localize("Flush", "poker_hands"),
138-
G.GAME.hands["Three of a Kind"].level,
139-
G.GAME.hands["Straight"].level,
140-
G.GAME.hands["Flush"].level,
141-
colours = { planetcolourone, planetcolourtwo, planetcolourthree },
116+
number_format(G.GAME.hands["Three of a Kind"].level),
117+
number_format(G.GAME.hands["Straight"].level),
118+
number_format(G.GAME.hands["Flush"].level),
119+
colours = {
120+
(
121+
to_big(G.GAME.hands["Three of a Kind"].level) == to_big(1) and G.C.UI.TEXT_DARK
122+
or G.C.HAND_LEVELS[to_big(math.min(7, G.GAME.hands["Three of a Kind"].level)):to_number()]
123+
),
124+
(
125+
to_big(G.GAME.hands["Straight"].level) == to_big(1) and G.C.UI.TEXT_DARK
126+
or G.C.HAND_LEVELS[to_big(math.min(7, G.GAME.hands["Straight"].level)):to_number()]
127+
),
128+
(to_big(G.GAME.hands["Flush"].level) == to_big(1) and G.C.UI.TEXT_DARK or G.C.HAND_LEVELS[to_big(
129+
math.min(7, G.GAME.hands["Flush"].level)
130+
):to_number()]),
131+
},
142132
},
143133
}
144134
end,
@@ -197,32 +187,28 @@ local sydan = {
197187
return true
198188
end,
199189
loc_vars = function(self, info_queue, center)
200-
local levelone = G.GAME.hands["Full House"].level or 1
201-
local leveltwo = G.GAME.hands["Four of a Kind"].level or 1
202-
local levelthree = G.GAME.hands["Straight Flush"].level or 1
203-
local planetcolourone = G.C.HAND_LEVELS[math.min(levelone, 7)]
204-
local planetcolourtwo = G.C.HAND_LEVELS[math.min(leveltwo, 7)]
205-
local planetcolourthree = G.C.HAND_LEVELS[math.min(levelthree, 7)]
206-
if levelone == 1 or leveltwo == 1 or levelthree == 1 then --Level 1 colour is white (The background), so this sets it to black
207-
if levelone == 1 then
208-
planetcolourone = G.C.UI.TEXT_DARK
209-
end
210-
if leveltwo == 1 then
211-
planetcolourtwo = G.C.UI.TEXT_DARK
212-
end
213-
if levelthree == 1 then
214-
planetcolourthree = G.C.UI.TEXT_DARK
215-
end
216-
end
217190
return {
218191
vars = {
219192
localize("Full House", "poker_hands"),
220193
localize("Four of a Kind", "poker_hands"),
221194
localize("Straight Flush", "poker_hands"),
222-
G.GAME.hands["Full House"].level,
223-
G.GAME.hands["Four of a Kind"].level,
224-
G.GAME.hands["Straight Flush"].level,
225-
colours = { planetcolourone, planetcolourtwo, planetcolourthree },
195+
number_format(G.GAME.hands["Full House"].level),
196+
number_format(G.GAME.hands["Four of a Kind"].level),
197+
number_format(G.GAME.hands["Straight Flush"].level),
198+
colours = {
199+
(
200+
to_big(G.GAME.hands["Full House"].level) == to_big(1) and G.C.UI.TEXT_DARK
201+
or G.C.HAND_LEVELS[to_big(math.min(7, G.GAME.hands["Full House"].level)):to_number()]
202+
),
203+
(
204+
to_big(G.GAME.hands["Four of a Kind"].level) == to_big(1) and G.C.UI.TEXT_DARK
205+
or G.C.HAND_LEVELS[to_big(math.min(7, G.GAME.hands["Four of a Kind"].level)):to_number()]
206+
),
207+
(
208+
to_big(G.GAME.hands["Straight Flush"].level) == to_big(1) and G.C.UI.TEXT_DARK
209+
or G.C.HAND_LEVELS[to_big(math.min(7, G.GAME.hands["Straight Flush"].level)):to_number()]
210+
),
211+
},
226212
},
227213
}
228214
end,
@@ -281,32 +267,28 @@ local lapio = {
281267
return true
282268
end,
283269
loc_vars = function(self, info_queue, center)
284-
local levelone = G.GAME.hands["Five of a Kind"].level or 1
285-
local leveltwo = G.GAME.hands["Flush House"].level or 1
286-
local levelthree = G.GAME.hands["Flush Five"].level or 1
287-
local planetcolourone = G.C.HAND_LEVELS[math.min(levelone, 7)]
288-
local planetcolourtwo = G.C.HAND_LEVELS[math.min(leveltwo, 7)]
289-
local planetcolourthree = G.C.HAND_LEVELS[math.min(levelthree, 7)]
290-
if levelone == 1 or leveltwo == 1 or levelthree == 1 then --Level 1 colour is white (The background), so this sets it to black
291-
if levelone == 1 then
292-
planetcolourone = G.C.UI.TEXT_DARK
293-
end
294-
if leveltwo == 1 then
295-
planetcolourtwo = G.C.UI.TEXT_DARK
296-
end
297-
if levelthree == 1 then
298-
planetcolourthree = G.C.UI.TEXT_DARK
299-
end
300-
end
301270
return {
302271
vars = {
303272
localize("Five of a Kind", "poker_hands"),
304273
localize("Flush House", "poker_hands"),
305274
localize("Flush Five", "poker_hands"),
306-
G.GAME.hands["Five of a Kind"].level,
307-
G.GAME.hands["Flush House"].level,
308-
G.GAME.hands["Flush Five"].level,
309-
colours = { planetcolourone, planetcolourtwo, planetcolourthree },
275+
number_format(G.GAME.hands["Five of a Kind"].level),
276+
number_format(G.GAME.hands["Flush House"].level),
277+
number_format(G.GAME.hands["Flush Five"].level),
278+
colours = {
279+
(
280+
to_big(G.GAME.hands["Five of a Kind"].level) == to_big(1) and G.C.UI.TEXT_DARK
281+
or G.C.HAND_LEVELS[to_big(math.min(7, G.GAME.hands["Five of a Kind"].level)):to_number()]
282+
),
283+
(
284+
to_big(G.GAME.hands["Flush House"].level) == to_big(1) and G.C.UI.TEXT_DARK
285+
or G.C.HAND_LEVELS[to_big(math.min(7, G.GAME.hands["Flush House"].level)):to_number()]
286+
),
287+
(
288+
to_big(G.GAME.hands["Flush Five"].level) == to_big(1) and G.C.UI.TEXT_DARK
289+
or G.C.HAND_LEVELS[to_big(math.min(7, G.GAME.hands["Flush Five"].level)):to_number()]
290+
),
291+
},
310292
},
311293
}
312294
end,
@@ -372,17 +354,7 @@ local kaikki = {
372354
local planetcolourone = G.C.HAND_LEVELS[math.min(levelone, 7)]
373355
local planetcolourtwo = G.C.HAND_LEVELS[math.min(leveltwo, 7)]
374356
local planetcolourthree = G.C.HAND_LEVELS[math.min(levelthree, 7)]
375-
if levelone == 1 or leveltwo == 1 or levelthree == 1 then --Level 1 colour is white (The background), so this sets it to black
376-
if levelone == 1 then
377-
planetcolourone = G.C.UI.TEXT_DARK
378-
end
379-
if leveltwo == 1 then
380-
planetcolourtwo = G.C.UI.TEXT_DARK
381-
end
382-
if levelthree == 1 then
383-
planetcolourthree = G.C.UI.TEXT_DARK
384-
end
385-
end
357+
386358
return {
387359
vars = {
388360
localize("cry_Bulwark", "poker_hands"),
@@ -391,7 +363,20 @@ local kaikki = {
391363
G.GAME.hands["cry_Bulwark"].level,
392364
G.GAME.hands["cry_Clusterfuck"].level,
393365
G.GAME.hands["cry_UltPair"].level,
394-
colours = { planetcolourone, planetcolourtwo, planetcolourthree },
366+
colours = {
367+
(
368+
to_big(G.GAME.hands["cry_Bulwark"].level) == to_big(1) and G.C.UI.TEXT_DARK
369+
or G.C.HAND_LEVELS[to_big(math.min(7, G.GAME.hands["cry_Bulwark"].level)):to_number()]
370+
),
371+
(
372+
to_big(G.GAME.hands["cry_Clusterfuck"].level) == to_big(1) and G.C.UI.TEXT_DARK
373+
or G.C.HAND_LEVELS[to_big(math.min(7, G.GAME.hands["cry_Clusterfuck"].level)):to_number()]
374+
),
375+
(
376+
to_big(G.GAME.hands["cry_UltPair"].level) == to_big(1) and G.C.UI.TEXT_DARK
377+
or G.C.HAND_LEVELS[to_big(math.min(7, G.GAME.hands["cry_UltPair"].level)):to_number()]
378+
),
379+
},
395380
},
396381
}
397382
end,
@@ -1037,18 +1022,18 @@ local abelt = {
10371022
badges[1] = create_badge(localize("k_planet_disc"), get_type_colour(self or card.config, card), nil, 1.2)
10381023
end,
10391024
loc_vars = function(self, info_queue, center)
1040-
local levelone = G.GAME.hands["cry_Bulwark"].level or 1
1041-
local planetcolourone = G.C.HAND_LEVELS[math.min(levelone, 7)]
1042-
if levelone == 1 then
1043-
planetcolourone = G.C.UI.TEXT_DARK
1044-
end
10451025
return {
10461026
vars = {
10471027
localize("cry_hand_bulwark"),
10481028
G.GAME.hands["cry_Bulwark"].level,
10491029
G.GAME.hands["cry_Bulwark"].l_mult,
10501030
G.GAME.hands["cry_Bulwark"].l_chips,
1051-
colours = { planetcolourone },
1031+
colours = {
1032+
(
1033+
to_big(G.GAME.hands["cry_Bulwark"].level) == to_big(1) and G.C.UI.TEXT_DARK
1034+
or G.C.HAND_LEVELS[to_big(math.min(7, G.GAME.hands["cry_Bulwark"].level)):to_number()]
1035+
),
1036+
},
10521037
},
10531038
}
10541039
end,
@@ -1083,18 +1068,18 @@ local void = {
10831068
badges[1] = create_badge("", get_type_colour(self or card.config, card), nil, 1.2)
10841069
end,
10851070
loc_vars = function(self, info_queue, center)
1086-
local levelone = G.GAME.hands["cry_Clusterfuck"].level or 1
1087-
local planetcolourone = G.C.HAND_LEVELS[math.min(levelone, 7)]
1088-
if levelone == 1 then
1089-
planetcolourone = G.C.UI.TEXT_DARK
1090-
end
10911071
return {
10921072
vars = {
10931073
localize("cry_Clusterfuck"),
10941074
G.GAME.hands["cry_Clusterfuck"].level,
10951075
G.GAME.hands["cry_Clusterfuck"].l_mult,
10961076
G.GAME.hands["cry_Clusterfuck"].l_chips,
1097-
colours = { planetcolourone },
1077+
colours = {
1078+
(
1079+
to_big(G.GAME.hands["cry_Clusterfuck"].level) == to_big(1) and G.C.UI.TEXT_DARK
1080+
or G.C.HAND_LEVELS[to_big(math.min(7, G.GAME.hands["cry_Clusterfuck"].level)):to_number()]
1081+
),
1082+
},
10981083
},
10991084
}
11001085
end,
@@ -1140,7 +1125,12 @@ local marsmoons = {
11401125
G.GAME.hands["cry_UltPair"].level,
11411126
G.GAME.hands["cry_UltPair"].l_mult,
11421127
G.GAME.hands["cry_UltPair"].l_chips,
1143-
colours = { planetcolourone },
1128+
colours = {
1129+
(
1130+
to_big(G.GAME.hands["cry_UltPair"].level) == to_big(1) and G.C.UI.TEXT_DARK
1131+
or G.C.HAND_LEVELS[to_big(math.min(7, G.GAME.hands["cry_UltPair"].level)):to_number()]
1132+
),
1133+
},
11441134
},
11451135
}
11461136
end,
@@ -1175,18 +1165,18 @@ local universe = {
11751165
badges[1] = create_badge(localize("k_planet_universe"), get_type_colour(self or card.config, card), nil, 1.2)
11761166
end,
11771167
loc_vars = function(self, info_queue, center)
1178-
local levelone = G.GAME.hands["cry_WholeDeck"].level or 1
1179-
local planetcolourone = G.C.HAND_LEVELS[math.min(levelone, 7)]
1180-
if levelone == 1 then
1181-
planetcolourone = G.C.UI.TEXT_DARK
1182-
end
11831168
return {
11841169
vars = {
11851170
localize("cry_UltPair"),
11861171
G.GAME.hands["cry_WholeDeck"].level,
11871172
G.GAME.hands["cry_WholeDeck"].l_mult,
11881173
G.GAME.hands["cry_WholeDeck"].l_chips,
1189-
colours = { planetcolourone },
1174+
colours = {
1175+
(
1176+
to_big(G.GAME.hands["cry_Bulwark"].level) == to_big(1) and G.C.UI.TEXT_DARK
1177+
or G.C.HAND_LEVELS[to_big(math.min(7, G.GAME.hands["cry_WholeDeck"].level)):to_number()]
1178+
),
1179+
},
11901180
},
11911181
}
11921182
end,

0 commit comments

Comments
 (0)