Commit 93ac2a46 authored by nekrozar's avatar nekrozar

fix & update ritual summon

parent d6503ff9
...@@ -9,22 +9,8 @@ function c11398951.initial_effect(c) ...@@ -9,22 +9,8 @@ function c11398951.initial_effect(c)
e1:SetOperation(c11398951.activate) e1:SetOperation(c11398951.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c11398951.filter(c,e,tp,m1,m2,ft) function c11398951.filter(c,e,tp)
if not c:IsSetCard(0x2093) or bit.band(c:GetType(),0x81)~=0x81 return c:IsSetCard(0x2093)
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m1:Filter(Card.IsCanBeRitualMaterial,c,c)
mg:Merge(m2)
if ft>0 then
return mg:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c)
else
return ft>-1 and mg:IsExists(c11398951.mfilterf,1,nil,tp,mg,c)
end
end
function c11398951.mfilterf(c,tp,mg,rc)
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5 then
Duel.SetSelectedCard(c)
return mg:CheckWithSumEqual(Card.GetRitualLevel,rc:GetLevel(),0,99,rc)
else return false end
end end
function c11398951.mfilter(c) function c11398951.mfilter(c)
return c:GetLevel()>0 and c:IsRace(RACE_WARRIOR+RACE_FAIRY) and c:IsAbleToDeck() return c:GetLevel()>0 and c:IsRace(RACE_WARRIOR+RACE_FAIRY) and c:IsAbleToDeck()
...@@ -33,33 +19,29 @@ function c11398951.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -33,33 +19,29 @@ function c11398951.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg1=Duel.GetRitualMaterial(tp) local mg1=Duel.GetRitualMaterial(tp)
local mg2=Duel.GetMatchingGroup(c11398951.mfilter,tp,LOCATION_GRAVE,0,nil) local mg2=Duel.GetMatchingGroup(c11398951.mfilter,tp,LOCATION_GRAVE,0,nil)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) return Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,nil,c11398951.filter,e,tp,mg1,mg2,Card.GetLevel,"Equal")
return Duel.IsExistingMatchingCard(c11398951.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg1,mg2,ft)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function c11398951.activate(e,tp,eg,ep,ev,re,r,rp) function c11398951.activate(e,tp,eg,ep,ev,re,r,rp)
local mg1=Duel.GetRitualMaterial(tp) local mg1=Duel.GetRitualMaterial(tp)
local mg2=Duel.GetMatchingGroup(c11398951.mfilter,tp,LOCATION_GRAVE,0,nil) local mg2=Duel.GetMatchingGroup(c11398951.mfilter,tp,LOCATION_GRAVE,0,nil)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c11398951.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg1,mg2,ft) local g=Duel.SelectMatchingCard(tp,aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,1,nil,c11398951.filter,e,tp,mg1,mg2,Card.GetLevel,"Equal")
local tc=g:GetFirst() local tc=g:GetFirst()
if tc then if tc then
local mg=mg1:Filter(Card.IsCanBeRitualMaterial,tc,tc) local mg=mg1:Filter(Card.IsCanBeRitualMaterial,tc,tc)
mg:Merge(mg2) mg:Merge(mg2)
local mat=nil if tc.mat_filter then
if ft>0 then mg=mg:Filter(tc.mat_filter,tc,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),1,99,tc)
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) mg:RemoveCard(tc)
mat=mg:FilterSelect(tp,c11398951.mfilterf,1,1,nil,tp,mg,tc)
Duel.SetSelectedCard(mat)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat2=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),0,99,tc)
mat:Merge(mat2)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Equal")
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Equal")
aux.GCheckAdditional=nil
if not mat or mat:GetCount()==0 then return end
tc:SetMaterial(mat) tc:SetMaterial(mat)
local mat2=mat:Filter(Card.IsLocation,nil,LOCATION_GRAVE):Filter(Card.IsRace,nil,RACE_WARRIOR+RACE_FAIRY) local mat2=mat:Filter(Card.IsLocation,nil,LOCATION_GRAVE):Filter(Card.IsRace,nil,RACE_WARRIOR+RACE_FAIRY)
mat:Sub(mat2) mat:Sub(mat2)
......
...@@ -13,64 +13,44 @@ end ...@@ -13,64 +13,44 @@ end
function c16494704.exfilter0(c) function c16494704.exfilter0(c)
return c:IsSetCard(0x99) and c:IsLevelAbove(1) and c:IsAbleToGrave() return c:IsSetCard(0x99) and c:IsLevelAbove(1) and c:IsAbleToGrave()
end end
function c16494704.filter(c,e,tp,m,ft) function c16494704.filter(c,e,tp)
if not c:IsRace(RACE_DRAGON) or bit.band(c:GetType(),0x81)~=0x81 return c:IsRace(RACE_DRAGON)
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
if c.mat_filter then
mg=mg:Filter(c.mat_filter,nil,tp)
end
if ft>0 then
return mg:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
else
return mg:IsExists(c16494704.mfilterf,1,nil,tp,mg,c)
end
end
function c16494704.mfilterf(c,tp,mg,rc)
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5 then
Duel.SetSelectedCard(c)
return mg:CheckWithSumGreater(Card.GetRitualLevel,rc:GetLevel(),rc)
else return false end
end end
function c16494704.target(e,tp,eg,ep,ev,re,r,rp,chk) function c16494704.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsType,nil,TYPE_PENDULUM) local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsType,nil,TYPE_PENDULUM)
local sg=nil
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>1 then if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>1 then
local sg=Duel.GetMatchingGroup(c16494704.exfilter0,tp,LOCATION_EXTRA,0,nil) sg=Duel.GetMatchingGroup(c16494704.exfilter0,tp,LOCATION_EXTRA,0,nil)
mg:Merge(sg)
end end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) return Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,c16494704.filter,e,tp,mg,sg,Card.GetLevel,"Greater")
return ft>-1 and Duel.IsExistingMatchingCard(c16494704.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp,mg,ft)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end end
function c16494704.operation(e,tp,eg,ep,ev,re,r,rp) function c16494704.operation(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsType,nil,TYPE_PENDULUM) local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsType,nil,TYPE_PENDULUM)
local sg=nil
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>1 then if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>1 then
local sg=Duel.GetMatchingGroup(c16494704.exfilter0,tp,LOCATION_EXTRA,0,nil) sg=Duel.GetMatchingGroup(c16494704.exfilter0,tp,LOCATION_EXTRA,0,nil)
mg:Merge(sg)
end end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c16494704.filter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp,mg,ft) local tg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(aux.RitualUltimateFilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,c16494704.filter,e,tp,mg,sg,Card.GetLevel,"Greater")
local tc=tg:GetFirst() local tc=tg:GetFirst()
if tc then if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc) mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if tc.mat_filter then if sg then
mg=mg:Filter(tc.mat_filter,nil,tp) mg:Merge(sg)
end end
local mat=nil if tc.mat_filter then
if ft>0 then mg=mg:Filter(tc.mat_filter,tc,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) mg:RemoveCard(tc)
mat=mg:FilterSelect(tp,c16494704.mfilterf,1,1,nil,tp,mg,tc)
Duel.SetSelectedCard(mat)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat2=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
mat:Merge(mat2)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater")
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater")
aux.GCheckAdditional=nil
if not mat or mat:GetCount()==0 then return end
tc:SetMaterial(mat) tc:SetMaterial(mat)
local mat2=mat:Filter(Card.IsLocation,nil,LOCATION_EXTRA) local mat2=mat:Filter(Card.IsLocation,nil,LOCATION_EXTRA)
mat:Sub(mat2) mat:Sub(mat2)
......
...@@ -47,49 +47,33 @@ function c23160024.drop(e,tp,eg,ep,ev,re,r,rp) ...@@ -47,49 +47,33 @@ function c23160024.drop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,e:GetHandler():GetCode()) Duel.Hint(HINT_CARD,0,e:GetHandler():GetCode())
Duel.Draw(tp,1,REASON_EFFECT) Duel.Draw(tp,1,REASON_EFFECT)
end end
function c23160024.spfilter(c,e,tp,m,ft) function c23160024.spfilter(c,e,tp)
if not c:IsCode(98287529) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end return c:IsCode(98287529)
local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
if ft>0 then
return mg:CheckWithSumEqual(Card.GetRitualLevel,8,1,99,c)
else
return mg:IsExists(c23160024.mfilterf,1,nil,tp,mg,c)
end
end
function c23160024.mfilterf(c,tp,mg,rc)
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5 then
Duel.SetSelectedCard(c)
return mg:CheckWithSumEqual(Card.GetRitualLevel,8,0,99,rc)
else return false end
end end
function c23160024.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c23160024.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsType,nil,TYPE_PENDULUM) local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsType,nil,TYPE_PENDULUM)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) return Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,nil,c23160024.spfilter,e,tp,mg,nil,Card.GetOriginalLevel,"Equal")
return ft>-1 and Duel.IsExistingMatchingCard(c23160024.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp,mg,ft)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function c23160024.spop(e,tp,eg,ep,ev,re,r,rp) function c23160024.spop(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsType,nil,TYPE_PENDULUM) local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsType,nil,TYPE_PENDULUM)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c23160024.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg,ft) local g=Duel.SelectMatchingCard(tp,aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,1,nil,c23160024.spfilter,e,tp,mg,nil,Card.GetOriginalLevel,"Equal")
local tc=g:GetFirst() local tc=g:GetFirst()
if tc then if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc) mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
local mat=nil if tc.mat_filter then
if ft>0 then mg=mg:Filter(tc.mat_filter,tc,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,8,1,99,tc)
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) mg:RemoveCard(tc)
mat=mg:FilterSelect(tp,c23160024.mfilterf,1,1,nil,tp,mg,tc)
Duel.SetSelectedCard(mat)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat2=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,8,0,99,tc)
mat:Merge(mat2)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetOriginalLevel(),"Equal")
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,false,1,tc:GetOriginalLevel(),tp,tc,tc:GetOriginalLevel(),"Equal")
aux.GCheckAdditional=nil
if not mat or mat:GetCount()==0 then return end
tc:SetMaterial(mat) tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect() Duel.BreakEffect()
......
...@@ -10,53 +10,36 @@ function c23459650.initial_effect(c) ...@@ -10,53 +10,36 @@ function c23459650.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
c23459650.fit_monster={88176533,24175232} c23459650.fit_monster={88176533,24175232}
function c23459650.filter(c,e,tp,m,ft) function c23459650.filter(c,e,tp)
if not c:IsSetCard(0x11f) or bit.band(c:GetType(),0x81)~=0x81 return c:IsSetCard(0x11f)
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
if ft>0 then
return mg:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
else
return mg:IsExists(c23459650.filterF,1,nil,tp,mg,c)
end
end
function c23459650.filterF(c,tp,mg,rc)
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5 then
Duel.SetSelectedCard(c)
return mg:CheckWithSumGreater(Card.GetRitualLevel,rc:GetLevel(),rc)
else return false end
end end
function c23459650.target(e,tp,eg,ep,ev,re,r,rp,chk) function c23459650.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) return Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,nil,c23459650.filter,e,tp,mg,nil,Card.GetLevel,"Greater")
return ft>-1 and Duel.IsExistingMatchingCard(c23459650.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg,ft)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function c23459650.mfilter(c) function c23459650.mfilter(c)
return c:IsCode(88176533) or c:IsCode(24175232) return c:IsCode(88176533,24175232)
end end
function c23459650.activate(e,tp,eg,ep,ev,re,r,rp) function c23459650.activate(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c23459650.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg,ft) local tg=Duel.SelectMatchingCard(tp,aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,1,nil,c23459650.filter,e,tp,mg,nil,Card.GetLevel,"Greater")
local tc=tg:GetFirst() local tc=tg:GetFirst()
if tc then if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc) mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
local mat=nil if tc.mat_filter then
if ft>0 then mg=mg:Filter(tc.mat_filter,tc,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) mg:RemoveCard(tc)
mat=mg:FilterSelect(tp,c23459650.filterF,1,1,nil,tp,mg,tc)
Duel.SetSelectedCard(mat)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat2=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
mat:Merge(mat2)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater")
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater")
aux.GCheckAdditional=nil
if not mat or mat:GetCount()==0 then return end
tc:SetMaterial(mat) tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect() Duel.BreakEffect()
......
...@@ -32,49 +32,33 @@ function c27383110.initial_effect(c) ...@@ -32,49 +32,33 @@ function c27383110.initial_effect(c)
e1:SetLabelObject(e3) e1:SetLabelObject(e3)
end end
c27383110.fit_monster={44665365} c27383110.fit_monster={44665365}
function c27383110.filter(c,e,tp,m,ft) function c27383110.filter(c,e,tp)
if not c:IsCode(44665365) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end return c:IsCode(44665365)
local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
if ft>0 then
return mg:CheckWithSumEqual(Card.GetRitualLevel,6,1,99,c)
else
return mg:IsExists(c27383110.mfilterf,1,nil,tp,mg,c)
end
end
function c27383110.mfilterf(c,tp,mg,rc)
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5 then
Duel.SetSelectedCard(c)
return mg:CheckWithSumEqual(Card.GetRitualLevel,6,0,99,rc)
else return false end
end end
function c27383110.target(e,tp,eg,ep,ev,re,r,rp,chk) function c27383110.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) return Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,nil,c27383110.filter,e,tp,mg,nil,Card.GetOriginalLevel,"Equal")
return ft>-1 and Duel.IsExistingMatchingCard(c27383110.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg,ft)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function c27383110.activate(e,tp,eg,ep,ev,re,r,rp) function c27383110.activate(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c27383110.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg,ft) local tg=Duel.SelectMatchingCard(tp,aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,1,nil,c27383110.filter,e,tp,mg,nil,Card.GetOriginalLevel,"Equal")
local tc=tg:GetFirst() local tc=tg:GetFirst()
if tc then if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc) mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
local mat=nil if tc.mat_filter then
if ft>0 then mg=mg:Filter(tc.mat_filter,tc,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,6,1,99,tc)
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) mg:RemoveCard(tc)
mat=mg:FilterSelect(tp,c27383110.mfilterf,1,1,nil,tp,mg,tc)
Duel.SetSelectedCard(mat)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat2=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,6,0,99,tc)
mat:Merge(mat2)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetOriginalLevel(),"Equal")
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,false,1,tc:GetOriginalLevel(),tp,tc,tc:GetOriginalLevel(),"Equal")
aux.GCheckAdditional=nil
if not mat or mat:GetCount()==0 then return end
tc:SetMaterial(mat) tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect() Duel.BreakEffect()
......
...@@ -23,36 +23,39 @@ end ...@@ -23,36 +23,39 @@ end
function c28429121.mfilter(c,e) function c28429121.mfilter(c,e)
return c:IsFaceup() and c:GetLevel()>0 and not c:IsImmuneToEffect(e) and c:IsReleasable() return c:IsFaceup() and c:GetLevel()>0 and not c:IsImmuneToEffect(e) and c:IsReleasable()
end end
function c28429121.filter(c,e,tp,m) function c28429121.filter(c,e,tp)
if bit.band(c:GetType(),0x81)~=0x81 or not c:IsSetCard(0x3a) return c:IsSetCard(0x3a)
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
return mg:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c)
end end
function c28429121.target(e,tp,eg,ep,ev,re,r,rp,chk) function c28429121.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end
local mg1=Duel.GetRitualMaterial(tp) local mg1=Duel.GetRitualMaterial(tp)
mg1:Remove(Card.IsLocation,nil,LOCATION_HAND) mg1:Remove(Card.IsLocation,nil,LOCATION_HAND)
local mg2=Duel.GetMatchingGroup(c28429121.mfilter,tp,0,LOCATION_MZONE,nil,e) local mg2=Duel.GetMatchingGroup(c28429121.mfilter,tp,0,LOCATION_MZONE,nil,e)
mg1:Merge(mg2) mg1:Merge(mg2)
return Duel.IsExistingMatchingCard(c28429121.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg1) return Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,nil,c28429121.filter,e,tp,mg1,nil,Card.GetLevel,"Equal")
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function c28429121.activate(e,tp,eg,ep,ev,re,r,rp) function c28429121.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local mg1=Duel.GetRitualMaterial(tp) local mg1=Duel.GetRitualMaterial(tp)
mg1:Remove(Card.IsLocation,nil,LOCATION_HAND) mg1:Remove(Card.IsLocation,nil,LOCATION_HAND)
local mg2=Duel.GetMatchingGroup(c28429121.mfilter,tp,0,LOCATION_MZONE,nil,e) local mg2=Duel.GetMatchingGroup(c28429121.mfilter,tp,0,LOCATION_MZONE,nil,e)
mg1:Merge(mg2) mg1:Merge(mg2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c28429121.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg1) local tg=Duel.SelectMatchingCard(tp,aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,1,nil,c28429121.filter,e,tp,mg1,nil,Card.GetLevel,"Equal")
local tc=tg:GetFirst() local tc=tg:GetFirst()
if tc then if tc then
local mg=mg1:Filter(Card.IsCanBeRitualMaterial,tc,tc) local mg=mg1:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,tc,tp)
else
mg:RemoveCard(tc)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),1,99,tc) aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Equal")
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Equal")
aux.GCheckAdditional=nil
if not mat or mat:GetCount()==0 then return end
tc:SetMaterial(mat) tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect() Duel.BreakEffect()
......
...@@ -21,17 +21,14 @@ function c32828635.initial_effect(c) ...@@ -21,17 +21,14 @@ function c32828635.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
c32828635.fit_monster={46427957,72426662} c32828635.fit_monster={46427957,72426662}
function c32828635.cfilter(c,e,tp,m) function c32828635.cfilter(c,e,tp)
if bit.band(c:GetType(),0x81)~=0x81 or not c:IsCode(46427957,72426662) return c:IsCode(46427957,72426662)
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
return mg:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
end end
function c32828635.target(e,tp,eg,ep,ev,re,r,rp,chk) function c32828635.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg1=Duel.GetRitualMaterial(tp) local mg1=Duel.GetRitualMaterial(tp)
mg1:Remove(Card.IsLocation,nil,LOCATION_HAND) mg1:Remove(Card.IsLocation,nil,LOCATION_HAND)
return Duel.IsExistingMatchingCard(c32828635.cfilter,tp,LOCATION_HAND,0,1,nil,e,tp,mg1) return Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,nil,c32828635.cfilter,e,tp,mg1,nil,Card.GetLevel,"Greater")
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
...@@ -39,12 +36,20 @@ function c32828635.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -39,12 +36,20 @@ function c32828635.activate(e,tp,eg,ep,ev,re,r,rp)
local mg1=Duel.GetRitualMaterial(tp) local mg1=Duel.GetRitualMaterial(tp)
mg1:Remove(Card.IsLocation,nil,LOCATION_HAND) mg1:Remove(Card.IsLocation,nil,LOCATION_HAND)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c32828635.cfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg1) local tg=Duel.SelectMatchingCard(tp,aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,1,nil,c32828635.cfilter,e,tp,mg1,nil,Card.GetLevel,"Greater")
local tc=tg:GetFirst() local tc=tg:GetFirst()
if tc then if tc then
local mg=mg1:Filter(Card.IsCanBeRitualMaterial,tc,tc) local mg=mg1:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,tc,tp)
else
mg:RemoveCard(tc)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc) aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater")
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater")
aux.GCheckAdditional=nil
if not mat or mat:GetCount()==0 then return end
tc:SetMaterial(mat) tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP) Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
......
--サイバネット・リチューアル --サイバネット・リチューアル
function c34767865.initial_effect(c) function c34767865.initial_effect(c)
aux.AddRitualProcGreater(c,c34767865.ritual_filter) aux.AddRitualProcGreater2(c,c34767865.ritual_filter)
--token --token
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
......
...@@ -20,22 +20,8 @@ function c38784726.initial_effect(c) ...@@ -20,22 +20,8 @@ function c38784726.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
c38784726.fit_monster={16313112} c38784726.fit_monster={16313112}
function c38784726.filter(c,e,tp,m,m2,ft) function c38784726.filter(c,e,tp)
if not c:IsSetCard(0x119) or bit.band(c:GetType(),0x81)~=0x81 return c:IsSetCard(0x119)
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
mg:Merge(m2)
if ft>0 then
return mg:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
else
return mg:IsExists(c38784726.filterF,1,nil,tp,mg,c)
end
end
function c38784726.filterF(c,tp,mg,rc)
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5 then
Duel.SetSelectedCard(c)
return mg:CheckWithSumGreater(Card.GetRitualLevel,rc:GetLevel(),rc)
else return false end
end end
function c38784726.mfilter(c) function c38784726.mfilter(c)
return c:GetLevel()>0 and c:IsSetCard(0x119) and c:IsAbleToDeck() return c:GetLevel()>0 and c:IsSetCard(0x119) and c:IsAbleToDeck()
...@@ -46,40 +32,36 @@ end ...@@ -46,40 +32,36 @@ end
function c38784726.target(e,tp,eg,ep,ev,re,r,rp,chk) function c38784726.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
local mg2=Group.CreateGroup() local mg2=nil
if Duel.IsExistingMatchingCard(c38784726.cfilter,tp,LOCATION_MZONE,0,1,nil) then if Duel.IsExistingMatchingCard(c38784726.cfilter,tp,LOCATION_MZONE,0,1,nil) then
mg2=Duel.GetMatchingGroup(c38784726.mfilter,tp,LOCATION_GRAVE,0,nil) mg2=Duel.GetMatchingGroup(c38784726.mfilter,tp,LOCATION_GRAVE,0,nil)
end end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) return Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,nil,c38784726.filter,e,tp,mg,mg2,Card.GetLevel,"Greater")
return ft>-1 and Duel.IsExistingMatchingCard(c38784726.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg,mg2,ft)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function c38784726.activate(e,tp,eg,ep,ev,re,r,rp) function c38784726.activate(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
local mg2=Group.CreateGroup() local mg2=nil
if Duel.IsExistingMatchingCard(c38784726.cfilter,tp,LOCATION_MZONE,0,1,nil) then if Duel.IsExistingMatchingCard(c38784726.cfilter,tp,LOCATION_MZONE,0,1,nil) then
mg2=Duel.GetMatchingGroup(c38784726.mfilter,tp,LOCATION_GRAVE,0,nil) mg2=Duel.GetMatchingGroup(c38784726.mfilter,tp,LOCATION_GRAVE,0,nil)
end end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c38784726.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg,mg2,ft) local tg=Duel.SelectMatchingCard(tp,aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,1,nil,c38784726.filter,e,tp,mg,mg2,Card.GetLevel,"Greater")
local tc=tg:GetFirst() local tc=tg:GetFirst()
if tc then if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc) mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
mg:Merge(mg2) mg:Merge(mg2)
local mat=nil if tc.mat_filter then
if ft>0 then mg=mg:Filter(tc.mat_filter,tc,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) mg:RemoveCard(tc)
mat=mg:FilterSelect(tp,c38784726.filterF,1,1,nil,tp,mg,tc)
Duel.SetSelectedCard(mat)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat2=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
mat:Merge(mat2)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater")
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater")
aux.GCheckAdditional=nil
if not mat or mat:GetCount()==0 then return end
tc:SetMaterial(mat) tc:SetMaterial(mat)
local mat2=mat:Filter(Card.IsLocation,nil,LOCATION_GRAVE) local mat2=mat:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
mat:Sub(mat2) mat:Sub(mat2)
......
--機械天使の儀式 --機械天使の儀式
function c39996157.initial_effect(c) function c39996157.initial_effect(c)
--Activate aux.AddRitualProcGreater2(c,c39996157.ritual_filter)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c39996157.target)
e1:SetOperation(c39996157.activate)
c:RegisterEffect(e1)
--destroy replace --destroy replace
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
...@@ -18,56 +11,8 @@ function c39996157.initial_effect(c) ...@@ -18,56 +11,8 @@ function c39996157.initial_effect(c)
e2:SetOperation(c39996157.repop) e2:SetOperation(c39996157.repop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c39996157.filter(c,e,tp,m,ft) function c39996157.ritual_filter(c)
if not c:IsSetCard(0x2093) or bit.band(c:GetType(),0x81)~=0x81 return c:IsSetCard(0x2093)
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
if ft>0 then
return mg:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
else
return mg:IsExists(c39996157.filterF,1,nil,tp,mg,c)
end
end
function c39996157.filterF(c,tp,mg,rc)
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5 then
Duel.SetSelectedCard(c)
return mg:CheckWithSumGreater(Card.GetRitualLevel,rc:GetLevel(),rc)
else return false end
end
function c39996157.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return ft>-1 and Duel.IsExistingMatchingCard(c39996157.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg,ft)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c39996157.activate(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c39996157.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg,ft)
local tc=tg:GetFirst()
if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
local mat=nil
if ft>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:FilterSelect(tp,c39996157.filterF,1,1,nil,tp,mg,tc)
Duel.SetSelectedCard(mat)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat2=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
mat:Merge(mat2)
end
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end end
function c39996157.repfilter(c,tp) function c39996157.repfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsAttribute(ATTRIBUTE_LIGHT) return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsAttribute(ATTRIBUTE_LIGHT)
......
...@@ -10,26 +10,13 @@ function c79306385.initial_effect(c) ...@@ -10,26 +10,13 @@ function c79306385.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
c79306385.fit_monster={48546368} c79306385.fit_monster={48546368}
function c79306385.filter(c,e,tp,m,ft) function c79306385.filter(c,e,tp)
if not c:IsCode(48546368) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end return c:IsCode(48546368)
local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
if ft>0 then
return mg:CheckWithSumGreater(Card.GetRitualLevel,12,c)
else
return mg:IsExists(c79306385.mfilterf,1,nil,tp,mg,c)
end
end
function c79306385.mfilterf(c,tp,mg,rc)
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5 then
Duel.SetSelectedCard(c)
return mg:CheckWithSumGreater(Card.GetRitualLevel,12,rc)
else return false end
end end
function c79306385.target(e,tp,eg,ep,ev,re,r,rp,chk) function c79306385.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) return Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,nil,c79306385.filter,e,tp,mg,nil,Card.GetOriginalLevel,"Greater")
return ft>-1 and Duel.IsExistingMatchingCard(c79306385.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg,ft)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
...@@ -41,24 +28,21 @@ function c79306385.chlimit(e,ep,tp) ...@@ -41,24 +28,21 @@ function c79306385.chlimit(e,ep,tp)
end end
function c79306385.activate(e,tp,eg,ep,ev,re,r,rp) function c79306385.activate(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c79306385.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg,ft) local tg=Duel.SelectMatchingCard(tp,aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,1,nil,c79306385.filter,e,tp,mg,nil,Card.GetOriginalLevel,"Greater")
local tc=tg:GetFirst() local tc=tg:GetFirst()
if tc then if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc) mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
local mat=nil if tc.mat_filter then
if ft>0 then mg=mg:Filter(tc.mat_filter,tc,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,12,tc)
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) mg:RemoveCard(tc)
mat=mg:FilterSelect(tp,c79306385.mfilterf,1,1,nil,tp,mg,tc)
Duel.SetSelectedCard(mat)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat2=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,12,tc)
mat:Merge(mat2)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetOriginalLevel(),"Greater")
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,false,1,tc:GetOriginalLevel(),tp,tc,tc:GetOriginalLevel(),"Greater")
aux.GCheckAdditional=nil
if not mat or mat:GetCount()==0 then return end
tc:SetMaterial(mat) tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect() Duel.BreakEffect()
......
...@@ -13,84 +13,54 @@ end ...@@ -13,84 +13,54 @@ end
function c7986397.dfilter(c) function c7986397.dfilter(c)
return c:IsSetCard(0x106) and c:IsLevelAbove(1) and c:IsAbleToGrave() return c:IsSetCard(0x106) and c:IsLevelAbove(1) and c:IsAbleToGrave()
end end
function c7986397.filter(c,e,tp,m,ft) function c7986397.filter(c,e,tp,m)
if not c:IsSetCard(0x106) or bit.band(c:GetType(),0x81)~=0x81 if not c:IsSetCard(0x106) or bit.band(c:GetType(),0x81)~=0x81
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c) local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
local dg=Duel.GetMatchingGroup(c7986397.dfilter,tp,LOCATION_DECK,0,nil) local dg=Duel.GetMatchingGroup(c7986397.dfilter,tp,LOCATION_DECK,0,nil)
if ft>0 then mg:Merge(dg)
return mg:CheckWithSumEqual(Card.GetRitualLevel,c:GetLevel(),1,99,c) if c.mat_filter then
or dg:IsExists(c7986397.dlvfilter,1,nil,tp,mg,c) mg=mg:Filter(c.mat_filter,c,tp)
else else
return ft>-1 and mg:IsExists(c7986397.mfilterf,1,nil,tp,mg,dg,c) mg:RemoveCard(c)
end end
aux.GCheckAdditional=aux.RitualCheckAdditional(c,c:GetLevel(),"Equal")
local res=mg:CheckSubGroup(c7986397.fselect,1,c:GetLevel(),c)
aux.GCheckAdditional=nil
return res
end end
function c7986397.mfilterf(c,tp,mg,dg,rc) function c7986397.fselect(g,mc)
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5 then return aux.RitualCheck(g,tp,mc,mc:GetLevel(),"Equal") and g:FilterCount(Card.IsLocation,nil,LOCATION_DECK)<=1
Duel.SetSelectedCard(c)
return mg:CheckWithSumEqual(Card.GetRitualLevel,rc:GetLevel(),0,99,rc)
or dg:IsExists(c7986397.dlvfilter,1,nil,tp,mg,rc,c)
else return false end
end
function c7986397.dlvfilter(c,tp,mg,rc,mc)
Duel.SetSelectedCard(Group.FromCards(c,mc))
return mg:CheckWithSumEqual(Card.GetRitualLevel,rc:GetLevel(),0,99,rc)
end end
function c7986397.target(e,tp,eg,ep,ev,re,r,rp,chk) function c7986397.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) return Duel.IsExistingMatchingCard(c7986397.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp,mg)
return Duel.IsExistingMatchingCard(c7986397.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp,mg,ft)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end end
function c7986397.activate(e,tp,eg,ep,ev,re,r,rp) function c7986397.activate(e,tp,eg,ep,ev,re,r,rp)
local m=Duel.GetRitualMaterial(tp) local m=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c7986397.filter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp,m,ft) local tg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c7986397.filter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp,m)
local tc=tg:GetFirst() local tc=tg:GetFirst()
if tc then if tc then
local mat,dmat
local mg=m:Filter(Card.IsCanBeRitualMaterial,tc,tc) local mg=m:Filter(Card.IsCanBeRitualMaterial,tc,tc)
local dg=Duel.GetMatchingGroup(c7986397.dfilter,tp,LOCATION_DECK,0,nil) local dg=Duel.GetMatchingGroup(c7986397.dfilter,tp,LOCATION_DECK,0,nil)
if ft>0 then mg:Merge(dg)
local b1=dg:IsExists(c7986397.dlvfilter,1,nil,tp,mg,tc) if tc.mat_filter then
local b2=mg:CheckWithSumEqual(Card.GetRitualLevel,tc:GetLevel(),1,99,tc) mg=mg:Filter(tc.mat_filter,tc,tp)
if b1 and (not b2 or Duel.SelectYesNo(tp,aux.Stringid(7986397,0))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
dmat=dg:FilterSelect(tp,c7986397.dlvfilter,1,1,nil,tp,mg,tc)
Duel.SetSelectedCard(dmat)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),0,99,tc)
mat:Merge(dmat)
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) mg:RemoveCard(tc)
mat=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),1,99,tc)
end end
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:FilterSelect(tp,c7986397.mfilterf,1,1,nil,tp,mg,dg,tc)
local b1=dg:IsExists(c7986397.dlvfilter,1,nil,tp,mg,tc,mat:GetFirst())
Duel.SetSelectedCard(mat)
local b2=mg:CheckWithSumEqual(Card.GetRitualLevel,tc:GetLevel(),0,99,tc)
if b1 and (not b2 or Duel.SelectYesNo(tp,aux.Stringid(7986397,0))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
dmat=dg:FilterSelect(tp,c7986397.dlvfilter,1,1,nil,tp,mg,tc,mat:GetFirst())
mat:Merge(dmat)
Duel.SetSelectedCard(mat)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat2=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),0,99,tc) aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Equal")
mat:Merge(mat2) local mat=mg:SelectSubGroup(tp,c7986397.fselect,false,1,tc:GetLevel(),tc)
else aux.GCheckAdditional=nil
Duel.SetSelectedCard(mat) if not mat or mat:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat2=mg:SelectWithSumEqual(tp,Card.GetRitualLevel,tc:GetLevel(),0,99,tc)
mat:Merge(mat2)
end
end
tc:SetMaterial(mat) tc:SetMaterial(mat)
if dmat then local dmat=mat:Filter(Card.IsLocation,nil,LOCATION_DECK)
if dmat:GetCount()>0 then
mat:Sub(dmat) mat:Sub(dmat)
Duel.SendtoGrave(dmat,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL) Duel.SendtoGrave(dmat,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL)
end end
......
--リバース・オブ・ザ・ワールド --リバース・オブ・ザ・ワールド
function c95612049.initial_effect(c) function c95612049.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=aux.AddRitualProcGreater2(c,c95612049.filter,LOCATION_HAND+LOCATION_DECK,nil,c95612049.mfilter)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,95612049+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,95612049+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c95612049.target)
e1:SetOperation(c95612049.activate)
c:RegisterEffect(e1)
end end
function c95612049.mfilter(c) function c95612049.mfilter(c)
return c:IsLocation(LOCATION_HAND) and c:IsType(TYPE_RITUAL) return c:IsLocation(LOCATION_HAND) and c:IsType(TYPE_RITUAL)
end end
function c95612049.filter(c,e,tp,m) function c95612049.filter(c)
if not c:IsCode(72426662,46427957) or bit.band(c:GetType(),0x81)~=0x81 return c:IsCode(72426662,46427957)
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
return mg:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
end
function c95612049.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetRitualMaterial(tp):Filter(c95612049.mfilter,nil)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c95612049.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c95612049.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local mg=Duel.GetRitualMaterial(tp):Filter(c95612049.mfilter,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c95612049.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp,mg)
local tc=tg:GetFirst()
if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end end
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