代码拉取完成,页面将自动刷新
同步操作将从 汤圆/tyj 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
local extension = Package:new("tyj_heg")
extension.extensionName = "tyj"
extension.game_modes_whitelist = { 'nos_heg_mode', 'new_heg_mode' ,"jbsnew_heg_mode","zhonger_heg_mode"}
local U = require "packages/utility/utility"
local H = require "packages/hegemony/util"
Fk:loadTranslationTable{
["tyj_heg"] = "汤圆国战将",
["tyj"]='汤圆精品包'
}
local U = require "packages/utility/utility"
--local tyj_xiliang_fuc = require "packages/tyj/tyj_xiliang"
local heg = Fk.game_modes["new_heg_mode"]
if heg then
table.insertIfNeed(heg.whitelist, "tyj_heg")
end
local heg2 = Fk.game_modes["jbsnew_heg_mod"]
if heg2 then
table.insertIfNeed(heg2.whitelist, "tyj_heg")
end
local tyj_niufu = General:new(extension, "tyj_heg__niufu", "qun", 4,4)
tyj_niufu:addCompanions({--[["tyj_heg__dongxia",]]"ld__dongzhuo"})
Fk:loadTranslationTable{
["tyj_heg__niufu"] = "牛辅",
["#tyj_heg__niufu"] = "鈇符斥雠",
["designer:tyj_heg__niufu"] = "汤圆",
["cv:tyj_heg__niufu"] = "官方",
["illustrator:tyj_heg__niufu"] = "错落宇宙",
}
local tyj__fuyi = fk.CreateViewAsSkill{
name = "tyj_heg__fuyi",
anim_type = "offensive",
prompt = "#tyj_heg__fuyi-invoke",
pattern = "duel",
card_filter = Util.FalseFunc,
times = function(self)
return Self.phase == Player.Play and 1 - Self:usedSkillTimes(self.name, Player.HistoryPhase) or -1
end,
view_as = function(self, cards)
local card = Fk:cloneCard("duel")
card.skillName = self.name
return card
end,
enabled_at_play = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
end,
after_use = function (self, player, use)
local room = player.room
if not player.dead then
local cardsp=#player:getCardIds('h')
local cardn = {}
room.logic:getEventsOfScope(GameEvent.MoveCards, 999, function(e)
for _, move in ipairs(e.data) do
if move.toArea == Card.DiscardPile then
for _, info in ipairs(move.moveInfo) do
if room:getCardArea(info.cardId) == Card.DiscardPile and Fk:getCardById(info.cardId).trueName == 'slash' then
table.insertIfNeed(cardn, info.cardId)
end
end
end
end
end, Player.HistoryTurn)
local n = cardsp - #cardn
if n > 0 then
room:askForDiscard(player, n, n, false, self.name, false)
elseif n < 0 then
player:drawCards(-n, self.name)
end
end
end,
}
tyj_niufu:addSkill(tyj__fuyi)
Fk:loadTranslationTable{
["tyj_heg__fuyi"] = "鈇疑",
[":tyj_heg__fuyi"] = "出牌阶段限一次,你可以视为使用【决斗】,然后将手牌数调整至本回合进入弃牌堆的【杀】数。",
["#tyj_heg__fuyi-invoke"]="鈇疑:你可以视为使用【决斗】,但是使用后会调整手牌。",
["$tyj_heg__fuyi1"]="诸君临我,如鼠蚁扰熊!",
["$tyj_heg__fuyi2"]="猛士如我,无惧天下雄兵。",
["~tyj_heg__niufu"]="金银径须取,勿伤我命!",
}
local tyj__fanchou = General:new(extension, "tyj_heg__fanchou", "qun", 4,4)
tyj__fanchou:addCompanions({--[["tyj_heg__hansui",]]"ld__dongzhuo"})
Fk:loadTranslationTable{
["tyj_heg__fanchou"] = "樊稠",
["#tyj_heg__fanchou"] = "挥军浊城",
["designer:tyj_heg__fanchou"] = "汤圆",
["cv:tyj_heg__fanchou"] = "官方",
["illustrator:tyj_heg__fanchou"] = "天纵世纪",
}
local tyj__zhuocheng = fk.CreateActiveSkill{
name = "tyj_heg__zhuocheng",
anim_type = "offensive",
can_use = function(self, player)
return not Self:isKongcheng() and #table.filter(Fk:currentRoom().alive_players,function(p) return p~=Self and not p:isKongcheng() end)>0
end,
card_num = 1,
target_num = 1,
card_filter = function (self, to_select, selected, selected_targets)
local card = Fk:getCardById(to_select)
return Fk:currentRoom():getCardArea(to_select) == Player.Hand and #selected == 0 and card.number and #table.filter(Fk:currentRoom().alive_players,function(p) return #table.filter(p:getCardIds("ej"),function(c) return Fk:getCardById(c).number and Fk:getCardById(c).number == card.number end)>0 end)>0
end,
target_filter = function (self, to_select, selected, selected_cards, card, extra_data)
if #selected ~= 0 or #selected_cards~= 1 then return false end
local card = Fk:getCardById(selected_cards[1])
local target = Fk:currentRoom():getPlayerById(to_select)
return target and #table.filter(target:getCardIds("ej"),function(cid) return Fk:getCardById(cid).number and Fk:getCardById(cid).number==card.number end)>0
end,
on_use = function (self, room, effect)
local player = room:getPlayerById(effect.from)
local target = room:getPlayerById(effect.tos[1])
local card = Fk:getCardById(effect.cards[1])
local cards = table.filter(target:getCardIds("ej"),function(cid) return Fk:getCardById(cid).number and Fk:getCardById(cid).number==card.number end)
if #cards>0 then
local get = room:askForCardsChosen(player, player, 1,1, {
card_data = {
{ "pile_discard", cards }
}
}, self.name, "浊城:选择要被加入你的【火烧连营】的牌")
if #get>0 then
local ucards = {effect.cards[1],get[1]}
local looting = Fk:cloneCard('burning_camps')
looting.skillName=self.name
looting:addSubcards(ucards)
if U.getDefaultTargets(player, looting, true)~=nil then
U.askForUseVirtualCard(room, player, "burning_camps", ucards, self.name, "#tyj_heg__zhuocheng-use:::"..looting:toLogString(), false, false, false, false, nil, false)
end
end
end
end,
}
tyj__fanchou:addSkill(tyj__zhuocheng)
Fk:loadTranslationTable{
["tyj_heg__zhuocheng"]="浊城",
[":tyj_heg__zhuocheng"]="出牌阶段,你可将一张手牌与场上一张点数相同的牌当【火烧连营】使用。",
["#tyj_heg__zhuocheng-use"] = "浊城:使用 %arg。",
["$tyj_heg__zhuocheng1"]="大兴兵争,长安当乱。",
["$tyj_heg__zhuocheng2"]="挥军入城,拨乱长安!",
["~tyj_heg__fanchou"]="李稚然,你这是何意?",
}
local tyj__zhangji = General:new(extension, "tyj_heg__zhangji", "qun", 4,4)
Fk:loadTranslationTable{
["tyj_heg__zhangji"] = "张济",
["#tyj_heg__zhangji"] = "屯凶肆掠",
["designer:tyj_heg__zhangji"] = "汤圆",
["cv:tyj_heg__zhangji"] = "官方",
["illustrator:tyj_heg__zhangji"] = "YanBai",
}
tyj__zhangji:addCompanions({"ld__zhangxiu"})
local tyj__xiongtun = fk.CreateTriggerSkill{
name="tyj_heg__xiongtun",
anim_type = "control",
events = {fk.EventPhaseStart},
can_trigger= function(self, event, target, player, data)
if player:hasSkill(self) and target == player and player.phase == Player.Finish then
return #table.filter(player.room.alive_players, function(p)
return #p:getCardIds("e") > 0 end)>0
end
end,
on_cost = function (self, event, target, player, data)
local room = player.room
local cards={}
local events1 = player.room.logic:getEventsOfScope(GameEvent.MoveCards, 999, function(e)
for _, move in ipairs(e.data) do
if move.toArea == Card.DiscardPile then
for _, info in ipairs(move.moveInfo) do
if info.cardId and player.room:getCardArea(info.cardId) == Card.DiscardPile then
if(Fk:getCardById(info.cardId,true).trueName=='slash') then
table.insertIfNeed(cards,info.cardId)
end
end
end
end
end
end, Player.HistoryTurn)
if #cards>0 then
local tos=table.filter(room.alive_players, function(p)
return #p:getCardIds("e")>0 and #p:getCardIds("e") <=#cards end)
local targets = room:askForChoosePlayers(player,table.map(tos, Util.IdMapper),1,1,"凶囤:令一名角色获得【杀】,你获得其装备区的一张牌",self.name,true)
if #targets>0 then
self.cost_data=targets[1]
return true
else return false end
else
return false end
end,
on_use = function (self, event, target, player, data)
local room = player.room
local cards={}
local target = room:getPlayerById(self.cost_data)
if target then
local events1 = player.room.logic:getEventsOfScope(GameEvent.MoveCards, 999, function(e)
for _, move in ipairs(e.data) do
if move.toArea == Card.DiscardPile then
for _, info in ipairs(move.moveInfo) do
if info.cardId and player.room:getCardArea(info.cardId) == Card.DiscardPile then
if(Fk:getCardById(info.cardId,true).trueName=='slash') then
table.insertIfNeed(cards,info.cardId)
end
end
end
end
end
end, Player.HistoryTurn)
if #cards>=#target:getCardIds('e') then
local get = room:askForCardsChosen(player, player, #target:getCardIds('e'),#target:getCardIds('e'), {
card_data = {
{ "pile_discard", cards }
}
}, self.name, "#tyj_heg__xiongtun-choose:::" .. tostring(#target:getCardIds('e')))
if #get>0 then
room:moveCardTo(get, Player.Hand, target, fk.ReasonJustMove, self.name, "", true, player.id)
if #get == #target:getCardIds('e') then
if not (player.dead or target.dead or #target:getCardIds("e") == 0) then
local id = room:askForCardChosen(player, target, "e", self.name)
room:obtainCard(player, id, true, fk.ReasonPrey)
end
end
end
end
end
end,
}
tyj__zhangji:addSkill(tyj__xiongtun)
Fk:loadTranslationTable{
["tyj_heg__xiongtun"]="凶屯",
[":tyj_heg__xiongtun"]="结束阶段,你可令一名角色获得本回合进入弃牌堆的X张【杀】,若如此做,你获得其装备区内一张牌(X为其装备区内牌数)。",
["#tyj_heg__xiongtun-choose"]="凶屯:选择 %arg 张【杀】令其获得",
["$tyj_heg__xiongtun1"]="今位轻势弱,才至屯军。",
["$tyj_heg__xiongtun2"]="一时弱劣,待雄厚之势必出。",
["~tyj_heg__zhangji"]="哪里来的乱箭?",
}
local ty_askForUseVirtualCard = function(room, player, name, subcards, skillName, prompt, cancelable, bypass_times, bypass_distances, extraUse, extra_data, skipUse,extra_cardData)
if player.dead then return end
subcards = subcards or {}
extraUse = (extraUse == nil) and true or extraUse
skillName = skillName or "virtual_viewas"
local all_names = type(name) == "table" and name or {name}
if (cancelable == nil) then cancelable = true end
if (bypass_times == nil) then bypass_times = true end
extra_data = extra_data or {}
extra_data.selected_subcards = subcards
extra_data.skillName = skillName
extra_data.virtualuse_allnames = all_names
extra_data.bypass_times = bypass_times
extra_data.bypass_distances = bypass_distances
local names = table.filter(all_names, function (n)
local card = Fk:cloneCard(n)
card:addSubcards(subcards)
card.skillName = skillName
card.extra_data = extra_cardData or {}
return card.skill:canUse(player, card, extra_data) and not player:prohibitUse(card)
and table.find(room.alive_players, function (p)
return not player:isProhibited(p, card) and card.skill:modTargetFilter(p.id, {}, player.id, card, not bypass_distances)
end)
end)
extra_data.virtualuse_names = names
local dat
if #names > 0 then
if not prompt then
if #all_names == 1 then
prompt = ("#askForUseVirtualCard:::"..skillName..":"..all_names[1])
else
prompt = ("#askForUseVirtualCards:::"..skillName..":"..#names)
end
end
_, dat = room:askForUseViewAsSkill(player, "virtual_viewas", prompt, cancelable, extra_data)
end
if #names == 0 then return end
local card, tos
if dat then
tos = dat.targets
card = Fk:cloneCard(dat.interaction or all_names[1])
card:addSubcards(subcards)
card.skillName = skillName
card.extra_data = extra_cardData or {}
else
if cancelable then return end
for _, n in ipairs(names) do
card = Fk:cloneCard(n)
card:addSubcards(subcards)
card.skillName = skillName
card.extra_data = extra_cardData or {}
local temp = U.getDefaultTargets(player, card, bypass_times, bypass_distances)
if temp then
tos = temp
break
end
end
end
if not tos then return end
local use = {
from = player.id,
tos = table.map(tos, function(p) return {p} end),
card = card,
extraUse = extraUse,
}
if not skipUse then
room:useCard(use)
end
return use
end
local tyj__xurong = General:new(extension, "tyj_heg__xurong", "qun", 4,4)
tyj__xurong:addCompanions({--[["tyj_heg__gongsundu"]]"ld__dongzhuo"})
Fk:loadTranslationTable{
["tyj_heg__xurong"] = "徐荣",
["#tyj_heg__xurong"] = "斩绝尽镬",
["designer:tyj_heg__xurong"] = "汤圆",
["cv:tyj_heg__xurong"] = "官方",
["illustrator:tyj_heg__xurong"] = "zoo",
}
local tyj__shajue = fk.CreateActiveSkill{
name = "tyj_heg__shajue",
anim_type = "offensive",
prompt = "杀绝:你可以将一名角色的最后一张牌当【决斗】使用",
can_use = function(self, player)
if #table.filter(Fk:currentRoom().alive_players,function(targetx) return #targetx:getCardIds('he')==1 and not table.contains(player:getTableMark("tyj_heg__shajue_used-phase"),targetx.id) end)>0 then
return true
end
return false
end,
card_filter = function (self, to_select, selected, selected_targets)
return false
end,
min_target_num = 1,
max_target_num = 1,
target_filter = function(self, to_select, selected, cards)
local targetx = Fk:currentRoom():getPlayerById(to_select)
if targetx and not table.contains(Self:getTableMark("tyj_heg__shajue_used-phase"),targetx.id) and #targetx:getCardIds("he") == 1 then
local card = Fk:cloneCard("duel")
card.skillName = "tyj_heg__shajue"
card.subcards=targetx:getCardIds("he")
return Self:canUse(card) and not Self:prohibitUse(card) and #table.filter(Fk:currentRoom().alive_players, function (p)
return not Self:isProhibited(p, card)
end)>0
end
end,
on_use = function (self, room, effect)
local player = room:getPlayerById(effect.from)
local target = room:getPlayerById(effect.tos[1])
local mark = player:getTableMark("tyj_heg__shajue_used-phase")
table.insertIfNeed(mark,target.id)
room:setPlayerMark(player,"tyj_heg__shajue_used-phase",mark)
if #target:getCardIds("he") == 1 then
local slash = Fk:cloneCard("duel")
slash.skillName = self.name
slash:addSubcard(target:getCardIds("he")[1])
slash.extra_data = slash.extra_data or {}
slash.extra_data.tyj_heg__shajue = {target.id}
local max_num = slash.skill:getMaxTargetNum(player, slash)
local targets = {}
for _, p in ipairs(room.alive_players) do
if player ~= p and not player:isProhibited(p, slash) then
table.insert(targets, p.id)
end
end
if #targets>0 or max_num>0 then
local tos = room:askForChoosePlayers(player, targets, 1, max_num, "#tyj_heg__shajue-use:::"..slash:toLogString(), self.name, true)
if #tos > 0 then
room:useCard({
from = player.id,
tos = table.map(tos, function(pid) return { pid } end),
card = slash,
})
end
end
end
end,
}
local tyj__shajue_damage = fk.CreateTriggerSkill{
visible = false,
name = "#tyj_heg__shajue_damage",
on_cost = function(self, event, target, player, data)
return true
end,
refresh_events = {fk.DamageInflicted},
mute = true,
can_refresh = function(self, event, target, player, data)
if player.dead or data.card == nil or target ~= player then return false end
local room = player.room
local use = data.card
return use.extra_data and use.extra_data.tyj_heg__shajue and not table.contains(use.extra_data.tyj_heg__shajue, player.id)
end,
on_refresh = function(self, event, target, player, data)
data.damage = data.damage + 1
end,
}
tyj__shajue:addRelatedSkill(tyj__shajue_damage)
tyj__xurong:addSkill(tyj__shajue)
Fk:loadTranslationTable{
["tyj_heg__shajue"]="杀绝",
[":tyj_heg__shajue"]="出牌阶段每名角色限一次,你可以将一名角色的最后一张牌当【决斗】使用(对其以外角色造成的伤害+1)。",
["#tyj_heg__shajue-use"] = "杀绝:使用【决斗】 ",
["tyj_heg__shajue_used-phase"]="已杀绝",
["$tyj_heg__shajue1"]="除根斩尽,以绝后顾。",
["$tyj_heg__shajue2"]="此敌,断不可留一人。",
["~tyj_heg__xurong"]="吾血战沙场,少有败绩,却落魄至此。",
}
local tyj__guosi = General:new(extension, "tyj_heg__guosi", "qun", 4,4)
tyj__guosi:addCompanions({"hs__jiaxu"})
Fk:loadTranslationTable{
["tyj_heg__guosi"] = "郭汜",
["#tyj_heg__guosi"] = "饲财觎命",
["designer:tyj_heg__guosi"] = "汤圆",
["cv:tyj_heg__guosi"] = "官方",
["illustrator:tyj_heg__guosi"] = "zoo",
}
local tyj__tanbei = fk.CreateViewAsSkill{
name = "tyj_heg__tanbei",
anim_type = "offensive",
prompt = "#tyj_heg__tanbei-snatch",
pattern = "snatch",
min_card_num = 0,
card_filter = Util.TrueFunc,
toput_cards={},
times = function(self)
if Self.phase == Player.Play then
if Self:getMark("@@tyj_heg__tanbei_double-phase")~=0 then
return 2-Self:usedSkillTimes(self.name, Player.HistoryPhase)
else
return 1 - Self:usedSkillTimes(self.name, Player.HistoryPhase)
end
end
return -1
end,
view_as = function(self, cards)
local card = Fk:cloneCard("snatch")
card.skillName = self.name
self.toput_cards=cards
return card
end,
enabled_at_play = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0 or (player:getMark("@@tyj_heg__tanbei_double-phase")~=0 and player:usedSkillTimes(self.name, Player.HistoryPhase) <2)
end,
before_use = function (self,player,use)
local room = player.room
if self.toput_cards and #self.toput_cards then
use.tyj_heg__tanbei=#self.toput_cards
local cards = table.filter(self.toput_cards, function(id) return room:getCardOwner(id) == player end)
if #cards>0 then
room:moveCards({
ids = cards,
from = player.id,
fromArea = Player.Hand,
toArea = Card.DrawPile,
moveReason = fk.ReasonPut,
skillName = self.name,
moveVisible = false,
})
end
end
end,
after_use = function (self,player,use)
local room = player.room
local duelc = use.tyj_heg__tanbei or 0
for _, pid in pairs(TargetGroup:getRealTargets(use.tos)) do
local target = room:getPlayerById(pid)
local usex = nil
local card = room:askForCard(target, duelc,#target:getCardIds('he'), true, self.name, true, ".", "#tyj_heg__tanbei-duel:::"..duelc)
if #card>=duelc then
usex = room:useVirtualCard("duel", card, target, player, self.name)
elseif #card == 0 and duelc == 0 then
local can = player.room:askForSkillInvoke(target, self.name, nil, "#tyj_heg__tanbei-duel0::"..player.id)
if can then
usex = room:useVirtualCard("duel", nil, target, player, self.name)
end
end
if usex==nil or (not (usex and usex.damageDealt and usex.damageDealt[player.id])) then
room:setPlayerMark(player,"@@tyj_heg__tanbei_double-phase",1)
end
end
end,
}
tyj__guosi:addSkill(tyj__tanbei)
Fk:loadTranslationTable{
["tyj_heg__tanbei"]="贪狈",
[":tyj_heg__tanbei"]="出牌阶段限一次,你可将至少0张牌置于牌堆顶,视为使用【顺手牵羊】,目标可将至少等量张牌(0张视为使用)当【决斗】对你使用,若你未因此受到伤害,本阶段改为限两次。",
["tyj_heg__xielu"]="挟掳",
[":tyj_heg__xielu"]="主将技,你使用基本或普通锦囊牌时时,若此牌仅有一个合法目标,则额外结算一次。",
["#tyj_heg__tanbei-duel0"]="贪狈:你可视为对 %dest 使用【决斗】。",
["#tyj_heg__tanbei-duel"]="贪狈:你可将至少 %arg 张牌当【决斗】对偷了你的牌的角色使用。",
["#tyj_heg__tanbei-snatch"]="贪狈:你可以将至少0张牌置于牌堆顶,视为使用【顺手牵羊】",
["@@tyj_heg__tanbei_double-phase"]="贪狈限两次",
["~tyj_heg__guosi"]="呃诶,我,竟抵不过他吕奉先!",
["$tyj_heg__tanbei1"]="威逼势迫,巧取豪夺!",
["$tyj_heg__tanbei2"]="予取予夺,盗亦有道。",
}
local tyj__lijue = General:new(extension, "tyj_heg__lijue", "qun", 4,4)
tyj__lijue:addCompanions({"hs__jiaxu"})
Fk:loadTranslationTable{
["tyj_heg__lijue"] = "李傕",
["#tyj_heg__lijue"] = "狡蟒谲算",
["designer:tyj_heg__lijue"] = "汤圆",
["cv:tyj_heg__lijue"] = "官方",
["illustrator:tyj_heg__lijue"] = "小牛",
}
local tyj__xiongsuan_active = fk.CreateActiveSkill{
name = "#tyj_heg__xiongsuan_active",
anim_type = "offensive",
card_num = 0,
target_num = 1,
visible=false,
mute = true,
card_filter = Util.FalseFunc,
prompt = function (self, selected, selected_cards)
return "#tyj_heg__xiongsuan-invoke:::" .. Self.hp
end,
target_filter = function(self, to_select, selected)
return #selected == 0 and to_select~=Self.id
end,
interaction = function()
local choose = {}
for i = 0, Self.hp, 1 do
table.insert(choose, tostring(i))
end
return UI.ComboBox {choices =choose}
end,
}
local tyj__xiongsuan = fk.CreateTriggerSkill{
name="tyj_heg__xiongsuan",
anim_type = "offensive",
events = {fk.EventPhaseStart},
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) and target == player and player.phase == Player.Start then
return #table.filter(player.room.alive_players, function (p)
return p~=player
end)>0
end
end,
on_cost = function (self, event, target, player, data)
local room = player.room
local success, dat = room:askForUseActiveSkill(player, "#tyj_heg__xiongsuan_active", "#tyj_heg__xiongsuan-invoke:::"..player.hp, true)
if success then
self.cost_data = {dat.targets[1],tonumber(dat.interaction)}
return true
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
local targetres = self.cost_data or {}
local targetdec = 0
local targetx = nil
if #targetres>0 and not player.dead and not room:getPlayerById(targetres[1]).dead then
targetx = room:getPlayerById(targetres[1])
room:doIndicate(player.id,{targetx.id})
local canpick = {"#tyj_heg__xiongsuan_target-recover"}
if #targetx:getCardIds('he')>0 then
canpick = {"#tyj_heg__xiongsuan_target-give","#tyj_heg__xiongsuan_target-recover"}
end
local result = room:askForChoice(targetx ,canpick, self.name,"#tyj_heg__xiongsuan_target-invoke:::"..player.hp,true,{"#tyj_heg__xiongsuan_target-give","#tyj_heg__xiongsuan_target-recover"})
if result then
if result == "#tyj_heg__xiongsuan_target-give" then
local cards = targetx:getCardIds("he")
if #cards > 0 then
cards = room:askForCard(targetx, 1, #cards, true, self.name, false, ".", "#tyj_heg__xiongsuan-give::"..player.id)
end
if #cards > 0 then
room:moveCardTo(cards, Player.Hand, player, fk.ReasonGive, self.name, nil, false, targetx.id)
targetdec = #cards
room:delay(500)
end
else
local mark = player:getMark("@tyj_heg__xiongsuan_recover-turn")
mark = mark+self.cost_data[2]
room:setPlayerMark(player,"@tyj_heg__xiongsuan_recover-turn",mark)
local mark = targetx:getMark("@tyj_heg__xiongsuan_recover-turn")
mark = mark+self.cost_data[2]
room:setPlayerMark(targetx,"@tyj_heg__xiongsuan_recover-turn",mark)
end
end
player:chat("我要砸你"..tostring(self.cost_data[2]).."点血!")
room:delay(1500)
local tonum =self.cost_data[2]-targetdec
room:damage{
from = player,
to = targetx,
damage = tonum,
skillName = self.name,
}
room:damage{
from = player,
to = player,
damage = self.cost_data[2],
skillName = self.name,
}
end
end,
refresh_events = {fk.TurnEnd},
can_refresh = function (self, event, target, player, data)
return player:getMark("@tyj_heg__xiongsuan_recover-turn")~=0 and player:isAlive()
end,
on_refresh = function (self, event, target, player, data)
local room = player.room
local mark = player:getMark("@tyj_heg__xiongsuan_recover-turn")
if player:isWounded() then
room:recover({
who = player,
num = mark,
recoverBy = player,
skillName = self.name
})
end
end,
}
tyj__xiongsuan:addRelatedSkill(tyj__xiongsuan_active)
tyj__lijue:addSkill(tyj__xiongsuan)
Fk:loadTranslationTable{
["tyj_heg__xiongsuan"]="凶算",
[":tyj_heg__xiongsuan"]="准备阶段,你可以秘密选择一个至多为你的体力值的自然数,对你与一名其他角色各造成等量点伤害。你在公布伤害值前令其选择一项:1.交给你任意张牌以减少其受到的等量点伤害;2.本回合结束时与你各回复伤害值点体力。",
["#tyj_heg__xiongsuan_fenpei-invoke"]="凶算:选择分配给 %dest 的伤害值,剩余的伤害值将分配给你。",
["$tyj_heg__xiongsuan1"]="狡狐着悍狼之铠,智堪运筹、威慑千军。",
["$tyj_heg__xiongsuan2"]="没有点算计,怎能立于乱世。",
--["$tyj_heg__xiongsuan1"]="彭越挠楚,奉先可击。",
--["$tyj_heg__xiongsuan2"]="分兵多路,首尾不能互应。",
["~tyj_heg__lijue"]="曹贼,你竟灭我三族!",
["@tyj_heg__xiongsuan_recover-turn"]="凶算回复",
["#tyj_heg__xiongsuan_active"]="凶算",
["#tyj_heg__xiongsuan-invoke"]="凶算:选择一个至多为 %arg 的正整数,对你与一名其他角色造成等量点伤害。",
["#tyj_heg__xiongsuan_target-invoke"]="凶算:你即将受到至多 %arg 点伤害,你须选择以下一项",
["#tyj_heg__xiongsuan_target-give"]="交出牌",
[":#tyj_heg__xiongsuan_target-give"]="交给对方任意张牌,减少受到的等量点伤害。",
["#tyj_heg__xiongsuan_target-recover"]="回复体力",
[":#tyj_heg__xiongsuan_target-recover"]="本回合结束时,与对方各回复受到的伤害值点体力。",
["#tyj_heg__xiongsuan-give"] = "凶算:选择至少一张牌交给 %dest",
["#tyj_heg__xiongsuan_say"]="我要砸你 %arg 点血!",
}
local tyj__mawan = General:new(extension, "tyj_heg__mawan", "qun", 4,4)
tyj__mawan:addCompanions({"tyj__hansui","tyj_heg__machao"})
Fk:loadTranslationTable{
["tyj_heg__mawan"] = "马玩",
["#tyj_heg__mawan"] = "联起芜北",
["designer:tyj_heg__mawan"] = "汤圆",
["cv:tyj_heg__mawan"] = "官方",
["illustrator:tyj_heg__mawan"] = "官方",
}
local tyj__wulian = fk.CreateViewAsSkill{
name = "tyj_heg__wulian",
anim_type = "offensive",
pattern = "slash",
card_filter = function(self, to_select, selected)
if #selected >=3 then return false end
return true
end,
view_as = function(self, cards)
if #cards < 1 then return nil end
local c = Fk:cloneCard("slash")
c.skillName = self.name
c:addSubcards(cards)
return c
end,
before_use = function(self, player, use)
local damage = -1
damage=damage+#table.filter(use.card.subcards,function(c)
return Fk:getCardById(c).type == Card.TypeEquip
end)
use.additionalDamage = damage
end,
enabled_at_response = function(self, player, response)
return not response
end,
}
local tyj__wulian_target = fk.CreateTargetModSkill {
name = "#tyj_heg__wulian_target",
mute=true,
extra_target_func = function(self, player, skill, card)
if card and table.contains(card.skillNames, "tyj_heg__wulian") and card.subcards then
return #card.subcards-1
end
return 0
end,
}
local tyj__wulian_trigger = fk.CreateTriggerSkill{
visible = false,
events={fk.AfterCardTargetDeclared},
name = "#tyj_heg__wulian_trigger",
mute=true,
can_trigger=function (self, event, target, player, data)
if target == player then
return data.card and table.contains(data.card.skillNames, "tyj_heg__wulian") and data.tos and #TargetGroup:getRealTargets(data.tos) >0
end
end,
on_cost = function(self, event, target, player, data)
return true
end,
on_use = function (self, event, target, player, data)
local room = player.room
room:doIndicate(player.id, TargetGroup:getRealTargets(data.tos))
local targets = table.filter(TargetGroup:getRealTargets(data.tos), function(p) return not room:getPlayerById(p):isNude() end)
local targetsx={}
for _, p in ipairs(targets) do
table.insert(targetsx,room:getPlayerById(p))
end
local extraData = {
num = 1,
min_num = 1,
include_equip = true,
pattern = ".|.|.|.|.|equip",
reason = self.name,
}
for _, p in ipairs(targets) do
room:getPlayerById(p).request_data = json.encode({"choose_cards_skill", "#tyj_heg__wulian-card::"..player.id,true, extraData})
end
room:notifyMoveFocus(targetsx, self.name)
room:doBroadcastRequest("AskForUseActiveSkill", targetsx)
local changetarget={}
for _, p in ipairs(targetsx) do
if p.reply_ready then
local replyCard = json.decode(p.client_reply).card
local id = json.decode(replyCard).subcards[1]
if U.canMoveCardIntoEquip(player,id, true) then
room:doIndicate(p.id,{player.id})
U.moveCardIntoEquip(room,player, id, self.name, true, p)
local ptargets=table.clone(TargetGroup:getRealTargets(data.tos))
for i=1,#ptargets do
if ptargets[i] == p.id then
table.remove(ptargets,i)
end
end
if #ptargets > 0 then
local to = player.room:askForChoosePlayers(p,ptargets,
1, 1, "芜联:令一名其他目标代替你成为目标", self.name, false, true)
if #to > 0 then
table.insert(changetarget,{p.id,to[1]})
end
end
end
end
end
if #changetarget >0 then
for _, p in ipairs(changetarget) do
room:doIndicate(p[1],{p[2]})
TargetGroup:removeTarget(data.tos,p[1])
TargetGroup:pushTargets(data.tos,{p[2]})
end
end
end,
}
local mawan_mashu = fk.CreateDistanceSkill{
name = "tyj_heg__mawanmashu",
frequency = Skill.Compulsory,
correct_func = function(self, from, to)
if from:hasSkill(self) then
return -1
end
end,
}
tyj__wulian:addRelatedSkill(tyj__wulian_target)
tyj__wulian:addRelatedSkill(tyj__wulian_trigger)
tyj__mawan:addSkill(tyj__wulian)
tyj__mawan:addSkill(mawan_mashu)
Fk:loadTranslationTable{
["tyj_heg__wulian"]="芜联",
["#tyj_heg__wulian_trigger"]="芜联",
[":tyj_heg__wulian"]="你可以将至多三张牌当作目标上限为牌数且伤害基数为X的【杀】使用(X为其中的装备牌数),此【杀】指定目标时令此牌的目标同时选择是否将一张装备牌置于你的装备区以将其的目标转移给一名不为其的目标。",
["$tyj_heg__wulian1"]="诸军并起,无终岁计。",
["$tyj_heg__wulian2"]="自遭荒乱,率乏粮谷。",
["tyj_heg__mawanmashu"]="马术",
[":tyj_heg__mawanmashu"]="锁定技,你计算与其他角色的距离-1。",
["~tyj_heg__mawan"]="楼班尚且年幼。",
["#tyj_heg__wulian-card"]="芜联:你可以选择将一张装备牌置于 %dest 的装备区以转移自己的目标",
}
local tyj__machao = General:new(extension, "tyj_heg__machao", "qun", 4,4)
tyj__machao:addCompanions({"hs__mateng","tyj_heg__mawan","hs__pangde"})
Fk:loadTranslationTable{
["tyj_heg__machao"] = "马超",
["#tyj_heg__machao"] = "凉州铁骑",
["designer:tyj_heg__machao"] = "汤圆",
["cv:tyj_heg__machao"] = "官方",
["illustrator:tyj_heg__machao"] = "青学",
}
local tyj__tieji = fk.CreateTriggerSkill{
name = "tyj_heg__tieji",
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" and not player.room:getPlayerById(data.to).dead
end,
on_cost = function(self, event, target, player, data)
local room = player.room
if room:askForSkillInvoke(player, self.name, nil, "#tyj_heg__tieji-invoke::"..data.to) then
return true
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
local totaregt = room:getPlayerById(data.to)
local tos = {}
for _, ts in ipairs({player,totaregt}) do
if #table.filter(room.alive_players, function(p) return ts:canMoveCardsInBoardTo(p, 'e') end)>0 then
table.insert(tos,ts.id)
end
end
if #tos>0 then
local p2 = room:askForChoosePlayers(player, tos, 1, 1, "铁骑:选择要被移动场上牌的角色", self.name,false)
if #p2 ~= 0 then
local to = room:getPlayerById(p2[1])
local targets = table.filter(room.alive_players, function(p) return to:canMoveCardsInBoardTo(p, 'e') end)
if #targets > 0 then
local t = room:askForChoosePlayers(player, table.map(targets, Util.IdMapper), 1, 1, "#tyj_heg__tieji-move::"..to.id, self.name, false)
if #t > 0 then
local move = room:askForMoveCardInBoard(player, to, room:getPlayerById(t[1]), self.name,'e', to, {})
if move and to==player then
room:doIndicate(player.id, {data.to})
room:addPlayerMark(room:getPlayerById(data.to), "@@tyj_heg__tieji-turn")
room:addPlayerMark(room:getPlayerById(data.to), MarkEnum.UncompulsoryInvalidity .. "-turn")
data.disresponsive = true
end
end
end
end
--[[local to = room:askForChooseToMoveCardInBoard(player, "#tyj__tieji-choose", self.name, true, "e")
if #to == 2 then
local move=room:askForMoveCardInBoard(player, room:getPlayerById(to[1]), room:getPlayerById(to[2]), self.name, "e")
if move and to[1]==player.id then
room:doIndicate(player.id, {data.to})
room:addPlayerMark(room:getPlayerById(data.to), "@@tyj__tieji-turn")
room:addPlayerMark(room:getPlayerById(data.to), MarkEnum.UncompulsoryInvalidity .. "-turn")
data.disresponsive = true
end
end]]--
end
end,
}
local machao_mashu = fk.CreateDistanceSkill{
name = "tyj_heg__machaomashu",
frequency = Skill.Compulsory,
correct_func = function(self, from, to)
if from:hasSkill(self) then
return -1
end
end,
}
tyj__machao:addSkill(tyj__tieji)
tyj__machao:addSkill(machao_mashu)
Fk:loadTranslationTable{
["tyj_heg__tieji"]="踏阵",
[":tyj_heg__tieji"]="你使用【杀】指定目标后,可以移动你或目标场上的一张牌,若为你的牌则其不能响应此【杀】且本回合非锁定技失效。",
["#tyj_heg__tieji-invoke"]="是否发动 铁骑 移动你或 %dest 的一张牌",
["#tyj_heg__tieji-choose"]="铁骑:移动场上的一张牌,若为你的牌则令此【杀】不可响应且目标非锁定技失效。",
["@@tyj_heg__tieji-turn"]="被铁骑",
["$tyj_heg__tieji1"]="良驹健儿,破营溃军!",
["$tyj_heg__tieji2"]="整装列队,趁势破敌!",
["~tyj_heg__machao"]="马失,前蹄...",
["#tyj_heg__tieji-move"] = "铁骑:选择一名角色,将 %dest 的牌移至该角色的场上",
["tyj_heg__tieji_hand"] = "移动手牌",
["tyj_heg__tieji_equip"] = "移动装备区牌",
["tyj_heg__machaomashu"]="马术",
[":tyj_heg__machaomashu"]="锁定技,你计算与其他角色的距离-1。",
}
local tyj__dongxie = General(extension, "tyj_heg__dongxie", "qun", 4,4,General.Female)
tyj__dongxie:addCompanions({"tyj_heg__niufu","ld__dongzhuo"})
Fk:loadTranslationTable{
["tyj_heg__dongxie"] = "董翓",
["#tyj_heg__dongxie"] = "狡狐鸣凶",
["designer:tyj_heg__dongxie"] = "汤圆",
["cv:tyj_heg__dongxie"] = "官方",
["illustrator:tyj_heg__dongxie"] = "凝聚永恒",
}
local tyj__jiaoxia = fk.CreateViewAsSkill{
name = "tyj_heg__jiaoxia",
anim_type = "offensive",
prompt = "狡黠:将一张牌当【推心置腹】使用。",
pattern = "sincere_treat",
times = function(self)
return Self.phase == Player.Play and 1 - Self:usedSkillTimes(self.name, Player.HistoryPhase) or -1
end,
card_filter= function (self, to_select, selected)
return #selected == 0
end,
view_as = function(self, cards)
if #cards ~= 1 then
return nil
end
local card = Fk:cloneCard("sincere_treat")
card.skillName = self.name
card:addSubcards(cards)
return card
end,
before_use = function (self, player, use)
use.extra_data=use.extra_data or {}
use.extra_data.tyj_heg__jiaoxia_user = player.id
end,
enabled_at_play = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
end,
}
local tyj_heg__jiaoxia_delay = fk.CreateTriggerSkill{
visible = false,
name = "#tyj_heg__jiaoxia_delay",
events = {fk.AfterCardsMove},
mute = true,
can_trigger = function(self, event, target, player, data)
local e = player.room.logic:getCurrentEvent():findParent(GameEvent.CardEffect)
if e then
local use = e.data[1]
if table.contains(use.card.skillNames, "tyj_heg__jiaoxia") then
local ids = {}
for _, move in ipairs(data) do
if move.toArea == Card.PlayerHand and move.to == player.id then
for _, info in ipairs(move.moveInfo) do
if table.contains(player:getCardIds("h"), info.cardId) then
table.insertIfNeed(ids, info.cardId)
end
end
end
end
if #ids > 0 then
self.cost_data = ids
return true
end
end
end
end,
on_cost = Util.TrueFunc,
on_use = function(self, event, target, player, data)
local room = player.room
local ids = self.cost_data
local e = player.room.logic:getCurrentEvent():findParent(GameEvent.CardEffect)
if e then
local use = e.data[1]
local me = room:getPlayerById(use.extra_data.tyj_heg__jiaoxia_user)
me:showCards(ids)
room:delay(500)
local mark = me:getTableMark("@$tyj__jiaoxia_sha-round")
table.insertTableIfNeed(mark,ids)
room:setPlayerMark(me,"@$tyj__jiaoxia_sha-round",mark)
end
end,
refresh_events = {fk.Damage,fk.PreCardUse},
can_refresh = function (self, event, target, player, data)
if event == fk.Damage then
if target == player and #player:getTableMark("@$tyj__jiaoxia_sha-round")>0 then
return true
end
else
return target == player and table.contains(data.card.skillNames, "#tyj_heg__jiaoxia_filter")
end
end,
on_refresh = function (self, event, target, player, data)
local room =player.room
if event == fk.Damage then
room:setPlayerMark(player,"@$tyj__jiaoxia_sha-round",0)
else
data.extraUse = true
end
end
}
local tyj_heg__jiaoxia_filter = fk.CreateFilterSkill{
name = "#tyj_heg__jiaoxia_filter",
visible = false,
anim_type = "negative",
card_filter = function(self, to_select, player,isJudgeEvent)
local room = Fk:currentRoom()
return #table.filter(room.alive_players,function (p)
return table.contains(p:getTableMark("@$tyj__jiaoxia_sha-round"),to_select.id)
end)>0 and
(table.contains(player.player_cards[Player.Hand], to_select.id) or isJudgeEvent)
end,
view_as = function(self, to_select)
local card = Fk:cloneCard("slash", Card.Heart, to_select.number)
card.skillName = self.name
return card
end,
}
local tyj_heg__jiaoxia_targetmod = fk.CreateTargetModSkill{
name = "#tyj_heg__jiaoxia_targetmod",
bypass_times = function(self, player, skill, scope, card)
return card and table.contains(card.skillNames, "#tyj_heg__jiaoxia_filter")
end,
}
local tyj__xiongjun = H.CreateArraySummonSkill{
name = "tyj_heg__xiongjun",
array_type = "formation",
}
local tyj_heg__xiongjun_trigger = fk.CreateTriggerSkill{ -- FIXME
name = "#tyj_heg__xiongjun_trigger",
visible=false,
times = function(self)
return 1 - Self:usedSkillTimes(self.name, Player.HistoryTurn)
end,
frequency = Skill.Compulsory,
events = {fk.Damage},
mute = true,
can_trigger = function(self, event, target, player, data)
return player:usedSkillTimes(self.name,Player.HistoryTurn)==0 and player:hasSkill(tyj__xiongjun) and #player.room.alive_players >= 4 and H.inFormationRelation(player, target)
end,
on_cost = function (self, event, target, player, data)
return true
end,
on_use = function(self, event, target, player, data)
local room = player.room
--player:addSkillUseHistory(self.name,1)
room:notifySkillInvoked(player, tyj__xiongjun.name)
player:broadcastSkillInvoke(tyj__xiongjun.name)
for _, p in ipairs(room.alive_players) do
if H.inFormationRelation(p, player) and target~=p then
p:drawCards(1,tyj__xiongjun.name)
end
end
end,
}
tyj__xiongjun:addRelatedSkill(tyj_heg__xiongjun_trigger)
tyj__jiaoxia:addRelatedSkill(tyj_heg__jiaoxia_delay)
tyj__jiaoxia:addRelatedSkill(tyj_heg__jiaoxia_filter)
tyj__jiaoxia:addRelatedSkill(tyj_heg__jiaoxia_targetmod)
tyj__dongxie:addSkill(tyj__jiaoxia)
--tyj__dongxie:addSkill(tyj__xiongjun)
Fk:loadTranslationTable{
["tyj_heg__jiaoxia"]="狡黠",
[":tyj_heg__jiaoxia"]="出牌阶段限一次,你可以将一张牌当【推心置腹】使用,并展示你获得与交出的牌,这些牌本轮视为不计入次数的【杀】直到你造成伤害后。",
["tyj_heg__xiongjun"]="凶军",
["@$tyj__jiaoxia_sha-round"]="狡黠",
["tyj_heg__jiaoxia_filter"]="狡黠",
["#tyj_heg__jiaoxia_filter"]="狡黠",
[":tyj_heg__xiongjun"]="阵法技,每回合限一次,与你处在同一队列的角色造成伤害后,此队列中其以外的角色各摸一张牌。",
["$tyj_heg__jiaoxia1"]="暗剑匿踪,现时必捣黄龙。",
["$tyj_heg__jiaoxia2"]="袖中藏刃,欲取诸君之头。",
["$tyj_heg__xiongjun1"]="青锋绕指柔,将军可愿提头来见?",
["$tyj_heg__xiongjun2"]="我视诸君如豕犬,杀剐不过覆手之间。",
["~tyj_heg__dongxie"] = "覆巢之下,断无完卵余生。",
}
Fk:addPoxiMethod {
name = "tyj_heg__tanyi_poXi",
card_filter = function(to_select, selected,data,extra_data)
if extra_data == nil then return false end
if #selected == 0 then return Fk:getCardById(to_select).number<=(extra_data or 0) end
local num = Fk:getCardById(to_select).number
for _, cid in ipairs(selected) do
num=num+Fk:getCardById(cid).number
end
return num<=(extra_data or 0)
end,
feasible = function(selected)
return true
end,
prompt = function(data,extra_data)
return "贪异:选择其中点数和不大于"..tostring(extra_data or 0).."的任意张牌"
end
}
local tyj__tanyi = fk.CreateActiveSkill{
name = "tyj_heg__tanyi",
anim_type = "offensive",
card_num = 0,
target_num = 1,
can_use = function(self, player)
return not player:isKongcheng() and (player:usedSkillTimes(self.name,Player.HistoryPhase)==0 or (player:usedSkillTimes(self.name,Player.HistoryPhase)<2 and player:getMark("@@tyj_heg__tanyi_double-phase")~=0))
end,
card_filter = Util.FalseFunc,
target_filter = function(self, to_select, selected)
return #selected == 0 and to_select ~= Self.id and Self:canPindian(Fk:currentRoom():getPlayerById(to_select))
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
local target = room:getPlayerById(effect.tos[1])
room:doIndicate(effect.from,{effect.tos[1]})
local pindian = player:pindian({target}, self.name)
local winner = nil
local loser=nil
if pindian.results[target.id].winner == player then
winner=player
loser=target
elseif pindian.results[target.id].winner == target then
winner=target
loser=player
end
if winner ~= nil and loser ~= nil then
local num = 0
num=num+pindian.fromCard.number
num=num+pindian.results[target.id].toCard.number
local cards = winner:getCardIds('he')
if #cards>0 then
winner:showCards(cards)
local cardsgain=room:askForPoxi(loser, "tyj_heg__tanyi_poXi", {
{ self.name, cards },
},num, true)
if #cardsgain >0 then
room:obtainCard(loser, cards, false, fk.ReasonPrey,loser.id,self.name)
if loser == player then
local showc = {}
for _, cid in ipairs(cards) do
if Fk:getCardById(cid, true).type == Card.TypeEquip then
table.insertIfNeed(showc,cid)
end
end
if #showc >0 then
player:showCards(showc)
room:setPlayerMark(player,"@@tyj_heg__tanyi_double-phase",1)
end
end
end
local cardx= Fk:cloneCard("slash")
local use = {
from = winner.id,
tos = {{loser.id}},
card = cardx,
}
use.card.skillName = self.name
if U.canUseCardTo(room, winner, loser, cardx, false, false) then
room:useCard(use)
end
end
end
end,
}
local tyj__huaiyi = fk.CreateTriggerSkill{
name = "tyj_heg__huaiyi",
events = {fk.AfterCardsMove},
can_trigger = function (self, event, target, player, data)
if player:hasSkill(self) then
for _, move in ipairs(data) do
if move.to == player.id and move.toArea == Player.Hand then
for _, info in ipairs(move.moveInfo) do
if Fk:getCardById(info.cardId, true).type == Card.TypeEquip then
return true
end
end
end
end
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
local ids = {}
for _, move in ipairs(data) do
if move.to == player.id and move.toArea == Player.Hand then
for _, info in ipairs(move.moveInfo) do
if Fk:getCardById(info.cardId, true).type == Card.TypeEquip then
table.insertIfNeed(ids,info.cardId)
end
end
end
end
player:showCards(ids)
room:delay(800)
local mark = player:getMark("@tyj_heg__tanyi_double")
mark = mark+1
room:setPlayerMark(player,"@tyj_heg__tanyi_double",mark)
end,
}
local tyj__guohuai = General(extension, "tyj_heg__guohuai", "wei", 4,4)
tyj__guohuai:addCompanions({"hs__xiahouyuan","hs__zhanghe"})
Fk:loadTranslationTable{
["tyj_heg__guohuai"] = "郭淮",
["#tyj_heg__guohuai"] = "垂问秦雍",
["designer:tyj_heg__guohuai"] = "汤圆",
["cv:tyj_heg__guohuai"] = "官方",
["illustrator:tyj_heg__guohuai"] = "DH",
}
local tyj__zhangyu = fk.CreateViewAsSkill{
name = "tyj_heg__zhangyu",
pattern = "jink,nullification",
prompt = function (self)
if Fk.currentResponsePattern ~= nil and Exppattern:Parse(Fk.currentResponsePattern):match(Fk:cloneCard("jink")) then
return "嶂御:你可以将一张手牌当【闪】使用";
elseif Fk.currentResponsePattern ~= nil and Exppattern:Parse(Fk.currentResponsePattern):match(Fk:cloneCard("heg__nullification")) then
return "嶂御:你可以将一张装备牌当【无懈可击·国】使用";
else
return "嶂御:将装备牌当【无懈可击·国】使用,或手牌当【闪】使用";
end
end,
interaction = function()
local all_names = { "jink", "nullification"}
local names1 = {}
if #Self:getCardIds('h')>Self:getMaxCards() then
table.insert(names1,'jink')
end
if #Self:getCardIds('h')<=#Self:getCardIds('e') then
table.insert(names1,'nullification')
end
local names = U.getViewAsCardNames(Self, "tyj_heg__zhangyu", names1, {})
if #names > 0 then
return UI.ComboBox { choices = names, all_choices = all_names }
end
end,
card_filter = function (self, to_select, selected)
if self.interaction.data then
if self.interaction.data == "jink" then
return #selected == 0 and Fk:currentRoom():getCardArea(to_select) == Player.Hand
elseif self.interaction.data == "nullification" then
return #selected == 0 and Fk:getCardById(to_select).type == Card.TypeEquip
else
return false
end
end
return false
end,
view_as = function(self, cards)
if #cards ~= 1 or not self.interaction.data then return end
if self.interaction.data == "nullification" then
self.interaction.data ="heg__nullification"
end
local card = Fk:cloneCard(self.interaction.data)
card:addSubcards(cards)
card.skillName = self.name
return card
end,
enabled_at_play = function(self, player)
return false
end,
enabled_at_response = function(self, player, response)
if Fk.currentResponsePattern ~= nil then
for _, name in ipairs({"jink", "nullification"}) do
local card = Fk:cloneCard(name)
card.skillName = self.name
if Exppattern:Parse(Fk.currentResponsePattern):match(card) then
if name == "jink" then
return #Self:getCardIds('h')>Self:getMaxCards()
elseif name == "nullification" then
return #Self:getCardIds('h')<=#Self:getCardIds('e') and not response
end
end
end
end
end,
}
tyj__guohuai:addSkill(tyj__zhangyu)
Fk:loadTranslationTable{
["tyj_heg__zhangyu"]="嶂御",
[":tyj_heg__zhangyu"]="若你的手牌数:不大于装备区内的牌数,你可以将一张装备牌当【无懈可击·国】使用;大于手牌上限,你可以将一张手牌当【闪】使用。",
["$tyj_heg__zhangyu1"]="吾已料敌布防,蜀军休想进犯!",
["$tyj_heg__zhangyu2"]="诸君依策行事,定保魏境无虞。",
["~tyj_heg__guohuai"]="岂料姜维,空手接剑。",
}
local tyj__chenjiao = General(extension, "tyj_heg__chenjiao", "wei", 3,3)
tyj__chenjiao:addCompanions({"hs__caoren"})
Fk:loadTranslationTable{
["tyj_heg__chenjiao"] = "陈矫",
["#tyj_heg__chenjiao"] = "刚断骨鲠",
["designer:tyj_heg__chenjiao"] = "汤圆",
["cv:tyj_heg__chenjiao"] = "官方",
["illustrator:tyj_heg__chenjiao"] = "青岛君桓",
}
local tyj__xieshou = fk.CreateTriggerSkill{
events = {fk.Damaged},
name = "tyj_heg__xieshou",
can_trigger = function (self, event, target, player, data)
if player:hasSkill(self) and target:isAlive() then
return #table.filter(player.room.alive_players, function(p) return p.hp < target.hp end)==0 and (player.faceup or not player.chained)
end
end,
on_cost = function (self, event, target, player, data)
local room = player.room
local all_choices = {"横置","叠置","Cancel"}
local choices = {}
if not player.chained then
table.insert(choices,"横置")
end
if player.faceup then
table.insert(choices,"叠置")
end
table.insert(choices,"Cancel")
if #choices>0 then
local choice = room:askForChoice(player, choices, self.name,"#tyj_heg__xieshou-invoke::"..target.id,false,all_choices)
if choice~="Cancel" then
self.cost_data = choice
return true
end
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
room:doIndicate(player.id,{target.id})
if self.cost_data and self.cost_data ~= nil then
if self.cost_data == "横置" then
player:setChainState(true)
target:drawCards(2,self.name)
if player.faceup and not target:hasSkill(self.name,true,true) then
local result = room:askForSkillInvoke(player,self.name,nil,"#tyj_heg__xieshou_turn-invoke::"..target.id)
if result then
if player.faceup then
player:turnOver()
end
room:handleAddLoseSkills(target,self.name, nil, true, false)
end
end
elseif self.cost_data == "叠置" then
if player.faceup then
player:turnOver()
end
target:drawCards(2,self.name)
if not player.chained and not target:hasSkill(self.name,true,true) then
local result = room:askForSkillInvoke(player,self.name,nil,"#tyj_heg__xieshou_chain-invoke"..target.id)
if result then
player:setChainState(true)
room:handleAddLoseSkills(target,self.name, nil, true, false)
end
end
end
end
end,
}
local tyj__qizi = fk.CreateTriggerSkill{
name="tyj_heg__qizi",
events = {fk.EnterDying},
times = function(self)
return 1 - Self:usedSkillTimes(self.name, Player.HistoryRound)
end,
can_trigger = function (self, event, target, player, data)
if H.compareKingdomWith(player,target) and player:hasSkill(self) then
return player:usedSkillTimes(self.name,Player.HistoryRound)==0 and #table.filter(player.room.alive_players, function(p) return p~=player.room.current and p:distanceTo(target)>1 end)>0 and #player:getCardIds('he')>0
end
end,
on_cost = function (self, event, target, player, data)
local room = player.room
local tos = table.filter(player.room.alive_players, function(p) return p~=player.room.current and p:distanceTo(target)>1 end)
if #tos>0 then
local to, cid = room:askForChooseCardAndPlayers(player, table.map(tos,Util.IdMapper), 1, 1, nil,"#tyj_heg__qizi_discard-invoke::"..target.id, self.name, true)
if #to>0 and cid then
self.cost_data = {cid,to[1]}
return true
end
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
local cost = self.cost_data or {}
if #cost >1 then
room:throwCard(cost[1],self.name,player,player)
local to = room:getPlayerById(cost[2])
room:doIndicate(player.id,{to.id})
room:setPlayerMark(to, "@@tyj__qizi_remove", 1)
room:setPlayerMark(to, MarkEnum.PlayerRemoved, 1)
room:handleAddLoseSkills(to, "#tyj_heg__qizi_lure_tiger_prohibit|#tyj_heg__qizi__lure_tiger_hp", nil, false, true) -- global...
room.logic:trigger("fk.RemoveStateChanged", to, nil)
end
end,
refresh_events = {fk.TurnStart},
can_refresh = function (self, event, target, player, data)
return target == player and player:getMark("@@tyj__qizi_remove")~=0
end,
on_refresh = function (self, event, target, player, data)
local room = player.room
room:setPlayerMark(target, "@@tyj__qizi_remove", 0)
room:setPlayerMark(target, MarkEnum.PlayerRemoved, 0)
end,
}
local lureTigerProhibit = fk.CreateProhibitSkill{
name = "#tyj_heg__qizi_lure_tiger_prohibit",
-- global = true,
prohibit_use = function(self, player, card)
return player:getMark("@@tyj__qizi_remove") ~= 0
end,
is_prohibited = function(self, from, to, card)
return to:getMark("@@tyj__qizi_remove") ~= 0
end,
}
local lureTigerHp = fk.CreateTriggerSkill{
name = "#tyj_heg__qizi__lure_tiger_hp",
-- global = true,
refresh_events = {fk.PreHpRecover, fk.PreHpLost, fk.DamageInflicted},
can_refresh = function(self, event, target, player, data)
return target == player and player:getMark("@@tyj__qizi_remove") ~= 0
end,
on_refresh = function(self, event, target, player, data)
if event == fk.DamageInflicted then
data.damage = 0
else
data.num = 0
end
return true
end,
}
Fk:addSkill(lureTigerProhibit)
Fk:addSkill(lureTigerHp)
tyj__chenjiao:addSkill(tyj__xieshou)
tyj__chenjiao:addSkill(tyj__qizi)
Fk:loadTranslationTable{
["tyj_heg__xieshou"]="协守",
[":tyj_heg__xieshou"]="有角色受到伤害后,若其的体力值为全场最小,你可以横置或将平置的武将牌叠置以令其摸两张牌,然后你可以执行另一项以令其获得此技能。",
["tyj_heg__qizi"]="弃子",
[":tyj_heg__qizi"]="每轮限一次,同势力角色进入濒死时,你可以弃置一张牌以令一名距离其大于1且不在执行回合的角色视为被【调虎离山】至后者的回合开始时。",
["$tyj_heg__xieshou1"]="此城所能守者,在你我之协力。",
["$tyj_heg__xieshou2"]="今与将军协力守城,人在则城在。",
["$tyj_heg__qizi1"]="今诸君众志成城,纵金石之力亦难破之。",
["$tyj_heg__qizi2"]="矫性谨,将军性烈,二者相佐,其利断金。",
["~tyj_heg__chenjiao"]="矫既死,则魏再无直臣哉。",
["#tyj_heg__xieshou-invoke"]="协守:是否横置或将平置的武将牌叠置以令 %dest 摸两张牌。",
["#tyj_heg__xieshou_turn-invoke"]="协守:是否将武将牌叠置以令 %dest 获得〖协守〗。",
["#tyj_heg__xieshou_chain-invoke"]="协守:是否将武将牌横置以令 %dest 获得〖协守〗。",
["#tyj_heg__qizi_discard-invoke"]="是否弃置一张牌以发动 弃子 令一名距离 %dest 大于1的角色视为被【调虎离山】?",
["#tyj_heg__qizi_remove-invoke"]="弃子:你可以选择一个距离 %dest 大于1的角色,令其视为被【调虎离山】。",
["@@tyj__qizi_remove"]="调虎离山",
}
local tyj__huojun = General(extension, "tyj_heg__huojun", "shu", 4,4)
Fk:loadTranslationTable{
["tyj_heg__huojun"] = "霍峻",
["#tyj_heg__huojun"] = "葭萌雄狮",
["designer:tyj_heg__huojun"] = "汤圆",
["cv:tyj_heg__huojun"] = "官方",
["illustrator:tyj_heg__huojun"] = "热图文化",
}
local tyj__fenrui = fk.CreateActiveSkill{
name = "tyj_heg__fenrui",
anim_type = "offensive",
card_num = 1,
target_num = 0,
prompt = "#tyj_heg__fenrui",
times = function(self)
return Self.phase == Player.Play and 1 - Self:usedSkillTimes(self.name, Player.HistoryPhase) or -1
end,
can_use = function (self, player)
return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0 and not player:isNude()
end,
card_filter = function(self, to_select, selected)
local card = Fk:getCardById(to_select)
return #selected == 0 and card.type == Card.TypeEquip --and not Self:prohibitDiscard(to_select)
end,
target_filter = Util.FalseFunc,
on_use = function(self, room, effect)
local from = room:getPlayerById(effect.from)
if from:isAlive() then
--room:throwCard(effect.cards, self.name, from, from)
room:recastCard(effect.cards, room:getPlayerById(effect.from), self.name)
if from:isAlive() then
local card
local cards={}
local cardstouse = {}
while true do
if from:isAlive() then
local id = room:getNCards(1)[1]
room:moveCardTo(id, Card.Processing, nil, fk.ReasonJustMove, self.name, nil, true, from.id)
table.insert(cardstouse, id)
room:delay(300)
local c = Fk:getCardById(id)
if c.trueName == "slash" then
card = c
room:delay(500)
break
else
table.insert(cards, id)
end
else break end
end
if from:isAlive() and room:getCardOwner(card.id)==nil then
room:moveCardTo(card.id, Player.Hand,from, fk.ReasonPrey, self.name, nil, true, from.id)
end
if from:isAlive() and #cardstouse>0 then
U.askForUseRealCard(room, from,cardstouse, nil, self.name,"奋锐:你可以使用亮出的一张牌", {expand_pile =table.filter(cardstouse,function(cid) return room:getCardOwner(cid)~=from and room:getCardArea(cid)~=Card.PlayerHand end), extra_use = true},false)
end
cards = table.filter(cards, function(id) return room:getCardArea(id) == Card.Processing end)
room:moveCardTo(cards, Card.DiscardPile, nil, fk.ReasonPutIntoDiscardPile, self.name, nil, true, from.id)
end
end
end,
}
tyj__huojun:addSkill(tyj__fenrui)
Fk:loadTranslationTable{
["tyj_heg__fenrui"]="奋锐",
[":tyj_heg__fenrui"]="出牌阶段限一次,你可以重铸一张装备牌以亮出牌堆顶的牌直到亮出【杀】,然后你获得此【杀】并可以使用一张因此亮出的牌(不计入次数)。",
["#tyj_heg__fenrui"]="奋锐:你可以重铸一张装备牌,从牌堆顶翻找一张【杀】并使用翻出的一张牌。",
["$tyj_heg__fenrui1"]="善守者亦善攻,不可死守。",
["$tyj_heg__fenrui2"]="璋军疲敝,可伺机而攻。",
["~tyj_heg__huojun"] = "蒙君知遇,奈何早薨。",
}
local tyj__sunluban = General(extension, "tyj_heg__sunluban", "wu", 3,3,General.Female)
Fk:loadTranslationTable{
["tyj_heg__sunluban"] = "孙鲁班",
["#tyj_heg__sunluban"] = "为虎作伥",
["designer:tyj_heg__sunluban"] = "汤圆",
["cv:tyj_heg__sunluban"] = "官方",
["illustrator:tyj_heg__sunluban"] = "FOOLTOWN",
}
tyj__sunluban:addCompanions({"hs__sunquan"})
local tyj__zenhui = fk.CreateTriggerSkill{
name="tyj_heg__zenhui",
events={fk.AfterCardTargetDeclared},
anim_type = "control",
can_trigger = function(self, event, target, player, data)
return player:hasSkill(self) and H.compareKingdomWith(player,target) and (data.card:isCommonTrick() or data.card.trueName == 'slash') and
table.every(player.room:getOtherPlayers(target), function (p) return #target:getCardIds('e') >= #p:getCardIds('e') end)
end,
on_cost = function(self, event, target, player, data)
local room = player.room
local targets = U.getUseExtraTargets(room, data)
if #targets == 0 then return false end
local tos = room:askForChoosePlayers(player, targets, 1, 1, "#tyj__zenhui_target:::"
..data.card:toLogString(), 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 tos = self.cost_data
table.insert(data.tos, {tos})
room:sendLog{ type = "#AddTargetsBySkill", from = target.id, to = {tos}, arg = self.name, arg2 = data.card:toLogString() }
local to = room:getPlayerById(tos)
if to:isAlive() and #target:getCardIds('he')>0 then
local card = room:askForCardChosen(to, target, "he", self.name,"谮毁:弃置其一张牌")
room:throwCard({card}, self.name, target, player)
end
end,
}
local tyj__jiaojin_active = fk.CreateActiveSkill{
name = "#tyj_heg__jiaojin_active",
card_num = 1,
visible = false,
mute=true,
card_filter = function(self, to_select, selected, targets)
local tos = Self:getMark("tyj_heg__jiaojin_from-phase")
if tos~=0 then
return #selected == 0 and Fk:getCardById(to_select).type == Card.TypeEquip and U.canMoveCardIntoEquip(Fk:currentRoom():getPlayerById(tos), to_select, true)
end
end,
}
local tyj__jiaojin = fk.CreateTriggerSkill{
name = "tyj_heg__jiaojin",
anim_type = "offensive",
events = {fk.DamageInflicted},
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) then
return target == player and data.from and data.from:isAlive() and #player:getCardIds('he')>0
end
end,
on_cost = function(self, event, target, player, data)
local room = player.room
room:setPlayerMark(player,"tyj_heg__jiaojin_from-phase",data.from.id)
local success, dat = player.room:askForUseActiveSkill(player, "#tyj_heg__jiaojin_active", "#tyj_heg__jiaojin-invoke::"..data.from.id, true)
if success then
self.cost_data = dat
room:setPlayerMark(player,"tyj_heg__jiaojin_from-phase",0)
return true
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
local to = data.from
U.moveCardIntoEquip(room, to, self.cost_data.cards[1], self.name, true, player)
return true
end,
}
tyj__sunluban:addSkill(tyj__zenhui)
tyj__jiaojin:addRelatedSkill(tyj__jiaojin_active)
tyj__sunluban:addSkill(tyj__jiaojin)
Fk:loadTranslationTable{
["tyj_heg__zenhui"]="谮毁",
[":tyj_heg__zenhui"]="装备区内牌数为全场最大的同势力角色使用【杀】或普通锦囊牌时,你可以为此牌指定一个额外目标,然后令此目标弃置使用者的一张牌。",
["tyj_heg__jiaojin"]="骄矜",
[":tyj_heg__jiaojin"]="你受到伤害时,可以将一张装备牌置入伤害来源的装备区(替换原装备)以防止之。",
["#tyj__zenhui_target"]="是否发动 谮毁 为 %arg 指定一个额外的目标?",
["#tyj_heg__jiaojin_active"]="骄矜",
["#tyj_heg__jiaojin-invoke"]="是否将一张装备牌置于 %dest 的装备区内以发动 骄矜 来防止此伤害?",
["$tyj_heg__zenhui1"]="你可别不识抬举!",
["$tyj_heg__zenhui2"]="你也休想置身事外!",
["$tyj_heg__jiaojin1"]="是谁借给你的胆子?",
["$tyj_heg__jiaojin2"]="就凭你、还想算计于我?!",
["~tyj_heg__sunluban"] = "本公主,何罪之有?",
}
local tyj__huangfusong = General(extension, "tyj_heg__huangfusong", "qun", 4,4)
tyj__huangfusong:addCompanions({"tyj_heg__zhujun"})
Fk:loadTranslationTable{
["tyj_heg__huangfusong"] = "皇甫嵩",
["#tyj_heg__huangfusong"] = "营火溃螟",
["designer:tyj_heg__huangfusong"] = "汤圆",
["cv:tyj_heg__huangfusong"] = "官方",
["illustrator:tyj_heg__huangfusong"] = "鬼画府",
}
local tyj__shiji = fk.CreateTriggerSkill{
name = "tyj_heg__shiji",
events={fk.AfterCardsMove,fk.EventPhaseStart},
anim_type = "offensive",
can_trigger = function (self, event, target, player, data)
if player:hasSkill(self) then
if event == fk.AfterCardsMove then
for _, move in ipairs(data) do
if #move.moveInfo>0 then
if move.proposer and move.proposer == player.id and move.moveReason == fk.ReasonDiscard and move.from then
for _, info in ipairs(move.moveInfo) do
if table.contains({Card.PlayerEquip,Card.PlayerHand},info.fromArea) then
return true
end
end
end
end
end
end
end
if event == fk.EventPhaseStart then
return player:getMark('@@tyj_heg__shiji_used')~=0
end
end,
on_cost = function (self, event, target, player, data)
local room = player.room
if event == fk.AfterCardsMove then
return room:askForSkillInvoke(player,self.name)
elseif event == fk.EventPhaseStart then
room:setPlayerMark(player,'@@tyj_heg__shiji_used',0)
if player:isAlive() then
local all_choices= {"#tyj_heg__shiji_use","#tyj_heg__shiji_fire"}
local choice = {}
local ids = {}
room.logic:getEventsOfScope(GameEvent.MoveCards, 1, function (e)
for _, move in ipairs(e.data) do
if move.toArea == Card.DiscardPile and move.moveReason == fk.ReasonDiscard then
for _, info in ipairs(move.moveInfo) do
table.insertIfNeed(ids, info.cardId)
end
end
end
return false
end, Player.HistoryTurn)
ids = table.filter(ids, function (id) return room:getCardArea(id) == Card.DiscardPile end)
if #ids>0 then
table.insert(choice,"#tyj_heg__shiji_use")
end
if #table.filter(room.alive_players, function(t)
return U.canUseCardTo(room, player, t, Fk:cloneCard("fire_attack"))
end)>0 then
table.insert(choice,"#tyj_heg__shiji_fire")
end
if #choice>0 then
local choice = room:askForChoice(player, choice, self.name,"势击:你可以选择一项执行",true,all_choices)
if choice then
self.cost_data = choice
return true
end
end
end
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
if event == fk.AfterCardsMove then
room:setPlayerMark(player,"@@tyj_heg__shiji_used",1)
elseif event == fk.EventPhaseStart then
if player:isAlive() then
local choice = self.cost_data
if choice == "#tyj_heg__shiji_use" then
local ids = {}
room.logic:getEventsOfScope(GameEvent.MoveCards, 1, function (e)
for _, move in ipairs(e.data) do
if move.toArea == Card.DiscardPile and move.moveReason == fk.ReasonDiscard then
for _, info in ipairs(move.moveInfo) do
table.insertIfNeed(ids, info.cardId)
end
end
end
return false
end, Player.HistoryTurn)
ids = table.filter(ids, function (id) return room:getCardArea(id) == Card.DiscardPile end)
if #ids>0 then
local to = room:askForChoosePlayers(player,table.map(player.room:getOtherPlayers(player),Util.IdMapper),1,1,"势击:选择要使用牌的角色",self.name,false)
if #to>0 then
U.askForUseRealCard(room,room:getPlayerById(to[1]),ids, nil, self.name,"#tyj_heg__shiji_use-invoke", {expand_pile =ids, extra_use = true},false)
end
end
elseif choice == "#tyj_heg__shiji_fire" then
U.askForUseVirtualCard(room, player, "fire_attack", nil, self.name, "#tyj_heg__shiji_fire-invoke", true, false, false, false, nil,false)
end
end
end
end,
}
tyj__huangfusong:addSkill(tyj__shiji)
Fk:loadTranslationTable{
["tyj_heg__shiji"]="势击",
[":tyj_heg__shiji"]="你弃置任意角色的牌后,你可以于下个阶段开始时选择一项:1.令一名其他角色使用一张本回合因弃置进入弃牌堆的牌;2.视为使用一张【火攻】。",
["#tyj_heg__shiji_use"]="令其他角色使用牌",
["#tyj_heg__shiji_use-invoke"]="势击:使用其中一张牌。",
[":#tyj_heg__shiji_use"]="令一名其他角色使用一张本回合因弃置进入弃牌堆的牌",
["#tyj_heg__shiji_fire"]="使用【火攻】",
[":#tyj_heg__shiji_fire"]="视为使用一张【火攻】",
["#tyj_heg__shiji_fire-invoke"]="势击:视为使用一张【火攻】",
["@@tyj_heg__shiji_used"]="势击",
["$tyj_heg__shiji1"]="敌军依草结营,正犯兵家大忌!",
["$tyj_heg__shiji2"]="兵法所云火攻之计,正合此时之势!",
["~tyj_heg__huangfusong"]="力有所能,臣必为也……",
}
local tyj__liangxing = General(extension, "tyj_heg__liangxing", "qun", 4,4)
tyj__liangxing:addCompanions({"tyj_heg__machao"})
Fk:loadTranslationTable{
["tyj_heg__liangxing"] = "梁兴",
["#tyj_heg__liangxing"] = "凶豺掠豹",
["designer:tyj_heg__liangxing"] = "汤圆",
["cv:tyj_heg__liangxing"] = "官方",
["illustrator:tyj_heg__liangxing"] = "匠人绘",
}
local tyj__weilu = fk.CreateTriggerSkill{
name = "tyj_heg__weilu",
events={fk.EventPhaseStart},
anim_type = "offensive",
can_trigger = function (self, event, target, player, data)
if player:hasSkill(self) and target == player and player.phase == Player.Play then
return #table.filter(player.room.alive_players,function (p)
return #p:getCardIds('he')>2 and p~=player
end)>0
end
end,
on_cost = function (self, event, target, player, data)
local room = player.room
local tos = table.filter(room.alive_players,function (p)
return #p:getCardIds('he')>2 and p~=player
end)
if #tos>0 then
local to = room:askForChoosePlayers(player,table.map(tos,Util.IdMapper),1,1,"是否对一名其他角色发动 威掳 展示其的三张牌?",self.name,true,true)
if #to>0 then
local tot = room:getPlayerById(to[1])
if #tot:getCardIds('he')>3 then
local ids = room:askForCardsChosen(player,tot,3,3,"he",self.name,"#tyj_heg__weilu_choose3::"..to[1])
if #ids>0 then
self.cost_data = {to[1],ids}
return true
end
else
self.cost_data = {to[1],tot:getCardIds('he')}
return true
end
end
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
local to = room:getPlayerById(self.cost_data[1])
room:doIndicate(player.id,{self.cost_data[1]})
player:showCards(self.cost_data[2])
room:delay(1200)
if player:isAlive() then
local cardsm = room:askForCard(player, 1, #player:getCardIds("he"), true, self.name, true, ".","#tyj_heg__weilu_chooseself")
if #cardsm>0 then
player:showCards(cardsm)
room:delay(1200)
if player:isAlive() and to:isAlive() then
local choice = room:askForChoice(to, {"#tyj_heg__weilu_exchange","#tyj_heg__weilu_refuse"}, self.name,"威掳:你须选择一项执行",true,{"#tyj_heg__weilu_exchange","#tyj_heg__weilu_refuse"})
if choice then
if choice == "#tyj_heg__weilu_exchange" then
U.swapCards(room, player, player, to, table.clone(cardsm),
table.clone(self.cost_data[2]), self.name)
else
local mark = player:getTableMark("@$tyj_heg__weilu_showed-phase")
table.insertTableIfNeed(mark,cardsm)
room:setPlayerMark(player,"@$tyj_heg__weilu_showed-phase",mark)
room:setPlayerMark(player,"tyj_heg__weilu_showed",mark)
for _, id in ipairs(cardsm) do
room:setCardMark(Fk:getCardById(id), "@tyj_heg__weilu-inhand", " 不计次")
end
local mark = to:getTableMark("@$tyj_heg__weilu_showed-phase")
table.insertTableIfNeed(mark,self.cost_data[2])
room:setPlayerMark(to,"@$tyj_heg__weilu_showed-phase",mark)
room:setPlayerMark(to,"tyj_heg__weilu_showed",mark)
for _, id in ipairs(self.cost_data[2]) do
room:setCardMark(Fk:getCardById(id), "@tyj_heg__weilu-inhand", " 弃置")
end
room:setPlayerMark(to,"@@tyj_heg__weilu-phase",1)
local mark = player:getTableMark("tyj_heg__weilu_mark-phase")
table.insert(mark,{to.id,self.cost_data[2],cardsm})
room:setPlayerMark(player,"tyj_heg__weilu_mark-phase",mark)
end
end
end
end
end
end,
refresh_events = {fk.DamageInflicted,fk.EventPhaseEnd},
can_refresh = function (self, event, target, player, data)
if event == fk.DamageInflicted then
return target == player and #player:getTableMark("tyj_heg__weilu_mark-phase")>0 and #table.filter(player:getTableMark("tyj_heg__weilu_mark-phase"),function (tos)
return tos[1]==data.to.id
end)>0
elseif event == fk.EventPhaseEnd then
return #player:getTableMark("tyj_heg__weilu_showed")~=0
end
end,
on_refresh = function (self, event, target, player, data)
local room = player.room
if event == fk.DamageInflicted then
local todis = {}
for _, tos in ipairs(player:getTableMark("tyj_heg__weilu_mark-phase")) do
if tos[1]== data.to.id then
for _, cid in ipairs(tos[2]) do
if room:getCardOwner(cid)==data.to then
table.insertIfNeed(todis,cid)
end
end
end
end
if #todis>0 then
--[[player:broadcastSkillInvoke(self.name)
room:notifySkillInvoked(player,self.name)
room:throwCard(todis,self.name,data.to,player)--]]
local get = room:askForCardsChosen(player, target, 1,1, {
card_data = {
{ "$Hand", todis }
}
}, self.name,"威掳:弃置其展示的一张牌")
if #get>0 then
player:broadcastSkillInvoke(self.name)
room:notifySkillInvoked(player,self.name)
room:throwCard(get,self.name,data.to,player)
end
end
elseif event == fk.EventPhaseEnd then
for _, cid in ipairs(player:getTableMark("tyj_heg__weilu_showed")) do
room:setCardMark(Fk:getCardById(cid), "@tyj_heg__weilu-inhand",0)
end
room:setPlayerMark(player,"tyj_heg__weilu_showed",0)
end
end,
}
local tyj__weilu_targetmod = fk.CreateTargetModSkill{
name = "#tyj__weilu_targetmod",
bypass_times = function(self, player, skill, scope, card, to)
if #player:getTableMark("tyj_heg__weilu_mark-phase")>0 then
for _, tos in ipairs(player:getTableMark("tyj_heg__weilu_mark-phase")) do
if tos[1]== to.id then
for _, cid in ipairs(tos[3]) do
if cid == card.id then
return true
end
end
end
end
end
return false
end,
}
tyj__weilu:addRelatedSkill(tyj__weilu_targetmod)
tyj__liangxing:addSkill(tyj__weilu)
Fk:loadTranslationTable{
["tyj_heg__weilu"]="威掳",
[":tyj_heg__weilu"]="出牌阶段开始时,你可以展示一名其他角色的三张牌,然后你可以展示任意张牌以令其选择一项:1.交换这些牌;2.本阶段你对其使用你展示的牌无次数限制且对其造成伤害时弃置其展示的一张牌。",
["#tyj_heg__weilu_choose3"]="威掳:选择 %dest 的三张牌并展示",
["#tyj_heg__weilu_chooseself"]="威掳:你可以展示任意张牌(可取消)。",
["#tyj_heg__weilu_exchange"]="交换展示牌",
["#tyj_heg__weilu_refuse"]="不交换",
[":#tyj_heg__weilu_exchange"]="用你被展示的三张牌交换其展示的牌。",
[":#tyj_heg__weilu_refuse"]="其本阶段对你使用其展示的牌无次数限制,且对你造成伤害后弃置你展示的牌。",
["@$tyj_heg__weilu_showed-phase"]="威掳展示",
["@@tyj_heg__weilu-phase"]="被威掳",
["tyj_heg__weilu_mark-phase"]="威掳",
["#tyj__weilu_targetmod"]="威掳",
["$tyj_heg__weilu1"]="天下大乱,掳掠以自保。",
["$tyj_heg__weilu2"]="趁火打劫,乘危掳掠。",
["~tyj_heg__liangxing"]="夏侯渊,你竟敢!",
["@tyj_heg__weilu-inhand"]="威掳",
}
local tyj__zhujun = General(extension, "tyj_heg__zhujun", "qun", 4,4)
tyj__zhujun:addCompanions({"tyj_heg__huangfusong"})
Fk:loadTranslationTable{
["tyj_heg__zhujun"] = "朱儁",
["#tyj_heg__zhujun"] = "刚猛框扈",
["designer:tyj_heg__zhujun"] = "汤圆",
["cv:tyj_heg__zhujun"] = "官方",
["illustrator:tyj_heg__zhujun"] = "鬼画府",
}
local tyj__fendi = fk.CreateTriggerSkill{
name="tyj_heg__fendi",
events = {fk.EventPhaseStart},
visible=false,
can_trigger = function (self, event, target, player, data)
if player:hasSkill(self) then
return H.compareKingdomWith(player,target) and target.phase == Player.Play
end
end,
on_cost = function (self, event, target, player, data)
local success, dat = player.room:askForUseViewAsSkill(player,"#tyj_heg__fendi","是否发动 分敌 将一张伤害牌当【调虎离山】使用?", true)
if success then
self.cost_data = dat
return true
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
if player:isAlive() then
local dat = self.cost_data
local card = Fk.skills["#tyj_heg__fendi"]:viewAs(dat.cards)
local use = {from = player.id, tos = table.map(dat.targets, function(p) return {p} end), card = card}
room:useCard(use)
for _, p in ipairs({player,target}) do
if p:isAlive() then
if player:isAlive() and target:isAlive() then
local tos = table.filter(room.alive_players,function (pt)
return H.inSiegeRelation(player,target,pt)
end)
if #tos >0 then
local to = room:askForChoosePlayers(p,table.map(tos,Util.IdMapper),1,1,"分敌:你可以选择一名被你们围攻的角色,弃置该角色一张牌",self.name,false)
if #to>0 then
local card = room:askForCardChosen(p,room:getPlayerById(to[1]), "he", self.name,"#tyj__fendi_discard::"..to[1])
room:throwCard({card}, self.name, room:getPlayerById(to[1]),p)
end
end
end
end
end
end
end,
}
local tyj__fendi_viewas = fk.CreateViewAsSkill{
name = "#tyj_heg__fendi",
anim_type = "control",
prompt = "是否发动 分敌 将一张 伤害牌 当【调虎离山】使用?",
card_num = 1,
visible = false,
pattern = "lure_tiger",
can_use = function(self, player) return true end,
card_filter = function(self, to_select, selected)
if #selected ~= 0 then return false end
return Fk:getCardById(to_select).is_damage_card
end,
view_as = function(self, cards)
if #cards ~= 1 then
return nil
end
local c = Fk:cloneCard("lure_tiger")
c.skillName = self.name
c:addSubcards(cards)
return c
end,
}
Fk:addSkill(tyj__fendi_viewas)
local tyj__houfeng = fk.CreateTriggerSkill{
name = "tyj_heg__houfeng",
anim_type = "drawcard",
events = {fk.AfterCardsMove},
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) then
for _, move in ipairs(data) do
if move.to then
local to = player.room:getPlayerById(move.to)
if H.inFormationRelation(player, to) and move.skillName =="kill" and not to.dead then
return true
end
end
end
end
end,
on_trigger = function(self, event, target, player, data)
for _, move in ipairs(data) do
if move.to then
local to = player.room:getPlayerById(move.to)
if H.inFormationRelation(player, to) and move.skillName =="kill" and not to.dead then
self:doCost(event, target, player, {to = to,num = #move.moveInfo})
end
end
end
end,
on_cost = function (self, event, target, player, data)
return player.room:askForSkillInvoke(player, self.name, nil,"#tyj_heg__houfeng-invoke::"..data.to.id..":"..data.num)
end,
on_use = function (self, event, target, player, data)
local room = player.room
for _, p in ipairs(room.alive_players) do
if H.inFormationRelation(p, player) and p~=data.to and p:isAlive() then
p:drawCards(data.num,self.name)
end
end
end,
}
tyj__zhujun:addSkill(tyj__fendi)
tyj__zhujun:addSkill(tyj__houfeng)
Fk:loadTranslationTable{
["#tyj_heg__fendi"]="分敌",
["tyj_heg__fendi"]="分敌",
[":tyj_heg__fendi"]="同势力角色的出牌阶段开始时,你可以将一张伤害牌当【调虎离山】使用,然后你们各可以弃置一名被你们围攻的角色的一张牌。",
["#tyj__fendi_discard"]="分敌:弃置 %dest 的一张牌",
["tyj_heg__houfeng"]="厚俸",
[":tyj_heg__houfeng"]="与你处于同一队列的角色因执行击杀奖惩而摸牌后,你可以令此队列中其余的角色各摸等量张牌。",
["#tyj_heg__houfeng-invoke"]="是否发动 厚俸 令队列中 %dest 以外的角色也摸 %arg 张牌?",
["$tyj_heg__fendi1"] = "全军彻围,待其出城迎敌,再攻敌自散矣!",
["$tyj_heg__fendi2"] = "佯解敌围,而后城外击之,此为易破之道!",
["$tyj_heg__houfeng1"] = "交汝统领,勿负我望!",
["$tyj_heg__houfeng2"] = "有功自当行赏,来人呈上!",
["~tyj_heg__zhujun"] = "郭汜小竖!气煞我也!嗯……",
}
local tyj__panshu = General(extension, "tyj_heg__panshu", "wu", 3,3,General.Female)
tyj__panshu:addCompanions({"hs__sunquan"})
Fk:loadTranslationTable{
["tyj_heg__panshu"] = "潘淑",
["#tyj_heg__panshu"] = "婉转燕尔",
["designer:tyj_heg__panshu"] = "汤圆",
["cv:tyj_heg__panshu"] = "官方",
["illustrator:tyj_heg__panshu"] = "君桓文化",
}
local tyj__jinzhi = fk.CreateTriggerSkill{
name = "tyj_heg__jinzhi",
anim_type = "drawcard",
events = { fk.AfterCardsMove},
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) then
if event == fk.CardUseFinished then
return target == player and data.card.type == Card.TypeEquip
else
local equipnum = #player:getCardIds("e")
for _, move in ipairs(data) do
for _, info in ipairs(move.moveInfo) do
if move.from == player.id and info.fromArea == Card.PlayerEquip then
equipnum = equipnum + 1
elseif move.to == player.id and move.toArea == Card.PlayerEquip then
equipnum = equipnum - 1
end
end
end
if #player:getCardIds("e") ~= equipnum then
local ecards = player:getCardIds("e")
--[[if #ecards == 0 then
return true
else]]
if #ecards ~= 0 then
local suits = {}
for _, cid in ipairs(player:getCardIds("e")) do
local c = Fk:getCardById(cid)
if table.contains(suits,c.suit) then
return false
else
table.insertIfNeed(suits,c.suit)
end
end
return true
end
end
end
end
end,
on_cost = function (self, event, target, player, data)
local room = player.room
local to = room:askForChoosePlayers(player,table.map(room.alive_players,Util.IdMapper),1,1,"#tyj__jinzhi-invoke",self.name,true,false)
if #to>0 then
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)
room:doIndicate(player.id,{self.cost_data})
if to:isAlive() then
room:drawCards(to,1,self.name)
end
end,
}
local tyj__weiyi =fk.CreateTriggerSkill{
name = "tyj_heg__weiyi",
anim_type = "control",
events = {fk.BeforeDrawCard},
can_trigger = function(self, event, target, player, data)
return H.compareKingdomWith(player,target) and #target:getCardIds('e') < #player:getCardIds('e') and player:hasSkill(self) and data.skillName~=self.name and data.num > 0 and target.phase == Player.Draw
end,
on_cost = function (self, event, target, player, data)
local room = player.room
return room:askForSkillInvoke(player, self.name, nil,"#tyj_heg__weiyi-invoke::"..target.id..":"..data.num)
end,
on_use = function (self, event, target, player, data)
local room = player.room
room:drawCards(player,data.num,self.name)
if #player:getCardIds('he')>0 then
local cardsm = room:askForCard(player, math.min(#player:getCardIds('he'),data.num), math.min(#player:getCardIds('he'),data.num), true, self.name, false, ".","#tyj_heg__weiyi-give::"..target.id..":"..data.num)
if #cardsm>0 then
room:moveCardTo(cardsm, Player.Hand,target, fk.ReasonGive, self.name, nil, false, player.id)
end
end
data.num = 0
end,
}
tyj__panshu:addSkill(tyj__jinzhi)
tyj__panshu:addSkill(tyj__weiyi)
Fk:loadTranslationTable{
["#tyj_heg__jinzhi"]="锦织",
["tyj_heg__jinzhi"]="锦织",
[":tyj_heg__jinzhi"]="你装备区内牌的数量变化后,若这些牌的数量大于1且花色皆不同,你可以令一名角色摸一张牌。",
["#tyj__jinzhi-invoke"]="是否发动 锦织 令一名角色摸一张牌?",
["tyj_heg__weiyi"]="威仪",
[":tyj_heg__weiyi"]="同势力角色因摸牌阶段摸牌时,若其装备区内的牌数小于你,你可以改为由你摸牌,若如此做,你需要交给其摸牌数张牌。",
["#tyj_heg__weiyi-invoke"]="是否发动 威仪 令你摸 %dest 即将摸的 %arg 张牌?",
["#tyj_heg__weiyi-give"]="威仪:你需要交给 %dest %arg 张牌",
["$tyj_heg__weiyi1"] = "无威仪者,不可奉社稷。",
["$tyj_heg__weiyi2"] = "有威仪者,进止雍容。",
["$tyj_heg__jinzhi1"] = "织锦为旗,以扬威仪。",
["$tyj_heg__jinzhi2"] = "坐而织锦,立则为仪。",
["~tyj_heg__panshu"] = "本为织女,幸蒙帝垂怜……",
}
local tyj__xuangongzhu = General(extension, "tyj_heg__xuangongzhu", "wei", 3,3,General.Female)
tyj__xuangongzhu:addCompanions({"ty_heg__duyu"})
Fk:loadTranslationTable{
["tyj_heg__xuangongzhu"] = "宣公主",
["#tyj_heg__xuangongzhu"] = "卿舞驱惘",
["designer:tyj_heg__xuangongzhu"] = "汤圆",
["cv:tyj_heg__xuangongzhu"] = "官方",
["illustrator:tyj_heg__xuangongzhu"] = "热图文化",
}
local tyj__qingwu = fk.CreateActiveSkill{
name = "tyj_heg__qingwu",
anim_type = "tyj_heg__qingwu",
card_num = 0,
target_num = 2,
times = function(self)
return Self.phase == Player.Play and 1 - Self:usedSkillTimes(self.name, Player.HistoryPhase) or -1
end,
prompt = "卿舞:你选择选择两名角色,将先选的角色装备区域内一张牌移动至后先选的角色的装备区内,然后前者视为对后者使用【杀】",
can_use = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
end,
card_filter = Util.FalseFunc,
target_filter = function (self, to_select, selected)
local target = Fk:currentRoom():getPlayerById(to_select)
if target then
if #selected == 0 then
return #target:getCardIds('e')>0 and #table.filter(target:getCardIds('e'),function (cid)
local c = Fk:getCardById(cid)
return c.sub_type == Card.SubtypeWeapon
end)>0
elseif #selected == 1 then
local cardx = table.filter(Fk:currentRoom():getPlayerById(selected[1]):getCardIds('e'),function (cid)
local c = Fk:getCardById(cid)
return c.sub_type ~= Card.SubtypeWeapon
end)
return Fk:currentRoom():getPlayerById(selected[1]):canMoveCardsInBoardTo(target,'e',cardx)
end
end
return false
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
local cardx = table.filter(room:getPlayerById(effect.tos[1]):getCardIds('e'),function (cid)
local c = Fk:getCardById(cid)
return c.sub_type ~= Card.SubtypeWeapon
end)
room:askForMoveCardInBoard(player, room:getPlayerById(effect.tos[1]), room:getPlayerById(effect.tos[2]), self.name,'e',room:getPlayerById(effect.tos[1]),cardx)
if room:getPlayerById(effect.tos[1]):isAlive() and room:getPlayerById(effect.tos[2]):isAlive() then
local use=room:useVirtualCard("slash", nil, room:getPlayerById(effect.tos[1]), room:getPlayerById(effect.tos[2]), self.name,true)
if player:isAlive() then
local to = room:getPlayerById(use.from)
local all_choices = {"弃置牌","令其摸牌"}
local choices = {}
if #player:getCardIds('he')>0 then
table.insert(choices,"弃置牌")
end
if use.damageDealt and to:isAlive() then
table.insert(choices,"令其摸牌")
end
if #choices >0 then
local choice = room:askForChoice(player, choices, self.name,"卿舞:你须选择一项执行",false,all_choices)
if choice == "令其摸牌" then
to:drawCards(2,self.name)
else
room:askForDiscard(player, 2, 2, true, self.name, false,nil,"卿舞:你需弃置两张手牌",false)
end
end
end
end
end,
}
local tyj__rongru = fk.CreateTriggerSkill{
name = "tyj_heg__rongru",
anim_type = "control",
frequency = Skill.Compulsory,
events = {fk.AfterCardsMove},
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) then
if event == fk.AfterCardsMove then
for _, move in ipairs(data) do
if move.to == player.id and move.toArea == Player.Hand and move.moveReason == fk.ReasonDraw then
return #move.moveInfo>1
end
if move.from == player.id and move.moveReason == fk.ReasonDiscard then
for _, info in ipairs(move.moveInfo) do
if (info.fromArea == Card.PlayerHand or info.fromArea == Card.PlayerEquip) then
return #move.moveInfo>1
end
end
end
end
end
end
end,
on_trigger = function (self, event, target, player, data)
if player:hasSkill(self) then
if event == fk.AfterCardsMove then
for _, move in ipairs(data) do
if move.to == player.id and move.toArea == Player.Hand and move.moveReason == fk.ReasonDraw then
local cards = {}
table.forEach(move.moveInfo, function(info)
table.insert(cards, info.cardId)
end)
if # cards>0 then
self:doCost(event, target, player, {type = "draw",cids = cards})
end
end
if move.from == player.id and move.moveReason == fk.ReasonDiscard then
local cards = {}
table.forEach(move.moveInfo, function(info)
if info.fromArea == Card.PlayerHand or info.fromArea == Card.PlayerEquip then
table.insert(cards, info.cardId)
end
end)
if # cards>0 then
self:doCost(event, target, player, {type = "dis",cids = cards})
end
end
end
end
end
end,
on_cost = function (self, event, target, player, data)
local room = player.room
local str = nil
if room:askForSkillInvoke(player,self.name) then
if data.type == "dis" then
str = "融濡:选择你弃置的一张牌,然后交给一名角色"
else
str = "融濡:选择你摸的一张牌,然后交给一名角色"
end
local get = room:askForCardsChosen(player, player, 1,1, {
card_data = {
{ "pile_discard", data.cids }
}
}, self.name,str)
if #get>0 then
self.cost_data = get[1]
return true
end
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
local c = Fk:getCardById(self.cost_data)
local tos = room:getOtherPlayers(player)
if # tos >0 then
local to = room:askForChoosePlayers(player,table.map(tos,Util.IdMapper),1,1,"#tyj__rongru-choose:::"..c:toLogString(),self.name,false,false)
if #to>0 then
room:moveCardTo(c.id, Player.Hand,room:getPlayerById(to[1]), fk.ReasonGive, self.name, nil, false, player.id)
end
end
end,
}
tyj__xuangongzhu:addSkill(tyj__qingwu)
tyj__xuangongzhu:addSkill(tyj__rongru)
Fk:loadTranslationTable{
["tyj_heg__qingwu"]="卿舞",
[":tyj_heg__qingwu"]="出牌阶段限一次,你可以将一名角色装备区内的一张武器牌移动至另一名角色的装备区内,令前者视为对后者使用【杀】,然后你须弃置两张牌或令因此造成伤害的角色摸两张牌。",
["#tyj__jinzhi-invoke"]="是否发动 锦织 令一名角色摸一张牌?",
["tyj_heg__rongru"]="融濡",
[":tyj_heg__rongru"]="你一次性摸或弃置至少两张牌后,可以将其中一张牌交给一名其他角色。",
["#tyj__rongru-choose"]="融濡:将 %arg 交给一名角色。",
["$tyj_heg__qingwu1"] = "天家贵胄,福泽四海。",
["$tyj_heg__qingwu2"] = "虽豺狼当道,虎豹哮林,妾亦生死相随。",
["$tyj_heg__rongru1"] = "辅车相依,比翼双飞。",
["$tyj_heg__rongru2"] = "情投意合,相濡以沫。",
["~tyj_heg__xuangongzhu"] = "元凯,我去也……",
}
local tyj__gongsundu = General(extension, "tyj_heg__gongsundu", "qun", 4,4)
tyj__gongsundu:addCompanions({"tyj_heg__xurong"})
Fk:loadTranslationTable{
["tyj_heg__gongsundu"] = "公孙度",
["#tyj_heg__gongsundu"] = "威戾海东",
["designer:tyj_heg__gongsundu"] = "汤圆",
["cv:tyj_heg__gongsundu"] = "官方",
["illustrator:tyj_heg__gongsundu"] = "匠人绘",
}
local tyj__zhenzhe = fk.CreateTriggerSkill{
name = "tyj_heg__zhenzhe",
events = {fk.Damage},
can_trigger = function (self, event, target, player, data)
if target == player and player:hasSkill(self) then
return data.card and ((data.card.trueName == 'slash') or data.card.name == "duel") and --[[player.room.logic:getActualDamageEvents(1, function(e)
return e.data[1].from == player
end)[1].data[1] == data player:usedSkillTimes(self.name, Player.HistoryTurn) == 0 and--]] data.to and data.to:isAlive()
end
end,
on_cost = function (self, event, target, player, data)
local room = player.room
local tos = table.filter(room.alive_players,function (p)
return data.to:inMyAttackRange(p) and #p:getCardIds('h')~=math.max(data.to.hp,0)
end)
if #tos > 0 then
local num = math.max(data.to.hp,0)
for _, p in ipairs(tos) do
local cnum = #p:getCardIds('h')-num
if cnum > 0 then
room:setPlayerMark(p,"@tyj_heg__zhenzhe-dis",cnum)
room:setPlayerMark(p,"@tyj_heg__zhenzhe-recover",1)
else
room:setPlayerMark(p,"@tyj_heg__zhenzhe-draw",-cnum)
end
end
local to = room:askForChoosePlayers(player,table.map(tos,Util.IdMapper),1,1,"#tyj__zhenzhe-invoke::"..data.to.id..":"..data.to.hp,self.name,true,true)
for _, p in ipairs(tos) do
room:setPlayerMark(p,"@tyj_heg__zhenzhe-dis",0)
room:setPlayerMark(p,"@tyj_heg__zhenzhe-recover",0)
room:setPlayerMark(p,"@tyj_heg__zhenzhe-draw",0)
end
if #to > 0 then
self.cost_data = to[1]
return true
end
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
local to = room:getPlayerById(self.cost_data)
room:doIndicate(player.id,{to.id})
local num = math.max(data.to.hp,0)
if to:isAlive() and #to:getCardIds('h')~=num then
local n = #to:getCardIds('h') - num
if n > 0 then
local cards = room:askForDiscard(to, n, n, false, self.name, false,'.',"#tyj__zhenzhe-discard:::"..n,false,false)
if #cards > 0 and to:isAlive() then
room:recover({
who = to,
num = 1,
recoverBy = player,
skillName = self.name
})
end
elseif n < 0 then
player:drawCards(-n, self.name)
end
end
end,
}
tyj__gongsundu:addSkill(tyj__zhenzhe)
Fk:loadTranslationTable{
["tyj_heg__zhenzhe"]="振詟",
[":tyj_heg__zhenzhe"]="你使用【杀】或【决斗】对其他角色造成伤害后,可以令其攻击范围内的一名角色将手牌数调整至前者的体力值,若因此弃置了牌,后者回复1点体力。",
["#tyj__zhenzhe-invoke"]="是否发动 振詟 令 %dest 攻击范围内的一名角色将手牌数调整至 %arg 张?",
["#tyj__zhenzhe-discard"]="振詟:你需要弃置 %arg 张牌,因此弃置牌后回复1点体力",
["@tyj_heg__zhenzhe-draw"]="摸牌",
["@tyj_heg__zhenzhe-dis"]="弃牌",
["@tyj_heg__zhenzhe-recover"]="回复",
["$tyj_heg__zhenzhe1"] = "名震千里,泽被海东。",
["$tyj_heg__zhenzhe2"] = "施威除暴,上下咸服。",
["~tyj_heg__gongsundu"] = "为何都不愿出仕!",
}
local tyj__wuban = General(extension, "tyj_heg__wuban", "shu", 4,4)
tyj__wuban:addCompanions({"hs__weiyan"})
Fk:loadTranslationTable{
["tyj_heg__wuban"] = "吴班",
["#tyj_heg__wuban"] = "笃进豪侠",
["designer:tyj_heg__wuban"] = "汤圆",
["cv:tyj_heg__wuban"] = "官方",
["illustrator:tyj_heg__wuban"] = "匠人绘",
}
local tyj__jintao = fk.CreateTriggerSkill{
anim_type = "drawcard",
name = "tyj_heg__jintao",
events = {fk.EventPhaseEnd},
can_trigger = function (self, event, target, player, data)
if player:hasSkill(self) and target == player and player.phase == Player.Play then
local card = Fk:cloneCard("slash")
local card_skill = card.skill
local status_skills = Fk:currentRoom().status_skills[TargetModSkill] or Util.DummyTable
for _, skill in ipairs(status_skills) do
if skill:bypassTimesCheck(player, card_skill, Player.HistoryPhase, card, nil) then return false end
end
if player:usedCardTimes("slash", Player.HistoryPhase) >= card_skill:getMaxUseTime(player, Player.HistoryPhase, card, nil) then
return true
end
end
end,
on_cost = function (self, event, target, player, data)
return player.room:askForSkillInvoke(player,self.name,nil,"#tyj__jintao-invoke")
end,
on_use = function (self, event, target, player, data)
local room = player.room
room:drawCards(player,2,self.name)
local mark = player:getMark("@tyj_heg__jintao-extraslash")
mark = mark+1
room:setPlayerMark(player,"@tyj_heg__jintao-extraslash",mark)
end,
}
local tyj__jintao_targetmod = fk.CreateTargetModSkill{
name = "#tyj_heg__jintao_targetmod",
residue_func = function(self, player, skill, scope)
if skill.trueName == "slash_skill" and player:getMark("@tyj_heg__jintao-extraslash") > 0 and scope == Player.HistoryPhase then
return player:getMark("@tyj_heg__jintao-extraslash")
end
end,
}
local tyj__jintao_maxhand = fk.CreateMaxCardsSkill{
name = "#tyj__jintao_maxhand",
exclude_from = function(self, player, card)
return player:hasShownSkill("tyj_heg__jintao") and card.trueName == 'slash'
end,
}
tyj__jintao:addRelatedSkill(tyj__jintao_targetmod)
tyj__jintao:addRelatedSkill(tyj__jintao_maxhand)
tyj__wuban:addSkill(tyj__jintao)
Fk:loadTranslationTable{
["tyj_heg__jintao"]="进讨",
[":tyj_heg__jintao"]="你的【杀】不计入手牌上限。出牌阶段结束时,若你本阶段使用【杀】的次数不小于次数上限,你可以摸两张牌并令此上限+1。",
["#tyj__jintao-invoke"]="是否发动 进讨 摸两张牌并令使用【杀】的次数上限+1?",
["@tyj_heg__jintao-extraslash"]="进讨",
["#tyj__jintao_maxhand"]="进讨",
["$tyj_heg__jintao1"] = "一雪前耻,誓报前仇!",
["$tyj_heg__jintao2"] = "量敌而进,直讨吴境!",
["~tyj_heg__wuban"] = "恨……杀不尽吴狗!",
}
local tyj__sunliang = General(extension, "tyj_heg__sunliang", "wu", 3,3)
--tyj__sunliang:addCompanions({"js__sunjun"})
Fk:loadTranslationTable{
["tyj_heg__sunliang"] = "孙亮",
["#tyj_heg__sunliang"] = "独枝盘蟒",
["designer:tyj_heg__sunliang"] = "汤圆",
["cv:tyj_heg__sunliang"] = "官方",
["illustrator:tyj_heg__sunliang"] = "眉毛子",
}
local tyj__duanfeng = fk.CreateTriggerSkill{
name="tyj_heg__duanfeng",
events = {fk.TurnEnd},
can_trigger = function (self, event, target, player, data)
local room = player.room
if player:hasSkill(self) and #table.filter(room.alive_players,function (p)
return H.compareKingdomWith(player,p) and #player.room.logic:getActualDamageEvents(2, function(e)
return e.data[1].to == p
end) > 0 end)>0 then
local ids =table.filter(room.discard_pile, function(id) return (Fk:getCardById(id).trueName == 'slash') or (Fk:getCardById(id).sub_type == Card.SubtypeWeapon) end) --[[{}
room.logic:getEventsOfScope(GameEvent.MoveCards, 1, function (e)
for _, move in ipairs(e.data) do
if move.toArea == Card.DiscardPile then
for _, info in ipairs(move.moveInfo) do
if (Fk:getCardById(info.cardId).trueName == 'slash') or (Fk:getCardById(info.cardId).sub_type == Card.SubtypeWeapon) then
table.insertIfNeed(ids, info.cardId)
end
end
end
end
return false
end, Player.HistoryTurn)]]
if #ids >0 then
return true
end
end
end,
on_cost = function (self, event, target, player, data)
local room = player.room
local tos = table.filter(room.alive_players,function (p)
return H.compareKingdomWith(player,p) and #player.room.logic:getActualDamageEvents(2, function(e)
return e.data[1].to == p
end) > 0 end)
if #tos >0 then
local to = room:askForChoosePlayers(player,table.map(tos,Util.IdMapper),1,1,"是否发动 锻锋 令一名本回合受到过伤害的同势力角色获得牌?",self.name,true,true)
if #to>0 then
self.cost_data = to[1]
return true
end
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
local to = room:getPlayerById(self.cost_data)
room:doIndicate(player.id,{to.id})
local ids =table.filter(room.discard_pile, function(id) return (Fk:getCardById(id).trueName == 'slash') or (Fk:getCardById(id).sub_type == Card.SubtypeWeapon) end)--[[ {}
room.logic:getEventsOfScope(GameEvent.MoveCards, 1, function (e)
for _, move in ipairs(e.data) do
if move.toArea == Card.DiscardPile then
for _, info in ipairs(move.moveInfo) do
if (Fk:getCardById(info.cardId).trueName == 'slash') or (Fk:getCardById(info.cardId).sub_type == Card.SubtypeWeapon) then
table.insertIfNeed(ids, info.cardId)
end
end
end
end
return false
end, Player.HistoryTurn)]]
if #ids >0 then
local get = room:askForCardsChosen(player, player, 1,1, {
card_data = {
{ "pile_discard", ids }
}
}, self.name, "#tyj_heg__duanfeng-choose::" .. self.cost_data)
if #get>0 then
room:moveCardTo(get, Player.Hand, to, fk.ReasonPrey, self.name, "", true, player.id)
end
end
end,
}
local tyj__kuizhu = fk.CreateTriggerSkill{
name = "tyj_heg__kuizhu",
events = {fk.EventPhaseEnd},
can_trigger = function (self, event, target, player, data)
local room = player.room
if player:hasSkill(self) and target == player and player.phase == Player.Discard then
local slashes = {}
room.logic:getEventsOfScope(GameEvent.MoveCards, 1, function (e)
for _, info in ipairs(e.data) do
if info.moveReason == fk.ReasonDiscard and info.proposer == player.id then
table.insertTable(
slashes,
table.map(
table.filter(info.moveInfo, function(moveInfo) return Fk:getCardById(moveInfo.cardId).trueName == 'slash' end),
function(moveInfo) return moveInfo.cardId end
)
)
end
end
return false
end, Player.HistoryPhase)
if #slashes >0 then
return true
end
end
end,
on_cost = function (self, event, target, player, data)
local room = player.room
local slashes = {}
room.logic:getEventsOfScope(GameEvent.MoveCards, 1, function (e)
for _, info in ipairs(e.data) do
if info.moveReason == fk.ReasonDiscard and info.proposer == player.id then
table.insertTable(
slashes,
table.map(
table.filter(info.moveInfo, function(moveInfo) return Fk:getCardById(moveInfo.cardId).trueName == 'slash' end),
function(moveInfo) return moveInfo.cardId end
)
)
end
end
return false
end, Player.HistoryPhase)
local num = #slashes
local tos = table.filter(room.alive_players,function (p)
return --[[player:inMyAttackRange(p) and--]] p.hp<=num
end)
if #tos>0 then
local to = room:askForChoosePlayers(player,table.map(tos,Util.IdMapper),1,1,"tyj_heg__kuizhu-choose:::"..num,self.name,true,true)
if #to>0 then
self.cost_data = to[1]
return true
end
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
room:doIndicate(player.id,{self.cost_data})
local to = room:getPlayerById(self.cost_data)
room:damage{
from = player,
to = to,
damage = 1,
damageType = fk.NormalDamage,
skillName = self.name,
}
end,
}
tyj__sunliang:addSkill(tyj__duanfeng)
tyj__sunliang:addSkill(tyj__kuizhu)
Fk:loadTranslationTable{
["tyj_heg__duanfeng"]="锻锋",
[":tyj_heg__duanfeng"]="每回合结束时,你可以令一名本回合受到过伤害的同势力角色获得弃牌堆中的一张【杀】或武器牌。",
["tyj_heg__kuizhu"]="溃诛",
[":tyj_heg__kuizhu"]="弃牌阶段结束时,你可以对一名体力值为X的角色造成1点伤害(X为你本阶段弃置的【杀】数)。",
["#tyj_heg__duanfeng-choose"]="锻锋:令 %dest 获得其中一张牌",
["tyj_heg__kuizhu-choose"]="是否发动 溃诛 对攻击范围内一名体力值等于 %arg 的角色造成1点伤害?",
["$tyj_heg__duanfeng1"] = "能征善战,乃我东吴长久之风。",
["$tyj_heg__duanfeng2"] = "重赏之下,必有勇夫。",
["$tyj_heg__kuizhu1"] = "欺朕年幼?有胆,便一决雌雄!",
["$tyj_heg__kuizhu2"] = "只要朕还在,老贼休想稳坐一天!",
["~tyj_heg__sunliang"] = "君不君 ,臣不臣,此国之悲。",
}
local tyj__wenyang = General:new(extension, "tyj_heg__wenyang", "wei", 4,4)
tyj__wenyang.subkingdom = "wu"
tyj__wenyang:addCompanions({"ld__wenqin"})
Fk:loadTranslationTable{
["tyj_heg__wenyang"] = "文鸯",
["#tyj_heg__wenyang"] = "叱阵如云",
["designer:tyj_heg__wenyang"] = "汤圆",
["cv:tyj_heg__wenyang"] = "官方",
["illustrator:tyj_heg__wenyang"] = "鬼画府",
}
local tyj__chuifeng = fk.CreateActiveSkill{
name = "tyj_heg__chuifeng",
anim_type = "offensive",
times = function(self)
return Self.phase == Player.Play and 1 - Self:usedSkillTimes(self.name, Player.HistoryPhase) or -1
end,
prompt = "椎锋:你可以将一名同势力角色场上的一张牌当【决斗】使用",
can_use = function(self, player)
if Self:usedSkillTimes(self.name, Player.HistoryPhase)<1 and #table.filter(Fk:currentRoom().alive_players,function(targetx) return #targetx:getCardIds('ej')>0 and H.compareKingdomWith(player,targetx) end)>0 then
return true
end
return false
end,
card_filter = function (self, to_select, selected, selected_targets)
return false
end,
min_target_num = 1,
max_target_num = 1,
target_filter = function(self, to_select, selected, cards)
local targetx = Fk:currentRoom():getPlayerById(to_select)
if targetx and #targetx:getCardIds("ej") >0 and H.compareKingdomWith(Self,targetx) then
for _, cid in ipairs(targetx:getCardIds("ej")) do
local card = Fk:cloneCard("duel")
card.skillName = self.name
card.subcards={cid}
return Self:canUse(card) and not Self:prohibitUse(card) and #table.filter(Fk:currentRoom().alive_players, function (p)
return not Self:isProhibited(p, card)
end)>0
end
end
end,
on_use = function (self, room, effect)
local player = room:getPlayerById(effect.from)
local target = room:getPlayerById(effect.tos[1])
local cardsid = {}
if target and #target:getCardIds("ej") >0 then
for _, cid in ipairs(target:getCardIds("ej")) do
local card = Fk:cloneCard("duel")
card.skillName = self.name
card.subcards={cid}
if player:canUse(card) and not player:prohibitUse(card) and #table.filter(room.alive_players, function (p)
return not player:isProhibited(p, card)
end)>0 then
table.insert(cardsid,cid)
end
end
if #cardsid>0 then
local c = room:askForCardsChosen(player,target,1,1,{ card_data = { { "场上的可用牌", cardsid } } },self.name,"#tyj_heg__chuifeng-duel::"..target.id)
if #c >0 then
local slash = Fk:cloneCard("duel")
slash.skillName = self.name
slash:addSubcard(c[1])
local max_num = slash.skill:getMaxTargetNum(player, slash)
local targets = {}
for _, p in ipairs(room.alive_players) do
if player ~= p and not player:isProhibited(p, slash) then
table.insert(targets, p.id)
end
end
if #targets>0 or max_num>0 then
local tos = room:askForChoosePlayers(player, targets, 1, max_num, "#tyj_heg__chuifeng-use:::"..slash:toLogString(), self.name, true)
if #tos > 0 then
local use = {
from = player.id,
tos = table.map(tos, function(pid) return { pid } end),
card = slash,
}
if Fk:getCardById(c[1]).sub_type == Card.SubtypeWeapon then
use.additionalDamage = 1
end
if (room:getCardOwner(c[1])== nil) or (room:getCardOwner(c[1])~=player) or (room:getCardArea(c[1]) ~= player.Hand and room:getCardArea(c[1]) ~= player.Equip) then
use.disresponsiveList = use.disresponsiveList or {}
table.insertIfNeed(use.disresponsiveList, player.id)
end
room:useCard(use)
end
end
end
end
end
end,
}
tyj__wenyang:addSkill(tyj__chuifeng)
Fk:loadTranslationTable{
["tyj_heg__chuifeng"]="椎锋",
[":tyj_heg__chuifeng"]="出牌阶段限一次,你可以将一名同势力角色场上的一张牌当【决斗】使用,若不为你的牌,你不能响应此牌;若为武器牌,此牌伤害基数+1。",
["#tyj_heg__chuifeng-duel"]="椎锋:将 %dest 场上的一张牌当【决斗】使用。",
["#tyj_heg__chuifeng-use"]="椎锋:请指定使用 %arg 的目标。",
["~tyj_heg__wenyang"]="半生功业,而见疑于一家之言,岂能无怨!",
["$tyj_heg__chuifeng1"]="率军冲锋,不惧刀枪所阻!",
["$tyj_heg__chuifeng2"]="登锋履刃,何妨马革裹尸!",
["$tyj_heg__chuifeng3"]="力摧敌阵,如视天光破云!",
}
local tyj__furong = General:new(extension, "tyj_heg__furong", "shu", 4,4)
Fk:loadTranslationTable{
["tyj_heg__furong"] = "傅肜",
["#tyj_heg__furong"] = "弈世忠烈",
["designer:tyj_heg__furong"] = "汤圆",
["cv:tyj_heg__furong"] = "官方",
["illustrator:tyj_heg__furong"] = "鬼画府",
}
local tyj__liechi = fk.CreateViewAsSkill{
name="tyj_heg__liechi",
anim_type = "control",
pattern = "peach",
prompt = function ()
return "烈斥:你可以弃置一名角色的一张牌,然后以一种方式使用【桃】"
end,
card_num = 0,
card_filter = Util.FalseFunc,
view_as = function(self, cards)
local card = Fk:cloneCard("peach")
card.skillName = self.name
return card
end,
before_use = function (self, player, use)
local room = player.room
local tot = table.filter(room.alive_players,function (p)
return #p:getCardIds('he')>0
end)
if #tot>0 then
local to = room:askForChoosePlayers(player,table.map(tot,Util.IdMapper),1,1,"烈斥:选择要被弃牌的角色",self.name,false,false)
if #tot>0 and #room:getPlayerById(to[1]):getCardIds('he')>0 then
local choices={}
local cancards = {}
local target = room:getPlayerById(to[1])
local cards = room:askForCardChosen(player,target,'he',self.name,"tyj_heg__liechi-discard::"..target.id)
if cards and target:isAlive() then
room:throwCard(cards,self.name,target,player)
if #player:getCardIds('he')>0 then
for _, cid in ipairs(player:getCardIds('he')) do
if Fk:getCardById(cid).trueName==Fk:getCardById(cards).trueName then
local yesable = true
local peach = Fk:cloneCard("peach")
peach.skillName = self.name
peach:addSubcard(cid)
if player:prohibitUse(peach) then
break
end
if use.tos ~= nil then
for n, pid in ipairs(use.tos) do
if
(player:isProhibited(room:getPlayerById(pid[1]), peach))
then
yesable = false
break
end
end
end
if yesable == true then
table.insertIfNeed(cancards,cid)
end
end
end
if #cancards>0 then
table.insert(choices,"#tyj_heg__leichi-view_as")
end
end
table.insert(choices,"#tyj_heg__leichi-remove")
local all_choices = {"#tyj_heg__leichi-view_as","#tyj_heg__leichi-remove"}
local choice = room:askForChoice(player,choices,self.name,"烈斥:选择你要使用这张【桃】的方式",true,all_choices)
if choice == "#tyj_heg__leichi-remove" then
local choicesx = {}
local all_choicesx = {"主将","副将"}
if H.getHegLord(Fk:currentRoom(),player)~=player and H.hasGeneral(player, false) then
table.insert(choicesx,"主将")
end
if H.hasGeneral(player, true) then
table.insert(choicesx,"副将")
end
local choicex = room:askForChoice(player,choicesx,self.name,"烈斥:移除你的一张武将牌",false,all_choicesx)
if choicex == "主将" then
H.removeGeneral(room, player,false)
return
else
H.removeGeneral(room, player,true)
return
end
else
local get = room:askForCardsChosen(player, player, 1,1, {
card_data = {
{ "可选牌", cancards }
}
}, self.name, "烈斥:选择要被当【桃】用的牌")
if #get>0 then
use.card:addSubcard(get[1])
return
end
end
end
end
end
return "tyj_heg__liechi"
end,
enabled_at_response = function(self, player, res)
return
not res and
not table.find(Fk:currentRoom().alive_players, function(p) return H.compareKingdomWith(player,p)~=true and p.dying end)
end,
}
local tyj__liechi_prohibit = fk.CreateProhibitSkill{
name = "#tyj_heg__liechi_prohibit",
is_prohibited = function(self, from, to, card)
if from:hasSkill("tyj_heg__liechi", true) then
return table.contains(card.skillNames, "tyj_heg__liechi") and H.compareKingdomWith(from,to)~=true
end
end,
}
tyj__liechi:addRelatedSkill(tyj__liechi_prohibit)
tyj__furong:addSkill(tyj__liechi)
Fk:loadTranslationTable{
["tyj_heg__liechi"]="烈斥",
[":tyj_heg__liechi"]="你需要对同势力角色使用【桃】时,你可以弃置一名角色的一张牌然后选择一项:1.将一张同名牌当【桃】使用;2.移除一张武将牌以视为使用【桃】。",
["#tyj_heg__liechi-discard"]="烈斥:弃置 %dest 的一张牌。",
["#tyj_heg__leichi-view_as"]="将牌当【桃】",
[":#tyj_heg__leichi-view_as"]="选择一张与弃置的牌牌名相同的牌,将这张牌当【桃】使用。",
["#tyj_heg__leichi-remove"]="移除武将牌",
[":#tyj_heg__leichi-remove"]="移除你的一张武将牌,视为使用【桃】。",
["~tyj_heg__furong"]="吴狗!何有汉将军降者!",
["$tyj_heg__liechi1"]="老夫一息尚存,吴狗便动不得主公分毫!",
["$tyj_heg__liechi2"]="吴狗何在,大汉将军傅肜在此!",
}
local tyj__zhanggong = General:new(extension, "tyj_heg__zhanggong", "wei", 3,3)
Fk:loadTranslationTable{
["tyj_heg__zhanggong"] = "张恭",
["#tyj_heg__zhanggong"] = "西域长歌",
["designer:tyj_heg__zhanggong"] = "汤圆",
["cv:tyj_heg__zhanggong"] = "官方",
["illustrator:tyj_heg__zhanggong"] = "B_LEE",
}
local tyj__qianxin_active = fk.CreateActiveSkill{
name = "#tyj_heg__qianxin_active",
mute = true,
visible = false,
min_card_num = 1,
target_num = 0,
card_filter = function(self, to_select, selected)
if Self:prohibitDiscard(Fk:getCardById(to_select)) then return false end
if #selected == 0 then
return true
else
return table.every(selected, function(id) return Fk:getCardById(to_select).suit ~= Fk:getCardById(id).suit end)
end
end,
}
local tyj__qianxin = fk.CreateTriggerSkill{
name = "tyj_heg__qianxin",
events ={fk.EnterDying},
can_trigger = function (self, event, target, player, data)
if player:hasSkill(self) then
return H.compareKingdomWith(player,target) and #player:getCardIds('he')>0
end
end,
on_cost = function (self, event, target, player, data)
local room = player.room
local default_discard = table.find(player:getCardIds{Player.Hand, Player.Equip}, function (id)
return not player:prohibitDiscard(Fk:getCardById(id))
end)
if default_discard == nil then return false end
local _,ret = room:askForUseActiveSkill(player,"#tyj_heg__qianxin_active","#tyj__qianxin-dis::"..target.id,true)
if ret and ret.cards and #ret.cards>0 then
self.cost_data = ret.cards
return true
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
room:throwCard(self.cost_data, self.name, player, player)
data.extra_data = data.extra_data or {}
local tos = data.extra_data.tyj_heg__qianxin_draw or {}
table.insertIfNeed(tos,{player.id,#self.cost_data})
data.extra_data.tyj_heg__qianxin_draw = tos
end,
refresh_events = {fk.AskForCardUse,fk.AfterAskForCardUse},
can_refresh = function (self, event, target, player, data)
if target == player then
if event == fk.AfterAskForCardUse then
return not data.result and data.extra_data and data.extra_data.tyj_heg__qianxin_dis and data.extra_data.tyj_heg__qianxin_dis>0
else
local room = player.room
local dying_event = room.logic:getCurrentEvent()
if dying_event then
local dying = dying_event.data[1]
local datax = dying.extra_data or {}
return datax and datax.tyj_heg__qianxin_draw and #datax.tyj_heg__qianxin_draw>0
end
end
end
end,
on_refresh = function (self, event, target, player, data)
local room = player.room
if event == fk.AfterAskForCardUse then
local num = data.extra_data.tyj_heg__qianxin_dis
if num and num>0 then
local ids = table.filter(player:getCardIds("he"), function(id) return not player:prohibitDiscard(Fk:getCardById(id)) end)
if #ids <= data.extra_data.tyj_heg__qianxin_dis then
room:throwCard(ids, self.name, player, player)
else
room:askForDiscard(player, data.extra_data.tyj_heg__qianxin_dis, data.extra_data.tyj_heg__qianxin_dis, false, self.name, false,nil,"tyj_heg__qianxin-choose:::"..num,false)
end
end
else
local todis =0
local dying_event = room.logic:getCurrentEvent()--:findParent(GameEvent.Dying)
if dying_event then
local dying = dying_event.data[1]
local datax = dying.extra_data or {}
if datax.tyj_heg__qianxin_draw and #datax.tyj_heg__qianxin_draw>0 then
for _, tos in ipairs(datax.tyj_heg__qianxin_draw) do
if #tos>0 then
local to = room:getPlayerById(tos[1])
if H.compareKingdomWith(player,to) then
room:drawCards(player,tos[2],self.name)
todis = todis+tos[2]
end
end
end
end
end
if todis >0 then
data.extra_data = data.extra_data or {}
data.extra_data.tyj_heg__qianxin_dis = data.extra_data.tyj_heg__qianxin_dis or 0
data.extra_data.tyj_heg__qianxin_dis=data.extra_data.tyj_heg__qianxin_dis+todis
end
end
end,
}
local tyj__zhenxing = fk.CreateTriggerSkill{
name = "tyj_heg__zhenxing",
events = {fk.Damaged},
can_trigger = function (self, event, target, player, data)
return target==player and player:hasSkill(self)
end,
on_cost = function (self, event, target, player, data)
local room = player.room
local choices = {"1","2","3","Cancel"}
local choice = room:askForChoice(player,choices,self.name,"是否发动 镇行 展示牌堆顶的至多三张牌?",false)
if choice ~= "Cancel" then
self.cost_data = tonumber(choice)
return true
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
local getcards = room:getNCards(self.cost_data)
local showcards = {}
table.insertTableIfNeed(showcards,getcards)
if #player:getCardIds('h')>0 then
table.insertTableIfNeed(showcards,player:getCardIds('h'))
end
player:showCards(getcards)
room:delay(600)
player:showCards(player:getCardIds('h'))
room:delay(800)
local suits = {}
for _, cid in ipairs(showcards) do
local c = Fk:getCardById(cid)
if c.suit and not table.contains(suits,c.suit) then
table.insertIfNeed(suits,c.suit)
else
suits = nil
break
end
end
if suits ~= nil then
local toget = {}
for _, cid in ipairs(showcards) do
if ((room:getCardOwner(cid)==nil) or(room:getCardOwner(cid)~=player)) or room:getCardArea(cid)~=Card.PlayerHand then
table.insertIfNeed(toget,cid)
end
end
if #toget>0 then
room:moveCardTo(toget, Player.Hand, player, fk.ReasonPrey, self.name, "", true)
end
end
local cards = table.filter(getcards, function(id) return room:getCardArea(id) == Card.Processing end)
room:moveCardTo(cards, Card.DrawPile, nil, fk.ReasonPutIntoDiscardPile, self.name, nil, true, player.id)
end,
}
tyj__qianxin:addRelatedSkill(tyj__qianxin_active)
tyj__zhanggong:addSkill(tyj__qianxin)
tyj__zhanggong:addSkill(tyj__zhenxing)
Fk:loadTranslationTable{
["tyj_heg__qianxin"]="遣信",
[":tyj_heg__qianxin"]="同势力角色进入濒死时,你可以弃置任意张花色不同的牌,令同势力角色因此结算需要使用【桃】时摸等量张牌,若其未使用,其弃置等量张牌。",
["#tyj__qianxin-dis"]="是否发动 遣信 弃置任意张牌令即将对 %dest 使用【桃】的同势力角色摸等量张牌?",
["#tyj_heg__qianxin_active"]="遣信",
["tyj_heg__qianxin-choose"]="遣信:选择 %arg 张牌弃置。",
["tyj_heg__zhenxing"]="镇行",
[":tyj_heg__zhenxing"]="你受到伤害后,可以展示牌堆顶的至多三张牌并展示手牌,若这些牌花色均不相同,你获得这些牌。",
["~tyj_heg__zhanggong"]="大漠孤烟,孤立无援啊。",
["$tyj_heg__qianxin1"]="兵困绝地,将至如归!",
["$tyj_heg__qianxin2"]="临危之际,速速来援!",
["$tyj_heg__zhenxing1"]="东征西讨,募军百里挑一。",
["$tyj_heg__zhenxing2"]="众口铄金,积毁销骨。",
}
local tyj__sunhao = General:new(extension, "tyj_heg__sunhao", "wu", 4,4)
Fk:loadTranslationTable{
["tyj_heg__sunhao"] = "孙皓",
["#tyj_heg__sunhao"] = "时日曷丧",
["designer:tyj_heg__sunhao"] = "汤圆",
["cv:tyj_heg__sunhao"] = "官方",
["illustrator:tyj_heg__sunhao"] = "LiuHeng",
}
local tyj__canshi_active = fk.CreateActiveSkill{
name = "#tyj_heg__canshi_active",
mute = true,
visible = false,
min_card_num = 1,
target_num = 0,
card_filter = function(self, to_select, selected)
return #selected < Self.maxHp
end,
}
local tyj__canshi = fk.CreateTriggerSkill{
name = "tyj_heg__canshi",
events = {fk.EventPhaseStart},
can_trigger = function (self, event, target, player, data)
if target==player and player.phase == Player.Play and player:hasSkill(self) then
if player:isWounded() then
return true
else
return #player:getCardIds('he')>0
end
end
end,
on_cost = function (self, event, target, player, data)
local room = player.room
if player:isWounded() then
return true
else
local _,ret = room:askForUseActiveSkill(player,"#tyj_heg__canshi_active","#tyj__canshi-dis:::"..player.maxHp,true)
if ret and ret.cards and #ret.cards>0 then
self.cost_data = ret.cards
return true
end
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
if self.cost_data and #self.cost_data>0 then
room:recastCard(self.cost_data, player, self.name)
elseif player:isWounded() then
local tos = table.filter(room.alive_players,function(p) return p:isWounded() and H.compareKingdomWith(player,p) end)
if #tos>0 then
local to = room:askForChoosePlayers(player,table.map(tos,Util.IdMapper),1,#tos,"#tyj_heg__canshi-choose",self.name,false)
if #to>0 then
for _, pid in ipairs(to) do
local p = room:getPlayerById(pid)
room:changeMaxHp(p,-1)
end
H.addHegMark(room,player, "yinyangfish",#to)
end
end
end
end,
}
local tyj__chouhai = fk.CreateTriggerSkill{
name = "tyj_heg__chouhai",
events = {fk.DamageInflicted,fk.DamageCaused},
can_trigger = function (self, event, target, player, data)
if target==player and player:hasSkill(self) then
return not player:isWounded() and not data.to:isWounded()
end
end,
frequency = Skill.Compulsory,
on_use = function (self, event, target, player, data)
data.damage = data.damage+1
end,
}
tyj__canshi:addRelatedSkill(tyj__canshi_active)
tyj__sunhao:addSkill(tyj__canshi)
tyj__sunhao:addSkill(tyj__chouhai)
Fk:loadTranslationTable{
["tyj_heg__canshi"]="残蚀",
[":tyj_heg__canshi"]="出牌阶段开始时,若你:未受伤,你可以重铸至多体力上限张牌;已受伤,你令至少一名与你势力相同且已受伤的角色减1点体力上限,然后你获得等量枚“阴阳鱼”标记。",
["#tyj__qianxin-dis"]="是否发动 遣信 弃置任意张牌令即将对 %dest 使用【桃】的同势力角色摸等量张牌?",
["#tyj_heg__canshi_active"]="残蚀",
["#tyj_heg__canshi-dis"]="是否发动 残蚀 重铸至多 %arg 张牌?。",
["#tyj_heg__canshi-choose"]="残蚀:令至少一名与你势力相同且已受伤的角色减1点体力上限。",
["tyj_heg__chouhai"]="仇海",
[":tyj_heg__chouhai"]="锁定技,你造成或受到伤害时,若你与受伤角色均未受伤,此伤害+1。",
["~tyj_heg__sunhao"]="命啊!命!",
["$tyj_heg__canshi1"]="众人与蝼蚁何异?呵呵呵。",
["$tyj_heg__canshi2"]="难道,一切不在朕手中?",
["$tyj_heg__chouhai1"]="哼!树敌三千又如何?",
["$tyj_heg__chouhai2"]="不发狂,就灭亡!",
["$tyj_heg__chouhai3"]="这是要我命归黄泉吗!",
["$tyj_heg__chouhai4"]="这就是末世皇帝的不归路!",
}
return extension
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。