Restrict Spearmaster use button
This commit is contained in:
parent
9574b532dc
commit
2d7cf24aa6
2 changed files with 27 additions and 6 deletions
|
|
@ -17,5 +17,5 @@
|
|||
"conflicts": [
|
||||
"Jen"
|
||||
],
|
||||
"version": "1.6.9"
|
||||
"version": "1.6.10"
|
||||
}
|
||||
|
|
@ -387,14 +387,35 @@ SMODS.Joker {
|
|||
cost = Cryptid and 12 or 20,
|
||||
rarity = Cryptid and epic or 4,
|
||||
Bakery_can_use = function(_, card)
|
||||
return not card.debuff and Jane.can_use() and G.pack_cards and G.pack_cards.cards and next(G.pack_cards.cards)
|
||||
if card.debuff or not
|
||||
Jane.can_use() or not
|
||||
((G.pack_cards or {}).cards or {})[1] then
|
||||
return false
|
||||
end
|
||||
|
||||
local ret = false
|
||||
|
||||
for _, v in pairs(G.pack_cards.cards) do
|
||||
if v.jane_spearmaster then
|
||||
return false
|
||||
elseif ((v.ability or {}).consumeable or {}).hand_type then
|
||||
ret = true
|
||||
end
|
||||
end
|
||||
|
||||
return ret
|
||||
end,
|
||||
Bakery_use_button_text = function() return "USE ALL" end,
|
||||
Bakery_use_joker = function()
|
||||
Bakery_use_joker = function(self, card)
|
||||
if not self:Bakery_can_use(card) then
|
||||
return
|
||||
end
|
||||
|
||||
local c = G.pack_cards.cards
|
||||
|
||||
for i = #c, 1, -1 do
|
||||
if (((c[i] or {}).ability or {}).consumeable or {}).hand_type then
|
||||
if ((c[i].ability or {}).consumeable or {}).hand_type then
|
||||
c[i].jane_spearmaster = true
|
||||
c[i]:use_consumeable()
|
||||
SMODS.calculate_context {using_consumeable = true, consumeable = c[i], area = c[i].from_area}
|
||||
c[i]:start_dissolve()
|
||||
|
|
@ -693,8 +714,8 @@ SMODS.Joker {
|
|||
Bakery_can_use = function(_, card)
|
||||
return not card.debuff and Jane.can_use()
|
||||
end,
|
||||
Bakery_use_joker = function(_, card)
|
||||
if card.debuff then
|
||||
Bakery_use_joker = function(self, card)
|
||||
if not self:Bakery_can_use(card) then
|
||||
return
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue