Commit 55b2cf1a authored by REIKAI's avatar REIKAI 💬

rep

parent 8e70adae
No preview for this file type
...@@ -9,173 +9,171 @@ function c17032160.initial_effect(c) ...@@ -9,173 +9,171 @@ function c17032160.initial_effect(c)
e1:SetOperation(c17032160.activate) e1:SetOperation(c17032160.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c17032160.filter(c,e,tp) function c17032160.xble(mg,c)
return c:IsRace(RACE_FIEND) and (c:IsFaceup() or not c:IsLocation(LOCATION_EXTRA)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) local n=mg:GetCount()
return c:IsXyzSummonable(mg,n,n)
end end
function c17032160.xyzfilter2(c,mg,rc) function c17032160.xyzfilexm(c,e,tp)
if not c:IsRace(RACE_FIEND) then return false end return c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and (c:IsType(TYPE_PENDULUM) or c:IsRace(RACE_FIEND))
local tmp=Duel.CheckXyzMaterial
local tmp2=Auxiliary.XyzLevelFreeFilter
local tmp3=Auxiliary.XyzLevelFreeGoal
function Duel.CheckXyzMaterial(c,f,lv,minc,maxc,og)
local flag=tmp(c,f,lv,minc,maxc,og)
if og then
for tc in aux.Next(og) do
if tc~=rc and f and not f(tc) then
flag=false
end
end
if og:Filter(aux.TRUE,rc):FilterCount(c17032160.matcheck,nil,c,f,lv)+1>=minc then
flag=true
end
end
return flag
end
function Auxiliary.XyzLevelFreeFilter(c,xyzc,f)
return c:IsFaceup() and c:IsCanBeXyzMaterial(xyzc) and (not f or f(c,xyzc)) or c==rc
end
function Auxiliary.XyzLevelFreeGoal(g,tp,xyzc,gf)
return (not gf or gf(g:Filter(aux.TRUE,rc)) or g:GetCount()==2) and Duel.GetLocationCountFromEx(tp,tp,g,xyzc)>0
end
local sg=mg:Clone()
sg:AddCard(rc)
local res=c:IsXyzSummonable(sg)
Duel.CheckXyzMaterial=tmp
Auxiliary.XyzLevelFreeFilter=tmp2
Auxiliary.XyzLevelFreeGoal=tmp3
return res
end end
function c17032160.xyzfilter(c,mg,ct) function c17032160.xyzfiln(c,e,tp)
return c:IsXyzSummonable(mg,2,ct) return c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end end
function c17032160.matcheck(c,xyzc,f,lv) function c17032160.filspex(c,e,tp)
return c:IsFaceup() and c:IsCanBeXyzMaterial(xyzc) and ((not f or f(c,xyzc)) and c:IsXyzLevel(xyzc,lv) or c==rc) return c:IsRace(RACE_FIEND) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsCanBeXyzMaterial(nil)
end end
function c17032160.mfilter1(c,mg,exg,rc) function c17032160.filspgv(c,e,tp)
return mg:IsExists(c17032160.mfilter2,1,c,c,exg,rc) return c:IsRace(RACE_FIEND) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsCanBeXyzMaterial(nil)
end end
function c17032160.mfilter2(c,mc,exg,rc) function c17032160.mgxble(Omg,c,xmg,exn,gmg,gn,b,oc)
return exg:IsExists(c17032160.excheck,1,nil,Group.FromCards(c,mc,rc),rc) local mg=Omg
if oc then mg:AddCard(oc) end
local sxg=mg:__band(xmg)
local sgg=mg:__band(gmg)
return #sxg<=exn and #sgg<=gn and (not b or #sxg+#sgg<2) and c17032160.xble(mg,c)
end end
function c17032160.excheck(c,eg,rc) function c17032160.filexg(c,oc,xmg,exn,gmg,gn,b)
local tmp=Duel.CheckXyzMaterial local level=1
local tmp2=Auxiliary.XyzLevelFreeFilter while level<13 do
local tmp3=Auxiliary.XyzLevelFreeGoal local e0=Effect.CreateEffect(oc)
function Duel.CheckXyzMaterial(c,f,lv,minc,maxc,og) e0:SetType(EFFECT_TYPE_SINGLE)
local flag=tmp(c,f,lv,minc,maxc,og) e0:SetCode(EFFECT_ADD_TYPE)
if og then e0:SetValue(TYPE_MONSTER)
for tc in aux.Next(og) do oc:RegisterEffect(e0,true)
if tc~=rc and f and not f(tc) then local e1=Effect.CreateEffect(oc)
flag=false e1:SetType(EFFECT_TYPE_SINGLE)
end e1:SetCode(EFFECT_XYZ_LEVEL)
end e1:SetValue(level)
if og:Filter(aux.TRUE,rc):FilterCount(c17032160.matcheck,nil,c,f,lv)+1>=minc then oc:RegisterEffect(e1,true)
flag=true local mg=xmg:__add(gmg)
end mg=mg:Filter(Card.IsXyzLevel,nil,c,level)
end if mg:GetCount()>0 and mg:CheckSubGroup(c17032160.mgxble,1,6,c,xmg,exn,gmg,gn,b,oc) then
return flag e0:Reset()
end e1:Reset()
function Auxiliary.XyzLevelFreeFilter(c,xyzc,f) return true
return c:IsFaceup() and c:IsCanBeXyzMaterial(xyzc) and (not f or f(c,xyzc)) or c==rc end
e0:Reset()
e1:Reset()
level=level+1
end end
function Auxiliary.XyzLevelFreeGoal(g,tp,xyzc,gf) return false
return (not gf or gf(g:Filter(aux.TRUE,rc)) or g:GetCount()==2) and Duel.GetLocationCountFromEx(tp,tp,g,xyzc)>0
end
local res=c:IsXyzSummonable(eg)
Duel.CheckXyzMaterial=tmp
Auxiliary.XyzLevelFreeFilter=tmp2
return res
end end
function c17032160.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c17032160.filng(c,xmg,exn,gmg,gn,b)
local c=e:GetHandler() local mg=xmg:__add(gmg)
if chkc then return false end return mg and mg:CheckSubGroup(c17032160.mgxble,1,6,c,xmg,exn,gmg,gn,b)
local ct=Duel.GetLocationCount(tp,LOCATION_MZONE)
local mg=Duel.GetMatchingGroup(c17032160.filter,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,nil,e,tp)
local exg=Duel.GetMatchingGroup(c17032160.xyzfilter,tp,LOCATION_EXTRA,0,nil,mg,ct)
local exg1=Duel.GetMatchingGroup(c17032160.xyzfilter2,tp,LOCATION_EXTRA,0,nil,mg,c)
exg:Merge(exg1)
if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2)
and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and mg:CheckSubGroup(c17032160.gfilter,1,2,exg,c) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg1,2,0,0)
end end
function c17032160.filter2(c,e,tp) function c17032160.xbleplus(mg,sc,twomg,xmg,exn,gmg,gn,b)
return c:IsRelateToEffect(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) local og=mg:__add(twomg)
return c17032160.mgxble(og,sc,xmg,exn,gmg,gn,b)
end end
function c17032160.gfilter(g,exg,rc) function c17032160.target(e,tp,eg,ep,ev,re,r,rp,chk)
local sg=g:Clone() if chk==0 then
sg:AddCard(rc) if not Duel.IsPlayerCanSpecialSummonCount(tp,2) then return false end
return exg:IsExists(c17032160.excheck,1,nil,sg,rc) local b=Duel.IsPlayerAffectedByEffect(tp,59822133)
local nilg=Group.CreateGroup()
local c=e:GetHandler()
local xmg=nilg
local exn=Duel.GetLocationCountFromEx(tp)
if Duel.IsPlayerAffectedByEffect(tp,29724053) and exn>2 then exn=2 end
if exn>0 then xmg=Duel.GetMatchingGroup(c17032160.filspex,tp,LOCATION_EXTRA,0,nil,e,tp) end
local gmg=nilg
local gn=Duel.GetLocationCount(tp,LOCATION_MZONE)
if gn>0 then gmg=Duel.GetMatchingGroup(aux.NecroValleyFilter(c17032160.filspgv),tp,LOCATION_GRAVE,0,nil,e,tp) end
if xmg:GetCount()<1 and gmg:GetCount()<1 then return false end
local exg=Duel.GetMatchingGroup(c17032160.xyzfilexm,tp,LOCATION_EXTRA,0,nil,e,tp)
if #exg>0 then exg=exg:Filter(c17032160.filexg,nil,c,xmg,exn,gmg,gn,b) end
local nxg=Duel.GetMatchingGroup(c17032160.xyzfiln,tp,LOCATION_EXTRA,0,nil,e,tp)
if #nxg>0 then nxg=nxg:Filter(c17032160.filng,nil,xmg,exn,gmg,gn,b) end
--Debug.Message(#exg)
return #exg>0 or #nxg>0
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function c17032160.activate(e,tp,eg,ep,ev,re,r,rp) function c17032160.activate(e,tp,eg,ep,ev,re,r,rp)
local rc=e:GetHandler() if not Duel.IsPlayerCanSpecialSummonCount(tp,2) then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end local b=Duel.IsPlayerAffectedByEffect(tp,59822133)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end local nilg=Group.CreateGroup()
local ct=Duel.GetLocationCount(tp,LOCATION_MZONE) local c=e:GetHandler()
local mg=Duel.GetMatchingGroup(c17032160.filter,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,nil,e,tp) if not c:IsRelateToEffect(e) then c=nil end
local exg=Duel.GetMatchingGroup(c17032160.xyzfilter,tp,LOCATION_EXTRA,0,nil,mg,ct) local xmg=nilg
local exg1=Duel.GetMatchingGroup(c17032160.xyzfilter2,tp,LOCATION_EXTRA,0,nil,mg,rc) local exn=Duel.GetLocationCountFromEx(tp)
exg:Merge(exg1) if Duel.IsPlayerAffectedByEffect(tp,29724053) and exn>2 then exn=2 end
local g=mg:SelectSubGroup(tp,c17032160.gfilter,false,1,2,exg,rc) if exn>0 then xmg=Duel.GetMatchingGroup(c17032160.filspex,tp,LOCATION_EXTRA,0,nil,e,tp) end
if #g==0 then return end local gmg=nilg
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) local gn=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.RaiseEvent(e:GetHandler(),EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0) if gn>0 then gmg=Duel.GetMatchingGroup(aux.NecroValleyFilter(c17032160.filspgv),tp,LOCATION_GRAVE,0,nil,e,tp) end
if g:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<#g then return end if xmg:GetCount()<1 and gmg:GetCount()<1 then return false end
local xyzg=Duel.GetMatchingGroup(c17032160.xyzfilter,tp,LOCATION_EXTRA,0,nil,g,#g) local exg=nilg
local xyzg1=Duel.GetMatchingGroup(c17032160.xyzfilter2,tp,LOCATION_EXTRA,0,nil,g,e:GetHandler()) if c then exg=Duel.GetMatchingGroup(c17032160.xyzfilexm,tp,LOCATION_EXTRA,0,nil,e,tp) end
xyzg:Merge(xyzg1) if #exg>0 then exg=exg:Filter(c17032160.filexg,nil,c,xmg,exn,gmg,gn,b) end
if xyzg:GetCount()>0 then local nxg=Duel.GetMatchingGroup(c17032160.xyzfiln,tp,LOCATION_EXTRA,0,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) if #nxg>0 then nxg=nxg:Filter(c17032160.filng,nil,xmg,exn,gmg,gn,b) end
local xyz=xyzg:Select(tp,1,1,nil):GetFirst() if #exg>0 and (#nxg<1 or Duel.SelectYesNo(tp,aux.Stringid(17032160,1))) then
local tmp=Duel.SelectXyzMaterial local e0=Effect.CreateEffect(c)
local temp=Duel.CheckXyzMaterial e0:SetType(EFFECT_TYPE_SINGLE)
function Duel.CheckXyzMaterial(c,f,lv,minc,maxc,og) e0:SetCode(EFFECT_ADD_TYPE)
local flag=temp(c,f,lv,minc,maxc,og) e0:SetValue(TYPE_MONSTER)
if og then e0:SetReset(RESETS_REDIRECT)
for tc in aux.Next(og) do c:RegisterEffect(e0,true)
if tc~=rc and f and not f(tc) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)--xyz
flag=false local sc=exg:Select(tp,1,1,nil)
end if sc then sc=sc:GetFirst() end
end local mg=xmg:__add(gmg)
if og:Filter(aux.TRUE,rc):FilterCount(Card.IsCanBeXyzMaterial,nil,c)+1>=minc then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
flag=true local mg1=mg:FilterSelect(tp,Card.IsCanBeXyzMaterial,1,1,nil,sc)
local mc=mg1:GetFirst()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_XYZ_LEVEL)
e1:SetValue(mc:GetLevel())
e1:SetReset(RESETS_REDIRECT)
c:RegisterEffect(e1,true)
c:CancelToGrave()
local twomg=Group.FromCards(mc,c)
mg:RemoveCard(mc)
if c17032160.xble(twomg,sc) and (b or not mg:CheckSubGroup(c17032160.xbleplus,1,#mg,sc,twomg,xmg,exn,gmg,gn,b)) then--
Duel.SpecialSummon(mc,0,tp,tp,false,false,POS_FACEUP)
Duel.BreakEffect()
Duel.XyzSummon(tp,sc,twomg,0)
else Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local tmg=mg:SelectSubGroup(tp,c17032160.xbleplus,false,1,#mg,sc,twomg,xmg,exn,gmg,gn,b)
if tmg then
tmg:AddCard(mc)
local tmc=tmg:GetFirst()
while tmc do
Duel.SpecialSummonStep(tmc,0,tp,tp,false,false,POS_FACEUP)
tmc=tmg:GetNext()
end end
Duel.SpecialSummonComplete()
Duel.RaiseEvent(c,EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
if tmg:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<tmg:GetCount() then
c:CancelToGrave(false)
return end
Duel.BreakEffect()
tmg:AddCard(c)
Duel.XyzSummon(tp,sc,tmg,0)
end end
return flag
end
local tmp2=Auxiliary.XyzLevelFreeFilter
local tmp3=Auxiliary.XyzLevelFreeGoal
function Auxiliary.XyzLevelFreeFilter(c,xyzc,f)
return c:IsFaceup() and c:IsCanBeXyzMaterial(xyzc) and (not f or f(c,xyzc)) or c==rc
end end
function Auxiliary.XyzLevelFreeGoal(g,tp,xyzc,gf) elseif #nxg>0 then
return (not gf or gf(g:Filter(aux.TRUE,rc)) or g:GetCount()==2) and Duel.GetLocationCountFromEx(tp,tp,g,xyzc)>0 Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)--xyz
end local sc=nxg:Select(tp,1,1,nil)
local b1=xyz:IsXyzSummonable(g,#g,#g) if sc then sc=sc:GetFirst() end
g:AddCard(rc) local mg=xmg:__add(gmg)
local b2=xyz:IsXyzSummonable(g,#g,#g) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local off=1 local tmg=mg:SelectSubGroup(tp,c17032160.mgxble,false,1,#mg,sc,xmg,exn,gmg,gn,b)
local ops={} if tmg then
local opval={} local tmc=tmg:GetFirst()
if b1 then while tmc do
ops[off]=aux.Stringid(17032160,0) Duel.SpecialSummonStep(tmc,0,tp,tp,false,false,POS_FACEUP)
opval[off-1]=1 tmc=tmg:GetNext()
off=off+1 end
end Duel.SpecialSummonComplete()
if b2 then Duel.RaiseEvent(c,EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
ops[off]=aux.Stringid(17032160,1) if tmg:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<tmg:GetCount() then
opval[off-1]=2 c:CancelToGrave(false)
off=off+1 return end
end Duel.BreakEffect()
local op=Duel.SelectOption(tp,table.unpack(ops)) Duel.XyzSummon(tp,sc,tmg,0)
local sel=opval[op]
if sel==1 then
g:RemoveCard(rc)
Duel.XyzSummon(tp,xyz,g)
else
rc:CancelToGrave()
Duel.XyzSummon(tp,xyz,g)
end end
end end
end end
\ No newline at end of file
...@@ -34,7 +34,7 @@ function cm.spcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -34,7 +34,7 @@ function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE) and e:GetHandler():IsPreviousPosition(POS_FACEUP) return e:GetHandler():IsPreviousLocation(LOCATION_MZONE) and e:GetHandler():IsPreviousPosition(POS_FACEUP)
end end
function cm.cfilter(c) function cm.cfilter(c)
return c:IsSetCard(0x362) and c:IsAbleToRemoveAsCost() and not c:IsCode(m) return c:IsSetCard(0x362) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost() and not c:IsCode(m)
end end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_GRAVE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
...@@ -53,7 +53,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -53,7 +53,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsSetCard(0x362) and c:IsAbleToRemoveAsCost() return c:IsSetCard(0x362) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_GRAVE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_GRAVE,0,1,nil) end
......
...@@ -26,7 +26,7 @@ function c33310210.initial_effect(c) ...@@ -26,7 +26,7 @@ function c33310210.initial_effect(c)
e1:SetDescription(aux.Stringid(33310210,0)) e1:SetDescription(aux.Stringid(33310210,0))
e1:SetCategory(CATEGORY_TOHAND) e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(c33310210.thtg) e1:SetTarget(c33310210.thtg)
e1:SetOperation(c33310210.thop) e1:SetOperation(c33310210.thop)
......
...@@ -19,7 +19,7 @@ function cm.filter1(c,e) ...@@ -19,7 +19,7 @@ function cm.filter1(c,e)
return not c:IsImmuneToEffect(e) return not c:IsImmuneToEffect(e)
end end
function cm.filter2(c,e,tp,m,f,chkf) function cm.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x551) and (not f or f(c)) return 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) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
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