代码拉取完成,页面将自动刷新
local extension = Package:new("tyj_sp_guan")
extension.extensionName = "tyj"
Fk:loadTranslationTable{
["tyj_sp_guan"] = "汤圆官改将",
["tyj"]='汤圆精品包'
}
local U = require "packages/utility/utility"
local tyj_gongsunyuan = General:new(extension, "tyj__gongsunyuan", "qun", 4,4)
Fk:loadTranslationTable{
["tyj__gongsunyuan"] = "公孙渊",
["#tyj__gongsunyuan"] = "据燕待沽",
["designer:tyj__gongsunyuan"] = "汤圆",
["cv:tyj__gongsunyuan"] = "官方",
["illustrator:tyj__gongsunyuan"] = "秋呆呆",
}
local tyj__tanyi = fk.CreateTriggerSkill{
name = "tyj__tanyi",
anim_type = "control",
events = {fk.AfterCardsMove},
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) then
local tos = {}
for _, move in ipairs(data) do
if move.to and move.toArea == Card.PlayerHand and move.to ~= player.id then
local to = player.room:getPlayerById(move.to);
if #move.moveInfo and #move.moveInfo>1 and ( to.phase ~= Player.Draw or player:getMark("@tyj_yanluan_used")~=0) and not to:isKongcheng()then
table.insertIfNeed(tos, move.to)
end
end
if #tos > 0 then
self.cost_data = tos
return true
end
end
end
end,
on_trigger = function(self, event, target, player, data)
local room = player.room
local targets = table.simpleClone(self.cost_data)
room:sortPlayersByAction(targets)
for _, target_id in ipairs(targets) do
if not player:hasSkill(self) then break end
local skill_target = room:getPlayerById(target_id)
if not skill_target:isNude() then
if skill_target and not skill_target.dead then
self:doCost(event, skill_target, player, data)
end
end
end
end,
on_cost = function(self, event, target, player, data)
return player.room:askForSkillInvoke(player, self.name, nil, "#tyj__tanyi-invoke::"..target.id)
end,
on_use = function(self, event, target, player, data)
local room = player.room
room:doIndicate(player.id, {target.id})
local id = room:askForCardChosen(player, target, "he", self.name)
local card = Fk:getCardById(id)
room:obtainCard(player, id, false, fk.ReasonPrey,player.id,self.name)
local mark=target:getTableMark(target,"@@tyj__tanyi_delaycards-turn")
mark[#mark+1]=id
room:setPlayerMark(target,"@@tyj__tanyi_delaycards-turn", mark)
local tos={}
for _, p in ipairs(room:getOtherPlayers(player, true)) do
if player:inMyAttackRange(p) and p.hp>=player.hp then
table.insertIfNeed(tos, p.id)
end
end
if #tos>0 then
local p2 = room:askForChoosePlayers(player, tos, 1, 1, "#tyj__tanyi-give:::"..card:toLogString(), self.name, true)
if #p2 ~= 0 then
room:obtainCard(p2[1], id, false, fk.ReasonPrey,player.id,self.name)
end
end
end,
}
local tyj__tanyi_delay = fk.CreateTriggerSkill{
name = "#tyj__tanyi_delay",
anim_type = "control",
events = {fk.TurnEnd},
mute = true,
can_trigger = function(self, event, target, player, data)
if #player:getTableMark( "@@tyj__tanyi_delaycards-turn")>0 then
return true
end
end,
on_cost = Util.TrueFunc,
on_use = function(self, event, target, player, data)
local room = player.room
local mark = player:getTableMark( "@@tyj__tanyi_delaycards-turn");
for _, p in ipairs(mark) do
if(room:getCardOwner(p)~=player and room:getCardOwner(p)~=nil) then
room:useVirtualCard("slash", nil, player,room:getCardOwner(p), self.name, true)
end
end
room:setPlayerMark(target,"@@tyj__tanyi_delaycards-turn",{})
end,
}
local tyj__yanluan = fk.CreateTriggerSkill{
name = "tyj__yanluan",
anim_type = "drawcard",
frequency = Skill.Wake,
events = {fk.EventPhaseStart},
can_trigger = function(self, event, target, player, data)
if target == player and player:hasSkill(self) and player.phase == Player.Start and player:usedSkillTimes(self.name, Player.HistoryGame) == 0 then
return true
end
end,
can_wake = function(self, event, target, player, data)
local room = player.room
local tos={}
for _, p in ipairs(room:getOtherPlayers(player, true)) do
if player:inMyAttackRange(p) then
table.insertIfNeed(tos, p.id)
end
end
if #tos == 0 then return false end
return table.every(player.room.alive_players, function(p)
return (not player:inMyAttackRange(p)) or (#player.room.logic:getActualDamageEvents( 1, function(e) return e.data[1].to == p and e.data[1].card and e.data[1].card.trueName=="slash" end, Player.HistoryGame) > 0)
end)
end,
on_use = function(self, event, target, player, data)
local room = player.room
room:setPlayerMark(target,"@tyj_yanluan_used",'攻击范围内')
room:handleAddLoseSkills(player, "tianming", nil, true, false)
end,
}
local tyj__yanluan_inrange = fk.CreateAttackRangeSkill{
name = "#tyj__yanluan_inrange",
frequency = Skill.Compulsory,
within_func = function (self, from, to)
for _, p in ipairs(Fk:currentRoom().alive_players) do
if to:getMark("@tyj_yanluan_used")~=0 then
return true
end
end
end,
}
tyj__tanyi:addRelatedSkill(tyj__tanyi_delay)
tyj_gongsunyuan:addSkill(tyj__tanyi)
tyj__yanluan:addRelatedSkill(tyj__yanluan_inrange)
tyj_gongsunyuan:addSkill(tyj__yanluan)
tyj_gongsunyuan:addRelatedSkill("tianming")
Fk:loadTranslationTable{
["tyj__tanyi"] = "贪异",
[":tyj__tanyi"] = "当其他角色于摸牌阶段外一次性获得至少两张牌后,你可以分配其的一张牌并明置之至本回合结束。"..
"此回合结束时,其视为对此牌的拥有者使用一张【杀】。",
["#tyj__tanyi-invoke"] = "是否对 %dest 使用 贪异 以获得其一张牌?",
["#tyj__tanyi-give"] = "你可以将 %arg 分配给攻击范围内一名体力值不大于你的角色",
["@@tyj__tanyi_delaycards-turn"] = "贪异",
["tyj__tanyi_delay"] = "贪异",
["tyj__yanluan"] = "燕乱",
[":tyj__yanluan"] = "觉醒技,准备阶段,若你攻击范围内的角色皆受到过【杀】造成的伤害,你令你视为在所有角色的攻击范围内,".."然后获得〖天命〗并删去〖贪异〗描述中的“不因摸牌阶段”。",
["@tyj_yanluan_used"]= "燕乱",
["#hello"] = "执行",
["$tyj__tanyi1"] = "天下苍生攘攘,何人不为利惘?",
["$tyj__tanyi2"] = "珠宝金髭,不过寻常之物,雄踞一方,才是英雄所为。",
["$tyj__yanluan1"] = "一生纵横,怎可向他人称臣?",
["$tyj__yanluan2"] = "曹刘可王,孤,亦可王!",
["$tianming_tyj__gongsunyuan1"] = "大丈夫,怎能久居人下?",
["$tianming_tyj__gongsunyuan2"] = "从今天起,我就是燕王!",
["~tyj__gongsunyuan"] = "天险异象,终无处可逃。",
}
local tyj__xushao = General(extension, "tyj__xushao", "qun", 3,3)
Fk:loadTranslationTable{
["tyj__xushao"] = "者许劭",
["#tyj__xushao"] = "识“者”读心",
["designer:tyj__xushao"] = "汤圆",
["cv:tyj__xushao"] = "官方",
["illustrator:tyj__xushao"] = "深圳枭瞳",
}
local function getSkillNameListall(playerx)--能获取衍生技
local ret = {}
if playerx then
local other_skills = table.map(playerx.other_skills, Util.Name2SkillMapper)
local self_skills = table.connect(playerx.skills, other_skills)
local myrelated_skills = table.connect(playerx.related_skills, self_skills)
local otherskllmap = table.map(playerx.related_other_skills, Util.Name2SkillMapper)
local skills = table.connect(otherskllmap,myrelated_skills)
for _, skill in ipairs(skills) do
table.insert(ret, skill.name)
end
end
return ret
end
local function findAlltheSkill() --用于获取全部的已开启武将的可获得技能
local skills = {}
for _, general in pairs(Fk:getAllGenerals()) do
for _, skill in ipairs(general.skills) do
if not skill.lordSkill and #skill.attachedKingdom == 0 then
table.insert(skills, skill.name)
end
end
end
return skills
end
local function startsWith(str, prefix)
return str:sub(1, #prefix) == prefix
end
local function findwordskill(string)
local skillpool2={} --筛选出来的技能放进这个表
local pushednames={}
for _, general in pairs(Fk:getAllGenerals()) do
for _, skn in ipairs(getSkillNameListall(general)) do
local sk=Fk.skills[skn]
if not sk.lordSkill and #sk.attachedKingdom == 0 then
--local skill = sk.name
if Fk:translate("$"..skn.."_"..general.name) and string.find(Fk:translate("$"..skn.."_"..general.name),string) and not table.contains(pushednames,"$"..skn.."_"..general.name) then
table.insert(pushednames,"$"..skn.."_"..general.name)
table.insert(skillpool2,{skn,0,general.name,1})
elseif Fk:translate("$"..skn) and string.find(Fk:translate("$"..skn),string) and not table.contains(pushednames,"$"..skn) then
table.insert(pushednames,"$"..skn)
table.insert(skillpool2,{skn,0,general.name})
else
for i=1,99 do
if Fk:translate("$"..skn..tostring(i)) or Fk:translate("$"..skn.."_"..general.name..tostring(i)) then --从1到99依次检查对应技能有没有语音这一条语音
if string.find(Fk:translate("$"..skn.."_"..general.name..tostring(i)), string) and not table.contains(pushednames,"$"..skn.."_"..general.name..tostring(i)) then
table.insert(pushednames,"$"..skn.."_"..general.name..tostring(i))
table.insert(skillpool2,{skn,i,general.name,1})
elseif string.find(Fk:translate("$"..skn..tostring(i)), string) and not table.contains(pushednames,"$"..skn..tostring(i)) then --检索这局语音的台词translate里是否包含“者”字
table.insert(pushednames,"$"..skn..tostring(i))
table.insert(skillpool2,{skn,i,general.name})
end
else break end --如果没有则说明已经没有其他语音了,跳过这个技能
end
end
end
end
if startsWith(general.name,"tymou__") then --该死的谋武将双形态,真你妈该死
local mouname = general.name:sub(1,5).."2"..general.name:sub(6,#general.name)
for _, skn in ipairs(getSkillNameListall(general)) do
local sk=Fk.skills[skn]
if not sk.lordSkill and #sk.attachedKingdom == 0 then
--local skill = sk.name
if Fk:translate("$"..skn.."_"..mouname) and string.find(Fk:translate("$"..skn.."_"..mouname),string) and not table.contains(pushednames,"$"..skn.."_"..mouname) then
table.insert(pushednames,"$"..skn.."_"..mouname)
table.insert(skillpool2,{skn,0,mouname,1})
else
for i=1,99 do
if Fk:translate("$"..skn.."_"..mouname..tostring(i)) then --从1到99依次检查对应技能有没有语音这一条语音
if string.find(Fk:translate("$"..skn.."_"..mouname..tostring(i)), string) and not table.contains(pushednames,"$"..skn.."_"..mouname..tostring(i)) then
table.insert(pushednames,"$"..skn.."_"..mouname..tostring(i))
table.insert(skillpool2,{skn,i,mouname,1})
end
else break end --如果没有则说明已经没有其他语音了,跳过这个技能
end
end
end
end
end
end
return skillpool2
end
--"者许劭 评鉴"
local tyj__pingjian = fk.CreateTriggerSkill{
name = "tyj__pingjian",
anim_type = "drawcard",
events = {fk.CardUsing},
frequency = Skill.Compulsory,
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and player.phase == Player.Play and not table.contains(player:getTableMark('@$tyj__pingjian_card-phase'), data.card.trueName)
end,
on_use = function(self, event, target, player, data)
local room = player.room
local mark = player:getTableMark('@$tyj__pingjian_card-phase')
table.insert(mark, data.card.trueName)
player.room:setPlayerMark(player,'@$tyj__pingjian_card-phase', mark)
if #player:getTableMark("tyj__xushao_skilllid") == 0 then --如果已经筛过技能存在mark里了就不再生成一遍技能池,提高性能
--local skillpool1=findAlltheSkill() --使用findAlltheSkill生成初始技能池
local skillpool2=findwordskill("者")
room:setPlayerMark(player,"tyj__xushao_skilllid",skillpool2) --把筛完的有“者”的技能存到mark里后面发动时直接用,提高性能
end
local skills=table.random(player:getTableMark("tyj__xushao_skilllid"), 1) --随机选取一个已经筛好台词有“者”的技能
if #skills[1]==3 then
player:chat("$"..skills[1][1]..":"..skills[1][2]) --念这个语音的同时chat出来
else
player:chat("$"..skills[1][1]..":"..skills[1][2]..":"..skills[1][3]) --念这个语音的同时chat出来
end
if player:hasSkill(skills[1][1], true) then --如果已经有随机到的这个技能
--room:drawCards(player,2,self.name) --则摸两张牌
else --否则
room:handleAddLoseSkills(player, skills[1][1]) --你获得随机到的技能
local skillsx = player:getTableMark( self.name)
table.insert(skillsx, skills[1][1])
room:setPlayerMark(player, self.name, skillsx) --然后把这个技能存到一个mark里等会清除
local ogeneral = player.general
player.general = skills[1][3]
room:broadcastProperty(player, "general")
room:delay(1350)
player.general = ogeneral
room:broadcastProperty(player, "general")
end
end,
refresh_events = {fk.EventPhaseProceeding},
can_refresh = function(self, event, target, player, data)
return target == player and player.phase == Player.Play and player:getMark(self.name) ~= 0
end,
on_refresh = function(self, event, target, player, data)
local room = player.room
room:handleAddLoseSkills(player, table.concat(
table.map(player:getMark(self.name), function(str)
return "-" .. str
end), "|")) -- 清除mark里存的技能
room:setPlayerMark(player, self.name, 0)
end,
}
local tyj__jianzang = fk.CreateTriggerSkill{
name="tyj__jianzang",
anim_type="support",
events={fk.EventPhaseStart},
can_trigger = function (self, event, target, player, data)
if target == player and player:hasSkill(self) and player.phase == Player.Finish then
local gskills = Fk.generals[target.general]:getSkillNameList()
if target.deputyGeneral and target.deputyGeneral ~= "" then
table.insertTableIfNeed(gskills, Fk.generals[target.deputyGeneral]:getSkillNameList())
end
local skills={}
for _, s in ipairs(player.player_skills) do
if s.name~="#ice_damage_skill_tyj" and s:isPlayerSkill(player) and not s.attached_equip and not table.contains(gskills,s.name) then
table.insert(skills,s.name)
end
end
if #skills >0 then
self.cost_data={skills}
return true
end
end
end,
on_cost= function (self, event, target, player, data)
local room = player.room
local result = room:askForChoosePlayers(player,
table.map(room:getOtherPlayers(player), Util.IdMapper), 1, 1,
'#tyj__jianzang-invoke', self.name, true)
if #result>0 then
local calls=self.cost_data
table.insert(calls,result[1])
self.cost_data=calls
return true
end
end,
on_use =function (self, event, target, player, data)
local room = player.room
if self.cost_data and #self.cost_data>1 then
room:doIndicate(player.id,{self.cost_data[2]})
local skills = self.cost_data[1]
local to = room:getPlayerById(self.cost_data[2])
local result = room:askForCustomDialog(player, self.name,
"packages/tyj/qml/ChooseSkillBox.qml", {
skills, 1, 1, "令其获得的技能"
})
if result == "" then return false end
local choice = json.decode(result)
if #choice > 0 then
if not to:hasSkill(choice[1]) then
room:handleAddLoseSkills(to, table.concat(choice, "|"), nil, true, false)
local mark = to:getTableMark("@@tyj__jianzang_skill")
table.insert(mark,{player.id,choice[1]})
room:setPlayerMark(to,"@@tyj__jianzang_skill",mark)
end
if not to:isNude() then
local id = room:askForCardChosen(player,to, "he", self.name)
if id then
room:obtainCard(player, id, false, fk.ReasonPrey,player.id,self.name)
end
end
end
end
end,
refresh_events ={fk.EventPhaseStart},
can_refresh = function (self, event, target, player, data)
if #player:getTableMark("@@tyj__jianzang_skill")==0 or #table.filter(player:getTableMark("@@tyj__jianzang_skill"), function(p) return target.id==p[1] end)==0 then return false end
if target.phase == Player.Start then
return true
end
end,
on_refresh = function (self, event, target, player, data)
local room = player.room
local mark = player:getTableMark("@@tyj__jianzang_skill")
for i=#mark,1,-1 do
if mark[i][1]==target.id then
room:handleAddLoseSkills(player,"-"..mark[i][2], nil, true, false)
table.remove(mark,i)
end
end
if #mark>0 then
room:setPlayerMark(player,"@@tyj__jianzang_skill",mark)
else
room:setPlayerMark(player,"@@tyj__jianzang_skill",0)
end
end
}
tyj__xushao:addSkill(tyj__pingjian)
tyj__xushao:addSkill(tyj__jianzang)
Fk:loadTranslationTable{
["tyj__pingjian"]="评鉴",
[":tyj__pingjian"]="锁定技,出牌阶段每种牌名限一次,你使用一张牌时,你念一句包含“者”的技能台词并获得对应技能直到你的下个出牌阶段开始。",
["tyj__jianzang"]="荐臧",
[":tyj__jianzang"]="结束阶段,你可以选择你的一个非武将牌上的技能,令一名其他角色获得之直到你的下个准备阶段并获得其的一张牌。",
["$tyj__jianzang1"]="吾好核论乡党,长于明析臧否。",
["$tyj__jianzang2"]="君清平之奸贼,乱世之英雄。",
["$tyj__jianzang3"]="一言难道千秋业,一纸雅评半世人。",
["@@tyj__jianzang_skill"]="荐臧",
["#tyj__jianzang-invoke"]="是否对一名其他角色发动 荐臧 ?",
['@$tyj__pingjian_card-phase']="评鉴",
["~tyj__xushao"]="处士尽矣,汉已亡矣!",
["@tyj__pingjian_skillcount"]="评鉴技能库",
}
local tyj__zhugeguo = General:new(extension, "tyj__zhugeguo", "shu", 3,3,General.Female)
Fk:loadTranslationTable{
["tyj__zhugeguo"] = "诸葛果",
["#tyj__zhugeguo"] = "凤阁乘烟",
["designer:tyj__zhugeguo"] = "汤圆",
["cv:tyj__zhugeguo"] = "官方",
["illustrator:tyj__zhugeguo"] = "biou",
}
local tyj__qirang = fk.CreateTriggerSkill{
anim_type = "drawcard",
name = "tyj__qirang",
events = {fk.EventPhaseStart},
mute=true,
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and player.phase == Player.Draw
end,
frequency = Skill.Compulsory,
on_use = function(self, event, target, player, data)
local room=player.room
local result=false
if player:getMark("tyj__qirang_awaken")~=0 then
result=player.room:askForSkillInvoke(player, self.name, nil, "#tyj__qirang-invoke")
else result=true end
if result==true then
room:notifySkillInvoked(player, self.name)
player:broadcastSkillInvoke(self.name,-1)
local cardsJudged = {}
for i=1,20 do
local judge = {
who = player,
reason = "lightning",
pattern = ".|2~9|spade",
tyj__qirang = true,
}
room:judge(judge)
player.room:obtainCard(player, judge.card, true, nil, player.id, "tyj__qirang")
table.insert(cardsJudged, judge.card)
if judge.card.suit == Card.Spade and judge.card.number > 1 and judge.card.number < 10 then
local fakecard=Fk:cloneCard("lightning")
room:damage{
to = player,
damage = 3,
card = fakecard,
damageType = fk.ThunderDamage,
skillName = self.name,
}
if(player:getMark("tyj__qirang-phase")~=0) then
break
end
end
if player.dead or not table.every(cardsJudged, function(card)
return card == judge.card or judge.card:compareSuitWith(card, true)
end)
then
break
end
end
end
if result == true then
return true
end
end,
refresh_events = {fk.AfterCardsMove ,fk.Damaged},
can_refresh = function(self, event, target, player, data)
if player:hasSkill(self) then
if event== fk.Damaged then return target == player and data.skillName == self.name and not data.from
else
for _, move in ipairs(data) do
if move.to and move.toArea == Card.PlayerHand and move.to == player.id and move.skillName and move.skillName=='tyj__qirang' then
return player:getMark('@tyj__qirang_gained') < 9
end
end
end
end
end,
on_refresh = function(self, event, target, player, data)
if event== fk.Damaged then
player.room:setPlayerMark(player, "tyj__qirang-phase", 1)
else
local room = player.room
local mark = player:getMark('@tyj__qirang_gained');
for _, move in ipairs(data) do
if move.to and move.toArea == Card.PlayerHand and move.to == player.id and move.skillName and move.skillName=='tyj__qirang' then
local to = player.room:getPlayerById(move.to);
if #move.moveInfo and #move.moveInfo>0 then
mark=mark+#move.moveInfo
end
end
end
if mark >8 and (player:getMark("tyj__qirang_awaken")==0 or not player:hasSkill('taji')) then
room:broadcastPlaySound("./packages/tyj/audio/skill/tyj__qirang_wake1")
room:doAnimate("InvokeUltSkill", {
name = "tyj__qirang",
player = player.id,
deputy = player.deputyGeneral and player.deputyGeneral ~= "" and table.contains(Fk.generals[player.deputyGeneral]:getSkillNameList(true),"tyj__qirang"),
})
room:delay(2000)
room:setPlayerMark(player,"tyj__qirang_awaken",1)
room:handleAddLoseSkills(player,'taji');
end
room:setPlayerMark(player,'@tyj__qirang_gained',mark)
end
end,
}
local tyj__xingcui = fk.CreateViewAsSkill{
name = "tyj__xingcui",
pattern = ".|.|.|.|.|trick,equip",
anim_type = "special",
expand_pile = function (self)
return table.slice(Self:getTableMark( "tyj__xingcui_view"), 1, 2)
end,
prompt = function()
return "#tyj__xingcui:::"..1
end,
card_filter = function(self, to_select, selected)
if #selected == 0 and table.contains(Self:getTableMark( "tyj__xingcui_view"), to_select) then
local card = Fk:getCardById(to_select)
if Fk.currentResponsePattern == nil then
return Self:canUse(card) and not Self:prohibitUse(card) and card.type ~= card.TypeBasic
else
return Exppattern:Parse(Fk.currentResponsePattern):match(card) and card.type ~= card.TypeBasic
end
end
end,
view_as = function(self, cards)
if #cards ~= 1 then return end
return Fk:getCardById(cards[1])
end,
enabled_at_play = function(self, player)
return #player:getTableMark( "tyj__xingcui_view") > 0
end,
enabled_at_response = function(self, player, response)
return not response and #player:getTableMark( "tyj__xingcui_view") > 0
end,
}
local tyj__xingcui_trigger = fk.CreateTriggerSkill{
name = "#tyj__xingcui_trigger",
mute = true,
refresh_events = {fk.AfterCardsMove, fk.AfterDrawPileShuffle, fk.EventAcquireSkill, fk.EventLoseSkill},
can_refresh = function(self, event, target, player, data)
if event == fk.EventAcquireSkill or event == fk.EventLoseSkill then
return data == tyj__xingcui
else
return player:hasSkill(tyj__xingcui, true) and (player == target or event ~= fk.PreCardUse)
end
end,
on_refresh = function(self, event, target, player, data)
local room = player.room
if event == fk.AfterCardsMove or event == fk.AfterDrawPileShuffle then
local mark = player:getTableMark("tyj__xingcui_view")
local draw_pile = room.draw_pile
local new_mark = {}
if #draw_pile > 0 then
table.insert(new_mark, draw_pile[#draw_pile])
end
if #new_mark ~= mark then
room:setPlayerMark(player, "tyj__xingcui_view", new_mark)
end
for i = 1, #new_mark, 1 do
if new_mark[i] ~= new_mark[i] then
room:setPlayerMark(player, "tyj__xingcui_view", new_mark)
return false
end
end
elseif event == fk.EventAcquireSkill then
local draw_pile = room.draw_pile
local mark = {}
if #draw_pile > 0 then
table.insert(mark, draw_pile[#draw_pile])
end
room:setPlayerMark(player, "tyj__xingcui_view", mark)
elseif event == fk.EventLoseSkill then
room:setPlayerMark(player, "tyj__xingcui_view", 0)
end
end,
}
local tyj__xingcui_judge =fk.CreateTriggerSkill{
name = "#tyj_xingcui_judge",
anim_type = "control",
mute=true,
events = {fk.AskForRetrial},
can_trigger = function(self, event, target, player, data)
return player:hasSkill(self) and #player.room.draw_pile>0
end,
on_cost = function(self, event, target, player, data)
local card=Fk:getCardById(player.room.draw_pile[#player.room.draw_pile])
self.cost_data=player.room:askForSkillInvoke(player, self.name, nil, "#tyj__xingcui_judge-invoke:::"..card:toLogString())
return self.cost_data
end,
on_use = function(self, event, target, player, data)
player:broadcastSkillInvoke("tyj__xingcui",-1)
local card=Fk:getCardById(player.room.draw_pile[#player.room.draw_pile])
player.room:responseCard{
from = player.id,
card = card
}
player.room:retrial(card, player, data, "tyj__xingcui")
end,
}
tyj__xingcui:addRelatedSkill(tyj__xingcui_trigger)
tyj__xingcui:addRelatedSkill(tyj__xingcui_judge)
tyj__zhugeguo:addSkill(tyj__qirang)
tyj__zhugeguo:addRelatedSkill('taji')
tyj__zhugeguo:addSkill(tyj__xingcui)
Fk:loadTranslationTable{
["tyj__qirang_wake"]="祈禳",
["$tyj__qirang_wake1"]="谁者沉浮飘忽然,忘却凡尘千万事",
["tyj__qirang"]="祈禳",
[":tyj__qirang"]="锁定技,摸牌阶段,你改为进行【闪电】并获得判定牌,直到你因此受到伤害或获得花色相同的牌后。你因此获得九张牌后,将〖祈禳〗改为非锁定技并获得〖踏寂〗。",
["$tyj__qirang1"]="天人相为表里,造化,自在掌中。",
["$tyj__qirang2"]="祈禳上达天思,消恶以降吉祥。",
["$tyj__xingcui1"]="集智观星雨,凌烟飞仙池。",
["$tyj__xingcui2"]="羽化兮飞仙,飘渺兮凡尘。",
["$taji_tyj__zhugeguo1"]="九天羽化仙,随鹤东流去。",
["$taji_tyj__zhugeguo2"]="得羽升仙,化鹤归星。",
['@tyj__qirang_gained']="祈禳",
["#tyj__qirang-invoke"]="是否将摸牌阶段改为雷劫?",
["tyj__xingcui"]="星璀",
[":tyj__xingcui"]="你需要使用非基本牌时,可观看并使用牌堆底的牌。一张判定牌生效时,你可以观看牌堆底的牌,并可打出此牌代替之。",
["#tyj__xingcui"]="星璀:是否观看牌堆底的 %arg 张牌,并使用其中一张?",
["~tyj__zhugeguo"]="浮华落尽清似梦,淡看苍生几轮回。",
["#tyj__xingcui_judge-invoke"]="是否打出牌堆底的 %arg 代替判定牌?",
["#tyj_xingcui_judge"]="星璀",
}
mingShowCards = function (player, card, scope)
local suffix_mapper = {
[Player.HistoryGame] = "",
[Player.HistoryRound] = "-round",
[Player.HistoryTurn] = "-turn",
[Player.HistoryPhase] = "-phase",
}
scope = scope or Player.HistoryGame
local ids = Card:getIdList(card)
ids = table.filter(ids, function (id)
return table.contains(player:getCardIds("h"), id)
end)
if #ids > 0 then
for _, id in ipairs(ids) do
player.room:setCardMark(Fk:getCardById(id), MarkEnum.ShownCards..suffix_mapper[scope], 1)
end
player:showCards(ids)
end
end
local tyj__godzhangliao = General:new(extension, "tyj__godzhangliao", "god", 4,4)
Fk:loadTranslationTable{
["tyj__godzhangliao"] = "神张辽",
["#tyj__godzhangliao"] = "雁门之刑天",
["designer:tyj__godzhangliao"] = "汤圆",
["cv:tyj__godzhangliao"] = "官方",
["illustrator:tyj__godzhangliao"] = "光域",
}
local tyj__duorui =fk.CreateTriggerSkill{
name="tyj__duorui",
events = { fk.Damage },
can_trigger = function(self, event, target, player, data)
return target==player and player:hasSkill(self) and data.to ~= player and not data.to:isNude()
end,
on_cost = function(self, event, target, player, data)
self.cost_data=player.room:askForSkillInvoke(player, self.name, nil, "#tyj__duorui-invoke::"..data.to.id)
return self.cost_data
end,
on_use = function(self, event, target, player, data)
local room = player.room
room:doIndicate(player.id, { data.to.id })
local to = data.to
local cards = room:askForCardsChosen(player, to, 1, 1, "he", self.name)
if(#cards>0) then
room:moveCardTo(cards, Player.Hand,
player, fk.ReasonPrey, self.name)
player:showCards(cards)
local mark={}
if(#data.to:getTableMark("tyj__duorui_cards")~=0) then
mark=data.to:getTableMark("tyj__duorui_cards")
end
local skills={}
for _, skill_name in ipairs(Fk.generals[data.to.general]:getSkillNameList()) do
local skill = Fk.skills[skill_name]
if not (skill.lordSkill) then
if data.to:hasSkill(skill) then
table.insertIfNeed(skills, skill_name)
end
end
end
if data.to.deputyGeneral and data.to.deputyGeneral ~= "" then
for _, skill_name in ipairs(Fk.generals[data.to.deputyGeneral]:getSkillNameList()) do
local skill = Fk.skills[skill_name]
if not (skill.lordSkill) then
if data.to:hasSkill(skill) then
table.insertIfNeed(skills, skill_name)
end
end
end
end
if(#skills>0) then
table.insertIfNeed(skills,"Cancel");
local choice = room:askForChoice(player, skills, self.name, "#tyj__duorui-skill::" .. data.to.id, true)
if choice ~= "Cancel" then
local tos={player.id,choice,cards[1]}
table.insert(mark,tos)
room:setPlayerMark(data.to,"tyj__duorui_cards",mark)
room:setCardMark(Fk:getCardById(cards[1]), "@tyj__duorui_hand",Fk:translate( Fk.skills[choice].name))
end
end
end
end,
refresh_events = {fk.AfterCardsMove},
can_refresh = function(self, event, target, player, data)
if #player:getTableMark("tyj__duorui_cards")>0 then
for _, move in ipairs(data) do
if move.from and #table.filter(player:getTableMark("tyj__duorui_cards"), function(q) return q[1]==move.from end)>0 then
for _, info in ipairs(move.moveInfo) do
if(info.fromArea == Card.PlayerHand) then
for _, tos in ipairs(player:getTableMark("tyj__duorui_cards")) do
if(info.cardId==tos[3]) then return true end
end
end
end
end
end
end
end,
on_refresh = function(self, event, target, player, data)
local room = player.room
local mark=player:getTableMark("tyj__duorui_cards")
local index=0
for _, move in ipairs(data) do
if move.from and #table.filter(player:getTableMark("tyj__duorui_cards"), function(q) return q[1]==move.from end)>0 then
for _, info in ipairs(move.moveInfo) do
if(info.fromArea == Card.PlayerHand) then
for i=1,#player:getTableMark("tyj__duorui_cards") do
if(info.cardId ==player:getTableMark("tyj__duorui_cards")[i][3] and move.from == player:getTableMark("tyj__duorui_cards")[i][1]) then
table.remove(mark,i-index)
index=index+1
room:setCardMark(Fk:getCardById(player:getTableMark("tyj__duorui_cards")[i][3]), "@tyj__duorui_hand",0)
end
end
end
end
end
end
room:setPlayerMark(player,"tyj__duorui_cards",mark)
end,
}
local tyj__duorui_invalidity = fk.CreateInvaliditySkill {
name = "#tyj__duorui_invalidity",
invalidity_func = function(self, from, skill)
return #table.filter(from:getTableMark("tyj__duorui_cards"), function(q) return q[2]==skill.name end)>0
end
}
local tyj__zhiti =fk.CreateTriggerSkill{
name = "tyj__zhiti",
anim_type = "drawcard",
frequency = Skill.Compulsory,
events = {fk.AfterCardsMove},
mute=true,
can_trigger = function(self, event, target, player, data)
if not player:hasSkill(self) then return end
for _, move in ipairs(data) do
if(move.from) then
local from = player.room:getPlayerById(move.from)
if from:isKongcheng() and player:inMyAttackRange(from) and from:isWounded() then
for _, info in ipairs(move.moveInfo) do
if info.fromArea == Card.PlayerHand then
return not table.contains(from:getTableMark("@@tyj__zhiti_debuff"),player.id)
end
end
end
end
end
end,
on_use = function(self, event, target, player, data)
local room=player.room
for _, move in ipairs(data) do
if(move.from) then
local from = player.room:getPlayerById(move.from)
if from and from:isKongcheng() and player:inMyAttackRange(from) and from:isWounded() then
for _, info in ipairs(move.moveInfo) do
if info.fromArea == Card.PlayerHand and not table.contains(from:getTableMark("@@tyj__zhiti_debuff"),player.id) then
local result = room:askForSkillInvoke(player, self.name, nil, "#tyj__zhiti-invoke::"..move.from)
if result == true then
room:doIndicate(player.id, { move.from })
room:notifySkillInvoked(player, "tyj__zhiti")
player:broadcastSkillInvoke("tyj__zhiti",-1)
local mark=from:getTableMark("@@tyj__zhiti_debuff")
table.insertIfNeed(mark,player.id)
room:setPlayerMark(from,"@@tyj__zhiti_debuff",mark)
--room:drawCards(player,1,self.name)
end
break
end
end
end
end
end
end,
refresh_events = {fk.PreCardUse,fk.Damage},
can_refresh = function(self, event, target, player, data)
if event == fk.PreCardUse then return true
else return #player:getTableMark("@@tyj__zhiti_debuff")>0 and target == player and data.to and table.contains(player:getTableMark("@@tyj__zhiti_debuff"),data.to.id)
end
end,
on_refresh = function(self, event, target, player, data)
if event == fk.PreCardUse then
data.unoffsetableList = data.unoffsetableList or {}
for _, p in ipairs(player.room.alive_players) do
if #p:getTableMark("@@tyj__zhiti_debuff") > 0 and table.contains(p:getTableMark("@@tyj__zhiti_debuff"),player.id) then
table.insert(data.unoffsetableList, p.id)
end
end
else
if #player:getTableMark("@@tyj__zhiti_debuff")==0 then return false end
local mark={}
for i=1,#player:getTableMark("@@tyj__zhiti_debuff") do
if(player:getTableMark("@@tyj__zhiti_debuff")[i]~=data.to.id and player:getTableMark("@@tyj__zhiti_debuff")[i]~=nil) then
table.insert(mark,player:getTableMark("@@tyj__zhiti_debuff")[i])
end
end
if #mark==0 then
player.room:setPlayerMark(player,"@@tyj__zhiti_debuff",0)
else player.room:setPlayerMark(player,"@@tyj__zhiti_debuff",mark) end
end
end,
}
local tyj__zhiti_maxcards = fk.CreateMaxCardsSkill{
name = "#tyj__zhiti_maxcards",
correct_func = function(self, player)
local num=0
if player:isWounded() then
num=num-#table.filter(Fk:currentRoom().alive_players, function(p)
return p:hasSkill("tyj__zhiti") and p:inMyAttackRange(player) end
)
end
if player:hasSkill("tyj__zhiti") then
num=num+#table.filter(Fk:currentRoom().alive_players,function(p) return p:isWounded() and player:inMyAttackRange(p) end)
end
return num
end,
}
local tyj__duoruiShownCards = fk.CreateVisibilitySkill{
name = "#tyj__duorui_ShownCards",
card_visible = function(self, player, card)
if card:getMark("@tyj__duorui_hand") ~= 0 then
return true
end
end
}
tyj__duorui:addRelatedSkill(tyj__duorui_invalidity)
tyj__duorui:addRelatedSkill(tyj__duoruiShownCards)
tyj__zhiti:addRelatedSkill(tyj__zhiti_maxcards)
tyj__godzhangliao:addSkill(tyj__duorui)
tyj__godzhangliao:addSkill(tyj__zhiti)
Fk:loadTranslationTable{
["debug"]="执行",
["tyj__duorui"]="夺锐",
[":tyj__duorui"]="你对其他角色造成伤害后,可以获得其的一张牌并明置,然后你可以声明其武将牌上的一个技能,此技能失效直到此牌离开你的手牌。",
["tyj__duorui_cards"]="被夺锐",
["#tyj__duorui_dislog"] = " %to 的技能 %arg 失效了",
["#tyj__duorui_reclog"] = "%to 的技能 %arg 恢复了",
["tyj__zhiti"]="止啼",
[":tyj__zhiti"]="锁定技,你视为偷取了你的攻击范围内已受伤的角色的各1点手牌上限。他们之一失去所有手牌后,你可令其无法抵消牌直到对你造成伤害。",
["#tyj__duorui-skill"]="夺锐:是否令 %dest 武将牌上的一个技能失效?",
["#tyj__duorui-invoke"]="是否对 %dest 发动 夺锐 获得其一张牌?",
["@tyj__duorui_hand"]="夺锐",
["#tyj__zhiti-invoke"]="止啼:是否令 %dest 无法抵消牌直到对你造成伤害后。",
["@@tyj__zhiti_debuff"]="被止啼",
["$tyj__duorui1"]="天下雄兵之锐,吾一人可尽夺之!",
["$tyj__duorui2"]="我有八百壮士,可斩将,易旗,夺锐!",
["$tyj__zhiti1"]="闻吾之名讳,江东小儿无不惧而止啼。",
["$tyj__zhiti2"]="吾名如良药,可医吴儿夜啼。",
["~tyj__godzhangliao"]="辽来,辽来!辽去...辽,去。"
}
local tyj__fu_huchuquan = General:new(extension, "tyj__fu_huchuquan", "qun", 4,4)
Fk:loadTranslationTable{
["tyj__fu_huchuquan"] = "复呼厨泉",
["#tyj__fu_huchuquan"] = "从势复叛",
["designer:tyj__fu_huchuquan"] = "瑜瑾&汤圆",
["cv:tyj__fu_huchuquan"] = "官方",
["illustrator:tyj__fu_huchuquan"] = "光域",
}
---@param player ServerPlayer @ 操作蓄谋的玩家
---@param card integer | Card @ 用来蓄谋的牌
---@param skill_name? string @ 技能名
---@param proposer? integer @ 移动操作者的id
---@return nil
local mypremeditate = function(player, card, skill_name, proposer)
skill_name = skill_name or ""
proposer = proposer or player.id
local room = player.room
if type(card) == "table" then
assert(not card:isVirtual() or #card.subcards == 1)
card = card:getEffectiveId()
end
local xumou = Fk:cloneCard("premeditate")
xumou:addSubcard(card)
player:addVirtualEquip(xumou)
room:moveCardTo(xumou, Player.Judge, player, fk.ReasonJustMove, skill_name, "", false, proposer, "", {proposer, player.id})
end
local tyj__fuqin = fk.CreateTriggerSkill{
name="tyj__fuqin",
events={fk.AfterCardsMove},
can_trigger = function (self, event, target, player, data)
if player:hasSkill(self) then
local e = player.room.logic:getCurrentEvent():findParent(GameEvent.SkillEffect)
if e and e.data[3] == self then --FIXME:防止嵌套
return false
end
for _, move in ipairs(data) do
if move.to == player.id and move.toArea == Player.Hand and move.skillName ~= self.name then
local justarea={}
local fromarea={}
for _, info in ipairs(move.moveInfo) do
if move.from then
if #table.filter(fromarea,function(n) return n[1]==move.from and n[2]==info.fromArea end)==0 then
local target = player.room:getPlayerById(move.from)
if info.fromArea and info.fromArea == Player.Judge then
if #target:getCardIds("j") > 0 then
table.insert(fromarea,{move.from,info.fromArea})
self.cost_data={info.fromArea,move.from}
self:doCost(event, target, player, data)
end
elseif info.fromArea and info.fromArea == Player.Equip then
if #target:getCardIds("e") > 0 then
table.insert(fromarea,{move.from,info.fromArea})
self.cost_data={info.fromArea,move.from}
self:doCost(event, target, player, data)
end
elseif info.fromArea and info.fromArea == Player.Hand then
if #target:getCardIds("h") > 0 then
table.insert(fromarea,{move.from,info.fromArea})
self.cost_data={info.fromArea,move.from}
self:doCost(event, target, player, data)
end
elseif info.fromArea and info.fromArea == Card.PlayerSpecial then
for _, s in pairs(player.special_cards) do
local cards = table.simpleClone(s or {})
if cards and #cards>0 then
table.insert(fromarea,{move.from,info.fromArea})
self.cost_data={info.fromArea,move.from}
self:doCost(event, target, player, data)
break
end
end
end
end
else
if not table.contains(justarea,info.fromArea) then
if info.fromArea and info.fromArea == Card.Processing then
if #player.room.processing_area>0 then
table.insert(justarea,info.fromArea)
self.cost_data={info.fromArea}
self:doCost(event, target, player, data)
end
elseif info.fromArea and info.fromArea == Card.DiscardPile then
if #player.room.discard_pile>0 then
table.insert(justarea,info.fromArea)
self.cost_data={info.fromArea}
self:doCost(event, target, player, data)
end
elseif info.fromArea and info.fromArea == Card.DrawPile then
if #player.room.draw_pile>0 then
table.insert(justarea,info.fromArea)
self.cost_data={info.fromArea}
self:doCost(event, target, player, data)
end
elseif Card.Void then
if #player.room.void>0 then
table.insert(justarea,info.fromArea)
self.cost_data={info.fromArea}
self:doCost(event, target, player, data)
end
end
end
end
end
end
end
end
end,
on_cost = function (self, event, target, player, data)
local bool = false
local thisfromarea = ""
local random = false
local toname = ""
if self.cost_data[1]== Card.DrawPile then
thisfromarea = "牌堆"
random = true
elseif self.cost_data[1]== Card.DiscardPile then
thisfromarea = "弃牌堆"
random = true
elseif self.cost_data[1]== Card.Processing then
thisfromarea = "处理区"
elseif self.cost_data[1]== Card.PlayerSpecial then
thisfromarea = "武将牌上"
local to = player.room:getPlayerById(self.cost_data[2])
if to.deputyGeneral ~= "" then
toname = Fk:translate(to.general).."/"..Fk:translate(to.deputyGeneral)
else
toname = Fk:translate(to.general)
end
elseif self.cost_data[1]== Player.Hand then
thisfromarea = "手牌区"
local to = player.room:getPlayerById(self.cost_data[2])
if to.deputyGeneral ~= "" then
toname = Fk:translate(to.general).."/"..Fk:translate(to.deputyGeneral)
else
toname = Fk:translate(to.general)
end
elseif self.cost_data[1]== Player.Equip then
thisfromarea = "装备区"
local to = player.room:getPlayerById(self.cost_data[2])
if to.deputyGeneral ~= "" then
toname = Fk:translate(to.general).."/"..Fk:translate(to.deputyGeneral)
else
toname = Fk:translate(to.general)
end
elseif self.cost_data[1]== Player.Judge then
thisfromarea = "判定区"
local to = player.room:getPlayerById(self.cost_data[2])
if to.deputyGeneral ~= "" then
toname = Fk:translate(to.general).."/"..Fk:translate(to.deputyGeneral)
else
toname = Fk:translate(to.general)
end
elseif self.cost_data[1]== Card.Void then
thisfromarea = "虚空"
end
if self.cost_data and #self.cost_data>1 then
bool = player.room:askForSkillInvoke(player, self.name, nil, "是否发动 复侵 从 "..toname.." 的 "..thisfromarea.." 中选择一张牌获得?")
else
if random == false then
bool = player.room:askForSkillInvoke(player, self.name, nil, "是否发动 复侵 从 "..thisfromarea.." 中选择一张牌获得?")
else
bool = player.room:askForSkillInvoke(player, self.name, nil, "是否发动 复侵 从 "..thisfromarea.." 中随机获得一张牌?")
end
end
if bool then
return self.cost_data
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
local mark = player:getTableMark("tyj__fulue_cards-turn")
local thisareaname = ''
local toname = ""
if self.cost_data then
if self.cost_data[1] == Card.DiscardPile or self.cost_data[1] == Card.DrawPile then
if self.cost_data[1] == Card.DiscardPile then
local cards = room.discard_pile--[[table.filter(room.discard_pile, function (id)
return not table.contains(mark,id)
end)--]]
local card = table.random(cards,1)
if #card>0 then
player:showCards(card)
if not table.contains(mark,card[1]) then
room:moveCardTo(card[1], Card.PlayerHand, player, fk.ReasonPrey, self.name, nil, false, player.id)
else
mypremeditate(player,card[1],self.name,player.id)
end
end
else
local cards = room.draw_pile--[[table.filter(room.draw_pile, function (id)
return not table.contains(mark,id)
end)--]]
local card = table.random(cards,1)
if #card>0 then
player:showCards(card)
if not table.contains(mark,card[1]) then
room:moveCardTo(card[1], Card.PlayerHand, player, fk.ReasonPrey, self.name, nil, false, player.id)
else
mypremeditate(player,card[1],self.name,player.id)
end
end
end
elseif table.contains({Player.Judge,Player.Equip,Player.Hand},self.cost_data[1]) then
if room:getPlayerById(self.cost_data[2]) and not room:getPlayerById(self.cost_data[2]).dead then
local to = room:getPlayerById(self.cost_data[2])
if to.deputyGeneral ~= "" then
toname = Fk:translate(to.general).."/"..Fk:translate(to.deputyGeneral)
else
toname = Fk:translate(to.general)
end
local area=""
if self.cost_data[1] == Player.Judge then
area="j"
thisareaname="判定区"
elseif self.cost_data[1] == Player.Equip then
area="e"
thisareaname="装备区"
else
area="h"
thisareaname="手牌区"
end
if #to:getCardIds(area)> 0 then
room:doIndicate(player.id,{self.cost_data[2]})
local card = room:askForCardChosen(player,to, area, self.name,"复侵:从 "..toname.." 的 "..thisareaname.." 选择一张牌获得")
player:showCards(card)
if not table.contains(mark,card) then
room:obtainCard(player.id, card, false, fk.ReasonPrey,player.id,self.name)
else
mypremeditate(player,card,self.name,player.id)
end
end
end
else
local cardstopick={}
if self.cost_data[1] == Card.Processing then
thisareaname = "处理区"
cardstopick = room.processing_area--[[table.filter(room.processing_area, function (id)
return not table.contains(mark,id)
end)--]]
elseif self.cost_data[1] == Card.Void then
thisareaname = "虚空"
cardstopick = room.void
else
local to = room:getPlayerById(self.cost_data[2])
if to.deputyGeneral ~= "" then
toname = to.general.."/"..to.deputyGeneral
else
toname = to.general
end
thisareaname = toname.." 的 武将牌上"
for _, s in pairs(to.special_cards) do
local cards = table.simpleClone(s or {})
if cards and #cards>0 then
for _, c in ipairs(cards) do
table.insertIfNeed(cardstopick,c)
end
end
end
end
if #cardstopick > 0 then
room:doIndicate(player.id,{self.cost_data[2]})
local card = U.askforChooseCardsAndChoice(player,cardstopick, {"OK"}, "tyj__fuqin", "复侵:从 "..thisareaname.." 中选择一张牌获得", nil, 1, 1)
player:showCards(card)
if not table.contains(mark,card[1]) then
room:moveCardTo(Fk:getCardById(card[1]), Card.PlayerHand, player, fk.ReasonPrey, "tyj__fuqin", nil, true, player.id)
else
mypremeditate(player,card[1],self.name,player.id)
end
end
end
end
end,
refresh_events={fk.AfterCardsMove},
can_refresh = function(self, event, target, player, data)
for _, move in ipairs(data) do
if move.to == player.id and move.toArea == Player.Hand and move.skillName == self.name then
return #move.moveInfo>0
end
end
end,
on_refresh = function(self, event, target, player, data)
local room = player.room
local mark = player:getTableMark("tyj__fulue_cards-turn")
for _, move in ipairs(data) do
if move.to == player.id and move.toArea == Player.Hand --[[and move.skillName == self.name--]] then
for _, cards in ipairs(move.moveInfo) do
table.insertIfNeed(mark,cards.cardId)
end
end
end
room:setPlayerMark(player,"tyj__fulue_cards-turn",mark)
end,
}
tyj__fu_huchuquan:addSkill(tyj__fuqin)
--tyj__fu_huchuquan:addSkill("mm_pianchong&")
Fk:loadTranslationTable{
["tyj__fuqin"]="复侵",
[":tyj__fuqin"]="你不因此从某处获得一张牌后,你可以再从此处获得一张牌并展示,若你本回合获得过此牌,改为蓄谋之。",
["$tyj__fuqin1"]="胜者为王,吾等……无话可说……",
["$tyj__fuqin2"]="今乱平阳之地,汉人如何可防?",
["$tyj__fuqin3"]="此为吾等,复兴匈奴之良机!",
["~tyj__fu_huchuquan"]="久困汉庭,无力再叛……",
["#tyj__fuqin_took-take"]="再从 %dest 拿一张牌",
["#tyj__fuqin_took-invoke"]="是否发动 复侵 再从 %dest 处拿一张牌",
}
--[[local tyj__godjiaxu = General:new(extension, "tyj__godjiaxu", "god", 3,3)
Fk:loadTranslationTable{
["tyj__godjiaxu"] = "神贾诩",
["#tyj__godjiaxu"] = "倒悬云衢",
["designer:tyj__godjiaxu"] = "玄蝶",
["cv:tyj__godjiaxu"] = "酉良",
["illustrator:tyj__godjiaxu"] = "鬼画府",
}
local tyj__jiandai = fk.CreateTriggerSkill{
name = "tyj__jiandai",
events = {fk.BeforeTurnOver, fk.GameStart},
frequency = Skill.Compulsory,
can_trigger = function(self, event, target, player, data)
if not player:hasSkill(self) then return false end
if event == fk.BeforeTurnOver then
return target == player and not player.faceup
else
return true
end
end,
on_use = function(self, event, target, player, data)
if event == fk.GameStart then
player:turnOver()
else
return true
end
end,
}
local tyj__fangcan_viewas = fk.CreateViewAsSkill {
name = "tyj__fangcan_viewas",
interaction = function()
local name = Self:getMark("tyj__fangcan-turn")
local names = {}
table.insert(names, name)
if #names == 0 then return end
return UI.ComboBox { choices = names }
end,
card_filter = Util.FalseFunc,
view_as = function(self, cards)
if not self.interaction.data then return end
local card = Fk:cloneCard(self.interaction.data)
card.skillName = "tyj__fangcan"
return card
end,
}
Fk:addSkill(tyj__fangcan_viewas)
local tyj__fangcan = fk.CreateTriggerSkill{
name = "tyj__fangcan",
events={fk.TurnEnd},
anim_type="offensive",
frequency = Skill.Compulsory,
can_trigger = function (self, event, target, player, data)
if not player:hasSkill(self) then return false end
local numt = 0
local numd = 0
local events = 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):isCommonTrick()) then
numt=numt+1
end
if(Fk:getCardById(info.cardId,true).is_damage_card) then
numd=numd+1
end
end
end
end
end
end, Player.HistoryTurn)
return numt==1 or numd == 1
end,
on_use= function (self, event, target, player, data)
local room = player.room
local cardd=nil
local cardt=nil
local events = 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):isCommonTrick()) then
cardd=info.cardId
end
if(Fk:getCardById(info.cardId,true).is_damage_card and cardd~=info.cardId) then
cardt=info.cardId
end
end
end
end
end
end, Player.HistoryTurn)
local cards ={}
if cardd~=nil then
table.insert(cards,cardd)
end
if cardt~=nil then
table.insert(cards,cardt)
end
if #cards>0 then
local card,choice = U.askforChooseCardsAndChoice(player,cards, {"获得","使用"}, self.name, "#tyj__fangcan-invoke", nil, 1, 1, cards)
if choice == "获得" then
room:moveCards({
ids = card,
to = player.id,
toArea = Card.PlayerHand,
moveReason = fk.ReasonPrey,
proposer = player.id,
skillName = self.name,
})
else
room:setPlayerMark(player, "tyj__fangcan-turn", Fk:getCardById(card[1]).name)
local success, dat = room:askForUseActiveSkill(player, "tyj__fangcan_viewas", "tyj__fangcan", false)
if success then
local card = Fk.skills["tyj__fangcan_viewas"]:viewAs(dat.cards)
card.skillName = self.name
room:useCard {
from = player.id,
tos = table.map(dat.targets, function(id) return { id } end),
card = card,
extraUse = true,
}
end
end
end
end
}
local tyj__wuqibingfa_viewas = fk.CreateViewAsSkill{
name = "#tyj__wuqibingfa_viewas",
card_num = 1,
card_filter = function(self, to_select, selected)
return #selected == 0
end,
view_as = function(self, cards)
if #cards ~= 1 then return end
local card = Fk:cloneCard("slash")
card:addSubcard(cards[1])
card.skillName = "tyj__wuqibingfa"
return card
end,
}
Fk:addSkill(tyj__wuqibingfa_viewas)
local tyj__wuqibingfa_skill = fk.CreateTriggerSkill{
name = "#tyj__wuqibingfa_skill",
attached_equip = "tyj__wuqibingfa",
mute=true,
frequency = Skill.Compulsory,
events = {fk.TurnEnd},
can_trigger = function(self, _, target, player, data)
return target == player and #table.filter(player.room.alive_players,function(p) return p:getMark("@tyj__wuqibingfa-turn")>0 and not p.isNude() end)>0
end,
on_use = function (self, event, target, player, data)
local tos = table.filter(player.room.alive_players,function(p) return p:getMark("@tyj__wuqibingfa")>0 and not p.isNude() end)
if #tos > 0 then
for _, p in ipairs(tos) do
local success, dat = player.room:askForUseActiveSkill(player, "tyj__wuqibingfa_viewas", "吴起兵法", false)
local card = Fk:cloneCard("amazing_grace")
card:addSubcards(dat.cards)
card.skillName = self.name
player.room:useCard{
from = p.id,
tos = table.map(dat.targets, function(id) return {id} end),
card = card,
}
end
end
end
}
Fk:addSkill(tyj__wuqibingfa_skill)
local tyj__wuqibingfa = fk.CreateArmor{
name = "tyj__wuqibingfa",
suit = Card.Spade,
number = 1,
equip_skill = tyj__wuqibingfa_skill,
on_uninstall = function(self, room, player)
Armor.onUninstall(self, room, player)
if player:isAlive() and self.equip_skill:isEffectable(player) and #getTrueSkills(player)>0 then
room:askForChoosePlayers(player, room.alive_players,0, #getTrueSkills(player),"吴起兵法:选择任意名角色,他们在回合结束时将一张牌当【杀】用", self.name, true)
end
end,
}
local tyj__juehun = fk.CreateTriggerSkill{
events = {fk.MaxHpChanged,fk.HpChanged,fk.AfterDying},
frequency = Skill.Compulsory,
name="tyj__juehun",
can_trigger = function (self, event, target, player, data)
if not player:hasSkill(self) then return false end
if event == fk.MaxHpChanged then
return not player:isWounded() and data.extra_data and data.extra_data.tyj_juehun_wounded and data.extra_data.tyj_juehun_wounded==player.id
elseif event == fk.HpChanged then
return data.num and data.num > 0 and not player:isWounded()
else
return target:isAlive()
end
end,
on_use = function (self, event, target, player, data)
local id = U.prepareDeriveCards(player.room, tyj__wuqibingfa, "tyj__wuqibingfa")[1]
if player:usedSkillTimes(self.name,Player.HistoryGame)%2 == 0 then
local skills = Fk.generals[player.general]:getSkillNameList(true)
if player.deputyGeneral ~= "" then
table.insertTableIfNeed(skills, Fk.generals[player.deputyGeneral]:getSkillNameList(true))
end
skills = table.filter(skills, function(s) return player:hasSkill(s, true) end)
if #skills > 0 then
skills = table.slice(skills, 1, 2)
player.room:handleAddLoseSkills(player, "-"..table.concat(skills, "|-"), nil, true, false)
end
end
end,
refresh_events = {fk.BeforeMaxHpChanged},
can_refresh = function (self, event, target, player, data)
return target == player and player:isWounded();
end,
on_refresh = function (self, event, target, player, data)
data.extra_data = data.extra_data or {}
data.extra_data.tyj_juehun_wounded = player.id
end,
}
extension:addCard(tyj__wuqibingfa)
tyj__godjiaxu:addSkill(tyj__jiandai)
tyj__godjiaxu:addSkill(tyj__fangcan)
Fk:loadTranslationTable{
["tyj__jiandai"]="缄殆",
[":tyj__jiandai"]="锁定技,你始终处于翻面状态。",
["tyj__fangcan"]="纺残",
[":tyj__fangcan"]="锁定技,每回合结束时,你获得或视为使用本回合弃牌堆中唯一的普通锦囊牌或唯一的伤害牌。",
["tyj__juehun"]="绝殙",
[":tyj__juehun"]="锁定技,当有角色脱离受伤或濒死状态时,你装备【吴起兵法】,若为第偶数次发动,你失去武将牌上的首个技能。",
["tyj__luoshu"]="络殊",
[":tyj__luoshu"]="锁定技,准备阶段,你从随机三个限定技中获得一个。",
["tyj__fenfou"]="纷殕",
[":tyj__fenfou"]="限定技,一轮游戏开始时,你可以令所有角色同时选择两项:翻面;摸两张牌;本轮获得【鸩毒】。",
["#tyj__fangcan-invoke"]="获得或视为使用其中一张牌",
}]]--
--local tyj__zhangjiao = General:new(extension, "tyj__zhangjiao", "qun", 4,4)
Fk:loadTranslationTable{
["tyj__zhangjiao"] = "张角",
["#tyj__zhangjiaon"] = "符济万民",
["designer:tyj__zhangjiao"] = "汤圆",
["cv:tyj__zhangjiao"] = "官方",
["illustrator:tyj__zhangjiao"] = "光域",
}
Fk:loadTranslationTable{
["tyj__fuji"]="符济",
[":tyj__fuji"]="锁定技,一张判定牌进入弃牌堆后,将与你武将牌上的牌花色皆不同,你将之置于武将牌上;若有则你摸一张牌且本回合获得〖鬼道〗。你可以将武将牌上一张本回合未进入过弃牌堆的花色的一张牌当作【桃】或【无中生有】使用。",
["tyj__jianfu"]="詃覆",
[":tyj__jianfu"]="游戏开始时,一号位使用牌堆中的一张【闪电】。有角色脱离濒死后,你可以令使其进入濒死的角色进行【闪电】判定。",
}
local tyj__caochun = General:new(extension, "tyj__caochun", "wei", 4,4)
Fk:loadTranslationTable{
["tyj__caochun"] = "曹纯",
["#tyj__caochun"] = "虎豹肖瑞",
["designer:tyj__caochun"] = "汤圆",
["cv:tyj__caochun"] = "官方",
["illustrator:tyj__caochun"] = "凡果_Make",
}
local tyj__shanjia_viewas = fk.CreateViewAsSkill{
name = "tyj__shanjia_viewas",
pattern = "slash",
card_filter = Util.FalseFunc,
view_as = function(self, cards)
local card = Fk:cloneCard("slash")
card.skillName = "tyj__shanjia_viewas"
return card
end,
}
Fk:addSkill(tyj__shanjia_viewas)
local tyj__shanjia = fk.CreateTriggerSkill{
name = "tyj__shanjia",
anim_type = "offensive",
events = {fk.EventPhaseStart},
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and player.phase == Player.Play
end,
on_use = function(self, event, target, player, data)
local room = player.room
local num=#player:getAvailableEquipSlots()-#player:getCardIds(Player.Equip)
local drawed = player:drawCards(num, self.name)
if #table.filter(drawed,function(c) return Fk:getCardById(c).type==Card.TypeEquip end) == 0 then
room:handleAddLoseSkills(player, "huqi", nil, true, false)
end
local cards = {}
if player:getMark(self.name) < num then
local x = num - player:getMark(self.name)
if #player:getCardIds{Player.Hand, Player.Equip} < x then
cards = table.simpleClone(player:getCardIds{Player.Hand, Player.Equip})
local cardIds = {}
table.insertTable(cardIds, player.player_cards[Player.Hand])
table.insertTable(cardIds, player.player_cards[Player.Equip])
room:throwCard(cardIds,self.name, player,player)
else
cards = room:askForDiscard(player, x, x, true, self.name, false, ".", "#tyj__shanjia-discard:::"..x)
end
end
if player:getMark("tyj__shanjia_recover-phase") ==0 then
room:recover{
who = player,
num = 1,
recoverBy = player,
skillName = self.name
}
end
if player:getMark("tyj__shanjia_minus-phase") ==0 then
room:addPlayerMark(player,self.name, 1)
end
if player:getMark("tyj__shanjia_sha-phase")==0 then
local targets = table.map(table.filter(room:getOtherPlayers(player), function(p)
return not player:isProhibited(p, Fk:cloneCard("slash")) end), Util.IdMapper)
if #targets == 0 then return end
local success, dat = room:askForUseActiveSkill(player, "tyj__shanjia_viewas", "#tyj__shanjia-choose", true)
if success then
local card = Fk:cloneCard("slash")
card.skillName = self.name
room:useCard{
from = player.id,
tos = table.map(dat.targets, function(id) return {id} end),
card = card,
extraUse = true,
}
end
end
room:setPlayerMark(player,"tyj__shanjia_minus-phase",0)
room:setPlayerMark(player,"tyj__shanjia_recover-phase",0)
room:setPlayerMark(player,"tyj__shanjia_sha-phase",0)
end,
refresh_events={fk.AfterCardsMove},
can_refresh = function (self, event, target, player, data)
for _, move in ipairs(data) do
if move.from == player.id and move.moveReason == fk.ReasonDiscard and move.skillName == "tyj__shanjia" then
return #move.moveInfo>0
end
end
end,
on_refresh= function (self, event, target, player, data)
local room = player.room
local nobasic =true
local nohand = true
local onlyequip =true
for _, move in ipairs(data) do
if move.from == player.id and move.moveReason == fk.ReasonDiscard and move.skillName == "tyj__shanjia" then
for _, info in ipairs(move.moveInfo) do
if info.fromArea == Card.PlayerHand or info.fromArea == Card.PlayerEquip then
if info.fromArea == Card.PlayerHand then
nohand=false
end
if Fk:getCardById(info.cardId).type == Card.TypeBasic then
nobasic=false
end
if Fk:getCardById(info.cardId).type == Card.TypeBasic or Fk:getCardById(info.cardId).type == Card.TypeTrick then
onlyequip=false
end
end
end
end
end
if onlyequip== false then
room:setPlayerMark(player,"tyj__shanjia_minus-phase",1)
else
room:setPlayerMark(player,"tyj__shanjia_minus-phase",0)
end
if nobasic == false then
room:setPlayerMark(player,"tyj__shanjia_recover-phase",1)
else
room:setPlayerMark(player,"tyj__shanjia_recover-phase",0)
end
if nohand == false then
room:setPlayerMark(player,"tyj__shanjia_sha-phase",1)
else
room:setPlayerMark(player,"tyj__shanjia_sha-phase",0)
end
end
}
tyj__caochun:addSkill(tyj__shanjia)
tyj__caochun:addRelatedSkill("huqi")
Fk:loadTranslationTable{
["tyj__shanjia"]="缮甲",
[":tyj__shanjia"]="出牌阶段开始时,你可以摸X张牌并弃置X张牌,若你未摸到装备牌,你获得〖虎骑〗。若你未弃置:基本牌,你回复1点体力;非装备牌,〖缮甲〗弃牌数-1;手牌,你视为使用一张【杀】(X为你空置的装备栏数)。",
["#tyj__shanjia-discard"] = "缮甲:你需弃置%arg张牌",
["#tyj__shanjia-choose"] = "缮甲:你可以视为使用【杀】",
["tyj__shanjia_viewas"] = "缮甲",
["@tyj__shanjia"] = "缮甲",
["$tyj__shanjia1"]="兵皆精锐,选八尺之躯,砺数九之寒,成万胜之军!",
["$huqi_tyj__caochun1"]="激水漂石,鸷鸟毁折,势如彍弩,勇而不乱。",
["$tyj__shanjia2"]="士皆骁勇,衣三属之甲,操五石之弓,破百倍之敌!",
["$huqi_tyj__caochun2"]="破军罢马,丢盔失甲,疲兵残阵,何以御我?",
["~tyj__caochun"]="将军死马背,罹魂犹战野!",
}
local tyj__liewei = fk.CreateTriggerSkill{
name = "tyj__liewei",
events = {fk.EnterDying},
frequency = Skill.Compulsory,
can_trigger = function (self, event, target, player, data)
return player:hasSkill(self) and player:getMaxCards() > player:usedSkillTimes(self.name, Player.HistoryTurn)
end,
on_use = function (self, event, target, player, data)
player.room:drawCards(player,1,self.name)
end,
}
local tyj__liewei_delay = fk.CreateTriggerSkill{
name = "#tyj__liewei_delay",
anim_type = "drawcard",
events = {fk.Death},
frequency = Skill.Compulsory,
mute = true,
can_trigger = function(self, event, target, player, data)
return player:hasSkill("tyj__liewei") and data.damage and data.damage.from and data.damage.from == player
end,
on_use = function(self, event, target, player, data)
local room = player.room
room:notifySkillInvoked(player,"tyj__liewei")
player:broadcastSkillInvoke("tyj__liewei")
if not player:hasSkill("tyj__cuorui",true,true) then
local choice = room:askForChoice(player, {"#tyj__liewei_draw-choice:::"..data.name, "#tyj__liewei_gain-choice"},"tyj__liewei")
if choice == "#tyj__liewei_gain-choice" then
room:handleAddLoseSkills(player,"tyj__cuorui",nil, true, false)
else
room:drawCards(player,player:usedSkillTimes("tyj__liewei", Player.HistoryTurn),"tyj__liewei")
end
else
room:drawCards(player,player:usedSkillTimes("tyj__liewei", Player.HistoryTurn),"tyj__liewei")
end
end,
}
Fk:loadTranslationTable{
["tyj__liewei"]="裂围",
[":tyj__liewei"]="锁定技,①每回合限X次,有角色进入濒死时,你摸一张牌(X为你的手牌上限)②你杀死一名角色后,你获得〖挫锐〗或摸本回合你发动〖裂围〗①的次数张牌。",
["#tyj__liewei_draw-choice"]="摸%arg张牌",
["#tyj__liewei_gain-choice"]="获得〖挫锐〗",
["tyj__cuorui"]="挫锐",
[":tyj__cuorui"]="你装备区内每有一张牌,你的手牌上限便+1。出牌阶段,你可以失去此技能,然后你可以将一张装备区内的牌当作【杀】使用并重复。",
}
--local tyj__tongyuan = General:new(extension, "tyj__tongyuan", "qun", 4,4)
Fk:loadTranslationTable{
["tyj__tongyuan"] = "童渊",
["#tyj__tongyuan"] = "蓬莱枪神散人",
["designer:tyj__tongyuan"] = "汤圆",
["cv:tyj__tongyuan"] = "官方",
["illustrator:tyj__tongyuan"] = "黯荧岛工作室",
}
local tyj__chaofeng = fk.CreateTriggerSkill{
name= "tyj__chaofeng",
frequency = Skill.Compulsory,
events={fk.CardUsing},
can_trigger = function (self, event, target, player, data)
if target == player and player:hasSkill(self) then
return (data.card.trueName == 'slash' ) or (data.card.type == Card.TypeBasic and player:getMark("@tyj__chuanshu_bool")~=0)
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
local mark = player:getTableMark("tyj__chaofeng_skills")
if mark[data.card.trueName] == nil then
local skillspool = {}
local eventsx={fk.PreCardUse,
fk.AfterCardUseDeclared,
fk.AfterCardTargetDeclared,
fk.CardUsing,
fk.BeforeCardUseEffect,
fk.TargetSpecifying,
fk.TargetConfirming,
fk.TargetSpecified,
fk.TargetConfirmed,
fk.CardUseFinished}
for _, general in pairs(Fk:getAllGenerals()) do
for _, skn in ipairs(getSkillNameListall(general)) do
local sk=Fk.skills[skn]
if not sk.lordSkill and #sk.attachedKingdom == 0 then
if Fk:translate(":"..skn) and string.find(Fk:translate(":"..skn),"【"..Fk:translate(data.card.trueName, "zh_CN").."】") then
--table.insertIfNeed(skillspool,skn)
if (sk:isInstanceOf(TriggerSkill) and #table.filter(eventsx,function(e) return table.contains(sk.events,e) end)>0)or(sk:isInstanceOf(ActiveSkill) and sk.view_as) then
table.insertIfNeed(skillspool,skn)
end
--[[elseif table.find(sk.related_skills, function (s)
return (s:isInstanceOf(TriggerSkill) and #table.filter(eventsx,function(e) return table.contains(s.events,e) end)>0)or(s:isInstanceOf(ActiveSkill) and s.view_as)
end) then
table.insertIfNeed(skillspool,skn)
end--]]
end
end
end
end
if #skillspool >0 then
mark[data.card.trueName]=skillspool
else
mark[data.card.trueName]={"没有"}
end
room:setPlayerMark(player,"tyj__chaofeng_skills",mark)
mark = player:getTableMark("tyj__chaofeng_skills")
end
if mark[data.card.trueName][1]~="没有" then
local truepool = table.filter(mark[data.card.trueName],function(sk) return not player:hasSkill(sk,true,true) end)
if #truepool >0 then
local gained = table.random(truepool,1)[1]
if not player:hasSkill(gained,true,true) then
room:handleAddLoseSkills(player, gained,nil, true, false)
local mark = player:getTableMark("tyj__chaofeng_clear")
if #mark > 0 then
for i=0, #mark do
if mark[1]==data.card.trueName then
table.insert(mark[2],gained)
elseif i == #mark then
table.insert(mark,{data.card.trueName,{gained}})
end
end
else
table.insert(mark,{data.card.trueName,{gained}})
end
room:setPlayerMark(player,"tyj__chaofeng_clear",mark)
end
end
end
end,
refresh_events = {fk.CardUseFinished},
can_refresh = function (self, event, target, player, data)
if target == player then
return #player:getTableMark("tyj__chaofeng_clear")>0 and #table.filter(player:getTableMark("tyj__chaofeng_clear"),function(l) return l[1]~=data.card.trueName and #l[2]>0 end)>0
end
end,
on_refresh = function (self, event, target, player, data)
local room = player.room
local mark = player:getTableMark("tyj__chaofeng_clear")
for i=#mark, 1,-1 do
if mark[i][1] ~= data.card.trueName then
room:handleAddLoseSkills(player, table.concat(
table.map(mark[i][2], function(str)
return "-" .. str
end), "|")) -- 清除mark里存的技能
table.remove(mark,i)
end
end
if #mark >0 then
room:setPlayerMark(player,"tyj__chaofeng_clear",mark)
else
room:setPlayerMark(player,"tyj__chaofeng_clear",0)
end
end,
}
local tyj__chaofeng_moreslash = fk.CreateTargetModSkill{
name = "#tyj__chaofeng_moreslash",
anim_type = "offensive",
residue_func = function(self, player, skill, scope, card)
return (player:hasSkill("tyj__chaofeng") and (skill.trueName == "slash_skill" or( card.type == Card.TypeBasic and player:getMark("@tyj__chuanshu_bool")~=0))) and 2 or 0
end,
}
local tyj__chuanshu = fk.CreateTriggerSkill{
events = {fk.EventPhaseStart},
name = "tyj__chuanshu",
anim_type = "special",
frequency = Skill.Wake,
can_trigger = function(self, event, target, player, data)
if target == player and player:hasSkill(self) and player.phase == Player.Start and player:usedSkillTimes(self.name, Player.HistoryGame) == 0 then
return true
end
end,
can_wake = function (self, event, target, player, data)
return table.every(player.room.alive_players, function(p) return p.hp >= player.hp end)
end,
on_use = function (self, event, target, player, data)
local room = player.room
room:setPlayerMark(player,"@tyj__chuanshu_bool","基本牌")
local tos = {}
for _, p in ipairs(room:getOtherPlayers(player)) do
if table.every(player.room.alive_players, function(j) return j.hp <= p.hp end) or table.every(player.room.alive_players, function(k) return #k:getCardIds('h') <= #p:getCardIds('h') end) then
table.insertIfNeed(tos,p.id)
end
end
if #tos>0 then
local p2 = room:askForChoosePlayers(player, tos, 1, 1, "传术:你可以令一名手牌数或体力值最大的角色获得〖朝凤〗", self.name, true)
if #p2 ~= 0 then
room:handleAddLoseSkills(room:getPlayerById(p2[1]),"tyj__chaofeng",nil, true, false)
end
end
end,
}
tyj__chaofeng:addRelatedSkill(tyj__chaofeng_moreslash)
--tyj__tongyuan:addSkill(tyj__chaofeng)
--tyj__tongyuan:addSkill(tyj__chuanshu)
Fk:loadTranslationTable{
["tyj__chaofeng"]="朝凤",
[":tyj__chaofeng"]="锁定技,你使用【杀】次数上限+2。你使用一张【杀】时,随机获得一个描述中包含此牌牌名的技能(须会因使用牌触发或含主动转化效果)直到你使用不同牌名的牌后。",
["tyj__chuanshu"]="传术",
[":tyj__chuanshu"]="觉醒技,准备阶段,若你的体力值为全场最小,你令你的〖朝凤〗可因任意基本牌触发,然后可以令一名体力值或手牌数最大的其他角色获得〖朝凤〗。",
["@tyj__chuanshu_bool"]="朝凤",
["$tyj__chaofeng1"]="吾枪所至,人马俱亡!",
["$tyj__chaofeng2"]="鸾凤归巢,百鸟齐鸣。",
["$tyj__chaofeng3"]="鸾凤之响,所闻皆朝。",
["$tyj__chuanshu1"]="得吾传术,尔等可称万人之敌。",
["$tyj__chuanshu2"]="习吾枪法,徒儿天下皆可去得。",
["~tyj__tongyuan"]="有子龙得吾真传,可瞑目矣。",
}
--[[local tyj__guixin = fk.CreateTriggerSkill{
events = {fk.CardUseFinished},
can_trigger = function (self, event, target, player, data)
return #player.room.logic:getActualDamageEvents(1, function(e)
return e.data[1].from and e.data[1].from == winner and e.data[1].card and e:findParent(GameEvent.UseCard)
end, Player.HistoryTurn)>0
end,
}]]--
local function GetLodskillbyKindom(room,kingdom)
local tag = {}
for _, g in ipairs(Fk:getAllGenerals()) do
if g.kingdom == kingdom or g.subkingdom==kingdom then
for _, skn in ipairs(getSkillNameListall(g)) do
local sk=Fk.skills[skn]
if sk.lordSkill and #sk.attachedKingdom == 0 then
table.insert(tag, { g.name, skn })
end
end
end
room:setTag("tyj__lordSkillOf"..kingdom, tag)
end
end
local tyj__zhenyu = fk.CreateTriggerSkill{
name = "tyj__zhenyu",
events = {fk.Damage,fk.Damaged},
can_trigger = function (self, event, target, player, data)
if player:hasSkill(self) and ((event == fk.Damage and target == player) or (event == fk.Damaged and target == player) or (event == fk.HpRecover and data and data.recoverBy == player)) and data.card and data.card~=nil and U.isPureCard(data.card) then
local useevent = nil
local e = player.room.logic:getCurrentEvent():findParent(GameEvent.UseCard)
if e then
useevent = e.data[1]
else
return false end
return #U.getActualUseTargets(player.room, useevent, fk.CardUsing) > 0
end
end,
on_cost = function (self, event, target, player, data)
local room = player.room
local useevent = data
local e = player.room.logic:getCurrentEvent():findParent(GameEvent.UseCard)
if e then
useevent = e.data[1]
else
return false end
local tos = U.getActualUseTargets(player.room, useevent, fk.CardUsing)
local res = room:askForChoosePlayers(player,tos,1,1,"震宇:是否更改一名目标的势力",self.name,true,false)
if #res >0 then
self.cost_data = {res[1],tos}
return true
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
local victim = room:getPlayerById(self.cost_data[1])
local kingdoms = table.simpleClone(Fk.kingdoms)
table.removeOne(kingdoms, victim.kingdom)
local choice = room:askForChoice(player, kingdoms, self.name, nil, false, Fk.kingdoms)
room:changeKingdom(victim, choice, true)
local kingdomcheck = room:getPlayerById(self.cost_data[2][1]).kingdom
for _, i in ipairs(self.cost_data[2]) do
if room:getPlayerById(i).kingdom ~= kingdomcheck then
kingdomcheck = nil
break
end
end
if kingdomcheck ~= nil then
if not room:getTag("tyj__lordSkillOf"..kingdomcheck) then
GetLodskillbyKindom(room,kingdomcheck)
end
local tab = room:getTag("tyj__lordSkillOf"..kingdomcheck)
local skills = {}
for _, v in ipairs(tab) do
if --[[not table.find(room.alive_players, function(p)
return p:hasSkill(v[2])
end)--]] not player:hasSkill(v[2]) then
table.insert(skills,v)
end
end
if #skills <= 3 then return end --FIXME
local final = table.random(skills,3)
local result = room:askForCustomDialog(player, self.name,
"packages/tyj/qml/ChooseSkillBox.qml", {
{final[1][2],final[2][2],final[3][2]}, 1, 1, "震宇:选择一个主公技获得", {final[1][1],final[2][1],final[3][1]},
})
if result == "" then
result = { skills[1][2] }
else
result = json.decode(result)
end
room:handleAddLoseSkills(player, table.concat(result, "|"), nil)
end
end,
}
local tyj__xiaokan = fk.CreateViewAsSkill{
name = "tyj__xiaokan",
pattern = ".",
interaction = function()
local names, all_names = {} , {}
local skills={}
for _, s in ipairs(Self.player_skills) do
if s:isPlayerSkill(Self) and not s.attached_equip then
table.insertIfNeed(skills,s.name)
end
end
for _, id in ipairs(Fk:getAllCardIds()) do
local card = Fk:getCardById(id)
if (card.type == Card.TypeBasic or card:isCommonTrick()) and not card.is_derived and not table.contains(all_names, card.name) then
table.insert(all_names, card.name)
local to_use = Fk:cloneCard(card.name)
if ((Fk.currentResponsePattern == nil and Self:canUse(to_use) and not Self:prohibitUse(to_use)) or
(Fk.currentResponsePattern and Exppattern:Parse(Fk.currentResponsePattern):match(to_use))) then
if not table.contains(Self:getTableMark("tyj__xiaokan-round"),card.trueName) and Fk:translate(card.trueName, "zh_CN"):len()<= #skills-1 then
table.insert(names, card.name)
end
end
end
end
if #names == 0 then return false end
return UI.ComboBox { choices = names, all_choices = all_names }
end,
card_filter = Util.FalseFunc,
view_as = function(self, cards)
if #cards ~= 0 or not self.interaction.data then return end
local card = Fk:cloneCard(self.interaction.data)
card.skillName = self.name
return card
end,
before_use = function(self, player, use)
local num = Fk:translate(use.card.trueName, "zh_CN"):len()
local skills={}
for _, s in ipairs(Self.player_skills) do
if s:isPlayerSkill(Self) and not s.attached_equip then
table.insert(skills,s.name)
end
end
if #skills > num then
local result = player.room:askForCustomDialog(player, self.name,
"packages/tyj/qml/ChooseSkillBox.qml", {
skills, num, num, "枭瞰:失去"..tostring(num).."个技能",
})
if result == "" then
result = table.random(skills,num)
else
result = json.decode(result)
end
player.room:handleAddLoseSkills(player, table.concat(
table.map(result, function(str)
return "-" .. str
end), "|"),nil)
else
player.room:handleAddLoseSkills(player, table.concat(
table.map(skills, function(str)
return "-" .. str
end), "|"),nil)
end
end,
enabled_at_play = function(self, player)
return true
end,
enabled_at_response = function(self, player, response)
return not response
end,
}
local tyj__xiaokan_refresh = fk.CreateTriggerSkill{
name = "#tyj__xiaokan_refresh",
refresh_events = {fk.AfterCardUseDeclared, fk.EventAcquireSkill},
can_refresh = function(self, event, target, player, data)
if event == fk.AfterCardUseDeclared then
--return target == player and (data.card.type == Card.TypeBasic or data.card.type == Card.TypeTrick)
return (data.card.type == Card.TypeBasic or data.card.type == Card.TypeTrick)
else
return target == player and data == self and player.room:getTag("RoundCount")
end
end,
on_refresh = function(self, event, target, player, data)
local room = player.room
if event == fk.AfterCardUseDeclared then
local mark = player:getTableMark( "tyj__xiaokan-round")
table.insertIfNeed(mark, data.card.trueName)
room:setPlayerMark(player, "tyj__xiaokan-round", mark)
else
local mark = {}
room.logic:getEventsOfScope(GameEvent.UseCard, 1, function(e)
local use = e.data[1]
--if use.from == player.id then
table.insertIfNeed(mark, use.card.trueName)
--end
return false
end, Player.HistoryRound)
room:setPlayerMark(player, "tyj__xiaokan-round", mark)
end
end,
}
local function Getskillbyfrequency(room,player,frequency,ifused)
local tag = {}
for _, g in ipairs(Fk:getAllGenerals()) do
for _, skn in ipairs(getSkillNameListall(g)) do
local sk=Fk.skills[skn]
if ifused == nil or ifused == false or (ifused == true and player:usedSkillTimes(skn, Player.HistoryGame) == 0) then
if sk.frequency == frequency then
table.insert(tag, { g.name, skn })
end
end
end
end
return tag
end
local tyj__guixin = fk.CreateTriggerSkill{
name = "tyj__guixin",
events = {fk.RoundEnd},
frequency = Skill.Wake,
can_trigger = function (self, event, target, player, data)
return player:hasSkill(self)
end,
can_wake = function(self, event, target, player, data)
local room = player.room
local tos={}
for _, p in ipairs(room.alive_players) do
table.insertIfNeed(tos,p.kingdom)
end
return #tos == 1
end,
on_use = function (self, event, target, player, data)
local room = player.room
local roundCount = room:getTag("RoundCount")
roundCount = 0
room:setTag("RoundCount", roundCount)
room:doBroadcastNotify("UpdateRoundNum", roundCount)
room:handleAddLoseSkills(player, "tyj__xionghuan", nil)
end,
}
local tyj__xionghuan = fk.CreateTriggerSkill{
name = "tyj__xionghuan",
events = {fk.EventLoseSkill},
frequency = Skill.Compulsory,
can_trigger = function (self, event, target, player, data)
if target == player and player:hasSkill(self) and data and data.name and Fk:translate(data.name):len()>0 and Fk:translate(":"..data.name):len()>0 and data.name:sub(1,1)~="#" then
local e = player.room.logic:getCurrentEvent():findParent(GameEvent.SkillEffect)
if e and e.data[3] == self then --FIXME:防止嵌套
return false
end
local ban_types = {Skill.Limited, Skill.Wake, Skill.Quest}
return not table.contains(ban_types,data.frequency) and data.name
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
local pool = {Getskillbyfrequency(room,player,Skill.Limited,true),Getskillbyfrequency(room,player,Skill.Wake,true),Getskillbyfrequency(room,player,Skill.Quest,true)}
local final = {}
if #pool[1]>0 then
table.insert(final,table.random(pool[1],1)[1])
end
if #pool[2]>0 then
table.insert(final,table.random(pool[2],1)[1])
end
if #pool[3]>0 then
table.insert(final,table.random(pool[3],1)[1])
end
if #final>0 then
local result = room:askForCustomDialog(player, self.name,
"packages/tyj/qml/ChooseSkillBox.qml", {
{final[1][2],final[2][2],final[3][2]}, 1, 1, "雄寰:选择一个限定/觉醒/使命技获得", {final[1][1],final[2][1],final[3][1]},
})
if result == "" then
result = { table.random(table.random(pool,1)[1],1)[1][2] }
else
result = json.decode(result)
end
room:handleAddLoseSkills(player, table.concat(result, "|"), nil)
end
end,
}
--local tyj__god_caocao = General:new(extension, "tyj__caocao", "wei", 4,4)
Fk:loadTranslationTable{
["tyj__caocao"] = "曹操",
["#tyj__caocao"] = "雄瞰归心",
["designer:tyj__caocao"] = "水天一色&汤圆",
["cv:tyj__caocao"] = "官方",
["illustrator:tyj__caocao"] = "黯荧岛工作室",
}
--tyj__god_caocao:addSkill(tyj__zhenyu)
--tyj__xiaokan:addRelatedSkill(tyj__xiaokan_refresh)
--tyj__god_caocao:addSkill(tyj__xiaokan)
--tyj__god_caocao:addSkill(tyj__guixin)
--tyj__god_caocao:addRelatedSkill(tyj__xionghuan)
Fk:loadTranslationTable{
["tyj__zhenyu"]="震宇",
[":tyj__zhenyu"]="你因实体牌造成或受到伤害,可更改此牌一名目标的势力,然后若所有目标势力相同,你从随机三个此势力主公技中获得一个。",
["tyj__xiaokan"]="枭瞰",
[":tyj__xiaokan"]="你可失去任意个技能视为使用一张牌名字数相等且本轮未被使用过的基本或普通锦囊牌。",
["tyj__guixin"]="归心",
[":tyj__guixin"]="觉醒技,轮次结束时,若所有角色势力相同,你将轮次数归零并获得〖雄寰〗。",
["tyj__xionghuan"]="雄寰",
[":tyj__xionghuan"]="锁定技,你失去不带限定、觉醒、使命技标签的技能后,从这三种标签的技能中你未发动过的技能各随机一个中选择一个获得。",
}
--效果池
local effectpool={
any={"dingcuo","wangong","xianwei","qizhou","baobian","yifa","qimei","quanbian","yipo","douchan","duoshou","kunfen","goude","benxi","qiangzhi","xiantu","pizhuan","meihun","zhiti","cuike","longnu","silun","ol_ex__ninge","juejing","guixin","wumou","chezheng","jinqu","y13__jiewei","jianxiang","huimin","daiyan","fumian","qingxian","juexiang","caishi","qinqing","guizao","chanxin","jigong","xingxue","qiaoshi","huituo","pingkou","youdi","faen","nos__faen","bingyi","zhiyan","juece","miji","leiji","ex__leiji","ol_ex__jieming","ol_ex__kuanggu","kuanggu","biyue","ex__biyue","guanxing","ex__guanxing","ol_ex__fenji","ol_ex__piaoling","yiji","jiang","yinghun","xiaoji","ex__jianxiong","zhiyu","yiji","ex__yiji","ex__luoshen","xunxun","zhaxiang","ex__qianxun","lianying","wangzun","luoshen","cangzhuo","ol_ex__shebian","jieming","tuntian","ol_ex__tuntian","ex__qingjian","jiyuan","jujian","xuanfeng","buyi","nos__miji","qianxi","jingce"},
usesharelatetarget={"huanfu","lingren","gongjian","zhuilie","wanyi","canmou","zhuosheng","xiaoshi","hulie","ol__dulie","tushe","kuansai","qizhi","huoshou","jianzhengq","zhuandui","ol_ex__liegong","wushuang","tieji","roulin","zuoding"},
datato={"duorui","ex__tieji","liegong","liyu","qiaomeng"},
phasedraw={"ex__luoyi","jiangchi","xiaoren","ty__luochong"},
drawn={"nos__juejing","yongsi","luoyi","yingzi","ex__yingzi","zishou","haoshi"},
phasedis={"guzheng","guizao","ol_ex__jushou","jushou","chenyong","xiaoren","ty__luochong","panqin"},
phasejudge={"zhenglun","xiaoren","xiaoren"},
anydying={"nos__jiefan","sanku"},
phaseuse={"qingjiao","jiqiaos","ty__luochong","longsong","panqin","liantao"},
turnrelate={"liantao","yongzu","lanjiang","haoyi","xianmou","miyi","sijun","zhengqing","ol_ex__jushou","jushou","chenyong","yuyan","xiaoren","ty__luochong"},
anyphase={"fensi","yangkuang","xiongshu","zhuijix","zhaoran","caiyuan","ol__huishi","qingleng","jinming","bolan","zhuri","hongtu","shelie","kongsheng","zuilun","zhengu","ol_ex__shensu","shensu","zaiqi","ol_ex__shensu","tuxi","keji","fangquan","ol_ex__fangquan","ex__luoyi","qiaobian"},
datacard={"zhefu","yizhao","ciwei","zhongyong","wangliec","tiandu","jianxiong","juxiang","ol_ex__yaowu","longyin"},
datafrom={"huqi","jianhui","ol__xibing","enyuan","nos__enyuan","qiaoyan","ex__fankui","fankui","ex__ganglie","ganglie","wangxi","ol__xibing"},
datafromid={"cihuang","zhenlie"},
datatocard={},
datafromidcard={"xiaoshi","ol__dulie","xiangle","congjian","shouxi","zhuandui","maihuo","shiyuan"},
datatofrom={"beige","ol_ex__beige","naxiang","qiaoyan"},
anydamage={"chuanwu","shanzhuan","zhidao","chengxiang","nos__chengxiang","qianlong","ty__baobian","lvli","yiwu","sanshou","qiwu","kuangbao","junlue","tianxiang","lianhuo","huisheng","ol_ex__tianxiang","tianxiang","ol_ex__weimu","yuce","jiaojin","qingxi"},
}
--触发时机池
local triggerpool={
--弃牌阶段
phasedis={"guzheng","cangzhuo","kuizhu"},
phasedraw={"ol__huishi","shelie","zaiqi","tongbo","caishi","tuxi","ex__luoyi","xunxun"},
--摸牌阶段
phasejudge={"yonglue","haoshi","ex__tuxi"},
--判定阶段
anydying={"nos__jiefan","buyi","juejing"},
--濒死
drawn={"nos__juejing","luoyi","yingzi","ex__yingzi","yongsi"},
--摸牌阶段修改摸牌数时
phaseuse = {"xiongshu","zhuijix","zhaoran","bolan","qiangzhi","xiantu","cuike","longnu","yili","chezheng","jigong","fangquan","ol_ex__fangquan"},
--出牌阶段开始
otphase = {"qimei","caiyuan","qingleng","hongtu","kunfen","zhuri","kongsheng","zuilun","zhengu","ol_ex__shensu","shensu","jinqu","benghuai","ol_ex__zaiqi","y13__jushou","huimin","fuzhu","daiyan","fumian","qinqing","xingxue","qiaoshi","qieting","bingyi","zhiyan","juece","qianxi","ol_ex__jushou","biyue","ex__biyue","ol_ex__piaoling","ex__luoshen","zhuhai","wangzun","jujian"},
--其他阶段,包括回合开始结束啥的
turnrelate={"jinming","ol_ex__botu","ol_ex__huashen","goude","qimei","caiyuan","qingleng","hongtu","kunfen","kongsheng","zuilun","zhengu","jinqu","benghuai","ol_ex__zaiqi","y13__jushou","biyue","ex__biyue","ol_ex__piaoling","ex__luoshen","zhuhai","wangzun","jujian","fuzhu","daiyan","fumian","qinqing","xingxue","qiaoshi","xingxue","qiaoshi","qieting","bingyi","zhiyan","juece","qianxi"},
--其他阶段,包括回合开始结束啥的(和上面重了)
usesharelatetarget={"yifa","hulie","tushe","kuansai","qizhi","huoshou","lianzheng","zuoding","ol_ex__liegong","liegong","ex__tieji","tieji","roulin"},
--使用fk.TargetSpecified时机的
datato = {},
datatocard={"qingxi","anjian","nos__qianxi","beige","ol_ex__beige","lieren","yizhong","pojun","shiyong","ol_ex__yaowu","yaowu","kuangfu","qiaomeng","liyu","jianxiong"},
--使用有data.to和data.card的
datafrom = {"hanzhan"},
--有datafrom的
datatofrom={"yimie","naxiang","ol__xibing","qiaoyan","qiwu","wuhun","ex__fankui","fankui","ex__ganglie","ganglie",},
--有data.from和data.to的
bothdamage = {"junlue","kuangbao","naxiang","jianhui"},
--造成和受到伤害都包含的
damaged={"qiaoyan","ol_ex__ninge","wuhun","zhengrong","tianxiang","lianhuo","huisheng","chanxin","anjian","nos__qianxi","beige","ol_ex__beige","lieren","ol_ex__tianxiang","ex__jianxiong","ex__fankui","fankui","ex__ganglie","ganglie","jianxiong","yiji","ex__yiji","zhiyu","wangxi","ol_ex__tianxiang","jianxiong","zhichi","quanji","yuce","shiyong","ol_ex__yaowu","yaowu"},
--受到伤害的
damage = {"yimie","duoshou","duorui","qingxi","ol_ex__kuanggu","kuanggu","ol_ex__weimu","ol_ex__xinsheng","xinsheng","pojun","kuangfu","qiaomeng","liyu"},
--造成伤害的
datacard={"shenpin","ex__paoxiao","guidao","guicai","ol_ex__guidao","funan","nos__zhenlie","wuyan","tiandu","ol_ex__leiji"},
--有data.card的
usetos={"cihuang","zhenlie","liuli","qiuyuan","shouxi","jianxiang","congjianx","ol__dulie","fuyin","jiaojin","congjian","xiangle","jiang","mengjin","nos__wuyan","canmou","ciwei","quanbian","xiaoshi","benxi","zhongyong","wangliec","wushuang","zhuandui","pizhuan","juzhan","wumou","shicai","jianying","zenhui","nos__mieji","ex__jizhi","jizhi","ex__qianxun","longyin"},
--有use.tos的一般都是usestruct相关时机的技能
}
local function getonuseeffect(room,player,skill)
--这个函数用来给来自某个triggerpool的技能配对对应的效果池
local toreturn = effectpool.any
--任何技能都可以配对effectpool.any的技能
if table.contains(triggerpool.phasedis,skill) then
toreturn = table.connect(toreturn,effectpool.anyphase)
toreturn = table.connect(toreturn,effectpool.phasedis)
end
if table.contains(triggerpool.phasedraw,skill) then
toreturn = table.connect(toreturn,effectpool.anyphase)
toreturn = table.connect(toreturn,effectpool.phasedraw)
end
if table.contains(triggerpool.drawn,skill) then
toreturn = table.connect(toreturn,effectpool.drawn)
end
if table.contains(triggerpool.phaseuse,skill) then
toreturn = table.connect(toreturn,effectpool.anyphase)
toreturn = table.connect(toreturn,effectpool.phaseuse)
end
if table.contains(triggerpool.phaseuse,skill) then
toreturn = table.connect(toreturn,effectpool.anyphase)
toreturn = table.connect(toreturn,effectpool.phaseuse)
end
if table.contains(triggerpool.otphase,skill) then
toreturn = table.connect(toreturn,effectpool.anyphase)
end
if table.contains(triggerpool.turnrelate,skill) then
toreturn = table.connect(toreturn,effectpool.turnrelate)
end
if table.contains(triggerpool.usesharelatetarget,skill) then
toreturn = table.connect(toreturn,effectpool.usesharelatetarget)
toreturn = table.connect(toreturn,effectpool.datacard)
toreturn = table.connect(toreturn,effectpool.usetos)
end
if table.contains(triggerpool.damage,skill) or table.contains(triggerpool.damaged,skill) or table.contains(triggerpool.bothdamage,skill) then
toreturn = table.connect(toreturn,effectpool.anydamage)
toreturn = table.connect(toreturn,effectpool.datato)
end
if table.contains(triggerpool.datato,skill) or table.contains(triggerpool.datatofrom,skill) or table.contains(triggerpool.bothdamage,skill) then
toreturn = table.connect(toreturn,effectpool.datato)
end
if table.contains(triggerpool.datatocard,skill) then
toreturn = table.connect(toreturn,effectpool.datatocard)
toreturn = table.connect(toreturn,effectpool.datacard)
end
if table.contains(triggerpool.datafrom,skill) or table.contains(triggerpool.datatofrom,skill) or table.contains(triggerpool.damage,skill) then
toreturn = table.connect(toreturn,effectpool.datafrom)
end
if table.contains(triggerpool.datacard,skill) then
toreturn = table.connect(toreturn,effectpool.datacard)
end
if table.contains(triggerpool.anydying,skill) then
toreturn = table.connect(toreturn,effectpool.anydying)
end
if table.contains(triggerpool.datatofrom,skill) then
toreturn = table.connect(toreturn,effectpool.datatofrom)
toreturn = table.connect(toreturn,effectpool.usesharelatetarget)
end
if table.contains(triggerpool.usetos) then
toreturn = table.connect(toreturn,effectpool.datafromid)
toreturn = table.connect(toreturn,effectpool.usetos)
toreturn = table.connect(toreturn,effectpool.datacard)
end
return toreturn
end
local function Getskillthatsnormal(room,player)
--这个函数用来晒正常的触发技,同时规定来源扩展包,这个函数引用了我的包里的函数getSkillNameListall(general.name),用于获得一名武将牌上所有技能(包含一切衍生技)
local tag = {}
local has = {}
local banedskills = {"cunmu","gundam__juejing"}
for _, g in ipairs(Fk:getAllGenerals()) do
if (table.contains({"standard","standard_ex","ol_ex","yj","shzl"},g.package.extensionName) or table.contains({"standard","standard_ex","ol_ex","yj","shzl","ol__mou","ol_wende"},g.package.name)) then
for _, skn in ipairs(getSkillNameListall(g)) do
local sk=Fk.skills[skn]
if not table.contains(banedskills,skn) and sk:isInstanceOf(TriggerSkill) and table.contains({ Skill.Compulsory, Skill.Frequent, Skill.NotFrequent }, sk.frequency) and
not sk:isSwitchSkill() and
not sk.lordSkill and
not sk.isHiddenSkill and not table.contains(has,skn)then
table.insert(tag,{skn,g.name})
table.insert(has,skn)
end
end
end
end
return tag
end
local function rhgenerateArray()
local arr = {}
for i = 1, 100 do
arr[i] = i
end
return arr
end
local rhArray = rhgenerateArray()
local tyj__hunpo_skillmodel = fk.CreateTriggerSkill{
name = "#tyj__hunpo_skillmodel",
events = rhArray,
tyj__hunpo_data = "",
mute = true,
can_trigger = function(self, event, target, player, data)
local s=player.room:getTag("tyj__hunpo_skillowner") or {}
local sl = s[player.id] or {}
if s[player.id]~=nil and #s[player.id]>0 then
for i=1 ,#sl do
local g=Fk.skills[sl[i][1]]
if g and table.contains(g.events,event) and g.triggerable(self, event, target, player, data) then self.tyj__hunpo_data = sl[i]
if i == #sl then
return true
else
g.trigger(self, event, target, player, data)
end
end
end
end
end,
on_cost = function(self, event, target, player, data)
local g=Fk.skills[self.tyj__hunpo_data[2]]
if g and g.cost(self, event, target, player, data) then return true end
end,
on_use = function(self, event, target, player, data)
local room = player.room
local g=Fk.skills[self.tyj__hunpo_data[2]]
room:notifySkillInvoked(player,(Fk:translate(self.tyj__hunpo_data[1])[1]..Fk:translate(self.tyj__hunpo_data[2])[2]) or "tyj__hunpo",g.anim_type or nil)
player:broadcastSkillInvoke(table.random(self.tyj__hunpo_data,1)[1], -1)
return g and g.use(self, event, target, player, data)
end,
refresh_events = rhArray,
can_refresh = function(self, event, target, player, data)
local s=player.room:getTag("tyj__hunpo_skillowner") or {}
local sl = s[player.id] or {}
if s[player.id]~=nil and #s[player.id]>0 then
for i=1 ,#sl do
local g=Fk.skills[sl[i][1]]
if g and table.contains(g.events,event) and g.canRefresh(self, event, target, player, data) then self.tyj__hunpo_data = sl[i]
if i == #sl then
return true
else
g.refresh(self, event, target, player, data)
end
end
end
end
end,
on_refresh = function(self, event, target, player, data)
local g=Fk.skills[self.tyj__hunpo_data[2]]
return g and g.refresh(self, event, target, player, data)
end
}
--Fk:addSkill(tyj__hunpo_skillmodel)
local tyj__hunpo = fk.CreateTriggerSkill{
name = "tyj__hunpo",
events = {fk.GameStart,fk.EnterDying,fk.Damage},
frequency= Skill.Compulsory,
can_trigger = function (self, event, target, player, data)
if player:hasSkill(self) then
if event == fk.Damage then
return target == player and not table.contains(player:getTableMark("tyj__hunpo_time"),event)
elseif event == fk.EnterDying then
return target == player and not table.contains(player:getTableMark("tyj__hunpo_time"),event)
elseif event == fk.GameStart then
return not table.contains(player:getTableMark("tyj__hunpo_time"),event)
end
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
local markone = player:getTableMark("tyj__hunpo_time")
table.insertIfNeed(markone,event)
room:setPlayerMark(player,"tyj__hunpo_time",markone)
local pool = room.tag["tyj__skillthatsnormal"] or {}
if #pool==0 then
pool = Getskillthatsnormal(room,player)
room.tag["tyj__skillthatsnormal"]=pool
end
local skillsp = table.random(pool,math.min(3,#pool))
if #skillsp>0 then
local skillfc = {}
local gfc = {}
for _, tos in ipairs(skillsp) do
table.insert(skillfc,tos[1])
table.insert(gfc,tos[2])
end
local skillcombo = {}
local result = room:askForCustomDialog(player, self.name,
"packages/tyj/qml/ChooseSkillBox.qml", {
skillfc, 1, 1, "选择一个技能作为触发时机",
})
if result == "" then
result = table.random(skillfc,1)
else
result = json.decode(result)
end
table.insert(skillcombo,result[1])
local effecttos = getonuseeffect(room,player,skillcombo[1])
if #effecttos >0 then
effecttos= table.random(effecttos,math.min(3,#effecttos))
local result = room:askForCustomDialog(player, self.name,
"packages/tyj/qml/ChooseSkillBox.qml", {
effecttos, 1, 1, "选择一个技能作为在 〖"..Fk:translate(skillcombo[1]).."〗 的发动时机触发的效果",
})
if result == "" then
result = table.random(effecttos,1)
else
result = json.decode(result)
end
table.insert(skillcombo,result[1])
end
if #skillcombo>1 then
room.tag["tyj__hunpo_skillowner"]=room.tag["tyj__hunpo_skillowner"] or {}
room.tag["tyj__hunpo_skillowner"][player.id] = room.tag["tyj__hunpo_skillowner"][player.id] or {}
local tos = room.tag["tyj__hunpo_skillowner"][player.id]
table.insert(tos,skillcombo)
room.tag["tyj__hunpo_skillowner"][player.id] = tos
print(room.tag["tyj__hunpo_skillowner"][player.id][1][1])
local skillxx=skillcombo
local mark = player:getTableMark("@[:]tyj__huoposkills")
table.insert(mark,Fk:translate(skillxx[1])[1]..Fk:translate(skillxx[2])[2].."。<br><li>时机与条件来自:〖"..Fk:translate(skillxx[1]).."〗<br>"..Fk:translate(":"..skillxx[1]).."<br><li>效果来自:〖"..Fk:translate(skillxx[2]).."〗<br>"..Fk:translate(":"..skillxx[2]))
room:setPlayerMark(player,"@[:]tyj__huoposkills",mark)
--[[Fk:loadTranslationTable{
[namex]=Fk:translate(skillxx[1])[1]..Fk:translate(skillxx[2])[2],
[":"..namex]="融合技能。<br><li>时机与条件来自:〖"..Fk:translate(skillxx[1]).."〗<br>"..Fk:translate(":"..skillxx[1]).."<br><li>效果来自:〖"..Fk:translate(skillxx[2]).."〗<br>"..Fk:translate(":"..skillxx[2]),
}
Fk.translations["zh_CN"][namex]=Fk:translate(skillxx[1])[1]..Fk:translate(skillxx[2])[2]
Fk.translations["zh_CN"][":"..namex]="融合技能。<br><li>时机与条件来自:〖"..Fk:translate(skillxx[1]).."〗<br>"..Fk:translate(":"..skillxx[1]).."<br><li>效果来自:〖"..Fk:translate(skillxx[2]).."〗<br>"..Fk:translate(":"..skillxx[2])
print(Fk:translate(namex))
print(Fk:translate(":"..namex))--]]
--room:handleAddLoseSkills(player,"tyj__hunpo_skillmodel", nil, true, false)
local skill = Fk.skills[skillxx[2]]
local toget = {table.unpack(skill.related_skills)}
table.insert(toget, skill)
local ret = {}
for _, s in ipairs(toget) do
if not player:hasSkill(s, true, true) then
table.insert(ret, s)
if s:isInstanceOf(TriggerSkill) and RoomInstance then
room.logic:addTriggerSkill(s)
end
if s:isInstanceOf(StatusSkill) then
room.status_skills[s.class] = room.status_skills[s.class] or {}
table.insertIfNeed(room.status_skills[s.class], s)
end
end
end
end
end
end,
}
local tyj__hunpo_use = fk.CreateActiveSkill{
name = "tyj__hunpo_use",
anim_type = "special",
target_num = 0,
prompt = "是否视为发动〖混魄〗?",
frequency = Skill.Compulsory,
card_filter = function(self, to_select, selected)
return false
end,
can_use = function(self, player)
return true
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
tyj__hunpo:use(fk.GameStart, player, player, {})
end,
}
--tyj__hunpo:addRelatedSkill(tyj__hunpo_skillmodel)
--tyj__hunpo:addRelatedSkill(tyj__hunpo_use)
--tyj__god_caocao:addSkill(tyj__hunpo)
Fk:loadTranslationTable{
["tyj__hunpo"]="枭瞰",
["tyj__hunpo_use"]="枭瞰",
[":tyj__hunpo"]="锁定技,游戏开始时/你进入濒死时/你造成伤害后(每个时机各限一次),你从随机三个触发技中选择一个,再从随机三个触发技中选择一个,然后用首个技能的时机和第二个技能的效果组合在一起成为一个新技能。",
["#tyj__hunpo_skillmodel"]="枭瞰",
["$tyj__hunpo1"]="鸿鹄大志,几人能懂?",
["$tyj__hunpo2"]="奸略逐鹿原,雄才扫狼烟!",
["~tyj__caocao"]="平生助汉,终不可追...",
[":#tyj__hunpo_skillmodel"]="新技能",
["@[:]tyj__huoposkills"]="归心技能",
}
--[[local tyj__zhugedan = General:new(extension, "tyj__zhugedan", "wei", 4,4)
--tyj__zhugedan.shield = 1
Fk:loadTranslationTable{
["tyj__zhugedan"] = "诸葛诞",
["#tyj__zhugedan"] = "兔死獒烹",
["designer:tyj__zhugedan"] = "汤圆",
["cv:tyj__zhugedan"] = "官方",
["illustrator:tyj__zhugedan"] = "黯荧岛工作室",
}
local tyj__gongao_viewas = fk.CreateViewAsSkill{
name = "#tyj__gongao_viewas",
anim_type = "control",
prompt = "功獒:是否将一张基本牌当【树上开花】对其使用?",
card_num = 1,
target_num = 0,
can_use = function(self, player) return true end,
target_filter = Util.FalseFunc,
card_filter = function(self, to_select, selected)
if #selected ~= 0 then return false end
local card = Fk:cloneCard("bogus_flower")
card:addSubcard(to_select)
return Fk:getCardById(to_select).type == Card.TypeBasic and not Self:prohibitUse(card) and not Self:isProhibited(Self, card)
end,
view_as = function(self, cards)
if #cards ~= 1 then return end
local card = Fk:cloneCard("bogus_flower")
card:addSubcard(cards[1])
card.skillName = "tyj__gongao"
card.skillNames = card.skillNames or {}
table.insert(card.skillNames,"tyj__gongao")
--card.extra_data = card.extra_data or {}
--card.extra_data.tyj__gongao_from = Self.id
return card
end,
}
Fk:addSkill(tyj__gongao_viewas)
local tyj__gongao = fk.CreateTriggerSkill{
name="tyj__gongao",
anim_type = "drawcard",
events = {fk.EventPhaseStart},
can_trigger= function(self, event, target, player, data)
if player:hasSkill(self) and target.phase == Player.Start then
return #player.room.logic:getActualDamageEvents( 1, function(e)
local damage = e.data[1]
return (damage.from == player and damage.to == target) or (damage.from == target and damage.to == player)
end, Player.HistoryGame) == 0
end
end,
on_cost = function (self, event, target, player, data)
local success, dat = player.room:askForUseActiveSkill(player, "#tyj__gongao_viewas", "功獒", true)
if success then
self.cost_data = dat.cards
return true
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
local preuse = room:useVirtualCard("bogus_flower",self.cost_data,player,target,self.name)
if preuse.extra_data and preuse.extra_data.tyj__gongao_record then
local mark = preuse.extra_data.tyj__gongao_record
while #mark > 0 and not player.dead do
local use = U.askForUseRealCard(room, player, mark, nil, self.name, nil, {expand_pile = mark}, true)
if not use then break end
table.removeOne(mark, use.card:getEffectiveId())
room:useCard(use)
end
end
end,
refresh_events = {fk.AfterCardsMove},
can_refresh = function(self, event, target, player, data)
for _, move in ipairs(data) do
if move.from and move.from ==player.id and move.toArea == Card.DiscardPile and move.moveReason == fk.ReasonDiscard then return true end
end
end,
on_refresh = function (self, event, target, player, data)
local room = player.room
local e = player.room.logic:getCurrentEvent():findParent(GameEvent.UseCard)
if e then
local use = e.data[1]
if table.contains(use.card.skillNames, "tyj__gongao") then
local exdata = e.data[1].extra_data or {}
exdata.tyj__gongao_record = exdata.tyj__gongao_record or {}
for _, move in ipairs(data) do
if move.toArea == Card.DiscardPile and move.moveReason == fk.ReasonDiscard then
for _, info in ipairs(move.moveInfo) do
if (info.fromArea == Card.PlayerHand or info.fromArea == Card.PlayerEquip) then
table.insertIfNeed(exdata.tyj__gongao_record, info.cardId)
end
end
end
end
e.data[1].extra_data = exdata
end
end
end,
}
local tyj__yaju = fk.CreateTriggerSkill{
name = "tyj__yaju",
events = {fk.DamageCaused, fk.MaxHpChanged,fk.HpChanged,fk.AfterDying},
frequency = Skill.Quest,
mute = true,
can_trigger = function(self, event, target, player, data)
if player:getQuestSkillState(self.name) or not player:hasSkill(self) then
return false
end
local room = player.room
if event == fk.DamageCaused then
return not player:hasSkill("tianren",true) and target == player
elseif event == fk.MaxHpChanged or event == fk.HpChanged then
for _, p in ipairs(room:getOtherPlayers(player)) do
if p:getLostHp() >= player:getLostHp() and p.id ~= player.id then return false end
end
return player:getLostHp()>player.hp
else return #player.room.logic:getActualDamageEvents( 1, function(e)
local damage = e.data[1]
return (damage.from == player and damage.to == target)
end, Player.HistoryGame) ~= 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
if event == fk.DamageCaused then
if not player:hasSkill("tianren", true) then
room:notifySkillInvoked(player, self.name, "special")
player:broadcastSkillInvoke(self.name,table.random({1,2}))
room:setPlayerMark(player, "tyj__yaju_tianren", 1)
room:handleAddLoseSkills(player, "tianren", nil, true, false)
end
elseif (event == fk.MaxHpChanged) or(event == fk.HpChanged) then
room:notifySkillInvoked(player, self.name, "negative")
player:broadcastSkillInvoke(self.name, 4)
room:updateQuestSkillState(player, self.name, true)
if player:isWounded() and not player.dead then
room:recover({
who = player,
num = player:getLostHp(),
recoverBy = player,
skillName = self.name
})
end
room:handleAddLoseSkills(player, "zhangu")
else
local mark = player:getTableMark("tyj__yaju_count")
table.insertIfNeed(mark,target.id)
room:setPlayerMark(player,"tyj__yaju_count",mark)
if #player:getTableMark("tyj__yaju_count")>1 then
room:setPlayerMark(player,"tyj__yaju_count",0)
room:notifySkillInvoked(player, self.name)
player:broadcastSkillInvoke(self.name, 3)
room:updateQuestSkillState(player, self.name)
room:handleAddLoseSkills(player, "ol__mingzhe")
end
end
end,
refresh_events = {fk.AfterTurnEnd},
can_refresh = function(self, event, target, player, data)
return not target.dead
end,
on_refresh = function(self, event, target, player, data)
local room = player.room
if player:getMark("tyj__yaju_tianren") > 0 then
room:setPlayerMark(player, "tyj__yaju_tianren", 0)
if player:hasSkill("tianren", true) then
room:handleAddLoseSkills(player, "-tianren",nil,true,false)
end
end
end
}
local tyj__yaju_tianrenremark= fk.CreateTriggerSkill{
--我服了天任居然清标记数
name = "#tyj__yaju_tianrenremark",
priority = 0.02,
refresh_events = {fk.EventLoseSkill,fk.EventAcquireSkill},
can_refresh = function(self, event, target, player, data)
if (player ~= target ) or (data and data.name ~= "tianren") then return false end
if event == fk.EventLoseSkill then
return player:hasSkill("tyj__yaju",true) and player:getMark("@tianren") ~= 0
else
return player:getMark("tyj__yaju_tianrenremark") ~= 0
end
end,
on_refresh = function(self, event, target, player, data)
if event == fk.EventLoseSkill then
player.room:setPlayerMark(player, "tyj__yaju_tianrenremark",player:getMark("@tianren") )
else
player.room:setPlayerMark(player, "@tianren",player:getMark("tyj__yaju_tianrenremark") )
player.room:setPlayerMark(player, "tyj__yaju_tianrenremark",0)
end
end,
}
tyj__zhugedan:addSkill(tyj__gongao)
tyj__zhugedan:addSkill(tyj__yaju)
tyj__yaju:addRelatedSkill(tyj__yaju_tianrenremark)
tyj__zhugedan:addRelatedSkill("tianren")
tyj__zhugedan:addRelatedSkill("ol__mingzhe")
tyj__zhugedan:addRelatedSkill("zhangu")
Fk:loadTranslationTable{
["#tyj__yaju_tianrenremark"]="天任",
["tyj__gongao"]="功獒",
[":tyj__gongao"]="任意角色的准备阶段,若你们皆未对对方造成过伤害,你可将一张基本牌当【树上开花】对其使用,并可使用因此弃置的牌。",
["$tyj__gongao1"]="怯战者立斩不赦,尔等勿忘吾剑之利!",
["$tyj__gongao2"]="户犬闻寇至尚吠三两声,况我大魏义士乎?",
["#tyj__gongaou_viewas"]="功獒",
["tyj__yaju"]="齾举",
[":tyj__yaju"]="使命技,你造成伤害时获得〖天任〗至此回合结束。<br>\
<strong>成功</strong>:两名受到过你造成的伤害的角色的濒死结算完成后,你获得〖明哲〗;<br>\
<strong>失败</strong>:你的已损体力成为场上唯一最高且大于你的体力值时,你回满体力并获得〖战孤〗。",
[":tyj__yaju_re"]="使命技,你对其他角色造成伤害时,可以获得其一张牌并将其一张牌置于你的武将牌上称为“威”。你的手牌上限+X(X为你的权数)。<br>\
<strong>成功</strong>:两名受到过你造成的伤害的角色进入濒死后,你将所有“威”交给一名其他角色并摸等量张牌,然后获得“明哲”;<br>\
<strong>失败</strong>:准备阶段,若你的手牌上限为全场唯一最多且体力值为全场最小,你弃置所有“威”并获得等量点体力上限与【战孤】。",
["@tyj__yaju_count"]="齾举",
["$tyj__yaju1"]="末将愿为我大魏开疆拓土。",
["$tyj__yaju2"]="犯大魏者,虽远必诛。",
["$tyj__yaju3"]="恪尽职守,忠心侍主",
["$tyj__yaju4"]="世受魏恩,岂可欲以社稷输人?",
["$tianren_tyj__zhugedan1"]="以有道之师,伐无道之徒!",
["$tianren_tyj__zhugedan2"]="冒犯天威当有此名。",
["$ol__mingzhe_tyj__zhugedan1"]="位居人臣,自当竭忠尽智。",
["$ol__mingzhe_tyj__zhugedan2"]="大魏獒犬,恪忠于国。",
["$zhangu__tyj__zhugedan1"]="本将军,誓与寿春,共存亡。",
["$zhangu__tyj__zhugedan2"]="只求,玉石俱焚!",
["~tyj__zhugedan"]="成功,成仁!",
}--]]
local tyj__xiahoudun = General:new(extension, "tyj__xiahoudun", "wei", 4,4)
Fk:loadTranslationTable{
["tyj__xiahoudun"] = "夏侯惇",
["#tyj__xiahoudun"] = "独眼的罗刹",
["designer:tyj__xiahoudun"] = "汤圆",
["cv:tyj__xiahoudun"] = "官方",
["illustrator:tyj__xiahoudun"] = "YanBai",
}
local tyj__ganglie = fk.CreateTriggerSkill{
name = "tyj__ganglie",
anim_type = "masochism",
events = {fk.Damaged},
on_trigger = function(self, event, target, player, data)
self.cancel_cost = false
for i = 1, data.damage do
if i > 1 and (self.cancel_cost or not player:hasSkill(self)) then break end
self:doCost(event, target, player, data)
end
end,
on_cost = function(self, event, target, player, data)
local room = player.room
return room:askForSkillInvoke(player, self.name, data)
end,
on_use = function(self, event, target, player, data)
local room = player.room
local from = data.from
local cardsc = nil
local dis = room:askForDiscard(player, 1, 1, true, self.name, true,nil,"刚烈:弃置一张牌,或者取消并弃置牌堆顶的一张牌",false)
if dis~={} and #dis and #dis>0 then
cardsc = dis
room:moveCards({
ids = cardsc,
from=player.id,
toArea = Card.DiscardPile,
moveReason = fk.ReasonDiscard,
skillName = self.name,
proposer = player.id
})
else
cardsc = room:getNCards(1)
room:moveCards({
ids = cardsc,
toArea = Card.DiscardPile,
moveReason = fk.ReasonDiscard,
skillName = self.name,
proposer = player.id
})
end
if from and not from.dead and cardsc~=nil then
room:doIndicate(player.id, {data.from.id})
local choices = {"#tyj__ganglie_damage"}
local candis = {}
if #from:getCardIds{Player.Equip,Player.Hand} > 0 then
for _, cid in ipairs(from:getCardIds{Player.Equip,Player.Hand}) do
if Fk:getCardById(cid).suit == Fk:getCardById(cardsc[1]).suit then
table.insert(candis,cid)
end
end
end
if #candis > 0 then
table.insert(choices,"#tyj__ganglie_dis")
end
local choosed = room:askForChoice(from, choices, self.name,"刚烈",false,{"#tyj__ganglie_damage","#tyj__ganglie_dis"})
if choosed == "#tyj__ganglie_dis" then
from:showCards(from:getCardIds{Player.Hand})
local candis2 = {}
if #from:getCardIds{Player.Equip,Player.Hand} > 0 then
for _, cid in ipairs(from:getCardIds{Player.Equip,Player.Hand}) do
if Fk:getCardById(cid).suit == Fk:getCardById(cardsc[1]).suit then
table.insert(candis2,cid)
end
end
end
if #candis2 > 0 then
room:moveCards({
ids = candis2,
from = from.id,
toArea = Card.DiscardPile,
moveReason = fk.ReasonDiscard,
skillName = self.name,
proposer = player.id
})
end
else
room:damage{
from = player,
to = from,
damage = 1,
skillName = self.name,
}
end
end
end
}
local tyj__qingjian = fk.CreateTriggerSkill{
events={fk.AfterCardsMove},
name="tyj__qingjian",
times = function(self)
return 1 - Self:usedSkillTimes(self.name, Player.HistoryTurn)
end,
can_trigger = function (self, event, target, player, data)
if player:hasSkill(self) and player:usedSkillTimes(self.name, Player.HistoryTurn) == 0 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 then
return true
end
end
end
end
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
if event == fk.AfterCardsMove then
local num = 0
for _, move in ipairs(data) do
if #move.moveInfo>0 then
if move.proposer and move.proposer == player.id and move.moveReason == fk.ReasonDiscard then
num = num+#move.moveInfo
end
end
end
num =math.min(5,num)
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.ReasonUse 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 < num then return end
local get = {}
if #ids > num then
get = room:askForCardsChosen(player, player, num, num, {
card_data = {
{ "pile_discard", ids }
}
}, self.name, "tyj__qingjian_pickcard:::" .. num )
else
get = ids
end
if #get == num then
room:askForYiji(player, get, nil, self.name, #get, #get,"tyj__qingjian_fenpei:::"..#get, get)
end
end
end,
}
tyj__xiahoudun:addSkill(tyj__ganglie)
tyj__xiahoudun:addSkill(tyj__qingjian)
Fk:loadTranslationTable{
["tyj__ganglie"]="刚烈",
[":tyj__ganglie"]="你受到1点伤害后,可以弃置你或牌堆顶的一张牌,令伤害来源选择一项:1.若其手牌中有与此牌花色相同的牌,其展示手牌,令你弃置其所有此花色的牌;2.你对其造成1点伤害。",
["#tyj__ganglie_dis"]="其弃置你花色相同的牌",
["#tyj__ganglie_damage"]="受到1点伤害",
["tyj__qingjian"]="清俭",
[":tyj__qingjian"]="每回合限一次,有牌被你弃置后,你可以分配等量张本回合不因使用进入弃牌堆牌(至多五张)。",
["tyj__qingjian_pickcard"]="清俭:选择要分配的 %arg 张牌",
["tyj__qingjian_fenpei"]="清俭:将这 %arg 张牌分配给任意角色",
["$tyj__ganglie1"]="怎能被这点小伤吓倒?",
["$tyj__ganglie2"]="血债,要用血来偿!",
["$tyj__qingjian1"]="俭以养德,屯田戍兵。",
["$tyj__qingjian2"]="粥饭供三餐之用,无需酒肉。",
["~tyj__xiahoudun"]="看不到曹公的江山了...",
}
local tyj__zuoci = General:new(extension, "tyj__zuoci", "qun", 3,3)
Fk:loadTranslationTable{
["tyj__zuoci"] = "左慈",
["#tyj__zuoci"] = "道衍万态",
["designer:tyj__zuoci"] = "汤圆",
["cv:tyj__zuoci"] = "官方",
["illustrator:tyj__zuoci"] = "alien",
}
local tyj__yanxing_huashen = fk.CreateTriggerSkill{
name = "#tyj__yanxing_huashen",
anim_type = "special",
mute = true,
events = {fk.GameStart,fk.AfterSkillEffect},
frequency = Skill.Compulsory,
can_trigger = function(self, event, target, player, data)
if player:hasSkill("tyj__yanxing") then
if event == fk.AfterSkillEffect then
if target == player and player:getMark("@tyj__yanxing_skill")~=0 and data and data.name and data.name~=nil then
if data.name == player:getMark("@tyj__yanxing_skill") then
return true
else
local skillx = Fk.skills[player:getMark("@tyj__yanxing_skill")]
if skillx.related_skills and skillx.related_skills~=nil and #skillx.related_skills>0 then
for _, sk in ipairs(skillx.related_skills) do
if sk.name and sk.name == data.name or (sk == data) then
return true
end
end
end
end
end
else
return true
end
end
end,
on_cost = Util.TrueFunc,
on_use = function(self, event, target, player, data)
local room = player.room
room:notifySkillInvoked(player,"tyj__yanxing")
player:broadcastSkillInvoke("tyj__yanxing", -1)
if player:getMark("@tyj__yanxing_skill")~=0 and type(player:getMark("@tyj__yanxing_skill")) == "string" then
room:handleAddLoseSkills(player, "-"..player:getMark("@tyj__yanxing_skill"),nil,true,false)
room:setPlayerMark(player,"@tyj__yanxing_skill",0)
end
local getnum = 2
getnum = getnum+player:getMark("@tyj__fupo_addnum")
local extragen = player:getTableMark("@&tyj__fupo_extra")
local generalsx = table.filter(room.general_pile, function (name)
return not table.contains(extragen, name)
end)
local generals = table.random(generalsx,getnum)
if #extragen> 0 then
for _, i in ipairs(extragen) do
table.insertIfNeed(generals,i)
end
room:setPlayerMark(player,"@&tyj__fupo_extra",0)
end
if #generals == 0 then return end
local default = {}
local skillList = {}
for _, g in ipairs(generals) do
local general = Fk.generals[g]
local skills = {}
for _, skillName in ipairs(general:getSkillNameList()) do
local s = Fk.skills[skillName]
if not (s.lordSkill) and #s.attachedKingdom == 0 then
table.insert(skills, skillName)
if #default == 0 then
default = {g, skillName}
end
end
end
table.insert(skillList, skills)
end
local result = room:askForCustomDialog(
player, "tyj__yanxing",
"packages/tyj/qml/ChooseSkillFromGeneralBox.qml",
{ generals, skillList, "衍形:选择其中一个技能获得" }
)
if result == "" then
if #default == 0 then return end
result = default
else
result = json.decode(result)
end
local generalName, skill = table.unpack(result)
room:handleAddLoseSkills(player, skill)
room:setPlayerMark(player,"@tyj__yanxing_skill",skill)
local ogeneral = player.general
player.general = generalName
room:broadcastProperty(player, "general")
player:broadcastSkillInvoke(skill, -1)
room:delay(1350)
player.general = ogeneral
room:broadcastProperty(player, "general")
room:delay(500)
end,
}
local tyj__yanxing = fk.CreateActiveSkill{
name = "tyj__yanxing",
anim_type = "special",
target_num = 0,
prompt = "是否视为发动〖衍形〗?",
times = function(self)
return Self.phase == Player.Play and 1 - Self:usedSkillTimes(self.name, Player.HistoryPhase) or -1
end,
frequency = Skill.Compulsory,
card_filter = function(self, to_select, selected)
return false
end,
can_use = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
tyj__yanxing_huashen:use(fk.AskForCardUse, player, player, {})
end,
}
local tyj__fupo = fk.CreateTriggerSkill{
name = "tyj__fupo",
events = {fk.AfterDying,fk.EnterDying},
can_trigger = function (self, event, target, player, data)
if player:hasSkill(self) then
if event == fk.AfterDying then
return target == player and player:isAlive() and player:getMark("@tyj__fupo_addnum")<3
else
return target~=player and ((target.general and target.general ~= nil and target.general ~="" and not table.contains(player:getTableMark("@&tyj__fupo_extra"),target.general))or (target.deputyGeneral and target.deputyGeneral ~= nil and target.deputyGeneral ~= "" and not table.contains(player:getTableMark("@&tyj__fupo_extra"),target.deputyGeneral)))
end
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
if event == fk.AfterDying then
local mark = player:getMark("@tyj__fupo_addnum")
mark = mark+1
room:setPlayerMark(player,"@tyj__fupo_addnum",mark)
else
if target.general and target.general ~= nil and target.general ~="" and not table.contains(player:getTableMark("@&tyj__fupo_extra"),target.general) then
local mark = player:getTableMark("@&tyj__fupo_extra")
table.insertIfNeed(mark,target.general)
room:setPlayerMark(player,"@&tyj__fupo_extra",mark)
end
if target.deputyGeneral and target.deputyGeneral ~=nil and target.deputyGeneral ~= "" and not table.contains(player:getTableMark("@&tyj__fupo_extra"),target.deputyGeneral) then
local mark = player:getTableMark("@&tyj__fupo_extra")
table.insertIfNeed(mark,target.deputyGeneral)
room:setPlayerMark(player,"@&tyj__fupo_extra",mark)
end
end
end,
}
tyj__yanxing:addRelatedSkill(tyj__yanxing_huashen)
tyj__zuoci:addSkill(tyj__yanxing)
tyj__zuoci:addSkill(tyj__fupo)
Fk:loadTranslationTable{
["tyj__yanxing"]="衍形",
["#tyj__yanxing_huashen"]="衍形",
[":tyj__yanxing"]="锁定技,游戏开始时,你失去因〖衍形〗获得的技能并随机观看两张武将牌,选择其中一张上的一个技能获得。出牌阶段限一次,或你发动因〖衍形〗获得的技能后,你视为发动〖衍形〗。",
["tyj__yanxing_re"]="衍形",
[":tyj__yanxing_re"]="锁定技,游戏开始时,你失去因〖衍形〗获得的技能并观看场上每个势力的各一张武将牌,选择其中一张上的一个技能获得。出牌阶段限一次,或你发动因〖衍形〗获得的技能后,你视为发动〖衍形〗。",
[":#tyj__yanxing_huashen"]="锁定技,游戏开始时,你失去因〖衍形〗获得的技能并随机观看两张武将牌,选择其中一张上的一个技能获得。出牌阶段限一次,或你发动因〖衍形〗获得的技能后,你视为发动〖衍形〗。",
["tyj__fupo_re"]="俘魄",
[":tyj__fupo_re"]="你脱离濒死后,可令〖衍形〗观看一个势力的武将牌数+1(至多加至3)。其他角色进入濒死时,你下次发动〖衍形〗额外观看其的武将牌。",
["@tyj__yanxing_skill"]="衍形技能",
["tyj__fupo"]="俘魄",
[":tyj__fupo"]="你脱离濒死后,〖衍形〗观看的武将牌数+1(至多加至5)。其他角色进入濒死时,你下次发动〖衍形〗额外观看其的武将牌。",
["@tyj__fupo_addnum"]="俘魄",
["@&tyj__fupo_extra"]="俘魄额外",
["$tyj__yanxing1"]="一念思量,化身无数。",
["$tyj__yanxing2"]="性本如空,化身万千。",
["$tyj__fupo1"]="新生之犊,无求其故。",
["$tyj__fupo2"]="醍醐灌顶,如临新生。",
["~tyj__zuoci"]="道家,不入轮回。",
}
local tyj__lingtong = General:new(extension, "tyj__lingtong", "wu", 4,4)
Fk:loadTranslationTable{
["tyj__lingtong"] = "凌统",
["#tyj__lingtong"] = "豪情烈胆",
["designer:tyj__lingtong"] = "汤圆",
["cv:tyj__lingtong"] = "官方",
["illustrator:tyj__lingtong"] = "第七个桔子",
}
local tyj__xuanfeng = fk.CreateTriggerSkill{
events={fk.AfterCardsMove},
name="tyj__xuanfeng",
triggertype="",
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 and #move.moveInfo and #move.moveInfo==3 then
return true
end
if #move.moveInfo>0 then
if move.proposer and move.proposer == player.id and move.moveReason == fk.ReasonDiscard then
local num = 0
for _, info in ipairs(move.moveInfo) do
if (info.fromArea == Card.PlayerHand ) then
num=num+1
end
end
if num == 2 then
return true
end
end
if move.from and move.from == player.id then
for _, info in ipairs(move.moveInfo) do
if table.contains({Card.PlayerEquip,Card.PlayerJudge},info.fromArea) then
return true
end
end
end
end
end
end
end
end,
on_trigger= function (self, event, target, player, data)
for _, move in ipairs(data) do
if move.to == player.id and move.toArea == Player.Hand and move.moveReason == fk.ReasonDraw and #move.moveInfo and #move.moveInfo==3 then
self.triggertype="lose"
self:doCost(event, target, player, data)
end
if #move.moveInfo>0 then
if move.from and move.from == player.id then
for _, info in ipairs(move.moveInfo) do
if table.contains({Card.PlayerEquip,Card.PlayerJudge},info.fromArea) then
self.triggertype="dis"
self:doCost(event, target, player, data)
end
end
end
if move.proposer and move.proposer == player.id and move.moveReason == fk.ReasonDiscard then
local num = 0
for _, info in ipairs(move.moveInfo) do
if (info.fromArea == Card.PlayerHand ) then
num = num+1
end
end
if num == 2 then
self.triggertype="draw"
self:doCost(event, target, player, data)
end
end
end
end
end,
on_cost = function (self, event, target, player, data)
local room = player.room
local tos = {}
self.cost_data = {}
table.insert(self.cost_data,self.triggertype)
self.triggertype=""
if self.cost_data[1] == "lose" then
for _, p in ipairs(room.alive_players) do
if #p:getCardIds{Player.Equip, Player.Judge} > 0 then table.insert(tos,p.id) end
end
elseif self.cost_data[1] == "dis" then
for _, p in ipairs(room.alive_players) do
if #p:getCardIds{Player.Hand} > 1 then table.insert(tos,p.id) end
end
elseif self.cost_data[1] == "draw" then
for _, p in ipairs(room.alive_players) do
table.insert(tos,p.id)
end
end
if #tos >0 then
local p2 = room:askForChoosePlayers(player, tos, 1, 1, "#tyj__xuanfeng_"..self.cost_data[1], self.name, true)
if #p2 ~= 0 then
table.insert(self.cost_data,p2[1])
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 >1 then
local to = room:getPlayerById(self.cost_data[2])
if self.cost_data[1] == "dis" then
if #to:getCardIds{Player.Hand} >1 then
room:askForDiscard(to, 2, 2, false, self.name, false,nil,"旋风:你需弃置两张手牌",false)
end
elseif self.cost_data[1] == "draw" then
to:drawCards(3,self.name)
elseif self.cost_data[1] == "lose" then
if #to:getCardIds{Player.Equip,Player.Judge} >0 then
local card = room:askForCardChosen(to, to, "ej", self.name,"旋风:你需将你场上的一张牌置入弃牌堆")
room:moveCardTo(card, Card.DiscardPile, nil, fk.ReasonPutIntoDiscardPile, self.name,nil,nil,to.id)
end
end
end
end,
}
tyj__lingtong:addSkill(tyj__xuanfeng)
Fk:loadTranslationTable{
["tyj__xuanfeng"]="旋风",
[":tyj__xuanfeng"]="你执行以下一项后,可以令一名角色执行下一项:①失去场上的一张牌;②弃置两张手牌;③摸三张牌(③的下一项为①)。<br/><font color='grey'>“失去场上的一张牌”被执行时的效果为“将场上的一张牌置入弃牌堆”</font>",
["#tyj__xuanfeng_dis"]="是否发动 旋风 令一名角色弃置两张手牌?",
["#tyj__xuanfeng_lose"]="是否发动 旋风 令一名角色将自己场上的一张牌置于弃牌堆?",
["#tyj__xuanfeng_draw"]="是否发动 旋风 令一名角色摸三张牌?",
["$tyj__xuanfeng1"]="短兵相接,教尔等片甲不留。",
["$tyj__xuanfeng2"]="急军先行,斩将,夺城,再败军。",
["~tyj__lingtong"]="公绩之犬子,就托于主公了。",
}
local tyj__zhuran = General:new(extension, "tyj__zhuran", "wu", 4,4)
Fk:loadTranslationTable{
["tyj__zhuran"] = "朱然",
["#tyj__zhuran"] = "胆镇无惧",
["designer:tyj__zhuran"] = "汤圆",
["cv:tyj__zhuran"] = "官方",
["illustrator:tyj__zhuran"] = "秋呆呆",
}
local tyj__danshou = fk.CreateTriggerSkill{
name = "tyj__danshou",
events = {fk.CardUseFinished},
can_trigger = function (self, event, target, player, data)
if player:hasSkill(self) then
return data.tos and table.contains(TargetGroup:getRealTargets(data.tos),player.id)
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
player:drawCards(1,self.name)
room:setPlayerMark(player,"@@tyj__danshou_effect-turn",1)
end
}
local tyj__danshou_prohibit = fk.CreateProhibitSkill{
name = "#tyj__danshou_prohibit",
prohibit_use = function(self, player, card)
return player:getMark("@@tyj__danshou_effect-turn")~=0
end,
prohibit_discard = function(self, player, card)
return player:getMark("@@tyj__danshou_effect-turn")~=0
end,
}
tyj__danshou:addRelatedSkill(tyj__danshou_prohibit)
tyj__zhuran:addSkill(tyj__danshou)
Fk:loadTranslationTable{
["tyj__danshou"]="胆守",
[":tyj__danshou"]="有角色使用牌后,若此牌目标包含你,你可以摸一张牌,令你本回合不能再使用或弃置牌。",
["#tyj__danshou_prohibit"]="胆守",
["@@tyj__danshou_effect-turn"]="胆守",
["$tyj__danshou1"]="临机胆定,不动如山。",
["$tyj__danshou2"]="一切就此结束。",
["~tyj__zhuran"]="义封一生,不负国家。"
}
local tyj__xiahoujie = General:new(extension, "tyj__xiahoujie", "wei", 5,5)
Fk:loadTranslationTable{
["tyj__xiahoujie"] = "夏侯杰",
["#tyj__xiahoujie"] = "当阳虎胆",
["designer:tyj__xiahoujie"] = "汤圆",
["cv:tyj__xiahoujie"] = "官方",
["illustrator:tyj__xiahoujie"] = "君桓文化",
}
local tyj__liedan = fk.CreateTriggerSkill{
events = {fk.SkillEffect},
name="tyj__liedan",
anim_type = "drawcard",
can_trigger = function (self, event, target, player, data)
if player:hasSkill(self) then
local tag = player.room.tag["tyj_firstSkillTriggeredInTurn"] or {}
return data.tyj__firstSkillTriggeredInTurn and data.tyj__firstSkillTriggeredInTurn ==1 and #tag>1 and tag[1]==data.name
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
player:drawCards(1)
room:setPlayerMark(player,"@tyj__liedan_skill-turn",data.name)
end,
refresh_events = {fk.SkillEffect,fk.AfterTurnEnd,fk.AfterSkillEffect},
can_refresh = function (self, event, target, player, data)
local room = player.room
local tag = room.tag["tyj_firstSkillTriggeredInTurn"] or {}
if target == player then
if event == fk.SkillEffect then
if not data.name:startsWith("#") and target:hasSkill(data.name,true,true) then
if #tag>0 then
return #tag>1 and tag[1]==data.name
else
return #tag==0
end
end
elseif event == fk.AfterTurnEnd then
return #tag>0
end
end
if event == fk.AfterSkillEffect then
return player:getMark("@tyj__liedan_skill-turn")~=0 and player:getMark("@tyj__liedan_skill-turn") == data.name and data.tyj__firstSkillTriggeredInTurn and ((data.tyj__firstSkillTriggeredInTurn == 2)or(data.tyj__firstSkillTriggeredInTurn == 3))
end
end,
on_refresh = function (self, event, target, player, data)
local room = player.room
local tag = room.tag["tyj_firstSkillTriggeredInTurn"] or {}
if event == fk.SkillEffect then
if #tag>0 then
room.tag["tyj_firstSkillTriggeredInTurn"][2]=room.tag["tyj_firstSkillTriggeredInTurn"][2]+1
data.tyj__firstSkillTriggeredInTurn = room.tag["tyj_firstSkillTriggeredInTurn"][2]
elseif #tag==0 then
room.tag["tyj_firstSkillTriggeredInTurn"]={data.name,1}
data.tyj__firstSkillTriggeredInTurn = room.tag["tyj_firstSkillTriggeredInTurn"][2]
end
elseif event == fk.AfterTurnEnd then
room.tag["tyj_firstSkillTriggeredInTurn"]={}
elseif event == fk.AfterSkillEffect then
if data.tyj__firstSkillTriggeredInTurn == 2 then
room:notifySkillInvoked(player,self.name,"negative")
player:broadcastSkillInvoke(self.name,-1)
room:askForDiscard(player, 2, 2,true, self.name, false,nil,"裂胆:你需弃置两张手牌",false)
else
room:notifySkillInvoked(player,self.name,"negative")
player:broadcastSkillInvoke(self.name,-1)
room:loseHp(player,3,self.name)
end
end
end,
}
tyj__xiahoujie:addSkill(tyj__liedan)
Fk:loadTranslationTable{
["tyj__liedan"]="裂胆",
[":tyj__liedan"]="每回合首次有技能被发动时,你可以摸一张牌。若如此做,其本回合第二次被发动后,你弃置两张牌;其本回合第三次被发动后,你失去3点体力。",
["@tyj__liedan_skill-turn"]="裂胆",
["tyj__yishi"]="倚势",
[":tyj__yishi"]="锁定技,你每回合发动〖裂胆〗的前X次效果改为重铸一张牌(X为你手牌数、体力值、装备区内牌数中为全场最大的数量)。",
["$tyj__liedan1"]="百万大军之中,你还能取我首级不成!",
["$tyj__liedan2"]="你要战,我便战!我有兄弟千千万!",
["$tyj__liedan3"]="麾下健儿跺脚,可叫你江东地动山摇!",
["$tyj__liedan4"]="百万之众为盾,你能奈我何?",
["~tyj__xiahoujie"]="啊,我的心肝呀。",
}
local tyj__lijue = General:new(extension, "tyj__lijue", "qun", 4,4)
--tyj__lijue.shield = 1
Fk:loadTranslationTable{
["tyj__lijue"] = "李傕",
["#tyj__lijue"] = "侍暴凶篡",
["designer:tyj__lijue"] = "汤圆",
["cv:tyj__lijue"] = "官方",
["illustrator:tyj__lijue"] = "凝聚永恒",
}
local tyj__xiongsuan_active = fk.CreateActiveSkill{
name = "tyj__xiongsuan_active",
anim_type = "offensive",
card_num = 0,
target_num = 1,
card_filter = Util.FalseFunc,
prompt = function (self, selected, selected_cards)
return "#tyj__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}--]]
return UI.Spin{
from = 1,
to = Self.hp,
}
end,
--[[name = "tyj__xiongsuan_active",
anim_type = "offensive",
card_num =0,
target_num = 1,
prompt = function (self, selected, selected_cards)
return "#tyj__xiongsuan-invoke:::" .. Self.hp
end,
target_filter = function(self, to_select, selected)
return #selected == 0
end,
interaction = function()
return UI.Spin{
from = 0,
to = Self.hp,
}
end--]]
}
Fk:addSkill(tyj__xiongsuan_active)
local tyj__xiongsuan = fk.CreateTriggerSkill{
name="tyj__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__xiongsuan_active", "#tyj__xiongsuan-invoke:::"..player.hp, true)
if success then
local choose = {}
local totalnum = tonumber(dat.interaction)
for i = 0, totalnum, 1 do
table.insert(choose, tostring(i))
end
local result = room:askForChoice(player ,choose, self.name,"#tyj__xiongsuan_fenpei-invoke::"..dat.targets[1],false)
if result then
local tonum = tonumber(result)
local mynum = totalnum-tonum
self.cost_data = {dat.targets[1],{tonum,mynum}}
end
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
local reverse = false
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__xiongsuan_target-recover"}
if #targetx:getCardIds('he')>0 then
canpick = {"#tyj__xiongsuan_target-give","#tyj__xiongsuan_target-recover"}
end
local result = room:askForChoice(targetx ,canpick, self.name,"#tyj__xiongsuan_target-invoke:::"..player.hp,true,{"#tyj__xiongsuan_target-give","#tyj__xiongsuan_target-recover"})
if result then
if result == "#tyj__xiongsuan_target-give" then
local cards = targetx:getCardIds("he")
if #cards > 0 then
cards = room:askForCard(targetx, 1, #cards, true, self.name, false, ".", "#tyj__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)
reverse = true
end
else
local mark = player:getMark("@tyj__xiongsuan_recover-turn")
mark = mark+self.cost_data[2][1]
room:setPlayerMark(player,"@tyj__xiongsuan_recover-turn",mark)
local mark = targetx:getMark("@tyj__xiongsuan_recover-turn")
mark = mark+self.cost_data[2][1]
room:setPlayerMark(targetx,"@tyj__xiongsuan_recover-turn",mark)
end
end
player:chat("我要砸你"..tostring(self.cost_data[2][1]).."点血!我砸我自己"..tostring(self.cost_data[2][2]).."点血!")
room:delay(1500)
local tonum =self.cost_data[2][1]
local mynum =self.cost_data[2][2]
if reverse == true then
tonum =self.cost_data[2][2]
mynum =self.cost_data[2][1]
end
room:damage{
from = player,
to = targetx,
damage = tonum,
skillName = self.name,
}
room:damage{
from = player,
to = player,
damage = mynum,
skillName = self.name,
}
end
end,
refresh_events = {fk.TurnEnd},
can_refresh = function (self, event, target, player, data)
return player:getMark("@tyj__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__xiongsuan_recover-turn")
if player:isWounded() then
room:recover({
who = player,
num = mark,
recoverBy = player,
skillName = self.name
})
end
end,
}
local tyj__fanshi = fk.CreateActiveSkill{
name = "tyj__fanshi",
anim_type = "control",
frequency = Skill.Limited,
prompt = function ()
return "#tyj__fanshi-active:::" .. #Self:getCardIds('h') .. ":" .. Self.hp
end,
card_num = 0,
target_num = 0,
can_use = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryGame) == 0 and #player:getCardIds('h')~=player.hp
end,
card_filter = Util.FalseFunc,
target_filter = Util.FalseFunc,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
local cardn = #player:getCardIds('h')
local hpn = player.hp
local cardn2 = cardn
local hpn2 = hpn
local n = cardn2 - hpn2
if n > 0 then
room:askForDiscard(player, n, n, false, self.name, false)
else
player:drawCards(-n, self.name)
end
player.hp = math.min(player.maxHp,cardn2)
room:broadcastProperty(player, "hp")
if player.hp <= 0 then
local dyingStruct = {
who = player.id,
}
player.room:enterDying(dyingStruct)
end
--room:setPlayerMark(player,"@@tyj__fanshi",1)
end,
}
local tyj__fanshi_back = fk.CreateTriggerSkill{
name="#tyj__fanshi_back",
anim_type = "special",
refresh_events = {fk.Deathed},
can_refresh = function(self, event, target, player, data)
return player:getMark("@@tyj__fanshi")~=0 and data.damage and data.damage.from == player
end,
on_refresh = function(self, event, target, player, data)
local room = player.room
room:setPlayerMark(player,"@@tyj__fanshi",0)
end,
}
tyj__lijue:addSkill(tyj__xiongsuan)
--tyj__fanshi:addRelatedSkill(tyj__fanshi_back)
--tyj__lijue:addSkill(tyj__fanshi)
Fk:loadTranslationTable{
--["tyj__xiongsuan"]="凶算",
-- [":tyj__xiongsuan"]="准备阶段,你可以秘密选择一个至多为你的体力值的自然数,然后对一名其他角色造成等量点伤害。你在公布伤害值前令其选择一项:1.交给你任意张牌以将的等量点伤害转移给你;2.本回合结束时回复伤害值点体力。",
["tyj__xiongsuan"]="凶算",
[":tyj__xiongsuan"]="准备阶段,你可以秘密分配至多你的体力值点伤害给你与一名其他角色。你在公布分配的伤害值前令其选择一项:1.交给你任意张牌以交换分配的伤害值;2.本回合结束时与你各回复其被分配的伤害值点体力。",
["tyj__fanshi"]="谲势",
[":tyj__fanshi"]="限定技,出牌阶段,你可以交换体力值与手牌数。",
["#tyj__fanshi-active"] = "发动 谲势,将体力值调整为%arg;将手牌数调整为%arg2",
["#tyj__xiongsuan_fenpei-invoke"]="凶算:选择分配给 %dest 的伤害值,剩余的伤害值将分配给你。",
["@@tyj__fanshi"]="谲势失效",
["$tyj__fanshi1"]="狡狐着悍狼之铠,智堪运筹、威慑千军。",
["$tyj__fanshi2"]="没有点算计,怎能立于乱世。",
["$tyj__xiongsuan1"]="彭越挠楚,奉先可击。",
["$tyj__xiongsuan2"]="分兵多路,首尾不能互应。",
["~tyj__lijue"]="曹贼,你竟灭我三族!",
["@tyj__xiongsuan_recover-turn"]="凶算回复",
["tyj__xiongsuan_active"]="凶算",
["#tyj__xiongsuan-invoke"]="凶算:选择一个至多为 %arg 的正整数,作为伤害分配你与一名其他角色。",
["#tyj__xiongsuan_target-invoke"]="凶算:你即将受到至多 %arg 点伤害,你须选择以下一项",
["#tyj__xiongsuan_target-give"]="交出牌",
[":#tyj__xiongsuan_target-give"]="交给对方任意张牌,交换你们被分配的伤害值。",
["#tyj__xiongsuan_target-recover"]="回复体力",
[":#tyj__xiongsuan_target-recover"]="本回合结束时,回复受到的伤害值点体力。",
["#tyj__xiongsuan-give"] = "凶算:选择至少一张牌交给 %dest",
["#tyj__xiongsuan_say"]="我要砸你 %arg 点血!",
}
Fk:loadTranslationTable{
["tyj__jingce"]="精策",
[":tyj__jingce"]="你从牌堆获得牌后,或受到伤害后,将牌堆底的一张牌置于武将牌上称为“策”。每回合结束时,你可选择一项:1.用任意张牌替换等量张“策”;2.移去任意张“策”,将手牌数调整至等量张。",
}
Fk:loadTranslationTable{
["tyj__hulie"]="虎烈",
[":tyj__hulie"]="每回合每种牌名限一次,你使用【杀】或【决斗】,亦或是成为它们的目标时,可以令此牌伤害基数+1。此牌结算后,你可令一名未受到伤害的目标视为对使用者使用【决斗】。",
["tyj__yipo"]="毅魄",
[":tyj__tipo"]="你的体力首次变化至一个值后,可以选择一项令一名其他角色执行:1.摸X张牌,弃一张牌;2.摸一张牌,弃X张牌(X为你的已损体力值)。",
}
Fk:loadTranslationTable{
["tyj__quanji"]="权计",
[":tyj__quanji"]="你受到伤害后,或使用牌对唯一目标造成伤害后,可以将受伤角色的一张牌置于你的武将牌称为“权”,然后你们中手牌较少的一方摸一张牌。你的手牌上限+X(X为你的“权”数)。",
["tyj__zili"]="自立",
[":tyj__zili"]="觉醒技,准备阶段,若你的手牌上限为全场唯一最大,你减1点体力上限,摸两张牌或回复1点体力,然后获得〖排异〗。",
["tyj__paiyi"]="排异",
[":tyj__paiyi"]="出牌阶段限一次,你可以移去一张“权”,令一名角色将手牌数向上限调整两张,若其手牌数不小于你,你可对其造成1点伤害。",
}
local guanweipool = {
---@param player ServerPlayer
---@param room Room
["ex__zhiheng"]= function (room,player)
return 1+(#player:getCardIds("he")*0.4)
end,
---@param player ServerPlayer
---@param room Room
["ex__rende"]= function (room,player)
local num = 0
if #player:getCardIds("h")>0 then
num= num+ 0.1
end
if #player:getCardIds("h")>1 then
num= num+ 1.2
end
if #player:getCardIds("h")> player:getMaxCards() then
num = num+((#player:getCardIds("h")- player:getMaxCards())*0.2)
end
return num
end,
---@param player ServerPlayer
---@param room Room
["ex__yijue"]= function (room,player)
if #table.filter(room.alive_players,function(p) return p~=player and #p:getCardIds('h')>0 end)>0 then
return 1
end
return 0
end,
---@param player ServerPlayer
---@param room Room
["ex__wusheng"]= function (room,player)
local num = 0
local reds = table.filter(player:getCardIds("h"), function(id) return Fk:getCardById(id).color == Card.Red end)
if #reds == 0 then return 0 end
if #table.filter(U.GetEnemies(room,player),function(p) return player:canUseTo(Fk:cloneCard("slash"),p) end)>0 then
num = num+1
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 #reds*0.9 end
end
end
return num
end,
---@param player ServerPlayer
---@param room Room
["ex__paoxiao"]= function (room,player)
local num = 0
local reds = table.filter(player:getCardIds("h"), function(id) return Fk:getCardById(id).trueName == "slash" end)
local can = false
if #reds == 0 then return 0 end
if #table.filter(U.GetEnemies(room,player),function(p) return player:canUseTo(Fk:cloneCard("slash"),p) end)>0 then
num = num+1
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 can = true break end
end
if can == true then
num= num + (reds*0.3)
else
num= num + (reds*0.9)
end
end
return num
end,
---@param player ServerPlayer
---@param room Room
["ex__longdan"]= function (room,player)
local num = 0
local reds = table.filter(player:getCardIds("h"), function(id) return Fk:getCardById(id).trueName == "jink" end)
if #reds == 0 then return 0 end
if #table.filter(U.GetEnemies(room,player),function(p) return player:canUseTo(Fk:cloneCard("slash"),p) end)>0 then
num = num+1
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 #reds*0.9 end
end
end
return num
end,
---@param player ServerPlayer
---@param room Room
["ex__tieji"]= function (room,player)
local num = 0
local reds = table.filter(player:getCardIds("h"), function(id) return Fk:getCardById(id).trueName == "slash" end)
if #reds == 0 then return 0 end
if #table.filter(U.GetEnemies(room,player),function(p) return player:canUseTo(Fk:cloneCard("slash"),p) end)>0 then
num = num+2
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 #reds*0.3 end
end
end
return num
end,
---@param player ServerPlayer
---@param room Room
["ex__jizhi"]= function (room,player)
local num = 0
local reds = table.filter(player:getCardIds("h"), function(id) return Fk:getCardById(id).type == Card.TypeTrick end)
if #reds == 0 then return 0 end
return #reds * 0.8
end,
---@param player ServerPlayer
---@param room Room
["ex__jianyan"]= function (room,player)
if #table.filter(U.GetFriends(room,player),function(p) return p:isMale() end)>0 then
return 1.5
end
end,
---@param player ServerPlayer
---@param room Room
["jiyuan"]= function (room,player)
return 1
end,
["gongxin"]= function (room,player)
return 1.1
end,
---@param player ServerPlayer
---@param room Room
["qixi"]= function (room,player)
local reds = table.filter(player:getCardIds("h"), function(id) return Fk:getCardById(id).color == Card.Black end)
if #reds == 0 then return 0 end
return #reds*0.45
end,
---@param player ServerPlayer
---@param room Room
["fanjian"]= function (room,player)
if #player:getCardIds("h")>0 then
return 1
end
return 0
end,
---@param player ServerPlayer
---@param room Room
["ex__guose"]= function (room,player)
local reds = table.filter(player:getCardIds("h"), function(id) return Fk:getCardById(id).suit == Card.Diamond end)
if #reds == 0 then return 0 end
local num = 1.5
for _, p in ipairs(U.GetEnemies(room,player)) do
local fakenum = 1.5
if p:getCardIds('h')>4 then
fakenum = fakenum*2
end
fakenum = fakenum+((#p:getCardIds("h")-p:getMaxCards())*0.35)
if fakenum > num then
num = fakenum
end
end
return num
end,
["ex__lianying"]= function (room,player)
local reds = table.filter(player:getCardIds("h"), function(id) return Fk:getCardById(id).suit == Card.Diamond end)
if #reds == 0 then return 0 end
local num = 1.5
for _, p in ipairs(U.GetEnemies(room,player)) do
local fakenum = 1.5
if p:getCardIds('h')>4 then
fakenum = fakenum*2
end
fakenum = fakenum+((#p:getCardIds("h")-p:getMaxCards())*0.35)
if fakenum > num then
num = fakenum
end
end
return num
end,
}
Fk:loadTranslationTable{
["tyj__guanwei"]="观微",
[":tyj__guanwei"]="出牌阶段限一次,你可以发现一个可以本出牌阶段内发动的完美的技能(范围:界标包,风火林山)并获得之直到本阶段结束。",
["tyj__gongqing"]="公清",
[":tyj__gongqing"]="锁定技,你造成或受到伤害时,若伤害来源的手牌数为全场最多,其须弃置一张手牌或令此伤害-1。若其在执行出牌阶段且其不为你,你可以对其发动〖观微〗。",
}
local tyj__shibao = General:new(extension, "tyj__shibao", "jin", 4,4)
Fk:loadTranslationTable{
["tyj__shibao"] = "石苞",
["#tyj__shibao"] = "乐陵郡公",
["designer:tyj__shibao"] = "汤圆",
["cv:tyj__shibao"] = "官方",
["illustrator:tyj__shibao"] = "凝聚永恒",
}
local tyj__zhuosheng = fk.CreateTriggerSkill{
name = "tyj__zhuosheng",
anim_type = "special",
events = {fk.TurnEnd},
can_trigger = function(self, event, target, player, data)
return player:hasSkill(self) and target == player and
not player:insideExtraTurn() and player:getMark("tyj__zhuosheng_gainturn-round")>0
end,
frequency = Skill.Compulsory,
on_use= function (self, event, target, player, data)
local room = player.room
room:setPlayerMark(player, "@tyj__zhuosheng_extra", player:getMark("tyj__zhuosheng_gainturn-round"))
end,
refresh_events = { fk.TurnEnd,fk.AfterTurnEnd,fk.RoundStart},
can_refresh = function(self, event, target, player, data)
if event == fk.TurnEnd then
return #player.room.logic:getActualDamageEvents(1, function(e) return e.data[1].from == player end) > 0
elseif event == fk.AfterTurnEnd then
return player:getMark("@tyj__zhuosheng_extra")>0
elseif event == fk.RoundStart then
return player:getMark("tyj__zhuosheng_track")>0
end
end,
on_refresh = function(self, event, target, player, data)
local room = player.room
if event == fk.TurnEnd then
local mark = player:getMark("tyj__zhuosheng_track")
mark = mark+1
room:setPlayerMark(player,"tyj__zhuosheng_track",mark)
elseif event == fk.AfterTurnEnd then
if player:getMark("@tyj__zhuosheng_extra") > 0 then
player:broadcastSkillInvoke(self.name)
room:notifySkillInvoked(player, self.name)
room:removePlayerMark(player,"@tyj__zhuosheng_extra", 1)
player:gainAnExtraTurn(true, self.name)
end
elseif event == fk.RoundStart then
room:setPlayerMark(player,"tyj__zhuosheng_gainturn-round",player:getMark("tyj__zhuosheng_track"))
room:setPlayerMark(player, "tyj__zhuosheng_track",0)
end
end,
}
tyj__shibao:addSkill(tyj__zhuosheng)
Fk:loadTranslationTable{
["tyj__zhuosheng"]="擢升",
[":tyj__zhuosheng"]="锁定技,你的额定回合结束时,你上一轮每于一个回合内造成过伤害,你便执行一个额外的回合。",
["@tyj__zhuosheng_extra"]="剩余回合",
["@tyj__zhuosheng_gainturn-round"]="擢升",
["$tyj__zhuosheng1"] = "才经世务,干用之绩。",
["$tyj__zhuosheng2"] = "器量之远,当至公辅。",
["~tyj__shibao"] = "寒门出身,难以擢升。",
}
local tyj__wenyang = General:new(extension, "tyj__wenyang", "wei", 4,4)
tyj__wenyang.subkingdom = "wu"
Fk:loadTranslationTable{
["tyj__wenyang"] = "文鸯",
["#tyj__wenyang"] = "叱阵如云",
["designer:tyj__wenyang"] = "汤圆",
["cv:tyj__wenyang"] = "官方",
["illustrator:tyj__wenyang"] = "鬼画府",
}
local tyj__chuifeng = fk.CreateActiveSkill{
name = "tyj__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 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 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__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__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,
}
local tyj__chizhen = fk.CreateTriggerSkill{
name = "tyj__chizhen",
anim_type = "special",
events = {fk.Damaged,fk.TurnEnd},
times = function(self)
return (7 - Self:getMark("tyj__chizhen_used-round")) or -1
end,
can_trigger = function (self, event, target, player, data)
if event == fk.TurnEnd then
return player:getMark("@tyj__chizhen_extraturn-turn")>0
else
return target == player and player:hasSkill(self) and player.hp == 1 and player:getMark("@tyj__chizhen_extraturn-turn")==0
end
end,
on_cost = function (self, event, target, player, data)
if event == fk.TurnEnd then
return true
else
return player.room:askForSkillInvoke(player,self.name)
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
if event == fk.TurnEnd then
local mark = player:getMark("tyj__chizhen_used-round")
mark = mark+1
room:setPlayerMark(player,"tyj__chizhen_used-round",mark)
player:gainAnExtraTurn(true, self.name)
else
room:setPlayerMark(player,"@tyj__chizhen_extraturn-turn",1)
end
end,
}
tyj__wenyang:addSkill(tyj__chuifeng)
tyj__wenyang:addSkill(tyj__chizhen)
Fk:loadTranslationTable{
["tyj__chuifeng"]="椎锋",
[":tyj__chuifeng"]="出牌阶段限一次,你可以将一名角色场上的一张牌当【决斗】使用,若不为你的牌,你不能响应此牌;若为武器牌,此牌伤害基数+1。",
["tyj__chizhen"]="叱阵",
[":tyj__chizhen"]="每轮限七次,你受到伤害后,若你的体力值为1,你可以于本回合结束后进行一个额外的回合。",
["@tyj__chizhen_extraturn-turn"]="已叱阵",
["#tyj__chuifeng-duel"]="椎锋:将 %dest 场上的一张牌当【决斗】使用。",
["#tyj__chuifeng-use"]="椎锋:请指定使用 %arg 的目标。",
["~tyj__wenyang"]="半生功业,而见疑于一家之言,岂能无怨!",
["$tyj__chuifeng1"]="率军冲锋,不惧刀枪所阻!",
["$tyj__chuifeng2"]="登锋履刃,何妨马革裹尸!",
["$tyj__chuifeng3"]="力摧敌阵,如视天光破云!",
["$tyj__chizhen1"]="狭路相逢,勇进者胜,怯战者亡!",
["$tyj__chizhen2"]="背水立阵仿韩信,破釜沉舟学霸王!",
}
local tyj__peixiu = General:new(extension, "tyj__peixiu", "jin", 3,3)
tyj__peixiu.subkingdom = "wei"
Fk:loadTranslationTable{
["tyj__peixiu"] = "裴秀",
["#tyj__peixiu"] = "尽揽万禹",
["designer:tyj__peixiu"] = "汤圆",
["cv:tyj__peixiu"] = "官方",
["illustrator:tyj__peixiu"] = "君桓文化",
}
local getNumber = function(ids)
if type(ids) == "number" then
return Fk:getCardById(ids).number
elseif type(ids) == "table" then
return table.map(ids, function(id)
return Fk:getCardById(id).number
end)
end
end
local isEqualDifferenceSeries = function(list, difference)
local dif = difference or 1
table.sort(list)
local n
for _, i in ipairs(list) do
if not n then
n = i
elseif i ~= n + dif then
return false
else
n = i
end
end
return true
end
local tyj__xingtu = fk.CreateViewAsSkill{
name = "tyj__xingtu",
anim_type = "drawcard",
pattern = "foresight",
enabled_at_play = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
end,
card_filter = function(self, to_select, selected)
return #selected <3 and Fk:currentRoom():getCardArea(to_select) == Player.Hand
end,
before_use = function (self, player, use)
local room = player.room
local cards = {}
local subcards = use.card.subcards
for _, p in ipairs(room.alive_players) do
for _, cid in ipairs(p:getCardIds('ej')) do
table.insertIfNeed(cards,cid)
end
end
if #subcards<3 then
local num = 3
num = num -#subcards
if #cards >= num then
local c = room:askForCardsChosen(player,player,num,num,{ card_data = { { "场上的可用牌", cards } } },self.name,"行图:选择场上的一张牌,将此牌与 "..Fk:getCardById(use.card.subcards[1]):toLogString().."和"..Fk:getCardById(use.card.subcards[2]):toLogString().."当【洞烛先机】使用")
if #c>0 then
use.card:addSubcards(c)
if player:prohibitUse(use.card) then return self.name end
end
else return self.name end
end
end,
after_use = function (self, player, use)
local room = player.room
local subcards = use.card.subcards
if isEqualDifferenceSeries(getNumber(subcards)) or isEqualDifferenceSeries(getNumber(subcards),1) or isEqualDifferenceSeries(getNumber(subcards),2) or isEqualDifferenceSeries(getNumber(subcards),3) or isEqualDifferenceSeries(getNumber(subcards),4) or isEqualDifferenceSeries(getNumber(subcards),5) or isEqualDifferenceSeries(getNumber(subcards),6) or isEqualDifferenceSeries(getNumber(subcards),7) then
local skills = table.filter(player.player_skills, function(s)
return s:isPlayerSkill(player)
end)
if #skills >0 then
local skillNames = table.map(skills, function(s)
return s.name
end)
local skill = room:askForChoice(player, skillNames, self.name, "行图:请重置一个技能")
if skill then
local sk = Fk.skills[skill]
room:setPlayerMark(player,"@recharge-"..sk.name,0)
if player:usedSkillTimes(skill, Player.HistoryGame) ~= 0 then
player:setSkillUseHistory(skill,0,Player.HistoryGame)
end
if player:usedSkillTimes(skill, Player.HistoryRound) ~= 0 then
player:setSkillUseHistory(skill,0,Player.HistoryRound)
end
if player:usedSkillTimes(skill, Player.HistoryPhase) ~= 0 then
player:setSkillUseHistory(skill,0,Player.HistoryPhase)
end
if player:usedSkillTimes(skill, Player.HistoryTurn) ~= 0 then
player:setSkillUseHistory(skill,0,Player.HistoryTurn)
end
end
end
end
end,
view_as = function(self, cards)
if (#cards <2) or (#cards>3) then return nil end
local card = Fk:cloneCard("foresight")
card:addSubcards(cards)
card.skillName = self.name
return card
end,
}
local tyj__kanyu = fk.CreateActiveSkill{
name = "tyj__kanyu",
prompt = "勘域:弃置两张牌并获得弃牌堆中点数为两张牌之和与两张牌之差的牌各一张",
anim_type = "drawcard",
max_phase_use_time = 1,
card_filter = function(self, to_select, selected)
return #selected < 2 and not Self:prohibitDiscard(Fk:getCardById(to_select))
end,
target_filter = Util.FalseFunc,
target_num = 0,
card_num = 2,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
room:throwCard(effect.cards, self.name, player, player)
local num1 = Fk:getCardById(effect.cards[1]).number
local num2 = Fk:getCardById(effect.cards[2]).number
local num3 = math.abs(num1+num2)
local num4 = math.abs(num1-num2)
local cards3 = {}
local cards4 = {}
for _, cid in ipairs(room.discard_pile) do
local c = Fk:getCardById(cid)
if c.number == num3 then
table.insertIfNeed(cards3,cid)
end
if c.number == num4 then
table.insertIfNeed(cards4,cid)
end
end
if #cards3>0 then
local get = room:askForCardsChosen(player, player,1,1, {
card_data = {
{ "pile_discard", cards3 }
}
}, self.name,"勘域:获得其中一张牌")
if #get>0 then
room:moveCardTo(get, Player.Hand, player, fk.ReasonJustMove, self.name, "", true, player.id)
end
end
if #cards4>0 then
local get = room:askForCardsChosen(player, player,1,1, {
card_data = {
{ "pile_discard", cards4 }
}
}, self.name,"勘域:获得其中一张牌")
if #get>0 then
room:moveCardTo(get, Player.Hand, player, fk.ReasonJustMove, self.name, "", true, player.id)
end
end
end
}
local tyj__jinglan = fk.CreateTriggerSkill{
events = {fk.EventPhaseStart},
name = "tyj__jinglan",
frequency = Skill.Limited,
can_trigger = function (self, event, target, player, data)
if player:hasSkill(self) and target == player and target.phase == Player.Finish and player:usedSkillTimes(self.name,Player.HistoryGame)==0 then
local number = {1,2,3,4,5,6,7,8,9,10,11,12,13}
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 table.contains(number,Fk:getCardById(info.cardId).number) then
table.removeOne(number,Fk:getCardById(info.cardId).number)
end
end
end
end
end
end, Player.HistoryTurn)
return #number == 0
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
local number = {1,2,3,4,5,6,7,8,9,10,11,12,13}
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 table.contains(number,Fk:getCardById(info.cardId).number) then
table.insertIfNeed(cards,info.cardId)
end
end
end
end
end
end, Player.HistoryTurn)
while #cards > 0 and not player.dead do
local use = U.askForUseRealCard(room, player, cards, nil, self.name, "尽览:使用中央区的一张牌", {expand_pile = cards}, true)
if not use then break end
table.removeOne(number, use.card.number)
room:useCard(use)
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 table.contains(number,Fk:getCardById(info.cardId).number) then
table.insertIfNeed(cards,info.cardId)
end
end
end
end
end
end, Player.HistoryTurn)
end
end,
}
tyj__jinglan.CenterArea = true
tyj__peixiu:addSkill(tyj__xingtu)
tyj__peixiu:addSkill(tyj__kanyu)
tyj__peixiu:addSkill(tyj__jinglan)
Fk:loadTranslationTable{
['tyj_centralarea'] = "其实就是本回合进入过弃牌堆,且仍在弃牌堆内的牌。",
["tyj__xingtu"]="行图",
[":tyj__xingtu"]="出牌阶段限一次,你可以将手牌和场上共计三张牌(至少两张手牌)当【洞烛先机】使用,若它们的点数组成等差数列,你重置一个技能。",
["tyj__kanyu"]="勘域",
[":tyj__kanyu"]="出牌阶段限一次,你可以弃置两张牌,获得弃牌堆中点数为两者之和与两者之差的牌各一张。",
["tyj__jinglan"]="尽览",
[":tyj__jinglan"]="限定技,结束阶段,若<a href='tyj_centralarea'>中央区</a>包含每种点数的牌,你可以使用<a href='tyj_centralarea'>中央区</a>每种点数的牌各一张。",
["#tyj__xingtu-pick"]="行图:请选择场上的 %arg 张牌",
["$tyj__xingtu1"]="制图之体有六,缺一不可言精。",
["$tyj__xingtu2"]="图设分率,则宇内地域皆可绘于一尺。",
["$tyj__kanyu1"]="辨广轮之度,正彼此之体,远近无所隐其形。",
["$tyj__kanyu2"]="地有六合,图有六体,可校其经纬。",
["$tyj__jinglan1"]="《周礼》有言,爵分公、侯、伯、子、男。",
["$tyj__jinglan2"]="复五等之爵,明尊卑之序。",
["~tyj__peixiu"] = "这酒,是冷的。",
}
return extension
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。