2023-04-09 13:35:35 +08:00
|
|
|
-- SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2022-09-15 11:17:13 +08:00
|
|
|
local discardSkill = fk.CreateActiveSkill{
|
|
|
|
name = "discard_skill",
|
|
|
|
card_filter = function(self, to_select, selected)
|
|
|
|
if #selected >= self.num then
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
|
2023-03-20 20:15:24 +08:00
|
|
|
local checkpoint = true
|
2023-04-10 15:55:06 +08:00
|
|
|
local card = Fk:getCardById(to_select)
|
|
|
|
|
|
|
|
local status_skills = Fk:currentRoom().status_skills[ProhibitSkill] or {}
|
|
|
|
for _, skill in ipairs(status_skills) do
|
|
|
|
if skill:prohibitDiscard(Self, card) then
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2023-01-29 18:11:41 +08:00
|
|
|
if not self.include_equip then
|
2023-03-20 20:15:24 +08:00
|
|
|
checkpoint = checkpoint and (Fk:currentRoom():getCardArea(to_select) ~= Player.Equip)
|
2023-01-29 18:11:41 +08:00
|
|
|
end
|
|
|
|
|
2023-04-12 22:28:19 +08:00
|
|
|
if self.pattern and self.pattern ~= "" then
|
2023-04-10 15:55:06 +08:00
|
|
|
checkpoint = checkpoint and (Exppattern:Parse(self.pattern):match(card))
|
2023-03-20 20:15:24 +08:00
|
|
|
end
|
|
|
|
return checkpoint
|
2022-09-15 11:17:13 +08:00
|
|
|
end,
|
2023-02-26 15:01:14 +08:00
|
|
|
min_card_num = function(self) return self.min_num end,
|
|
|
|
max_card_num = function(self) return self.num end,
|
2022-09-15 11:17:13 +08:00
|
|
|
}
|
|
|
|
|
2023-03-14 20:48:08 +08:00
|
|
|
local chooseCardsSkill = fk.CreateActiveSkill{
|
|
|
|
name = "choose_cards_skill",
|
2023-04-04 16:25:37 +08:00
|
|
|
expand_pile = function(self) return self.expand_pile end,
|
2023-04-12 22:28:19 +08:00
|
|
|
card_filter = function(self, to_select, selected)
|
|
|
|
if #selected >= self.num then
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
|
|
|
|
local checkpoint = true
|
|
|
|
local card = Fk:getCardById(to_select)
|
|
|
|
|
|
|
|
if not self.include_equip then
|
|
|
|
checkpoint = checkpoint and (Fk:currentRoom():getCardArea(to_select) ~= Player.Equip)
|
|
|
|
end
|
|
|
|
|
|
|
|
if self.pattern and self.pattern ~= "" then
|
|
|
|
checkpoint = checkpoint and (Exppattern:Parse(self.pattern):match(card))
|
|
|
|
end
|
|
|
|
return checkpoint
|
|
|
|
end,
|
2023-03-14 20:48:08 +08:00
|
|
|
min_card_num = function(self) return self.min_num end,
|
|
|
|
max_card_num = function(self) return self.num end,
|
|
|
|
}
|
|
|
|
|
2022-09-15 11:17:13 +08:00
|
|
|
local choosePlayersSkill = fk.CreateActiveSkill{
|
|
|
|
name = "choose_players_skill",
|
2023-02-26 15:01:14 +08:00
|
|
|
card_filter = function(self, to_select)
|
|
|
|
return self.pattern ~= "" and Exppattern:Parse(self.pattern):match(Fk:getCardById(to_select))
|
2022-09-15 11:17:13 +08:00
|
|
|
end,
|
2023-02-26 15:01:14 +08:00
|
|
|
target_filter = function(self, to_select, selected, cards)
|
|
|
|
if self.pattern ~= "" and #cards == 0 then return end
|
2022-09-15 11:17:13 +08:00
|
|
|
if #selected < self.num then
|
2023-01-29 18:11:41 +08:00
|
|
|
return table.contains(self.targets, to_select)
|
2022-09-15 11:17:13 +08:00
|
|
|
end
|
|
|
|
end,
|
2023-02-26 15:01:14 +08:00
|
|
|
card_num = function(self) return self.pattern ~= "" and 1 or 0 end,
|
|
|
|
min_target_num = function(self) return self.min_num end,
|
|
|
|
max_target_num = function(self) return self.num end,
|
2022-09-15 11:17:13 +08:00
|
|
|
}
|
|
|
|
|
2023-05-13 14:16:09 +08:00
|
|
|
local maxCardsSkill = fk.CreateMaxCardsSkill{
|
|
|
|
name = "max_cards_skill",
|
|
|
|
global = true,
|
|
|
|
correct_func = function(self, player)
|
|
|
|
return player:getMark("AddMaxCards") + player:getMark("AddMaxCards-turn") - player:getMark("MinusMaxCards") - player:getMark("MinusMaxCards-turn")
|
|
|
|
end,
|
|
|
|
}
|
|
|
|
|
2022-09-15 11:17:13 +08:00
|
|
|
AuxSkills = {
|
|
|
|
discardSkill,
|
2023-03-14 20:48:08 +08:00
|
|
|
chooseCardsSkill,
|
2022-09-15 11:17:13 +08:00
|
|
|
choosePlayersSkill,
|
2023-05-13 14:16:09 +08:00
|
|
|
maxCardsSkill,
|
2022-09-15 11:17:13 +08:00
|
|
|
}
|