Commit ea33d6f9 authored by Tachibana's avatar Tachibana

ybb

parent dd11c715
...@@ -11,11 +11,10 @@ function cm.initial_effect(c) ...@@ -11,11 +11,10 @@ function cm.initial_effect(c)
c:RegisterEffect(e0) c:RegisterEffect(e0)
--change effect --change effect
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EVENT_CHAIN_SOLVING) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(15000810)
e1:SetRange(LOCATION_FZONE) e1:SetRange(LOCATION_FZONE)
e1:SetCondition(cm.chcon)
e1:SetOperation(cm.chop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--Add Counter --Add Counter
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
...@@ -45,6 +44,15 @@ function cm.initial_effect(c) ...@@ -45,6 +44,15 @@ function cm.initial_effect(c)
e6:SetTarget(cm.sptg) e6:SetTarget(cm.sptg)
e6:SetOperation(cm.spop) e6:SetOperation(cm.spop)
c:RegisterEffect(e6) c:RegisterEffect(e6)
if not cm.global_effect then
cm.global_effect=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_SOLVING)
ge1:SetCondition(cm.chcon)
ge1:SetOperation(cm.chop)
Duel.RegisterEffect(ge1,0)
end
end end
function cm.counterfilter(c) function cm.counterfilter(c)
return c:IsLocation(LOCATION_ONFIELD) and c:IsPreviousLocation(LOCATION_ONFIELD) return c:IsLocation(LOCATION_ONFIELD) and c:IsPreviousLocation(LOCATION_ONFIELD)
...@@ -81,32 +89,30 @@ function cm.chcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -81,32 +89,30 @@ function cm.chcon(e,tp,eg,ep,ev,re,r,rp)
return rc:IsType(TYPE_PENDULUM) and rc:IsAttribute(ATTRIBUTE_WIND) and re:GetOperation() and re:IsActivated() return rc:IsType(TYPE_PENDULUM) and rc:IsAttribute(ATTRIBUTE_WIND) and re:GetOperation() and re:IsActivated()
end end
function cm.chop(e,tp,eg,ep,ev,re,r,rp) function cm.chop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetOwner()
local op=re:GetOperation() local op=re:GetOperation()
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(15000810) e1:SetCode(15000810)
e1:SetRange(LOCATION_FZONE) e1:SetTargetRange(1,0)
e1:SetOperation(op) e1:SetOperation(op)
e1:SetLabelObject(re) e1:SetLabelObject(re)
e1:SetReset(RESET_CHAIN+RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
c:RegisterEffect(e1) Duel.RegisterEffect(e1,0)
Duel.ChangeChainOperation(ev,cm.repop) Duel.ChangeChainOperation(ev,cm.repop)
end end
function cm.selfilter(c) function cm.selfilter(c)
return c:IsCode(15000810) and c:GetEffectCount(15000810)~=0 return c:GetEffectCount(15000810)~=0 and not c:IsDisabled()
end end
function cm.repop(e,tp,eg,ep,ev,re,r,rp) function cm.repop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.selfilter,tp,LOCATION_FZONE,LOCATION_FZONE,nil) local se=Duel.IsPlayerAffectedByEffect(0,15000810)
if not se then se=Duel.IsPlayerAffectedByEffect(1,15000810) end
local op=nil local op=nil
local tc=g:GetFirst() if se then
while tc do
local ae=tc:IsHasEffect(15000810)
local x=1 local x=1
if tc:IsHasEffect(15000810) then for _,i in ipairs{Duel.IsPlayerAffectedByEffect(0,15000810)} do
for _,i in ipairs{tc:IsHasEffect(15000810)} do
if i:GetLabelObject()==e and x~=0 then if i:GetLabelObject()==e and x~=0 then
op=i:GetOperation() op=i:GetOperation()
i:Reset() i:Reset()
...@@ -114,9 +120,9 @@ function cm.repop(e,tp,eg,ep,ev,re,r,rp) ...@@ -114,9 +120,9 @@ function cm.repop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
tc=g:GetNext()
end
if op then op(e,tp,eg,ep,ev,re,r,rp) end if op then op(e,tp,eg,ep,ev,re,r,rp) end
local ag=Duel.GetMatchingGroup(cm.selfilter,tp,LOCATION_FZONE,LOCATION_FZONE,nil)
if ag:GetCount()==0 then return end
local seq=c:GetSequence() local seq=c:GetSequence()
if c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and seq<=4 and ((seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1)) or (seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1))) and Duel.SelectYesNo(tp,aux.Stringid(15000810,0)) then if c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and seq<=4 and ((seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1)) or (seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1))) and Duel.SelectYesNo(tp,aux.Stringid(15000810,0)) then
Duel.BreakEffect() Duel.BreakEffect()
......
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