Skip to content

Commit eee58cb

Browse files
committed
scalae&double scale refactor + misc_joker detection
1 parent b0db9f7 commit eee58cb

File tree

4 files changed

+497
-812
lines changed

4 files changed

+497
-812
lines changed

items/epic.lua

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,11 +1030,19 @@ local double_scale = {
10301030
cost = 18,
10311031
immutable = true,
10321032
atlas = "atlasepic",
1033-
cry_scale_mod = function(self, card, joker, orig_scale_scale, true_base, orig_scale_base, new_scale_base)
1033+
calc_scaling = function(self, card, other, current_scaling, current_scalar, args)
1034+
if not G.GAME.cryptid_base_scales then G.GAME.cryptid_base_scales = {} end
1035+
if not G.GAME.cryptid_base_scales[other.config.center.key] then G.GAME.cryptid_base_scales[other.config.center.key] = {} end
1036+
if not G.GAME.cryptid_base_scales[other.config.center.key][args.scalar_value] then G.GAME.cryptid_base_scales[other.config.center.key][args.scalar_value] = current_scalar end
1037+
local true_base = G.GAME.cryptid_base_scales[other.config.center.key][args.scalar_value]
1038+
local orig_scale_scale = current_scaling
10341039
if Cryptid.gameset(self) == "exp_modest" then
1035-
return lenient_bignum(to_big(true_base) * 2)
1040+
return {
1041+
scalar_value = lenient_bignum(to_big(true_base) * 2),
1042+
message = localize("k_upgrade_ex")
1043+
}
10361044
end
1037-
return lenient_bignum(orig_scale_scale + to_big(true_base))
1045+
return {scalar_value = lenient_bignum(orig_scale_scale + to_big(true_base)), message = localize("k_upgrade_ex")}
10381046
end,
10391047
cry_credits = {
10401048
idea = {

items/exotic.lua

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -374,11 +374,6 @@ local exponentia = {
374374
vars = { number_format(v.ability.extra.Emult) },
375375
}),
376376
})
377-
Cryptid.apply_scale_mod(v, v.ability.extra.Emult_mod, old, v.ability.extra.Emult, {
378-
base = { { "extra", "Emult" } },
379-
scaler = { { "extra", "Emult_mod" } },
380-
scaler_base = { v.ability.extra.Emult_mod },
381-
})
382377
end
383378
end
384379
return ret
@@ -830,9 +825,14 @@ local scalae = {
830825
}
831826
end
832827
end,
833-
cry_scale_mod = function(self, card, joker, orig_scale_scale, true_base, orig_scale_base, new_scale_base)
834-
if joker.ability.name ~= "cry-Scalae" then
835-
local new_scale = lenient_bignum(
828+
calc_scaling = function(self, card, other, current_scaling, current_scalar, args)
829+
if other.ability.name ~= "cry-Scalae" then
830+
if not G.GAME.cryptid_base_scales then G.GAME.cryptid_base_scales = {} end
831+
if not G.GAME.cryptid_base_scales[other.config.center.key] then G.GAME.cryptid_base_scales[other.config.center.key] = {} end
832+
if not G.GAME.cryptid_base_scales[other.config.center.key][args.scalar_value] then G.GAME.cryptid_base_scales[other.config.center.key][args.scalar_value] = current_scalar end
833+
local true_base = G.GAME.cryptid_base_scales[other.config.center.key][args.scalar_value]
834+
local orig_scale_scale = current_scaling
835+
local new_scale = lenient_bignum(
836836
to_big(true_base)
837837
* (
838838
(
@@ -844,10 +844,13 @@ local scalae = {
844844
) ^ to_big(card.ability.extra.scale)
845845
)
846846
)
847-
if not Cryptid.is_card_big(joker) and to_big(new_scale) >= to_big(1e300) then
847+
if not Cryptid.is_card_big(other) and to_big(new_scale) >= to_big(1e300) then
848848
new_scale = 1e300
849849
end
850-
return new_scale
850+
return {
851+
scalar_value = new_scale,
852+
message = localize("k_upgrade_ex")
853+
}
851854
end
852855
end,
853856
loc_vars = function(self, info_queue, card)

0 commit comments

Comments
 (0)