FreeKill/packages/standard/aux_skills.lua
notify cd7e4c9bd3 I18n (#57)
* rotate general name when it becomes too long

* remember x and y pos of window

* config.language, and can change translations according to language

* standard i18n (WIP)

* client translation (WIP)

* translation for standard cards

* translate skill name and adjust UI
2023-02-27 10:23:48 +08:00

38 lines
1.1 KiB
Lua

local discardSkill = fk.CreateActiveSkill{
name = "discard_skill",
card_filter = function(self, to_select, selected)
if #selected >= self.num then
return false
end
if not self.include_equip then
return Fk:currentRoom():getCardArea(to_select) ~= Player.Equip
end
return true
end,
min_card_num = function(self) return self.min_num end,
max_card_num = function(self) return self.num end,
}
local choosePlayersSkill = fk.CreateActiveSkill{
name = "choose_players_skill",
card_filter = function(self, to_select)
return self.pattern ~= "" and Exppattern:Parse(self.pattern):match(Fk:getCardById(to_select))
end,
target_filter = function(self, to_select, selected, cards)
if self.pattern ~= "" and #cards == 0 then return end
if #selected < self.num then
return table.contains(self.targets, to_select)
end
end,
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,
}
AuxSkills = {
discardSkill,
choosePlayersSkill,
}