Skip to content

Commit 24db195

Browse files
authored
Merge branch 'MathIsFun0:main' into main
2 parents 028fb95 + 02e12e6 commit 24db195

File tree

12 files changed

+281
-145
lines changed

12 files changed

+281
-145
lines changed

Cryptid.lua

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ local cryptidConfigTab = function()
226226
config = { n = G.UIT.R, config = { align = "tm", padding = 0 }, nodes = { left_settings, right_settings } }
227227
cry_nodes[#cry_nodes + 1] = config
228228
cry_nodes[#cry_nodes + 1] = UIBox_button({
229+
colour = G.C.CRY_GREENGRADIENT,
229230
button = "your_collection_content_sets",
230231
label = { localize("b_content_sets") },
231232
count = modsCollectionTally(G.P_CENTER_POOLS["Content Set"]),
@@ -237,18 +238,31 @@ local cryptidConfigTab = function()
237238
--Add warning notifications later for family mode
238239
cry_nodes[#cry_nodes + 1] = create_toggle({
239240
label = localize("cry_family"),
240-
active_colour = G.C.MONEY,
241+
active_colour = HEX("40c76d"),
241242
ref_table = Cryptid_config,
242243
ref_value = "family_mode",
243244
callback = reload_cryptid_localization,
244245
})
245246
cry_nodes[#cry_nodes + 1] = create_toggle({
246247
label = localize("cry_experimental"),
247-
active_colour = G.C.MONEY,
248+
active_colour = HEX("1f8505"),
248249
ref_table = Cryptid_config,
249250
ref_value = "experimental",
250251
})
252+
cry_nodes[#cry_nodes + 1] = create_toggle({
253+
label = localize("cry_feat_https module"),
254+
active_colour = HEX("b1c78d"),
255+
ref_table = Cryptid_config,
256+
ref_value = "HTTPS",
257+
})
258+
cry_nodes[#cry_nodes + 1] = create_toggle({
259+
label = localize("cry_feat_menu"),
260+
active_colour = HEX("1c5c23"),
261+
ref_table = Cryptid_config,
262+
ref_value = "menu",
263+
})
251264
cry_nodes[#cry_nodes + 1] = UIBox_button({
265+
colour = G.C.CRY_ALTGREENGRADIENT,
252266
button = "reset_gameset_config",
253267
label = { localize("b_reset_gameset_" .. (G.PROFILES[G.SETTINGS.profile].cry_gameset or "mainline")) },
254268
minw = 5,
@@ -292,26 +306,31 @@ local cryptidTabs = function()
292306
}
293307
settings = { n = G.UIT.C, config = { align = "tl", padding = 0.05 }, nodes = {} }
294308
settings.nodes[#settings.nodes + 1] = create_toggle({
309+
active_colour = G.C.CRY_JOLLY,
295310
label = localize("cry_mus_jimball"),
296311
ref_table = Cryptid_config.Cryptid,
297312
ref_value = "jimball_music",
298313
})
299314
settings.nodes[#settings.nodes + 1] = create_toggle({
315+
active_colour = G.C.CRY_JOLLY,
300316
label = localize("cry_mus_code"),
301317
ref_table = Cryptid_config.Cryptid,
302318
ref_value = "code_music",
303319
})
304320
settings.nodes[#settings.nodes + 1] = create_toggle({
321+
active_colour = G.C.CRY_JOLLY,
305322
label = localize("cry_mus_exotic"),
306323
ref_table = Cryptid_config.Cryptid,
307324
ref_value = "exotic_music",
308325
})
309326
settings.nodes[#settings.nodes + 1] = create_toggle({
327+
active_colour = G.C.CRY_JOLLY,
310328
label = localize("cry_mus_high_score"),
311329
ref_table = Cryptid_config.Cryptid,
312330
ref_value = "big_music",
313331
})
314332
settings.nodes[#settings.nodes + 1] = create_toggle({
333+
active_colour = G.C.CRY_JOLLY,
315334
label = localize("cry_mus_alt_bg"),
316335
ref_table = Cryptid_config.Cryptid,
317336
ref_value = "alt_bg_music",

assets/1x/atlasexotic.png

11.2 KB
Loading

assets/1x/sticker_cry.png

-11.5 KB
Loading

assets/2x/atlasexotic.png

-52.3 KB
Loading

assets/2x/sticker_cry.png

-34.1 KB
Loading

config.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ return {
88
},
99
["family_mode"] = false,
1010
["experimental"] = false,
11+
["HTTPS"] = false,
12+
["menu"] = false,
1113
}

items/exotic.lua

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ local universum = {
136136
end,
137137
cry_credits = {
138138
idea = { "Ein13" },
139-
art = { "Ein13/hydrogenperoxiide" },
139+
art = { "Ein13", "hydrogenperoxiide" },
140140
},
141141
init = function(self)
142142
--Universum Patches
@@ -1169,7 +1169,7 @@ local energia = {
11691169
end,
11701170
cry_credits = {
11711171
idea = { "jenwalter666" },
1172-
art = { "Kailen" },
1172+
art = { "unexian" },
11731173
code = { "Math" },
11741174
},
11751175
}
@@ -1446,12 +1446,7 @@ local formidiulosus = {
14461446
G.jokers:emplace(card)
14471447
end
14481448
end
1449-
if
1450-
context.cardarea == G.jokers
1451-
and (to_big(card.ability.extra.Emult) > to_big(1))
1452-
and not context.before
1453-
and not context.after
1454-
then
1449+
if context.cardarea == G.jokers and (to_big(card.ability.extra.Emult) > to_big(1)) and context.joker_main then
14551450
return {
14561451
message = localize({
14571452
type = "variable",
@@ -1493,7 +1488,7 @@ local items = {
14931488
--verisimile, WHY IS THIS AN EXOTIC????????????????????
14941489
--rescribere, [NEEDS REFACTOR]
14951490
duplicare,
1496-
--formidiulosus
1491+
formidiulosus,
14971492
}
14981493
return {
14991494
name = "Exotic Jokers",

items/misc_joker.lua

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ local potofjokes = {
262262
end,
263263
calculate = function(self, card, context)
264264
if context.end_of_round and not context.individual and not context.repetition and not context.blueprint then
265-
G.hand:change_size(math.min(1000 - card.ability.extra.h_size, card.ability.extra.h_mod))
265+
G.hand:change_size(math.min(math.max(0, 1000 - card.ability.extra.h_size), card.ability.extra.h_mod))
266266
card.ability.extra.h_size = card.ability.extra.h_size + card.ability.extra.h_mod
267267
return {
268268
message = localize({ type = "variable", key = "a_handsize", vars = { card.ability.extra.h_mod } }),
@@ -795,7 +795,7 @@ local triplet_rhythm = {
795795
if context.joker_main and context.scoring_hand then
796796
local threes = 0
797797
for i = 1, #context.scoring_hand do
798-
if context.scoring_hand[i]:get_id() then
798+
if context.scoring_hand[i]:get_id() == 3 then
799799
threes = threes + 1
800800
end
801801
end
@@ -1194,14 +1194,14 @@ local seal_the_deal = {
11941194
end,
11951195
set_ability = function(self, card, initial, delay_sprites)
11961196
local sealtable = { "blue", "red", "purple" }
1197-
if Cryptid.enabled["Misc."] then
1197+
if cry_card_enabled("cry_azure") then
11981198
sealtable[#sealtable + 1] = "azure"
11991199
end
1200-
if Cryptid.enabled["Code Cards"] then
1200+
if cry_card_enabled("cry_green") then
12011201
sealtable[#sealtable + 1] = "green"
12021202
end
12031203
card.ability.extra = pseudorandom_element(sealtable, pseudoseed("abc"))
1204-
if G.P_CENTERS["j_cry_seal_the_deal"].discovered then
1204+
if self.discovered then
12051205
--Gold (ULTRA RARE!!!!!!!!)
12061206
if pseudorandom("xyz") <= 0.000001 and not (card.area and card.area.config.collection) then
12071207
card.children.center:set_sprite_pos({ x = 6, y = 4 })
@@ -1498,7 +1498,7 @@ local fspinner = {
14981498
return { vars = { center.ability.extra.chips, center.ability.extra.chip_mod } }
14991499
end,
15001500
rarity = 1,
1501-
cost = 6,
1501+
cost = 5,
15021502
order = 77,
15031503
blueprint_compat = true,
15041504
perishable_compat = false,
@@ -1757,9 +1757,9 @@ local gardenfork = {
17571757
calculate = function(self, card, context)
17581758
if context.cardarea == G.jokers and context.before and not context.blueprint then
17591759
for i = 1, #context.full_hand do
1760-
if context.other_card:get_id() == 14 then
1760+
if context.scoring_hand[i]:get_id() == 14 then
17611761
for j = 1, #context.full_hand do
1762-
if context.other_card:get_id() == 7 then -- :( ekshpenshive
1762+
if context.scoring_hand[j]:get_id() == 7 then -- :( ekshpenshive
17631763
ease_dollars(card.ability.extra.money)
17641764
return { message = "$" .. card.ability.extra.money, colour = G.C.MONEY }
17651765
end
@@ -6983,7 +6983,7 @@ local cookie = {
69836983
cost = 4,
69846984
atlas = "atlastwo",
69856985
order = 133,
6986-
config = { extra = { chips = 150, chip_mod = 1 } },
6986+
config = { extra = { chips = 200, chip_mod = 1 } },
69876987
blueprint_compat = true,
69886988
eternal_compat = false,
69896989
perishable_compat = false,

lib/misc.lua

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,17 +183,48 @@ end
183183

184184
-- simple plural s function for localisation
185185
function cry_pls(str, vars)
186-
if string.sub(str, 1, 1) == "p" or string.sub(str, 1, 1) == "s" or string.sub(str, 1, 1) == "y" then
187-
num = vars[tonumber(string.sub(str, 2, -1))]
188-
if num then
189-
if math.abs(to_big(num) - 1) > to_big(0.001) then
190-
return string.sub(str, 1, 1) == "y" and "ies" or "s"
186+
local inside = str:match("<(.-)>") -- finds args
187+
local _table = {}
188+
if inside then
189+
for v in inside:gmatch("[^,]+") do -- adds args to array
190+
table.insert(_table, v)
191+
end
192+
end
193+
if not vars then
194+
num = 1 -- Hopefully prevents a crash if no level data
195+
else
196+
local num = vars[tonumber(string.match(str, ">(%d+)"))] -- gets the number outside angle brackets, and its corresponding variable
197+
end
198+
local plural = _table[1] -- default
199+
local checks = { [1] = "=" }
200+
if #_table > 1 then
201+
for i = 2, #_table do
202+
local isnum = tonumber(_table[i])
203+
if isnum then
204+
checks[isnum] = ">" .. (_table[i + 1] or "")
205+
i = i + 1
206+
elseif i == 2 then
207+
checks[1] = "=" .. _table[i]
191208
else
192-
return string.sub(str, 1, 1) == "y" and "y" or ""
209+
print("Unexpected string: " .. _table[i])
210+
end
211+
end
212+
end
213+
local function fch(str, c)
214+
return string.sub(str, 1, 1) == c -- gets first char and returns boolean
215+
end
216+
for k, v in pairs(checks) do
217+
if fch(v, "=") then
218+
if math.abs(to_big(num) - k) < to_big(0.001) then
219+
return string.sub(v, 2, -1)
220+
end
221+
elseif fch(v, ">") then
222+
if to_big(num) >= to_big(k - 0.001) then
223+
return string.sub(v, 2, -1)
193224
end
194225
end
195226
end
196-
return false -- idk it doesn't really matter
227+
return plural
197228
end
198229

199230
-- generate a random edition (e.g. Antimatter Deck)
@@ -348,7 +379,7 @@ end
348379

349380
--Changes main menu colors and stuff
350381
--has to be modified with new enabling system
351-
if true then --Cryptid.enabled["Menu"] then
382+
if Cryptid_config.menu then
352383
local oldfunc = Game.main_menu
353384
Game.main_menu = function(change_context)
354385
local ret = oldfunc(change_context)

lib/overrides.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ G.C.CRY_BLOSSOM = { 0, 0, 0, 0 }
229229
G.C.CRY_AZURE = { 0, 0, 0, 0 }
230230
G.C.CRY_ASCENDANT = { 0, 0, 0, 0 }
231231
G.C.CRY_JOLLY = { 0, 0, 0, 0 }
232+
G.C.CRY_GREENGRADIENT = { 0, 0, 0, 0 }
233+
G.C.CRY_ALTGREENGRADIENT = { 0, 0, 0, 0 }
232234
Cryptid.C = {
233235
EXOTIC = { HEX("708b91"), HEX("1e9eba") },
234236
TWILIGHT = { HEX("0800ff"), HEX("aa00ff") },
@@ -241,8 +243,9 @@ Cryptid.C = {
241243
ASCENDANT = { HEX("2e00f5"), HEX("e5001d") },
242244
JOLLY = { HEX("6ec1f5"), HEX("456b84") },
243245
SELECTED = { HEX("e38039"), HEX("ccdd1b") },
246+
GREENGRADIENT = { HEX("51e099"), HEX("1e523a") },
247+
ALTGREENGRADIENT = { HEX("6bb565"), HEX("bd28bf") },
244248
}
245-
246249
cry_pointer_dt = 0
247250
cry_jimball_dt = 0
248251
cry_glowing_dt = 0

0 commit comments

Comments
 (0)