Commit 400cd2f2 authored by Tachibana's avatar Tachibana

hole

parent 7050186f
...@@ -5,8 +5,8 @@ function c81040041.initial_effect(c) ...@@ -5,8 +5,8 @@ function c81040041.initial_effect(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:SetTarget(c81040041.target) e1:SetTarget(cm.target)
e1:SetOperation(c81040041.activate) e1:SetOperation(cm.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--set --set
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -19,35 +19,41 @@ function c81040041.initial_effect(c) ...@@ -19,35 +19,41 @@ function c81040041.initial_effect(c)
e2:SetOperation(c81040041.setop) e2:SetOperation(c81040041.setop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c81040041.filter(c,e,tp) function cm.filter(c,e,tp)
return c:IsSetCard(0x81c) return c:IsSetCard(0x81c)
end end
function c81040041.cfilter(c) function cm.cfilter(c)
return c:IsFacedown() or not (c:IsFaceup() and c:IsType(TYPE_RITUAL) and c:IsType(TYPE_MONSTER)) return c:IsFaceup() and c:IsType(TYPE_RITUAL)
end end
function c81040041.mfilter(c) function cm.mfilter(c)
return c:IsSetCard(0x81c) return c:IsSetCard(0x81c)
end end
function c81040041.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
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
local mg2=nil local mg2=nil
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)>0 and not Duel.IsExistingMatchingCard(c81040041.cfilter,tp,LOCATION_MZONE,0,1,nil) then local ug=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
e:SetLabel(1) if ug:GetCount()>0 and ug:FilterCount(cm.cfilter,nil)==sg:GetCount() then
mg2=Duel.GetMatchingGroup(aux.RitualExtraFilter,tp,LOCATION_GRAVE,0,nil,c81040041.mfilter) mg2=Duel.GetMatchingGroup(aux.RitualExtraFilter,tp,LOCATION_GRAVE,0,nil,cm.mfilter)
end end
return Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,nil,c81040041.filter,e,tp,mg,mg2,Card.GetLevel,"Greater") return Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,nil,cm.filter,e,tp,mg,mg2,Card.GetLevel,"Greater")
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
if ug:GetCount()>0 and ug:FilterCount(cm.cfilter,nil)==sg:GetCount() then
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,0,tp,LOCATION_GRAVE)
e:SetLabel(1)
else
e:SetLabel(0)
end
end end
function c81040041.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp) local mg=Duel.GetRitualMaterial(tp)
local mg2=nil local mg2=nil
if e:GetLabel()==1 then if e:GetLabel()==1 then
mg2=Duel.GetMatchingGroup(aux.RitualExtraFilter,tp,LOCATION_GRAVE,0,nil,c81040041.mfilter) mg2=Duel.GetMatchingGroup(aux.RitualExtraFilter,tp,LOCATION_GRAVE,0,nil,cm.mfilter)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,1,nil,c81040041.filter,e,tp,mg,mg2,Card.GetLevel,"Greater") local tg=Duel.SelectMatchingCard(tp,aux.RitualUltimateFilter,tp,LOCATION_HAND,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
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc) mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
......
...@@ -62,7 +62,7 @@ function cm.thcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -62,7 +62,7 @@ function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_GRAVE) return e:GetHandler():IsPreviousLocation(LOCATION_GRAVE)
end end
function cm.thfilter(c) function cm.thfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand() and not c:IsType(TYPE_RITUAL) return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand() and not c:IsType(TYPE_RITUAL) and c:IsSetCard(0x81c)
end end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) 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