diff --git a/manifest.json b/manifest.json index 2d1c7a2..82e3456 100644 --- a/manifest.json +++ b/manifest.json @@ -17,5 +17,5 @@ "conflicts": [ "Jen" ], - "version": "1.0.4" + "version": "1.0.5" } \ No newline at end of file diff --git a/src/edition.lua b/src/edition.lua index 3ac1cb5..a1aed17 100644 --- a/src/edition.lua +++ b/src/edition.lua @@ -7,35 +7,43 @@ SMODS.Edition({ loc_txt = { name = "Polygloss", label = "Polygloss", - text = { + text = Cryptid and { "{C:chips}+#1#{}, {X:chips,C:white}x#2#{} & {X:chips,C:dark_edition}^#3#{} Chips", "{C:mult}+#4#{}, {X:mult,C:white}x#5#{} & {X:mult,C:dark_edition}^#6#{} Mult", - "Generates {C:money}+$#7#", + "{C:money}$#7# {}when scored", + } or { + "{C:chips}+#1#{} & {X:chips,C:white}x#2#{}", + "{C:mult}+#3#{} & {X:mult,C:white}x#4#{}", + "{C:money}$#5# {}when scored", }, }, - config = {chips = 1, mult = 1, x_chips = 1.1, x_mult = 1.1, e_chips = 1.01, e_mult = 1.01, p_dollars = 1}, + config = { + mult = 1, + chips = 1, + x_mult = 1.1, + x_chips = 1.1, + p_dollars = 1, + e_chips = Cryptid and 1.01 or nil, + e_mult = Cryptid and 1.01 or nil, + }, sound = { sound = "jane_e_polygloss", per = 1.2, vol = 0.4, }, weight = 8, - extra_cost = 2, + extra_cost = 4, in_shop = true, shader = "polygloss", apply_to_float = false, loc_vars = function(self) - return { - vars = { - self.config.chips, - self.config.x_chips, - self.config.e_chips, - self.config.mult, - self.config.x_mult, - self.config.e_mult, - self.config.p_dollars, - }, - } + local vars = {self.config.chips, self.config.x_chips} + vars[#vars + 1] = self.config.e_chips + vars[#vars + 1] = self.config.mult + vars[#vars + 1] = self.config.x_mult + vars[#vars + 1] = self.config.e_mult + vars[#vars + 1] = self.config.p_dollars + return {vars = vars} end, calculate = function(_, card, context) if context.pre_joker then @@ -136,7 +144,7 @@ SMODS.Edition({ weight = 0.8, in_shop = true, shader = false, - extra_cost = 12, + extra_cost = 5, apply_to_float = false, get_weight = function(self) return G.GAME.edition_rate * self.weight diff --git a/src/slugcat.lua b/src/slugcat.lua index 8a60e65..3b2742f 100644 --- a/src/slugcat.lua +++ b/src/slugcat.lua @@ -431,42 +431,21 @@ function Card:draw(layer) orig_draw(self, layer) end -local function attunement() - local function polygloss(tbl) - local sum = 0 - - for _, v in pairs(tbl) do - if (v.edition or {}).key == "e_jane_polygloss" then - sum = sum + 1 - end - end - - return sum - end - - if Cryptid then - return 1.001 - end - - local cards = polygloss(G.playing_cards) + polygloss(G.jokers.cards) + polygloss(G.consumeables.cards) - local base = 1.01 - local round = 100 - local expo = cards * 2 - local error_correction = 1e-10 - return math.floor(base ^ expo * round + error_correction) / round -end +local attune = Cryptid and 1.001 or 1.1 SMODS.Joker { key = "saint", atlas = "janesaint", loc_txt = { name = "The Saint{C:jane_RGB}#1#", - text = { - "{C:spectral}#2# {}will {C:attention}not destroy Jokers", - "{C:jane_RGB}#3#{}#4#{X:black,C:jane_RGB,s:1.5}#5#{C:spectral}#6#{C:chips}#7#{}#8#{C:mult}#9#", - "{C:inactive,s:1.25}#10#{C:attention,s:1.25}#11#{C:inactive,s:1.25}#12#{C:inactive}#13#{C:jane_RGB}#14#" .. - (Cryptid and "{C:inactive}" or "{C:inactive,s:0.75}") .. - "#15#", + text = Cryptid and { + "{C:spectral}Ankh and Gateway {}will {C:attention}not destroy Jokers", + "{C:jane_RGB}#2#{}#3#{X:black,C:jane_RGB,s:1.5}#4#{C:spectral}#5#{C:chips}#6#{}#7#{C:mult}#8#", + "{C:inactive,s:1.25}#9#{C:attention,s:1.25}#10#{C:inactive,s:1.25}#11#{C:inactive}#12#", + } or { + "{C:spectral}Ankh {}will {C:attention}not destroy Jokers", + "{C:jane_RGB}#2#{}#3#{C:dark_edition}#4#{}#5#", + "{C:inactive,s:1.25}#6#{C:attention,s:1.25}#7#{C:inactive,s:1.25}#8#{C:inactive}#9#", }, }, config = {extra = {karma = 0, max_karma = Cryptid and 10 or 3}}, @@ -482,22 +461,29 @@ SMODS.Joker { local attuned = karma >= max_karma return { - vars = { + vars = Cryptid and { attuned and " (Attuned)" or "", - Cryptid and "Ankh and Gateway" or "Ankh", attuned and "" or "Attune ", attuned and "" or "after using ", - attuned and (Cryptid and "^^" or "^") .. attunement() or max_karma, - attuned and "" or (Cryptid and " Gateways" or " Ankh or Soul Cards"), + attuned and "^^" .. attune or max_karma, + attuned and "" or " Gateways", attuned and " Chips " or "", attuned and "& " or "", attuned and "Mult" or "", attuned and "" or "[", attuned and "" or karma, attuned and "" or " / " .. max_karma .. "]", - attuned and "(Cannot be debuffed" .. (Cryptid and "" or ", scales with ") or "", - attuned and (Cryptid and "" or "polygloss") or "", - attuned and ")" or "", + attuned and "(Cannot be debuffed)" or "", + } or { + attuned and " (Attuned)" or "", + attuned and "" or "Attune ", + attuned and "Fires on cards with " or "after using ", + attuned and "editions" or max_karma, + attuned and "" or " Ankh or Soul Cards", + attuned and "" or "[", + attuned and "" or karma, + attuned and "" or " / " .. max_karma .. "]", + attuned and "(Cannot be debuffed)" or "", }, } end, @@ -512,32 +498,36 @@ SMODS.Joker { local max_karma = extra.max_karma extra.is_attuned = extra.karma >= max_karma - if extra.karma >= max_karma then + if extra.is_attuned then + card.debuff = false + if card.ability then card.ability.perishable = false card.ability.perish_tally = 1e9 end - card.debuff = false - - if not context.joker_main then + if ({[false] = context.cardarea ~= G.play, [true] = not context.joker_main})[not not Cryptid] then return end - local attune = attunement() + local trigger = ({ + e_holo = {mult_mod = 50}, + e_foil = {chip_mod = 250}, + e_polychrome = {xmult_mod = 2.5}, + e_jane_polygloss = { + colour = G.C.jane_RGB, + sound = "talisman_eeechip", + [Cryptid and "EEchip_mod" or "Echip_mod"] = attune, + [Cryptid and "EEmult_mod" or "Emult_mod"] = attune, + message = (Cryptid and "^^" or "^") .. attune .. " Chips & Mult", + }, + })[Cryptid and "e_jane_polygloss" or ((context.other_card or {}).edition or {}).key] - if attune == 1 then - return + if trigger then + trigger.card = card end - return { - card = card, - colour = G.C.jane_RGB, - sound = "talisman_eeechip", - message = (Cryptid and "^^" or "^") .. attune .. " Chips & Mult", - [Cryptid and "EEchip_mod" or "Echip_mod"] = attune, - [Cryptid and "EEmult_mod" or "Emult_mod"] = attune, - }, true + return trigger end if not (not context.blueprint and