代码拉取完成,页面将自动刷新
local extension = Package:new("LOLex")
extension.extensionName = "MahjongSoul"
Fk:loadTranslationTable {
["LOLex"] = "雀魂-模式专属",
["wxhl"] = "无限火力",
}
local H = require "packages/hegemony/util"
local U = require "packages/utility/utility"
local hainiuafu = General(extension, "wxhl__hainiuafu", "qun", 4)
hainiuafu.hidden = true
local sw_jiqiong = fk.CreateTriggerSkill {
name = "sw_jiqiong",
events = { fk.GameStart },
frequency = Skill.Compulsory,
anim_type = "offensive",
can_trigger = function(self, event, target, player, data)
return player:hasSkill(self.name) and player:usedSkillTimes(self.name, Player.HistoryGame) == 0
end,
on_use = function(self, event, target, player, data)
local room = player.room
for _, p in ipairs(room.alive_players) do
local x = 4 - p.maxHp
if p.maxHp < 4 and p.role ~= "lord" then
room:changeMaxHp(p, x)
end
room:recover { num = p.maxHp - p.hp, skillName = self.name, who = p, recoverBy = p }
local skills = {}
for _, s in ipairs(p.player_skills) do
if not (s.attached_equip or s.name[#s.name] == "&") then
table.insertIfNeed(skills, s.name)
table.removeOne(skills, "sw_huoli")
table.removeOne(skills, "sw_jiqiong")
end
end
if room.settings.gameMode == "mj_1v2_mode" and p.role == "lord" then
table.removeOne(skills, "mj_feiyang")
table.removeOne(skills, "mj_bahu")
end
if #skills > 0 then
room:handleAddLoseSkills(p, "-" .. table.concat(skills, "|-"), nil, true, false)
end
local cardIds = {}
for _, ids in pairs(p.special_cards) do
table.insertTable(cardIds, ids)
end
room:moveCards({
from = p.id,
ids = cardIds,
toArea = Card.DiscardPile,
moveReason = fk.ReasonPutIntoDiscardPile,
skillName = self.name,
})
p:throwAllMarks()
end
end,
}
-- local sw_jiqiong_tar = fk.CreateTriggerSkill {
-- name = "#sw_jiqiong_tar",
-- events = { fk.RoundEnd },
-- frequency = Skill.Compulsory,
-- anim_type = "offensive",
-- can_trigger = function(self, event, target, player, data)
-- return player:hasSkill(self.name)
-- end,
-- on_use = function(self, event, target, player, data)
-- local room = player.room
-- for _, p in ipairs(room.alive_players) do
-- local skills = {}
-- for _, s in ipairs(p.player_skills) do
-- if not (s.attached_equip or s.name[#s.name] == "&") then
-- table.insertIfNeed(skills, s.name)
-- table.removeOne(skills, "sw_jiqiong")
-- table.removeOne(skills, "sw_huoli&")
-- table.removeOne(skills, "sw_huoli")
-- end
-- end
-- if room.settings.gameMode == "mj_1v2_mode" and p.role == "lord" then
-- table.removeOne(skills, "mj_feiyang")
-- table.removeOne(skills, "mj_bahu")
-- end
-- if #skills > 0 then
-- room:handleAddLoseSkills(p, "-" .. table.concat(skills, "|-"), nil, true, false)
-- end
-- local cardIds = {}
-- for _, ids in pairs(p.special_cards) do
-- table.insertTable(cardIds, ids)
-- end
-- room:moveCards({
-- from = p.id,
-- ids = cardIds,
-- toArea = Card.DiscardPile,
-- moveReason = fk.ReasonPutIntoDiscardPile,
-- skillName = self.name,
-- })
-- p:throwAllMarks()
-- end
-- end,
-- }
local sw_jiqiong_target = fk.CreateTriggerSkill {
name = "#sw_jiqiong_target",
refresh_events = { fk.GameStart, fk.EventAcquireSkill, fk.EventLoseSkill, fk.Deathed },
can_refresh = function(self, event, target, player, data)
if event == fk.GameStart then
return player:hasSkill(self.name, true)
elseif event == fk.EventAcquireSkill or event == fk.EventLoseSkill then
return data == self and
not table.find(player.room:getOtherPlayers(player), function(p) return p:hasSkill("sw_huoli", true) end)
else
return target == player and player:hasSkill(self.name, true, true) and
not table.find(player.room:getOtherPlayers(player), function(p) return p:hasSkill("sw_huoli", true) end)
end
end,
on_refresh = function(self, event, target, player, data)
local room = player.room
if event == fk.GameStart or event == fk.EventAcquireSkill then
if player:hasSkill(self.name, true) then
for _, p in ipairs(room:getOtherPlayers(player)) do
room:handleAddLoseSkills(p, "sw_huoli&", nil, false, true)
end
end
elseif event == fk.EventLoseSkill or event == fk.Deathed then
for _, p in ipairs(room:getOtherPlayers(player)) do
room:handleAddLoseSkills(p, "-sw_huoli&", nil, false, true)
end
end
end,
}
-- sw_jiqiong:addRelatedSkill(sw_jiqiong_tar)
sw_jiqiong:addRelatedSkill(sw_jiqiong_target)
hainiuafu:addSkill(sw_jiqiong)
Fk:loadTranslationTable {
["sw_jiqiong"] = "技穷",
["#sw_jiqiong_tar"] = "技穷",
[":sw_jiqiong"] = "锁定技,游戏开始,你令所有角色将体力调整至3点,然后失去所有技能;每轮开始时,所有角色随机获得两个技能;每轮结束时,所有角色失去本轮获得的技能",
}
local sw_huoli_acit = fk.CreateTriggerSkill {
name = "sw_huoli&",
frequency = Skill.Compulsory,
mute = true,
events = { fk.RoundStart },
can_trigger = function(self, event, target, player, data)
return player:hasSkill(self.name)
end,
on_use = function(self, event, target, player, data)
local room = player.room
if player.room:getTag("RoundCount") == 1 then
local skills = {}
for _, general in ipairs(Fk:getAllGenerals()) do
for _, skill in ipairs(general.skills) do
local str = Fk:translate(":" .. skill.name)
if not player:hasSkill(skill) and string.find(str, "锁定技") and not string.find(str, "宗族技") and not string.find(str, "觉醒技") and not string.find(str, "体力上限") and not string.find(str, "游戏开始时") and not string.find(str, "使命技") and not string.find(str, "蓄力技") and not string.find(str, "灵能") and not string.find(str, "限定技") and not string.find(str, "主公技") then
table.insertIfNeed(skills, skill.name)
end
end
end
if #skills > 0 then
local skill = table.random(skills, 1)
local skillss = table.concat(skill, "|")
room:handleAddLoseSkills(player, skillss, nil, true, false)
end
local skills2 = {}
for _, general in ipairs(Fk:getAllGenerals()) do
for _, skill2 in ipairs(general.skills) do
local str = Fk:translate(":" .. skill2.name)
if not player:hasSkill(skill2) and string.find(str, "每回合限一次") and not string.find(str, "宗族技") and not string.find(str, "觉醒技") and not string.find(str, "体力上限") and not string.find(str, "游戏开始时") and not string.find(str, "使命技") and not string.find(str, "蓄力技") and not string.find(str, "灵能") and not string.find(str, "限定技") and not string.find(str, "主公技") then
table.insertIfNeed(skills2, skill2.name)
end
end
end
if #skills2 > 0 then
local skill2 = table.random(skills2, 1)
local skillss2 = table.concat(skill2, "|")
room:handleAddLoseSkills(player, skillss2, nil, true, false)
end
elseif player.room:getTag("RoundCount") == 2 or player.room:getTag("RoundCount") == 3 then
local skills = {}
for _, general in ipairs(Fk:getAllGenerals()) do
for _, skill in ipairs(general.skills) do
local str = Fk:translate(":" .. skill.name)
if not player:hasSkill(skill) and string.find(str, "出牌阶段限") and not string.find(str, "宗族技") and not string.find(str, "觉醒技") and not string.find(str, "体力上限") and not string.find(str, "游戏开始时") and not string.find(str, "使命技") and not string.find(str, "蓄力技") and not string.find(str, "灵能") and not string.find(str, "限定技") and not string.find(str, "主公技") then
table.insertIfNeed(skills, skill.name)
end
end
end
if #skills > 0 then
local skill = table.random(skills, 1)
local skillss = table.concat(skill, "|")
room:handleAddLoseSkills(player, skillss, nil, true, false)
end
elseif player.room:getTag("RoundCount") == 4 then
local skills = {}
for _, general in ipairs(Fk:getAllGenerals()) do
for _, skill in ipairs(general.skills) do
local str = Fk:translate(":" .. skill.name)
if not player:hasSkill(skill) and string.find(str, "限定技") and not string.find(str, "宗族技") and not string.find(str, "觉醒技") and not string.find(str, "体力上限") and not string.find(str, "游戏开始时") and not string.find(str, "使命技") and not string.find(str, "蓄力技") and not string.find(str, "灵能") and not string.find(str, "主公技") then
table.insertIfNeed(skills, skill.name)
end
end
end
if #skills > 0 then
local skill = table.random(skills, 1)
local skillss = table.concat(skill, "|")
room:handleAddLoseSkills(player, skillss, nil, true, false)
end
elseif player.room:getTag("RoundCount") > 4 then
local skills = {}
for _, general in ipairs(Fk:getAllGenerals()) do
for _, skill in ipairs(general.skills) do
local str = Fk:translate(":" .. skill.name)
if not player:hasSkill(skill) and not string.find(str, "觉醒技") and not string.find(str, "宗族技") and not string.find(str, "体力上限") and not string.find(str, "游戏开始时") and not string.find(str, "使命技") and not string.find(str, "蓄力技") and not string.find(str, "灵能") and not string.find(str, "限定技") and not string.find(str, "主公技") then
table.insertIfNeed(skills, skill.name)
end
end
end
if #skills > 0 then
local skill = table.random(skills, 1)
local skillss = table.concat(skill, "|")
room:handleAddLoseSkills(player, skillss, nil, true, false)
end
end
end
}
local sw_huoli = fk.CreateTriggerSkill {
name = "sw_huoli",
frequency = Skill.Compulsory,
mute = true,
events = { fk.RoundStart },
can_trigger = function(self, event, target, player, data)
return player:hasSkill(self.name)
end,
on_use = function(self, event, target, player, data)
local room = player.room
if player.room:getTag("RoundCount") == 1 then
local skills = {}
for _, general in ipairs(Fk:getAllGenerals()) do
for _, skill in ipairs(general.skills) do
local str = Fk:translate(":" .. skill.name)
if not player:hasSkill(skill) and string.find(str, "锁定技") and not string.find(str, "宗族技") and not string.find(str, "觉醒技") and not string.find(str, "体力上限") and not string.find(str, "游戏开始时") and not string.find(str, "使命技") and not string.find(str, "蓄力技") and not string.find(str, "灵能") and not string.find(str, "限定技") and not string.find(str, "主公技") then
table.insertIfNeed(skills, skill.name)
end
end
end
if #skills > 0 then
local skill = table.random(skills, 1)
local skillss = table.concat(skill, "|")
room:handleAddLoseSkills(player, skillss, nil, true, false)
end
local skills2 = {}
for _, general in ipairs(Fk:getAllGenerals()) do
for _, skill2 in ipairs(general.skills) do
local str = Fk:translate(":" .. skill2.name)
if not player:hasSkill(skill2) and string.find(str, "每回合限一次") and not string.find(str, "宗族技") and not string.find(str, "觉醒技") and not string.find(str, "体力上限") and not string.find(str, "游戏开始时") and not string.find(str, "使命技") and not string.find(str, "蓄力技") and not string.find(str, "灵能") and not string.find(str, "限定技") and not string.find(str, "主公技") then
table.insertIfNeed(skills2, skill2.name)
end
end
end
if #skills2 > 0 then
local skill2 = table.random(skills2, 1)
local skillss2 = table.concat(skill2, "|")
room:handleAddLoseSkills(player, skillss2, nil, true, false)
end
elseif player.room:getTag("RoundCount") == 2 or player.room:getTag("RoundCount") == 3 then
local skills = {}
for _, general in ipairs(Fk:getAllGenerals()) do
for _, skill in ipairs(general.skills) do
local str = Fk:translate(":" .. skill.name)
if not player:hasSkill(skill) and string.find(str, "出牌阶段限") and not string.find(str, "宗族技") and not string.find(str, "觉醒技") and not string.find(str, "体力上限") and not string.find(str, "游戏开始时") and not string.find(str, "使命技") and not string.find(str, "蓄力技") and not string.find(str, "灵能") and not string.find(str, "限定技") and not string.find(str, "主公技") then
table.insertIfNeed(skills, skill.name)
end
end
end
if #skills > 0 then
local skill = table.random(skills, 1)
local skillss = table.concat(skill, "|")
room:handleAddLoseSkills(player, skillss, nil, true, false)
end
elseif player.room:getTag("RoundCount") == 4 then
local skills = {}
for _, general in ipairs(Fk:getAllGenerals()) do
for _, skill in ipairs(general.skills) do
local str = Fk:translate(":" .. skill.name)
if not player:hasSkill(skill) and string.find(str, "限定技") and not string.find(str, "宗族技") and not string.find(str, "觉醒技") and not string.find(str, "体力上限") and not string.find(str, "游戏开始时") and not string.find(str, "使命技") and not string.find(str, "蓄力技") and not string.find(str, "灵能") and not string.find(str, "主公技") then
table.insertIfNeed(skills, skill.name)
end
end
end
if #skills > 0 then
local skill = table.random(skills, 1)
local skillss = table.concat(skill, "|")
room:handleAddLoseSkills(player, skillss, nil, true, false)
end
elseif player.room:getTag("RoundCount") > 4 then
local skills = {}
for _, general in ipairs(Fk:getAllGenerals()) do
for _, skill in ipairs(general.skills) do
local str = Fk:translate(":" .. skill.name)
if not player:hasSkill(skill) and not string.find(str, "觉醒技") and not string.find(str, "宗族技") and not string.find(str, "体力上限") and not string.find(str, "游戏开始时") and not string.find(str, "使命技") and not string.find(str, "蓄力技") and not string.find(str, "灵能") and not string.find(str, "限定技") and not string.find(str, "主公技") then
table.insertIfNeed(skills, skill.name)
end
end
end
if #skills > 0 then
local skill = table.random(skills, 1)
local skillss = table.concat(skill, "|")
room:handleAddLoseSkills(player, skillss, nil, true, false)
end
end
end
}
Fk:loadTranslationTable {
["sw_huoli"] = "火力",
[":sw_huoli"] = "锁定技,按轮次随机获得技能;首轮开始时,获得一个锁定技和一个每回合限一次的技能;第二/三个轮开始时,获得一个出牌阶段可用的技能;第四轮开始时,获得一个限定技,第五轮后,每轮随机获得一个常规技能",
["sw_huoli&"] = "火力",
[":sw_huoli&"] = "锁定技,按轮次随机获得技能;首轮开始时,获得一个锁定技和一个每回合限一次的技能;第二/三个轮开始时,获得一个出牌阶段可用的技能;第四轮开始时,获得一个限定技,第五轮后,每轮随机获得一个常规技能",
}
hainiuafu:addSkill(sw_huoli)
Fk:addSkill(sw_huoli_acit)
Fk:loadTranslationTable {
["wxhl__hainiuafu"] = "阿福",
}
local sss = fk.CreateTargetModSkill { --场上受伤角色大于2时,出牌阶段额外一张杀
name = "sss",
residue_func = function(self, player, skill, scope, card)
local n = 0
for _, p in ipairs(Fk:currentRoom().alive_players) do
if p:isWounded() then
n = n + 1
end
end
if n > 2 and player:hasSkill(self.name) and card.trueName == "slash" and scope == Player.HistoryPhase then
return 1
else
return 0
end
end
}
-- local daqiao = General(extension, "sww__daqiao", "wu", 3, 3, General.Female)
-- local sw_guose = fk.CreateViewAsSkill {
-- name = "sw_guose",
-- anim_type = "control",
-- pattern = "indulgence",
-- card_filter = function(self, to_select, selected)
-- return #selected == 0 and Fk:getCardById(to_select).color == Card.Red
-- end,
-- view_as = function(self, cards)
-- if #cards ~= 1 then return nil end
-- local c = Fk:cloneCard("indulgence")
-- c.skillName = self.name
-- c:addSubcard(cards[1])
-- return c
-- end,
-- }
-- local sw_guose_trigger = fk.CreateTriggerSkill {
-- name = "#sw_guose_trigger",
-- events = { fk.CardUseFinished, fk.EventPhaseStart },
-- mute = true,
-- can_trigger = function(self, event, target, player, data)
-- if event == fk.CardUseFinished then
-- if player:hasSkill(self) and target == player and table.contains(data.card.skillNames, "sw_guose") then
-- for _, pid in ipairs(TargetGroup:getRealTargets(data.tos)) do
-- local p = player.room:getPlayerById(pid)
-- if not p.dead then
-- return true
-- end
-- end
-- end
-- else
-- return player:hasSkill(self) and target ~= player and target.phase == Player.Judge and
-- #target:getCardIds("j") > 0 and #target:getCardIds("h") > 1
-- end
-- end,
-- on_cost = function(self, event, target, player, data)
-- if event == fk.CardUseFinished then return true end
-- local cards = player.room:askForCard(target, 2, 2, false, self.name, true, ".", "#sw_guose-ask:" .. player.id)
-- if #cards == 2 then
-- self.cost_data = cards
-- return true
-- end
-- end,
-- on_use = function(self, event, target, player, data)
-- local room = player.room
-- if event == fk.CardUseFinished then
-- for _, pid in ipairs(TargetGroup:getRealTargets(data.tos)) do
-- local p = room:getPlayerById(pid)
-- if not p.dead then
-- if data.card.suit == Card.Heart and p:isWounded() then
-- room:recover { num = 1, skillName = sw_guose.name, who = p, recoverBy = player }
-- elseif data.card.suit == Card.Diamond then
-- p:drawCards(2, sw_guose.name)
-- end
-- end
-- end
-- else
-- room:notifySkillInvoked(player, sw_guose.name)
-- player:broadcastSkillInvoke(sw_guose.name)
-- local dummy = Fk:cloneCard("dilu")
-- dummy:addSubcards(self.cost_data)
-- room:obtainCard(player, dummy, false, fk.ReasonGive)
-- if target.dead or #target:getCardIds("j") == 0 then return end
-- local card = room:askForCardChosen(target, target, "j", self.name)
-- room:obtainCard(target, card, true, fk.ReasonPrey)
-- end
-- end,
-- }
-- sw_guose:addRelatedSkill(sw_guose_trigger)
-- daqiao:addSkill(sw_guose)
-- local sw_wanrong = fk.CreateTriggerSkill {
-- name = "sw_wanrong",
-- anim_type = "defensive",
-- events = { fk.TargetConfirming },
-- can_trigger = function(self, event, target, player, data)
-- return target == player and player:hasSkill(self) and data.card.trueName == "slash" and not player:isNude()
-- end,
-- on_cost = function(self, event, target, player, data)
-- local room = player.room
-- local targets = {}
-- local from = room:getPlayerById(data.from)
-- local duel = Fk:cloneCard("duel")
-- for _, p in ipairs(room:getOtherPlayers(player)) do
-- if U.canTransferTarget(p, data) then
-- table.insert(targets, p.id)
-- end
-- end
-- if #targets == 0 then return false end
-- local tos, cid = room:askForChooseCardAndPlayers(player, targets, 1, 1, nil, "#sw_wanrong", self.name, true)
-- if #tos > 0 then
-- self.cost_data = { tos[1], cid }
-- return true
-- end
-- end,
-- on_use = function(self, event, target, player, data)
-- local room = player.room
-- local to = room:getPlayerById(self.cost_data[1])
-- room:obtainCard(to, self.cost_data[2], false, fk.ReasonGive)
-- AimGroup:addTargets(room, data, { to.id })
-- AimGroup:cancelTarget(data, player.id)
-- data.extra_data = data.extra_data or {}
-- data.extra_data.sw_wanrong_dueler = data.extra_data.sw_wanrong_dueler or {}
-- table.insertIfNeed(data.extra_data.sw_wanrong_dueler, to.id)
-- return true
-- end,
-- }
-- local sw_wanrong_delay = fk.CreateTriggerSkill {
-- name = "#sw_wanrong_delay",
-- mute = true,
-- events = { fk.CardUseFinished },
-- can_trigger = function(self, event, target, player, data)
-- if not player.dead and data.extra_data and data.extra_data.sw_wanrong_dueler and table.contains(data.extra_data.sw_wanrong_dueler, player.id) then
-- local room = player.room
-- local from = room:getPlayerById(data.from)
-- return not from.dead and U.canUseCardTo(room, player, from, Fk:cloneCard("duel"))
-- end
-- end,
-- on_cost = function(self, event, target, player, data)
-- local room = player.room
-- return room:askForSkillInvoke(player, "sw_wanrong", nil, "#sw_wanrong-duel:" .. data.from)
-- end,
-- on_use = function(self, event, target, player, data)
-- local room = player.room
-- local from = room:getPlayerById(data.from)
-- room:useVirtualCard("duel", nil, player, from, "sw_wanrong")
-- end,
-- }
-- sw_wanrong:addRelatedSkill(sw_wanrong_delay)
-- daqiao:addSkill(sw_wanrong)
-- local sw_liuli = fk.CreateTriggerSkill {
-- name = "sw_liuli",
-- events = { fk.TurnEnd },
-- anim_type = "control",
-- frequency = Skill.Limited,
-- can_trigger = function(self, event, target, player, data)
-- return player:hasSkill(self) and target:getNextAlive() == player and
-- player:usedSkillTimes(self.name, Player.HistoryGame) == 0 and #player.room.alive_players > 2
-- end,
-- on_cost = function(self, event, target, player, data)
-- local room = player.room
-- local players = table.simpleClone(room:getOtherPlayers(player))
-- table.removeOne(players, target)
-- local tos = room:askForChoosePlayers(player, table.map(players, Util.IdMapper), 1, 1, "#sw_liuli", self.name,
-- true)
-- if #tos > 0 then
-- self.cost_data = tos[1]
-- return true
-- end
-- end,
-- on_use = function(self, event, target, player, data)
-- local room = player.room
-- local to = room:getPlayerById(self.cost_data)
-- to:drawCards(3, self.name)
-- room:swapSeat(player, to)
-- end,
-- }
-- daqiao:addSkill(sw_liuli)
-- Fk:loadTranslationTable {
-- ["sww__daqiao"] = "大乔",
-- ["sw_guose"] = "国色",
-- [":sw_guose"] = "①你可以将一张红色牌当【乐不思蜀】使用,若为♥,令目标回复一点体力;若为♦,目标摸两张牌。②一名其他角色判定阶段开始时,若其判定区有牌,其可以将两张手牌交给你,然后获得判定区一张牌。",
-- ["#sw_guose_trigger"] = "国色",
-- ["#sw_guose-ask"] = "国色:你可以将两张手牌交给 %src,获得你判定区一张牌",
-- ["sw_wanrong"] = "婉容",
-- [":sw_wanrong"] = "每当你成为【杀】的目标时,你可以将一张牌交给一名其他角色(需为合法目标),并将此【杀】目标转移给其。此【杀】结算结束后,该角色可以视为对此【杀】使用者使用一张【决斗】。",
-- ["#sw_wanrong"] = "婉容:将一张牌交给一名其他角色,将此【杀】目标转移给其",
-- ["#sw_wanrong_delay"] = "婉容",
-- ["#sw_wanrong-duel"] = "婉容:你可视为对 %src 使用【决斗】",
-- ["sw_liuli"] = "流离",
-- [":sw_liuli"] = "限定技,你上家的回合结束时,若你已受伤,你可以与除你上家外的一名其他角色交换座位,然后其摸三张牌。",
-- ["#sw_liuli"] = "流离:与一名其他角色交换座位,其摸三张牌",
-- ["$sw_guose1"] = "溪边坐流水,与君共清欢。",
-- ["$sw_guose2"] = "衣带逐水去,绿川盼君留。",
-- ["$sw_wanrong1"] = "吾夫君在此,汝胆敢如此放肆?",
-- ["$sw_wanrong2"] = "邪佞诈妄之人,断无可容之处!",
-- ["$sw_liuli1"] = "此生逢伯符,足以慰平生。",
-- ["$sw_liuli2"] = "所幸遇郎君,流离得良人。",
-- ["~sww__daqiao"] = "忆君如流水,日夜无歇时。",
-- }
Fk:addPoxiMethod {
name = "joy__yanjiao_cutten",
card_filter = function(to_select, selected, data, extra_data) -- 可以接受额外的数据extra_data,从相关技能中传回
local n = Fk:getCardById(to_select).number
for _, id in ipairs(selected) do
n = n + Fk:getCardById(id).number
end
return n <= extra_data
end,
feasible = function(selected)
return #selected > 0
end,
prompt = function()
return Fk:translate("#joy__yanjiao-choose")
end
}
local joy__yanjiao = fk.CreateActiveSkill { --poxi框备用技能存根,模板
name = "joy__yanjiao",
anim_type = "control",
card_num = 0,
target_num = 1,
target_filter = function(self, to_select, selected)
return #selected < 1
end,
can_use = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryTurn) == 0
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
local target = room:getPlayerById(effect.tos[1])
local ids = room:getNCards(3 + player:getMark("@joy__yanjiao"), "bottom")
room:moveCards({
ids = ids,
toArea = Card.Processing,
moveReason = fk.ReasonPut,
})
local number = (Fk:getCardById(ids[1]).number + Fk:getCardById(ids[2]).number + Fk:getCardById(ids[3]).number) //
2
local get = room:askForPoxi(target, "joy__yanjiao_cutten", {
{ self.name, ids },
}, number, true)
if #get > 0 then
local dummy = Fk:cloneCard("dilu")
dummy:addSubcards(get)
room:obtainCard(target.id, dummy, true, fk.ReasonPrey)
local n = 0
for _, id in ipairs(get) do
if n < number then
n = n + Fk:getCardById(id).number
end
end
end
ids = table.filter(ids, function(id) return room:getCardArea(id) == Card.Processing end)
if #ids > 0 then
if target == player then
room:moveCards({
ids = ids,
toArea = Card.DiscardPile,
moveReason = fk.ReasonPutIntoDiscardPile,
})
else
local dummy = Fk:cloneCard("dilu")
dummy:addSubcards(ids)
room:obtainCard(player.id, dummy, true, fk.ReasonPrey)
end
end
end,
}
local attacktest = fk.CreateAttackRangeSkill { --攻击距离锁定为1的模板
name = "attacktest",
correct_func = function(self, from, to)
if from:hasSkill(self) then
if from:getMark("dda-turn") > 0 then
return -from:getMark("dda-turn")
elseif from:getMark("aad-turn") > 0 then
return from:getMark("aad-turn")
end
end
end,
}
local attackwww = fk.CreateTriggerSkill { --同上,附加效果,用于设置实际标记,标记为距离-1
name = "#attackwww",
mute = true,
refresh_events = { fk.EventPhaseStart, fk.CardUseFinished },
can_refresh = function(self, event, target, player, data)
if player:hasSkill(self) and target == player then
if event == fk.EventPhaseStart then
return player.phase == Player.Start and player:getAttackRange() ~= 1
else
return data.card.sub_type == Card.SubtypeWeapon
end
end
end,
on_refresh = function(self, event, target, player, data)
local room = player.room
if event == fk.EventPhaseStart then
if player:getAttackRange() > 1 then
room:setPlayerMark(player, "dda-turn", player:getAttackRange() - 1)
elseif player:getAttackRange() == 0 then
room:setPlayerMark(player, "aad-turn", 1)
end
else
room:setPlayerMark(player, "dda-turn", 0)
room:setPlayerMark(player, "aad-turn", 0)
if player:getAttackRange() > 1 then
room:setPlayerMark(player, "dda-turn", player:getAttackRange() - 1)
elseif player:getAttackRange() == 0 then
room:setPlayerMark(player, "aad-turn", 1)
end
end
end,
}
Fk:loadTranslationTable {
["attacktest"] = "攻击距离锁定为1",
["#attackwww"] = "攻击距离锁定为1",
[":attacktest"] = "攻击距离锁定为1",
}
local sw_douxun = fk.CreateTriggerSkill { -- 指定目标后的判定加伤模板
name = "sw_douxun",
anim_type = "offensive",
events = { fk.TargetSpecified },
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and data.card.trueName == "slash"
end,
on_cost = function(self, event, target, player, data)
return player.room:askForSkillInvoke(player, self.name, nil, "#sw_douxun-invoke::" .. data.to)
end,
on_use = function(self, event, target, player, data)
local room = player.room
local judge = {
who = player,
reason = self.name,
pattern = ".|.|spade,club",
}
room:judge(judge)
if judge.card.color == Card.Black then
data.additionalDamage = (data.additionalDamage or 0) + 1
data.disresponsive = true
end
end,
}
Fk:loadTranslationTable {
["sw_douxun"] = "斗巡",
["#sw_douxun-invoke"] = "斗巡:是否进行判定,若为黑色,%dest 不能响应此牌且对其造成的伤害+1",
[":sw_douxun"] = "当你使用【杀】指定目标后,你进项判定,若为黑色,此【杀】伤害+1且不可响应",
}
local fenpai = fk.CreateActiveSkill { --主动给其他人牌模板,可用于部分技能
name = "fenpai",
anim_type = "control",
card_num = 0,
min_target_num = 1,
max_target_num = 3,
can_use = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
end,
card_filter = function(self, to_select, selected)
return false
end,
target_filter = function(self, to_select, selected)
return #selected < 3 and to_select ~= Self.id
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
local targets = table.clone(effect.tos)
room:sortPlayersByAction(targets)
for _, id in ipairs(targets) do
local target = room:getPlayerById(id)
if not player.dead then
local card = room:askForCard(player, 1, 1, true, self.name, false, ".", "#fenpai-give:" .. target.id)
local dummy = Fk:cloneCard("dilu")
dummy:addSubcards(card)
room:obtainCard(target, dummy, false, fk.ReasonGive)
end
end
end,
}
Fk:loadTranslationTable {
["fenpai"] = "给牌",
["#fenpai-give"] = "给牌:请选择要交给 %src 的一张牌",
[":fenpai"] = "出牌阶段限一次,你选择三名其他角色,然后你交给这些角色各一张牌。",
}
--杀指定目标后判定,黑色横置并造成雷电伤害
local jiaoxue = fk.CreateTriggerSkill {
name = "jiaoxue",
anim_type = "offensive",
frequency = Skill.Compulsory,
events = { fk.TargetSpecified },
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and
data.card.name == "thunder__slash" --判断是否为雷杀,应用name而非trueName
end,
on_use = function(self, event, target, player, data)
local room = player.room
local judge = {
who = player,
reason = self.name,
pattern = ".|.|spade,club",
}
room:judge(judge)
if judge.card.color == Card.Black then
---------------------------------------
local targets = table.map(table.filter(room:getAlivePlayers(), function(p)
return p ~= player
end), function(p) return p.id end)
-------------------------------此区间用于筛选符合要求的角色,room:getAlivePlayers()代表当前存活的所有玩家,return p ~= player 用于返回可选择的目标
if #targets == 0 then return false end -----若没有符合的目标,则返回false,否则继续往下执行
--------------------------------
local tos = room:askForChoosePlayers(player, targets, 1, 2, "#jiaoxue-askchosen", self.name, false)
for _, p in ipairs(tos) do
local id = room:getPlayerById(p)
if not id.chained then
id:setChainState(true)
end
end
---------------------------------此区间用于将targets中已经筛选出的角色,从这些角色中选择,然后遍历选择出来的每个角色,如果没有横置,则横置
-- local tar = room:askForChoosePlayers(player, tos, 1, 1, "#jiaoxue-askdamage", self.name, false)[1]
-- local tgt = room:getPlayerById(tar)
-- if not tgt.dead then
-- room:damage {
-- from = player,
-- to = tgt,
-- damage = 1,
-- skillName = self.name,
-- damageType = fk.ThunderDamage }
-- end
----------------------------------------------
for _, p in ipairs(room:getAlivePlayers()) do
if p.chained then
if not p.dead then
room:damage {
from = player,
to = p,
damage = 1,
skillName = self.name,
damageType = fk.ThunderDamage }
end
end
end
-------------------------------------此区间用于筛选房间内所有存活的角色,若目标符合横置且没有死亡,对这些角色造成一点雷电伤害
end
data.additionalDamage = (data.additionalDamage or 0) + 1
---------------------------伤害+1
local cards = table.filter(player:getCardIds("h"),
function(id) return Fk:getCardById(id).type ~= Card.TypeBasic end) ------------判断手牌中是否有不是基本牌的牌
if #cards > 0 or #player:getCardIds(player.Equip) > 0 then -------同时判断cards是否大于0或装备区是否有牌,毕竟装备也是非基本,若大于0,继续往下执行
room:askForDiscard(player, 1, 1, true, self.name, false, ".|.|.|.|.|trick,equip", "#jiaoxue-choosediscard") ----------询问玩家弃置其中一张,若要
end
end,
}
Fk:loadTranslationTable {
["jiaoxue"] = "教学",
["#jiaoxue-askchosen"] = "教学:请选择要横置的至多两名角色",
["#jiaoxue-choosediscard"] = "教学:弃置一张非基本牌",
[":jiaoxue"] = "锁定技:当你使用雷【杀】指定目标后,你进行一次判定:若为黑色,此【杀】造成的伤害+1,你选择至多两名角色横置,并对所有横置角色各造成一点雷电伤害,结算完成后弃置一张非基本牌",
}
local mingmen = fk.CreateTriggerSkill {
name = "mingmen",
anim_type = "defensive",
frequency = Skill.Compulsory,
events = { fk.DrawNCards },
on_use = function(self, event, target, player, data)
data.n = data.n + 1
end,
}
local mingmen_targetmod = fk.CreateTargetModSkill {
name = "#mingmen_targetmod",
residue_func = function(self, player, skill, scope, card)
if card and player:hasSkill("mingmen") and card.trueName == "slash" and scope == Player.HistoryPhase then
return #player:getPile("mingmen_Pile")
end
end,
}
local mingmen_targetmod1 = fk.CreateTargetModSkill {
name = "#mingmen_targetmod1",
residue_func = function(self, player, skill, scope, card)
if card and player:hasSkill("mingmen") and card.trueName == "slash" and scope == Player.HistoryPhase then
return -1
end
end,
}
local sw_sifeng = fk.CreateTriggerSkill {
name = "sw_sifeng",
events = { fk.EventPhaseStart, fk.CardUsing },
can_trigger = function(self, event, target, player, data)
if (target ~= player or not player:hasSkill(self.name)) then return false end
if event == fk.EventPhaseStart then
return (player.phase == Player.Start) and not player:isNude()
else
local suitsRecorded = type(player:getMark("@mingmen_Pile-putt")) == "table" and
player:getMark("@mingmen_Pile-putt") or {}
local mingmen_Pile = table.map(player:getPile("mingmen_Pile"),
function(cid) return Fk:getCardById(cid):getSuitString() end)
local suit = data.card:getSuitString()
return not table.contains(suitsRecorded, "log_" .. suit) and table.contains(mingmen_Pile, suit) and
player:getMark("sifeng_c-turn") < 2
end
end,
on_cost = function(self, event, target, player, data)
if event == fk.EventPhaseStart then
player.room:drawCards(player, 1, self.name)
local ids = player.room:askForCard(player, 1, 2, true, self.name, true, nil, "#mingmen_Pile-power")
if #ids > 0 then
self.cost_data = ids
return true
end
else
return true
end
end,
on_use = function(self, event, target, player, data)
if event == fk.EventPhaseStart then
player:addToPile("mingmen_Pile", self.cost_data, true, self.name)
else
player:drawCards(1, self.name)
player.room:addPlayerMark(player, "sifeng_c-turn", 1)
end
end,
}
local sw_huangpai = fk.CreateTriggerSkill {
name = "sw_huangpai",
frequency = Skill.Wake,
events = { fk.EventPhaseStart },
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self.name) and
player.phase == Player.Finish and
player:usedSkillTimes(self.name, Player.HistoryGame) == 0
end,
can_wake = function(self, event, target, player, data)
return #player:getPile("mingmen_Pile") > 3
end,
on_use = function(self, event, target, player, data)
local room = player.room
room:changeMaxHp(player, 1)
local choices = { "draw3" }
if player:isWounded() then
table.insert(choices, "recover")
end
local choice = room:askForChoice(player, choices, self.name)
if choice == "draw3" then
player:drawCards(2)
else
room:recover({
who = player,
num = 1,
recoverBy = player,
skillName = self.name
})
end
room:handleAddLoseSkills(player, "liuman", nil, true, false)
room:handleAddLoseSkills(player, "-mingmen", nil, true, false)
room:handleAddLoseSkills(player, "-sw_sifeng", nil, true, false)
if #player:getPile("mingmen_Pile") > 0 then
local dummy = Fk:cloneCard("dilu")
dummy:addSubcards(player:getPile("mingmen_Pile"))
room:obtainCard(player, dummy, true, fk.ReasonJustMove)
end
end,
}
local liuman = fk.CreateTriggerSkill {
name = "liuman",
anim_type = "offensive",
events = { fk.DamageCaused },
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self.name) and data.card and
data.card.is_damage_card
end,
on_use = function(self, event, target, player, data)
local room = player.room
room:killPlayer({ who = data.to.id })
end,
}
mingmen:addRelatedSkill(mingmen_targetmod)
mingmen:addRelatedSkill(mingmen_targetmod1)
-- local sw_rende = fk.CreateActiveSkill {
-- name = "sw_rende",
-- anim_type = "offensive",
-- card_num = 0,
-- target_num = 1,
-- prompt = "#sw_rende-active",
-- can_use = function(self, player)
-- return player:getHandcardNum() > 0
-- end,
-- card_filter = Util.FalseFunc,
-- target_filter = function(self, to_select, selected)
-- return #selected == 0 and to_select ~= Self.id and
-- Fk:currentRoom():getPlayerById(to_select):getMark("sw_rende-phase") == 0
-- end,
-- on_use = function(self, room, effect)
-- local player = room:getPlayerById(effect.from)
-- local target = room:getPlayerById(effect.tos[1])
-- room:setPlayerMark(target, "sw_rende-phase", 1)
-- player:drawCards(1, self.name)
-- local mark = player:getTableMark( "sw_rendeex-turn")
-- local cards
-- if #player:getCardIds(Player.Hand) > 2 then
-- cards = room:askForCard(player, 2, #player:getCardIds(Player.Hand), true, self.name, false, nil,
-- "#sw_rende-ask:" .. target.id)
-- elseif #player:getCardIds(Player.Hand) <= 2 then
-- cards = player:getCardIds(Player.Hand)
-- end
-- local dummy = Fk:cloneCard("dilu")
-- dummy:addSubcards(cards)
-- room:obtainCard(target, dummy, false, fk.ReasonGive)
-- local success, data = room:askForUseActiveSkill(player, "swrende_viewas", "#sw_rende-choice", true)
-- if success then
-- local ids = Fk.skills["swrende_viewas"]:viewAs(data.cards)
-- local use = {
-- from = player.id,
-- tos = table.map(data.targets, function(id) return { id } end),
-- card = ids,
-- extraUse = true,
-- }
-- room:useCard(use)
-- table.insert(mark, ids.trueName)
-- room:setPlayerMark(player, "sw_rendeex-turn", #mark > 0 and mark or 0)
-- end
-- end,
-- }
-- liubei:addSkill(sw_rende)
-- Fk:loadTranslationTable {
-- ["sw_rende"] = "仁德",
-- ["swrende_viewas"] = "仁德",
-- [":sw_rende"] = "出牌阶段每名角色限一次,若你有牌,你可以选择一名角色,摸一张牌并交给其至少两张牌,然后视为使用一张本回合未以此法使用过的基本牌",
-- ["#sw_rende-ask"] = "仁德:请交给 %src 至少两张牌",
-- ["#sw_rende-choice"] = "仁德:请选择要使用的基本牌",
-- }
-- local sw_zhangwu = fk.CreateTriggerSkill {
-- name = "sw_zhangwu",
-- anim_type = "defensive",
-- frequency = Skill.Compulsory,
-- events = { fk.CardUsing },
-- can_trigger = function(self, event, target, player, data)
-- if player:hasSkill(self) then
-- local events = player.room.logic:getEventsOfScope(GameEvent.UseCard, 999, function(e)
-- local use = e.data[1]
-- return use.from == player.id
-- end, Player.HistoryPhase)
-- return #events == player:getLostHp() and player:isWounded()
-- end
-- end,
-- on_use = function(self, event, target, player, data)
-- data.additionalEffect = 1
-- end,
-- }
-- local sw_zhangwu_trigger = fk.CreateTriggerSkill {
-- name = "#sw_zhangwu_trigger",
-- anim_type = "support",
-- frequency = Skill.Compulsory,
-- events = { fk.AfterDying },
-- can_trigger = function(self, event, target, player, data)
-- return player:isAlive() and player:hasSkill("sw_zhangwu") and
-- player:usedSkillTimes(self.name, Player.HistoryGame) == 0
-- end,
-- on_use = function(self, event, target, player, data)
-- local room = player.room
-- if player:getHandcardNum() < player:getLostHp() then
-- local x = player:getLostHp() - player:getHandcardNum()
-- player:drawCards(x, self.name)
-- end
-- room:handleAddLoseSkills(player, "-sw_zhangwu", nil)
-- room:handleAddLoseSkills(player, "jianhe", nil)
-- end,
-- }
-- sw_zhangwu:addRelatedSkill(sw_zhangwu_trigger)
-- liubei:addSkill(sw_zhangwu)
-- liubei:addRelatedSkill("jianhe")
-- Fk:loadTranslationTable {
-- ["sw_zhangwu"] = "章武",
-- ["#sw_zhangwu_trigger"] = "章武",
-- [":sw_zhangwu"] = "锁定技,你于回合内使用的第X张牌额外结算一次;当你首次脱离濒死状态时,失去该技能,获得〖剑合〗",
-- }
-- local sw_jijiang = fk.CreateActiveSkill {
-- name = "sw_jijiang$",
-- anim_type = "support",
-- card_num = 1,
-- target_num = 1,
-- can_use = function(self, player)
-- return not player:isKongcheng()
-- end,
-- card_filter = function(self, to_select, selected)
-- return #selected == 0 and Fk:getCardById(to_select).trueName == "slash"
-- end,
-- target_filter = function(self, to_select, selected)
-- return #selected == 0 and to_select ~= Self.id and Fk:currentRoom():getPlayerById(to_select).kingdom == Self.kingdom
-- end,
-- on_use = function(self, room, effect)
-- local target = room:getPlayerById(effect.tos[1])
-- table.forEach(effect.cards, function(cid)
-- room:setCardMark(Fk:getCardById(cid), "@@sw_jijiang", 1)
-- end)
-- room:obtainCard(target, effect.cards[1], false, fk.ReasonGive)
-- room:getPlayerById(effect.from):drawCards(1, self.name)
-- end,
-- }
-- local sw_jijiang_dlc = fk.CreateTriggerSkill {
-- name = "#sw_jijiang_dlc",
-- anim_type = "drawcard",
-- frequency = Skill.Compulsory,
-- mute = true,
-- events = { fk.Damage },
-- can_trigger = function(self, event, target, player, data)
-- return player:hasSkill(sw_jijiang) and data.card and table.find(Card:getIdList(data.card), function(id)
-- return Fk:getCardById(id):getMark("@@sw_jijiang") > 0
-- end)
-- end,
-- on_use = function(self, event, target, player, data)
-- player.room:setCardMark(data.card, "@@sw_jijiang", 0)
-- player:drawCards(1, self.name)
-- target:drawCards(1, self.name)
-- end,
-- }
-- sw_jijiang:addRelatedSkill(sw_jijiang_dlc)
-- liubei:addSkill(sw_jijiang)
-- Fk:loadTranslationTable {
-- ["sw_jijiang"] = "激将",
-- ["#sw_jijiang_dlc"] = "激将",
-- [":sw_jijiang"] = "主公技,出牌阶段,你可以交给势力与你相同的其他角色角色一张【杀】并摸一张牌;当以此法给出的【杀】造成伤害后,你与其各摸一张牌",
-- ["@@sw_jijiang"] = "激将",
-- }
-- local sw_duozheng = fk.CreateTriggerSkill {
-- name = "sw_duozheng",
-- events = { fk.GamePrepared },
-- priority = 10,
-- mute = true,
-- frequency = Skill.Compulsory,
-- can_trigger = function(self, event, target, player, data)
-- local room = player.room
-- return player:hasSkill(self) and player.role ~= "lord" and
-- (room.settings.gameMode == "aaa_role_mode" or room.settings.gameMode == "vanished_dragon" or room.settings.gameMode == "sfvanished_dragon")
-- end,
-- on_use = function(self, event, target, player, data)
-- local room = player.room
-- player:broadcastSkillInvoke(self.name)
-- room:changeMaxHp(player, 1)
-- room:recover({
-- who = player,
-- num = 1,
-- recoverBy = player,
-- skillName = self.name
-- })
-- local lord = table.find(room.alive_players, function(p) return p.role == "lord" end)
-- if lord then
-- if lord ~= player then
-- lord.role = "unknown"
-- room:broadcastProperty(lord, "role")
-- player.role = "lord"
-- lord.role = table.random({ "loyalist", "rebel", "renegade" })
-- room:notifyProperty(player, player, "role")
-- room:notifyProperty(lord, lord, "role")
-- room:broadcastProperty(player, "role")
-- end
-- local skills = {}
-- for _, skill_name in ipairs(Fk.generals[lord.general]:getSkillNameList(true)) do
-- local skill = Fk.skills[skill_name]
-- if skill.lordSkill then
-- table.insertIfNeed(skills, skill_name)
-- end
-- end
-- if #skills > 0 then
-- room:handleAddLoseSkills(lord, "-" .. table.concat(skills, "|-"), nil, false)
-- end
-- end
-- -- local zg = table.random(table.filter(room.alive_players, function(p) return p.role ~= "lord" end))
-- -- zg.role = "lord"
-- -- room:setPlayerMark(zg, "duozheng_zhugong", 1)
-- -- room:notifyProperty(zg, zg, "role")
-- -- local fz = table.random(table.filter(room.alive_players, function(p) return p.role ~= "lord" end))
-- -- fz.role = "rebel"
-- -- room:setPlayerMark(fz, "duozheng_fanzei", 1)
-- -- room:notifyProperty(fz, fz, "role")
-- -- for _, p in ipairs(room:getAlivePlayers()) do
-- -- if p:getMark("@@duozheng_zhugong") == 0 and p:getMark("@@duozheng_fanzei") == 0 then
-- -- p.role = table.random({ "loyalist", "rebel", "renegade", "lord" })
-- -- room:notifyProperty(p, p, "role")
-- -- end
-- -- end
-- local first = table.find(room.players, function(p) return p.seat == 1 end)
-- if first and first ~= player then
-- room:swapSeat(player, first)
-- room.current = player
-- end
-- end,
-- }
-- liuyan:addSkill(sw_duozheng)
-- Fk:loadTranslationTable {
-- ["sww__liuyan"] = "刘焉",
-- ["~sww__liuyan"] = "根基未稳,吾命休矣...",
-- ["sw_duozheng"] = "夺政",
-- [":sw_duozheng"] = "锁定技,游戏开始时,若你不为主公,将你的身份改为主公,增加一点体力上限并回复一点体力,与一号位交换座位,然后将原主公的身份进行随机分配(仅身份、忠胆模式下生效)。",
-- ["$sw_duozheng1"] = "汉室宝器,岂可丧于外奴之手。",
-- ["$sw_duozheng2"] = "图强自立,据险谋国。",
-- }
local sw_rongzhu = fk.CreateActiveSkill {
name = "sw_rongzhu",
card_num = 1,
can_use = function(self, player)
return player:hasSkill(self.name) and player.phase == Player.Play
end,
card_filter = function(self, to_select, selected)
return #selected == 0 and Fk:currentRoom():getCardArea(to_select) == Player.Hand and
table.contains({ Card.SubtypeWeapon },
Fk:getCardById(to_select).sub_type)
end,
target_filter = function(self, to_select, selected)
return false
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
local card = Fk:getCardById(effect.cards[1])
player:addToPile("majun_wuqi", card, true, self.name)
if card.equip_skill then
room:handleAddLoseSkills(player, card.equip_skill.name, nil, true, false)
-- room:setPlayerMark(player, "sw_rongzhu_equipskill", card.equip_skill.name.. "-" .. card.name)
-- local translate = Fk:translate(card.name)
-- -- dbg()
-- room:setPlayerMark(player, "@" .. translate, "")
end
end,
}
local test = General(extension, "sw__test", "que", 20, 20, General.Female)
local wocaojineng = fk.CreateTriggerSkill {
name = "wocaojineng",
events = { fk.CardUseFinished },
anim_type = "offensive",
frequency = Skill.Compulsory,
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self.name)
end,
on_use = function(self, event, target, player, data)
local all_skills = {}
for _, skill in ipairs(target.player_skills) do
if not skill.frequency ~= Skill.Wake then
table.insert(all_skills, skill.name)
end
end
if table.contains(all_skills, self.name) then
for _, skill_name in ipairs(all_skills) do
local skill = Fk.skills[skill_name]
local scope_type = skill.scope_type
if scope_type == nil and skill.frequency ~= Skill.Wake then
scope_type = Player.HistoryPhase
end
if scope_type and player:usedSkillTimes(skill_name, scope_type) > 0 then
player:setSkillUseHistory(skill_name, 0, scope_type)
end
end
end
local all_skills1 = {}
for _, skill in ipairs(target.player_skills) do
if not skill.frequency ~= Skill.Wake then
table.insert(all_skills1, skill.name)
end
end
if table.contains(all_skills1, self.name) then
for _, skill_name in ipairs(all_skills1) do
local skill = Fk.skills[skill_name]
local scope_type = skill.scope_type
if scope_type == nil and skill.frequency ~= Skill.Wake then
scope_type = Player.HistoryGame
end
if scope_type and player:usedSkillTimes(skill_name, scope_type) > 0 then
player:setSkillUseHistory(skill_name, 0, scope_type)
end
end
end
local all_skills2 = {}
for _, skill in ipairs(target.player_skills) do
if not skill.frequency ~= Skill.Wake then
table.insert(all_skills2, skill.name)
end
end
if table.contains(all_skills2, self.name) then
for _, skill_name in ipairs(all_skills2) do
local skill = Fk.skills[skill_name]
local scope_type = skill.scope_type
if scope_type == nil and skill.frequency ~= Skill.Wake then
scope_type = Player.HistoryTurn
end
if scope_type and player:usedSkillTimes(skill_name, scope_type) > 0 then
player:setSkillUseHistory(skill_name, 0, scope_type)
end
end
end
local all_skills3 = {}
for _, skill in ipairs(target.player_skills) do
if not skill.frequency ~= Skill.Wake then
table.insert(all_skills3, skill.name)
end
end
if table.contains(all_skills3, self.name) then
for _, skill_name in ipairs(all_skills3) do
local skill = Fk.skills[skill_name]
local scope_type = skill.scope_type
if scope_type == nil and skill.frequency ~= Skill.Wake then
scope_type = Player.HistoryRound
end
if scope_type and player:usedSkillTimes(skill_name, scope_type) > 0 then
player:setSkillUseHistory(skill_name, 0, scope_type)
end
end
end
end,
}
test:addSkill(wocaojineng)
local zhemian = fk.CreateTriggerSkill {
name = "zhemian",
events = { fk.EventPhaseChanging },
can_trigger = function(self, event, target, player, data)
local n = 0
for _, id in ipairs(player.room:getOtherPlayers(player)) do
if #id:getCardIds("h") > 0 then
n = n + 1
end
end
return target ~= player and player:hasSkill(self) and data.to == target.Start and
table.every(player.room:getOtherPlayers(target), function(p)
return p:getHandcardNum() <= target:getHandcardNum()
end) and target.kingdom == "qun" and n > 0
end,
on_cost = function(self, event, target, player, data)
local room = player.room
local targets = room:getOtherPlayers(player)
local to = room:askForChoosePlayers(target, table.map(targets, Util.IdMapper), 1, 1, "遮面:请选择要交换装备的角色", self.name)
if #to == 0 or (#room:getPlayerById(to[1]):getCardIds("e") == 0 and #player:getCardIds("e") == 0) then
return false
else
self.cost_data = to[1]
return true
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
local to = room:getPlayerById(self.cost_data)
if room:askForSkillInvoke(target, self.name, nil, "#zhemian-askskill:" .. player.id .. ":" .. to.id) then
room:askForMoveCardInBoard(target, to, player, self.name)
end
end,
}
Fk:loadTranslationTable {
["zhemian"] = "遮面",
[":zhemian"] = "其他群势力角色的准备阶段,若其手牌数为全场最多,其可以选择一名其他角色,然后令其选择是否调换你与其选择目标装备区的一张牌。",
["#zhemian-askskill"] = "遮面:是否移动%src或%dest装备区的一张牌至对方装备区?",
}
local xiii = fk.CreateViewAsSkill {
name = "xiii",
anim_type = "switch",
switch_skill_name = "xiii",
prompt = function()
return "#xiii-prompt:::" ..
(Self:getSwitchSkillState("xiii") == fk.SwitchYang and "unexpectation" or "looting")
end,
card_filter = function(self, to_select, selected)
return #selected == 0 and Fk:getCardById(to_select).trueName == "slash"
end,
view_as = function(self, cards)
if #cards ~= 1 then return nil end
local name = (Self:getSwitchSkillState("xiii") == fk.SwitchYang and "unexpectation" or "looting")
if not Fk.all_card_types[name] then return nil end
local c = Fk:cloneCard(name)
c.skillName = self.name
c:addSubcard(cards[1])
return c
end,
enabled_at_play = function(self, player)
return not player:isKongcheng() and table.find(player:getCardIds("h"),
function(id) return Fk:getCardById(id).trueName == "slash" end)
end,
}
local xilve_delay = fk.CreateTriggerSkill {
name = "#xilve_delay",
frequency = Skill.Compulsory,
events = { fk.CardUseFinished },
can_trigger = function(self, event, target, player, data)
return player:hasSkill("xilve") and target == player and data.card and table.contains(data.card.skillNames, "xilve") and
not data.damageDealt
end,
on_use = function(self, event, target, player, data)
local all_slots = { "WeaponSlot", "ArmorSlot", "DefensiveRideSlot", "OffensiveRideSlot", "TreasureSlot" }
local choices = {}
for _, equip_slot in ipairs(all_slots) do
if table.contains(player.sealedSlots, equip_slot) then
table.insert(choices, equip_slot)
end
end
if #choices > 0 then
local choice = player.room:askForChoice(player, choices, self.name, "#xilve-choice", false)
player.room:resumePlayerArea(player, { choice })
player:endPlayPhase()
end
end,
}
Fk:loadTranslationTable {
["xiii"] = "变牌",
[":xiii"] = "转换技,出牌阶段,你可以将【杀】当做,阳:【出其不意】;阴:【趁火打劫】使用,若此牌未造成伤害,你回复一个装备栏并结束出牌阶段。",
}
local napai_viewas = fk.CreateViewAsSkill {
name = "napai_viewas",
anim_type = "offensive",
pattern = "slash,duel",
prompt = "拿牌:是否使用【过河拆桥】?",
interaction = function()
return UI.ComboBox { choices = { "dismantlement" } }
end,
card_filter = function(self, to_select, selected)
return #selected == 0 and table.contains(Self:getCardIds("he"), to_select)
end,
view_as = function(self, cards)
if #cards ~= 1 or not self.interaction.data then return end
local card = Fk:cloneCard(self.interaction.data)
card.skillName = self.name
card:addSubcard(cards[1])
return card
end,
}
Fk:addSkill(napai_viewas)
local napai = fk.CreateTriggerSkill {
name = "napai",
anim_type = "drawcard",
events = { fk.AfterCardsMove, fk.Damage },
can_trigger = function(self, event, target, player, data)
if not player:hasSkill(self) then return end
if event == fk.AfterCardsMove then
self.cost_data = {}
for _, move in ipairs(data) do
if move.from and move.toArea == Card.DiscardPile and move.skillName == "dismantlement_skill" and move.proposer == player.id then
for _, info in ipairs(move.moveInfo) do
if Fk:getCardById(info.cardId).type == Card.TypeBasic and player.room:getCardArea(info.cardId) == Card.DiscardPile then
table.insertIfNeed(self.cost_data, info.cardId)
end
end
end
end
if #self.cost_data > 0 then
return true
end
else
return target == player and data.to and not data.to.dead and data.to ~= player and data.from == player
end
end,
on_cost = function(self, event, target, player, data)
if event == fk.AfterCardsMove then
return true
else
local success, dat = player.room:askForUseActiveSkill(player, "napai_viewas", "#napai-ask:"..data.to.id, true,
{
bypass_times = true,
extraUse = true,
})
if success and dat then
self.cost_data = dat
return true
end
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
if event == fk.AfterCardsMove then
room:delay(200)
local dummy = Fk:cloneCard("dilu")
dummy:addSubcards(self.cost_data)
room:obtainCard(player.id, dummy, true, fk.ReasonJustMove)
else
local card = napai_viewas:viewAs(self.cost_data.cards)
room:useCard {
from = player.id,
tos = table.map(self.cost_data.targets, function(id) return { id } end),
card = card,
}
end
end,
}
test:addSkill(napai)
Fk:loadTranslationTable {
["napai"] = "拿牌",
[":napai"] = "当你对其他角色造成伤害后,你可以将一张牌当做【过河拆桥】对其适应,你获得因此被弃置的基本牌。",
["#napai-ask"] = "拿牌:是否对%src使用【过河拆桥】",
["napai_viewas"] = "拿牌",
}
Fk:loadTranslationTable {
["sw__test"] = "魔法少女",
["wocaojineng"] = "我草",
[":wocaojineng"] = "每当你使用一张牌时,重置你的所有技能",
}
return extension
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。