hunren = sgs.CreateTriggerSkill
{
name = "hunren",
frequency = sgs.Skill_Compulsory,
events = {sgs.GameStart,sgs.CardLost,sgs.FinishJudge,sgs.CardGot},
on_trigger = function(self, event, player, data)
local room = player:getRoom()
if event==sgs.GameStart then
player:setTag("HunrenSkill",sgs.QVariant("tiandu")
--elseif event == sgs.CardUsed then
elseif event==sgs.FinishJudge then
if player:getWeapon() then return false end
local judge = data:toJudge()
local card = judge.card
data_card = sgs.QVariant(0)
data_card:setValue(card)
if(room:askForSkillInvoke(player,"tiandu", data_card)) then
player:obtainCard(judge.card)
room:playSkillEffect("tiandu")
return true
end
return false
elseif event==sgs.CardLost or event==sgs.CardGot then
local move = data:toCardMove()
local y=sgs.Sanguosha:getCard(move.card_id)
if (move.from_place == sgs.Player_Equip) and y:inherits("Weapon") then
room:detachSkillFromPlayer(player:getTag("HunrenSkill"):toString()
player:setTag("HunrenSkill","tiandu")
elseif move.to=player and move.to_place==sgs.Player_Equip and y:inherits("Weapon") then
local x=sgs.Sanguosha:getCard(move.card_id)
local skill
if x:inherits("Crossbow") then
skill="jizhi"
elseif x:inherits("DoubleSword") then
skill="rende"
elseif x:inherits("QinggangSword") then
skill="juejing"
elseif x:inherits("GudingBlade") then
skill="yinghun"
elseif x:inherits("IceSword") then
skill="tianxiang"
elseif x:inherits("Blade") then
skill="wusheng"
elseif x:inherits("Axe") then
skill="duanliang"
elseif x:inherits("Spear") then
skill="paoxiao"
elseif x:inherits("Fan") then
skill="bazhen"
elseif x:inherits("Halberd") then
skill="wushuang"
elseif x:inherits("KylinBow") then
skill="liegong"
elseif x:inherits("MoonSpear") then
skill="longdan"
elseif x:inherits("YitianSword") then
skill="jianxiong"
elseif x:inherits("YxSword") then
skill="fangzhu"
elseif x:inherits("SpMoonspear") then
skill="qingguo"
else skill="jixi"
end
if player:hasSkill(skill) then return end
player:setTag("HunrenSkill",sgs.QVariant(skill)
room:acquireSkill(player,skill)
end
end
end
end,
}
cuihuo = sgs.CreateTriggerSkill
{
name = "cuihuo",
events = {sgs.CardLost},
on_trigger=function(self,event,player,data)
local room = player:getRoom()
if event == sgs.CardLost then
local move = data:toCardMove()
local y=sgs.Sanguosha:getCard(move.card_id)
if (move.from_place == sgs.Player_Equip) and y:inherits("Weapon") then
local recov = sgs.RecoverStruct()
recov.card = nil
recov.who = player
room:recover(player, recov)
if player:getPhase() == sgs.Player_NotActive then return false end
room:setPlayerFlag(player,"chused")
end
end
end,
can_trigger=function(self,player)
return player:hasSkill(self:objectName()) and player:isAlive() and not player:hasFlag("chused")
end,
}
魂刃和淬火,
@Ailue ,你怎么看?