Skip to content

Commit

Permalink
fix quantum enhancements copying editions/seals
Browse files Browse the repository at this point in the history
  • Loading branch information
MathIsFun0 committed Dec 28, 2024
1 parent a6e80f8 commit c284e63
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lovely/enhancement.toml
Original file line number Diff line number Diff line change
Expand Up @@ -411,4 +411,13 @@ target = "functions/state_events.lua"
pattern = "if cards_destroyed[i].ability.name == 'Glass Card' then"
position = "at"
payload = "if SMODS.has_enhancement(cards_destroyed[i], 'm_glass') then"
match_indent = true

# Prevent blue seals from applying on quantum enhancement calc
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "if self.seal == 'Blue' and #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then"
position = "at"
payload = "if self.seal == 'Blue' and #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit and not self.ability.extra_enhancement then"
match_indent = true
8 changes: 8 additions & 0 deletions src/overrides.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1601,6 +1601,7 @@ end

local cge = Card.get_edition
function Card:get_edition()
if self.ability.extra_enhancement then return end
local ret = cge(self)
if self.edition and self.edition.key then
local ed = SMODS.Centers[self.edition.key]
Expand Down Expand Up @@ -2118,4 +2119,11 @@ function Card:get_chip_bonus()
if self.debuff then return 0 end
return self.ability.bonus + (self.ability.perma_bonus or 0)
end

-- prevent quantum enhacements from applying seal effects
local ccs = Card.calculate_seal
function Card:calculate_seal(context)
if self.ability.extra_enhancement then return end
return ccs(self, context)
end
--#endregion

0 comments on commit c284e63

Please sign in to comment.