Commit 2d50e7a5 authored by nanahira's avatar nanahira Committed by mercury233

fix No.41 (#890)

parent 8f07e1ef
......@@ -44,6 +44,16 @@ function c90590303.initial_effect(c)
e5:SetCondition(c90590303.discon)
e5:SetOperation(c90590303.disop)
c:RegisterEffect(e5)
--global check for getting activate position
if not c90590303.global_check then
c90590303.global_check=true
local ge1=Effect.GlobalEffect()
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetCondition(c90590303.regcon)
ge1:SetOperation(c90590303.regop)
Duel.RegisterEffect(ge1,0)
end
end
c90590303.xyz_number=41
function c90590303.mtcon(e,tp,eg,ep,ev,re,r,rp)
......@@ -70,10 +80,23 @@ function c90590303.postg(e,c)
end
function c90590303.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
if c:IsStatus(STATUS_BATTLE_DESTROYED) or c:IsAttackPos() then return false end
return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsDefensePos() and loc==LOCATION_MZONE
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
return not c:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsDefensePos() and c90590303[cid]
end
function c90590303.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
function c90590303.regcon(e,tp,eg,ep,ev,re,r,rp)
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
if not re:IsActiveType(TYPE_MONSTER) or loc~=LOCATION_MZONE then return false end
local rc=re:GetHandler()
if rc:IsRelateToEffect(re) then
return rc:IsDefensePos()
else
return rc:IsPreviousPosition(POS_DEFENSE)
end
end
function c90590303.regop(e,tp,eg,ep,ev,re,r,rp)
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
c90590303[cid]=true
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