Commit 9fdb4f41 authored by Chrono-Genex's avatar Chrono-Genex Committed by GitHub

update Rebirth of Nephthys (#1728)

parent fb5e6c33
--ネフティスの輪廻 --ネフティスの輪廻
function c23459650.initial_effect(c) function c23459650.initial_effect(c)
aux.AddCodeList(c,88176533,24175232) aux.AddCodeList(c,88176533,24175232)
--Activate aux.AddRitualProcGreater2(c,c23459650.filter,LOCATION_HAND,nil,nil,false,c23459650.extraop)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c23459650.target)
e1:SetOperation(c23459650.activate)
c:RegisterEffect(e1)
end end
function c23459650.filter(c,e,tp) function c23459650.filter(c,e,tp)
return c:IsSetCard(0x11f) return c:IsSetCard(0x11f)
end end
function c23459650.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetRitualMaterial(tp)
return Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,nil,c23459650.filter,e,tp,mg,nil,Card.GetLevel,"Greater")
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c23459650.mfilter(c) function c23459650.mfilter(c)
if c:IsPreviousLocation(LOCATION_MZONE) then if c:IsPreviousLocation(LOCATION_MZONE) then
local code,code2=c:GetPreviousCodeOnField() local code,code2=c:GetPreviousCodeOnField()
...@@ -27,34 +13,13 @@ function c23459650.mfilter(c) ...@@ -27,34 +13,13 @@ function c23459650.mfilter(c)
end end
return c:IsCode(88176533,24175232) return c:IsCode(88176533,24175232)
end end
function c23459650.activate(e,tp,eg,ep,ev,re,r,rp) function c23459650.extraop(e,tp,eg,ep,ev,re,r,rp,tc,mat)
local mg=Duel.GetRitualMaterial(tp) if not tc then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
local tg=Duel.SelectMatchingCard(tp,aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,1,nil,c23459650.filter,e,tp,mg,nil,Card.GetLevel,"Greater") if mat:IsExists(c23459650.mfilter,1,nil) and #g>0 and Duel.SelectYesNo(tp,aux.Stringid(23459650,0)) then
local tc=tg:GetFirst()
if tc then
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)
Duel.BreakEffect() Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
tc:CompleteProcedure() local sg=g:Select(tp,1,1,e:GetHandler())
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler()) Duel.Destroy(sg,REASON_EFFECT)
if mat:IsExists(c23459650.mfilter,1,nil) and #g>0 and Duel.SelectYesNo(tp,aux.Stringid(23459650,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=g:Select(tp,1,1,e:GetHandler())
Duel.Destroy(sg,REASON_EFFECT)
end
end end
end end
...@@ -1675,6 +1675,7 @@ function Auxiliary.RitualUltimateOperation(filter,level_function,greater_or_equa ...@@ -1675,6 +1675,7 @@ function Auxiliary.RitualUltimateOperation(filter,level_function,greater_or_equa
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,Auxiliary.NecroValleyFilter(Auxiliary.RitualUltimateFilter),tp,summon_location,0,1,1,nil,filter,e,tp,mg,exg,level_function,greater_or_equal) local tg=Duel.SelectMatchingCard(tp,Auxiliary.NecroValleyFilter(Auxiliary.RitualUltimateFilter),tp,summon_location,0,1,1,nil,filter,e,tp,mg,exg,level_function,greater_or_equal)
local tc=tg:GetFirst() local tc=tg:GetFirst()
local mat
if tc then if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc) mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if exg then if exg then
...@@ -1688,7 +1689,7 @@ function Auxiliary.RitualUltimateOperation(filter,level_function,greater_or_equa ...@@ -1688,7 +1689,7 @@ function Auxiliary.RitualUltimateOperation(filter,level_function,greater_or_equa
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local lv=level_function(tc) local lv=level_function(tc)
Auxiliary.GCheckAdditional=Auxiliary.RitualCheckAdditional(tc,lv,greater_or_equal) Auxiliary.GCheckAdditional=Auxiliary.RitualCheckAdditional(tc,lv,greater_or_equal)
local mat=mg:SelectSubGroup(tp,Auxiliary.RitualCheck,false,1,lv,tp,tc,lv,greater_or_equal) mat=mg:SelectSubGroup(tp,Auxiliary.RitualCheck,false,1,lv,tp,tc,lv,greater_or_equal)
Auxiliary.GCheckAdditional=nil Auxiliary.GCheckAdditional=nil
tc:SetMaterial(mat) tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat) Duel.ReleaseRitualMaterial(mat)
...@@ -1697,7 +1698,7 @@ function Auxiliary.RitualUltimateOperation(filter,level_function,greater_or_equa ...@@ -1697,7 +1698,7 @@ function Auxiliary.RitualUltimateOperation(filter,level_function,greater_or_equa
tc:CompleteProcedure() tc:CompleteProcedure()
end end
if extra_operation then if extra_operation then
extra_operation(e,tp,eg,ep,ev,re,r,rp,tc) extra_operation(e,tp,eg,ep,ev,re,r,rp,tc,mat)
end end
end 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