Commit b902a59b authored by REIKAI's avatar REIKAI 💬

Update c86590310.lua

parent fc0e21b2
...@@ -31,13 +31,22 @@ function cm.RitualUltimateFilter(c,filter,e,tp,m1,m2,level_function,greater_or_e ...@@ -31,13 +31,22 @@ function cm.RitualUltimateFilter(c,filter,e,tp,m1,m2,level_function,greater_or_e
end end
local lv=level_function(c) local lv=level_function(c)
Auxiliary.GCheckAdditional=Auxiliary.RitualCheckAdditional(c,lv,greater_or_equal) Auxiliary.GCheckAdditional=Auxiliary.RitualCheckAdditional(c,lv,greater_or_equal)
local res=mg:CheckSubGroup(Auxiliary.RitualCheck,1,lv,tp,c,lv,greater_or_equal) local res=mg:CheckSubGroup(cm.ritualcheckgroup,1,lv,tp,c,lv,greater_or_equal)
Auxiliary.GCheckAdditional=nil Auxiliary.GCheckAdditional=nil
return res return res
end end
function cm.ritualcheckgroup(g,tp,c,lv,str)
if c:IsLocation(LOCATION_MZONE) and not g:IsExists(Card.IsCode,1,nil,86590300) then
return false
end
return Auxiliary.RitualCheck(g,tp,c,lv,str)
end
function cm.rtc(g,c,lv) function cm.rtc(g,c,lv)
Duel.SetSelectedCard(g) Duel.SetSelectedCard(g)
return g:CheckWithSumGreater(Card.GetRitualLevel,lv,c) and g:IsExists(Card.IsCode,1,nil,86590300) if c:IsLocation(LOCATION_MZONE) and not g:IsExists(Card.IsCode,1,nil,86590300) then
return false
end
return g:CheckWithSumGreater(Card.GetRitualLevel,lv,c)
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)
if chk==0 then if chk==0 then
...@@ -54,7 +63,6 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -54,7 +63,6 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.SelectMatchingCard(tp,cm.RitualUltimateFilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,cm.filter,e,tp,mg,mg2,Card.GetLevel,"Greater") local tg=Duel.SelectMatchingCard(tp,cm.RitualUltimateFilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,cm.filter,e,tp,mg,mg2,Card.GetLevel,"Greater")
local tc=tg:GetFirst() local tc=tg:GetFirst()
if tc then if tc then
if tc:IsLocation(LOCATION_DECK) then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc) mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if tc.mat_filter then if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,tc,tp) mg=mg:Filter(tc.mat_filter,tc,tp)
...@@ -72,25 +80,6 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -72,25 +80,6 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.BreakEffect() Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP) Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure() tc:CompleteProcedure()
else
mg=mg: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)
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)
Duel.ReleaseRitualMaterial(mat)
mtg:Merge(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end end
if tc:IsFaceup() and #mtg>0 then if tc:IsFaceup() and #mtg>0 then
Duel.BreakEffect() Duel.BreakEffect()
......
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