Commit 827c6baa authored by nanahira's avatar nanahira

ritual subgroup part 1

parent 5e817ef2
...@@ -1389,27 +1389,20 @@ function Auxiliary.AddRitualProcGreater(c,filter) ...@@ -1389,27 +1389,20 @@ function Auxiliary.AddRitualProcGreater(c,filter)
e1:SetOperation(Auxiliary.RitualGreaterOperation(filter)) e1:SetOperation(Auxiliary.RitualGreaterOperation(filter))
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function Auxiliary.RitualGreaterFilter(c,filter,e,tp,m,ft) function Auxiliary.RitualGreaterCheck(g,tp,c,lv)
Duel.SetSelectedCard(g)
return g:CheckWithSumGreater(Card.GetRitualLevel,lv,c) and Duel.GetMZoneCount(tp,g,tp)>0
end
function Auxiliary.RitualGreaterFilter(c,filter,e,tp,m)
if (filter and not filter(c)) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end if (filter and not filter(c)) 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)
if ft>0 then return mg:CheckSubGroup(Auxiliary.RitualGreaterCheck,1,63,tp,c,c:GetOriginalLevel())
return mg:CheckWithSumGreater(Card.GetRitualLevel,c:GetOriginalLevel(),c)
else
return mg:IsExists(Auxiliary.RitualGreaterFilterF,1,nil,tp,mg,c)
end
end
function Auxiliary.RitualGreaterFilterF(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:GetOriginalLevel(),rc)
else return false end
end end
function Auxiliary.RitualGreaterTarget(filter) function Auxiliary.RitualGreaterTarget(filter)
return function(e,tp,eg,ep,ev,re,r,rp,chk) return function(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(Auxiliary.RitualGreaterFilter,tp,LOCATION_HAND,0,1,nil,filter,e,tp,mg)
return ft>-1 and Duel.IsExistingMatchingCard(Auxiliary.RitualGreaterFilter,tp,LOCATION_HAND,0,1,nil,filter,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
...@@ -1423,18 +1416,8 @@ function Auxiliary.RitualGreaterOperation(filter) ...@@ -1423,18 +1416,8 @@ function Auxiliary.RitualGreaterOperation(filter)
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 Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
if ft>0 then local mat=mg:SelectSubGroup(tp,Auxiliary.RitualGreaterCheck,false,1,63,tp,tc,tc:GetOriginalLevel())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetOriginalLevel(),tc)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:FilterSelect(tp,Auxiliary.RitualGreaterFilterF,1,1,nil,tp,mg,tc)
Duel.SetSelectedCard(mat)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat2=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetOriginalLevel(),tc)
mat:Merge(mat2)
end
tc:SetMaterial(mat) tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
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