Commit f0473045 authored by mercury233's avatar mercury233 Committed by GitHub

update Nekroz of Sophia (#1103)

parent eafae0fc
...@@ -93,43 +93,38 @@ end ...@@ -93,43 +93,38 @@ end
function c21105106.filter(c,tp) function c21105106.filter(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) return c:IsControler(tp) and c:IsLocation(LOCATION_MZONE)
end end
function c21105106.ritual_custom_condition(c,mg,ft) function c21105106.ritual_custom_condition(c,mg,ft,greater)
--ft is kept for compatablity
local tp=c:GetControler() local tp=c:GetControler()
local g=mg:Filter(c21105106.filter,c,tp) local g=mg:Filter(c21105106.filter,c,tp)
return ft>-3 and g:IsExists(c21105106.ritfilter1,1,nil,c:GetLevel(),g) local sg=Group.CreateGroup()
end return g:IsExists(c21105106.rselect,1,nil,tp,sg,g,c,greater)
function c21105106.ritfilter1(c,lv,mg) end
lv=lv-c:GetLevel() function c21105106.rselect(c,tp,sg,mg,rc,greater)
if lv<2 then return false end sg:AddCard(c)
local mg2=mg:Clone() local res=#sg==3 and c21105106.rgoal(tp,sg,rc,greater)
mg2:Remove(Card.IsRace,nil,c:GetRace()) or #sg<3 and mg:IsExists(c21105106.rselect,1,sg,tp,sg,mg,rc,greater)
return mg2:IsExists(c21105106.ritfilter2,1,nil,lv,mg2) sg:RemoveCard(c)
end return res
function c21105106.ritfilter2(c,lv,mg) end
local clv=c:GetLevel() function c21105106.rgoal(tp,sg,rc,greater)
lv=lv-clv if not (#sg==3 and Duel.GetMZoneCount(tp,sg,tp)>0 and sg:GetClassCount(Card.GetRace)==3) then return false end
if lv<1 then return false end if greater then
local mg2=mg:Clone() Duel.SetSelectedCard(sg)
mg2:Remove(Card.IsRace,nil,c:GetRace()) return sg:CheckWithSumGreater(Card.GetRitualLevel,rc:GetLevel(),rc)
return mg2:IsExists(Card.IsLevel,1,nil,lv) else
end return sg:CheckWithSumEqual(Card.GetRitualLevel,rc:GetLevel(),3,3,rc)
function c21105106.ritual_custom_operation(c,mg) end
end
function c21105106.ritual_custom_operation(c,mg1,greater)
local tp=c:GetControler() local tp=c:GetControler()
local lv=c:GetLevel() local lv=c:GetLevel()
local g=mg:Filter(c21105106.filter,c,tp) local mg=mg1:Filter(c21105106.filter,c,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) local sg=Group.CreateGroup()
local g1=g:FilterSelect(tp,c21105106.ritfilter1,1,1,nil,lv,g) while #sg<3 do
local tc1=g1:GetFirst() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
lv=lv-tc1:GetLevel() local g=mg:FilterSelect(tp,c21105106.rselect,1,1,sg,tp,sg,mg,c,greater)
g:Remove(Card.IsRace,nil,tc1:GetRace()) sg:Merge(g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) end
local g2=g:FilterSelect(tp,c21105106.ritfilter2,1,1,nil,lv,g) c:SetMaterial(sg)
local tc2=g2:GetFirst()
lv=lv-tc2:GetLevel()
g:Remove(Card.IsRace,nil,tc2:GetRace())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g3=g:FilterSelect(tp,Card.IsLevel,1,1,nil,lv)
g1:Merge(g2)
g1:Merge(g3)
c:SetMaterial(g1)
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