frozencookie frozencookie
关注数: 2 粉丝数: 3 发帖数: 389 关注贴吧数: 46
求教,enabled_at_play好像没有效果 想做一个这样的技能:猛虎:出牌阶段,你可以选择任意一名角色拼点,若你赢,则这回合内,你每对其他角色造成一点伤害,你摸一张牌,若你输,则你立刻失去一点体力;每回合限用一次。 用的版本是alpha版,其他的都实现了就是“每回合限用一次”这个..... x_menghu_card = sgs.CreateSkillCard{ name="x_menghu_card", target_fixed=false, will_throw=false, filter = function(self, targets, to_select, player) if #targets > 0 then return false end if to_select:objectName() == player:objectName() then return false end if to_select:isKongcheng() then return false end return true end, on_use = function(self, room, source, targets) if source:hasFlag("menghu_used") then return nil end local room = source:getRoom() local target = targets[1] local success = source:pindian(target, "x_menghu_card", Null) source:setFlags("menghu_used") if success then source:setFlags("menghu_success") else room:loseHp(source,1) end end,} x_menghu_vs = sgs.CreateViewAsSkill{ name="x_menghu_vs", n=0, view_filter=function(self,selected,to_select) return false end, view_as = function(self, cards) return x_menghu_card:clone() end, enabled_at_play = function(self,player) return not player:hasFlag("menghu_used") end, } x_menghu = sgs.CreateTriggerSkill{ name = "x_menghu", view_as_skill = x_menghu_vs, events = {sgs.Damage}, frequency = sgs.Skill_NotFrequent, on_trigger = function(self, event, player, data) local room = player:getRoom() local damage = data:toDamage() if event == sgs.Damage and damage.from:hasSkill(self:objectName()) and player:hasFlag("menghu_success") then for var = 1, damage.damage, 1 do player:drawCards(1) end end end }
1 下一页