太阳神三国杀lua吧 关注:2,642贴子:73,408
  • 4回复贴,共1

有没有大神详细讲解下tag

取消只看楼主收藏回复

怒火:锁定技,一张基本牌指定你为目标后,本局游戏该牌不能再指定你为目标,且你不能使用这些牌。我对照鸡肋,做到一部分让他用不了那些基本牌,后面禁止技实现不了,也就是仍然能指定他为目标。想问问大神,禁止技怎么判断?


IP属地:山东来自Android客户端1楼2019-02-25 23:13回复
    Luanuhuo = sgs.CreateTriggerSkill{
    name = "Luanuhuo" ,
    events = {sgs.TargetConfirmed},
    frequency = sgs.Skill_Compulsory,
    on_trigger = function(self, event, player, data)
    local use = data:toCardUse()
    if use.to:contains(player) then
    if use.card:isVirtualCard() and (use.card:subcardsLength() ~= 1) then return false end
    if ((use.card:isKindOf("Slash") and sgs.Sanguosha:getEngineCard(use.card:getEffectiveId()):isKindOf("Slash")) or (use.card:isKindOf("Peach") and sgs.Sanguosha:getEngineCard(use.card:getEffectiveId()):isKindOf("Peach")) or
    (use.card:isKindOf("Analeptic") and sgs.Sanguosha:getEngineCard(use.card:getEffectiveId()):isKindOf("Analeptic"))) then
    local nuhuo = use.card:getEffectiveId()
    local card_list = player:getTag("Luanuhuo"):toIntList()
    if card_list:length() > 0 then
    for _, id in sgs.qlist(card_list) do
    player:gainMark("@HH")
    if id ~= nuhuo then
    card_list:append(nuhuo)
    end
    end
    else
    card_list:append(nuhuo)
    end
    local d = sgs.QVariant()
    d:setValue(card_list) -- QVariantList
    player:setTag("Luanuhuo", d)
    --local type_i = nuhuo.."|.|.|hand"
    --player:getRoom():setPlayerCardLimitation(player, "use", type_i, false)
    end
    end
    end
    }
    Luanuhuoeffect = sgs.CreateProhibitSkill{
    name = "Luanuhuoeffect" ,
    is_prohibited = function(self, from, to, card)
    local canuse = true
    local nuhuo = card:getEffectiveId()
    local card_list = to:getTag("Luanuhuo"):toIntList()
    if card_list:length() > 0 then
    for _, id in sgs.qlist(card_list) do
    if id == nuhuo then
    canuse = false
    end
    end
    else
    canuse = false
    end
    if to:hasSkill(self:objectName()) then
    return canuse
    end
    end
    }


    IP属地:山东3楼2019-02-27 03:13
    回复
      要么全不能用,要么没效果,不知道怎么改?求助(我加了gainmark测试的,到for _, id in sgs.qlist(card_list) do 这句开始不执行)


      IP属地:山东4楼2019-02-27 03:15
      回复
        Luanuhuoeffect = sgs.CreateProhibitSkill{
        name = "Luanuhuoeffect" ,
        is_prohibited = function(self, from, to, card)
        return to:hasSkill(self:objectName())
        and card:hasFlag("Luanuhuo")
        end
        }
        这样也没效果。


        IP属地:山东5楼2019-02-27 17:18
        回复
          呼叫大神们@白狼天狗 @独孤安河 @叁贰贰贰玖 @chh317 @我是1个萝莉控


          IP属地:山东来自Android客户端6楼2019-02-27 19:06
          回复