Commit 71fe9644 authored by mercury233's avatar mercury233 Committed by GitHub

fix Vanguard of the Underground Emperor

parent bc8393dd
...@@ -6,7 +6,7 @@ function s.initial_effect(c) ...@@ -6,7 +6,7 @@ function s.initial_effect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_CUSTOM+id) e1:SetCode(EVENT_TO_GRAVE)
e1:SetRange(LOCATION_GRAVE) e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,id) e1:SetCountLimit(1,id)
e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetProperty(EFFECT_FLAG_DELAY)
...@@ -14,25 +14,12 @@ function s.initial_effect(c) ...@@ -14,25 +14,12 @@ function s.initial_effect(c)
e1:SetTarget(s.tg) e1:SetTarget(s.tg)
e1:SetOperation(s.op) e1:SetOperation(s.op)
c:RegisterEffect(e1) c:RegisterEffect(e1)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_TO_GRAVE)
ge1:SetCondition(s.regcon)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
end
end
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsPreviousLocation,1,nil,LOCATION_HAND)
end end
function s.regop(e,tp,eg,ep,ev,re,r,rp) function s.cfilter(c)
local g=Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_GRAVE,LOCATION_GRAVE,eg,id) return c:IsType(TYPE_MONSTER) and c:IsPreviousLocation(LOCATION_HAND)
Duel.RaiseEvent(g,EVENT_CUSTOM+id,re,r,rp,ep,0)
end end
function s.con(e,tp,eg,ep,ev,re,r,rp) function s.con(e,tp,eg,ep,ev,re,r,rp)
return eg:IsContains(e:GetHandler()) return eg:IsExists(s.cfilter,1,nil) and not eg:IsContains(e:GetHandler())
end end
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk) function s.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
......
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