Commit a65332c5 authored by DailyShana's avatar DailyShana

update aux.EnableSpiritReturn

parent 5663ffe0
--荒魂 --荒魂
function c16889337.initial_effect(c) function c16889337.initial_effect(c)
--spirit return --spirit return
aux.EnableSpiritReturn(c) aux.EnableSpiritReturn(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP)
--cannot special summon --cannot special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
......
--リチュア・ナタリア --リチュア・ナタリア
function c17241370.initial_effect(c) function c17241370.initial_effect(c)
--spirit return --spirit return
aux.EnableSpiritReturn(c) aux.EnableSpiritReturn(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP)
--cannot special summon --cannot special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
......
--阿修羅 --阿修羅
function c2134346.initial_effect(c) function c2134346.initial_effect(c)
--spirit return --spirit return
aux.EnableSpiritReturn(c) aux.EnableSpiritReturn(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP)
--cannot special summon --cannot special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
......
--偉大天狗 --偉大天狗
function c2356994.initial_effect(c) function c2356994.initial_effect(c)
--spirit return --spirit return
aux.EnableSpiritReturn(c) aux.EnableSpiritReturn(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP)
--cannot special summon --cannot special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
......
--和魂 --和魂
function c24701235.initial_effect(c) function c24701235.initial_effect(c)
--spirit --spirit
aux.EnableSpiritReturn(c) aux.EnableSpiritReturn(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP)
--cannot special summon --cannot special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
......
--八汰烏 --八汰烏
function c3078576.initial_effect(c) function c3078576.initial_effect(c)
--spirit return --spirit return
aux.EnableSpiritReturn(c) aux.EnableSpiritReturn(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP)
--cannot special summon --cannot special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
......
--月読命 --月読命
function c34853266.initial_effect(c) function c34853266.initial_effect(c)
--spirit return --spirit return
aux.EnableSpiritReturn(c) aux.EnableSpiritReturn(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP)
--cannot special summon --cannot special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
......
--不死之炎鳥 --不死之炎鳥
function c38538445.initial_effect(c) function c38538445.initial_effect(c)
--spirit return --spirit return
aux.EnableSpiritReturn(c) aux.EnableSpiritReturn(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP)
--cannot special summon --cannot special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
......
--軍荼利 --軍荼利
function c38975369.initial_effect(c) function c38975369.initial_effect(c)
--spirit --spirit
aux.EnableSpiritReturn(c) aux.EnableSpiritReturn(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP)
--cannot special summon --cannot special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
......
--竜宮之姫 --竜宮之姫
function c39751093.initial_effect(c) function c39751093.initial_effect(c)
--spirit return --spirit return
aux.EnableSpiritReturn(c) aux.EnableSpiritReturn(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP)
--cannot special summon --cannot special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
......
--雷帝神 --雷帝神
function c40473581.initial_effect(c) function c40473581.initial_effect(c)
--spirit return --spirit return
aux.EnableSpiritReturn(c) aux.EnableSpiritReturn(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP)
--cannot special summon --cannot special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
......
--磨破羅魏 --磨破羅魏
function c40695128.initial_effect(c) function c40695128.initial_effect(c)
--spirit return --spirit return
aux.EnableSpiritReturn(c) aux.EnableSpiritReturn(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP)
--cannot special summon --cannot special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
......
--羅刹 --羅刹
function c43378076.initial_effect(c) function c43378076.initial_effect(c)
--spirit return --spirit return
aux.EnableSpiritReturn(c) aux.EnableSpiritReturn(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP)
--cannot special summon --cannot special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
......
--伊弉波 --伊弉波
function c43543777.initial_effect(c) function c43543777.initial_effect(c)
--spirit return --spirit return
aux.EnableSpiritReturn(c) aux.EnableSpiritReturn(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP)
--cannot special summon --cannot special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
......
--金華猫 --金華猫
function c45452224.initial_effect(c) function c45452224.initial_effect(c)
--spirit return --spirit return
aux.EnableSpiritReturn(c) aux.EnableSpiritReturn(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP)
--cannot special summon --cannot special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
......
--鳳凰 --鳳凰
function c50866755.initial_effect(c) function c50866755.initial_effect(c)
--spirit return --spirit return
aux.EnableSpiritReturn(c) aux.EnableSpiritReturn(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP)
--cannot special summon --cannot special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
......
--リチュア・エミリア --リチュア・エミリア
function c73551138.initial_effect(c) function c73551138.initial_effect(c)
--spirit return --spirit return
aux.EnableSpiritReturn(c) aux.EnableSpiritReturn(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP)
--cannot special summon --cannot special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
......
--火之迦具土 --火之迦具土
function c75745607.initial_effect(c) function c75745607.initial_effect(c)
--spirit return --spirit return
aux.EnableSpiritReturn(c) aux.EnableSpiritReturn(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP)
--cannot special summon --cannot special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
......
--八俣大蛇 --八俣大蛇
function c76862289.initial_effect(c) function c76862289.initial_effect(c)
--spirit return --spirit return
aux.EnableSpiritReturn(c) aux.EnableSpiritReturn(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP)
--cannot special summon --cannot special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
......
--因幡之白兎 --因幡之白兎
function c77084837.initial_effect(c) function c77084837.initial_effect(c)
--spirit return --spirit return
aux.EnableSpiritReturn(c) aux.EnableSpiritReturn(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP)
--cannot special summon --cannot special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
function c82841979.initial_effect(c) function c82841979.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
--spirit return --spirit return
aux.EnableSpiritReturn(c,true) aux.EnableSpiritReturn(c,EVENT_SPSUMMON_SUCCESS)
--cannot special summon --cannot special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
......
--砂塵の悪霊 --砂塵の悪霊
function c89111398.initial_effect(c) function c89111398.initial_effect(c)
--spirit --spirit
aux.EnableSpiritReturn(c) aux.EnableSpiritReturn(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP)
--cannot special summon --cannot special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
......
--夜叉 --夜叉
function c94215860.initial_effect(c) function c94215860.initial_effect(c)
--spirit --spirit
aux.EnableSpiritReturn(c) aux.EnableSpiritReturn(c,EVENT_SUMMON_SUCCESS,EVENT_FLIP)
--cannot special summon --cannot special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
......
...@@ -34,18 +34,6 @@ function Auxiliary.NOT(f) ...@@ -34,18 +34,6 @@ function Auxiliary.NOT(f)
return not f(a,b,c) return not f(a,b,c)
end end
end end
function Auxiliary.IsDualState(effect)
local c=effect:GetHandler()
return not c:IsDisabled() and c:IsDualState()
end
function Auxiliary.IsNotDualState(effect)
local c=effect:GetHandle()
return c:IsDisabled() or not c:IsDualState()
end
function Auxiliary.DualNormalCondition(effect)
local c=effect:GetHandler()
return c:IsFaceup() and not c:IsDualState()
end
function Auxiliary.BeginPuzzle(effect) function Auxiliary.BeginPuzzle(effect)
local e1=Effect.GlobalEffect() local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
...@@ -69,6 +57,18 @@ end ...@@ -69,6 +57,18 @@ end
function Auxiliary.PuzzleOp(e,tp) function Auxiliary.PuzzleOp(e,tp)
Duel.SetLP(0,0) Duel.SetLP(0,0)
end end
function Auxiliary.IsDualState(effect)
local c=effect:GetHandler()
return not c:IsDisabled() and c:IsDualState()
end
function Auxiliary.IsNotDualState(effect)
local c=effect:GetHandle()
return c:IsDisabled() or not c:IsDualState()
end
function Auxiliary.DualNormalCondition(effect)
local c=effect:GetHandler()
return c:IsFaceup() and not c:IsDualState()
end
function Auxiliary.EnableDualAttribute(c) function Auxiliary.EnableDualAttribute(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
...@@ -87,6 +87,60 @@ function Auxiliary.EnableDualAttribute(c) ...@@ -87,6 +87,60 @@ function Auxiliary.EnableDualAttribute(c)
e3:SetValue(TYPE_EFFECT) e3:SetValue(TYPE_EFFECT)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
--register effect of return to hand for Spirit monsters
function Auxiliary.EnableSpiritReturn(c,event1,event2,event3)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetOperation(Auxiliary.SpiritReturnReg)
e1:SetCode(event1)
c:RegisterEffect(e1)
if event2 then
local e2=e1:Clone()
e2:SetCode(event2)
c:RegisterEffect(e2)
end
if event3 then
local e3=e1:Clone()
e3:SetCode(event3)
c:RegisterEffect(e3)
end
end
function Auxiliary.SpiritReturnReg(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetDescription(1104)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetReset(RESET_EVENT+0x1ee0000+RESET_PHASE+PHASE_END)
e1:SetCondition(Auxiliary.SpiritReturnCondition)
e1:SetTarget(Auxiliary.SpiritReturnTarget)
e1:SetOperation(Auxiliary.SpiritReturnOperation)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
c:RegisterEffect(e2)
end
function Auxiliary.SpiritReturnCondition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsHasEffect(EFFECT_SPIRIT_DONOT_RETURN) then return false end
if e:IsHasType(EFFECT_TYPE_TRIGGER_F) then
return not c:IsHasEffect(EFFECT_SPIRIT_MAYNOT_RETURN)
else return c:IsHasEffect(EFFECT_SPIRIT_MAYNOT_RETURN) end
end
function Auxiliary.SpiritReturnTarget(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function Auxiliary.SpiritReturnOperation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
function Auxiliary.TargetEqualFunction(f,value,a,b,c) function Auxiliary.TargetEqualFunction(f,value,a,b,c)
return function(effect,target) return function(effect,target)
return f(target,a,b,c)==value return f(target,a,b,c)==value
...@@ -1647,55 +1701,3 @@ end ...@@ -1647,55 +1701,3 @@ end
function Auxiliary.nvfilter(c) function Auxiliary.nvfilter(c)
return not c:IsHasEffect(EFFECT_NECRO_VALLEY) return not c:IsHasEffect(EFFECT_NECRO_VALLEY)
end end
--register effect of return to hand for Spirit monsters
function Auxiliary.EnableSpiritReturn(c,sponly)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetOperation(Auxiliary.sprtreg)
if not sponly then
e1:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP)
c:RegisterEffect(e2)
else
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e1)
end
end
function Auxiliary.sprtreg(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetDescription(1104)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetReset(RESET_EVENT+0x1ee0000+RESET_PHASE+PHASE_END)
e1:SetCondition(Auxiliary.sprtcon)
e1:SetTarget(Auxiliary.sprttg)
e1:SetOperation(Auxiliary.sprtop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
c:RegisterEffect(e2)
end
function Auxiliary.sprtcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsHasEffect(EFFECT_SPIRIT_DONOT_RETURN) then return false end
if e:IsHasType(EFFECT_TYPE_TRIGGER_F) then
return not c:IsHasEffect(EFFECT_SPIRIT_MAYNOT_RETURN)
else return c:IsHasEffect(EFFECT_SPIRIT_MAYNOT_RETURN) end
end
function Auxiliary.sprttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function Auxiliary.sprtop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.SendtoHand(c,nil,REASON_EFFECT)
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