Commit 1f45d40a authored by mercury233's avatar mercury233

fix & update aux.SpiritReturnCondition

parent 114acd4a
......@@ -74,12 +74,13 @@ function c25415052.retreg(e,tp,eg,ep,ev,re,r,rp)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetReset(RESET_EVENT+0x1ee0000+RESET_PHASE+PHASE_END)
e1:SetCondition(aux.SpiritReturnCondition)
e1:SetCondition(aux.SpiritReturnConditionForced)
e1:SetTarget(c25415052.rettg)
e1:SetOperation(c25415052.retop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCondition(aux.SpiritReturnConditionOptional)
c:RegisterEffect(e2)
end
function c25415052.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -54,7 +54,11 @@ function c44877690.cfilter(c)
end
function c44877690.retcon(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(c44877690.cfilter,tp,LOCATION_MZONE,0,1,e:GetHandler()) then return false end
return aux.SpiritReturnCondition(e,tp,eg,ep,ev,re,r,rp)
if e:IsHasType(EFFECT_TYPE_TRIGGER_F) then
return aux.SpiritReturnConditionForced(e,tp,eg,ep,ev,re,r,rp)
else
return aux.SpiritReturnConditionOptional(e,tp,eg,ep,ev,re,r,rp)
end
end
function c44877690.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(44877690)==0 end
......
......@@ -65,12 +65,13 @@ function c52900000.retreg(e,tp,eg,ep,ev,re,r,rp)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetReset(RESET_EVENT+0x1ee0000+RESET_PHASE+PHASE_END)
e1:SetCondition(aux.SpiritReturnCondition)
e1:SetCondition(aux.SpiritReturnConditionForced)
e1:SetTarget(c52900000.rettg)
e1:SetOperation(c52900000.retop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCondition(aux.SpiritReturnConditionOptional)
c:RegisterEffect(e2)
end
function c52900000.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -162,29 +162,29 @@ function Auxiliary.SpiritReturnReg(e,tp,eg,ep,ev,re,r,rp)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetReset(RESET_EVENT+0xd6e0000+RESET_PHASE+PHASE_END)
e1:SetCondition(Auxiliary.SpiritReturnCondition1)
e1:SetTarget(Auxiliary.SpiritReturnTarget1)
e1:SetCondition(Auxiliary.SpiritReturnConditionForced)
e1:SetTarget(Auxiliary.SpiritReturnTargetForced)
e1:SetOperation(Auxiliary.SpiritReturnOperation)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCondition(Auxiliary.SpiritReturnCondition2)
e2:SetTarget(Auxiliary.SpiritReturnTarget2)
e2:SetCondition(Auxiliary.SpiritReturnConditionOptional)
e2:SetTarget(Auxiliary.SpiritReturnTargetOptional)
c:RegisterEffect(e2)
end
function Auxiliary.SpiritReturnCondition1(e,tp,eg,ep,ev,re,r,rp)
function Auxiliary.SpiritReturnConditionForced(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return not c:IsHasEffect(EFFECT_SPIRIT_DONOT_RETURN) and not c:IsHasEffect(EFFECT_SPIRIT_MAYNOT_RETURN)
end
function Auxiliary.SpiritReturnTarget1(e,tp,eg,ep,ev,re,r,rp,chk)
function Auxiliary.SpiritReturnTargetForced(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.SpiritReturnCondition2(e,tp,eg,ep,ev,re,r,rp)
function Auxiliary.SpiritReturnConditionOptional(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return not c:IsHasEffect(EFFECT_SPIRIT_DONOT_RETURN) and c:IsHasEffect(EFFECT_SPIRIT_MAYNOT_RETURN)
end
function Auxiliary.SpiritReturnTarget2(e,tp,eg,ep,ev,re,r,rp,chk)
function Auxiliary.SpiritReturnTargetOptional(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
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