Commit 9ae9748a authored by POLYMER's avatar POLYMER

fix

parent e252469f
......@@ -3,6 +3,12 @@ local s,id=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,17337400)
c:EnableReviveLimit()
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_CHANGE_CODE)
e0:SetValue(17337400)
c:RegisterEffect(e0)
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x3f50),2,4,s.lcheck)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
......@@ -16,13 +22,19 @@ function s.initial_effect(c)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(s.regcon)
e2:SetOperation(s.regop)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCondition(s.self_leave_con)
e2:SetOperation(s.reg_delayed_sp)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
e3:SetCondition(s.other_leave_con)
e3:SetOperation(s.reg_delayed_sp)
c:RegisterEffect(e3)
end
function s.lcheck(g,lc)
return g:IsExists(Card.IsFusionCode,1,nil,17337400)
......@@ -57,42 +69,41 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_BATTLE+REASON_EFFECT)
function s.mira_filter(c,tp)
return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE)
and (c:IsSetCard(0x3f50) or aux.IsCodeListed(c,17337400))
and c:GetReasonPlayer()==1-tp -
end
function s.self_leave_con(e,tp,eg,ep,ev,re,r,rp)
return s.mira_filter(e:GetHandler(),tp)
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,id+1)~=0 then return end
function s.other_leave_con(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.mira_filter,1,e:GetHandler(),tp)
end
function s.reg_delayed_sp(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,id+100)~=0 then return end
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetOperation(s.spop_step)
e1:SetReset(RESET_CHAIN)
e1:SetCode(EVENT_ADJUST)
e1:SetOperation(s.sp_final_action)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_ADJUST)
e2:SetOperation(s.spop_step)
e2:SetReset(RESET_PHASE+PHASE_END)
local e2=e1:Clone()
e2:SetCode(EVENT_CHAIN_SOLVED)
e2:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e2,tp)
end
function s.vfilter(c,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp)
and c:IsPreviousLocation(LOCATION_MZONE)
and (c:IsSetCard(0x3f50) or aux.IsCodeListed(c,17337400))
and (c:IsReason(REASON_BATTLE) or (c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp))
end
function s.spop_step(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,id+1)~=0 then
function s.sp_final_action(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,id+100)~=0 then
e:Reset()
return
end
local g=Duel.GetMatchingGroup(s.vfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,tp)
if #g==0 then return end
end
local c=e:GetOwner()
if c:IsLocation(LOCATION_GRAVE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if (c:IsLocation(LOCATION_GRAVE) or c:IsLocation(LOCATION_REMOVED))
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then
Duel.RegisterFlagEffect(tp,id+1,RESET_PHASE+PHASE_END,0,1)
Duel.RegisterFlagEffect(tp,id+100,RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_CARD,0,id)
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
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