@@ -15,6 +15,7 @@ Cryptid.misprintize_value_blacklist = {
1515 h_size = false ,
1616 selected_d6_face = false ,
1717 cry_hook_id = false ,
18+ colour = false
1819 -- TARGET: Misprintize Value Blacklist (format: key = false, )
1920}
2021
@@ -379,3 +380,99 @@ function Card:get_nominal(mod)
379380 + 10 * self .base .face_nominal * rank_mult
380381 + 0.000001 * self .unique_val
381382end
383+
384+ function Cryptid .manipulate (card , args )
385+ if not args then
386+ Cryptid .manipulate (card , {
387+ min = G .GAME .modifiers .cry_misprint_min ,
388+ max = G .GAME .modifiers .cry_misprint_max ,
389+ type = " X" ,
390+ dont_stack = true
391+ })
392+ else
393+ if not args .type then args .type = " X" end
394+ local caps = card .config .center .misprintize_caps or {}
395+ if card .infinifusion then
396+ if card .config .center == card .infinifusion_center or card .config .center .key == " j_infus_fused" then
397+ calculate_infinifusion (card , nil , function (i )
398+ Cryptid .manipulate (card , args )
399+ end )
400+ end
401+ end
402+ Cryptid .manipulate_table (card , card , " ability" , args )
403+ if card .base then Cryptid .manipulate_table (card , card , " base" , args ) end
404+ if caps then
405+ for i , v in pairs (caps ) do
406+ if type (v ) == " table" and not v .tetrate then
407+ for i2 , v2 in pairs (v ) do
408+ if to_big (card .ability [i ][i2 ]) > to_big (v2 ) then
409+ card .ability [i ][i2 ] = Cryptid .sanity_check (v2 , Cryptid .is_card_big (card ))
410+ end
411+ end
412+ elseif (type (v ) == " table" and v .tetrate ) or type (v ) == " number" then
413+ if to_big (card .ability [i ]) > to_big (v ) then
414+ card .ability [i ] = Cryptid .sanity_check (v , Cryptid .is_card_big (card ))
415+ end
416+ end
417+ end
418+ end
419+ if card .ability .consumeable then
420+ for k , v in pairs (card .ability .consumeable ) do
421+ card .ability .consumeable [k ] = Cryptid .deep_copy (card .ability [k ])
422+ end
423+ end
424+ end
425+ end
426+
427+ function Cryptid .manipulate_table (card , ref_table , ref_value , args )
428+ for i , v in pairs (ref_table [ref_value ]) do
429+ if (type (v ) == " number" or (type (v ) == " table" and v .tetrate )) and Cryptid .misprintize_value_blacklist [i ] ~= false then
430+ local num = v
431+ if args .dont_stack then
432+ if not Cryptid .base_values [card .config .center .key ] then Cryptid .base_values [card .config .center .key ] = {} end
433+ if not Cryptid .base_values [card .config .center .key ][i ] then Cryptid .base_values [card .config .center .key ][i ] = v end
434+ num = Cryptid .base_values [card .config .center .key ][i ]
435+ end
436+ if args .big then
437+ ref_table [ref_value ][i ] = Cryptid .manipulate_value (num , args , args .big )
438+ else
439+ ref_table [ref_value ][i ] = Cryptid .manipulate_value (num , args , Cryptid .is_card_big (card ))
440+ end
441+ elseif i ~= " immutable" and type (v ) == " table" and Cryptid .misprintize_value_blacklist [i ] ~= false then
442+ Cryptid .manipulate_table (card , ref_table [ref_value ], i , args )
443+ end
444+ end
445+ end
446+
447+ function Cryptid .manipulate_value (num , args , is_big )
448+ if args .func then
449+ num = args .func (num , args , is_big )
450+ else
451+ if args .min and args .max then
452+ local new_args = args
453+ local big_min = to_big (args .min )
454+ local big_max = to_big (args .max )
455+ local new_value = Cryptid .log_random (pseudoseed (args .seed or (" cry_misprint" .. G .GAME .round_resets .ante )), big_min , big_max )
456+ if args .type == " +" then
457+ if to_big (num ) ~= to_big (0 ) and to_big (num ) ~= to_big (1 ) then
458+ num = to_big (num ) + to_big (new_value )
459+ end
460+ elseif args .type == " X" then
461+ num = to_big (num ) * to_big (new_value )
462+ elseif args .type == " hyper" then
463+ if to_big (num ) ~= to_big (0 ) and to_big (num ) ~= to_big (1 ) then
464+ num = to_big (num ):arrow (args .value .arrows , to_big (new_value ))
465+ end
466+ end
467+ elseif args .value then
468+ if args .type == " +" then
469+ num = to_big (num ) + to_big (args .value )
470+ elseif args .type == " X" then
471+ num = to_big (num ) * to_big (args .value )
472+ elseif args .type == " hyper" then
473+ num = to_big (num ):arrow (args .value .arrows , to_big (args .value .height ))
474+ end
475+ end
476+ end
477+ return Cryptid .sanity_check (num , is_big )
478+ end
0 commit comments