Commit f8e837fd authored by Huangnan's avatar Huangnan

fix

parent 0da15785
Pipeline #40430 failed with stages
in 3 minutes and 33 seconds
......@@ -35,7 +35,7 @@ function s.initial_effect(c)
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(s.descon)
e3:SetTarget(s.destg)
......
......@@ -55,10 +55,10 @@ end
function s.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCountFromEx(e:GetHandlerPlayer())>0
and Duel.IsExistingMatchingCard(s.spfilter,e:GetHandlerPlayer(),LOCATION_HAND+LOCATION_GRAVE+LOCATION_MZONE,0,1,c) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
and Duel.IsExistingMatchingCard(s.spfilter,e:GetHandlerPlayer(),LOCATION_HAND+LOCATION_GRAVE+LOCATION_MZONE,0,1,c) and c:IsCanBeSpecialSummoned(e,0,e:GetHandlerPlayer(),true,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_MZONE,0,c)
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:Select(tp,1,1,nil)
if sg then
......
......@@ -34,7 +34,7 @@ function s.initial_effect(c)
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(s.descon)
e3:SetTarget(s.destg)
......
--月咏小萌
local s,id,o=GetID()
s.MoJin=true
function s.initial_effect(c)
--extra summon
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_SUMMON_SUCCESS)
e6:SetOperation(s.sumop)
c:RegisterEffect(e6)
local e7=e6:Clone()
e7:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e7)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(2)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
--e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetType(EFFECT_TYPE_IGNITION)
--e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_HAND)
--e3:SetCountLimit(1,id)
e3:SetCost(aux.bfgcost)
e3:SetTarget(s.target)
e3:SetOperation(s.operation)
s.MoJin=true
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(id,0))
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_SUMMON_SUCCESS)
e0:SetOperation(s.sumop)
c:RegisterEffect(e0)
local e1=e0:Clone()
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCost(aux.bfgcost)
e2:SetTarget(s.bfgtg)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,id)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetRange(LOCATION_GRAVE)
e4:SetCountLimit(1,id)
c:RegisterEffect(e4)
end
function s.sumop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not (Duel.IsPlayerCanSummon(tp) or Duel.IsPlayerCanAdditionalSummon(tp)) then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0)
e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
--e1:SetTargetRange(1,0)
e1:SetTarget(s.estg)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1)
end
function s.estg(e,c)
--return c.MoJin==true
return not c:IsSetCard(0x23333a)
end
function s.val(e,c)
local tp=e:GetHandlerPlayer()
local ct=Duel.GetFlagEffect(tp,id)
return ct+1
end
function s.mfilter1(c)
return c.MoJin==true and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function s.mfilter2(c)
return c.MoJin==true and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function s.sfselect(g,tp)
return Duel.IsExistingMatchingCard(s.synfilter,tp,LOCATION_EXTRA,0,1,nil,g)
end
function s.xfselect(g,tp)
return Duel.IsExistingMatchingCard(s.xyzfilter,tp,LOCATION_EXTRA,0,1,nil,g)
end
function s.lfselect(g,tp)
return Duel.IsExistingMatchingCard(s.lfilter,tp,LOCATION_EXTRA,0,1,nil,g)
end
function s.chkfilter(c,e,tp,m,f,chkf)
if not c.MoJin==true then return end
return s.ffilter(c,e,tp,m,f,chkf) or c:IsSynchroSummonable(nil,m) or c:IsXyzSummonable(m) or c:IsLinkSummonable(m,nil)
end
function s.ffilter(c,e,tp,m,f,chkf)
return c.MoJin==true and c:IsType(TYPE_FUSION) and (not f or f(c))
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(id,0))
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SET_SUMMON_COUNT_LIMIT)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e0:SetTargetRange(1,0)
e0:SetValue(2)
e0:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e0,tp)
end
--融合检查
function s.Fusionfilter0(c,e)
return not c:IsImmuneToEffect(e)
end
function s.Fusionfilter1(c)
return c:IsCanBeFusionMaterial() and c:IsAbleToRemove()
end
function s.Fusionfilter2(c,e,tp,m,f,chkf) --加魔禁字段
return c.MoJin and c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function s.chksfilter(c,g)
return c:IsSynchroSummonable(nil,g)
--同调检查
function s.Synchrofilter0(c,e)
return c:IsType(TYPE_MONSTER) and not c:IsImmuneToEffect(e)
end
function s.Synchrofilter1(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function s.Synchrofilter2(c,tp,g) --加魔禁字段
return c:IsSynchroSummonable(nil,g) and c.MoJin
end
function s.Synchrofilter3(level)
return function(g)
local sum = g:GetSum(Card.GetLevel)
return sum <= level
end
end
function s.Synchrofilter4(g,tp,syncard)
return syncard:IsSynchroSummonable(nil,g,#g-1,#g-1)
end
--超量检查
function s.Xyzfilter0(c,e)
return c:IsType(TYPE_MONSTER) and not c:IsImmuneToEffect(e)
end
function s.Xyzfilter1(c)
return c:IsType(TYPE_MONSTER) --and c:IsAbleToRemove()
end
function s.chkxfilter(c,g)
return c:IsXyzSummonable(g)
function s.Xyzfilter2(c,tp,g) --加魔禁字段
return c:IsXyzSummonable(g) and c.MoJin
end
function s.chklfilter(c,g)
return c:IsLinkSummonable(g,nil)
function s.Xyzfilter4(g,c)
return c:IsXyzSummonable(g,#g,#g)
end
function s.synfilter(c,g)
return c.MoJin==true and c:IsSynchroSummonable(nil,g,#g-1,#g-1)
--连接检查
function s.Linkfilter0(c,e)
return c:IsType(TYPE_MONSTER) and not c:IsImmuneToEffect(e)
end
function s.xyzfilter(c,g)
return c.MoJin==true and c:IsXyzSummonable(g,#g,#g)
function s.Linkfilter1(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function s.lfilter(c,g)
return c.MoJin==true and c:IsLinkSummonable(g,nil,#g,#g)
function s.Linkfilter2(c,tp,g) --加魔禁字段
return c:IsLinkSummonable(g) and c.MoJin
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
function s.Linkfilter3(Link)
return function(g)
local sum = g:GetCount()
return sum <= Link
end
end
function s.Linkfilter4(g,c)
return c:IsLinkSummonable(g,nil,#g,#g)
end
--检查结束
function s.bfgtg(e,tp,eg,ep,ev,re,r,rp,chk)
--融合检查
local chkf=tp
local c=e:GetHandler()
local sg=Duel.GetMatchingGroup(s.mfilter1,tp,LOCATION_HAND+LOCATION_MZONE,0,c)
local exg=Duel.GetMatchingGroup(s.mfilter2,tp,LOCATION_GRAVE,0,c)
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 then
Duel.RegisterFlagEffect(tp,id,RESET_EVENT+RESET_CHAIN,0,1)
sg:Merge(exg)
local mg1=Duel.GetFusionMaterial(tp)
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 then
local sg=Duel.GetMatchingGroup(s.Fusionfilter1,tp,LOCATION_GRAVE,0,nil)
if sg:GetCount()>0 then
mg1:Merge(sg)
end
local res=Duel.IsExistingMatchingCard(s.ffilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,sg,nil,chkf)
end
local res=Duel.IsExistingMatchingCard(s.Fusionfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(s.ffilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
res=Duel.IsExistingMatchingCard(s.Fusionfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
--同调检查
local mg3=Duel.GetMatchingGroup(s.Synchrofilter0,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,e)
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 then
local mg4=Duel.GetMatchingGroup(s.Synchrofilter1,tp,LOCATION_GRAVE,0,nil)
if mg4:GetCount()>0 then
mg3:Merge(mg4)
end
end
local Synchro=Duel.IsExistingMatchingCard(s.Synchrofilter2,tp,LOCATION_EXTRA,0,1,nil,tp,mg3)
--超量检查
local mg5=Duel.GetMatchingGroup(s.Xyzfilter0,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,e)
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 then
local mg6=Duel.GetMatchingGroup(s.Xyzfilter1,tp,LOCATION_GRAVE,0,nil)
if mg6:GetCount()>0 then
mg5:Merge(mg6)
end
end
local Xyz=Duel.IsExistingMatchingCard(s.Xyzfilter2,tp,LOCATION_EXTRA,0,1,nil,tp,mg5)
--连接检查
local mg7=Duel.GetMatchingGroup(s.Linkfilter0,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,e)
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 then
local mg8=Duel.GetMatchingGroup(s.Linkfilter1,tp,LOCATION_GRAVE,0,nil)
if mg8:GetCount()>0 then
mg7:Merge(mg8)
end
end
local Link=Duel.IsExistingMatchingCard(s.Linkfilter2,tp,LOCATION_EXTRA,0,1,nil,tp,mg7)
local b1=res
local b2=sg:CheckSubGroup(s.sfselect,1,#sg,tp)
local b3=sg:CheckSubGroup(s.xfselect,1,#sg,tp)
local b4=sg:CheckSubGroup(s.lfselect,1,#sg,tp)
local b2=Synchro
local b3=Xyz
local b4=Link
if chk==0 then return b1 or b2 or b3 or b4 end
local ckg=Duel.GetMatchingGroup(s.chkfilter,tp,LOCATION_EXTRA,0,nil,e,tp,sg,nil,chkf)
if #ckg==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,5))
local chkccc=ckg:Select(tp,1,1,nil)
local off=1
local ops={}
local opval={}
......@@ -143,121 +175,204 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
opval[off-1]=4
off=off+1
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT)
local op=Duel.SelectOption(tp,table.unpack(ops))
local sel=opval[op]
e:SetLabel(sel)
if sel==1 then
--融合
if opval[op]==1 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e:SetOperation(s.bfgop1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
--同调
elseif opval[op]==2 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
e:SetOperation(s.bfgop2)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
--超量
elseif opval[op]==3 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
e:SetOperation(s.bfgop3)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
--连接
elseif opval[op]==4 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
e:SetOperation(s.bfgop4)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
--融合效果处理
function s.bfgop1(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local c=e:GetHandler()
local sel=e:GetLabel()
local sg=Duel.GetMatchingGroup(s.mfilter1,tp,LOCATION_HAND+LOCATION_MZONE,0,c)
local exg=Duel.GetMatchingGroup(s.mfilter2,tp,LOCATION_GRAVE,0,c)
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 and Duel.GetFlagEffect(tp,id)>0 then
sg:Merge(exg)
end
if sel==1 then
local mg1=sg:Filter(s.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(s.ffilter,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(s.ffilter,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
local mg1=Duel.GetFusionMaterial(tp):Filter(s.Fusionfilter0,nil,e)
local exmat=false
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 then
local sg=Duel.GetMatchingGroup(s.Fusionfilter1,tp,LOCATION_GRAVE,0,nil,e)
if sg:GetCount()>0 then
mg1:Merge(sg)
exmat=true
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,5))
local chkccc=sg1:Select(tp,1,1,nil)
local fsg=sg1:Clone()
if sg2 then fsg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=fsg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
local tg=mat1:Filter(Card.IsLocation,nil,LOCATION_HAND+LOCATION_ONFIELD)
local rg=mat1:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
Duel.SendtoGrave(tg,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
if exmat then end
local sg1=Duel.GetMatchingGroup(s.Fusionfilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(s.Fusionfilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
mg1:RemoveCard(tc)
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
if exmat then end
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
local g1=mat1:Filter(Card.IsLocation,nil,LOCATION_HAND+LOCATION_ONFIELD)
local g2=mat1:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
Duel.SendtoGrave(g1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.Remove(g2,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
elseif sel==2 then
local schk=Duel.GetMatchingGroup(s.chksfilter,tp,LOCATION_EXTRA,0,nil,sg)
if #schk==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,5))
local chkccc=schk:Select(tp,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,512)
local syg=sg:SelectSubGroup(tp,s.sfselect,false,1,#sg,tp)
local syng=Duel.GetMatchingGroup(s.synfilter,tp,LOCATION_EXTRA,0,nil,syg)
if #syng>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=syng:Select(tp,1,1,nil):GetFirst()
tc:SetMaterial(syg)
local tg=syg:Filter(Card.IsLocation,nil,LOCATION_HAND+LOCATION_ONFIELD)
local rg=syg:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
Duel.SendtoGrave(tg,REASON_EFFECT+REASON_MATERIAL+REASON_SYNCHRO)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_SYNCHRO)
tc:CompleteProcedure()
end
end
--同调效果处理
function s.bfgop2(e,tp,eg,ep,ev,re,r,rp)
local mg1=Duel.GetMatchingGroup(s.Synchrofilter0,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,e)
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 then
local mg2=Duel.GetMatchingGroup(s.Synchrofilter1,tp,LOCATION_GRAVE,0,nil)
if mg2:GetCount()>0 then
mg1:Merge(mg2)
end
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,s.Synchrofilter2,tp,LOCATION_EXTRA,0,1,1,nil,tp,mg1):GetFirst()
if tc then
local level=tc:GetLevel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
aux.GCheckAdditional=s.Synchrofilter3(level)
local sg=mg1:SelectSubGroup(tp,s.Synchrofilter4,false,1,#mg1,tp,tc)
aux.GCheckAdditional=nil
if sg then
tc:SetMaterial(sg)
local g1=sg:Filter(Card.IsLocation,nil,LOCATION_HAND+LOCATION_MZONE)
local g2=sg:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
Duel.SendtoGrave(g1,REASON_EFFECT+REASON_MATERIAL+REASON_SYNCHRO)
Duel.Remove(g2,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_SYNCHRO)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
for sc in aux.Next(sg) do
Duel.RaiseSingleEvent(sc,EVENT_BE_MATERIAL,e,REASON_SYNCHRO,tp,tp,0)
Duel.RaiseEvent(sc,EVENT_BE_MATERIAL,e,REASON_SYNCHRO,tp,tp,0)
end
end
elseif sel==3 then
local xchk=Duel.GetMatchingGroup(s.chkxfilter,tp,LOCATION_EXTRA,0,nil,sg)
if #xchk==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,5))
local chkccc=xchk:Select(tp,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,513)
local syg=sg:SelectSubGroup(tp,s.xfselect,false,1,#sg,tp)
local syng=Duel.GetMatchingGroup(s.xyzfilter,tp,LOCATION_EXTRA,0,nil,syg)
if #syng>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=syng:Select(tp,1,1,nil):GetFirst()
tc:SetMaterial(syg)
for sc in aux.Next(syg) do
local mg=sc:GetOverlayGroup()
if mg:GetCount()~=0 then
Duel.Overlay(tc,mg)
end
end
--超量效果处理
function s.bfgop3(e,tp,eg,ep,ev,re,r,rp)
local mg1=Duel.GetMatchingGroup(s.Xyzfilter0,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,e)
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 then
local mg2=Duel.GetMatchingGroup(s.Xyzfilter1,tp,LOCATION_GRAVE,0,nil)
if mg2:GetCount()>0 then
mg1:Merge(mg2)
end
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,s.Xyzfilter2,tp,LOCATION_EXTRA,0,1,1,nil,tp,mg1):GetFirst()
if tc then
local Rank=tc:GetRank()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local sg=mg1:SelectSubGroup(tp,s.Xyzfilter4,false,1,4,tc)
if sg then
Duel.HintSelection(sg)
tc:SetMaterial(sg)
for sc in aux.Next(sg) do
local gg=sc:GetOverlayGroup()
if gg:GetCount()~=0 then
Duel.Overlay(tc,gg)
end
end
Duel.Overlay(tc,syg)
Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
Duel.Overlay(tc,sg)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
end
else
local lchk=Duel.GetMatchingGroup(s.chklfilter,tp,LOCATION_EXTRA,0,nil,sg)
if #lchk==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,5))
local chkccc=lchk:Select(tp,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,533)
local syg=sg:SelectSubGroup(tp,s.lfselect,false,1,#sg,tp)
local syng=Duel.GetMatchingGroup(s.lfilter,tp,LOCATION_EXTRA,0,nil,syg)
if #syng>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=syng:Select(tp,1,1,nil):GetFirst()
tc:SetMaterial(syg)
local tg=syg:Filter(Card.IsLocation,nil,LOCATION_HAND+LOCATION_ONFIELD)
local rg=syg:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
Duel.SendtoGrave(tg,REASON_EFFECT+REASON_MATERIAL+REASON_LINK)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_LINK)
end
end
--连接效果处理
function s.bfgop4(e,tp,eg,ep,ev,re,r,rp)
local mg1=Duel.GetMatchingGroup(s.Linkfilter0,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,e)
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 then
local mg2=Duel.GetMatchingGroup(s.Linkfilter1,tp,LOCATION_GRAVE,0,nil)
if mg2:GetCount()>0 then
mg1:Merge(mg2)
end
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,s.Linkfilter2,tp,LOCATION_EXTRA,0,1,1,nil,tp,mg1):GetFirst()
if tc then
local Link=tc:GetLink()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
aux.GCheckAdditional=s.Linkfilter3(Link)
local sg=mg1:SelectSubGroup(tp,s.Linkfilter4,false,1,#mg1,tc)
aux.GCheckAdditional=nil
if sg then
tc:SetMaterial(sg)
local g1=sg:Filter(Card.IsLocation,nil,LOCATION_HAND+LOCATION_ONFIELD)
local g2=sg:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
Duel.SendtoGrave(g1,REASON_EFFECT+REASON_MATERIAL+REASON_LINK)
Duel.Remove(g2,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_LINK)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_LINK,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
end
end
end
\ No newline at end of file
end
......@@ -8,7 +8,7 @@ function s.initial_effect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,{id,1})
e1:SetCountLimit(1,id)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
......@@ -24,7 +24,7 @@ function s.initial_effect(c)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e3:SetCountLimit(1,{id,1})
e3:SetCountLimit(1,id+100)
e3:SetCondition(s.spcon)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
......@@ -68,20 +68,12 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
-- 效果②处理函数
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0
and tc:IsLocation(LOCATION_DECK+LOCATION_EXTRA) and c:IsRelateToEffect(e) then
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)~=0 then
-- 离场时除外
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
c:RegisterEffect(e1,true)
end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
\ No newline at end of file
......@@ -58,43 +58,56 @@ function s.discost(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
-- 效果①
function s.filter(c,e,tp)
return c:IsSetCard(0x893) and c:IsDefense(200) and
c:IsAbleToHand() and (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false))
-- 效果①:取除素材检索/特殊召唤
function s.filter(c)
return c:IsSetCard(0x893) and c:IsDefense(200)
end
function s.xyztg(e,tp,eg,ep,ev,re,r,rp,chk)
local check=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e,tp,check) end
if chk==0 then
return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
--
function s.xyzop(e,tp,eg,ep,ev,re,r,rp)
--
local check=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp,check)
local tc=g:GetFirst()
if tc then
if tc:IsAbleToHand() and (not (check and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)) or Duel.SelectOption(tp,1190,1152)==0) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
--
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if not tc then return end
local b1=tc:IsAbleToHand()
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
local op
if b1 and b2 then
op=Duel.SelectOption(tp,1190,1152)
elseif b1 then
op=0
elseif b2 then
op=1
else
return
end
if op==0 then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
-- 自肃效果
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
-- 自肃限制函数:只能特殊召唤超量怪兽
function s.splimit(e,c)
return c:IsLocation(LOCATION_EXTRA) and not c:IsType(TYPE_XYZ)
......
......@@ -96,7 +96,7 @@ function cm.thccost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoExtraP(c,tp,REASON_COST)
end
function cm.thcfilter(c)
return c:IsSetCard(0x3ef1) and c:IsAbleToHand()
return c:IsSetCard(0x3ef1) and (c:IsAbleToHand() or c:IsAbleToGrave())
end
function cm.thctg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thcfilter,tp,LOCATION_DECK,0,1,nil) end
......
......@@ -77,14 +77,16 @@ function cm.filter(c)
end
function cm.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,1,0,LOCATION_MZONE)
end
function cm.posop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
-- 变为里侧守备表示
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local sg=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
local tc=sg:GetFirst()
if not tc then return end
-- 再次确认对象仍在场且符合条件
if tc:IsFaceup() and tc:IsCanTurnSet() and tc:IsLocation(LOCATION_MZONE) then
Duel.HintSelection(Group.FromCards(tc))
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
-- 禁止改变表示形式
local e1=Effect.CreateEffect(e:GetHandler())
......
......@@ -24,6 +24,7 @@ function cm.initial_effect(c)
e2:SetCode(EVENT_CUSTOM+m)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment