各位大佬好,如题,个人想到的入手角度是参考老版连营。由于“手牌变成3张”有两个情况,第一个是失去手牌后变成3张,另一个是得到手牌后,变成3张。 于是写了以下的代码:(huan是武将名称)
yhuanbian = sgs.CreateTriggerSkill{
name = "yhuanbian" ,
frequency = sgs.Skill_Frequent ,
events = {sgs.CardsMoveOneTime} ,
on_trigger = function(self, event, huan, data)
local room = huan:getRoom()
local move = data:toMoveOneTime()
if ((move.from:objectName() == huan:objectName() and move.from_places:contains(sgs.Player_PlaceHand) and huan:getHandcardNum()==3) or (move.to:objectName() == huan:objectName() and move.to_places:contains(sgs.Player_PlaceHand) and move.card_ids:length()+huan:getHandcardNum()==3)) then
huan:gainMark("@huanbian")
end
return false
end
}
实际运行情况,失去手牌后,如果剩余手牌3张,能触发。但在得到手牌后,如果手牌总数是3张,不会触发。想请大神帮帮忙de个bug,谢谢!
yhuanbian = sgs.CreateTriggerSkill{
name = "yhuanbian" ,
frequency = sgs.Skill_Frequent ,
events = {sgs.CardsMoveOneTime} ,
on_trigger = function(self, event, huan, data)
local room = huan:getRoom()
local move = data:toMoveOneTime()
if ((move.from:objectName() == huan:objectName() and move.from_places:contains(sgs.Player_PlaceHand) and huan:getHandcardNum()==3) or (move.to:objectName() == huan:objectName() and move.to_places:contains(sgs.Player_PlaceHand) and move.card_ids:length()+huan:getHandcardNum()==3)) then
huan:gainMark("@huanbian")
end
return false
end
}
实际运行情况,失去手牌后,如果剩余手牌3张,能触发。但在得到手牌后,如果手牌总数是3张,不会触发。想请大神帮帮忙de个bug,谢谢!