Commit 5d67717f authored by POLYMER's avatar POLYMER

fix

parent e1c5fc57
if not require and dofile then function require(str) return dofile(str..".lua") end end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
local m=53796144 local m=53796144
local cm=_G["c"..m] local cm=_G["c"..m]
cm.name="电子光虫-继电蜻蜓" cm.name="电子光虫-继电蜻蜓"
...@@ -25,14 +27,6 @@ function cm.initial_effect(c) ...@@ -25,14 +27,6 @@ function cm.initial_effect(c)
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter) Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
if not cm.global_check then if not cm.global_check then
cm.global_check=true cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SUMMON_SUCCESS)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(ge2,0)
local ge3=Effect.CreateEffect(c) local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_ADJUST) ge3:SetCode(EVENT_ADJUST)
...@@ -48,10 +42,6 @@ function cm.initial_effect(c) ...@@ -48,10 +42,6 @@ function cm.initial_effect(c)
Duel.RegisterEffect(ge5,0) Duel.RegisterEffect(ge5,0)
local ge6=ge5:Clone() local ge6=ge5:Clone()
Duel.RegisterEffect(ge6,1) Duel.RegisterEffect(ge6,1)
Relaytonbo_IsStatus=Card.IsStatus
Card.IsStatus=function(tc,int)
if int&(STATUS_SUMMON_TURN|STATUS_SPSUMMON_TURN|STATUS_FORM_CHANGED)~=0 and tc:GetFlagEffect(m)>0 then return true else return Relaytonbo_IsStatus(tc,int) end
end
Relaytonbo_ChangePosition=Duel.ChangePosition Relaytonbo_ChangePosition=Duel.ChangePosition
Duel.ChangePosition=function(...) Duel.ChangePosition=function(...)
Pos_Changed_by_Effect=true Pos_Changed_by_Effect=true
...@@ -68,32 +58,21 @@ function cm.xyzlimit(e,c) ...@@ -68,32 +58,21 @@ function cm.xyzlimit(e,c)
if not c then return false end if not c then return false end
return not c:IsRace(RACE_INSECT) return not c:IsRace(RACE_INSECT)
end end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(function(c)return c:IsRace(RACE_INSECT) and c:IsAttribute(ATTRIBUTE_LIGHT)end,nil)
for tc in aux.Next(g) do tc:RegisterFlagEffect(m,RESET_EVENT+0xec0000+RESET_PHASE+PHASE_END,0,1,e:GetCode()) end
end
function cm.cfilter(c) function cm.cfilter(c)
return c:IsHasEffect(m) and c:IsAbleToGraveAsCost() return c:IsHasEffect(m) and c:IsAbleToGraveAsCost()
end end
function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.cfilter,tp,0x3,0,nil) local g=Duel.GetMatchingGroup(cm.cfilter,tp,0x3,0,nil)
local fg=Duel.GetMatchingGroup(function(c)return c:GetFlagEffect(m)>0 end,tp,0x4,0,nil) local fg=Duel.GetMatchingGroup(Card.IsStatus,tp,0x4,0,nil,0x40000800)
if #g>0 then if #g>0 then
for tc in aux.Next(fg:Filter(function(c)return c:IsFaceup() and c:IsRace(RACE_INSECT) and c:IsAttribute(ATTRIBUTE_LIGHT)end,nil)) do fg:Filter(function(c)return c:IsFaceup() and c:IsRace(RACE_INSECT) and c:IsAttribute(ATTRIBUTE_LIGHT)end,nil):ForEach(Card.SetStatus,0x0100,false)
if tc:GetFlagEffectLabel(m)==1100 then tc:SetStatus(STATUS_SUMMON_TURN,false) else tc:SetStatus(STATUS_SPSUMMON_TURN,false) end
if tc:IsStatus(STATUS_FORM_CHANGED) then tc:SetStatus(STATUS_FORM_CHANGED,false) end
end
else else
for tc in aux.Next(fg) do fg:ForEach(Card.SetStatus,0x0100,true)
if tc:GetFlagEffectLabel(m)==1100 then tc:SetStatus(STATUS_SUMMON_TURN,true) else tc:SetStatus(STATUS_SPSUMMON_TURN,true) end
if tc:IsStatus(STATUS_FORM_CHANGED) then tc:SetStatus(STATUS_FORM_CHANGED,true) end
end
end end
end end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp) function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst() local tc=eg:GetFirst()
if #eg~=1 or not tc:IsControler(tp) or tc:GetFlagEffect(m)==0 or not Duel.IsExistingMatchingCard(cm.cfilter,tp,0x3,0,1,nil) then return end if #eg~=1 or not tc:IsControler(tp) or not tc:IsStatus(0x40000800) or not Duel.IsExistingMatchingCard(cm.cfilter,tp,0x3,0,1,nil) then return end
--tc:SetStatus(STATUS_FORM_CHANGED,false)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sc=Duel.SelectMatchingCard(tp,cm.cfilter,tp,0x3,0,1,1,nil):GetFirst() local sc=Duel.SelectMatchingCard(tp,cm.cfilter,tp,0x3,0,1,1,nil):GetFirst()
if Duel.SendtoGrave(sc,REASON_COST)==0 or not sc:IsLocation(LOCATION_GRAVE) then return end if Duel.SendtoGrave(sc,REASON_COST)==0 or not sc:IsLocation(LOCATION_GRAVE) then return end
......
if not require and dofile then function require(str) return dofile(str..".lua") end end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
local m=53796146 local m=53796146
local cm=_G["c"..m] local cm=_G["c"..m]
cm.name="永恒的守护神" cm.name="永恒的守护神"
...@@ -17,17 +19,6 @@ function cm.initial_effect(c) ...@@ -17,17 +19,6 @@ function cm.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
if not cm.global_check then if not cm.global_check then
cm.global_check=true cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SUMMON_SUCCESS)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
local ge1_1=ge1:Clone()
ge1_1:SetCode(EVENT_MSET)
Duel.RegisterEffect(ge1_1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(ge2,0)
local ge5=Effect.CreateEffect(c) local ge5=Effect.CreateEffect(c)
ge5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge5:SetCode(EVENT_CHANGE_POS) ge5:SetCode(EVENT_CHANGE_POS)
...@@ -36,10 +27,6 @@ function cm.initial_effect(c) ...@@ -36,10 +27,6 @@ function cm.initial_effect(c)
Duel.RegisterEffect(ge5,0) Duel.RegisterEffect(ge5,0)
local ge6=ge5:Clone() local ge6=ge5:Clone()
Duel.RegisterEffect(ge6,1) Duel.RegisterEffect(ge6,1)
Exxod_IsStatus=Card.IsStatus
Card.IsStatus=function(tc,int)
if int&(STATUS_SUMMON_TURN|STATUS_SPSUMMON_TURN)~=0 and tc:GetFlagEffect(m)>0 then return true else return Exxod_IsStatus(tc,int) end
end
Exxod_ChangePosition=Duel.ChangePosition Exxod_ChangePosition=Duel.ChangePosition
Duel.ChangePosition=function(...) Duel.ChangePosition=function(...)
Pos_Changed_by_Effect=true Pos_Changed_by_Effect=true
...@@ -49,12 +36,9 @@ function cm.initial_effect(c) ...@@ -49,12 +36,9 @@ function cm.initial_effect(c)
end end
end end
end end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(eg) do tc:RegisterFlagEffect(m,RESET_EVENT+0xec0000+RESET_PHASE+PHASE_END,0,1,e:GetCode()) end
end
function cm.reset(e,tp,eg,ep,ev,re,r,rp) function cm.reset(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst() local tc=eg:GetFirst()
if #eg~=1 or not tc:IsControler(tp) or tc:GetFlagEffect(m)==0 then return end if #eg~=1 or not tc:IsControler(tp) or not tc:IsStatus(0x40000800) then return end
Duel.ResetFlagEffect(tp,m+500) Duel.ResetFlagEffect(tp,m+500)
end end
function cm.thfilter(c) function cm.thfilter(c)
...@@ -116,19 +100,13 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp) ...@@ -116,19 +100,13 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function cm.adjustop(e,tp,eg,ep,ev,re,r,rp) function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local fg=Duel.GetMatchingGroup(function(c)return c:GetFlagEffect(m)>0 end,tp,0x4,0,nil) local fg=Duel.GetMatchingGroup(Card.IsStatus,tp,0x4,0,nil,0x40000800)
if Duel.GetFlagEffect(tp,m+500)>0 then if Duel.GetFlagEffect(tp,m+500)>0 then
for tc in aux.Next(fg) do for tc in aux.Next(fg) do
if tc:IsFacedown() then if tc:IsFacedown() then tc:SetStatus(0x0100,false) else tc:SetStatus(0x0100,true) end
if tc:GetFlagEffectLabel(m)==1100 or tc:GetFlagEffectLabel(m)==1106 then tc:SetStatus(STATUS_SUMMON_TURN,false) else tc:SetStatus(STATUS_SPSUMMON_TURN,false) end
else
if tc:GetFlagEffectLabel(m)==1100 or tc:GetFlagEffectLabel(m)==1106 then tc:SetStatus(STATUS_SUMMON_TURN,true) else tc:SetStatus(STATUS_SPSUMMON_TURN,true) end
end
end end
else else
for tc in aux.Next(fg) do for tc in aux.Next(fg) do fg:ForEach(Card.SetStatus,0x0100,true) end
if tc:GetFlagEffectLabel(m)==1100 or tc:GetFlagEffectLabel(m)==1106 then tc:SetStatus(STATUS_SUMMON_TURN,true) else tc:SetStatus(STATUS_SPSUMMON_TURN,true) end
end
e:Reset() e:Reset()
end end
end end
...@@ -24,13 +24,6 @@ function s.initial_effect(c) ...@@ -24,13 +24,6 @@ function s.initial_effect(c)
local e3=e2:Clone() local e3=e2:Clone()
e3:SetCode(EVENT_FLIP) e3:SetCode(EVENT_FLIP)
c:RegisterEffect(e3) c:RegisterEffect(e3)
if not s.global_check then
s.global_check=true
Denji_IsStatus=Card.IsStatus
Card.IsStatus=function(tc,int)
if int&(STATUS_SUMMON_TURN|STATUS_SPSUMMON_TURN)~=0 and tc:GetFlagEffect(id)>0 then return true else return Denji_IsStatus(tc,int) end
end
end
end end
function s.spcon(e,tp,eg,ep,ev,re,r,rp) function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_DRAW) return not e:GetHandler():IsReason(REASON_DRAW)
...@@ -55,7 +48,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -55,7 +48,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
if sg and #sg>0 and Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)~=0 then if sg and #sg>0 and Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)~=0 then
Duel.ConfirmCards(1-tp,sg) Duel.ConfirmCards(1-tp,sg)
sg:ForEach(Card.RegisterFlagEffect,id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1) sg:ForEach(Card.RegisterFlagEffect,id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
sg:ForEach(Card.SetStatus,STATUS_SPSUMMON_TURN,false) sg:ForEach(Card.SetStatus,0x0100,false)
sg:KeepAlive() sg:KeepAlive()
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
......
...@@ -26,6 +26,14 @@ function s.initial_effect(c) ...@@ -26,6 +26,14 @@ function s.initial_effect(c)
e4:SetCode(EVENT_SPSUMMON_SUCCESS) e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetCondition(s.descon) e4:SetCondition(s.descon)
c:RegisterEffect(e4) c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_ADJUST)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e5:SetRange(LOCATION_MZONE)
e5:SetOperation(s.adjustop1)
c:RegisterEffect(e5)
local e6=e5:Clone()
if not s.global_check then if not s.global_check then
s.global_check=true s.global_check=true
local ge1=Effect.CreateEffect(c) local ge1=Effect.CreateEffect(c)
...@@ -36,20 +44,11 @@ function s.initial_effect(c) ...@@ -36,20 +44,11 @@ function s.initial_effect(c)
local ge2=ge1:Clone() local ge2=ge1:Clone()
ge2:SetCode(EVENT_SPSUMMON_SUCCESS) ge2:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(ge2,0) Duel.RegisterEffect(ge2,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_ADJUST)
ge3:SetOperation(s.adjustop)
Duel.RegisterEffect(ge3,0)
local ge4=Effect.CreateEffect(c) local ge4=Effect.CreateEffect(c)
ge4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge4:SetCode(EVENT_FLIP_SUMMON_SUCCESS) ge4:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
ge4:SetOperation(s.check) ge4:SetOperation(s.check)
Duel.RegisterEffect(ge4,0) Duel.RegisterEffect(ge4,0)
local f1=Card.IsStatus
Card.IsStatus=function(tc,int)
if int&(STATUS_SUMMON_TURN|STATUS_SPSUMMON_TURN)~=0 and tc:GetFlagEffect(id)>0 then return true else return f1(tc,int) end
end
end end
end end
s.material_type=TYPE_SYNCHRO s.material_type=TYPE_SYNCHRO
...@@ -57,17 +56,17 @@ function s.sfilter(c) ...@@ -57,17 +56,17 @@ function s.sfilter(c)
return c:IsRace(RACE_FAIRY) and c:IsSynchroType(TYPE_SYNCHRO) return c:IsRace(RACE_FAIRY) and c:IsSynchroType(TYPE_SYNCHRO)
end end
function s.checkop(e,tp,eg,ep,ev,re,r,rp) function s.checkop(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(eg:Filter(Card.IsFacedown,nil)) do tc:RegisterFlagEffect(id,RESET_EVENT+0x1ec0000+RESET_PHASE+PHASE_END,0,1,e:GetCode()) end for tc in aux.Next(eg:Filter(Card.IsFacedown,nil)) do tc:RegisterFlagEffect(id,RESET_EVENT+0x1fc0000+RESET_PHASE+PHASE_END,0,1,e:GetCode()) end
end end
function s.adjustop(e,tp,eg,ep,ev,re,r,rp) function s.checkfil(c)
return c:GetFlagEffect(id)>0 and c:IsFacedown()
end
function s.adjustop1(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetFieldGroup(0,LOCATION_MZONE,LOCATION_MZONE) local g1=Duel.GetFieldGroup(0,LOCATION_MZONE,LOCATION_MZONE)
local g2=g1:Filter(function(c)return c:GetFlagEffect(id)>0 end,nil) local g2=g1:Filter(s.checkfil,nil)
g1:Sub(g2) if e:GetHandler():IsDisabled() then g1:ForEach(Card.SetStatus,0x0100,true) else
for tc in aux.Next(g2) do g2:ForEach(Card.SetStatus,0x0100,false)
if tc:GetFlagEffectLabel(id)==1106 then tc:SetStatus(STATUS_SUMMON_TURN,false) else tc:SetStatus(STATUS_SPSUMMON_TURN,false) end Group.__sub(g1,g2):ForEach(Card.SetStatus,0x0100,true)
end
for tc in aux.Next(g1) do
if tc:GetFlagEffectLabel(id)==1106 then tc:SetStatus(STATUS_SUMMON_TURN,true) else tc:SetStatus(STATUS_SPSUMMON_TURN,true) end
end end
end end
function s.check(e,tp,eg,ep,ev,re,r,rp) function s.check(e,tp,eg,ep,ev,re,r,rp)
......
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