Commit d194291a authored by 聖園ミカ's avatar 聖園ミカ 🐟

byd

parent f8923206
...@@ -5,19 +5,22 @@ function cm.initial_effect(c) ...@@ -5,19 +5,22 @@ function cm.initial_effect(c)
--link summon --link summon
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_ILLUSION),2,3) aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_ILLUSION),2,3)
--SPECIAL_SUMMON --destroy
local e2=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY) e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,m)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1)) e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_TOGRAVE) e3:SetCategory(CATEGORY_TOGRAVE)
...@@ -30,28 +33,30 @@ function cm.initial_effect(c) ...@@ -30,28 +33,30 @@ function cm.initial_effect(c)
e3:SetOperation(cm.tgop) e3:SetOperation(cm.tgop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function cm.cfilter(c,lg) function cm.cfilter(c,ec)
return lg:IsContains(c) if c:IsLocation(LOCATION_MZONE) then
return ec:GetLinkedGroup():IsContains(c)
else
return bit.band(ec:GetLinkedZone(c:GetPreviousControler()),bit.lshift(0x1,c:GetPreviousSequence()))~=0
end
end end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp) function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local lg=e:GetHandler():GetLinkedGroup() return eg:IsExists(cm.cfilter,1,nil,e:GetHandler())
return eg:IsExists(cm.cfilter,1,nil,lg)
end end
function cm.filter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsRace(RACE_ILLUSION) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsLevelBelow(4) and c:IsRace(RACE_ILLUSION) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst() if g:GetCount()>0 then
if tc then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end end
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
...@@ -65,7 +70,6 @@ end ...@@ -65,7 +70,6 @@ end
function cm.splimit(e,c) function cm.splimit(e,c)
return not c:IsRace(RACE_ILLUSION) return not c:IsRace(RACE_ILLUSION)
end end
function cm.costfilter(c) function cm.costfilter(c)
return c:IsRace(RACE_ILLUSION) and c:IsType(TYPE_MONSTER) and c:IsFaceupEx() and c:IsAbleToGraveAsCost() return c:IsRace(RACE_ILLUSION) and c:IsType(TYPE_MONSTER) and c:IsFaceupEx() and c:IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(nil,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) and Duel.IsExistingMatchingCard(nil,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c)
......
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