Commit eb7363fc authored by mercury233's avatar mercury233

fix

parent 6b2d9ff7
Pipeline #23024 passed with stages
in 30 seconds
...@@ -61,7 +61,7 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp) ...@@ -61,7 +61,7 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp)
if not tc or Duel.Destroy(tc,REASON_EFFECT)<1 then return end if not tc or Duel.Destroy(tc,REASON_EFFECT)<1 then return end
local lv=tc:GetOriginalLevel() local lv=tc:GetOriginalLevel()
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK,0,nil,lv) local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK,0,nil,lv)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroup(tp,s.chk,false,1,99,lv) local sg=g:SelectSubGroup(tp,s.chk,false,1,99,lv)
if sg then Duel.SendtoGrave(sg,REASON_EFFECT) end if sg then Duel.SendtoGrave(sg,REASON_EFFECT) end
end end
...@@ -43,7 +43,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -43,7 +43,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
function s.cfilter(c,tc,tp) function s.cfilter(c,tc,tp)
return c:IsFaceup() and c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,Group.CreateGroup(c,tc))>0 return c:IsFaceup() and c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,Group.FromCards(c,tc))>0
end end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -52,7 +52,7 @@ function s.rvop(e,tp,eg,ep,ev,re,r,rp) ...@@ -52,7 +52,7 @@ function s.rvop(e,tp,eg,ep,ev,re,r,rp)
elseif op==2 then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end elseif op==2 then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end
end end
function s.cfilter(c,tc,tp) function s.cfilter(c,tc,tp)
return c:IsFaceup() and c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,Group.CreateGroup(c,tc))>0 return c:IsFaceup() and c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,Group.FromCards(c,tc))>0
end end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -40,7 +40,7 @@ function s.spcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -40,7 +40,7 @@ function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp return Duel.GetTurnPlayer()==1-tp
end end
function s.cfilter(c,tc,tp) function s.cfilter(c,tc,tp)
return c:IsFaceup() and c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,Group.CreateGroup(c,tc))>0 return c:IsFaceup() and c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,Group.FromCards(c,tc))>0
end end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -43,31 +43,17 @@ function s.spfilter(c,e,tp) ...@@ -43,31 +43,17 @@ function s.spfilter(c,e,tp)
return c:IsSetCard(0x17e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x17e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function s.tftg(e,tp,eg,ep,ev,re,r,rp,chk) function s.tftg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) local b1=Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,e:GetHandler(),e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local b2=Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_HAND,0,1,nil) local b2=Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_HAND,0,1,nil)
if chk==0 then return b1 or b2 end if chk==0 then return b1 or b2 end
end end
function s.tfop(e,tp,eg,ep,ev,re,r,rp) function s.tfop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local b1=Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 local b1=Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local b2=Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_HAND,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 local b2=Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_HAND,0,1,nil)
if not (b1 or b2) then return end if not (b1 or b2) then return end
local off=1 local sel=aux.SelectFromOptions(tp,{b1,1152},{b2,1153})
local ops={}
local opval={}
if b1 then
ops[off]=2
opval[off-1]=1
off=off+1
end
if b2 then
ops[off]=1153
opval[off-1]=2
off=off+1
end
local op=Duel.SelectOption(tp,table.unpack(ops))
local sel=opval[op]
e:SetLabel(sel)
if sel==1 then if sel==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp) local sg=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
...@@ -105,4 +91,4 @@ end ...@@ -105,4 +91,4 @@ end
function s.spop(e,tp,eg,ep,ev,re,r,rp) function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not e:GetHandler():IsRelateToEffect(e) then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not e:GetHandler():IsRelateToEffect(e) then return end
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end end
\ No newline at end of file
...@@ -54,11 +54,12 @@ function s.tkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -54,11 +54,12 @@ function s.tkop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(tk,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(tk,0,tp,tp,false,false,POS_FACEUP)
end end
function s.negcon(e,tp,eg,ep,ev,re,r,rp) function s.negcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0 return Duel.GetCurrentChain()==0 and ep==1-tp
end end
function s.negcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsType,1,nil,TYPE_NORMAL) end if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsType,1,nil,TYPE_NORMAL) end
local g=Duel.SelectReleaseGroup(tp,Card.IsType,1,1,nil,TYPE_NORMAL) local g=Duel.SelectReleaseGroup(tp,Card.IsType,1,1,nil,TYPE_NORMAL)
Duel.Release(g,REASON_COST)
end end
function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
...@@ -32,11 +32,9 @@ function s.checkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -32,11 +32,9 @@ function s.checkop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function s.filter(c,e,tp) function s.filter(c,e,tp)
local seq=c:GetSequence() local p,seq=tc:GetControler(),tc:GetSequence()
if seq>4 then return false end return c:IsFaceup() and c:GetFlagEffect(id)>0 and Duel.GetMZoneCount(p,c,tp,LOCATION_REASON_TOFIELD,1<<seq)>0
if c:IsControler(1-tp) then seq=seq+16 end and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,c:GetControler())
return c:IsFaceup() and c:GetFlagEffect(id)>0 and Duel.GetMZoneCount(tp,c)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,c:GetControler(),1<<seq)
end end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc,e,tp) end
......
...@@ -76,7 +76,7 @@ end ...@@ -76,7 +76,7 @@ end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=eg:Filter(s.sfilter,nil,e,tp) local g=eg:Filter(s.sfilter,nil,e,tp)
if chkc then return g:IsContains(chkc) end if chkc then return g:IsContains(chkc) end
if chk==0 then return #g>0 end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and #g>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil) local sg=g:Select(tp,1,1,nil)
Duel.SetTargetCard(sg) Duel.SetTargetCard(sg)
......
...@@ -31,6 +31,7 @@ function s.initial_effect(c) ...@@ -31,6 +31,7 @@ function s.initial_effect(c)
e3:SetCode(EVENT_EQUIP) e3:SetCode(EVENT_EQUIP)
e3:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1) e3:SetCountLimit(1)
e3:SetCondition(s.eqcon)
e3:SetTarget(s.eqtg) e3:SetTarget(s.eqtg)
e3:SetOperation(s.eqop) e3:SetOperation(s.eqop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
...@@ -61,6 +62,13 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -61,6 +62,13 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.SendtoHand(tc,nil,REASON_EFFECT)
end end
end end
function s.eqcfilter(c,tp)
local tc=c:GetEquipTarget()
return tc and tc:IsControler(tp)
end
function s.eqcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.eqcfilter,1,nil,tp)
end
function s.ovfilter2(c) function s.ovfilter2(c)
return c:IsCanOverlay() return c:IsCanOverlay()
end end
......
...@@ -5,7 +5,7 @@ local s,id,o=GetID() ...@@ -5,7 +5,7 @@ local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
--material --material
aux.AddXyzProcedure(c,nil,12,2,s.mfilter(c:GetControler()),aux.Stringid(id,0),2,s.altop) aux.AddXyzProcedure(c,nil,12,2,s.mfilter,aux.Stringid(id,0),2,s.altop)
if not s.global_check then if not s.global_check then
s.global_check=true s.global_check=true
local ge1=Effect.CreateEffect(c) local ge1=Effect.CreateEffect(c)
...@@ -44,6 +44,10 @@ function s.initial_effect(c) ...@@ -44,6 +44,10 @@ function s.initial_effect(c)
e3:SetOperation(s.thop) e3:SetOperation(s.thop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function Auxiliary.XyzAlterFilter(c,alterf,xyzc,e,tp,alterop)
return alterf(c,e,tp,xyzc) and c:IsCanBeXyzMaterial(xyzc) and Duel.GetLocationCountFromEx(tp,tp,c,xyzc)>0
and Auxiliary.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) and (not alterop or alterop(e,tp,0,c))
end
function s.chk(e,tp,eg) function s.chk(e,tp,eg)
for p=0,1 do for p=0,1 do
if eg:IsExists(Card.IsSummonPlayer,1,nil,1-p) then if eg:IsExists(Card.IsSummonPlayer,1,nil,1-p) then
...@@ -51,11 +55,9 @@ function s.chk(e,tp,eg) ...@@ -51,11 +55,9 @@ function s.chk(e,tp,eg)
end end
end end
end end
function s.mfilter(tp) function s.mfilter(c,e,tp)
return function(c) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil):GetMaxGroup(Card.GetAttack)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil):GetMaxGroup(Card.GetAttack) return g and #g>0 and g:IsContains(c)
return g and #g>0 and g:IsContains(c)
end
end end
function s.altop(e,tp,chk) function s.altop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,id)>1 end if chk==0 then return Duel.GetFlagEffect(tp,id)>1 end
......
...@@ -30,8 +30,9 @@ end ...@@ -30,8 +30,9 @@ end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
local chk local chk
if tc:IsRelateToEffect(e) and tc:IsFaceup() and not tc:IsImmuneToEffect(e) then if tc:IsFaceup() and not tc:IsImmuneToEffect(e) then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT) e1:SetCode(EFFECT_IMMUNE_EFFECT)
...@@ -51,7 +52,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -51,7 +52,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
chk=true chk=true
end end
local g=Duel.GetMatchingGroup(s.dfilter,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(s.dfilter,tp,0,LOCATION_MZONE,nil)
if #g>0 then if tc:IsFaceup() and #g>0 then
if chk then Duel.BreakEffect() end if chk then Duel.BreakEffect() end
local dg=Group.CreateGroup() local dg=Group.CreateGroup()
for sc in aux.Next(g) do for sc in aux.Next(g) do
......
...@@ -23,7 +23,7 @@ end ...@@ -23,7 +23,7 @@ end
function s.mfilter(c,tp,ft) function s.mfilter(c,tp,ft)
local r=LOCATION_REASON_TOFIELD local r=LOCATION_REASON_TOFIELD
if not c:IsControler(c:GetOwner()) then r=LOCATION_REASON_CONTROL end if not c:IsControler(c:GetOwner()) then r=LOCATION_REASON_CONTROL end
return Duel.GetLocationCount(c:GetOwner(),LOCATION_SZONE,tp,r)>0 return c:GetOriginalType()&TYPE_MONSTER>0 and Duel.GetLocationCount(c:GetOwner(),LOCATION_SZONE,tp,r)>0
end end
function s.sfilter(c,e,tp) function s.sfilter(c,e,tp)
return c:GetOriginalType()&TYPE_MONSTER>0 and c:GetType()&TYPE_CONTINUOUS+TYPE_SPELL==TYPE_CONTINUOUS+TYPE_SPELL return c:GetOriginalType()&TYPE_MONSTER>0 and c:GetType()&TYPE_CONTINUOUS+TYPE_SPELL==TYPE_CONTINUOUS+TYPE_SPELL
......
...@@ -51,7 +51,7 @@ function s.initial_effect(c) ...@@ -51,7 +51,7 @@ function s.initial_effect(c)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function s.cfilter(c) function s.cfilter(c)
return c:IsSetCard(0x191) return c:IsSetCard(0x191) and c:IsFaceup()
end end
function s.effcon(e,tp,eg,ep,ev,re,r,rp) function s.effcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,e:GetHandler())
......
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