加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
joy_token.lua 6.01 KB
一键复制 编辑 原始数据 按行查看 历史
北冰洋T 提交于 2024-03-14 15:06 . update joy_token.lua.
local extension = Package:new("joy_token", Package.CardPack)
Fk:loadTranslationTable{
["joy_token"] = "欢乐杀衍生牌",
}
local U = require "packages/utility/utility"
local siege_engine_slash = fk.CreateViewAsSkill{
name = "joy__siege_engine_slash",
card_filter = Util.FalseFunc,
view_as = function(self, cards)
local card = Fk:cloneCard("slash")
card.skillName = "#joy__siege_engine_skill"
return card
end,
}
Fk:addSkill(siege_engine_slash)
local siegeEngineSkill = fk.CreateTriggerSkill{
name = "#joy__siege_engine_skill",
attached_equip = "joy__siege_engine",
events = {fk.EventPhaseStart, fk.Damage, fk.BeforeCardsMove, fk.TargetSpecified},
can_trigger = function(self, event, target, player, data)
if event == fk.EventPhaseStart then
return target == player and player:hasSkill(self) and player.phase == Player.Play
elseif event == fk.Damage then
return target == player and player:hasSkill(self) and data.card and table.contains(data.card.skillNames, self.name) and
U.damageByCardEffect(player.room) and not data.to.dead and not data.to:isNude()
elseif event == fk.BeforeCardsMove then
if player:getEquipment(Card.SubtypeWeapon) and Fk:getCardById(player:getEquipment(Card.SubtypeWeapon)).name == "joy__siege_engine" and
(player:getMark("joy__xianzhu1") == 0 and player:getMark("joy__xianzhu2") == 0 and player:getMark("joy__xianzhu3") == 0) then
for _, move in ipairs(data) do
return move.from == player.id
end
end
elseif event == fk.TargetSpecified then
return target == player and player:hasSkill(self) and data.card.trueName == "slash" and player:getMark("joy__xianzhu1") > 0
end
end,
on_cost = function(self, event, target, player, data)
if event == fk.EventPhaseStart then
local success, dat = player.room:askForUseActiveSkill(player, "joy__siege_engine_slash", "#joy__siege_engine-invoke", true)
if success then
self.cost_data = dat
return true
end
else
return true
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
if event == fk.EventPhaseStart then
local card = Fk:cloneCard("slash")
card.skillName = self.name
room:useCard{
from = player.id,
tos = table.map(self.cost_data.targets, function(id) return {id} end),
card = card,
extraUse = true,
}
elseif event == fk.Damage then
local cards = room:askForCardsChosen(player, data.to, 1, 1 + player:getMark("joy__xianzhu3"), "he", self.name)
room:throwCard(cards, self.name, data.to, player)
elseif event == fk.BeforeCardsMove then
for _, move in ipairs(data) do
if move.from == player.id and move.toArea ~= Card.Void then
for _, info in ipairs(move.moveInfo) do
if info.fromArea == Card.PlayerEquip and move.moveReason == fk.ReasonDiscard then
if Fk:getCardById(info.cardId, true).name == "joy__siege_engine" then
room:notifySkillInvoked(player, self.name, "defensive")
return true
end
end
end
end
end
elseif event == fk.TargetSpecified then
room:addPlayerMark(room:getPlayerById(data.to), fk.MarkArmorNullified)
data.extra_data = data.extra_data or {}
data.extra_data.siege_engineNullified = data.extra_data.siege_engineNullified or {}
data.extra_data.siege_engineNullified[tostring(data.to)] = (data.extra_data.siege_engineNullified[tostring(data.to)] or 0) + 1
end
end,
refresh_events = {fk.CardUseFinished},
can_refresh = function(self, event, target, player, data)
return data.extra_data and data.extra_data.siege_engineNullified
end,
on_refresh = function(self, event, target, player, data)
local room = player.room
for key, num in pairs(data.extra_data.siege_engineNullified) do
local p = room:getPlayerById(tonumber(key))
if p:getMark(fk.MarkArmorNullified) > 0 then
room:removePlayerMark(p, fk.MarkArmorNullified, num)
end
end
data.siege_engineNullified = nil
end,
}
local siege_engine_targetmod = fk.CreateTargetModSkill{
name = "#joy__siege_engine_targetmod",
distance_limit_func = function(self, player, skill, card, to)
if skill.trueName == "slash_skill" and card and card.trueName == "slash" and player:getMark("joy__xianzhu1") > 0 then
return 999
end
end,
extra_target_func = function(self, player, skill, card)
if skill.trueName == "slash_skill" and card and table.contains(card.skillNames, "#joy__siege_engine_skill") then
return player:getMark("joy__xianzhu2")
end
end,
}
siegeEngineSkill:addRelatedSkill(siege_engine_targetmod)
Fk:addSkill(siegeEngineSkill)
local siegeEngine = fk.CreateWeapon{
name = "&joy__siege_engine",
suit = Card.Spade,
number = 9,
attack_range = 2,
equip_skill = siegeEngineSkill,
}
extension:addCard(siegeEngine)
Fk:loadTranslationTable{
["joy__siege_engine"] = "大攻车",
[":joy__siege_engine"] = "装备牌·武器<br /><b>攻击范围</b>:2<br /><b>武器技能</b>:出牌阶段开始时,你可以视为使用一张【杀】(不计入次数),当此【杀】对目标角色造成伤害后,你弃置其一张牌。"..
"若此牌未升级,则不能被弃置。离开装备区后销毁。<br>升级选项:<br>1.此【杀】无视距离和防具(装备大攻车后的所有【杀】);<br>2.此【杀】可指定目标+1;<br>3.此【杀】造成伤害后弃牌数+1。",
["#joy__siege_engine_skill"] = "大攻车",
["joy__siege_engine_slash"] = "大攻车",
["#joy__siege_engine-invoke"] = "大攻车:你可以视为使用【杀】",
}
return extension
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化