@@ -109,17 +109,10 @@ function Cryptid.misprintize_tbl(name, ref_tbl, ref_value, clear, override, stac
109109 if not Cryptid .base_values [name ] then
110110 Cryptid .base_values [name ] = {}
111111 end
112- if not Cryptid .base_values [name ][k ] then
113- if G .P_CENTERS [name ] and G .P_CENTERS [name ].config [k ] then
114- Cryptid .base_values [name ][k ] = G .P_CENTERS [name ].config [k ]
115- elseif k == " cry_prob" then
116- Cryptid .base_values [name ][k ] = 1
117- else
118- Cryptid .base_values [name ][k ] = tbl [k ]
119- end
112+ if not Cryptid .base_values [name ][k .. ref_value ] then
113+ Cryptid .base_values [name ][k .. ref_value ] = tbl [k ]
120114 end
121-
122- local initial = (stack and tbl [k ] or Cryptid .base_values [name ][k ])
115+ local initial = (stack and tbl [k ] or Cryptid .base_values [name ][k .. ref_value ])
123116 local min = override and override .min or G .GAME .modifiers .cry_misprint_min
124117 local max = override and override .max or G .GAME .modifiers .cry_misprint_max
125118
@@ -137,13 +130,13 @@ function Cryptid.misprintize_tbl(name, ref_tbl, ref_value, clear, override, stac
137130 )
138131 ) and num_too_big (initial , min , max , prob_max )
139132 then
140- initial = Cryptid .base_values [name ][k ] * prob_max
133+ initial = Cryptid .base_values [name ][k .. ref_value ] * prob_max
141134 min = 1
142135 max = 1
143136 end
144137
145138 tbl [k ] = Cryptid .sanity_check (
146- clear and Cryptid .base_values [name ][k ]
139+ clear and Cryptid .base_values [name ][k .. ref_value ]
147140 or cry_format (Cryptid .calculate_misprint (initial , min , max , grow_type , pow_level ), " %.2g" ),
148141 big
149142 )
@@ -154,27 +147,24 @@ function Cryptid.misprintize_tbl(name, ref_tbl, ref_value, clear, override, stac
154147 if not Cryptid .base_values [name ] then
155148 Cryptid .base_values [name ] = {}
156149 end
157- if not Cryptid .base_values [name ][k ] then
158- Cryptid .base_values [name ][k ] = {}
159- end
160- if not Cryptid .base_values [name ][k ][_k ] then
150+ if not Cryptid .base_values [name ][_k .. k ] then
161151 if
162152 G .P_CENTERS [name ]
163153 and type (G .P_CENTERS [name ].config [k ]) == " table"
164154 and G .P_CENTERS [name ].config [k ][_k ]
165155 then
166- Cryptid .base_values [name ][k ][ _k ] = G .P_CENTERS [name ].config [k ][_k ]
156+ Cryptid .base_values [name ][_k .. k ] = G .P_CENTERS [name ].config [k ][_k ]
167157 else
168- Cryptid .base_values [name ][k ][ _k ] = tbl [k ][_k ]
158+ Cryptid .base_values [name ][_k .. k ] = tbl [k ][_k ]
169159 end
170160 end
171161
172- local initial = (stack and tbl [k ][_k ] or Cryptid .base_values [name ][k ][ _k ])
162+ local initial = (stack and tbl [k ][_k ] or Cryptid .base_values [name ][_k .. k ])
173163 local min = override and override .min or G .GAME .modifiers .cry_misprint_min
174164 local max = override and override .max or G .GAME .modifiers .cry_misprint_max
175165
176166 if (_k == " odds" ) and num_too_big (initial , min , max , prob_max ) then
177- initial = Cryptid .base_values [name ][k ][ _k ] * prob_max
167+ initial = Cryptid .base_values [name ][_k .. k ] * prob_max
178168 min = 1
179169 max = 1
180170 end
@@ -198,7 +188,7 @@ function Cryptid.misprintize_tbl(name, ref_tbl, ref_value, clear, override, stac
198188 end
199189
200190 tbl [k ][_k ] = Cryptid .sanity_check (
201- clear and Cryptid .base_values [name ][k ][ _k ]
191+ clear and Cryptid .base_values [name ][_k .. k ]
202192 or cry_format (
203193 Cryptid .calculate_misprint (initial , min , max , grow_type , pow_level ),
204194 " %.2g"
@@ -455,6 +445,16 @@ function Cryptid.manipulate(card, args)
455445 end
456446 end
457447 local config = copy_table (card .config .center .config )
448+ Cryptid .base_values [card .config .center .key ] = {}
449+ for i , v in pairs (config ) do
450+ if (type (v ) == " table" and v .tetrate ) or type (v ) == " number" and to_big (v ) ~= to_big (0 ) then
451+ Cryptid .base_values [card .config .center .key ][i .. " ability" ] = v
452+ elseif type (v ) == " table" then
453+ for i2 , v2 in pairs (v ) do
454+ Cryptid .base_values [card .config .center .key ][i2 .. i ] = v2
455+ end
456+ end
457+ end
458458 if not args .bypass_checks and not args .no_deck_effects then
459459 Cryptid .with_deck_effects (card , func )
460460 else
@@ -467,18 +467,6 @@ function Cryptid.manipulate(card, args)
467467 end
468468 -- ew ew ew ew
469469 G .P_CENTERS [card .config .center .key ].config = config
470- if not Cryptid .base_values [card .config .center .key ] then
471- Cryptid .base_values [card .config .center .key ] = {}
472- for i , v in pairs (config ) do
473- if (type (v ) == " table" and v .tetrate ) or type (v ) == " number" and to_big (v ) ~= to_big (0 ) then
474- Cryptid .base_values [card .config .center .key ][i .. " ability" ] = v
475- elseif type (v ) == " table" then
476- for i2 , v2 in pairs (v ) do
477- Cryptid .base_values [card .config .center .key ][i2 .. i ] = v2
478- end
479- end
480- end
481- end
482470 end
483471 return true
484472 end
0 commit comments