Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions lovely/atlas.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,3 @@ payload = '''
_atlas = G.ASSET_ATLAS[_smods_atlas] or _atlas
end'''

## Hide floating ? from undiscovered types
# Card:draw()
[[patches]]
[patches.pattern]
target = 'card.lua'
pattern = '''shared_sprite:draw_shader('dissolve', nil, nil, nil, self.children.center, scale_mod, rotate_mod)'''
position = 'at'
match_indent = true
payload = '''
if (self.config.center.undiscovered and not self.config.center.undiscovered.no_overlay) or not( SMODS.UndiscoveredSprites[self.ability.set] and SMODS.UndiscoveredSprites[self.ability.set].no_overlay) then
shared_sprite:draw_shader('dissolve', nil, nil, nil, self.children.center, scale_mod, rotate_mod)
else
if SMODS.UndiscoveredSprites[self.ability.set] and SMODS.UndiscoveredSprites[self.ability.set].overlay_sprite then
SMODS.UndiscoveredSprites[self.ability.set].overlay_sprite:draw_shader('dissolve', nil, nil, nil, self.children.center, scale_mod, rotate_mod)
end
end'''
41 changes: 0 additions & 41 deletions lovely/center.toml
Original file line number Diff line number Diff line change
Expand Up @@ -466,47 +466,6 @@ payload = '''
end
'''

# Card:draw()
[[patches]]
[patches.pattern]
target = 'card.lua'
pattern = '--If the card has any edition/seal, add that here'
position = 'before'
match_indent = true
payload = '''
local center = self.config.center
if center.draw and type(center.draw) == 'function' then
center:draw(self, layer)
end
if center.set == 'Default' or center.set == 'Enhanced' and not center.replace_base_card then
if not center.no_suit then
local suit = SMODS.Suits[self.base.suit] or {}
if suit.draw and type(suit.draw) == 'function' then
suit:draw(self, layer)
end
end
if not center.no_rank then
local rank = SMODS.Ranks[self.base.value] or {}
if rank.draw and type(rank.draw) == 'function' then
rank:draw(self, layer)
end
end
end
'''

[[patches]]
[patches.pattern]
target = 'card.lua'
pattern = 'if self.seal then'
position = 'at'
match_indent = true
payload = '''
local seal = G.P_SEALS[self.seal or {}] or {}
if type(seal.draw) == 'function' then
seal:draw(self, layer)
elseif self.seal then
'''

# no_blueprint check
[[patches]]
[patches.pattern]
Expand Down
108 changes: 0 additions & 108 deletions lovely/edition.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,114 +93,6 @@ for _, v in ipairs(G.P_CENTER_POOLS.Edition) do
G.BADGE_COL[v.key:sub(3)] = v.badge_colour
end'''

# Limit ARGS.send_to_shader[1] to wiggle between 0 and 2 instead of growing infinitely
# this makes shaders responsiveness on tilt reliable over time
# Card:draw()
[[patches]]
[patches.regex]
target = "card.lua"
pattern = '''
G\.TIMERS\.REAL/\(28\)'''
position = "at"
payload = '''math.sin(G.TIMERS.REAL/28) + 1'''

# Allow editions to not draw shadow
# Card:draw()
[[patches]]
[patches.regex]
target = "card.lua"
pattern = '''
self\.ability\.effect ~= 'Glass Card' and not self\.greyed'''
position = "after"
payload = ''' and self:should_draw_shadow() '''

# If shader modifies shape of card, this will stop "back" layer of the card being rendered.
# Card:draw()
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = '''
elseif not self.greyed then'''
position = "before"
payload = '''
elseif not self:should_draw_base_shader() then
-- Don't render base dissolve shader.
'''
match_indent = true

# If shader modifies shape of card, this will stop "back" layer of the card being rendered.
# spectral cards and booster packs only.
# Card:draw()
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = '''
if self.ability.set == 'Booster' or self.ability.set == 'Spectral' then'''
position = "at"
payload = '''
if (self.ability.set == 'Booster' or self.ability.set == 'Spectral') and self:should_draw_base_shader() then'''
match_indent = true

# If shader modifies shape of card, this will stop "back" layer of the card being rendered.
# invisible joker and vouchers.
# Card:draw()
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = '''
self.children.center:draw_shader('voucher', nil, self.ARGS.send_to_shader)'''
position = "at"
payload = '''
if self:should_draw_base_shader() then
self.children.center:draw_shader('voucher', nil, self.ARGS.send_to_shader)
end'''
match_indent = true

# Inject shaders applying to cards
# Card:draw()
[[patches]]
[patches.regex]
target = "card.lua"
pattern = '''
(?<indent>[\t ]*)if self\.edition and self\.editi[A-z\.\:\n\t _(',)~=]*me', nil, self.ARGS.send_to_shader\)
[\t ]*end
[\t ]*end'''
position = "at"
payload = '''
if self.edition then
for k, v in pairs(G.P_CENTER_POOLS.Edition) do
if self.edition[v.key:sub(3)] and v.shader then
if type(v.draw) == 'function' then
v:draw(self, layer)
else
self.children.center:draw_shader(v.shader, nil, self.ARGS.send_to_shader)
if self.children.front and self.ability.effect ~= 'Stone Card' and not self.config.center.replace_base_card then
self.children.front:draw_shader(v.shader, nil, self.ARGS.send_to_shader)
end
end
end
end
end'''
line_prepend = "$indent"

# Inject shaders applying to floating sprites
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "self.children.floating_sprite:draw_shader('dissolve', nil, nil, nil, self.children.center, scale_mod, rotate_mod)"
position = "after"
payload = '''
if self.edition then
for k, v in pairs(G.P_CENTER_POOLS.Edition) do
if v.apply_to_float then
if self.edition[v.key:sub(3)] then
self.children.floating_sprite:draw_shader(v.shader, nil, nil, nil, self.children.center, scale_mod, rotate_mod)
end
end
end
end'''
match_indent = true

# Remove prefix from shader key when calling send()
[[patches]]
[patches.pattern]
Expand Down
11 changes: 0 additions & 11 deletions lovely/enhancement.toml
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,6 @@ payload = """if not SMODS.has_no_suit(scoring_hand[i]) then
G.GAME.cards_played[scoring_hand[i].base.value].suits[scoring_hand[i].base.suit] = true
end"""


## replace_base_card
# Determines whether to draw the base card's front or not
# Card:draw()
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "if self.children.front and self.ability.effect ~= 'Stone Card' then"
match_indent = true
position = "at"
payload = "if self.children.front and (self.ability.delayed or (self.ability.effect ~= 'Stone Card' and not self.config.center.replace_base_card)) then"
# Add the delayed property to sprites that are delayed
[[patches]]
[patches.pattern]
Expand Down
25 changes: 0 additions & 25 deletions lovely/fixes.toml
Original file line number Diff line number Diff line change
Expand Up @@ -467,31 +467,6 @@ pattern = "for _, v in pairs(G.I.SPRITE) do"
position = "at"
payload = 'for k, v in pairs(G.I.SPRITE) do'

##
## Card:draw() - improved mod compatibility
##
# Add option for sprites to not be drawn
[[patches]]
[patches.pattern]
target = "card.lua"
match_indent = true
pattern = '''
if k ~= 'focused_ui' and k ~= "front" and k ~= "back" and k ~= "soul_parts" and k ~= "center" and k ~= 'floating_sprite' and k~= "shadow" and k~= "use_button" and k ~= 'buy_button' and k ~= 'buy_and_use_button' and k~= "debuff" and k ~= 'price' and k~= 'particles' and k ~= 'h_popup' then v:draw() end'''
position = "at"
payload = '''
if not v.custom_draw and k ~= 'focused_ui' and k ~= "front" and k ~= "back" and k ~= "soul_parts" and k ~= "center" and k ~= 'floating_sprite' and k~= "shadow" and k~= "use_button" and k ~= 'buy_button' and k ~= 'buy_and_use_button' and k~= "debuff" and k ~= 'price' and k~= 'particles' and k ~= 'h_popup' then v:draw() end'''

# This check is not necessary?
[[patches]]
[patches.pattern]
target = "card.lua"
match_indent = true
pattern = '''
if self.edition or self.seal or self.ability.eternal or self.ability.rental or self.ability.perishable or self.sticker or ((self.sticker_run and self.sticker_run ~= 'NONE') and G.SETTINGS.run_stake_stickers) or (self.ability.set == 'Spectral') or self.debuff or self.greyed or (self.ability.name == 'The Soul') or (self.ability.set == 'Voucher') or (self.ability.set == 'Booster') or self.config.center.soul_pos or self.config.center.demo then'''
position = "at"
payload = '''
if true then'''

## Make vanilla enhancement jokers work with extra enhancements

# Steel Joker
Expand Down
21 changes: 0 additions & 21 deletions lovely/sticker.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,27 +88,6 @@ position = "at"
match_indent = true
payload = '''if G.GAME.modifiers.enable_rentals_in_shop and pseudorandom((area == G.pack_cards and 'packssjr' or 'ssjr')..G.GAME.round_resets.ante) > 0.7 and not SMODS.Stickers["rental"].should_apply then'''

# Card:draw()
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = '''if self.ability.name == 'The Soul' and (self.config.center.discovered or self.bypass_discovery_center) then'''
match_indent = true
position = "before"
payload = '''
for k, v in pairs(SMODS.Stickers) do
if self.ability[v.key] then
if v and v.draw and type(v.draw) == 'function' then
v:draw(self, layer)
else
G.shared_stickers[v.key].role.draw_major = self
G.shared_stickers[v.key]:draw_shader('dissolve', nil, nil, nil, self.children.center)
G.shared_stickers[v.key]:draw_shader('voucher', nil, self.ARGS.send_to_shader, nil, self.children.center)
end
end
end
'''

# get_badge_colour()
[[patches]]
[patches.pattern]
Expand Down
Loading