Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
8f52e73
Initial commit
Eremel Jan 11, 2026
1b63781
Merge branch 'main' of https://github.com/Steamopollys/Steamodded int…
Eremel Feb 8, 2026
410d7f4
Fix loading with preflight
Eremel Feb 8, 2026
282be5a
Add support for `pool` to be defined as a table of keys
Eremel Feb 8, 2026
c6a9621
temp commit
Eremel Feb 13, 2026
6711345
Merge https://github.com/Steamopollys/Steamodded into weights
Eremel Mar 7, 2026
3fe4442
Merge https://github.com/Steamopollys/Steamodded into weights
Eremel Mar 8, 2026
7b9e718
Merge https://github.com/Steamopollys/Steamodded into weights
Eremel Mar 8, 2026
379ca25
Update
Eremel Mar 21, 2026
90ccac1
Begin replacing vanilla polling
Eremel Mar 28, 2026
e1ff828
Merge https://github.com/Steamopollys/Steamodded into weights
Eremel Mar 28, 2026
3ab3006
Finish vanilla replacement
Eremel Mar 28, 2026
394eff5
Merge https://github.com/Steamopollys/Steamodded into weights
Eremel Mar 28, 2026
901b042
Add intersecting pools support
Eremel Mar 28, 2026
561b3f5
this shouldn't be here
Eremel Mar 29, 2026
1cc5abc
Add attributes support
Eremel Mar 29, 2026
4d88c26
Initial attributes work
Eremel Mar 29, 2026
2b68dc3
update todo
Eremel Mar 29, 2026
f6c8d54
remove print
Eremel Mar 29, 2026
55ec34c
Add more attributes
Eremel Mar 29, 2026
24816ce
Merge https://github.com/Steamopollys/Steamodded into weights
Eremel Mar 29, 2026
b067669
:)
Eremel Mar 29, 2026
33d2352
Change default behaviour of polling multiple attributes to intersect,…
Eremel Mar 30, 2026
8e88af4
Add `allow_legendaries` flag
Eremel Mar 30, 2026
8bafe39
Attribute pollling respects rarity by default. Add `rarity` value whe…
Eremel Mar 31, 2026
c072750
Add individual rank attributes
Eremel Mar 31, 2026
2a96934
Add support for attributes in `SMODS.create_card`, slight rarity fix
Eremel Mar 31, 2026
97abc5f
Add mod_chance attribute
Eremel Mar 31, 2026
6f83b74
Attempting to register the same attribute key will now merge the keys…
Eremel Mar 31, 2026
44ef334
Add `closest_match` flag to ensure attributes don't reduce the pool t…
Eremel Mar 31, 2026
a3166d6
Add consumable type attributes
Eremel Mar 31, 2026
6605ba7
Clean up
Eremel Mar 31, 2026
093372e
Merge branch 'main' of https://github.com/Steamodded/smods into weights
Eremel Mar 31, 2026
cce8652
missed a debug print
Eremel Mar 31, 2026
596b6a0
Fix `get_pack` ignoring `_type`
Eremel Mar 31, 2026
80fefc8
Fix chance roll being adjusted when it shouldn't
Eremel Mar 31, 2026
2100b33
(:
Eremel Mar 31, 2026
b3ace60
Address wilson
Eremel Mar 31, 2026
28b5fe4
Add passive attribute
Eremel Apr 1, 2026
6ed5463
Add on_sell attribute
Eremel Apr 1, 2026
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
2 changes: 1 addition & 1 deletion lovely/card_limit.toml
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ position = "at"
payload = """local hand_space = e
local cards_to_draw = {}
local space_taken = 0
local limit = G.hand.config.card_limit - #G.hand.cards - (SMODS.cards_to_draw or 0)
local limit = (G.hand.config.card_limit - #G.hand.cards - (SMODS.cards_to_draw or 0))
local flags = SMODS.calculate_context({drawing_cards = true, amount = limit})
limit = flags.cards_to_draw or flags.modify or limit
local unfixed = not G.hand.config.fixed_limit
Expand Down
84 changes: 84 additions & 0 deletions lovely/weights.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
[manifest]
version = "1.0.0"
dump_lua = true
priority = -10

# Bypass get_new_boss()
[[patches]]
[patches.pattern]
target = 'functions/common_events.lua'
match_indent = true
position = 'after'
pattern = '''
function get_new_boss()
'''
payload = '''
-- Use SMODS object weight system when enabled
if SMODS.optional_features.object_weights then return SMODS.poll_object({type = 'Blind'}) end
'''

# Bypass create_card_for_shop()
[[patches]]
[patches.pattern]
target = 'functions/UI_definitions.lua'
match_indent = true
position = 'after'
pattern = '''
function create_card_for_shop(area)
'''
payload = '''
-- Use SMODS object weight system when enabled
if SMODS.optional_features.object_weights then return SMODS.create_shop_card(area) end
'''

# Bypass create_card key selection
[[patches]]
[patches.pattern]
target = 'functions/common_events.lua'
match_indent = true
position = 'before'
pattern = '''
if forced_key and not G.GAME.banned_keys[forced_key] then
'''
payload = '''
-- Use SMODS object weight system when enabled
if not forced_key and SMODS.optional_features.object_weights then forced_key = SMODS.poll_object({type = _type, guaranteed = true}) end

'''

# These patches add functionality for polling blinds, but are a precursor for full support of modded small and big blinds
# TODO: move to blind related toml
# Adjust vanilla blinds max ante property
[[patches]]
[patches.pattern]
target = 'game.lua'
match_indent = true
position = 'before'
pattern = '''
self.b_undiscovered = {name = 'Undiscovered', debuff_text = 'Defeat this blind to discover', pos = {x=0,y=30}}
'''
payload = '''
for key, blind in pairs(self.P_BLINDS) do
if blind.boss and blind.boss.max then
blind.boss.max = nil
if blind.boss.showdown then
blind.boss.min = nil
end
end
if key == 'bl_small' then blind.small = {min = 1} end
if key == 'bl_big' then blind.big = {min = 1} end
end
'''

# Add custom small/big blinds to `G.GAME.bosses_used`
[[patches]]
[patches.pattern]
target = 'game.lua'
match_indent = true
position = 'after'
pattern = '''
if v.boss then bosses_used[k] = 0 end
'''
payload = '''
if v.small or v.big then bosses_used[k] = 0 end
'''
1 change: 1 addition & 0 deletions src/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ for _, path in ipairs {
"src/overrides.lua",
"src/game_object.lua",
"src/compat_0_9_8.lua",
"src/utils/weights.lua"
} do
assert(load(SMODS.NFS.read(SMODS.path..path), ('=[SMODS _ "%s"]'):format(path)))()
end
Expand Down
17 changes: 17 additions & 0 deletions src/game_object.lua
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ Set `prefix_config.key = false` on your object instead.]]):format(obj.key), obj.
-- Checked on __call but not take_ownership. For take_ownership, the key must exist
function SMODS.GameObject:check_duplicate_key()
if self.obj_table[self.key] or (self.get_obj and self:get_obj(self.key)) then
if self.set == 'Attribute' then
SMODS.Attributes[self.key].keys = SMODS.merge_lists({SMODS.Attributes[self.key].keys, self.keys})
return true
end
sendWarnMessage(('Object %s has the same key as an existing object, not registering.'):format(self.key), self.set)
sendWarnMessage('If you want to modify an existing object, use take_ownership()', self.set)
return true
Expand Down Expand Up @@ -389,6 +393,12 @@ Set `prefix_config.key = false` on your object instead.]]):format(obj.key), obj.
end,
}

-------------------------------------------------------------------------------------------------
----- API CODE GameObject.Attribute
-------------------------------------------------------------------------------------------------

assert(load(SMODS.NFS.read(SMODS.path..'src/game_objects/attributes.lua'), ('=[SMODS _ "src/game_objects/attributes.lua"]')))()

-------------------------------------------------------------------------------------------------
----- INTERNAL API CODE GameObject._Loc_Pre
-------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -1188,6 +1198,13 @@ Set `prefix_config.key = false` on your object instead.]]):format(obj.key), obj.
v:inject_card(self)
end
end
if self.attributes then
for _, attribute in ipairs(self.attributes) do
if SMODS.Attributes[attribute] then
SMODS.Attributes[attribute].keys = SMODS.merge_lists({SMODS.Attributes[attribute].keys or {}, {self.key}})
end
end
end
end,
delete = function(self)
G.P_CENTERS[self.key] = nil
Expand Down
Loading