Skip to content

Commit 328d8c2

Browse files
Merge pull request #778 from real-niacat/main
re-add yarnball using new smods probability api
2 parents 3d6c950 + b9e3ba5 commit 328d8c2

File tree

1 file changed

+25
-41
lines changed

1 file changed

+25
-41
lines changed

items/misc_joker.lua

Lines changed: 25 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -10403,7 +10403,7 @@ local yarnball = { -- +1 to all listed probabilities for the highest cat tag lev
1040310403
"Darren_The_Frog",
1040410404
},
1040510405
code = {
10406-
"Lily",
10406+
"Lily Felli",
1040710407
},
1040810408
},
1040910409
object_type = "Joker",
@@ -10420,53 +10420,37 @@ local yarnball = { -- +1 to all listed probabilities for the highest cat tag lev
1042010420
cost = 8,
1042110421
order = 140,
1042210422
demicoloncompat = false,
10423-
config = { extra = { oddsmod = 1 }, immutable = { lasthighest = 0 } },
10424-
loc_vars = function(self, info_queue, card)
10425-
return { vars = { card.ability.extra.oddsmod } }
10426-
end,
10427-
update = function(self, card, dt)
10428-
if G.GAME and G.GAME.tags and card.ability then
10429-
local highest = 0
10430-
for i, tag in pairs(G.GAME.tags) do
10431-
local lvl = tag.ability.level
10432-
if lvl == nil then
10433-
lvl = 1
10434-
end
10435-
10436-
-- print("trying comparison of " .. tostring(lvl) .. " > " .. tostring(highest))
10437-
if tag.key == "tag_cry_cat" and lvl > highest then
10438-
highest = lvl
10439-
-- get highest cat tag level
10440-
-- unfortunately this probably causes lag if you have 2763 cat tags but thats your problem not mine
10441-
end
10442-
end
10443-
10444-
-- print(card.ability.immutable.lasthighest, highest)
10445-
if highest ~= card.ability.immutable.lasthighest then
10446-
for k, v in pairs(G.GAME.probabilities) do
10447-
G.GAME.probabilities[k] = (v - card.ability.immutable.lasthighest) + highest
10448-
-- im not fully sure on this, but we're having fun :)
10449-
10450-
-- i dont even know if you have to iterate through all of them, but this is what oa6 does
10451-
end
10452-
card.ability.immutable.lasthighest = highest
10453-
end
10454-
end
10455-
end,
1045610423
in_pool = function(self)
10457-
local r = false
10424+
if not G.GAME.tags or #G.GAME.tags == 0 then return false end
1045810425
for _, tag in pairs(G.GAME.tags) do
1045910426
if tag.key == "tag_cry_cat" then
10460-
r = true
10427+
return true
1046110428
end
1046210429
end
10463-
return r
10430+
return false
1046410431
end,
10432+
calculate = function(self, card, context)
1046510433

10466-
remove_from_deck = function(self, card, from_debuff)
10467-
for k, v in pairs(G.GAME.probabilities) do
10468-
G.GAME.probabilities[k] = (v - card.ability.immutable.lasthighest)
10434+
if context.mod_probability and not context.blueprint then
10435+
10436+
local highest_cat_lvl = 0
10437+
for _,tag in pairs(G.GAME.tags) do
10438+
local lvl = tag.ability.level
10439+
if highest_cat_lvl < 1 and tag.key == "tag_cry_cat" then
10440+
highest_cat_lvl = 1
10441+
end
10442+
if (lvl and lvl > highest_cat_lvl) then
10443+
highest_cat_lvl = lvl
10444+
end
10445+
10446+
10447+
end
10448+
10449+
return {
10450+
additive.numerator = (additive.numerator or context.numerator) + highest_cat_lvl
10451+
}
1046910452
end
10453+
1047010454
end,
1047110455
}
1047210456

@@ -10902,7 +10886,7 @@ local miscitems = {
1090210886
highfive,
1090310887
sock_and_sock,
1090410888
brokenhome,
10905-
--yarnball,
10889+
yarnball,
1090610890
pizza,
1090710891
pizza_slice,
1090810892
paved_joker,

0 commit comments

Comments
 (0)