Commit a575ce3b authored by wind2009's avatar wind2009

Fix

parent afbdb6df
Pipeline #43023 canceled with stages
in 7 seconds
No preview for this file type
--Pumpking the King of Grave Ghosts --Pumpking the King of Grave Ghosts
CATEGORY_SSET =0x200000000 --包含盖放魔陷的效果
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
aux.AddCodeList(c,97077563) aux.AddCodeList(c,97077563)
--set --set
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_TODECK+CATEGORY_SSET) e1:SetCategory(CATEGORY_TODECK+CATEGORY_SSET+CATEGORY_HANDES)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id) e1:SetCountLimit(1,id)
e1:SetCost(s.setcost) e1:SetCost(s.setcost)
e1:SetTarget(s.settg) e1:SetTarget(s.settg)
e1:SetOperation(s.setop) e1:SetOperation(s.setop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--special summon --special summon
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1)) e2:SetDescription(aux.Stringid(id,1))
...@@ -23,7 +24,7 @@ function s.initial_effect(c) ...@@ -23,7 +24,7 @@ function s.initial_effect(c)
e2:SetCountLimit(1,id+o) e2:SetCountLimit(1,id+o)
e2:SetTarget(s.sptg) e2:SetTarget(s.sptg)
e2:SetOperation(s.spop) e2:SetOperation(s.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function s.setcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.setcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end if chk==0 then return not e:GetHandler():IsPublic() end
...@@ -32,18 +33,20 @@ function s.setfilter(c) ...@@ -32,18 +33,20 @@ function s.setfilter(c)
return c:IsCode(97077563) and c:IsSSetable() return c:IsCode(97077563) and c:IsSSetable()
end end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil)
and Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil,REASON_DISCARD+REASON_EFFECT) end
and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
end end
function s.setop(e,tp,eg,ep,ev,re,r,rp) function s.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.setfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc and Duel.SSet(tp,tc)~=0 and c:IsRelateToEffect(e) then if tc and Duel.SSet(tp,tc)~=0 then
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_EFFECT) local dg=Duel.SelectMatchingCard(tp,Card.IsDiscardable,tp,LOCATION_HAND,0,1,1,nil,REASON_DISCARD+REASON_EFFECT)
if dg:GetCount()>0 then
Duel.ShuffleHand(tp)
Duel.SendtoGrave(dg,REASON_EFFECT+REASON_DISCARD)
end
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(id,2)) e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
...@@ -81,4 +84,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -81,4 +84,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
end end
function s.splimit(e,c) function s.splimit(e,c)
return c:IsLocation(LOCATION_HAND+LOCATION_GRAVE) and not c:IsRace(RACE_ZOMBIE) return c:IsLocation(LOCATION_HAND+LOCATION_GRAVE) and not c:IsRace(RACE_ZOMBIE)
end end
\ No newline at end of file
--Army of the Haunted --Army of the Haunted
CATEGORY_SSET =0x200000000 --包含盖放魔陷的效果
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
aux.AddCodeList(c,97077563) aux.AddCodeList(c,97077563)
...@@ -12,7 +13,7 @@ function s.initial_effect(c) ...@@ -12,7 +13,7 @@ function s.initial_effect(c)
e1:SetCondition(s.spcon) e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg) e1:SetTarget(s.sptg)
e1:SetOperation(s.spop) e1:SetOperation(s.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--set --set
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1)) e2:SetDescription(aux.Stringid(id,1))
...@@ -23,7 +24,7 @@ function s.initial_effect(c) ...@@ -23,7 +24,7 @@ function s.initial_effect(c)
e2:SetCountLimit(1,id+o) e2:SetCountLimit(1,id+o)
e2:SetTarget(s.settg) e2:SetTarget(s.settg)
e2:SetOperation(s.setop) e2:SetOperation(s.setop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function s.cfilter(c) function s.cfilter(c)
return c:IsCode(97077563) and c:IsFaceup() return c:IsCode(97077563) and c:IsFaceup()
...@@ -32,13 +33,14 @@ function s.spcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -32,13 +33,14 @@ function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,nil) return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end end
function s.spop(e,tp,eg,ep,ev,re,r,rp) function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) then if c:IsRelateToChain() and aux.NecroValleyFilter()(c) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end end
end end
...@@ -54,7 +56,7 @@ function s.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -54,7 +56,7 @@ function s.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function s.setop(e,tp,eg,ep,ev,re,r,rp) function s.setop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToChain() and aux.NecroValleyFilter()(tc) then
Duel.SSet(tp,tc) Duel.SSet(tp,tc)
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)
--search --search
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
...@@ -11,8 +12,8 @@ function s.initial_effect(c) ...@@ -11,8 +12,8 @@ function s.initial_effect(c)
e1:SetCost(s.cost) e1:SetCost(s.cost)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.operation) e1:SetOperation(s.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
-- --disable
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1)) e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DISABLE) e2:SetCategory(CATEGORY_DISABLE)
...@@ -30,7 +31,8 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -30,7 +31,8 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD) Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end end
function s.filter(c) function s.filter(c)
return aux.IsCodeOrListed(c,97077563) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand() return (c:IsCode(c,97077563) or aux.IsCodeListed(c,97077563) and c:IsType(TYPE_SPELL+TYPE_TRAP))
and c:IsAbleToHand()
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)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end
...@@ -57,28 +59,28 @@ end ...@@ -57,28 +59,28 @@ end
function s.disop(e,tp,eg,ep,ev,re,r,rp) function s.disop(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 tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsAttackPos() then if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
if tc:IsType(TYPE_EFFECT) then Duel.NegateRelatedChain(tc,RESET_TURN_SET)
Duel.NegateRelatedChain(tc,RESET_TURN_SET) local e2=Effect.CreateEffect(c)
local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_DISABLE)
e2:SetCode(EFFECT_DISABLE) e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e2)
tc:RegisterEffect(e2) local e3=e2:Clone()
local e3=e2:Clone() e3:SetCode(EFFECT_DISABLE_EFFECT)
e3:SetCode(EFFECT_DISABLE_EFFECT) e3:SetValue(RESET_TURN_SET)
e3:SetValue(RESET_TURN_SET) tc:RegisterEffect(e3)
tc:RegisterEffect(e3) if tc:IsType(TYPE_TRAPMONSTER) then
if tc:IsType(TYPE_TRAPMONSTER) then local e4=e2:Clone()
local e4=e2:Clone() e4:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e4:SetCode(EFFECT_DISABLE_TRAPMONSTER) tc:RegisterEffect(e4)
tc:RegisterEffect(e4)
end
end end
Duel.AdjustInstantly() Duel.AdjustInstantly()
if not tc:IsImmuneToEffect(e) then if not tc:IsImmuneToEffect(e) then
...@@ -87,7 +89,7 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) ...@@ -87,7 +89,7 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE) e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE)
e5:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL) e5:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e5:SetRange(LOCATION_MZONE) e5:SetRange(LOCATION_MZONE)
e5:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e5:SetReset(RESET_EVENT+RESETS_STANDARD)
e5:SetValue(1) e5:SetValue(1)
tc:RegisterEffect(e5) tc:RegisterEffect(e5)
local e6=e5:Clone() local e6=e5:Clone()
...@@ -105,4 +107,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) ...@@ -105,4 +107,4 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp)
end end
function s.fuslimit(e,c,sumtype) function s.fuslimit(e,c,sumtype)
return sumtype==SUMMON_TYPE_FUSION return sumtype==SUMMON_TYPE_FUSION
end end
\ No newline at end of file
...@@ -4,19 +4,19 @@ function s.initial_effect(c) ...@@ -4,19 +4,19 @@ function s.initial_effect(c)
aux.AddCodeList(c,97077563) aux.AddCodeList(c,97077563)
--destroy --destroy
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(36609518,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY) e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_ACTIVATE_CONDITION) e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_ACTIVATE_CONDITION)
e1:SetCountLimit(1,36609518) e1:SetCountLimit(1,id)
e1:SetCondition(s.descon) e1:SetCondition(s.descon)
e1:SetTarget(s.destg) e1:SetTarget(s.destg)
e1:SetOperation(s.desop) e1:SetOperation(s.desop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--get effect --get effect
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29601381,2)) e2:SetDescription(aux.Stringid(id,1))
e2:SetType(EFFECT_TYPE_XMATERIAL) e2:SetType(EFFECT_TYPE_XMATERIAL)
e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
...@@ -26,7 +26,7 @@ function s.initial_effect(c) ...@@ -26,7 +26,7 @@ function s.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function s.cfilter(c) function s.cfilter(c)
return c:IsFaceup() and ((c:IsRace(RACE_ZOMBIE) and not c:IsCode(id)) or c:IsCode(97077563)) return c:IsFaceup() and (c:IsRace(RACE_ZOMBIE) and not c:IsCode(id) or c:IsCode(97077563))
end end
function s.descon(e,tp,eg,ep,ev,re,r,rp) function s.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil)
...@@ -40,10 +40,10 @@ function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -40,10 +40,10 @@ function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function s.desop(e,tp,eg,ep,ev,re,r,rp) function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToChain() and tc:IsOnField() then
Duel.Destroy(tc,REASON_EFFECT) Duel.Destroy(tc,REASON_EFFECT)
end end
end end
function s.gfcon(e) function s.gfcon(e)
return e:GetHandler():IsRace(RACE_ZOMBIE) return e:GetHandler():IsRace(RACE_ZOMBIE)
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