Skip to content

Commit 145ccd4

Browse files
committed
some preparations
1 parent eb138ea commit 145ccd4

File tree

11 files changed

+366
-118
lines changed

11 files changed

+366
-118
lines changed

Cryptid.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,12 @@ local cryptidConfigTab = function()
333333
ref_table = Cryptid_config,
334334
ref_value = "menu",
335335
})
336+
cry_nodes[#cry_nodes + 1] = create_toggle({
337+
label = localize("cry_madness_enabled"),
338+
active_colour = HEX("40c76d"),
339+
ref_table = Cryptid_config,
340+
ref_value = "madness_enabled",
341+
})
336342
cry_nodes[#cry_nodes + 1] = UIBox_button({
337343
colour = G.C.CRY_ALTGREENGRADIENT,
338344
button = "reset_gameset_config",

config.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ return {
1111
["force_tooltips"] = true, -- i don't actually know what this does
1212
["HTTPS"] = true, -- your internet connection
1313
["menu"] = true, -- i don't know what this does either
14+
["madness_enabled"] = false
15+
1416
}

items/code.lua

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4786,22 +4786,38 @@ local CodeJoker = {
47864786
blueprint_compat = true,
47874787
demicoloncompat = true,
47884788
atlas = "atlasepic",
4789+
loc_vars = function(self, info_queue, center)
4790+
return { key = Cryptid.gameset_loc(self, { madness = "madness" }) }
4791+
end,
47894792
calculate = function(self, card, context)
47904793
if context.setting_blind and not (context.blueprint_card or self).getting_sliced then
4791-
if #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then
4794+
if Cryptid.gameset(self) == "madness" then
47924795
play_sound("timpani")
47934796
local card = create_card("Code", G.consumeables, nil, nil, nil, nil)
47944797
card:add_to_deck()
47954798
G.consumeables:emplace(card)
4799+
card:set_edition("e_negative")
47964800
card:juice_up(0.3, 0.5)
47974801
return nil, true
4802+
else
4803+
if #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then
4804+
play_sound("timpani")
4805+
local card = create_card("Code", G.consumeables, nil, nil, nil, nil)
4806+
card:add_to_deck()
4807+
G.consumeables:emplace(card)
4808+
card:juice_up(0.3, 0.5)
4809+
return nil, true
4810+
end
47984811
end
47994812
end
48004813
if context.forcetrigger then
48014814
play_sound("timpani")
48024815
local card = create_card("Code", G.consumeables, nil, nil, nil, nil)
48034816
card:add_to_deck()
48044817
G.consumeables:emplace(card)
4818+
if Cryptid.gameset(self) == "madness" then
4819+
card:set_edition("e_negative")
4820+
end
48054821
card:juice_up(0.3, 0.5)
48064822
return nil, true
48074823
end

items/epic.lua

Lines changed: 109 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ local error_joker = {
531531
},
532532
},
533533
},
534+
key = Cryptid.gameset(self) == "madness" and "j_cry_error_madness" or "j_cry_error"
534535
}
535536
end,
536537
add_to_deck = function(self, card, from_debuff)
@@ -596,7 +597,7 @@ local error_joker = {
596597
local buff = 0
597598
local cards = #G.jokers.cards
598599
for i = 1, #jokers do
599-
if cards + buff < G.jokers.config.card_limit then
600+
if cards + buff < G.jokers.config.card_limit or Cryptid.gameset(self) == "madness" then
600601
local card = copy_card(jokers[i])
601602
card:add_to_deck()
602603
G.jokers:emplace(card)
@@ -898,49 +899,79 @@ local boredom = {
898899
num,
899900
denom,
900901
},
902+
key = Cryptid.gameset(self) == "madness" and "j_cry_boredom_madness" or "j_cry_boredom"
901903
}
902904
end,
903905
atlas = "atlasepic",
904906
calculate = function(self, card, context)
905-
if context.before then
906-
local cards = {}
907-
for i, v in pairs(G.jokers.cards) do
908-
if v.config.center.key ~= "j_cry_boredom" then
909-
cards[#cards + 1] = v
907+
if Cryptid.gameset(self) == "madness" then
908+
if
909+
context.retrigger_joker_check
910+
and not context.retrigger_joker
911+
and not (context.other_card.ability and context.other_card.ability.name == "cry-Boredom")
912+
then
913+
if SMODS.pseudorandom_probability(card, "cry_boredom_joker", 1, card.ability.extra.odds, "Boredom") then
914+
return {
915+
message = localize("k_again_ex"),
916+
repetitions = 1,
917+
card = card,
918+
}
919+
else
920+
return nil, true
910921
end
911922
end
912-
local joker = pseudorandom_element(cards, pseudoseed("cry_boredom_joker"))
913-
card.cry_boredom_marked = joker
914-
end
915-
if context.after then
916-
card.cry_boredom_marked = nil
917-
end
918-
if
919-
context.retrigger_joker_check
920-
and not context.retrigger_joker
921-
and not (context.other_card.ability and context.other_card.ability.name == "cry-Boredom")
922-
and card.cry_boredom_marked == context.other_card
923-
then
924-
if SMODS.pseudorandom_probability(card, "cry_boredom_joker", 1, card.ability.extra.odds, "Boredom") then
923+
if
924+
context.repetition
925+
and context.cardarea == G.play
926+
and SMODS.pseudorandom_probability(card, "cry_boredom_joker", 1, card.ability.extra.odds, "Boredom")
927+
then
928+
return {
929+
message = localize("k_again_ex"),
930+
repetitions = 1,
931+
card = card,
932+
}
933+
end
934+
else
935+
if context.before then
936+
local cards = {}
937+
for i, v in pairs(G.jokers.cards) do
938+
if v.config.center.key ~= "j_cry_boredom" then
939+
cards[#cards + 1] = v
940+
end
941+
end
942+
local joker = pseudorandom_element(cards, pseudoseed("cry_boredom_joker"))
943+
card.cry_boredom_marked = joker
944+
end
945+
if context.after then
946+
card.cry_boredom_marked = nil
947+
end
948+
if
949+
context.retrigger_joker_check
950+
and not context.retrigger_joker
951+
and not (context.other_card.ability and context.other_card.ability.name == "cry-Boredom")
952+
and card.cry_boredom_marked == context.other_card
953+
then
954+
if SMODS.pseudorandom_probability(card, "cry_boredom_joker", 1, card.ability.extra.odds, "Boredom") then
955+
return {
956+
message = localize("k_again_ex"),
957+
repetitions = 1,
958+
card = card,
959+
}
960+
else
961+
return nil, true
962+
end
963+
end
964+
if
965+
context.repetition
966+
and context.cardarea == G.play
967+
and SMODS.pseudorandom_probability(card, "cry_boredom_card", 1, card.ability.extra.odds, "Boredom")
968+
then
925969
return {
926970
message = localize("k_again_ex"),
927971
repetitions = 1,
928972
card = card,
929973
}
930-
else
931-
return nil, true
932974
end
933-
end
934-
if
935-
context.repetition
936-
and context.cardarea == G.play
937-
and SMODS.pseudorandom_probability(card, "cry_boredom_card", 1, card.ability.extra.odds, "Boredom")
938-
then
939-
return {
940-
message = localize("k_again_ex"),
941-
repetitions = 1,
942-
card = card,
943-
}
944975
end
945976
end,
946977
cry_credits = {
@@ -988,7 +1019,7 @@ local number_blocks = {
9881019
}
9891020
end,
9901021
calculate = function(self, card, context)
991-
if context.after and not context.blueprint and not context.before and not context.repetition then
1022+
if context.after and not context.blueprint and not context.before and not context.repetition and Cryptid.gameset(self) ~= "madness" then
9921023
for i, v in pairs(G.hand.cards) do
9931024
if v:get_id() == G.GAME.current_round.cry_nb_card.id and not v.debuff then
9941025
SMODS.scale_card(card, {
@@ -1000,6 +1031,32 @@ local number_blocks = {
10001031
end
10011032
end
10021033
end
1034+
if Cryptid.gameset(self) ~= "madness" then
1035+
if
1036+
context.individual
1037+
and not context.end_of_round
1038+
and context.cardarea == G.hand
1039+
and not context.blueprint
1040+
and not context.before
1041+
and not context.after
1042+
and context.other_card:get_id() == G.GAME.current_round.cry_nb_card.id
1043+
then
1044+
if context.other_card.debuff then
1045+
return {
1046+
message = localize("k_debuffed"),
1047+
colour = G.C.RED,
1048+
card = card,
1049+
}
1050+
else
1051+
SMODS.scale_card(card, {
1052+
ref_table = card.ability.extra,
1053+
ref_value = "money",
1054+
scalar_value = "money_mod",
1055+
})
1056+
return nil, true
1057+
end
1058+
end
1059+
end
10031060
end,
10041061
calc_dollar_bonus = function(self, card)
10051062
if to_big(card.ability.extra.money) > to_big(0) then
@@ -1038,7 +1095,7 @@ local double_scale = {
10381095
immutable = true,
10391096
atlas = "atlasepic",
10401097
calc_scaling = function(self, card, other, current_scaling, current_scalar, args)
1041-
if to_big(times_current) >= to_big(times_needed) then
1098+
if to_big(times_current) >= to_big(times_needed) or Cryptid.gameset(self) == "madness" then
10421099
times_current = times_current - times_needed
10431100
else
10441101
return {
@@ -1089,6 +1146,7 @@ local double_scale = {
10891146
card.ability.times_needed,
10901147
card.ability.times_current,
10911148
},
1149+
key = Cryptid.gameset(self) == "madness" and "j_cry_Double Scale_madness" or "j_cry_Double Scale"
10921150
}
10931151
end,
10941152
}
@@ -2173,7 +2231,7 @@ local jtron = {
21732231
name = "cry-jtron",
21742232
key = "jtron",
21752233
config = {
2176-
extra = { bonus = 2 },
2234+
extra = { bonus = 1 },
21772235
immutable = { current = 0 },
21782236
},
21792237
rarity = "cry_epic",
@@ -2195,63 +2253,32 @@ local jtron = {
21952253
}
21962254
end,
21972255
calculate = function(self, card, context)
2256+
card.ability.immutable.current =
2257+
lenient_bignum(1 + to_big(card.ability.extra.bonus) * #SMODS.find_card("j_joker"))
21982258
if context.cardarea == G.jokers and context.joker_main then
2199-
card.ability.immutable.current =
2200-
lenient_bignum(1 + to_big(card.ability.extra.bonus) * #SMODS.find_card("j_joker"))
2201-
if to_big(card.ability.immutable.current) > to_big(0) then
2202-
return {
2203-
message = localize({
2204-
type = "variable",
2205-
key = "a_xmult",
2206-
vars = {
2207-
number_format(card.ability.immutable.current),
2208-
},
2209-
}),
2210-
Xmult_mod = lenient_bignum(card.ability.immutable.current),
2211-
colour = G.C.MULT,
2212-
}
2213-
end
2214-
end
2215-
if
2216-
context.end_of_round
2217-
and not context.blueprint
2218-
and not context.individual
2219-
and not context.repetition
2220-
and not context.retrigger_joker
2221-
then
2222-
if #G.jokers.cards + G.GAME.joker_buffer < G.jokers.config.card_limit then
2223-
G.E_MANAGER:add_event(Event({
2224-
func = function()
2225-
SMODS.add_card({
2226-
key = "j_joker",
2227-
area = G.jokers,
2228-
})
2229-
return true
2230-
end,
2231-
}))
2232-
end
2259+
return {
2260+
message = localize({
2261+
type = "variable",
2262+
key = "a_powmult",
2263+
vars = {
2264+
number_format(card.ability.immutable.current),
2265+
},
2266+
}),
2267+
Emult_mod = lenient_bignum(card.ability.immutable.current),
2268+
colour = G.C.DARK_EDITION,
2269+
}
22332270
end
22342271
if context.forcetrigger then
2235-
G.GAME.joker_buffer = G.GAME.joker_buffer + 1
2236-
G.E_MANAGER:add_event(Event({
2237-
func = function()
2238-
SMODS.add_card({
2239-
key = "j_joker",
2240-
area = G.jokers,
2241-
})
2242-
return true
2243-
end,
2244-
}))
22452272
return {
22462273
message = localize({
22472274
type = "variable",
2248-
key = "a_xmult",
2275+
key = "a_powmult",
22492276
vars = {
22502277
number_format(1 + to_big(card.ability.extra.bonus)),
22512278
},
22522279
}),
2253-
Xmult_mod = lenient_bignum(1 + to_big(card.ability.extra.bonus)),
2254-
colour = G.C.MULT,
2280+
Emult_mod = lenient_bignum(1 + to_big(card.ability.extra.bonus)),
2281+
colour = G.C.DARK_EDITION,
22552282
}
22562283
end
22572284
end,

items/exotic.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,12 @@ local tenebris = {
519519
order = 507,
520520
atlas = "atlasexotic",
521521
demicoloncompat = true,
522+
gameset_config = {
523+
extra = {
524+
slots = 25,
525+
money = 25
526+
}
527+
},
522528
calc_dollar_bonus = function(self, card)
523529
return lenient_bignum(card.ability.extra.money)
524530
end,
@@ -842,7 +848,7 @@ local scalae = {
842848
and not context.individual
843849
and not context.repetition
844850
and not context.blueprint
845-
and G.GAME.blind_on_deck == "Boss"
851+
and (G.GAME.blind_on_deck == "Boss" or Cryptid.gameset(self) == "madness")
846852
) or context.forcetrigger
847853
then
848854
SMODS.scale_card(card, {
@@ -900,6 +906,7 @@ local scalae = {
900906
example[2],
901907
example[3],
902908
},
909+
key = Cryptid.gameset_loc({madness = "madness"})
903910
}
904911
end,
905912
cry_credits = {

items/m.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,6 +1161,13 @@ local doodlem = {
11611161
},
11621162
immutable = { max_jollies = 25 },
11631163
},
1164+
gameset_config = {
1165+
madness = {
1166+
extra = {
1167+
init = 2
1168+
},
1169+
},
1170+
},
11641171
pos = { x = 2, y = 0 },
11651172
rarity = "cry_epic",
11661173
cost = 13,

0 commit comments

Comments
 (0)