Commit b59f31ce authored by Huangnan's avatar Huangnan

fix

parent 01fd2bb0
Pipeline #24243 passed with stages
in 24 minutes and 58 seconds
-- --
local m=17055000 local s,id,o=GetID()
local cm=_G["c"..m] function s.initial_effect(c)
cm.dfc_front_side=m
cm.dfc_back_side1=17055010
cm.dfc_back_side2=17055020
function cm.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
--special summon --special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -12,56 +8,67 @@ function cm.initial_effect(c) ...@@ -12,56 +8,67 @@ function cm.initial_effect(c)
e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon) e1:SetCondition(s.spcon)
e1:SetOperation(cm.spop) e1:SetOperation(s.spop)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e2:SetRange(LOCATION_HAND) e2:SetRange(LOCATION_HAND)
e2:SetTargetRange(LOCATION_HAND,0) e2:SetTargetRange(LOCATION_HAND,0)
e2:SetTarget(cm.eftg) e2:SetTarget(s.eftg)
e2:SetLabelObject(e1) e2:SetLabelObject(e1)
c:RegisterEffect(e2) c:RegisterEffect(e2)
if not cm.global_flag then if not s.global_flag then
cm.global_flag=true s.global_flag=true
s[0]=0
s[1]=0
local ge0=Effect.CreateEffect(c) local ge0=Effect.CreateEffect(c)
ge0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) ge0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ge0:SetCode(EVENT_CHAINING) ge0:SetCode(EVENT_CHAINING)
ge0:SetCondition(cm.atcon) ge0:SetCondition(s.atcon)
ge0:SetOperation(cm.atop) ge0:SetOperation(s.atop)
Duel.RegisterEffect(ge0,0) Duel.RegisterEffect(ge0,0)
local ge1=Effect.CreateEffect(c) local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_SOLVED) ge1:SetCode(EVENT_CHAIN_SOLVED)
ge1:SetCondition(cm.regcon) ge1:SetCondition(s.regcon)
ge1:SetOperation(cm.regop) ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0) Duel.RegisterEffect(ge1,0)
end end
end end
function cm.eftg(e,c) s.dfc_front_side=id
s.dfc_back_side1=17055010
s.dfc_back_side2=17055020
function s.eftg(e,c)
return c==e:GetHandler() return c==e:GetHandler()
end end
function cm.atcon(e,tp,eg,ep,ev,re,r,rp) function s.atcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL) return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL)
end end
function cm.atop(e,tp,eg,ep,ev,re,r,rp) function s.atop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(rp,17061154,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_CHAIN,0,1) Duel.RegisterFlagEffect(rp,id,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET+RESET_CHAIN,0,1)
end end
function cm.regcon(e,tp,eg,ep,ev,re,r,rp) function s.regcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return Duel.GetFlagEffect(rp,17061154)>0 and re:IsHasType(EFFECT_TYPE_ACTIVATE) return Duel.GetFlagEffect(rp,id)>0 and re:IsHasType(EFFECT_TYPE_ACTIVATE)
end end
function cm.regop(e,tp,eg,ep,ev,re,r,rp) function s.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(rp,17055000,0,0,0) if Duel.GetFlagEffect(rp,id+1)==0 then
s[rp]=s[rp]+1
if s[rp]>=10 then
Duel.Hint(HINT_CARD,0,id)
Duel.RegisterFlagEffect(rp,id+1,0,0,0)
end
end
end end
function cm.spcon(e,c) function s.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
local b1=Duel.IsPlayerCanSpecialSummonMonster(tp,17055010,0,0x21,4000,4000,10,RACE_DRAGON,ATTRIBUTE_LIGHT) local b1=Duel.IsPlayerCanSpecialSummonMonster(tp,17055010,0,0x21,4000,4000,10,RACE_DRAGON,ATTRIBUTE_LIGHT)
local b2=Duel.IsPlayerCanSpecialSummonMonster(tp,17055020,0,0x21,4000,4000,10,RACE_DRAGON,ATTRIBUTE_DARK) local b2=Duel.IsPlayerCanSpecialSummonMonster(tp,17055020,0,0x21,4000,4000,10,RACE_DRAGON,ATTRIBUTE_DARK)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and (b1 or b2) and Duel.GetFlagEffect(tp,17055000)>=10 return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and (b1 or b2) and Duel.GetFlagEffect(tp,id+1)>0
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c) function s.spop(e,tp,eg,ep,ev,re,r,rp,c)
local b1=Duel.IsPlayerCanSpecialSummonMonster(tp,17055010,0,0x21,4000,4000,10,RACE_DRAGON,ATTRIBUTE_LIGHT) local b1=Duel.IsPlayerCanSpecialSummonMonster(tp,17055010,0,0x21,4000,4000,10,RACE_DRAGON,ATTRIBUTE_LIGHT)
local b2=Duel.IsPlayerCanSpecialSummonMonster(tp,17055020,0,0x21,4000,4000,10,RACE_DRAGON,ATTRIBUTE_DARK) local b2=Duel.IsPlayerCanSpecialSummonMonster(tp,17055020,0,0x21,4000,4000,10,RACE_DRAGON,ATTRIBUTE_DARK)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and (b1 or b2) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and (b1 or b2) end
...@@ -69,17 +76,18 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp,c) ...@@ -69,17 +76,18 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ops={} local ops={}
local opval={} local opval={}
if b1 then if b1 then
ops[off]=aux.Stringid(17055000,1) ops[off]=aux.Stringid(id,1)
opval[off-1]=1 opval[off-1]=1
off=off+1 off=off+1
end end
if b2 then if b2 then
ops[off]=aux.Stringid(17055000,2) ops[off]=aux.Stringid(id,2)
opval[off-1]=2 opval[off-1]=2
off=off+1 off=off+1
end end
local op=Duel.SelectOption(tp,table.unpack(ops)) local op=Duel.SelectOption(tp,table.unpack(ops))
Duel.Hint(HINT_CARD,0,17055010+op*10) local tcode=17055010+op*10
Duel.Hint(HINT_CARD,0,tcode)
--back --back
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
...@@ -88,25 +96,24 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp,c) ...@@ -88,25 +96,24 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetLabel(e:GetHandler():GetOriginalCode()) e1:SetLabel(e:GetHandler():GetOriginalCode())
e1:SetCondition(cm.backon) e1:SetCondition(s.backon)
e1:SetOperation(cm.backop) e1:SetOperation(s.backop)
e:GetHandler():RegisterEffect(e1) e:GetHandler():RegisterEffect(e1)
local tcode=17055010+op*10
e:GetHandler():SetEntityCode(tcode,true) e:GetHandler():SetEntityCode(tcode,true)
e:GetHandler():ReplaceEffect(tcode,0,0) e:GetHandler():ReplaceEffect(tcode,0,0)
Duel.ConfirmCards(1-tp,e:GetHandler()) Duel.ConfirmCards(1-tp,e:GetHandler())
e:GetHandler():RegisterFlagEffect(17055000,0,0,0) e:GetHandler():RegisterFlagEffect(id+1,0,0,0)
end end
function cm.backon(e,tp,eg,ep,ev,re,r,rp) function s.backon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return e:GetHandler():GetFlagEffect(17055000)>0 return e:GetHandler():GetFlagEffect(id+1)>0
end end
function cm.backop(e,tp,eg,ep,ev,re,r,rp) function s.backop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tcode=e:GetLabel() local tcode=e:GetLabel()
c:SetEntityCode(tcode) c:SetEntityCode(tcode)
Duel.ConfirmCards(tp,Group.FromCards(c)) Duel.ConfirmCards(tp,Group.FromCards(c))
Duel.ConfirmCards(1-tp,Group.FromCards(c)) Duel.ConfirmCards(1-tp,Group.FromCards(c))
c:ReplaceEffect(tcode,0,0) c:ReplaceEffect(tcode,0,0)
e:GetHandler():ResetFlagEffect(17055000) e:GetHandler():ResetFlagEffect(id+1)
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