@@ -1033,15 +1033,19 @@ local exploit = {
10331033 return true
10341034 end ,
10351035 use = function (self , card , area , copier )
1036+ -- Un-use the card (re-use code is in lib/misc.lua)
10361037 if not card .ability .cry_multiuse or to_big (card .ability .cry_multiuse ) <= to_big (1 ) then
10371038 G .GAME .CODE_DESTROY_CARD = copy_card (card )
10381039 G .consumeables :emplace (G .GAME .CODE_DESTROY_CARD )
1039- else
1040- G .GAME .CODE_DESTROY_CARD = card
1040+ G .GAME .CODE_DESTROY_CARD .ability .cry_multiuse = nil
1041+ end
1042+ if card .ability .cry_multiuse then
10411043 card .ability .cry_multiuse = card .ability .cry_multiuse + 1
10421044 end
1045+
10431046 G .GAME .USING_CODE = true
10441047 G .GAME .USING_EXPLOIT = true
1048+ G .GAME .ACTIVE_CODE_CARD = G .GAME .CODE_DESTROY_CARD or card
10451049 G .FUNCS .overlay_menu ({ definition = G .UIDEF .exploit_menu () })
10461050 end ,
10471051}
@@ -3082,12 +3086,18 @@ local class = {
30823086 return { vars = { Cryptid .safe_get (card , " ability" , " max_highlighted" ) or self .config .max_highlighted } }
30833087 end ,
30843088 use = function (self , card , area , copier )
3089+ -- Un-use the card
30853090 if not card .ability .cry_multiuse or to_big (card .ability .cry_multiuse ) <= to_big (1 ) then
30863091 G .GAME .CODE_DESTROY_CARD = copy_card (card )
30873092 G .consumeables :emplace (G .GAME .CODE_DESTROY_CARD )
3093+ G .GAME .CODE_DESTROY_CARD .ability .cry_multiuse = nil
3094+ end
3095+ if card .ability .cry_multiuse then
3096+ card .ability .cry_multiuse = card .ability .cry_multiuse + 1
30883097 end
30893098 G .GAME .USING_CODE = true
30903099 G .GAME .USING_CLASS = card .ability .max_highlighted
3100+ G .GAME .ACTIVE_CODE_CARD = G .GAME .CODE_DESTROY_CARD or card
30913101 G .FUNCS .overlay_menu ({ definition = create_UIBox_class () })
30923102 end ,
30933103 init = function (self )
@@ -3111,10 +3121,19 @@ local class = {
31113121 end
31123122 G .hand :unhighlight_all ()
31133123 ccl (self )
3114- if G .GAME .CODE_DESTROY_CARD then
3115- G .GAME .CODE_DESTROY_CARD :start_dissolve ()
3116- G .GAME .CODE_DESTROY_CARD = nil
3124+ -- Re-use the card
3125+ if G .GAME .ACTIVE_CODE_CARD then
3126+ if
3127+ not G .GAME .ACTIVE_CODE_CARD .ability .cry_multiuse
3128+ or to_big (G .GAME .ACTIVE_CODE_CARD .ability .cry_multiuse ) <= to_big (1 )
3129+ then
3130+ G .GAME .ACTIVE_CODE_CARD :start_dissolve ()
3131+ else
3132+ G .GAME .ACTIVE_CODE_CARD .ability .cry_multiuse =
3133+ lenient_bignum (to_big (G .GAME .ACTIVE_CODE_CARD .ability .cry_multiuse ) - to_big (1 ))
3134+ end
31173135 end
3136+ G .GAME .ACTIVE_CODE_CARD = nil
31183137 end
31193138 else
31203139 ccl (self )
@@ -3306,12 +3325,18 @@ local variable = {
33063325 return { vars = { Cryptid .safe_get (card , " ability" , " max_highlighted" ) or self .config .max_highlighted } }
33073326 end ,
33083327 use = function (self , card , area , copier )
3328+ -- Un-use the card
33093329 if not card .ability .cry_multiuse or to_big (card .ability .cry_multiuse ) <= to_big (1 ) then
33103330 G .GAME .CODE_DESTROY_CARD = copy_card (card )
33113331 G .consumeables :emplace (G .GAME .CODE_DESTROY_CARD )
3332+ G .GAME .CODE_DESTROY_CARD .ability .cry_multiuse = nil
3333+ end
3334+ if card .ability .cry_multiuse then
3335+ card .ability .cry_multiuse = card .ability .cry_multiuse + 1
33123336 end
33133337 G .GAME .USING_CODE = true
33143338 G .GAME .USING_VARIABLE = card .ability .max_highlighted
3339+ G .GAME .ACTIVE_CODE_CARD = G .GAME .CODE_DESTROY_CARD or card
33153340 G .FUNCS .overlay_menu ({ definition = create_UIBox_variable_code () })
33163341 end ,
33173342 init = function (self )
@@ -3335,10 +3360,19 @@ local variable = {
33353360 end
33363361 G .hand :unhighlight_all ()
33373362 ccl (self )
3338- if G .GAME .CODE_DESTROY_CARD then
3339- G .GAME .CODE_DESTROY_CARD :start_dissolve ()
3340- G .GAME .CODE_DESTROY_CARD = nil
3363+ -- Re-use the card
3364+ if G .GAME .ACTIVE_CODE_CARD then
3365+ if
3366+ not G .GAME .ACTIVE_CODE_CARD .ability .cry_multiuse
3367+ or to_big (G .GAME .ACTIVE_CODE_CARD .ability .cry_multiuse ) <= to_big (1 )
3368+ then
3369+ G .GAME .ACTIVE_CODE_CARD :start_dissolve ()
3370+ else
3371+ G .GAME .ACTIVE_CODE_CARD .ability .cry_multiuse =
3372+ lenient_bignum (to_big (G .GAME .ACTIVE_CODE_CARD .ability .cry_multiuse ) - to_big (1 ))
3373+ end
33413374 end
3375+ G .GAME .ACTIVE_CODE_CARD = nil
33423376 end
33433377 else
33443378 ccl (self )
@@ -3485,7 +3519,8 @@ local log = {
34853519 local pseudorandom = copy_table (G .GAME .pseudorandom )
34863520 local j = {}
34873521 for i = 1 , 5 do
3488- j [# j + 1 ] = G .localization .descriptions [" Joker" ][Cryptid .predict_joker (" sho" )].name
3522+ local next_joker = G .localization .descriptions [" Joker" ][Cryptid .predict_joker (" sho" )]
3523+ j [# j + 1 ] = next_joker and next_joker .name or " [NOT A JOKER]"
34893524 end
34903525 G .GAME .pseudorandom = copy_table (pseudorandom )
34913526 G .GAME .USING_CODE = true
0 commit comments