Skip to content

Commit 3246646

Browse files
authored
Broken sync catalyst (#791)
1 parent 003e619 commit 3246646

File tree

6 files changed

+131
-0
lines changed

6 files changed

+131
-0
lines changed

assets/1x/atlastwo.png

-3.34 KB
Loading

assets/2x/atlastwo.png

-24.9 KB
Loading

items/misc_joker.lua

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10879,6 +10879,48 @@ local poor_joker = { -- +1 to all listed probabilities for the highest cat tag l
1087910879
end,
1088010880
}
1088110881

10882+
-- Broken Sync Catalyst
10883+
-- Swaps 10% of chips with 10% of mult
10884+
local broken_sync = {
10885+
cry_credits = {
10886+
idea = {
10887+
"arnideus",
10888+
},
10889+
art = {
10890+
"Tatteredlurker",
10891+
},
10892+
code = {
10893+
"InvalidOS",
10894+
},
10895+
},
10896+
object_type = "Joker",
10897+
dependencies = {
10898+
items = {
10899+
"set_cry_misc_joker",
10900+
},
10901+
},
10902+
name = "cry-broken_sync_catalyst",
10903+
key = "broken_sync_catalyst",
10904+
atlas = "atlastwo",
10905+
pos = { x = 6, y = 3 },
10906+
rarity = 3,
10907+
cost = 8,
10908+
order = 145,
10909+
demicoloncompat = true,
10910+
blueprint_compat = true,
10911+
config = { extra = { portion = 0.1 } },
10912+
loc_vars = function(self, info_queue, card)
10913+
return { vars = { number_format(Cryptid.clamp(card.ability.extra.portion * 100, 0, 100)) } }
10914+
end,
10915+
calculate = function(self, card, context)
10916+
if context.joker_main or context.forcetrigger then
10917+
return {
10918+
cry_broken_swap = card.ability.extra.portion
10919+
}
10920+
end
10921+
end
10922+
}
10923+
1088210924
local miscitems = {
1088310925
jimball_sprite,
1088410926
dropshot,
@@ -11010,6 +11052,7 @@ local miscitems = {
1101011052
paved_joker,
1101111053
fading_joker,
1101211054
poor_joker,
11055+
broken_sync,
1101311056
}
1101411057

1101511058
return {

lib/misc.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,6 +1453,11 @@ function Cryptid.funny_log(x, y)
14531453
return math.log(y) / math.log(x)
14541454
end
14551455

1456+
-- Clamps n between min and max
1457+
function Cryptid.clamp(n, min, max)
1458+
return math.min(math.max(n, min), max)
1459+
end
1460+
14561461
local say_stuff_ref = Card_Character.say_stuff
14571462
function Card_Character:say_stuff(n, not_first, quip_key)
14581463
local quip = SMODS.JimboQuips[quip_key]

lib/overrides.lua

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2216,3 +2216,77 @@ function SMODS.calculate_context(context, return_table, no_resolve)
22162216
end
22172217
return aaa
22182218
end
2219+
2220+
local scie = SMODS.calculate_individual_effect
2221+
function SMODS.calculate_individual_effect(effect, scored_card, key, amount, from_edition, ...)
2222+
local ret = scie(effect, scored_card, key, amount, from_edition, ...)
2223+
if ret then
2224+
return ret
2225+
end
2226+
2227+
if key == 'cry_broken_swap' and amount > 0 then
2228+
if effect.card and effect.card ~= scored_card then juice_card(effect.card) end
2229+
-- only need math.min due to amount being required to be greater than 0
2230+
amount = math.min(amount, 1)
2231+
2232+
local chips = SMODS.Scoring_Parameters.chips
2233+
local mult = SMODS.Scoring_Parameters.mult
2234+
local chip_mod = chips.current * amount
2235+
local mult_mod = mult.current * amount
2236+
2237+
chips:modify(mult_mod - chip_mod)
2238+
mult:modify(chip_mod - mult_mod)
2239+
2240+
if not Cryptid.safe_get(Talisman, "config_file", "disable_anims") then
2241+
G.E_MANAGER:add_event(Event({
2242+
func = (function()
2243+
-- scored_card:juice_up()
2244+
local pitch_mod = pseudorandom("cry_broken_sync")*0.05 + 0.85
2245+
-- wolf fifth as opposed to plasma deck's just-intonated fifth
2246+
-- yes i'm putting music theory nerd stuff in here no you cannot stop me
2247+
play_sound('gong', pitch_mod, 0.3)
2248+
play_sound('gong', pitch_mod*1.4814814, 0.2)
2249+
play_sound('tarot1', 1.5)
2250+
ease_colour(G.C.UI_CHIPS, mix_colours(G.C.BLUE, G.C.RED, amount))
2251+
ease_colour(G.C.UI_MULT, mix_colours(G.C.RED, G.C.BLUE, amount))
2252+
G.E_MANAGER:add_event(Event({
2253+
trigger = 'after',
2254+
blockable = false,
2255+
blocking = false,
2256+
delay = 0.8,
2257+
func = (function()
2258+
ease_colour(G.C.UI_CHIPS, G.C.BLUE, 0.8)
2259+
ease_colour(G.C.UI_MULT, G.C.RED, 0.8)
2260+
return true
2261+
end)
2262+
}))
2263+
G.E_MANAGER:add_event(Event({
2264+
trigger = 'after',
2265+
blockable = false,
2266+
blocking = false,
2267+
no_delete = true,
2268+
delay = 1.3,
2269+
func = (function()
2270+
G.C.UI_CHIPS[1], G.C.UI_CHIPS[2], G.C.UI_CHIPS[3], G.C.UI_CHIPS[4] = G.C.BLUE[1], G.C.BLUE[2], G.C.BLUE[3], G.C.BLUE[4]
2271+
G.C.UI_MULT[1], G.C.UI_MULT[2], G.C.UI_MULT[3], G.C.UI_MULT[4] = G.C.RED[1], G.C.RED[2], G.C.RED[3], G.C.RED[4]
2272+
return true
2273+
end)
2274+
}))
2275+
return true
2276+
end)
2277+
}))
2278+
if not effect.remove_default_message then
2279+
if effect.balance_message then
2280+
card_eval_status_text(effect.message_card or effect.juice_card or scored_card or effect.card or effect.focus, 'extra', nil, percent, nil, effect.balance_message)
2281+
else
2282+
card_eval_status_text(effect.message_card or effect.juice_card or scored_card or effect.card or effect.focus, 'extra', nil, percent, nil, {message = localize('cry_balanced_q'), colour = {0.8, 0.45, 0.85, 1}})
2283+
end
2284+
end
2285+
delay(0.6)
2286+
end
2287+
2288+
return true
2289+
end
2290+
end
2291+
2292+
SMODS.scoring_parameter_keys[#SMODS.scoring_parameter_keys+1] = "cry_broken_swap"

localization/en-us.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,6 +1232,14 @@ return {
12321232
"{C:attention}10 minutes",
12331233
},
12341234
},
1235+
j_cry_broken_sync_catalyst = {
1236+
name = "Broken Sync Catalyst",
1237+
text = {
1238+
"Swaps {C:attention}#1#%{} of {C:chips}Chips{} with {C:attention}#1#%{} of {C:mult}Mult{}",
1239+
"{C:inactive,s:0.8}I've seen this one before...",
1240+
"{C:inactive,s:0.8}...it's seen better days.",
1241+
},
1242+
},
12351243
j_cry_brittle = {
12361244
name = "Brittle Candy",
12371245
text = {
@@ -5174,6 +5182,7 @@ return {
51745182
cry_p_star = "Star",
51755183

51765184
cry_again_q = "Again?",
5185+
cry_balanced_q = "Balanced...?",
51775186
cry_curse = "Curse",
51785187
cry_curse_ex = "Curse!",
51795188
cry_demicolon = "Demitrigger!",

0 commit comments

Comments
 (0)