Commit 847dc128 authored by wind2009's avatar wind2009

Fix

parent b77f0148
Pipeline #43029 canceled with stages
in 5 seconds
No preview for this file type
...@@ -5,7 +5,7 @@ function s.initial_effect(c) ...@@ -5,7 +5,7 @@ function s.initial_effect(c)
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_ZOMBIE),6,2) aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_ZOMBIE),6,2)
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddCodeList(c,97077563) aux.AddCodeList(c,97077563)
--untargetable --cannot be target
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
...@@ -17,16 +17,16 @@ function s.initial_effect(c) ...@@ -17,16 +17,16 @@ function s.initial_effect(c)
e1:SetValue(s.tgval) e1:SetValue(s.tgval)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--search --search
local e1=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) e2:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,id) e2:SetCountLimit(1,id)
e1:SetProperty(EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DELAY)
e1:SetTarget(s.thtg) e2:SetTarget(s.thtg)
e1:SetOperation(s.thop) e2:SetOperation(s.thop)
c:RegisterEffect(e1) c:RegisterEffect(e2)
--tohand --tohand
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1)) e3:SetDescription(aux.Stringid(id,1))
...@@ -35,6 +35,7 @@ function s.initial_effect(c) ...@@ -35,6 +35,7 @@ function s.initial_effect(c)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,id+o) e3:SetCountLimit(1,id+o)
e3:SetCost(s.cost)
e3:SetTarget(s.target) e3:SetTarget(s.target)
e3:SetOperation(s.operation) e3:SetOperation(s.operation)
c:RegisterEffect(e3) c:RegisterEffect(e3)
...@@ -49,7 +50,7 @@ function s.tgval(e,re,rp) ...@@ -49,7 +50,7 @@ function s.tgval(e,re,rp)
return rp==1-e:GetHandlerPlayer() and re:IsActiveType(TYPE_MONSTER) return rp==1-e:GetHandlerPlayer() and re:IsActiveType(TYPE_MONSTER)
end end
function s.thfilter(c) function s.thfilter(c)
return aux.IsCodeListed(c,97077563) and c:IsAbleToHand() return aux.IsCodeOrListed(c,97077563) and c:IsAbleToHand()
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 Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
...@@ -66,11 +67,16 @@ end ...@@ -66,11 +67,16 @@ end
function s.filter(c) function s.filter(c)
return c:IsAbleToHand() return c:IsAbleToHand()
end end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) end
c:RemoveOverlayCard(tp,1,1,REASON_COST)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler() local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and s.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_ONFIELD,1,2,c) local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_ONFIELD,1,2,c)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,0,0)
end end
...@@ -80,4 +86,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -80,4 +86,4 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
end end
end end
\ No newline at end of file
...@@ -3,10 +3,10 @@ local s,id,o=GetID() ...@@ -3,10 +3,10 @@ local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--xyz summon --xyz summon
aux.AddXyzProcedure(c,nil,7,2,s.ovfilter,aux.Stringid(id,0),7,s.xyzop) aux.AddXyzProcedure(c,nil,7,2,s.ovfilter,aux.Stringid(id,0),7,s.xyzop)
c:EnableReviveLimit() c:EnableReviveLimit()
--material --material
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
...@@ -40,16 +40,20 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -40,16 +40,20 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and s.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,nil) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_MZONE,1,1,nil)
if g:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE) then
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end
end end
function s.operation(e,tp,eg,ep,ev,re,r,rp) function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) and tc:IsType(TYPE_MONSTER) and tc:IsCanOverlay() then if c:IsRelateToChain() and tc:IsRelateToChain()
and not tc:IsImmuneToEffect(e) and tc:IsType(TYPE_MONSTER) and tc:IsCanOverlay() and aux.NecroValleyFilter()(tc) then
local og=tc:GetOverlayGroup() local og=tc:GetOverlayGroup()
if og:GetCount()>0 then if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE) Duel.SendtoGrave(og,REASON_RULE)
end end
Duel.Overlay(c,Group.FromCards(tc)) Duel.Overlay(c,Group.FromCards(tc))
end end
end end
\ No newline at end of file
...@@ -4,16 +4,17 @@ function s.initial_effect(c) ...@@ -4,16 +4,17 @@ function s.initial_effect(c)
aux.AddCodeList(c,97077563) aux.AddCodeList(c,97077563)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCategory(CATEGORY_SSET) e1:SetCategory(CATEGORY_SSET)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(s.activate) e1:SetOperation(s.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--tg --tg
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,2)) e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_CHAINING) e2:SetCode(EVENT_CHAINING)
...@@ -28,17 +29,18 @@ function s.setfilter(c) ...@@ -28,17 +29,18 @@ function s.setfilter(c)
return c:IsCode(97077563) and c:IsSSetable() return c:IsCode(97077563) and c:IsSSetable()
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.setfilter,tp,LOCATION_DECK,0,nil) local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.setfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,nil)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) and ft>0 then if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) and ft>0 then
local ct=math.min(3,ft) local ct=math.min(3,ft)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=g:Select(tp,1,ft,nil) local sg=g:Select(tp,1,ft,nil)
Duel.SSet(tp,sg) Duel.SSet(tp,sg)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(id,3))
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
if Duel.GetTurnPlayer()==1-tp then if Duel.GetTurnPlayer()==1-tp then
ct=2 ct=2
end end
...@@ -63,7 +65,7 @@ function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -63,7 +65,7 @@ function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function s.tgop(e,tp,eg,ep,ev,re,r,rp) function s.tgop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToChain() then
Duel.SendtoGrave(tc,REASON_EFFECT) Duel.SendtoGrave(tc,REASON_EFFECT)
end end
end end
\ No newline at end of file
...@@ -5,13 +5,13 @@ function s.initial_effect(c) ...@@ -5,13 +5,13 @@ function s.initial_effect(c)
--activate --activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DRAW) e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_ATKCHANGE+CATEGORY_DRAW)
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)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.activate) e1:SetOperation(s.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function s.thfilter(c) function s.thfilter(c)
return (c:IsCode(100259007) or (c:IsRace(RACE_ZOMBIE) and c:IsLevel(6))) and c:IsAbleToHand() return (c:IsCode(100259007) or (c:IsRace(RACE_ZOMBIE) and c:IsLevel(6))) and c:IsAbleToHand()
...@@ -20,7 +20,8 @@ function s.adfilter(c) ...@@ -20,7 +20,8 @@ function s.adfilter(c)
return c:IsFaceup() and c:IsRace(RACE_ZOMBIE) return c:IsFaceup() and c:IsRace(RACE_ZOMBIE)
end end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk) function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) and not Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_MZONE,0,1,nil) local b1=Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil)
and (not Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_MZONE,0,1,nil) or not e:IsCostChecked())
local b2=Duel.IsExistingMatchingCard(s.adfilter,tp,LOCATION_MZONE,0,1,nil) local b2=Duel.IsExistingMatchingCard(s.adfilter,tp,LOCATION_MZONE,0,1,nil)
if chk==0 then return b1 or b2 end if chk==0 then return b1 or b2 end
local op=0 local op=0
...@@ -32,11 +33,12 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -32,11 +33,12 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(op) e:SetLabel(op)
if op==1 then if op==1 then
if e:IsCostChecked() then if e:IsCostChecked() then
e:SetCategory(CATEGORY_SPECIAL_SUMMON) e:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
end end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
elseif op==2 then elseif op==2 then
if e:IsCostChecked() then if e:IsCostChecked() then
e:SetCategory(CATEGORY_DRAW) e:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DRAW)
end end
end end
end end
...@@ -61,12 +63,12 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -61,12 +63,12 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(400) e1:SetValue(400)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
tc=g:GetNext() tc=g:GetNext()
end end
local g=Duel.GetMatchingGroup(s.drfilter,tp,LOCATION_ONFIELD,0,nil) local dct=Duel.GetMatchingGroupCount(s.drfilter,tp,LOCATION_ONFIELD,0,nil)
if #g>0 and Duel.IsPlayerCanDraw(tp,#g) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then if #g>0 and dct>0 and Duel.IsPlayerCanDraw(tp,dct) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Draw(tp,#g,REASON_EFFECT) Duel.Draw(tp,dct,REASON_EFFECT)
end end
end end
end end
\ No newline at end of file
...@@ -4,6 +4,7 @@ function s.initial_effect(c) ...@@ -4,6 +4,7 @@ function s.initial_effect(c)
aux.AddCodeList(c,97077563) aux.AddCodeList(c,97077563)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_COIN) e1:SetCategory(CATEGORY_COIN)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING) e1:SetCode(EVENT_CHAINING)
...@@ -11,16 +12,16 @@ function s.initial_effect(c) ...@@ -11,16 +12,16 @@ function s.initial_effect(c)
e1:SetCondition(s.condition) e1:SetCondition(s.condition)
e1:SetTarget(s.chtg) e1:SetTarget(s.chtg)
e1:SetOperation(s.chop) e1:SetOperation(s.chop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function s.condition(e,tp,eg,ep,ev,re,r,rp) function s.condition(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,0,nil) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,0,nil)
local check=g:IsExists(Card.IsRace,1,nil,RACE_ZOMBIE) and g:IsExists(Card.IsCode,1,nil,97077563) local check=g:IsExists(Card.IsRace,1,nil,RACE_ZOMBIE) and g:IsExists(Card.IsCode,1,nil,97077563)
return rp==1-tp and (re:IsActiveType(TYPE_MONSTER) return rp==1-tp and check and
or (re:GetActiveType()==TYPE_SPELL or re:IsActiveType(TYPE_QUICKPLAY)) and re:IsHasType(EFFECT_TYPE_ACTIVATE)) and check (re:IsActiveType(TYPE_MONSTER) or re:GetActiveType()==TYPE_SPELL or re:IsActiveType(TYPE_QUICKPLAY))
end end
function s.chtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.chtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,REASON_RULE) end
end end
function s.chop(e,tp,eg,ep,ev,re,r,rp) function s.chop(e,tp,eg,ep,ev,re,r,rp)
local res=Duel.TossCoin(1-tp,1) local res=Duel.TossCoin(1-tp,1)
...@@ -34,10 +35,11 @@ function s.chop(e,tp,eg,ep,ev,re,r,rp) ...@@ -34,10 +35,11 @@ function s.chop(e,tp,eg,ep,ev,re,r,rp)
end end
function s.repop1(e,tp,eg,ep,ev,re,r,rp) function s.repop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(1-tp,Card.IsAbleToRemove,1-tp,LOCATION_MZONE,0,1,1,nil) local g=Duel.SelectMatchingCard(1-tp,Card.IsAbleToRemove,1-tp,LOCATION_MZONE,0,1,1,nil,REASON_RULE)
Duel.HintSelection(g)
Duel.Remove(g,POS_FACEUP,REASON_RULE) Duel.Remove(g,POS_FACEUP,REASON_RULE)
end end
function s.repop2(e,tp,eg,ep,ev,re,r,rp) function s.repop2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_MZONE,0,nil,REASON_RULE)
Duel.Remove(g,POS_FACEUP,REASON_RULE) Duel.Remove(g,POS_FACEUP,REASON_RULE)
end end
\ No newline at end of file
...@@ -4,18 +4,20 @@ function s.initial_effect(c) ...@@ -4,18 +4,20 @@ function s.initial_effect(c)
aux.AddCodeList(c,97077563) aux.AddCodeList(c,97077563)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOGRAVE) e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER) e1:SetHintTiming(TIMING_END_PHASE,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,id) e1:SetCountLimit(1,id)
e1:SetCondition(s.condition) e1:SetCondition(s.condition)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.activate) e1:SetOperation(s.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--tg --tg
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOGRAVE) e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
...@@ -27,12 +29,11 @@ function s.initial_effect(c) ...@@ -27,12 +29,11 @@ function s.initial_effect(c)
e2:SetCondition(s.condition2) e2:SetCondition(s.condition2)
e2:SetTarget(s.tgtg) e2:SetTarget(s.tgtg)
e2:SetOperation(s.tgop) e2:SetOperation(s.tgop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function s.condition(e,tp,eg,ep,ev,re,r,rp) function s.condition(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,0,nil) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,0,nil)
local check=g:IsExists(Card.IsRace,1,nil,RACE_ZOMBIE) and g:IsExists(Card.IsCode,1,nil,97077563) return g:IsExists(Card.IsRace,1,nil,RACE_ZOMBIE) and g:IsExists(Card.IsCode,1,nil,97077563)
return check
end end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) end if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) end
...@@ -43,7 +44,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -43,7 +44,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function s.operation(e,tp,eg,ep,ev,re,r,rp) function s.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToChain() then
Duel.SendtoGrave(tc,REASON_EFFECT) Duel.SendtoGrave(tc,REASON_EFFECT)
end end
end end
...@@ -56,19 +57,18 @@ function s.tgfilter(c) ...@@ -56,19 +57,18 @@ function s.tgfilter(c)
end end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_SZONE,0,1,nil) if chk==0 then return Duel.IsExistingTarget(s.tgfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(Card.IsAbleToGrave,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end and Duel.IsExistingTarget(aux.AND(Card.IsAbleToGrave,Card.IsFaceup),tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_MZONE,0,1,1,nil) local g1=Duel.SelectTarget(tp,s.tgfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g2=Duel.SelectTarget(tp,Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,1,nil) local g2=Duel.SelectTarget(tp,aux.AND(Card.IsAbleToGrave,Card.IsFaceup),tp,0,LOCATION_ONFIELD,1,1,nil)
g1:Merge(g2) g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g1,g1:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g1,g1:GetCount(),0,0)
end end
function s.tgop(e,tp,eg,ep,ev,re,r,rp) function s.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local tg=Duel.GetTargetsRelateToChain()
local tg=g:Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()>0 then if tg:GetCount()>0 then
Duel.SendtoGrave(tg,REASON_EFFECT) Duel.SendtoGrave(tg,REASON_EFFECT)
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