Commit 527fd867 authored by GuGu's avatar GuGu

Update c11016.lua

parent 650879c0
Pipeline #34308 passed with stage
in 9 seconds
......@@ -22,6 +22,7 @@ function c11016.initial_effect(c)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e3:SetCondition(c11016.condition)
e3:SetTarget(c11016.target)
e3:SetOperation(c11016.operation)
......@@ -40,15 +41,14 @@ function c11016.initial_effect(c)
end
function c11016.condition(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end
return Duel.IsChainNegatable(ev) and e:GetHandler():GetAttack()>=600 and re:GetHandler()~=e:GetHandler()
return Duel.IsChainNegatable(ev) and re:GetHandler()~=e:GetHandler()
end
function c11016.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(11016)==0 and c:GetFlagEffect(1101600)==0 end
if chk==0 then return c:GetFlagEffect(11016)==0 and c:GetAttack()>=600 end
if c:IsHasEffect(EFFECT_REVERSE_UPDATE) then
c:RegisterFlagEffect(11016,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
c:RegisterFlagEffect(11016,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
c:RegisterFlagEffect(1101600,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
......@@ -56,28 +56,28 @@ function c11016.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c11016.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() and c:GetAttack()>=600 then
Duel.NegateActivation(ev)
if re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
if c:IsRelateToEffect(e) and c:IsFaceup() and c:GetAttack()>=600
and not c:IsStatus(STATUS_BATTLE_DESTROYED) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-600)
c:RegisterEffect(e1)
if not c:IsHasEffect(EFFECT_REVERSE_UPDATE) and Duel.GetCurrentChain()==ev+1 then
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
end
end
function c11016.ctltg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsControlerCanBeChanged() end
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_CONTROL,e:GetHandler(),1,0,0)
end
function c11016.ctlop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() and not Duel.GetControl(c,1-tp) then
if not c:IsImmuneToEffect(e) and c:IsAbleToChangeControler() then
Duel.Destroy(c,REASON_EFFECT)
end
if c:IsRelateToEffect(e) then
Duel.GetControl(c,1-tp)
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