Commit b902a59b authored by REIKAI's avatar REIKAI 💬

Update c86590310.lua

parent fc0e21b2
--未名天使的降临之仪 --未名天使的降临之仪
local m=86590310 local m=86590310
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.target) e1:SetTarget(cm.target)
e1:SetOperation(cm.activate) e1:SetOperation(cm.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function cm.fselect(g,lv,rc) function cm.fselect(g,lv,rc)
return g:IsExists(Card.IsCode,1,nil,86590300) and g:CheckWithSumGreater(Card.GetRitualLevel,lv,rc) return g:IsExists(Card.IsCode,1,nil,86590300) and g:CheckWithSumGreater(Card.GetRitualLevel,lv,rc)
end end
function cm.filter(c,e,tp,g) function cm.filter(c,e,tp,g)
return c:IsSetCard(0x965f) and (c:IsLocation(LOCATION_HAND) or g:CheckSubGroup(cm.fselect,1,#g,c:GetLevel(),c)) return c:IsSetCard(0x965f) and (c:IsLocation(LOCATION_HAND) or g:CheckSubGroup(cm.fselect,1,#g,c:GetLevel(),c))
end end
function cm.RitualUltimateFilter(c,filter,e,tp,m1,m2,level_function,greater_or_equal,chk) function cm.RitualUltimateFilter(c,filter,e,tp,m1,m2,level_function,greater_or_equal,chk)
if bit.band(c:GetType(),0x81)~=0x81 or (filter and not filter(c,e,tp,m1)) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end if bit.band(c:GetType(),0x81)~=0x81 or (filter and not filter(c,e,tp,m1)) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m1:Filter(Card.IsCanBeRitualMaterial,c,c) local mg=m1:Filter(Card.IsCanBeRitualMaterial,c,c)
if m2 then if m2 then
mg:Merge(m2) mg:Merge(m2)
end end
if c.mat_filter then if c.mat_filter then
mg=mg:Filter(c.mat_filter,c,tp) mg=mg:Filter(c.mat_filter,c,tp)
else else
mg:RemoveCard(c) mg:RemoveCard(c)
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.rtc(g,c,lv) function cm.ritualcheckgroup(g,tp,c,lv,str)
Duel.SetSelectedCard(g) if c:IsLocation(LOCATION_MZONE) and not g:IsExists(Card.IsCode,1,nil,86590300) then
return g:CheckWithSumGreater(Card.GetRitualLevel,lv,c) and g:IsExists(Card.IsCode,1,nil,86590300) return false
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) return Auxiliary.RitualCheck(g,tp,c,lv,str)
if chk==0 then end
local mg=Duel.GetRitualMaterial(tp) function cm.rtc(g,c,lv)
return Duel.IsExistingMatchingCard(cm.RitualUltimateFilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,cm.filter,e,tp,mg,mg2,Card.GetLevel,"Greater") Duel.SetSelectedCard(g)
end if c:IsLocation(LOCATION_MZONE) and not g:IsExists(Card.IsCode,1,nil,86590300) then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK) return false
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) return g:CheckWithSumGreater(Card.GetRitualLevel,lv,c)
local c=e:GetHandler() end
local mg=Duel.GetRitualMaterial(tp) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local mtg=Group.CreateGroup() if chk==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local mg=Duel.GetRitualMaterial(tp)
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") return Duel.IsExistingMatchingCard(cm.RitualUltimateFilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,cm.filter,e,tp,mg,mg2,Card.GetLevel,"Greater")
local tc=tg:GetFirst() end
if tc then Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
if tc:IsLocation(LOCATION_DECK) then end
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if tc.mat_filter then local c=e:GetHandler()
mg=mg:Filter(tc.mat_filter,tc,tp) local mg=Duel.GetRitualMaterial(tp)
else local mtg=Group.CreateGroup()
mg:RemoveCard(tc) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
end 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")
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) local tc=tg:GetFirst()
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater") if tc then
local mat=mg:SelectSubGroup(tp,cm.rtc,false,1,tc:GetLevel(),tc,tc:GetLevel()) mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
aux.GCheckAdditional=nil if tc.mat_filter then
if not mat or mat:GetCount()==0 then return end mg=mg:Filter(tc.mat_filter,tc,tp)
tc:SetMaterial(mat) else
Duel.ReleaseRitualMaterial(mat) mg:RemoveCard(tc)
mtg:Merge(mat) end
Duel.BreakEffect() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP) aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater")
tc:CompleteProcedure() local mat=mg:SelectSubGroup(tp,cm.rtc,false,1,tc:GetLevel(),tc,tc:GetLevel())
else aux.GCheckAdditional=nil
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc) if not mat or mat:GetCount()==0 then return end
if tc.mat_filter then tc:SetMaterial(mat)
mg=mg:Filter(tc.mat_filter,tc,tp) Duel.ReleaseRitualMaterial(mat)
else mtg:Merge(mat)
mg:RemoveCard(tc) Duel.BreakEffect()
end Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) tc:CompleteProcedure()
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater") end
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater") if tc:IsFaceup() and #mtg>0 then
aux.GCheckAdditional=nil Duel.BreakEffect()
if not mat or mat:GetCount()==0 then return end local rtg=mtg:FilterCount(Card.IsCode,nil,86590300)
tc:SetMaterial(mat) if rtg>=1 then
Duel.ReleaseRitualMaterial(mat) local e1=Effect.CreateEffect(e:GetHandler())
mtg:Merge(mat) e1:SetType(EFFECT_TYPE_SINGLE)
Duel.BreakEffect() e1:SetCode(EFFECT_UPDATE_ATTACK)
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
tc:CompleteProcedure() e1:SetValue(500)
end e1:SetReset(RESET_EVENT+RESETS_STANDARD)
end tc:RegisterEffect(e1)
if tc:IsFaceup() and #mtg>0 then local e2=e1:Clone()
Duel.BreakEffect() e2:SetCode(EFFECT_UPDATE_DEFENSE)
local rtg=mtg:FilterCount(Card.IsCode,nil,86590300) tc:RegisterEffect(e2)
if rtg>=1 then end
local e1=Effect.CreateEffect(e:GetHandler()) if rtg>=2 then
e1:SetType(EFFECT_TYPE_SINGLE) local e4=Effect.CreateEffect(c)
e1:SetCode(EFFECT_UPDATE_ATTACK) e4:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(500) e4:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
tc:RegisterEffect(e1) e4:SetValue(1)
local e2=e1:Clone() e4:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetCode(EFFECT_UPDATE_DEFENSE) tc:RegisterEffect(e4)
tc:RegisterEffect(e2) tc:RegisterFlagEffect(m+105,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,0))
end end
if rtg>=2 then if rtg>=3 then
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE) e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE) e4:SetCode(EFFECT_CANNOT_INACTIVATE)
e4:SetRange(LOCATION_MZONE) e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e4:SetRange(LOCATION_MZONE)
e4:SetValue(1) e4:SetValue(cm.effectfilter)
e4:SetReset(RESET_EVENT+RESETS_STANDARD) e4:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e4) tc:RegisterEffect(e4)
tc:RegisterFlagEffect(m+105,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,0)) local e5=Effect.CreateEffect(c)
end e5:SetType(EFFECT_TYPE_FIELD)
if rtg>=3 then e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
local e4=Effect.CreateEffect(c) e5:SetCode(EFFECT_CANNOT_DISEFFECT)
e4:SetType(EFFECT_TYPE_FIELD) e5:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_CANNOT_INACTIVATE) e5:SetValue(cm.effectfilter)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e5:SetReset(RESET_EVENT+RESETS_STANDARD)
e4:SetRange(LOCATION_MZONE) tc:RegisterEffect(e5)
e4:SetValue(cm.effectfilter) tc:RegisterFlagEffect(m+105,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,1))
e4:SetReset(RESET_EVENT+RESETS_STANDARD) end
tc:RegisterEffect(e4) end
local e5=Effect.CreateEffect(c) end
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) function cm.effectfilter(e,ct)
e5:SetCode(EFFECT_CANNOT_DISEFFECT) local te=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT)
e5:SetRange(LOCATION_MZONE) return te:GetHandler()==e:GetHandler()
e5:SetValue(cm.effectfilter)
e5:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e5)
tc:RegisterFlagEffect(m+105,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,1))
end
end
end
function cm.effectfilter(e,ct)
local te=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT)
return te:GetHandler()==e:GetHandler()
end end
\ No newline at end of file
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