游戏王diy吧 关注:11,269贴子:294,961
  • 11回复贴,共1

有能看懂代码的大佬么?

只看楼主收藏回复

--flip flag
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_FLIP)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetOperation(s.flipop)
c:RegisterEffect(e3)
--Synchro Summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,1))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCountLimit(1,999000019)
e4:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e4:SetCondition(s.syncon)
e4:SetTarget(s.syntg)
e4:SetOperation(s.synop)
c:RegisterEffect(e4)


IP属地:江苏来自Android客户端1楼2023-06-16 18:35回复
    function s.filter(tc,c,tp)
    if not tc:IsFaceup() or not tc:IsCanBeSynchroMaterial() then return false end
    local mg=Group.FromCards(c,tc)
    return Duel.IsExistingMatchingCard(s.synfilter,tp,LOCATION_EXTRA,0,1,nil,mg)
    end
    function s.synfilter(c,mg)
    return c:IsSynchroSummonable(nil,mg)
    end
    function s.syntg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
    local c=e:GetHandler()
    if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc,c,tp) end
    if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,c,c,tp) end
    Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
    Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,c,c,tp)
    Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
    end
    function s.synop(e,tp,eg,ep,ev,re,r,rp)
    local c=e:GetHandler()
    local tc=Duel.GetFirstTarget()
    if c:IsFaceup() and c:IsRelateToEffect(e)
    and tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
    local mg=Group.FromCards(c,tc)
    Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
    local g=Duel.SelectMatchingCard(tp,s.synfilter,tp,LOCATION_EXTRA,0,1,1,nil,mg)
    local sc=g:GetFirst()
    if sc then
    Duel.SynchroSummon(tp,sc,nil,mg)
    end
    end
    end


    IP属地:江苏来自Android客户端2楼2023-06-16 18:36
    回复
      我想把必须要反转过的限制删除怎么删啊


      IP属地:江苏来自Android客户端3楼2023-06-16 18:36
      回复
        function s.filter(tc,c,tp)
        if not tc:IsFaceup() or not tc:IsCanBeSynchroMaterial() then return false end
        local mg=Group.FromCards(c,tc)
        return Duel.IsExistingMatchingCard(s.synfilter,tp,LOCATION_EXTRA,0,1,nil,mg)
        end
        function s.synfilter(c,mg)
        return c:IsSynchroSummonable(nil,mg)
        end
        function s.syntg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
        local c=e:GetHandler()
        if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc,c,tp) end
        if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,c,c,tp) end
        Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
        Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,c,c,tp)
        Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
        end
        function s.synop(e,tp,eg,ep,ev,re,r,rp)
        local c=e:GetHandler()
        local tc=Duel.GetFirstTarget()
        if c:IsFaceup() and c:IsRelateToEffect(e)
        and tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
        local mg=Group.FromCards(c,tc)
        Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
        local g=Duel.SelectMatchingCard(tp,s.synfilter,tp,LOCATION_EXTRA,0,1,1,nil,mg)
        local sc=g:GetFirst()
        if sc then
        Duel.SynchroSummon(tp,sc,nil,mg)
        end
        end
        end


        IP属地:江苏来自Android客户端4楼2023-06-16 18:37
        回复
          我的妈,吞代码


          IP属地:江苏来自Android客户端5楼2023-06-16 18:38
          回复
            function s.flipop(e,tp,eg,ep,ev,re,r,rp)
            e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1)
            end
            function s.syncon(e,tp,eg,ep,ev,re,r,rp)
            local c=e:GetHandler()
            local ph=Duel.GetCurrentPhase()
            return c:GetFlagEffect(id)>0
            and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
            end
            function s.filter(tc,c,tp)
            if not tc:IsFaceup() or not tc:IsCanBeSynchroMaterial() then return false end
            local mg=Group.FromCards(c,tc)
            return Duel.IsExistingMatchingCard(s.synfilter,tp,LOCATION_EXTRA,0,1,nil,mg)
            end
            function s.synfilter(c,mg)
            return c:IsSynchroSummonable(nil,mg)
            end


            IP属地:江苏来自Android客户端6楼2023-06-16 18:38
            回复
              没人么


              IP属地:江苏来自Android客户端7楼2023-06-16 21:12
              回复
                虽然有些地方没搞懂,但是效果算是整出来了


                IP属地:江苏来自Android客户端8楼2023-06-16 21:45
                回复
                  弄好了么?弄好了就不看了


                  IP属地:内蒙古来自Android客户端9楼2023-06-16 22:01
                  回复
                    好歹发全一下效果呗,不然硬看代码也麻烦


                    IP属地:广东来自Android客户端10楼2023-06-17 07:38
                    回复
                      把flip flag删了,再把syncon里的c:getflageffect(id)>0删了


                      IP属地:甘肃来自Android客户端11楼2023-06-17 09:49
                      回复
                        下回发个lua文件帮你看看还行,吧里直接看实在痛苦


                        IP属地:北京来自Android客户端12楼2023-07-05 01:41
                        回复