Improve Jumbo implementation

This commit is contained in:
Emik 2026-05-26 23:37:19 +02:00
parent e3e5b574d8
commit 8e2caf2fee
Signed by: emik
GPG key ID: 6B0CD72A5E503BDF
4 changed files with 41 additions and 19 deletions

View file

@ -17,5 +17,5 @@
"conflicts": [
"Jen"
],
"version": "1.6.16"
"version": "1.6.17"
}

View file

@ -93,7 +93,7 @@ end
local jumbo_modifier = Cryptid and 100 or 2
SMODS.Edition({
local jumbo = SMODS.Edition({
key = "jumbo",
loc_txt = {
name = "Jumbo",
@ -102,7 +102,7 @@ SMODS.Edition({
"All card values are",
"{C:attention}multiplied{} by {C:attention}up to " .. jumbo_modifier,
"{C:inactive}(If possible)",
"{C:inactive,E:1,s:0.7}Whoa, it's huge!!{}",
"{C:inactive,E:1,s:0.75}Whoa, it's huge!!{}",
},
},
on_apply = function(card)
@ -111,15 +111,10 @@ SMODS.Edition({
end
card.Jane_jumbo = true
Jane.q(function()
Jane.resize(card, Jane.config.wee_sizemod)
end, nil, nil, nil, false, false)
local obj = card:gc()
if obj.set == "Booster" or obj.jumbo_mod then
jumbo_modifier = obj.jumbo_mod or 10
jumbo_modifier = obj.jumbo_mod or 2
end
if card.added_to_deck then
@ -131,6 +126,8 @@ SMODS.Edition({
if card.added_to_deck then
card:add_to_deck()
end
Jane.resize(card, Jane.config.wee_sizemod)
end,
on_remove = function(card)
if not card.Jane_jumbo then
@ -138,11 +135,6 @@ SMODS.Edition({
end
card.Jane_jumbo = nil
Jane.q(function()
Jane.resize(card, 1 / Jane.config.wee_sizemod)
end, nil, nil, nil, false, false)
local was_added = card.added_to_deck
if was_added then
@ -154,6 +146,8 @@ SMODS.Edition({
if was_added then
card:add_to_deck()
end
Jane.resize(card)
end,
sound = {sound = "jane_e_jumbo", per = 1, vol = 0.5},
weight = 5,
@ -164,6 +158,24 @@ SMODS.Edition({
get_weight = get_weight,
})
local orig_set_ability = Card.set_ability
function Card:set_ability(...)
local is_jumbo = self.edition and self.edition.jane_jumbo
if is_jumbo then
jumbo.on_remove(self)
end
local ret = orig_set_ability(self, ...)
if is_jumbo then
jumbo.on_apply(self)
end
return ret
end
SMODS.Edition({
key = "moire",
loc_txt = {

View file

@ -173,15 +173,24 @@ function Jane.play_sound(sound, per, vol)
end)
end
function Jane.resize(card, mod, force_save)
if force_save or not card.origsize then
function Jane.resize(card, mod)
if not card.origsize then
card.origsize = {w = card.T.w, h = card.T.h}
end
card:hard_set_T(card.T.x, card.T.y, card.T.w * mod, card.T.h * mod)
card:hard_set_T(
card.T.x,
card.T.y,
mod and mod * card.T.w or card.origsize.w,
mod and mod * card.T.h or card.origsize.h
)
if not mod then
card.origsize = nil
end
remove_all(card.children)
card.children = {}
card.children.shadow = Moveable(0, 0, 0, 0)
card.children = {shadow = Moveable(0, 0, 0, 0)}
card:set_sprites(card.config.center, card.base.id and card.config.card)
if card.area and

View file

@ -134,6 +134,7 @@ function Jane.misprintize_tbl(name, ref_tbl, ref_value, clear, override, stack,
if (type(tbl[k]) ~= "table") or is_number(tbl[k]) then
if is_number(tbl[k]) and not
(k == "x_chips" and not Cryptid) and not
(k == "h_x_chips" and not Cryptid) and not
(k == "id") and not
(k == "colour") and not
(k == "suit_nominal") and not