Restrict Spearmaster use button
This commit is contained in:
parent
9574b532dc
commit
5224985126
2 changed files with 33 additions and 6 deletions
|
|
@ -17,5 +17,5 @@
|
||||||
"conflicts": [
|
"conflicts": [
|
||||||
"Jen"
|
"Jen"
|
||||||
],
|
],
|
||||||
"version": "1.6.9"
|
"version": "1.6.10"
|
||||||
}
|
}
|
||||||
|
|
@ -387,17 +387,44 @@ SMODS.Joker {
|
||||||
cost = Cryptid and 12 or 20,
|
cost = Cryptid and 12 or 20,
|
||||||
rarity = Cryptid and epic or 4,
|
rarity = Cryptid and epic or 4,
|
||||||
Bakery_can_use = function(_, card)
|
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,
|
end,
|
||||||
Bakery_use_button_text = function() return "USE ALL" 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
|
local c = G.pack_cards.cards
|
||||||
|
|
||||||
for i = #c, 1, -1 do
|
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()
|
c[i]:use_consumeable()
|
||||||
SMODS.calculate_context {using_consumeable = true, consumeable = c[i], area = c[i].from_area}
|
SMODS.calculate_context {using_consumeable = true, consumeable = c[i], area = c[i].from_area}
|
||||||
|
local normal = c[i].area ~= G.pack_cards
|
||||||
c[i]:start_dissolve()
|
c[i]:start_dissolve()
|
||||||
|
|
||||||
|
if not normal then
|
||||||
|
G.GAME.pack_choices = G.GAME.pack_choices - 1
|
||||||
|
local _ = G.GAME.pack_choices <= 0 and G.FUNCS.end_consumeable()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
@ -693,8 +720,8 @@ SMODS.Joker {
|
||||||
Bakery_can_use = function(_, card)
|
Bakery_can_use = function(_, card)
|
||||||
return not card.debuff and Jane.can_use()
|
return not card.debuff and Jane.can_use()
|
||||||
end,
|
end,
|
||||||
Bakery_use_joker = function(_, card)
|
Bakery_use_joker = function(self, card)
|
||||||
if card.debuff then
|
if not self:Bakery_can_use(card) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue