代码拉取完成,页面将自动刷新
local extension = Package:new("tyj_wow")
extension.extensionName = "tyj"
Fk:loadTranslationTable{
["tyj_wow"] = "汤圆魔兽将",
["tyj"]='汤圆精品包'
}
local U = require "packages/utility/utility"
local tyj_garrosh = General:new(extension, "tyj__garrosh", "shu", 4,4)
Fk:loadTranslationTable{
["tyj__garrosh"] = "加尔鲁什",
["#tyj__garrosh"] = "战歌督军",
["designer:tyj__garrosh"] = "汤圆",
["cv:tyj__garrosh"] = "暴雪官方",
["illustrator:tyj__garrosh"] = "Glowei",
}
local tyj__rongzhou = fk.CreateTriggerSkill{
name = "tyj__rongzhou",
anim_type = "defensive",
events = {fk.HpChanged,fk.Damaged},
mute = true,
frequency = Skill.Compulsory,
can_trigger = function (self, event, target, player, data)
if target == player and player:hasSkill(self) then
if event==fk.HpChanged then
return data.num and data.num~=0;
else return not player:isNude()
and data.extra_data and data.extra_data.tyj_rongzhou_juedou and data.extra_data.tyj_rongzhou_juedou==player end
end
end,
on_trigger = function (self, event, target, player, data)
local room = player.room
if event==fk.HpChanged then
local mark = player:getMark('tyj_rongzhou_count')
local num = math.abs(data.num)
mark=mark+num
if mark > 1 then
while (mark>1) and player:hasSkill(self) do
mark = mark-2
self:doCost(event,target,player,data)
end
end
room:setPlayerMark(player,'tyj_rongzhou_count',mark)
else
self:doCost(event,target,player,data)
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
if(event==fk.HpChanged) then
player:broadcastSkillInvoke(self.name,math.floor((math.random()*4)+1))
room:changeShield(player, 1);
else
local success, dat = player.room:askForUseViewAsSkill(player, "#tyj__rongzhou_active", "#tyj__rongzhou_viewas", true, {bypass_times = true})
if success then
room:notifySkillInvoked(player, self.name)
player:broadcastSkillInvoke(self.name,math.floor((math.random()*4)+5))
local card = Fk.skills["#tyj__rongzhou_active"]:viewAs(dat.cards)
local use = {from = player.id, tos = table.map(dat.targets, function(p) return {p} end), card = card}
room:useCard(use)
end
end
end,
refresh_events = {fk.HpChanged},
can_refresh = function (self, event, target, player, data)
return target == player and player.shield == 0 and data.reason == "damage" and data.shield_lost > 0;
end,
on_refresh = function (self, event, target, player, data)
local e = player.room.logic:getCurrentEvent():findParent(GameEvent.Damage)
if e then
local damage = e.data[1]
damage.extra_data = damage.extra_data or {}
damage.extra_data.tyj_rongzhou_juedou = player
end
end,
}
tyj_garrosh:addSkill(tyj__rongzhou)
local tyj__rongzhou_viewas = fk.CreateViewAsSkill{
name = "#tyj__rongzhou_active",
card_num = 1,
card_filter = function(self, to_select, selected)
return #selected == 0 and Fk:getCardById(to_select).type == Card.TypeEquip
end,
view_as = function(self, cards)
if #cards ~= 1 then return end
local card = Fk:cloneCard("duel")
card:addSubcard(cards[1])
card.skillName = "tyj__rongzhou"
return card
end,
}
Fk:addSkill(tyj__rongzhou_viewas)
local tyj__shixing = fk.CreateActiveSkill{
name = "tyj__shixing",
anim_type = "offensive",
mute = true,
times = function(self)
return Self.phase == Player.Play and 1 - Self:usedSkillTimes(self.name, Player.HistoryPhase) or -1
end,
card_filter = function(self, to_select, selected, selected_targets)
return false
end,
can_use = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
end,
on_use = function(self, room, effect)
local from = room:getPlayerById(effect.from)
room:notifySkillInvoked(from, self.name)
from:broadcastSkillInvoke(self.name,math.floor((math.random()*4)+1))
local mark = from:getMark('@tyj__shixing-turn')
mark = mark+1
room:setPlayerMark(from,'@tyj__shixing-turn',mark);
room:damage{
from = from,
to = from,
damage = 1,
skillName = self.name,
}
end
}
local tyj__shixing_delay = fk.CreateTriggerSkill{
name ="#tyj__shixing_delay",
anim_type = "control",
events = {fk.PreHpRecover,fk.DamageInflicted},
mute = true,
can_trigger = function(self, event, target, player, data)
if player:getMark('@tyj__shixing-turn')>0 then
return not data.skillName or data.skillName ~="tyj__shixing";
end
end,
on_cost = Util.TrueFunc,
on_use = function (self, event, target, player, data)
local room = player.room
room:notifySkillInvoked(player, 'tyj__shixing')
player:broadcastSkillInvoke('tyj__shixing',math.floor((math.random()*4)+5))
local mark = player:getMark('@tyj__shixing-turn')
if(event == fk.DamageInflicted) then
data.damage = data.damage + mark
room:setPlayerMark(player,'@tyj__shixing-turn',0)
if(data.to and data.to ~= player) then
room:drawCards(player, 1,"tyj__shixing")
player:addSkillUseHistory("tyj__shixing", -1)
end
else
data.num=data.num+mark
room:setPlayerMark(player,'@tyj__shixing-turn',0)
if(data.who and data.who ~= player) then
room:drawCards(player, 1, "tyj__shixing")
player:addSkillUseHistory("tyj__shixing", -1)
end
end
end
}
tyj__shixing:addRelatedSkill(tyj__shixing_delay)
tyj_garrosh:addSkill(tyj__shixing);
Fk:loadTranslationTable{
['#testnum'] = '值为 %num',
["tyj__rongzhou"] = "戎胄",
[":tyj__rongzhou"] = "锁定技,你的体力值每变化两点后,你获得一点护甲。你受到令你失去所有护甲的伤害后可以将一张装备牌当【决斗】使用。",
["#tyj__rongzhou_viewas"] = "戎胄:可以将装备牌当【决斗】使用。",
["#tyj__rongzhou_active"]="戎胄",
['tyj_rongzhou_count'] = '戎胄',
["tyj__shixing"] = "嗜腥",
[":tyj__shixing"] = "出牌阶段限一次,你可以对自己造成1点伤害,令本回合下一次不因〖嗜腥〗造成的伤害/回复的数值+1,若受伤/回复角色不为你,你摸一张牌并重置〖嗜腥〗。",
['@tyj__shixing-turn'] = "嗜腥",
["$tyj__rongzhou1"] = '我从不低头!',
["$tyj__rongzhou2"] = 'I submit to no one!',
["$tyj__rongzhou3"] = '<咆哮>',
["$tyj__rongzhou4"] = '<咆哮>',
["$tyj__rongzhou5"] = '我要粉碎你!',
["$tyj__rongzhou6"] = 'I will crush you!',
["$tyj__rongzhou7"] = "Lok'tar ogar!",
["$tyj__rongzhou8"] = "Lok'tar ogar!",
["$tyj__shixing1"] = "我们要用鲜血染红战场!",
["$tyj__shixing2"] = "We will stain the battlefield red!",
["$tyj__shixing3"] = "不胜利,毋宁死!",
["$tyj__shixing4"] = "Victory or Death!",
["$tyj__shixing5"] = "力量与荣耀。",
["$tyj__shixing6"] = "Strength and honor.",
["$tyj__shixing7"] = "我渴望战斗!",
["$tyj__shixing8"] = "I thirst for battle!",
["~tyj__garrosh"] = "呃啊啊啊哦呃啊!",
}
local tyj_galakrond = General:new(extension, "tyj__galakrond", "qun", 6,6)
Fk:loadTranslationTable{
["tyj__galakrond"] = "迦拉克隆",
["#tyj__galakrond"] = "诸龙之父",
["designer:tyj__galakrond"] = "汤圆",
["cv:tyj__galakrond"] = "暴雪官方",
["illustrator:tyj__galakrond"] = "Konstantin Turovec",
}
local tyj__lushi = fk.CreateTriggerSkill{
name = "tyj__lushi",
anim_type = "offensive",
events = {fk.DamageCaused,fk.CardUsing},
frequency = Skill.Compulsory,
can_trigger = function(self, event, target, player, data)
if(target == player and player:hasSkill(self)) then
if event== fk.DamageCaused then return data.to.hp <= data.damage
else return #table.filter(player.room:getOtherPlayers(player), function(p) return p.hp <= player.hp end) > 0 end
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
if event == fk.DamageCaused then
player.room:sendLog{ type = "#PreventDamageBySkill", from = data.to.id, arg = self.name }
room:changeMaxHp(data.to, -data.damage)
room:changeMaxHp(player, data.damage)
room:recover({
who = player,
num = data.damage,
recoverBy = player,
skillName = self.name
})
return true
else
local targets =table.filter(player.room:getOtherPlayers(player), function(p) return p.hp <= player.hp end)
if #targets > 0 then
data.disresponsiveList = data.disresponsiveList or {}
for _, p in ipairs(targets) do
table.insertIfNeed(data.disresponsiveList, p.id)
end
end
end
end,
}
local tyj__shiduo=fk.CreateTriggerSkill{
name = "tyj__shiduo",
anim_type = "special",
events = {fk.Deathed},
can_trigger = function(self, event, target, player, data)
return player:hasSkill(self) and target~=player --and #table.filter(player.room:getOtherPlayers(player), function(p) return p.maxHp < target.maxHp end)==0
end,
on_cost = function(self, event, target, player, data)
local skills = Fk.generals[target.general]:getSkillNameList()
if target.deputyGeneral and target.deputyGeneral ~= "" then
table.insertTableIfNeed(skills, Fk.generals[target.deputyGeneral]:getSkillNameList())
end
self.cost_data = table.filter(skills, function(s)
local skill = Fk.skills[s]
return not player:hasSkill(skill, true) and not skill.lordSkill
and (#skill.attachedKingdom == 0 or table.contains(skill.attachedKingdom, player.kingdom))
end)
return #self.cost_data > 0 and player.room:askForSkillInvoke(player, self.name, nil, "#tyj__shiduo-invoke::"..target.id)
end,
on_use = function(self, event, target, player, data)
local room = player.room
room:doIndicate(player.id, {target.id})
if #self.cost_data>0 then
local result = room:askForCustomDialog(player,self.name,
"packages/tyj/qml/ChooseSkillBox.qml", {
self.cost_data, 1, 1, "#tyj__shiduo-choice::"..target.id
})
if result == "" then return false end
local choice = json.decode(result)
if choice then
room:handleAddLoseSkills(player, choice[1], nil, true, false)
local mark = player:getTableMark("@tyj__shiduo_skills")
table.insertIfNeed(mark, choice[1])
room:setPlayerMark(player,"@tyj__shiduo_skills", mark)
room:handleAddLoseSkills(player, choice[1])
end
end
end,
}
local tyj__shiduo_benghuai = fk.CreateTriggerSkill{
name = "#tyj__shiduo_benghuai",
events = {fk.AfterSkillEffect},
mute=true,
can_trigger = function(self, _, target, player, data)
if(target == player and player:hasSkill("tyj__shiduo") and #player:getTableMark("@tyj__shiduo_skills")>0) then
local e = player.room.logic:getCurrentEvent():findParent(GameEvent.SkillEffect)
if e and e.data[3] == self then --FIXME:防止嵌套
return false
end
return table.contains(player:getTableMark("@tyj__shiduo_skills"), data.name)
end
end,
on_cost = Util.TrueFunc,
on_use = function(self, event, target, player, data)
local room = player.room
room:notifySkillInvoked(player, "tyj__shiduo")
player:broadcastSkillInvoke("tyj__shiduo",-1)
local choice = room:askForChoice(player, {"loseMaxHp", "loseHp"},"tyj__shiduo")
if choice == "loseMaxHp" then
room:changeMaxHp(player, -1)
else
room:loseHp(player, 1, self.name)
end
end
}
local tyj__xinzhong = fk.CreateTriggerSkill{
name = "tyj__xinzhong$",
anim_type = "offensive",
events = {fk.PreDamage},
can_trigger = function(self, event, target, player, data)
if target~=player and player:hasSkill('tyj__xinzhong') then
return data.to and data.to.kingdom=='qun' and data.to.hp <=data.damage and data.to ~= player
end
end,
on_cost = function (self, event, target, player, data)
return player.room:askForSkillInvoke(data.to, self.name, data, "#tyj__xinzhong-invoke::"..player.id)
end,
on_use = function (self, event, target, player, data)
local room = player.room
room:doIndicate(player.id, {data.to.id})
room:drawCards(data.to,data.damage,self.name)
data.from=player
end
}
tyj__shiduo:addRelatedSkill(tyj__shiduo_benghuai)
tyj_galakrond:addSkill(tyj__lushi);
tyj_galakrond:addSkill(tyj__shiduo);
tyj_galakrond:addSkill(tyj__xinzhong);
Fk:loadTranslationTable{
["debug"]="内容为 %to";
["tyj__shiduo_skills"]="尸堕",
["tyj__lushi"] = "戮食",
["@tyj__shiduo_skills"]="尸堕",
[":tyj__lushi"] = "锁定技,体力值不大于你的角色无法响应你使用的牌。你造成致命伤害时,防止之并获得受伤角色的X点体力上限,然后回复X点体力(X为伤害值)。",
["tyj__shiduo"] = "尸堕",
["#tyj__shiduo-invoke"]="是否获得 %dest 武将牌上的一个技能?",
["#tyj__shiduo-choice"]="选择 %dest 武将牌上的一个技能获得",
[":tyj__shiduo"]="其他角色死亡时,你可以获得其武将牌上的一个技能。你发动因〖尸堕〗获得的技能后,若不在执行此效果,你须失去一点体力或体力上限。",
["tyj__xinzhong"] = "信众",
[":tyj__xinzhong"]="主公技,其他角色即将对群势力角色造成致命伤害时,受伤角色可以将伤害来源改为你并摸伤害值张牌。",
["#tyj__xinzhong-invoke"]="信众:你即将受到致命伤害,是否摸牌并将伤害来源改为 %dest?",
["loseMaxHp"] = "减1点体力上限",
["loseHp"] = "失去1点体力",
["$tyj__lushi1"]="你的恐惧美味无比。",
["$tyj__lushi2"]="You fear is delectable.",
["$tyj__lushi3"]="你的尖叫令我愉悦。",
["$tyj__lushi4"]="Your scream delight me.",
["$tyj__shiduo1"]="你的灵魂,会受到永恒的劫难。",
["$tyj__shiduo2"]="Enternity will not be kind to you soul.",
["$tyj__shiduo3"]="你的心灵,在颤抖。",
["$tyj__shiduo4"]="You mind falters.",
["$tyj__xinzhong1"]="我看到你了!",
["$tyj__xinzhong2"]="I see you.",
["$tyj__xinzhong3"]="我欣赏你的疯狂!",
["$tyj__xinzhong4"]="I aprove this insanity!",
["~tyj__galakrond"] = "呃....啊啊啊啊啊啊啊!",
}
local tyj__kaelthas = General:new(extension, "tyj__kaelthas", "wu", 3,3)
Fk:loadTranslationTable{
["tyj__kaelthas"] = "凯尔萨斯",
["#tyj__kaelthas"] = "逐日者",
["designer:tyj__kaelthas"] = "汤圆",
["cv:tyj__kaelthas"] = "暴雪官方",
["illustrator:tyj__kaelthas"] = "网络",
}
---@param player ServerPlayer @ 摸牌的玩家
---@param num integer @ 摸牌数
local function brokeHp(player,num)
local room = player.room
local mnnum = 0
local numx = num
local mark = player:getTableMark("@!tyj__BrokenHp")
for i=player.maxHp, 1,-1 do
if i > player.hp then
numx = numx-1
mnnum=mnnum+1
elseif not table.contains(mark,i) then
numx = numx-1
table.insertIfNeed(mark,i)
room:sendLog{
type = "#brokeHp",
from = player.id,
arg = i,
}
end
if numx <= 0 then break end
end
if mnnum >0 then
room:changeMaxHp(player, -mnnum)
end
if #mark>0 then
room:broadcastPlaySound("./packages/tyj/audio/effect/brokeHp")
room:setPlayerMark(player,"@!tyj__BrokenHp",mark)
else
room:setPlayerMark(player,"@!tyj__BrokenHp",0)
end
end
local brokeHp_skill = fk.CreateTriggerSkill{
name = "#brokeHp_skill",
refresh_events = {fk.HpChanged},
global = true,
can_refresh = function (self, event, target, player, data)
return target == player and #player:getTableMark("@!tyj__BrokenHp") ~= 0 and data.num and data.num~=0
end,
on_refresh = function (self, event, target, player, data)
local room = player.room
local mark = player:getTableMark("@!tyj__BrokenHp")
local mnnum = 0
local cnum = player.hp
for i=#mark,1,-1 do
if mark[i] > cnum then
mnnum=mnnum+1
table.remove(mark,i)
end
end
if #mark>0 then
room:setPlayerMark(player,"@!tyj__BrokenHp",mark)
else
room:setPlayerMark(player,"@!tyj__BrokenHp",0)
end
if mnnum >0 then
room:changeMaxHp(player, -mnnum)
end
end,
}
Fk:addSkill(brokeHp_skill)
local tyj__mozhu = fk.CreateTriggerSkill{
name = "tyj__mozhu",
anim_type = "drawcard",
events = {fk.AfterCardsMove,fk.AfterDrawPileShuffle},
frequency = Skill.Compulsory,
can_trigger = function(self, event, target, player, data)
if not player:hasSkill(self) then return end
if event == fk.AfterCardsMove then
for _, move in ipairs(data) do
if(move.from) then
local from = player.room:getPlayerById(move.from)
if from == player and #move.moveInfo>0 then
for _, info in ipairs(move.moveInfo) do
if info.fromArea == Card.PlayerHand or info.fromArea==Card.PlayerEquip then
return true
end
end
end
end
end
else return true end
end,
on_trigger = function (self, event, target, player, data)
if event == fk.AfterCardsMove then
local room=player.room
local mark=player:getMark("@tyj__mozhu_count")
for _, move in ipairs(data) do
if(move.from) then
local from = player.room:getPlayerById(move.from)
if from == player and #move.moveInfo>0 then
for _, info in ipairs(move.moveInfo) do
if info.fromArea == Card.PlayerHand or info.fromArea==Card.PlayerEquip then
mark=mark+1
end
end
end
end
end
room:setPlayerMark(player,"@tyj__mozhu_count",mark)
mark = player:getMark("@tyj__mozhu_count")
for i=1,99 do
if player:hasSkill(self) and mark >2 then
mark = mark -3
room:setPlayerMark(player,"@tyj__mozhu_count",mark)
mark = player:getMark("@tyj__mozhu_count")
self:doCost(event,target,player,data)
else
break
end
end
else self:doCost(event,target,player,data) end
end,
on_use = function(self, event, target, player, data)
local room=player.room
if event == fk.AfterCardsMove then
local card
local cards={}
while true do
local id = room:getNCards(1)[1]
room:moveCardTo(id, Card.Processing, nil, fk.ReasonJustMove, self.name, nil, true, player.id)
room:delay(270)
local c = Fk:getCardById(id)
if c:getTypeString() == "trick" then
card = c
room:delay(300)
break
else
table.insert(cards, id)
end
end
room:moveCardTo(card.id, Player.Hand, player, fk.ReasonPrey, self.name, nil, true, player.id)
cards = table.filter(cards, function(id) return room:getCardArea(id) == Card.Processing end)
room:moveCardTo(cards, Card.DiscardPile, nil, fk.ReasonPutIntoDiscardPile, self.name, nil, true, player.id)
else
--brokeHp(player,1)
room:changeMaxHp(player,-1)
room:drawCards(player,3,self.name)
end
end,
}
local tyj__yuyan_active = fk.CreateActiveSkill{
name = "tyj__yuyan_active",
anim_type = "control",
card_num = 0,
card_filter = Util.FalseFunc,
min_target_num = 1,
prompt = function (self, selected, selected_cards)
local num = Self:getMark("tyj__yuyan")
return "#tyj__yuyan-invoke:::" .. num
end,
target_filter = function(self, to_select, selected)
local n = Fk:currentRoom():getPlayerById(to_select).hp
for _, p in ipairs(selected) do
n = n + Fk:currentRoom():getPlayerById(p).hp
end
return n <= Self:getMark("tyj__yuyan")
end,
feasible = function(self, selected, selected_cards)
if #selected_cards ~= 0 or #selected == 0 then return false end
local n = 0
for _, p in ipairs(selected) do
n = n + Fk:currentRoom():getPlayerById(p).hp
end
return n == Self:getMark("tyj__yuyan")
end,
}
Fk:addSkill(tyj__yuyan_active)
local tyj__yuyan = fk.CreateTriggerSkill{
name = "tyj__yuyan",
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.Finish then
return true
end
end,
on_cost = function (self, event, target, player, data)
local room=player.room
local num = 0
local events = room.logic:getEventsOfScope(GameEvent.MoveCards, 999, function(e)
for _, move in ipairs(e.data) do
if move.toArea == Card.DiscardPile then
for _, info in ipairs(move.moveInfo) do
if room:getCardArea(info.cardId) == Card.DiscardPile and Fk:getCardById(info.cardId, true).type == Card.TypeTrick then
num=num+1
end
end
end
end
end, Player.HistoryTurn)
room:setPlayerMark(player, self.name, num)
local success, dat = room:askForUseActiveSkill(player, "tyj__yuyan_active", "#tyj__yuyan-use:::"..num, true)
if success then
self.cost_data = {dat.targets}
return true
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
local tos = table.map(self.cost_data[1], Util.Id2PlayerMapper)
for _, p in ipairs(tos) do
if not p.dead then
room:doIndicate(player.id,{p.id})
room:damage { from = player, to = p, damage = 1, skillName =self.name,damageType = fk.FireDamage, }
end
end
--[[if player:getMark("tyj__yuyan_damage-phase")>2 then
room:loseHp(player, 1, self.name)
room:handleAddLoseSkills(player, "-tyj__yuyan", nil, true, false)
room:handleAddLoseSkills(player, "qice", nil, true, false)
end--]]
end,
refresh_events={--[[fk.Damage,--]]fk.AfterCardsMove},
can_refresh = function (self, event, target, player, data)
if player:hasSkill("tyj__yuyan") and player.phase ~= Player.NotActive then
if event == fk.Damage then
return target == player and data.skillName == "tyj__yuyan"
else
for _, move in ipairs(data) do
if #move.moveInfo>0 and move.toArea == Card.DiscardPile then
for _, info in ipairs(move.moveInfo) do
if Fk:getCardById(info.cardId).type==Card.TypeTrick then return true end
end
end
end
end
end
return false
end,
on_refresh = function (self, event, target, player, data)
local room=player.room
if event == fk.Damage then
local mark=player:getMark("tyj__yuyan_damage-phase")
mark=mark+data.damage
room:setPlayerMark(player,"tyj__yuyan_damage-phase",mark)
else
local num = 0
local events = room.logic:getEventsOfScope(GameEvent.MoveCards, 999, function(e)
for _, move in ipairs(e.data) do
if move.toArea == Card.DiscardPile then
for _, info in ipairs(move.moveInfo) do
if room:getCardArea(info.cardId) == Card.DiscardPile and Fk:getCardById(info.cardId,true).type == Card.TypeTrick then
num=num+1
end
end
end
end
end, Player.HistoryTurn)
room:setPlayerMark(player,"@tyj__yuyan_count-turn",num)
end
end
}
local tyj__jieyuan = fk.CreateTriggerSkill{
name = "tyj__jieyuan$",
anim_type = "control",
events = {fk.AfterCardTargetDeclared},
mute=true,
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) and data.card:isCommonTrick() and player:usedSkillTimes(self.name) == 0 and target.kingdom=="wu" then
return true
end
end,
on_cost = Util.TrueFunc,
on_use = function(self, event, target, player, data)
local room=player.room
local tos={}
if player:getMark(self.name)==0 then
local targets = U.getUseExtraTargets(room, data)
if #targets > 0 then
tos= targets
local to = player.room:askForChoosePlayers(player, tos, 1, 1,
"#tyj__jieyuan-choose:::"..data.card:toLogString(), self.name, true)
if #to > 0 then
player:broadcastSkillInvoke("tyj__jieyuan",-1)
room:notifySkillInvoked(player,"tyj__jieyuan");
TargetGroup:pushTargets(data.tos,to[1])
end
end
end
end,
refresh_events = {fk.AfterDrawPileShuffle},
can_refresh = function(self, event, target, player, data)
return player:hasSkill(self.name, true)
end,
on_refresh = function(self, event, target, player, data)
player.room:setPlayerMark(player, self.name, 1)
end,
}
tyj__kaelthas:addSkill(tyj__mozhu)
tyj__kaelthas:addSkill(tyj__yuyan)
tyj__kaelthas:addSkill(tyj__jieyuan)
--tyj__kaelthas:addRelatedSkill("qice")
Fk:loadTranslationTable{
["@tyj__mozhu_count"]="魔珠",
["tyj__mozhu"] = "魔珠",
[":tyj__mozhu"] = "锁定技,你每失去三张牌后,便从牌堆检索一张锦囊牌获得。洗牌后,你减1点体力上限并摸三张牌。",
["$tyj__mozhu1"]="魔法,能量,我的人民陷入其中不能自拔。",
["$tyj__mozhu2"]="Energy, power. My people are addicted to it!",
["tyj__yuyan"]="狱炎",
[":tyj__yuyan"]="结束阶段,你可以对体力值和为X的任意名角色各造成一点火属性伤害(x为本回合进入弃牌堆的锦囊牌数)。",
["tyj__jieyuan"]="竭源",
[":tyj__jieyuan"]="主公技,吴势力角色每回合使用的首张普通锦囊牌指定目标时,若未洗牌过,你可以为此牌指定一个额外的目标。",
["#tyj__jieyuan-choose"]="竭源:是否为 %arg 指定一个额外的目标",
["#tyj__yuyan-use"]="是否发动 狱炎?(X为 %arg )",
["@tyj__yuyan_count-turn"]="狱炎",
["#tyj__yuyan-invoke"]="狱炎:选择体力值和为 %arg 的任意名角色,对他们各造成一点火属性伤害。",
["tyj__yuyan_active"]="狱炎",
["$tyj__yuyan1"]="Balamore shanal(萨尔斯语施法)",
["$tyj__yuyan2"]="Anar'anel belore!(萨尔斯语施法)",
["$qice_tyj__kaelthas1"]="我的力量由我掌控。",
["$qice_tyj__kaelthas2"]="My power is mine to wield.",
["~tyj__kaelthas"]="这是一次...eyi..小小的挫败。",
["$tyj__jieyuan1"]="太阳照耀着我的荣耀之路。",
["$tyj__jieyuan2"]="The sun lights my path to glory.",
["#brokeHp_skill"]="碎玉",
["#brokeHp"]="%from 的第 %arg 枚勾玉被击碎了",
}
local tyj__kelthuzad = General:new(extension, "tyj__kelthuzad", "wei", 3,3)
Fk:loadTranslationTable{
["tyj__kelthuzad"] = "克尔苏加德",
["#tyj__kelthuzad"] = "天灾军团的大巫妖",
["designer:tyj__kelthuzad"] = "汤圆",
["cv:tyj__kelthuzad"] = "暴雪官方",
["illustrator:tyj__kelthuzad"] = "James Ryman",
}
local tyj__kaoyi =fk.CreateTriggerSkill{
events = {fk.AskForPeachesDone},
name="tyj__kaoyi",
anim_type = "special",
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) and not target.dead and target.hp < 1 then
local skills={}
for _, skill_name in ipairs(Fk.generals[target.general]:getSkillNameList()) do
local skill = Fk.skills[skill_name]
if target:hasSkill(skill,true) then
table.insertIfNeed(skills, skill_name)
end
end
if target.deputyGeneral and target.deputyGeneral ~= "" then
for _, skill_name in ipairs(Fk.generals[target.deputyGeneral]:getSkillNameList()) do
local skill = Fk.skills[skill_name]
if target:hasSkill(skill,true) then
table.insertIfNeed(skills, skill_name)
end
end
end
if #skills>0 then
return true
end
end
end,
on_cost = function(self, event, target, player, data)
return player.room:askForSkillInvoke(player, self.name, data, "#tyj__kaoyi-invoke::"..target.id)
end,
on_use = function (self, event, target, player, data)
local room = player.room
room:broadcastPlaySound("./packages/tyj/audio/extra/tyj__kelthuzadBGM")
room:doIndicate(player.id,{target.id})
room:doAnimate("InvokeUltSkill", {
name = "tyj__kaoyi",
player = player.id,
deputy = player.deputyGeneral and player.deputyGeneral ~= "" and table.contains(Fk.generals[player.deputyGeneral]:getSkillNameList(true),"tyj__kaoyi"),
})
room:delay(2000)
local skills={}
for _, skill_name in ipairs(Fk.generals[target.general]:getSkillNameList()) do
local skill = Fk.skills[skill_name]
if target:hasSkill(skill,true) then
table.insertIfNeed(skills, skill_name)
end
end
if target.deputyGeneral and target.deputyGeneral ~= "" then
for _, skill_name in ipairs(Fk.generals[target.deputyGeneral]:getSkillNameList()) do
local skill = Fk.skills[skill_name]
if target:hasSkill(skill,true) then
table.insertIfNeed(skills, skill_name)
end
end
end
if #skills>0 then
local result = room:askForCustomDialog(target,self.name,
"packages/tyj/qml/ChooseSkillBox.qml", {
skills, 1, 1, "选择一个技能失去"
})
local choice = nil
if result == "" then
choice = table.random(skills,1)
else
choice = json.decode(result)
end
if choice then
room:handleAddLoseSkills(target, "-"..choice[1], nil, true, false)
local skills={}
for _, skill_name in ipairs(Fk.generals[target.general]:getSkillNameList()) do
local skill = Fk.skills[skill_name]
if not (skill.lordSkill) then
if target:hasSkill(skill,true) then
table.insertIfNeed(skills, skill_name)
end
end
end
if target.deputyGeneral and target.deputyGeneral ~= "" then
for _, skill_name in ipairs(Fk.generals[target.deputyGeneral]:getSkillNameList()) do
local skill = Fk.skills[skill_name]
if not (skill.lordSkill) then
if target:hasSkill(skill,true) then
table.insertIfNeed(skills, skill_name)
end
end
end
end
target.hp = math.min(target.maxHp,#skills)
room:broadcastProperty(target, "hp")
end
end
end,
}
local myIceDamageSkill = fk.CreateTriggerSkill{
name = "ice_damage_skill_tyj",
global = true,
mute = true,
events = {fk.DamageCaused},
can_trigger = function(self, event, target, player, data)
return target == player and data.damageType == fk.IceDamage and (not data.card or data.card.name ~= "ice__slash") and
not data.chain and not data.to:isNude() and data.skillName and Fk.skills[data.skillName] and Fk.skills[data.skillName].package.extensionName == "tyj"
end,
on_cost = function (self, event, target, player, data)
return player.room:askForSkillInvoke(player, self.name, nil, "#ice_damage_skill_tyj-invoke::"..data.to.id)
end,
on_use = function(self, event, target, player, data)
local room = player.room
local to = data.to
room:broadcastPlaySound("./packages/tyj/audio/effect/ice_sword")
for i = 1, 2 do
if to:isNude() then break end
local card = room:askForCardChosen(player, to, "he", self.name)
room:throwCard({card}, self.name, to, player)
end
return true
end
}
Fk:addSkill(myIceDamageSkill)
local tyj__wulianx_viewas = fk.CreateViewAsSkill{
name = "tyj__wulianx_viewas",
card_filter = Util.FalseFunc,
anim_type="drawcard",
view_as = function(self, cards)
local card = Fk:cloneCard("iron_chain")
card.skillName = "tyj__wulianx"
return card
end,
}
Fk:addSkill(tyj__wulianx_viewas)
local tyj__wulianx =fk.CreateTriggerSkill{
events = {fk.AfterDying,fk.Deathed},
name="tyj__wulianx",
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) then
if event == fk.AfterDying then return target:isAlive()
else return target.dead end
end
end,
on_cost = function(self, event, target, player, data)
return player.room:askForSkillInvoke(player, self.name, data, "是否发动 巫链 ?")
end,
on_use = function (self, event, target, player, data)
local room = player.room
local choiceList, all_choices = {"获得牌"}, {"铁索连环","获得牌","横置并摸牌"}
if not player:prohibitUse(Fk:cloneCard("iron_chain")) and player:canUse(Fk:cloneCard("iron_chain"))then
table.insert(choiceList,"铁索连环")
end
if not player.chained then
table.insert(choiceList,"横置并摸牌")
end
if #choiceList == 0 then return false end
local choice = room:askForChoice(player, choiceList, self.name,"巫链:选择要执行的一项", false, all_choices)
if choice == "铁索连环" then
local success, dat = player.room:askForUseViewAsSkill(player, "tyj__wulianx_viewas", "巫链", true, {bypass_times = true})
if success then
room:notifySkillInvoked(player, self.name)
player:broadcastSkillInvoke(self.name,math.floor((math.random()*4)+5))
local card = Fk.skills["tyj__wulianx_viewas"]:viewAs(dat.cards)
local use = {from = player.id, tos = table.map(dat.targets, function(p) return {p} end), card = card}
room:useCard(use)
end
elseif choice == "获得牌" then
local mark = player:getTableMark("@@tyj__wulianx_gain-turn")
table.insertIfNeed(mark,target.id)
room:setPlayerMark(player,"@@tyj__wulianx_gain-turn",mark)
else
--[[local cards = room:askForCard(player, 1, 999, true, self.name,false, ".", "巫链:重铸任意张牌")
if #cards > 0 then
room:recastCard(cards, player, self.name)
end--]]
player:setChainState(true)
player:drawCards(2)
end
end,
}
local tyj__wulian_pick = fk.CreateTriggerSkill{
name = "#tyj__wulian_pick",
events ={fk.TurnEnd},
anim_type="drawcard",
can_trigger = function (self, event, target, player, data)
return #player:getTableMark("@@tyj__wulianx_gain-turn")>0
end,
on_cost = function (self, event, target, player, data)
return true
end,
on_use =function (self, event, target, player, data)
local room = player.room
--local mark = player:getTableMark("@@tyj__wulianx_gain-turn")
local ids = {}
room.logic:getEventsOfScope(GameEvent.MoveCards, 1, function(e)
for _, move in ipairs(e.data) do
if move.toArea == Card.DiscardPile and move.moveReason == fk.ReasonDiscard --[[and move.from and table.contains(mark,move.from)--]]then
for _, info in ipairs(move.moveInfo) do
if player.room:getCardArea(info.cardId) == Card.DiscardPile then
table.insertIfNeed(ids, info.cardId)
end
end
end
end
return false
end, Player.HistoryTurn)
if #ids >0 then
local get = room:askForCardsChosen(player, player, 1, 3, {
card_data = {
{ "pile_discard", ids }
}
}, self.name, "#tyj__wulianx-choose")
if #get>0 then
room:moveCardTo(get, Player.Hand, player, fk.ReasonJustMove, self.name,nil,true, player.id)
end
end
end
}
local tyj__diaosha = fk.CreateTriggerSkill{
name="tyj__diaosha",
anim_type="offensive",
events={fk.Damage},
can_trigger = function (self, event, target, player, data)
return player:hasSkill(self) and target == player and data.damageType ~= fk.NormalDamage and data.to and not data.to:hasSkill("tyj__shihan",true) and not data.to.dead
end,
on_cost = function (self, event, target, player, data)
return player.room:askForSkillInvoke(player, self.name, data, "#tyj__diaosha-invoke::"..data.to.id)
end,
on_use = function (self, event, target, player, data)
local room = player.room
room:doIndicate(player.id,{data.to.id})
if not data.to:hasSkill("tyj__shihan",true) then
room:setPlayerMark(data.to,"@@tyj__diaosha_gain",1)
room:handleAddLoseSkills(data.to, "tyj__shihan", nil, true, false)
end
end,
refresh_events={fk.EnterDying},
can_refresh= function (self, event, target, player, data)
return target == player and player:getMark("@@tyj__diaosha_gain")>0 and player:hasSkill("tyj__shihan",true)
end,
on_refresh = function (self, event, target, player, data)
local room = player.room
room:setPlayerMark(player,"@@tyj__diaosha_gain",0)
room:handleAddLoseSkills(player, "-tyj__shihan", nil, true, false)
end
}
local tyj__shihan = fk.CreateTriggerSkill{
name="tyj__shihan",
anim_type="negative",
--events={fk.CardUsing},
events={fk.TurnEnd},
frequency=Skill.Compulsory,
--[[can_trigger = function (self, event, target, player, data)
return player:hasSkill(self) and target == player and player.hp >0 and player:getMark(self.name)>=player.hp
end,--]]
can_trigger = function (self, event, target, player, data)
return player:hasSkill(self) and #player.room.logic:getEventsOfScope(GameEvent.UseCard, 998, function(e)
local use = e.data[1]
return use.from == player.id
end, Player.HistoryTurn) >= player.hp
end,
on_use = function (self, event, target, player, data)
local room = player.room
--room:setPlayerMark(player,self.name,0)
room:damage{
from = player,
to = player,
damage = 1,
damageType = fk.IceDamage,
skillName = self.name,
}
end,
refresh_events = {fk.PreCardUse, fk.PreCardRespond},
can_refresh = function(self, event, target, player, data)
return player:hasSkill(self) and target == player and player.hp >0
end,
on_refresh = function(self, event, target, player, data)
player.room:addPlayerMark(player,self.name, 1)
end,
}
tyj__kelthuzad:addSkill(tyj__kaoyi)
tyj__wulianx:addRelatedSkill(tyj__wulian_pick)
tyj__kelthuzad:addSkill(tyj__wulianx)
tyj__kelthuzad:addSkill(tyj__shihan)
tyj__kelthuzad:addSkill(tyj__diaosha)
Fk:loadTranslationTable{
["ice_damage_skill_tyj"] = "冰冻伤害",
[":ice__slash_tyj"] = "一名角色造成不为连环伤害的冰冻伤害时,若受到此伤害的角色有牌,来源可防止此伤害,然后依次弃置其两张牌。",
["#ice_damage_skill_tyj-invoke"] = "冰杀:你可以防止对 %dest 造成的冰冻伤害,改为依次弃置其两张牌",
["tyj__kaoyi"] = "薧疫",
[":tyj__kaoyi"] = "一名角色的濒死结算后,若其仍濒死且其拥有武将牌上的技能,你可以令其选择其中一个失去并将体力值调整至X(X为其仍拥有的武将牌上的技能数)。",
["#tyj__kaoyi-invoke"]="薧疫:是否令 %dest 失去武将牌上的一个技能并回复体力?",
["tyj__wulianx"] = "巫链",
[":tyj__wulianx"] = "一名角色脱离濒死或死亡后,你可以选择一项:1.视为使用【铁索连环】;2.横置并摸两张牌;3.本回合结束时获得至多三张本回合被弃置的牌。",
["@@tyj__wulianx_gain-turn"]="巫链",
["tyj__wulianx_viewas"]="巫链",
["#tyj__wulian_pick"]="巫链",
["#tyj__wulianx-choose"]="巫链:选择至多三张牌获得。",
["tyj__shihan"] = "噬寒",
[":tyj__shihan"] = "锁定技,每回合结束时,若你本回合使用的牌数不小于体力值,你对自己造成1点冰属性伤害。",
["tyj__diaosha"] = "凋煞",
[":tyj__diaosha"] = "你造成属性伤害后,可以令受伤角色获得〖噬寒〗直到其进入濒死。",
["#tyj__diaosha-invoke"]="凋煞:是否令 %dest 获得〖噬寒〗?",
["@@tyj__diaosha_gain"]="凋煞",
["$tyj__kaoyi1"]="冰冻废土的战士们,起来吧!",
["$tyj__kaoyi2"]="Warriors of the frozen wastes, rise up!",
["$tyj__kaoyi3"]="听从召唤!",
["$tyj__kaoyi4"]="Obey the call!",
["$tyj__wulianx1"]="你的灵魂现在归我了!",
["$tyj__wulianx2"]="Your soul is bound to me now!",
["$tyj__wulianx3"]="来自黑暗寒冬的问候。",
["$tyj__wulianx4"]="Greetings from the cold dark.",
["$tyj__diaosha1"]="你的末日临近了。",
["$tyj__diaosha2"]="The end is upon you.",
["$tyj__diaosha3"]="黑暗的虚空正等着你。",
["$tyj__diaosha4"]="The dark void awaits you.",
["$tyj__shihan1"]="我会冻结你的血液!",
["$tyj__shihan2"]="I will freeze the blood in your veins!",
["$tyj__shihan3"]="祈祷我的慈悲吧!",
["$tyj__shihan4"]="Pray for mercy!",
["~tyj__kelthuzad"]="呃唔额,啊啊啊啊啊啊啊...",
}
local tyj__arthas = General:new(extension, "tyj__arthas", "wei", 5,5)
Fk:loadTranslationTable{
["tyj__arthas"] = "阿尔萨斯",
["#tyj__arthas"] = "巫妖王",
["designer:tyj__arthas"] = "汤圆",
["cv:tyj__arthas"] = "暴雪官方",
["illustrator:tyj__arthas"] = "网络",
}
local tyj__aihan = fk.CreateViewAsSkill{
name = "tyj__aihan",
anim_type = "offensive",
pattern = "ice__slash",
times = function (self)
local num = 1
for _, p in ipairs(Fk:currentRoom().players) do
if p.dead then
num=num+1
end
end
return num - Self:usedSkillTimes(self.name, Player.HistoryTurn)
end,
card_filter = function(self, to_select, selected)
if #selected == 1 then return false end
return true
end,
before_use = function (self, player, use)
use.extraUse=true
end,
enabled_at_play = function(self, player)
local num = 0
for _, p in ipairs(Fk:currentRoom().players) do
if p.dead then
num=num+1
end
end
return player:usedSkillTimes(self.name) <= num
end,
enabled_at_response = function(self, player, response)
local num = 0
for _, p in ipairs(Fk:currentRoom().players) do
if p.dead then
num=num+1
end
end
return not response and player:usedSkillTimes(self.name) <= num
end,
view_as = function(self, cards)
if #cards ~= 1 then
return nil
end
local c = Fk:cloneCard("ice__slash")
c.skillName = self.name
c:addSubcard(cards[1])
return c
end,
}
local tyj__aihan_delay= fk.CreateTriggerSkill{
name="#tyj__aihan_delay",
refresh_events={fk.Damage,fk.TurnEnd},
can_refresh = function(self, event, target, player, data)
if event == fk.Damage then
return
target == player and
not data.chain and
data.card and
table.contains(data.card.skillNames, "tyj__aihan")
else return player:getMark("@@tyj__aihan-turn")>0 end
end,
on_refresh = function (self, event, target, player, data)
local room = player.room
if event == fk.Damage then
local ids = {}
if player:hasSkill("tyj__aihan",true,true) then
room:handleAddLoseSkills(player, "-tyj__aihan", nil, true, false)
room:setPlayerMark(player,"@@tyj__aihan-turn",1)
end
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
if player.room:getCardArea(info.cardId) == Card.DiscardPile then
table.insertIfNeed(ids, info.cardId)
end
end
end
end
return false
end, Player.HistoryTurn)
local num = 0
for _, p in ipairs(Fk:currentRoom().players) do
if p.dead then
num=num+1
end
end
num=num+1
if #ids >0 then
local get = room:askForCardsChosen(player, player, 1, num, {
card_data = {
{ "pile_discard", ids }
}
}, self.name, "#tyj__aihan-choose:::" .. num)
if #get>0 then
room:moveCardTo(get, Player.Hand, player, fk.ReasonJustMove, self.name, "", false, player.id)
end
end
else
room:handleAddLoseSkills(player, "tyj__aihan", nil, true, false)
end
end,
}
local tyj__aihan_targetmod = fk.CreateTargetModSkill {
name = "#tyj__aihan_targetmod",
bypass_times = function(self, player, skill, scope, card, to)
return table.contains(card.skillNames, "tyj__aihan")
end
}
tyj__aihan:addRelatedSkill(tyj__aihan_targetmod)
local tyj__yaoguan = fk.CreateTriggerSkill{
name = "tyj__yaoguan",
anim_type = "control",
events = {fk.Death},
mute=true,
frequency = Skill.Compulsory,
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self, false, true)
end,
on_use = function(self, event, target, player, data)
local room = player.room
local tos ={}
for _,p in ipairs(room.alive_players) do
local skills={}
for _, skill_name in ipairs(Fk.generals[p.general]:getSkillNameList()) do
local skill = Fk.skills[skill_name]
if not (skill.lordSkill) then
if p:hasSkill(skill,true) then
table.insertIfNeed(skills, skill_name)
end
end
end
if p.deputyGeneral and p.deputyGeneral ~= "" then
for _, skill_name in ipairs(Fk.generals[p.deputyGeneral]:getSkillNameList()) do
local skill = Fk.skills[skill_name]
if not (skill.lordSkill) then
if p:hasSkill(skill,true) then
table.insertIfNeed(skills, skill_name)
end
end
end
end
if #skills > 0 then table.insert(tos,p.id)
end
end
table.removeOne(tos, player.id)
local p = room:askForChoosePlayers(player,tos, 1, 1, "妖冠:必须要有一个巫妖王!(令一名其他角色获得此技能)", self.name, false)
if #p > 0 then
local to = room:getPlayerById(p[1])
room:notifySkillInvoked(player,self.name)
player:broadcastSkillInvoke(self.name,math.floor((math.random()*4)+5))
room:doIndicate(player.id,{to.id})
room:doAnimate("InvokeUltSkill", {
name = "tyj__yaoguan",
player = player.id,
deputy = player.deputyGeneral and player.deputyGeneral ~= "" and table.contains(Fk.generals[player.deputyGeneral]:getSkillNameList(true),"tyj__yaoguan"),
})
room:delay(2000)
local skills={}
for _, skill_name in ipairs(Fk.generals[to.general]:getSkillNameList()) do
local skill = Fk.skills[skill_name]
if to:hasSkill(skill,true) then
table.insertIfNeed(skills, skill_name)
end
end
if to.deputyGeneral and to.deputyGeneral ~= "" then
for _, skill_name in ipairs(Fk.generals[to.deputyGeneral]:getSkillNameList()) do
local skill = Fk.skills[skill_name]
if to:hasSkill(skill,true) then
table.insertIfNeed(skills, skill_name)
end
end
end
if #skills>0 then
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 then
room:handleAddLoseSkills(player, "-tyj__yaoguan", nil, true, false)
room:handleAddLoseSkills(to, "-"..choice[1], nil, true, false)
room:handleAddLoseSkills(to, "tyj__yaoguan", nil, true, false)
end
end
end
end,
refresh_events={fk.AfterCardsMove,fk.EventLoseSkill},
can_refresh = function (self, event, target, player, data)
if event == fk.AfterCardsMove then
local equipnum = #player:getCardIds("e")
for _, move in ipairs(data) do
for _, info in ipairs(move.moveInfo) do
if move.from == player.id and info.fromArea == Card.PlayerEquip then
equipnum = equipnum + 1
elseif move.to == player.id and move.toArea == Card.PlayerEquip then
equipnum = equipnum - 1
end
end
end
return #player:getCardIds("e") ~= equipnum and not table.every(player.room.alive_players, function(p)
return #p:getCardIds("e") <= #player:getCardIds("e") end)
else
return data and data.name == "tyj__yaoguan"
end
end,
on_refresh = function (self, event, target, player, data)
if player.hp <= 0 then
local dyingStruct = {
who = player.id,
}
player.room:enterDying(dyingStruct)
end
end
}
local tyj__yaoguan_prevent = fk.CreateTriggerSkill{
name = "#tyj__yaoguan_prevent",
mute=true,
events = {fk.BeforeCardsMove,fk.EventPhaseChanging,fk.BeforeHpChanged,fk.AskForPeachesDone},
frequency = Skill.Compulsory,
anim_type = "defensive",
can_trigger = function(self, event, target, player, data)
if event == fk.BeforeCardsMove then
if not player:hasSkill("tyj__yaoguan") then return false end
for _, move in ipairs(data) do
if move.from == player.id and move.moveReason == fk.ReasonDiscard and move.proposer ~= player.id then
for _, info in ipairs(move.moveInfo) do
if info.fromArea == Card.PlayerEquip and not table.contains({Card.SubtypeDefensiveRide, Card.SubtypeOffensiveRide}, Fk:getCardById(info.cardId).sub_type) then
return true
end
end
end
end
else
if event == fk.EventPhaseChanging then
return target == player and player:hasSkill("tyj__yaoguan") and data.to == Player.Discard and table.every(player.room.alive_players, function(p)
return #p:getCardIds("e") <= #player:getCardIds("e") end)
else
return (event==fk.AskForPeachesDone or (data.num < 0 and player.hp <= math.abs(data.num) and (math.abs(data.num) - math.max(player.hp , 1) + 1) > 0) ) and target == player and player:hasSkill("tyj__yaoguan") and table.every(player.room.alive_players, function(p)
return #p:getCardIds("e") <= #player:getCardIds("e") end)
end
end
end,
on_use = function(self, event, target, player, data)
player.room:notifySkillInvoked(player,"tyj__yaoguan")
player:broadcastSkillInvoke("tyj__yaoguan",math.floor((math.random()*4)+1))
if event == fk.BeforeCardsMove then
local ids = {}
for _, move in ipairs(data) do
if move.from == player.id and move.moveReason == fk.ReasonDiscard and move.proposer ~= player.id then
local move_info = {}
for _, info in ipairs(move.moveInfo) do
local id = info.cardId
if info.fromArea == Card.PlayerEquip and not table.contains({Card.SubtypeDefensiveRide, Card.SubtypeOffensiveRide}, Fk:getCardById(info.cardId).sub_type) then
table.insert(ids, id)
else
table.insert(move_info, info)
end
end
if #ids > 0 then
move.moveInfo = move_info
end
end
end
if #ids > 0 then
player.room:sendLog{
type = "#cancelDismantle",
card = ids,
arg = self.name,
}
end
else
if event == fk.EventPhaseChanging then
return true
elseif event == fk.BeforeHpChanged then
data.preventDying=true
else
if event == fk.AskForPeachesDone then
data.ignoreDeath = true
end
end
end
end,
}
tyj__aihan:addRelatedSkill(tyj__aihan_delay)
tyj__yaoguan:addRelatedSkill(tyj__yaoguan_prevent)
tyj__arthas:addSkill(tyj__aihan)
tyj__arthas:addSkill(tyj__yaoguan)
Fk:loadTranslationTable{
["tyj__aihan"] = "哀寒",
[":tyj__aihan"] = "每回合限X次,你可以将一张牌当作不计入次数的冰【杀】使用,此【杀】造成伤害后你获得至多X张本回合不因使用进入弃牌堆的牌并失去〖哀寒〗至本回合结束(X为已死角色数+1)。",
["@@tyj__aihan-turn"]="哀寒",
["#tyj__aihan-choose"] = "哀寒:从弃牌堆中挑选至多%arg张卡牌获得",
["tyj__yaoguan"] = "妖冠",
["#tyj__yaoguan_prevent"]="妖冠",
[":tyj__yaoguan"] = "锁定技,你装备区的非坐骑牌无法被弃置。若你装备区的牌数为全场最多,你不执行濒死结算与弃牌阶段。你死亡后,须用你的〖妖冠〗代替一名其他角色的一个武将牌上的技能。",
["tyj__fusheng"]="复生",
[":tyj__fusheng"]="主公技,限定技,其他魏势力角色即将死亡时,你可以废除装备与判定区直到其杀死角色,令其改为休整一轮。",
["$tyj__aihan1"]="末日,降临",
["$tyj__aihan2"]="The end has come!",
["$tyj__aihan3"]="命运在召唤你。",
["$tyj__aihan4"]="Destiny calls to you.",
["$tyj__aihan5"]="万物都将在死亡中臣服。",
["$tyj__aihan6"]="All will serve me in death.",
["$tyj__yaoguan1"]="真是可惜。",
["$tyj__yaoguan2"]="What a waste.",
["$tyj__yaoguan3"]="你差点就把我逼到了极限。",
["$tyj__yaoguan4"]="You almost pushed me to my limits",
["$tyj__yaoguan5"]="伟大的命运等着你……",
["$tyj__yaoguan6"]="A great destiny awaits you...",
["$tyj__yaoguan7"]="我的统治永恒……",
["$tyj__yaoguan8"]="My rule is eternal...",
["~tyj__arthas"]="唔呃呃唔啊啊啊啊呃...",
}
Fk:loadTranslationTable{
["tyj__moxue"] = "魔血",
[":tyj__moxue"] = "锁定技,你使用非伤害普通锦囊牌时,失去一点体力。你的体力变化后,你摸一张牌",
["tyj__fenliu"]="分流",
[":tyj__fenliu"] = "你可以失去一点体力,视为使用一张单目标普通锦囊牌(不可指定你为目标)。",
["tyj__jihun"] = "汲魂",
[":tyj__jihun"] = "你对其他角色造成伤害后,可以令其下X次摸牌时,若你的手牌数不大于其,你令摸牌数-1并摸一张牌(X为其本回合响应你的牌的次数+1)",
}
local tyj__varian = General:new(extension, "tyj__varian", "wei", 4,4)
Fk:loadTranslationTable{
["tyj__varian"] = "瓦里安",
["#tyj__varian"] = "联盟的至高王",
["designer:tyj__varian"] = "汤圆",
["cv:tyj__varian"] = "暴雪官方",
["illustrator:tyj__varian"] = "James Ryman",
}
local tyj__saren = fk.CreateActiveSkill{
name = "tyj__saren",
anim_type = "offensive",
target_num = 0,
prompt = function(self)
return "你可以重铸任意张牌,将重铸的最多的花色的手牌当中【决斗】使用"
end,
times = function(self)
if Self.phase == Player.Play then
if Self:getMark("tyj__saren_double")>0 then
return 2 - Self:usedSkillTimes(self.name, Player.HistoryPhase)
else
return 1 - Self:usedSkillTimes(self.name, Player.HistoryPhase)
end
end
return -1
end,
can_use = function(self, player)
if player:usedSkillTimes(self.name, Player.HistoryPhase) == 0 and not player:isNude() then return true end
return player:usedSkillTimes(self.name, Player.HistoryPhase) <=1 and player:getMark("tyj__saren_double")>0 and not player:isNude()
end,
card_filter = function(self, to_select, selected)
return true
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
room:recastCard(effect.cards, player, self.name)
if player.dead then return end
local suits={}
local use = {}
local cardsx={}
local suit = ""
for _, id in ipairs(effect.cards) do
suit = Fk:getCardById(id):getSuitString()
if not use[suit] then
use[suit]=1
else
use[suit]=use[suit]+1
end
end
for k,v in pairs(use) do
local add=true
for _,f in pairs(use) do
if f > v then add =false end
end
if add == true then
table.insertIfNeed(suits,k)
end
end
for _, s in ipairs(suits)do
for __,c in ipairs(player:getCardIds("h")) do
if Fk:getCardById(c):getSuitString() == s then
table.insertIfNeed(cardsx,c)
end
end
end
if #cardsx>0 then
player:showCards(player:getCardIds('h'))
U.askForUseVirtualCard(room, player, "duel", cardsx, self.name, "将这些牌当【决斗】使用", false)
end
end,
}
local tyj__saren_draw = fk.CreateTriggerSkill{
name="#tyj__saren_draw",
refresh_events={fk.CardUsing,fk.EnterDying},
can_refresh = function (self, event, target, player, data)
if event==fk.EnterDying and target == player then
return true
end
if player:hasSkill("tyj__saren") and target == player and data.card.name == "duel" then
local events = player.room.logic:getEventsOfScope(GameEvent.Death, 1, function (e)
local deathData = e.data[1]
return deathData.damage and deathData.damage.from == player
end, Player.HistoryGame)
return #events>0
end
end,
on_refresh = function (self, event, target, player, data)
if event==fk.EnterDying then
local room = player.room
player.room:setPlayerMark(player,"tyj__saren_double",1)
if player:hasSkill("tyj__saren") and player:getMark("@@tyj__saren_double")==0 and (player.general=="tyj__varian" or player.deputyGeneral == "tyj__varian")then
--这部分检测武将牌是否为瓦里安只是给瓦里安一个炫酷的特效,并不影响游戏对局。
room:broadcastPlaySound("./packages/tyj/audio/extra/tyj__varianBGM")
room:doAnimate("InvokeUltSkill", {
name = "tyj__saren",
player = player.id,
deputy = player.deputyGeneral and player.deputyGeneral ~= "" and table.contains(Fk.generals[player.deputyGeneral]:getSkillNameList(true),"tyj__saren"),
})
room:delay(2000)
player.room:setPlayerMark(player,"@@tyj__saren_double",1)
end
else
player.room:drawCards(player,1,'tyj__saren')
end
end
}
tyj__saren:addRelatedSkill(tyj__saren_draw)
local tyj__yichou= fk.CreateTriggerSkill{
name="tyj__yichou",
events={fk.DamageInflicted,fk.DamageCaused},
can_trigger= function (self, event, target, player, data)
if player:hasSkill(self) and target == player then
return true
end
end,
on_cost=function (self, event, target, player, data)
return player.room:askForSkillInvoke(player, self.name, data, "#tyj__yichou-invoke::"..data.to.id)
end,
on_use= function (self, event, target, player, data)
data.damage = data.damage + 1
if data.from and data.from.id then
local mark = data.to:getTableMark("@@tyj__yichou")
table.insert(mark,data.from.id)
player.room:setPlayerMark(data.to,"@@tyj__yichou",mark)
end
end,
refresh_events={fk.DamageCaused,fk.DamageFinished},
can_refresh= function (self, event, target, player, data)
if event == fk.DamageCaused then
return target == player and table.contains(player:getTableMark("@@tyj__yichou"),data.to.id)
else
return data.extra_data and data.extra_data.tyj_yichou_draw and data.extra_data.tyj_yichou_draw == player.id
end
end,
on_refresh=function (self, event, target, player, data)
local room = player.room
if event == fk.DamageCaused then
local draw = false
local mark = player:getTableMark("@@tyj__yichou")
for i=#mark,1,-1 do
if mark[i]==data.to.id then
data.damage=data.damage+1
draw=true
table.remove(mark,i)
end
end
if #mark == 0 then
room:setPlayerMark(player,"@@tyj__yichou",0)
else
room:setPlayerMark(player,"@@tyj__yichou",mark)
end
if draw == true then
data.extra_data = data.extra_data or {}
data.extra_data.tyj_yichou_draw = player.id
end
else
room:drawCards(data.from,data.damage,self.name)
end
end
}
tyj__varian:addSkill(tyj__saren)
tyj__varian:addSkill(tyj__yichou)
Fk:loadTranslationTable{
["tyj__saren"] = "飒刃",
[":tyj__saren"] = "出牌阶段限一次,你可以重铸任意张牌,然后展示手牌并将其中重铸的最多的花色的手牌当【决斗】使用。若你进入过濒死,改为出牌阶段限两次;若你杀死过角色,你使用【决斗】时摸一张牌。",
["@@tyj__saren_double"]="飒刃 限两次",
["tyj__yichou"]="夷仇",
["@@tyj__yichou"]="夷仇",
["#tyj__yichou-invoke"]="夷仇:是否令 %dest 受到的伤害值+1?",
[":tyj__yichou"]="你造成或受到伤害时,可以令伤害值+1。若如此做,受伤角色下次对伤害来源造成伤害时,其令伤害值+1并于伤害结算后摸伤害值张牌。",
["$tyj__saren1"]="暴风城的将士们听我号令。",
["$tyj__saren2"]="Behold the armies of Stormwind.",
["$tyj__saren3"]="为了联盟!",
["$tyj__saren4"]="For the Alliance!",
["$tyj__yichou1"]="与我为敌便是自取灭亡。",
["$tyj__yichou2"]="Woe betide those who set themselves against me.",
["$tyj__yichou3"]="我会让你体会到我的痛苦!",
["$tyj__yichou4"]="May you suffer as I have!",
["~tyj__varian"]="嗯呃啊啊啊啊嗯...",
}
local tyj__alleria = General:new(extension, "tyj__alleria", "wu", 3,3,General.Female)
Fk:loadTranslationTable{
["tyj__alleria"] = "奥蕾莉亚",
["#tyj__alleria"] = "翠林游侠",
["designer:tyj__alleria"] = "汤圆",
["cv:tyj__alleria"] = "暴雪官方",
["illustrator:tyj__alleria"] = "Konstantin Turovec",
}
local tyj__xunlie_viewas = fk.CreateViewAsSkill {
name = "#tyj__xunlie_viewas",
interaction = function()
local name = Self:getMark("tyj__xunlie_usecard-phase")
if #name == 0 then return end
return UI.ComboBox { choices = name }
end,
card_filter = function(self, to_select, selected)
if #selected == 1 then return false end
return true
end,
view_as = function(self, cards)
if not self.interaction.data or #cards~= 1 then return end
local card = Fk:cloneCard(self.interaction.data)
card:addSubcard(cards[1])
card.skillName = "tyj__xunlie"
return card
end,
}
Fk:addSkill(tyj__xunlie_viewas)
local tyj__xunlie = fk.CreateTriggerSkill{
name="tyj__xunlie",
events = {fk.EventPhaseEnd},
can_trigger= function (self, event, target, player, data)
local room = player.room
local ids = target:getTableMark( "tyj__xunlie_usecard-phase")
player.room.logic:getEventsOfScope(GameEvent.UseCard, 1, function (e)
local use = e.data[1]
if use and use.cardsResponded then
table.insertIfNeed(ids, use.card.name)
end
end, Player.HistoryPhase)
room:setPlayerMark(target, "tyj__xunlie_usecard-phase", ids)
if #target:getTableMark( "tyj__xunlie_usecard-phase")>0 and player:hasSkill(self) then
return not player:isNude()
end
end,
on_cost = function (self, event, target, player, data)
local room = player.room
local mark=target:getTableMark( "tyj__xunlie_usecard-phase")
room:setPlayerMark(player, "tyj__xunlie_usecard-phase",mark)
local success, dat = player.room:askForUseViewAsSkill(player, "#tyj__xunlie_viewas", "巡猎", true, {bypass_distances = true})
if success then
self.cost_data=dat
return true
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
if self.cost_data then
local dat = self.cost_data
local card = Fk.skills["#tyj__xunlie_viewas"]:viewAs(dat.cards)
local use = {from = player.id, tos = table.map(dat.targets, function(p) return {p} end), card = card}
room:useCard(use)
if use.damageDealt then
local num=math.floor(math.random())+1
room:broadcastPlaySound("./packages/tyj/audio/extra/tyj__xunlie_hit"..tostring(num))
local tos={}
for _, p in ipairs(room.alive_players) do
if not p:hasSkill("ol_ex__jiewei",true,true) then
table.insertIfNeed(tos,p.id)
end
end
if #tos>0 then
local result = room:askForChoosePlayers(player,tos,1,1,"令一名角色获得 解围 或取消并摸一张牌","tyj__xunlie",true)
if #result>0 then
room:doIndicate(player.id,{result[1]})
room:handleAddLoseSkills(room:getPlayerById(result[1]), "ol_ex__jiewei", nil, true, false)
else
player:drawCards(1,"tyj__xunlie")
end
else
player:drawCards(1,"tyj__xunlie")
end
end
end
end
}
local tyj__fengxing = fk.CreateTriggerSkill{
name = "tyj__fengxing",
anim_type = "defensive",
events = {fk.AfterCardsMove},
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 == player.id then
for _, info in ipairs(move.moveInfo) do
if (info.fromArea == Card.PlayerEquip and Fk:getCardById(info.cardId).color == Card.Red ) or (info.fromArea==Card.PlayerHand and Fk:getCardById(info.cardId).name == "jink" ) then
return not player.room.current:isNude()
end
end
end
end
end,
on_cost = function (self, event, target, player, data)
local room = player.room
return room:askForSkillInvoke(player, self.name, data, "#tyj__fengxing-invoke::"..room.current.id)
end,
on_use = function (self, event, target, player, data)
local room = player.room
if not room.current:isNude() then
room:doIndicate(player.id,{room.current.id})
local result = room:askForCardChosen(player,room.current,'he',self.name,'风行:选择要被获得的牌')
if result then
local tos = table.map(room.alive_players,Util.IdMapper)
local to = room:askForChoosePlayers(player,tos,1,1,"#tyj__fengxing-gain:::"..Fk:getCardById(result):toLogString(),self.name,true)
if #to >0 then
room:obtainCard(room:getPlayerById(to[1]), result, false, fk.ReasonPrey,player.id,self.name)
end
end
end
end,
}
tyj__alleria:addSkill(tyj__xunlie)
tyj__alleria:addRelatedSkill("ol_ex__jiewei")
tyj__alleria:addSkill(tyj__fengxing)
Fk:loadTranslationTable{
["tyj__xunlie"] = "巡猎",
[":tyj__xunlie"] = "任意角色的阶段结束时,你可以将一张牌当本阶段被抵消过的一张牌使用(无距离限制),若造成了伤害,你摸一张牌或令一名角色获得〖解围〗。",
["tyj__fengxing"] = "风行",
[":tyj__fengxing"] = "你失去【闪】或装备区内的红色牌后,可以将当前回合角色的一张牌交给一名角色。",
["#tyj__fengxing-invoke"]="是否对 %dest 发动 风行 ?(分配其的一张牌)",
["#tyj__fengxing-gain"] = "风行:选择获得 %arg 的角色",
["@tyj__xunlie_usecard"]="巡猎",
["#tyj__xunlie_viewas"]="巡猎",
["$tyj__xunlie1"]="我很快就会报仇的!",
["$tyj__xunlie2"]="My revenge will be swift!",
["$tyj__xunlie3"]="射死哪一个呢?",
["$tyj__xunlie4"]="Who to shoot...",
["$tyj__fengxing1"]="我从不颤抖。",
["$tyj__fengxing2"]="I never tremble.",
["$tyj__fengxing3"]="快做出决定!",
["$tyj__fengxing4"]="Move. Now!",
["$ol_ex__jiewei_tyj__alleria1"]="我的弓箭听你指挥。",
["$ol_ex__jiewei_tyj__alleria2"]="You have my bow.",
["~tyj__alleria"]="唔啊啊啊呃啊啊啊啊啊哦呃呃啊呃...",
}
local tyj__onyxia = General:new(extension, "tyj__onyxia", "shu", 4,4,General.Female)
Fk:loadTranslationTable{
["tyj__onyxia"] = "奥妮克希亚",
["#tyj__onyxia"] = "龙巢之母",
["designer:tyj__onyxia"] = "汤圆",
["cv:tyj__onyxia"] = "暴雪官方",
["illustrator:tyj__onyxia"] = "Konstantin Turovec",
}
local tyj__onyxia_dragon = General(extension, "tyj__onyxia_dragon", "shu", 8, 8, General.Female)
tyj__onyxia_dragon.total_hidden = true
Fk:loadTranslationTable{
["tyj__onyxia_dragon"] = "奥妮克希亚",
["#tyj__onyxia_dragon"] = [[奥妮克希亚的龙形态<font color="red"><br>仅作展示,并不会出现在选将框。</font>]],
["designer:tyj__onyxia"] = "汤圆",
["cv:tyj__onyxia"] = "暴雪官方",
["illustrator:tyj__onyxia"] = "Alex Stone",
}
local tyj__yinju = fk.CreateActiveSkill{
name = "tyj__yinju",
anim_type = "switch",
switch_skill_name = "tyj__yinju",
times = function(self)
return Self.phase == Player.Play and 1 - Self:usedSkillTimes(self.name, Player.HistoryPhase) or -1
end,
target_num = 2,
prompt = "引局:选择两名角色令他们拼点",
can_use = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
end,
card_filter = function(self, to_select, selected, selected_targets)
return false
end,
target_filter = function(self, to_select, selected, selected_cards)
if #selected < 2 and not Fk:currentRoom():getPlayerById(to_select):isKongcheng() then
if #selected == 0 then
return true
elseif #selected == 1 and Fk:currentRoom():getPlayerById(selected[1]):canPindian(Fk:currentRoom():getPlayerById(to_select)) then
return true
end
end
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
local targets = table.map(effect.tos, function(id) return room:getPlayerById(id) end)
local pindian = targets[1]:pindian({targets[2]}, self.name)
local switch_state = player:getSwitchSkillState(self.name, true)
if player.dead then return end
local losers = {}
local winner = {}
if pindian.results[targets[2].id].winner == targets[1] then
losers = {targets[2]} winner ={targets[1]}
elseif pindian.results[targets[2].id].winner == targets[2] then
losers = {targets[1]} winner ={targets[2]}
else
losers = targets
end
if switch_state == fk.SwitchYang and #winner ~=0 and (losers[1]:isAlive() or player:isAlive()) then
local tos = {losers[1].id,player.id}
for _, p in ipairs(winner) do
local to = room:askForChoosePlayers(p,tos,1,1,"引局:对他们之一造成一点伤害",self.name,false)
if #to >0 then
room:damage{
from = p,
to = room:getPlayerById(to[1]),
damage = 1,
skillName = self.name,
}
end
end
end
if switch_state == fk.SwitchYin and #losers ~= 0 then
for _, p in ipairs(losers) do
local tos = {}
if #winner>0 and winner[1]:isAlive() and winner[1]:isWounded() then
table.insertIfNeed(tos,winner[1].id)
end
if player:isAlive() and player:isWounded() then
table.insertIfNeed(tos,player.id)
end
if #tos >0 then
local to = room:askForChoosePlayers(p,tos,1,1,"引局:令他们之一回复一点体力",self.name,false)
if #to >0 then
room:recover{
who = room:getPlayerById(to[1]),
num = 1,
recoverBy = p,
skillName = self.name
}
end
end
end
end
end,
}
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 skills = table.connect(playerx.related_other_skills,myrelated_skills)
for _, skill in ipairs(skills) do
table.insert(ret, skill.name)
end
end
return ret
end
local tyj__nishen= fk.CreateTriggerSkill{
name = "tyj__nishen",
anim_type = "masochism",
frequency = Skill.Compulsory,
events = {fk.Damaged,fk.AfterSkillEffect},
can_trigger = function (self, event, target, player, data)
if target == player and player:hasSkill(self) then
if event == fk.Damaged then
return true
else
local mark = player:getTableMark(self.name)
return data.name and #mark>0 and table.contains(mark,data.name)
end
end
end,
on_trigger = function(self, event, target, player, data)
if event == fk.Damaged then
for _ = 1, data.damage do
if not player:hasSkill(self) then break end
self:doCost(event, target, player, data)
end
else
if player:hasSkill(self) then
self:doCost(event, target, player, data)
end
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
if event == fk.Damaged then
local mark = player:getTableMark("tyj__nishen_skillpool")
if #mark == 0 then
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) and string.find(Fk:translate(skn),"龙") )or (Fk:translate(":"..skn) and string.find(Fk:translate(":"..skn),"龙") )then
if skn ~= "tyj__nishen" then
table.insertIfNeed(mark,skn)
end
end
end
end
end
if #mark >0 then
room:setPlayerMark(player,"tyj__nishen_skillpool",mark)
end
end
local skill=table.random(table.filter(mark,function(sk) return not player:hasSkill(sk,true,true)end),1)
if not player:hasSkill(skill[1],true,true) then
room:handleAddLoseSkills(player, skill[1],nil, true, false)
local skillsx = player:getTableMark( self.name)
table.insert(skillsx, skill[1])
room:setPlayerMark(player, self.name, skillsx)
if player.general == "tyj__onyxia" then
local ogeneral = player.general
player.general = "tyj__onyxia_dragon"
room:broadcastProperty(player, "general")
room:delay(800)
player.general = ogeneral
room:broadcastProperty(player, "general")
elseif player.deputyGeneral == "tyj__onyxia" then
local ogeneral = player.deputyGeneral
player.deputyGeneral = "tyj__onyxia_dragon"
room:broadcastProperty(player, "deputyGeneral")
room:delay(800)
player.general = ogeneral
room:broadcastProperty(player, "general")
end
end
else
local choice = room:askForChoice(player, {"#tyj__nishen-remove:::"..data.name, "#tyj__nishen-dragon"},"tyj__nishen")
if choice == "#tyj__nishen-dragon" then
room:handleAddLoseSkills(player,"-tyj__nishen",nil, true, false)
room:handleAddLoseSkills(player,"-tyj__yinju",nil, true, false)
if player.general == "tyj__onyxia" then
player.general = "tyj__onyxia_dragon"
room:broadcastProperty(player, "general")
end
if player.deputyGeneral == "tyj__onyxia" then
player.deputyGeneral = "tyj__onyxia_dragon"
room:broadcastProperty(player, "deputyGeneral")
end
room:broadcastPlaySound("./packages/tyj/audio/extra/tyj__onyxia_dragonBGM")
room:broadcastPlaySound("./packages/tyj/audio/extra/tyj__onyxia_transe")
room:doAnimate("InvokeUltSkill", {
name = "tyj__nishen",
player = player.id,
deputy = player.deputyGeneral and player.deputyGeneral ~= "" and table.contains(Fk.generals[player.deputyGeneral]:getSkillNameList(true),"tyj__nishen"),
})
room:delay(2000)
else
room:handleAddLoseSkills(player,"-"..data.name,nil, true, false)
local mark = player:getTableMark(self.name)
table.removeOne(mark,data.name)
room:setPlayerMark(player,self.name,mark)
end
end
end,
}
tyj__onyxia:addSkill(tyj__yinju)
tyj__onyxia:addSkill(tyj__nishen)
Fk:loadTranslationTable{
["tyj__yinju"]="引局",
[":tyj__yinju"]="转换技,出牌阶段限一次,你可以令两名角色拼点,然后 阳:赢的角色对你或没赢的角色造成一点伤害;阴:没赢的角色令你或赢的角色回复一点体力。",
["tyj__nishen"]="匿身",
[":tyj__nishen"]="锁定技,你受到1点伤害后,随机获得一个名称或描述中包含“龙”的技能。你发动因此获得的后选择一项:1.失去发动的技能;2.失去〖匿身〗与〖引局〗。",
["#tyj__nishen-remove"]="失去〖%arg〗",
["#tyj__nishen-dragon"]="失去〖匿身〗与〖引局〗",
["$tyj__yinju1"]="何必跟我装好人。",
["$tyj__yinju2"]="Don't play coy with me.",
["$tyj__yinju3"]="这世上的英雄够多了。",
["$tyj__yinju4"]="This world has enough heroes.",
["$tyj__nishen1"]="我不只看上去这么简单。",
["$tyj__nishen2"]="I am more than I seem.",
["$tyj__nishen3"]="每个人都有伪装。",
["$tyj__nishen4"]="We all have our disguises.",
["~tyj__onyxia"]="哦呃呃呃呃呃呃嗯...啊呃呃呃呃嗯嗯",
}
local tyj__vereesa = General:new(extension, "tyj__vereesa", "wei", 3,3,General.Female)
Fk:loadTranslationTable{
["tyj__vereesa"] = "温蕾萨",
["#tyj__vereesa"] = "恸怨化毒",
["designer:tyj__vereesa"] = "汤圆",
["cv:tyj__vereesa"] = "暴雪官方",
["illustrator:tyj__vereesa"] = "Konstantin Turovec",
}
local tyj__tongzhi = fk.CreateViewAsSkill{
name = "tyj__tongzhi",
anim_type = "offensive",
pattern = ".|.|.|.|.|basic",
interaction = function()
local names = {}
for _, id in ipairs(Fk:getAllCardIds()) do
local card = Fk:getCardById(id)
if card.type == Card.TypeBasic and
not card.is_derived and
((Fk.currentResponsePattern == nil and Self:canUse(card)) or
(Fk.currentResponsePattern and Exppattern:Parse(Fk.currentResponsePattern):match(card))) then
table.insertIfNeed(names, card.name)
end
end
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 = self.name
return card
end,
before_use = function(self, player, use)
local room = player.room
local skills = {}
local all_choices = {"#tyj__tongzhi_hand","#tyj__tongzhi_equip","#tyj__tongzhi_judge"}
if #player:getCardIds("h")>0 and player:getMark("tyj__tongzhi_hand-phase")==0 then
table.insertIfNeed(skills,"#tyj__tongzhi_hand")
end
if #player:getCardIds("e")>0 and player:getMark("tyj__tongzhi_equip-phase")==0 then
table.insertIfNeed(skills,"#tyj__tongzhi_equip")
end
if #player:getCardIds("j")>0 and player:getMark("tyj__tongzhi_judge-phase")==0 then
table.insertIfNeed(skills,"#tyj__tongzhi_judge")
end
for _, skill in ipairs(player.player_skills) do
if skill:isPlayerSkill(player) then
table.insert(skills, skill.name)
table.insert(all_choices,skill.name)
end
end
if #skills >0 then
-- FIXME: 傻逼神典韦
local choice = room:askForChoice(player, skills, self.name, "#youlong-choice", false, all_choices)
if choice == "#tyj__tongzhi_hand" then
room:setPlayerMark(player,"tyj__tongzhi_hand-phase",1)
room:moveCardTo(player:getCardIds("h"), Card.DiscardPile, nil, fk.ReasonPutIntoDiscardPile, self.name)
elseif choice == "#tyj__tongzhi_equip" then
room:moveCardTo(player:getCardIds("e"), Card.DiscardPile, nil, fk.ReasonPutIntoDiscardPile, self.name)
room:setPlayerMark(player,"tyj__tongzhi_equip-phase",1)
elseif choice == "#tyj__tongzhi_judge" then
room:moveCardTo(player:getCardIds("j"), Card.DiscardPile, nil, fk.ReasonPutIntoDiscardPile, self.name)
room:setPlayerMark(player,"tyj__tongzhi_judge-phase",1)
else
if player:hasSkill(choice,true,true) then
room:handleAddLoseSkills(player,"-"..choice,nil, true, false)
end
end
end
end,
enabled_at_play = function(self, player)
local skills = {}
if #player:getCardIds("h")>0 and player:getMark("tyj__tongzhi_hand-phase")==0 then
table.insertIfNeed(skills,"#tyj__tongzhi_hand-phase")
end
if #player:getCardIds("e")>0 and player:getMark("tyj__tongzhi_equip-phase")==0 then
table.insertIfNeed(skills,"#tyj__tongzhi_equip-phase")
end
if #player:getCardIds("j")>0 and player:getMark("tyj__tongzhi_judge-phase")==0 then
table.insertIfNeed(skills,"#tyj__tongzhi_judge-phase")
end
for _, skill in ipairs(player.player_skills) do
if skill:isPlayerSkill(player) then
table.insert(skills, skill.name)
end
end
return #skills>0
end,
enabled_at_response = function(self, player, response)
local skills = {}
if #player:getCardIds("h")>0 and player:getMark("tyj__tongzhi_hand-phase")==0 then
table.insertIfNeed(skills,"#tyj__tongzhi_hand-phase")
end
if #player:getCardIds("e")>0 and player:getMark("tyj__tongzhi_equip-phase")==0 then
table.insertIfNeed(skills,"#tyj__tongzhi_equip-phase")
end
if #player:getCardIds("j")>0 and player:getMark("tyj__tongzhi_judge-phase")==0 then
table.insertIfNeed(skills,"#tyj__tongzhi_judge-phase")
end
for _, skill in ipairs(player.player_skills) do
if skill:isPlayerSkill(player) then
table.insert(skills, skill.name)
end
end
return (not response) and #skills>0
end,
}
local tyj__tongzhi_delay = fk.CreateTriggerSkill{
name = "#tyj__tongbi_delay",
anim_type = "special",
mute=true,
events = {fk.Deathed},
can_trigger = function(self, event, target, player, data)
if player:hasSkill("tyj__tongzhi") then
local ids=false
player.room.logic:getEventsOfScope(GameEvent.UseCard, 1, function (e)
local use = e.data[1]
if use and use.card and use.card.skillNames and table.contains(use.card.skillNames,"tyj__tongzhi") and table.contains(TargetGroup:getRealTargets(use.tos),target.id) then
ids=true
end
end, Player.HistoryGame)
return ids
end
end,
on_cost = function (self, event, target, player, data)
return true
end,
on_use = function (self, event, target, player, data)
local room = player.room
room:broadcastPlaySound("./packages/tyj/audio/extra/tyj__vereesaBGM")
room:broadcastPlaySound("./packages/tyj/audio/skill/ol__zhendu_tyj__vereesa1")
room:notifySkillInvoked(player,"tyj__tongzhi")
room:handleAddLoseSkills(player,"ol__zhendu",nil, true, false)
room:doAnimate("InvokeUltSkill", {
name = "tyj__tongzhi",
player = player.id,
deputy = player.deputyGeneral and player.deputyGeneral ~= "" and table.contains(Fk.generals[player.deputyGeneral]:getSkillNameList(true),"tyj__tongzhi"),
})
room:delay(2000)
end
}
tyj__tongzhi:addRelatedSkill(tyj__tongzhi_delay)
tyj__vereesa:addSkill(tyj__tongzhi)
tyj__vereesa:addSkill("tyj__fengxing")
tyj__vereesa:addRelatedSkill("ol__zhendu")
Fk:loadTranslationTable{
["tyj__tongzhi"]="恸执",
[":tyj__tongzhi"]="你可以弃置你一个区域内的牌(每阶段每个区域限一次)或失去一个技能,视为使用一张基本牌。成为过此牌的目标的角色死亡后,你获得〖鸩毒〗。",
["#tyj__tongzhi_hand"]="手牌区",
["#tyj__tongzhi_equip"]="装备区",
["#tyj__tongzhi_judge"]="判定区",
['#tyj__tongzhi-choice'] = '恸执:弃置一个区域内的牌或失去一个技能',
["#tyj__tongbi_delay"]="恸执",
["$tyj__tongzhi1"]="我们并肩作战!",
["$tyj__tongzhi2"]="We stand together!",
["$tyj__fengxing_tyj__vereesa1"]="没人能躲过群星之怒!",
["$tyj__fengxing_tyj__vereesa2"]="None can escape the fury of the stars!",
["$ol__zhendu_tyj__vereesa1"]="你要为罗宁偿命。",
["$ol__zhendu_tyj__vereesa2"]="You'll pay! For Rhonin!",
["~tyj__vereesa"]="欸呃啊...",
}
--local tyj__dehaka = General:new(extension, "tyj__dehaka", "qun", 4,4)
Fk:loadTranslationTable{
["tyj__dehaka"] = "德哈卡",
["#tyj__dehaka"] = "原始异虫",
["designer:tyj__dehaka"] = "汤圆",
["cv:tyj__dehaka"] = "暴雪官方",
["illustrator:tyj__dehaka"] = "暴雪官方",
}
local tyj__juebian = fk.CreateTriggerSkill{
name = "tyj__juebian",
anim_type = "support",
frequency=Skill.Compulsory,
events = {fk.GameStart, fk.AfterCardsMove,fk.AfterCardUseDeclared},
can_trigger = function(self, event, target, player, data)
if event == fk.GameStart then
return player:hasSkill(self) and not player:isKongcheng()
elseif event == fk.AfterCardsMove then
for _, move in ipairs(data) do
if move.to == player.id and move.toArea == Player.Hand then
return player:hasSkill(self)
end
end
else
return target == player and player:hasSkill(self) and (player:getMark("tyj__juebian-turn")==0 or player:getMark("tyj__juebian-turn")<= player:getLostHp()) and
table.find({"@fujia", "@kongchao", "@canqu", "@zhuzhan"}, function(mark) return data.card:getMark(mark) ~= 0 end)
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
if event == fk.AfterCardUseDeclared then
data.extra_data = data.extra_data or {}
data.extra_data.variation = true
else
local cards = {}
if event == fk.GameStart then
cards = player:getCardIds("h")
else
for _, move in ipairs(data) do
if move.to == player.id and move.toArea == Player.Hand then
for _, info in ipairs(move.moveInfo) do
table.insertIfNeed(cards,info.cardId)
end
end
end
end
if #cards>0 then
local triglist = {"@kongchao","@canqu","@zhuzhan","@fujia"}
local efflist = {"variation_addtarget","variation_disresponsive","variation_damage","variation_cancel","variation_draw","variation_minustarget"}
for _,c in ipairs(cards) do
local card = Fk:getCardById(c)
if card:getMark("@fujia")~=0 or card:getMark("@kongchao") ~= 0 or card:getMark("@canqu") ~= 0 or card:getMark("@zhuzhan") ~= 0 then
else
local trig = table.random(triglist,1)[1]
local eff = table.random(efflist,1)[1]
room:setCardMark(card, trig, Fk:translate(eff))
room:setCardMark(card, "tyj__juebian_yb",trig)
end
end
end
end
end,
refresh_events = {fk.CardUseFinished,fk.CardUsing},
can_refresh = function (self, event, target, player, data)
if event == fk.CardUsing then
return target == player
else
return data.card:getMark("tyj__juebian_yb")~=0
end
end,
on_refresh = function (self, event, target, player, data)
local room = player.room
if event == fk.CardUseFinished then
room:setCardMark(data.card, data.card:getMark("tyj__juebian_yb"),0)
room:setCardMark(data.card, "tyj__juebian_yb",0)
else
player.room:addPlayerMark(player, "tyj__juebian-turn", 1)
end
end,
}
local tyj__nahua = fk.CreateTriggerSkill{
name = "tyj__nahua",
anim_type = "special",
events = {fk.Damage,fk.Damaged,},
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) and target == player then
if event == fk.Damage then
return data.to ~= player and data.to~=nil
else
return data.from ~= player and data.from~=nil
end
end
end,
on_cost = function (self, event, target, player, data)
local to = nil
if event == fk.Damage then
to =data.to
else
to = data.from
end
local skillscan={}
local skills=player:getTableMark("tyj__nahua_skills")
for _, skill_name in ipairs(Fk.generals[to.general]:getSkillNameList()) do
local skill = Fk.skills[skill_name]
if to:hasSkill(skill,true,true) then
table.insertIfNeed(skills, skill_name)
end
end
if to.deputyGeneral and to.deputyGeneral ~= "" then
for _, skill_name in ipairs(Fk.generals[to.deputyGeneral]:getSkillNameList()) do
local skill = Fk.skills[skill_name]
if to:hasSkill(skill,true,true) then
table.insertIfNeed(skills, skill_name)
end
end
end
for _, skn in ipairs(skills) do
local skilladd=false
if not player:hasSkill(skn) then
player.room:handleAddLoseSkills(player,skn,nil,false,true)
skilladd=true
end
local skill = Fk.skills[skn]
local _skill=skill
if not _skill:isInstanceOf(TriggerSkill) then
_skill = table.find(_skill.related_skills, function (s)
return s:isInstanceOf(TriggerSkill) and table.contains(s.events,event)
end)
end
if _skill and _skill:isInstanceOf(TriggerSkill) and table.contains(_skill.events,event) then
if _skill and _skill:triggerable(event, target, player, data) then
table.insertIfNeed(skillscan, skn)
end
end
if skilladd==true then
player.room:handleAddLoseSkills(player,"-"..skn,nil,false,true)
end
end
if #skillscan >0 then
local result = player.room:askForCustomDialog(player,self.name,
"packages/tyj/qml/ChooseSkillBox.qml", {
skillscan, 0, 1, "是否发动其中一个技能"
})
if result == "" then return false end
local choice = json.decode(result)
if choice and #choice>0 then
self.cost_data = choice[1]
player.room:handleAddLoseSkills(player,choice[1],nil,false,true)
return true
end
end
end,
on_use = function (self, event, target, player, data)
local skill = Fk.skills[self.cost_data]
local _skill=skill
if not _skill:isInstanceOf(TriggerSkill) then
_skill = table.find(_skill.related_skills, function (s)
return s:isInstanceOf(TriggerSkill) and table.contains(s.events,event)
end)
end
if _skill and _skill:isInstanceOf(TriggerSkill) and table.contains(_skill.events,event) then
_skill:trigger(event, target, player, data)
local mark = player:getTableMark("tyj__nahua_skills")
table.insertIfNeed(mark,self.cost_data)
player.room:setPlayerMark(player,"tyj__nahua_skills",mark)
end
player.room:handleAddLoseSkills(player,"-"..self.cost_data,nil,false,true)
end,
}
--tyj__dehaka:addSkill(tyj__juebian)
--tyj__dehaka:addSkill(tyj__nahua)
Fk:loadTranslationTable{
["tyj__juebian"]="谲变",
[":tyj__juebian"]="锁定技,你的初始手牌与获得的牌随机获得一个应变效果直到你使用这张牌后。你每回合使用的前X张牌无视应变条件(X为你的已损体力值+1)。",
["tyj__nahua"]="纳华",
[":tyj__nahua"]="你对其他角色造成伤害后,或受到其他角色造成的伤害后,可以发动一个因〖纳华〗发动过的技能,或发动其武将牌上的一个技能。",
}
local tyj__neltharion = General:new(extension, "tyj__neltharion", "shu", 12,12)
Fk:loadTranslationTable{
["tyj__neltharion"] = "奈萨里奥",
["#tyj__neltharion"] = "死亡之翼",
["designer:tyj__neltharion"] = "汤圆",
["cv:tyj__neltharion"] = "暴雪官方",
["illustrator:tyj__neltharion"] = "网络",
}
local tyj__shiyi_viewas = fk.CreateViewAsSkill{
name = "tyj__shiyi_viewas",
card_num = 1,
prompt = function (self, selected, selected_cards)
return "蚀翼:将一张牌当作造成火属性伤害的【决斗】使用"
end,
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("duel")
card:addSubcard(cards[1])
card.skillName = "tyj__shiyi"
return card
end,
}
Fk:addSkill(tyj__shiyi_viewas)
local tyj__shiyi = fk.CreateTriggerSkill{
name="tyj__shiyi",
events = {fk.HpChanged,fk.MaxHpChanged},
frequency = Skill.Compulsory,
can_trigger = function (self, event, target, player, data)
if not player:hasSkill(self) or target ~= player then return false end
return data.num and data.num<0
end,
on_trigger = function(self, event, target, player, data)
if event == fk.HpChanged then
for _ = 1, math.abs(data.num) do
if not player:hasSkill(self) then break end
if not table.find(player.room.alive_players, function(p) return p.dying end) then
self:doCost(event, target, player, data)
end
end
else
self:doCost(event, target, player, data)
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
if event == fk.HpChanged then
if not player:isNude() then
local success, dat = player.room:askForUseViewAsSkill(player, "tyj__shiyi_viewas", "#tyj__shiyi_viewas", false, {bypass_times = true})
if success then
room:notifySkillInvoked(player, self.name)
player:broadcastSkillInvoke(self.name,math.floor((math.random()*4)+5))
local card = Fk.skills["tyj__shiyi_viewas"]:viewAs(dat.cards)
local use = {from = player.id, tos = table.map(dat.targets, function(p) return {p} end), card = card}
room:useCard(use)
end
end
else
player:drawCards(math.abs(data.num),self.name)
local cards = player:getCardIds("he")
local cards2 = table.filter(room.draw_pile, function (id)
return Fk:getCardById(id).trueName == 'slash'
end)
local cardsg = table.random(cards2,#cards)
if type(cards) == "number" then
cards = {cards}
end
room:moveCards({
ids = cards,
from = player.id,
toArea = Card.DiscardPile,
skillName = "tyj__shiyi",
moveReason = fk.ReasonRecast,
proposer = player.id
})
room:sendFootnote(cards, {
type = "##RecastCard",
from = player.id,
})
room:broadcastPlaySound("./audio/system/r2ecast")
room:sendLog{
type = "#RecastBySkill",
from = player.id,
card = cards,
arg = "tyj__shiyi",
}
if #cardsg>0 then
room:moveCards({
ids = cardsg,
to = player.id,
toArea = Card.PlayerHand,
moveReason = fk.ReasonDraw,
proposer = player.id,
skillName = "tyj__shiyi",
})
end
end
end,
refresh_events = {fk.PreDamage},
can_refresh = function (self, event, target, player, data)
return data.card and data.card.skillNames and table.contains(data.card.skillNames,"tyj__shiyi")
end,
on_refresh = function (self, event, target, player, data)
data.damageType = fk.FireDamage
end,
}
local tyj__lingnue = fk.CreateTriggerSkill{
name = "tyj__lingnue",
events= {fk.EnterDying},
can_trigger = function (self, event, target, player, data)
if not player:hasSkill(self) or target == player then return false end
local skills = {}
for _, skill in ipairs(player.player_skills) do
if skill:isPlayerSkill(player) and player:hasSkill(skill)then
table.insert(skills, skill.name)
end
end
return #skills >0
end,
on_cost = function (self, event, target, player, data)
return player.room:askForSkillInvoke(player, self.name, data, "#tyj__lingnue-invoke::"..target.id)
end,
on_use = function (self, event, target, player, data)
local room = player.room
local skills = {}
for _, skill in ipairs(player.player_skills) do
if skill:isPlayerSkill(player) and player:hasSkill(skill) then
table.insert(skills, skill.name)
end
end
if #skills >0 then
local result = player.room:askForCustomDialog(player,self.name,
"packages/tyj/qml/ChooseSkillBox.qml", {
skills, 0, 1, "是否令你的一个技能失效"
})
if result == "" then return false end
local choice = json.decode(result)
if choice and #choice>0 then
local mark = player:getTableMark("tyj__lingnue_skills")
table.insert(mark,{choice[1],target.id})
room:setPlayerMark(player,"tyj__lingnue_skills",mark)
if data.damage and data.damage.from and data.damage.from:isAlive() then
room:drawCards(data.damage.from,2,self.name)
end
end
end
end,
refresh_events = {fk.Death},
can_refresh = function (self, event, target, player, data)
local mark = player:getTableMark("tyj__lingnue_skills")
return #mark > 0 and #table.filter(mark, function(q) return q[2]==target.id end)>0
end,
on_refresh = function (self, event, target, player, data)
local room = player.room
local mark=player:getTableMark("tyj__lingnue_skills")
for i=#mark, 1, -1 do
if mark[i][2] == target.id then
table.remove(mark,i)
end
end
if #mark >0 then
room:setPlayerMark(player,"tyj__lingnue_skills",mark)
else
room:setPlayerMark(player,"tyj__lingnue_skills",0)
end
end,
}
local tyj__lingnue_invalidity = fk.CreateInvaliditySkill {
name = "#tyj__lingnue_invalidity",
invalidity_func = function(self, from, skill)
return #table.filter(from:getTableMark("tyj__lingnue_skills"), function(q) return q[1]==skill.name end)>0
end
}
tyj__neltharion:addSkill(tyj__shiyi)
tyj__neltharion:addSkill(tyj__lingnue)
tyj__lingnue:addRelatedSkill(tyj__lingnue_invalidity)
tyj__neltharion:addSkill("ty__ranshang")
Fk:loadTranslationTable{
["tyj__shiyi"]="蚀翼",
[":tyj__shiyi"]="锁定技,你的体力减少1点后,若没有角色濒死,你将一张牌当造成火焰伤害的【决斗】使用。你的体力上限减少后,你摸减少量张牌并将所有牌重铸为【杀】。",
["#tyj__lingnue-invoke"]="是否发动 凌虐 令你的一个技能失效直到 %dest 死亡时",
["#tyj__shiyi_viewas"]="蚀翼",
["tyj__lingnue"]="凌虐",
[":tyj__lingnue"]="其他角色濒死时,你可以令你的一个技能失效至其死亡,然后令伤害来源摸两张牌。",
["$tyj__shiyi1"]="在我双翼的阴影中,万物,皆成灰烬。",
["$tyj__shiyi2"]="你们的世界在劫难逃。",
["$tyj__shiyi3"]="烧尽……一切!",
["$tyj__lingnue1"]="碾碎他们!",
["$tyj__lingnue2"]="就是这样!",
["$ty__ranshang_tyj__neltharion1"]="无边怒火!",
["$ty__ranshang_tyj__neltharion2"]="嗯……烧尽一切…",
["~tyj__neltharion"]="呜呃啊啊..."
}
local tyj__tuiming = fk.CreateActiveSkill{
name="tyj__menghuan",
anim_type = "support",
can_use = function(self, player)
return Self:usedSkillTimes(self.name, Player.HistoryPhase) == 0 and #Fk:currentRoom().alive_players>1
end,
card_num = 0,
target_num = 1,
card_filter = function (self, to_select, selected, selected_targets)
return false
end,
target_filter = function (self, to_select, selected, selected_cards, card, extra_data)
local closenum = nil
for _, i in ipairs(Fk:currentRoom().alive_players) do
local numx = math.abs(Self:getCardIds('h')-i:getCardIds('h'))
if i~=Self and (closenum == nil or numx<closenum) then
closenum = numx
end
end
local tos = {}
for _, i in ipairs(Fk:currentRoom().alive_players) do
if i~=Self and i:getCardIds('h')==closenum then
table.insert(tos,i.id)
end
end
return table.contains(tos,to_select)
end,
on_use = function (self, room, effect)
local player = room:getPlayerById(effect.from)
local target = room:getPlayerById(effect.tos[1])
local card = Fk:getCardById(effect.cards[1])
local cards = table.filter(target:getCardIds("ej"),function(cid) return Fk:getCardById(cid).number and Fk:getCardById(cid).number==card.number end)
if #cards>0 then
local get = room:askForCardsChosen(player, player, 1,1, {
card_data = {
{ "pile_discard", cards }
}
}, self.name, "浊城:选择要被加入你的【趁火打劫】的牌")
if #get>0 then
local ucards = {effect.cards[1],get[1]}
local looting = Fk:cloneCard('looting')
looting.skillName=self.name
looting:addSubcards(ucards)
if U.getDefaultTargets(player, looting, true)~=nil then
U.askForUseVirtualCard(room, player, "looting", ucards, self.name, "#tyj__zhuocheng-use:::"..looting:toLogString(), false, false, false, false, nil, false)
end
end
end
end,
}
Fk:loadTranslationTable{
["tyj__menghuan"]="盟患",
[":tyj__menghuan"]="出牌阶段限一次,你可以交给一名其他角色任意张牌,然后你们中手牌数等于上限的角色依次可以使用一张【杀】。",
["tyj__tuiming"]="俀悯",
[":tyj__tuiming"]="你失去所有手牌后,可以令一名体力值最小的角色回复1点体力,若其也没有手牌,你与其各摸一张牌。",
["tyj__holyNova"]="新星",
[":tyj__holyNova"]="限定技,出牌阶段,你可以将所有手牌当作【桃园结义】使用。",
}
Fk:loadTranslationTable{
["tyj__jueqi"]="决歧",
[":tyj__jueqi"]="每回合每种牌名限一次,你使用伤害牌,或成为伤害牌的目标时,可以令此牌对一名目标造成的伤害+1。此牌结算后,若其未受到此牌造成的伤害,你可令其视为对使用者使用一张【决斗】。",
["tyj__tuiming"]="庇俀",
[":tyj__tuiming"]="体力值小于你的其他角色成为伤害牌的唯一目标时,你可以成为此牌优先结算的额外目标,若此牌未对你造成伤害,你摸一张牌并可令此牌对其无效。",
["tyj__holyNova"]="神圣新星",
[":tyj__holyNova"]="限定技,出牌阶段,你可以弃置所有手牌,对所有对你造成过伤害的角色造成1点伤害,它们外的角色回复1点体力。",
}
local tyj__lothar = General(extension, "tyj__lothar", "wei", 4)
Fk:loadTranslationTable{
["tyj__lothar"] = "洛萨",
["#tyj__lothar"] = "艾泽拉斯雄狮",
["designer:tyj__lothar"] = "汤圆",
["cv:tyj__lothar"] = "暴雪官方",
["illustrator:tyj__lothar"] = "Zoltan Boros",
}
local tyj__yuchi = fk.CreateActiveSkill{
name = "tyj__yuchi",
anim_type = "offensive",
card_num = 0,
target_num = 1,
can_use = function(self, player)
return not player:isKongcheng()
end,
card_filter = Util.FalseFunc,
target_filter = function(self, to_select, selected)
return #selected == 0 and to_select ~= Self.id and Self:canPindian(Fk:currentRoom():getPlayerById(to_select))
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
local target = room:getPlayerById(effect.tos[1])
room:doIndicate(effect.from,{effect.tos[1]})
local pindian = player:pindian({target}, self.name)
local num = 0
local ids = {}
table.insert(ids, pindian.fromCard:getEffectiveId())
table.insert(ids, pindian.results[target.id].toCard:getEffectiveId())
for _, c in ipairs(ids) do
if Fk:getCardById(c).trueName == 'slash' then
num = num +1
elseif Fk:getCardById(c).trueName == 'jink' then
num = num -1
--room:drawCards(player,1,self.name)
end
end
local winner = nil
local loser=nil
if pindian.results[target.id].winner == player then
winner=player
loser=target
elseif pindian.results[target.id].winner == target then
winner=target
loser=player
end
if winner ~= nil and loser ~= nil then
local cardx= Fk:cloneCard("duel")
local use = {
from = winner.id,
tos = {{loser.id}},
card = cardx,
}
use.card.skillName = self.name
use.additionalDamage = num
if U.canUseCardTo(room, player, target, cardx, false, false) then
room:useCard(use)
if use.damageDealt and use.damageDealt[target.id] ~= nil and use.damageDealt[target.id] > 1 and (player.general == "tyj__lothar" or player.deputyGeneral == "tyj__lothar")then
room:broadcastPlaySound("./packages/tyj/audio/extra/tyj__lotharBGM")
end
if #room.logic:getActualDamageEvents(1, function(e)
return e.data[1].from and e.data[1].from == winner and e.data[1].card and e.data[1].card==cardx
end, Player.HistoryTurn)>0 then
else
local skills = {}
for _, skill in ipairs(winner.player_skills) do
if skill:isPlayerSkill(winner) and winner:hasSkill(skill) and not skill.attached_equip then
table.insert(skills, skill.name)
end
end
if #skills >0 then
local result = room:askForCustomDialog(player,self.name,
"packages/tyj/qml/ChooseSkillBox.qml", {
skills, 1, 1, "#tyj__yuchi_disable::"..winner.id
})
if result == "" then return false end
local choice = json.decode(result)
if choice and #choice>0 then
local mark = winner:getTableMark("@tyj__yuchi_skills")
table.insert(mark,choice[1])
room:setPlayerMark(winner,"@tyj__yuchi_skills",mark)
end
end
end
end
end
end,
}
local tyj__yuchi_delay = fk.CreateTriggerSkill{
name="#tyj__yuchi_delay",
refresh_events = {fk.TurnEnd},
can_refresh = function (self, event, target, player, data)
return target==player and #player:getTableMark("@tyj__yuchi_skills")>0
end,
on_refresh = function (self, event, target, player, data)
local room = player.room
room:setPlayerMark(player,"@tyj__yuchi_skills", 0)
end,
}
local tyj__yuchi_invalidity = fk.CreateInvaliditySkill {
name = "#tyj__yuchi_invalidity",
invalidity_func = function(self, from, skill)
return table.contains(from:getTableMark("@tyj__yuchi_skills"),skill.name)
end
}
tyj__yuchi:addRelatedSkill(tyj__yuchi_delay)
tyj__yuchi:addRelatedSkill(tyj__yuchi_invalidity)
tyj__lothar:addSkill(tyj__yuchi)
Fk:loadTranslationTable{
["tyj__yuchi"]="迂驰",
[":tyj__yuchi"]="出牌阶段,你可以拼点,令赢的角色视为对没赢的角色使用【决斗】,拼点牌每含一张【杀】/【闪】,伤害基数便+1/-1,然后你令使用【决斗】但未造成伤害的角色的一个技能失效至其回合结束。",
["@tyj__yuchi_skills"]="被失效",
["$tyj__yuchi1"]="我相信艾泽拉斯的力量",
["$tyj__yuchi2"]="为了洛丹伦!",
["$tyj__yuchi3"]="发起反击!",
["~tyj__lothar"]="忑呃啊啊啊啊...",
["#tyj__yuchi_disable"]="令 %dest 的一个技能失效",
}
Fk:loadTranslationTable{
["tyj__zhanji"]="斩棘",
[":tyj__zhanji"]="你使用伤害牌的指定唯一目标,或成为其他角色使用伤害牌的唯一目标时,可以与其各弃置任意张牌,然后弃牌多的一方对另一方造成一点伤害。若这些牌颜色相同,你摸一张牌。",
["tyj__daoyan"]="蹈焰",
[":tyj__daoyan"]="你受到伤害后,可以横置任意名与你体力值相同的角色,或视为使用一张【火攻】。",
["tyj__canjin"]="残烬",
[":tyj__canjin"]="觉醒技,你脱离因受到火属性伤害进入的濒死后,失去〖斩棘〗,获得一点体力上限与〖天启〗。",
}
Fk:loadTranslationTable{
["tyj__kaojie"]="薧劫",
[":tyj__kaojie"]="使命技,每回合每个区域限一次,你可以你一个区域内的最后一张牌当【杀】(无次数限制)或【无懈可击】使用,若被抵消,将对应此区域的〖薧劫〗分离为一个技能。",
}
return extension
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。