Skip to content
Open
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
29 changes: 22 additions & 7 deletions lib/hooks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1163,8 +1163,11 @@ function create_card(_type, area, legendary, _rarity, skip_materialize, soulable
end
end
if card and card.ability and card.ability.consumeable then
for i, a in pairs(SMODS.get_card_areas('jokers')) do
for _, c in pairs(a.cards) do
local _joker_areas = SMODS.get_card_areas('jokers')
if _joker_areas then
for i, a in pairs(_joker_areas) do
if a.cards then
for _, c in pairs(a.cards) do
if c.config.center.calculate then
local ret = c.config.center:calculate(c, {
get_consumable_type = true,
Expand All @@ -1183,8 +1186,10 @@ function create_card(_type, area, legendary, _rarity, skip_materialize, soulable
break
end
end
end
end
end
end
end
if card and card.ability and card.ability.consumeable then
SMODS.calculate_context{entr_consumable_created = true, other_card = card}
Expand Down Expand Up @@ -2157,14 +2162,19 @@ local add_tagref = add_tag
function add_tag(_tag, ...)
if type(_tag) == "table" then
if not _tag.ability.added_to_deck then
for i, v in pairs(SMODS.get_card_areas('jokers')) do
for a, card in pairs(v.cards) do
local _joker_areas = SMODS.get_card_areas('jokers')
if _joker_areas then
for i, v in pairs(_joker_areas) do
if v.cards then
for a, card in pairs(v.cards) do
local res = card:calculate_joker({tag_create = true, tag = _tag})
if res and res.tag then
_tag = res.tag
end
end
end
end
end
end
add_tagref(_tag, ...)
_tag.ability.added_to_deck = true
Expand Down Expand Up @@ -3119,13 +3129,18 @@ function Cryptid.get_interest(add_rows)
local rate = Cryptid.interest_rate()
local interest = math.min(math.floor(G.GAME.dollars / rate), G.GAME.interest_cap / 5)
interest = interest * G.GAME.interest_amount
for _, a in pairs(SMODS.get_card_areas("jokers")) do
for i, c in pairs(a.cards) do
local _joker_areas = SMODS.get_card_areas("jokers")
if _joker_areas then
for _, a in pairs(_joker_areas) do
if a.cards then
for i, c in pairs(a.cards) do
if c.config.center.cry_calc_interest then
interest = c.config.center:cry_calc_interest(c, interest)
end
end
end
end
end
G.GAME.interest_cap = cap
return interest
end
Expand Down Expand Up @@ -3901,4 +3916,4 @@ function Spectrallib.card_eval_status_text_eq(card, eval_type, amt, percent, dir
return
end
orig_ref(card, eval_type, amt, percent, dir, extra, pref, col, sound, vol, ta)
end
end