diff --git a/manifest.json b/manifest.json index 154b12d..ecb4353 100644 --- a/manifest.json +++ b/manifest.json @@ -17,5 +17,5 @@ "conflicts": [ "Jen" ], - "version": "1.6.16" + "version": "1.6.17" } \ No newline at end of file diff --git a/src/edition.lua b/src/edition.lua index 5806a21..724ebef 100644 --- a/src/edition.lua +++ b/src/edition.lua @@ -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 = { diff --git a/src/main.lua b/src/main.lua index 3d6c17c..bb3389e 100644 --- a/src/main.lua +++ b/src/main.lua @@ -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 diff --git a/src/misprintize.lua b/src/misprintize.lua index 6c21d21..52f69aa 100644 --- a/src/misprintize.lua +++ b/src/misprintize.lua @@ -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