Commit e8198940 authored by Nemo Ma's avatar Nemo Ma

fff

parent a98bd7ae
......@@ -11,19 +11,43 @@ function cm.initial_effect(c)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
if not cm.global_check then
cm.global_check=true
cm.chain=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(cm.check)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_CHAIN_SOLVED)
ge2:SetCondition(cm.clearcon)
ge2:SetOperation(cm.clear)
Duel.RegisterEffect(ge2,0)
local ge3=ge2:Clone()
ge3:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(ge3,0)
end
end
function cm.check(e,tp,eg,ep,ev,re,r,rp)
cm.chain=1
end
function cm.clearcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==1
end
function cm.clear(e,tp,eg,ep,ev,re,r,rp)
cm.chain=0
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetTurnPlayer()==1-tp and Duel.GetCurrentChain()==0 and not Duel.CheckPhaseActivity()
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetTurnPlayer()==1-tp and cm.chain==0 and not Duel.CheckPhaseActivity()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
return true
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()>0 then e:SetLabel(0) return true end
return false
end
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -10,10 +10,37 @@ function cm.initial_effect(c)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
if not cm.global_check then
cm.global_check=true
cm.chain=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(cm.check)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_CHAIN_SOLVED)
ge2:SetCondition(cm.clearcon)
ge2:SetOperation(cm.clear)
Duel.RegisterEffect(ge2,0)
local ge3=ge2:Clone()
ge3:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(ge3,0)
end
end
function cm.check(e,tp,eg,ep,ev,re,r,rp)
cm.chain=1
end
function cm.clearcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==1
end
function cm.clear(e,tp,eg,ep,ev,re,r,rp)
cm.chain=0
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetBattleMonster(1-tp)
return tc and tc:IsFaceup() and tc:IsRelateToBattle() and Duel.GetCurrentChain()==0
return tc and tc:IsFaceup() and tc:IsRelateToBattle() and cm.chain==0
end
function cm.thfilter(c,e,tp)
if not (c:IsSetCard(0x106f) and c:IsType(TYPE_MONSTER)) then return false 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