太阳神三国杀lua吧 关注:2,638贴子:73,381
  • 10回复贴,共1

【求助】求大神们帮忙写一段Lua

只看楼主收藏回复

RT,一楼祭度娘


IP属地:安徽1楼2015-11-06 09:43回复
    求帮忙写一段Lua,技能描述是“当你没有装备武器时,你的杀无视防具”。。。自己写的时候技能要么无法发动,要么单机启动的时候自己没有装备武器场上所有角色的杀都无视防具QAQ


    IP属地:安徽2楼2015-11-06 09:43
    回复
      把lua发来 告诉你错误··············


      IP属地:内蒙古3楼2015-11-06 09:51
      收起回复
        qaq代码被度娘吞了
        LuaQingrenArm = sgs.CreateTriggerSkill{
        name = "LuaQingren",
        frequency = sgs.Skill_Compulsory,
        events = {sgs.TargetConfirmed,sgs.CardFinished},
        on_trigger = function(self,event,player,data)
        local room = player:getRoom()
        local use = data:toCardUse()
        if event == sgs.TargetConfirmed then
        if player:hasSkill("LuaQingren") and player:getWeapon() == nil and use.card and use.card:isKindOf("Slash") then
        room:addPlayerMark(use.to:first(), "Armor_Nullified")
        room:broadcastSkillInvoke("LuaQingren")
        end
        end
        end


        IP属地:安徽5楼2015-11-06 10:02
        回复
          sgs.TargetConfirmed 是全局时机 你没有判断使用者 与 player的关系 参考铁骑
          sgs.CardFinished 这个时机会发生什么你没写


          IP属地:内蒙古6楼2015-11-06 10:19
          收起回复
            sgs.TargetConfirmed改成sgs.TargetConfirming解决问题,还有sgs.CardFinished没写


            IP属地:广东来自Android客户端7楼2015-11-06 12:23
            回复
              我是来晒ID的。


              8楼2015-11-06 17:12
              回复
                xxx:你使用的【杀】无视防具
                从高顺那里捞来的
                限制条件自己加
                然后把xxx改成技能名就好
                xxx = sgs.CreateTriggerSkill{
                name = "xxx",
                events = {sgs.TargetConfirmed, sgs.CardFinished},
                frequency = sgs.Skill_Compulsory,
                on_trigger = function(self, event, player, data)
                local room = player:getRoom()
                if event == sgs.TargetConfirmed then
                local use = data:toCardUse()
                if use.from and use.from:hasSkill(self:objectName()) then
                if use.card:isKindOf("Slash") then
                if use.from:objectName() == player:objectName() then
                room:setPlayerFlag(use.from, "xxxArmor")
                for _,p in sgs.qlist(use.to) do
                room:setPlayerMark(p, "Armor_Nullified", 1)
                end
                end
                end
                end
                return false
                else
                local use = data:toCardUse()
                if use.card:isKindOf("Slash") and use.from:hasFlag("xxxArmor") then
                for _,p in sgs.qlist(use.to) do
                room:setPlayerMark(p, "Armor_Nullified", 0)
                end
                end
                end
                end,
                }


                IP属地:广东9楼2015-11-18 16:24
                回复