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)
e1:SetOperation(c17032160.activate)
c:RegisterEffect(e1)
end
function c17032160.filter(c,e,tp)
return c:IsRace(RACE_FIEND) and (c:IsFaceup() or not c:IsLocation(LOCATION_EXTRA)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
function c17032160.xble(mg,c)
local n=mg:GetCount()
return c:IsXyzSummonable(mg,n,n)
end
function c17032160.xyzfilter2(c,mg,rc)
if not c:IsRace(RACE_FIEND) then return false end
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
function c17032160.xyzfilexm(c,e,tp)
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))
end
function c17032160.xyzfilter(c,mg,ct)
return c:IsXyzSummonable(mg,2,ct)
function c17032160.xyzfiln(c,e,tp)
return c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function c17032160.matcheck(c,xyzc,f,lv)
return c:IsFaceup() and c:IsCanBeXyzMaterial(xyzc) and ((not f or f(c,xyzc)) and c:IsXyzLevel(xyzc,lv) or c==rc)
function c17032160.filspex(c,e,tp)
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
function c17032160.mfilter1(c,mg,exg,rc)
return mg:IsExists(c17032160.mfilter2,1,c,c,exg,rc)
function c17032160.filspgv(c,e,tp)
return c:IsRace(RACE_FIEND) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsCanBeXyzMaterial(nil)
end
function c17032160.mfilter2(c,mc,exg,rc)
return exg:IsExists(c17032160.excheck,1,nil,Group.FromCards(c,mc,rc),rc)
function c17032160.mgxble(Omg,c,xmg,exn,gmg,gn,b,oc)
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
function c17032160.excheck(c,eg,rc)
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 res=c:IsXyzSummonable(eg)
Duel.CheckXyzMaterial=tmp
Auxiliary.XyzLevelFreeFilter=tmp2
return res
function c17032160.filexg(c,oc,xmg,exn,gmg,gn,b)
local level=1
while level<13 do
local e0=Effect.CreateEffect(oc)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_ADD_TYPE)
e0:SetValue(TYPE_MONSTER)
oc:RegisterEffect(e0,true)
local e1=Effect.CreateEffect(oc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_XYZ_LEVEL)
e1:SetValue(level)
oc:RegisterEffect(e1,true)
local mg=xmg:__add(gmg)
mg=mg:Filter(Card.IsXyzLevel,nil,c,level)
if mg:GetCount()>0 and mg:CheckSubGroup(c17032160.mgxble,1,6,c,xmg,exn,gmg,gn,b,oc) then
e0:Reset()
e1:Reset()
return true
end
e0:Reset()
e1:Reset()
level=level+1
end
return false
end
function c17032160.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return false end
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)
function c17032160.filng(c,xmg,exn,gmg,gn,b)
local mg=xmg:__add(gmg)
return mg and mg:CheckSubGroup(c17032160.mgxble,1,6,c,xmg,exn,gmg,gn,b)
end
function c17032160.filter2(c,e,tp)
return c:IsRelateToEffect(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
function c17032160.xbleplus(mg,sc,twomg,xmg,exn,gmg,gn,b)
local og=mg:__add(twomg)
return c17032160.mgxble(og,sc,xmg,exn,gmg,gn,b)
end
function c17032160.gfilter(g,exg,rc)
local sg=g:Clone()
sg:AddCard(rc)
return exg:IsExists(c17032160.excheck,1,nil,sg,rc)
function c17032160.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if not Duel.IsPlayerCanSpecialSummonCount(tp,2) then return false end
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
function c17032160.activate(e,tp,eg,ep,ev,re,r,rp)
local rc=e:GetHandler()
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
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,rc)
exg:Merge(exg1)
local g=mg:SelectSubGroup(tp,c17032160.gfilter,false,1,2,exg,rc)
if #g==0 then return end
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
Duel.RaiseEvent(e:GetHandler(),EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
if g:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<#g then return end
local xyzg=Duel.GetMatchingGroup(c17032160.xyzfilter,tp,LOCATION_EXTRA,0,nil,g,#g)
local xyzg1=Duel.GetMatchingGroup(c17032160.xyzfilter2,tp,LOCATION_EXTRA,0,nil,g,e:GetHandler())
xyzg:Merge(xyzg1)
if xyzg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local xyz=xyzg:Select(tp,1,1,nil):GetFirst()
local tmp=Duel.SelectXyzMaterial
local temp=Duel.CheckXyzMaterial
function Duel.CheckXyzMaterial(c,f,lv,minc,maxc,og)
local flag=temp(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(Card.IsCanBeXyzMaterial,nil,c)+1>=minc then
flag=true
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
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 b1=xyz:IsXyzSummonable(g,#g,#g)
g:AddCard(rc)
local b2=xyz:IsXyzSummonable(g,#g,#g)
local off=1
local ops={}
local opval={}
if b1 then
ops[off]=aux.Stringid(17032160,0)
opval[off-1]=1
off=off+1
end
if b2 then
ops[off]=aux.Stringid(17032160,1)
opval[off-1]=2
off=off+1
end
local op=Duel.SelectOption(tp,table.unpack(ops))
local sel=opval[op]
if sel==1 then
g:RemoveCard(rc)
Duel.XyzSummon(tp,xyz,g)
else
rc:CancelToGrave()
Duel.XyzSummon(tp,xyz,g)
if not Duel.IsPlayerCanSpecialSummonCount(tp,2) then return end
local b=Duel.IsPlayerAffectedByEffect(tp,59822133)
local nilg=Group.CreateGroup()
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then c=nil end
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=nilg
if c then exg=Duel.GetMatchingGroup(c17032160.xyzfilexm,tp,LOCATION_EXTRA,0,nil,e,tp) end
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
if #exg>0 and (#nxg<1 or Duel.SelectYesNo(tp,aux.Stringid(17032160,1))) then
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_ADD_TYPE)
e0:SetValue(TYPE_MONSTER)
e0:SetReset(RESETS_REDIRECT)
c:RegisterEffect(e0,true)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)--xyz
local sc=exg:Select(tp,1,1,nil)
if sc then sc=sc:GetFirst() end
local mg=xmg:__add(gmg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
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
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
elseif #nxg>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)--xyz
local sc=nxg:Select(tp,1,1,nil)
if sc then sc=sc:GetFirst() end
local mg=xmg:__add(gmg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local tmg=mg:SelectSubGroup(tp,c17032160.mgxble,false,1,#mg,sc,xmg,exn,gmg,gn,b)
if tmg then
local tmc=tmg:GetFirst()
while tmc do
Duel.SpecialSummonStep(tmc,0,tp,tp,false,false,POS_FACEUP)
tmc=tmg:GetNext()
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()
Duel.XyzSummon(tp,sc,tmg,0)
end
end
end
\ No newline at end of file
......@@ -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)
end
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
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
......@@ -53,7 +53,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
function cm.costfilter(c)
return c:IsSetCard(0x362) and c:IsAbleToRemoveAsCost()
return c:IsSetCard(0x362) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
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
......
......@@ -26,7 +26,7 @@ function c33310210.initial_effect(c)
e1:SetDescription(aux.Stringid(33310210,0))
e1:SetCategory(CATEGORY_TOHAND)
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:SetTarget(c33310210.thtg)
e1:SetOperation(c33310210.thop)
......
......@@ -19,7 +19,7 @@ function cm.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
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)
end
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