Commit e7d1e203 authored by wind2009's avatar wind2009

Fix 誘いのΔ

parent d2f4629e
Pipeline #30628 passed with stages
in 1 minute and 34 seconds
No preview for this file type
--引诱之Δ --誘いのΔ
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
...@@ -35,7 +36,7 @@ function s.initial_effect(c) ...@@ -35,7 +36,7 @@ function s.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function s.tgfilter(c) function s.tgfilter(c)
return c:IsRace(RACE_ZOMBIE) and c:IsLevelAbove(5) and c:IsAbleToHand() return c:IsRace(RACE_ZOMBIE) and c:IsLevelAbove(5) and c:IsAbleToGrave()
end end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.tgfilter,tp,LOCATION_DECK,0,nil) local g=Duel.GetMatchingGroup(s.tgfilter,tp,LOCATION_DECK,0,nil)
...@@ -46,7 +47,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -46,7 +47,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function s.tkcon(e,tp,eg,ep,ev,re,r,rp) function s.tkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsRace),tp,LOCATION_MZONE,0,1,nil,RACE_ZOMBIE) return Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsRace),tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,RACE_ZOMBIE)
end end
function s.tktg(e,tp,eg,ep,ev,re,r,rp,chk) function s.tktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
...@@ -61,12 +62,11 @@ function s.tkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -61,12 +62,11 @@ function s.tkop(e,tp,eg,ep,ev,re,r,rp)
local token=Duel.CreateToken(tp,id+o) local token=Duel.CreateToken(tp,id+o)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
end end
function s.trigfilter(c,tp) function s.trigfilter(c)
return c:IsType(TYPE_MONSTER) return c:IsType(TYPE_MONSTER) and c:IsPreviousLocation(LOCATION_GRAVE)
and c:IsPreviousLocation(LOCATION_GRAVE)
end end
function s.thcon(e,tp,eg,ep,ev,re,r,rp) function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.trigfilter,1,nil,tp) return eg:IsExists(s.trigfilter,1,nil)
end end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end if chk==0 then return e:GetHandler():IsAbleToHand() end
...@@ -74,8 +74,8 @@ function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -74,8 +74,8 @@ function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function s.thop(e,tp,eg,ep,ev,re,r,rp) function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) then if c:IsRelateToEffect(e) and aux.NecroValleyFilter()(c) then
Duel.SendtoHand(c,nil,REASON_EFFECT) Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c) Duel.ConfirmCards(1-tp,c)
end end
end end
\ No newline at end of file
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