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

求教一些基础lua知识

只看楼主收藏回复

造成伤害后进行判定的lua怎么编?
请帮忙把造成伤害的部分标明一下


IP属地:山西1楼2012-12-09 04:42回复
    luaganglie = sgs.CreateTriggerSkill
    {--刚烈 by ibicdlcod
    name = "luaganglie",
    events = {sgs.Damaged},
    on_trigger=function(self, event, player, data)
    local room = player:getRoom()
    local from = data:toDamage().from
    source = sgs.QVariant(0)
    source:setValue(from)
    if(from and from:isAlive() and room:askForSkillInvoke(player, "luaganglie", source)) then
    room:playSkillEffect("luaganglie")
    local judge = sgs.JudgeStruct()
    judge.pattern = sgs.QRegExp("(.*):(heart):(.*)")
    judge.good = false
    judge.reason = self:objectName()
    judge.who = player
    room:judge(judge)
    if(judge:isGood()) then
    if(not room:askForDiscard(from, "luaganglie", 2, true)) then
    local damage = sgs.DamageStruct()
    damage.from = player
    damage.to = from
    room:damage(damage)
    end
    room:setEmotion(player, "good")
    else
    room:setEmotion(player, "bad")
    end
    end
    end
    }
    (踏青,涅盘专用)


    来自Android客户端2楼2012-12-09 10:01
    收起回复