@@ -1947,8 +1947,9 @@ local clockwork = { -- Steel Support: The Joker
19471947 key = " clockwork" ,
19481948 pos = { x = 2 , y = 0 },
19491949 config = {
1950+ limits = { l1 = 2 , l2 = 3 , l3 = 5 , l4 = 7 },
19501951 counters = { c1 = 0 , c2 = 0 , c3 = 0 , c4 = 0 },
1951- extra = { xmult = 1 , xmult_mod = 0.5 , steelenhc = 1 , steel_mod = 0.2 },
1952+ extra = { xmult = 1 , xmult_mod = 0.25 , steelenhc = 1 , steel_mod = 0.1 },
19521953 },
19531954 order = 135 ,
19541955 immutable = false ,
@@ -1958,48 +1959,55 @@ local clockwork = { -- Steel Support: The Joker
19581959 atlas = " placeholders" ,
19591960 enhancement_gate = " m_steel" , -- lucky joker uses this? hopefully it works
19601961 loc_vars = function (self , info_queue , center )
1962+ local function process_var (m , cap )
1963+ if (m >= cap - 1 ) then
1964+ return localize (" k_active_ex" )
1965+ end
1966+ return cap - m - 1
1967+ end
19611968 return {
19621969 vars = {
1963- center .ability .counters .c1 ,
1964- center .ability .counters .c2 ,
1965- center .ability .counters .c3 ,
1966- center .ability .counters .c4 ,
1970+ process_var ( center .ability .counters .c1 , center . ability . limits . l1 ) ,
1971+ process_var ( center .ability .counters .c2 , center . ability . limits . l2 ) ,
1972+ process_var ( center .ability .counters .c3 , center . ability . limits . l3 ) ,
1973+ process_var ( center .ability .counters .c4 , center . ability . limits . l4 ) ,
19671974 center .ability .extra .xmult ,
19681975 center .ability .extra .xmult_mod ,
19691976 center .ability .extra .steelenhc ,
19701977 center .ability .extra .steel_mod ,
1978+ center .ability .limits .l1 ,
1979+ center .ability .limits .l2 ,
1980+ center .ability .limits .l3 ,
1981+ center .ability .limits .l4 ,
19711982 },
19721983 }
19731984 end ,
19741985 calculate = function (self , card , context )
19751986 if context .before and context .cardarea == G .jokers and not context .blueprint and not context .retrigger then
1976- if card .ability .counters .c1 >= 1 then
1977- card .ability .counters .c1 = 0
1978- else
1979- card .ability .counters .c1 = card .ability .counters .c1 + 1
1987+ local function clamp (c , l )
1988+ local m = c + 1
1989+ if c + 1 >= l then
1990+ return 0
1991+ end
1992+ return m
19801993 end
1981- if card .ability .counters .c2 >= 2 then
1982- card .ability .counters .c2 = 0
1994+
1995+ card .ability .counters .c1 = clamp (card .ability .counters .c1 , card .ability .limits .l1 ) -- ticker 1
1996+
1997+ card .ability .counters .c2 = clamp (card .ability .counters .c1 , card .ability .limits .l2 ) -- ticker 2
1998+ if card .ability .counters .c2 == 0 then
19831999 card .ability .extra .xmult = card .ability .extra .xmult + card .ability .extra .xmult_mod
1984- else
1985- card .ability .counters .c2 = card .ability .counters .c2 + 1
19862000 end
1987- if card .ability .counters .c3 >= 4 then
1988- card .ability .counters .c3 = 0
1989- else
1990- card .ability .counters .c3 = card .ability .counters .c3 + 1
1991- end
1992- if card .ability .counters .c4 >= 6 then
1993- card .ability .counters .c4 = 0
2001+
2002+ card .ability .counters .c3 = clamp (card .ability .counters .c1 , card .ability .limits .l3 ) -- ticker 3
2003+
2004+ card .ability .counters .c4 = clamp (card .ability .counters .c1 , card .ability .limits .l4 ) -- ticker 4
2005+ if card .ability .counters .c4 == 0 then
19942006 card .ability .extra .steelenhc = card .ability .extra .steelenhc + card .ability .extra .steel_mod
1995- else
1996- card .ability .counters .c4 = card .ability .counters .c4 + 1
1997- end
1998- if card .ability .counters .c2 == 0 or card .ability .counters .c4 == 0 then
1999- return { message = " Upgrade!" } -- bweeehh
20002007 end
2008+
20012009 end
2002- if context .repetition and context .cardarea == G .play and card .ability .counters .c1 == 0 then -- effect 1
2010+ if context .repetition and context .cardarea == G .hand and card .ability .counters .c1 == 0 then -- effect 1
20032011 if context .other_card .ability .effect == " Steel Card" then
20042012 return {
20052013 message = localize (" k_again_ex" ),
@@ -2013,7 +2021,9 @@ local clockwork = { -- Steel Support: The Joker
20132021 then
20142022 return { xmult = card .ability .extra .xmult }
20152023 end
2016- if context .before and context .cardarea == G .play and card .ability .counters .c3 == 0 then -- effect 3
2024+ if context .before and context .cardarea == G .jokers
2025+ and not context .blueprint_card
2026+ and not context .retrigger_joker and card .ability .counters .c3 == 0 then -- effect 3
20172027 context .full_hand [1 ]:set_ability (G .P_CENTERS [" m_steel" ], nil , true )
20182028 end
20192029 if
@@ -2025,19 +2035,37 @@ local clockwork = { -- Steel Support: The Joker
20252035 then -- effect 4
20262036 return { xmult = card .ability .extra .steelenhc }
20272037 end
2038+ -- imo this secret effect can be madness only -Math
2039+ if context .after and context .cardarea == G .jokers and not context .blueprint_card and not context .retrigger_joker then
2040+ if card .ability .counters .c1 == 0 and card .ability .counters .c2 == 0 and card .ability .counters .c3 == 0 and card .ability .counters .c4 == 0 then
2041+ G .E_MANAGER :add_event (Event ({
2042+ func = function ()
2043+ local m =
2044+ copy_card (card )
2045+ m :add_to_deck ()
2046+ G .jokers :emplace (m )
2047+ return true
2048+ end ,
2049+ }))
2050+ return {
2051+ message = localize (" k_duplicated_ex" ),
2052+ card = card ,
2053+ }
2054+ end
2055+ end
20282056 end ,
20292057 set_ability = function (self , card , initial , delay_sprites )
2030- card .ability .counters .c1 = math.floor (pseudorandom (" Clockwork1" ) * 1 + 0.5 )
2031- card .ability .counters .c2 = math.floor (pseudorandom (" Clockwork2" ) * 2 + 0.5 )
2032- card .ability .counters .c3 = math.floor (pseudorandom (" Clockwork3" ) * 4 + 0.5 )
2033- card .ability .counters .c4 = math.floor (pseudorandom (" Clockwork4" ) * 6 + 0.5 )
2058+ card .ability .counters .c1 = math.floor (pseudorandom (" Clockwork1" ) * ( card . ability . limits . l1 - 1 ) + 0.5 )
2059+ card .ability .counters .c2 = math.floor (pseudorandom (" Clockwork2" ) * ( card . ability . limits . l2 - 1 ) + 0.5 )
2060+ card .ability .counters .c3 = math.floor (pseudorandom (" Clockwork3" ) * ( card . ability . limits . l3 - 1 ) + 0.5 )
2061+ card .ability .counters .c4 = math.floor (pseudorandom (" Clockwork4" ) * ( card . ability . limits . l4 - 1 ) + 0.5 )
20342062 end ,
20352063 cry_credits = {
20362064 idea = {
20372065 " cassknows" ,
20382066 },
20392067 code = {
2040- " Nova" ,
2068+ " Nova" , " Math " ,
20412069 },
20422070 },
20432071}
0 commit comments