Commit 282314d3 authored by wind2009's avatar wind2009

Fix

parent 20f07a2b
Pipeline #43641 canceled with stages
in 37 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)
--set --place
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
...@@ -39,10 +39,9 @@ function s.initial_effect(c) ...@@ -39,10 +39,9 @@ function s.initial_effect(c)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function s.pfilter(c,tp) function s.pfilter(c,tp)
return c:IsSetCard(0x1144) return c:IsSetCard(0x1144) and not c:IsForbidden() and c:CheckUniqueOnField(tp)
and (c:IsType(TYPE_CONTINUOUS) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and (c:IsType(TYPE_CONTINUOUS) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
or c:IsType(TYPE_FIELD)) or c:IsType(TYPE_FIELD))
and not c:IsForbidden() and c:CheckUniqueOnField(tp)
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.IsExistingMatchingCard(s.pfilter,tp,LOCATION_DECK,0,1,nil,tp) end if chk==0 then return Duel.IsExistingMatchingCard(s.pfilter,tp,LOCATION_DECK,0,1,nil,tp) end
...@@ -99,4 +98,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -99,4 +98,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
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
...@@ -3,7 +3,7 @@ local s,id,o=GetID() ...@@ -3,7 +3,7 @@ local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,s.ffilter,3,true) aux.AddFusionProcFunRep(c,s.ffilter,3,true)
aux.AddContactFusionProcedure(c,Card.IsAbleToGraveAsCost,LOCATION_MZONE,0,Duel.SendtoGrave,REASON_COST) aux.AddContactFusionProcedure(c,Card.IsAbleToGraveAsCost,LOCATION_MZONE,0,Duel.SendtoGrave,REASON_SPSUMMON)
--splimit --splimit
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
...@@ -37,6 +37,7 @@ function s.initial_effect(c) ...@@ -37,6 +37,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(3,EFFECT_COUNT_CODE_CHAIN) e3:SetCountLimit(3,EFFECT_COUNT_CODE_CHAIN)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetTarget(s.distg) e3:SetTarget(s.distg)
e3:SetOperation(s.disop) e3:SetOperation(s.disop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
...@@ -67,7 +68,7 @@ end ...@@ -67,7 +68,7 @@ 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:IsFaceup() and tc:IsRelateToChain() then if tc:IsFaceup() and tc:IsRelateToChain() and tc:IsCanBeDisabledByEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET) Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
...@@ -79,6 +80,7 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp) ...@@ -79,6 +80,7 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp)
e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
Duel.AdjustInstantly()
if not tc:IsAttack(0) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then if not tc:IsAttack(0) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Recover(tp,math.ceil(tc:GetAttack()/2),REASON_EFFECT) Duel.Recover(tp,math.ceil(tc:GetAttack()/2),REASON_EFFECT)
......
...@@ -40,13 +40,15 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -40,13 +40,15 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
if sg:GetCount()>0 then if sg:GetCount()>0 then
Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg) Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp) local dg=Duel.SelectMatchingCard(tp,Card.IsDiscardable,tp,LOCATION_HAND,0,2,2,nil,REASON_DISCARD+REASON_EFFECT)
Duel.BreakEffect() if dg:GetCount()>0 then
Duel.DiscardHand(tp,nil,2,2,REASON_EFFECT+REASON_DISCARD) Duel.ShuffleHand(tp)
Duel.SendtoGrave(dg,REASON_EFFECT+REASON_DISCARD)
end
end end
end end
function s.thfilter2(c) function s.thfilter2(c)
return not c:IsSummonableCard() and c:IsRace(RACE_PYRO+RACE_THUNDER+RACE_FIEND) return not c:IsSummonableCard() and c:IsRace(RACE_PYRO+RACE_THUNDER+RACE_FIEND)
and c:IsLevel(10) and c:IsAbleToHand() and c:IsLevel(10) 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)
...@@ -60,4 +62,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -60,4 +62,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end end
\ No newline at end of file
...@@ -53,16 +53,17 @@ end ...@@ -53,16 +53,17 @@ 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()
local g=Duel.GetMatchingGroup(s.tgfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,aux.ExceptThisCard(e)) local g=Duel.GetMatchingGroup(s.tgfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,aux.ExceptThisCard(e))
if not g:CheckSubGroup(s.gcheck,3,3,tp) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroup(tp,s.gcheck,false,3,3) local sg=g:SelectSubGroup(tp,s.gcheck,false,3,3)
if sg:GetCount()>0 and Duel.SendtoGrave(sg,nil,REASON_EFFECT)~=0 if sg:GetCount()>0 and Duel.SendtoGrave(sg,REASON_EFFECT)==3
and sg:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE) and sg:IsExists(Card.IsLocation,3,nil,LOCATION_GRAVE)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp) local spg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=spg:GetFirst()
Duel.BreakEffect() Duel.BreakEffect()
if tc then if tc then
local res=false local res=false
...@@ -73,8 +74,9 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -73,8 +74,9 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
end end
if res then if res then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,3))
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT) e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
...@@ -105,4 +107,4 @@ end ...@@ -105,4 +107,4 @@ end
function s.drop(e,tp,eg,ep,ev,re,r,rp) function s.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT) Duel.Draw(p,d,REASON_EFFECT)
end end
\ No newline at end of file
...@@ -7,7 +7,7 @@ function s.initial_effect(c) ...@@ -7,7 +7,7 @@ function s.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--set --place
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0)) e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
...@@ -45,8 +45,10 @@ function s.setfilter(c) ...@@ -45,8 +45,10 @@ function s.setfilter(c)
end end
function s.setop(e,tp,eg,ep,ev,re,r,rp) function s.setop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=1 then return end if Duel.GetLocationCount(tp,LOCATION_SZONE)<=1 then return end
local pg=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.tffilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,nil,tp)
if pg:GetCount()<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.tffilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,2,2,nil,tp) local g=pg:Select(tp,2,2,nil)
local ct=0 local ct=0
for tc in aux.Next(g) do for tc in aux.Next(g) do
if Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then if Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
...@@ -58,8 +60,8 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -58,8 +60,8 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp)
and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_HAND,0,1,1,nil) local cg=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,cg)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
local sc=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst() local sc=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5) local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
...@@ -82,4 +84,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -82,4 +84,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
if c:IsRelateToChain() and aux.NecroValleyFilter()(c) then if c:IsRelateToChain() and aux.NecroValleyFilter()(c) then
Duel.SendtoHand(c,nil,REASON_EFFECT) Duel.SendtoHand(c,nil,REASON_EFFECT)
end end
end end
\ No newline at end of file
...@@ -48,43 +48,46 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -48,43 +48,46 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc then if tc then
local res=false local res=0
if tc:IsCode(101305005,101305006,101305007) then if tc:IsCode(101305005,101305006,101305007) then
res=Duel.SpecialSummon(tc,0,tp,tp,false,true,POS_FACEUP_DEFENSE) res=Duel.SpecialSummon(tc,0,tp,tp,false,true,POS_FACEUP_DEFENSE)
else else
res=Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) res=Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end end
if res and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,2,nil) if res>0 and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,2,nil)
and Duel.IsExistingMatchingCard(aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,nil) and Duel.IsExistingMatchingCard(aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectMatchingCard(tp,aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,1,nil) local ng=Duel.SelectMatchingCard(tp,aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.HintSelection(g) Duel.HintSelection(ng)
local tc=g:GetFirst() local nc=ng:GetFirst()
Duel.NegateRelatedChain(tc,RESET_TURN_SET) if nc:IsCanBeDisabledByEffect(e) then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE) e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1) nc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET) e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD) e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2) nc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER) e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD) e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3) nc:RegisterEffect(e3)
end
Duel.AdjustInstantly()
Duel.NegateRelatedChain(nc,RESET_TURN_SET)
Duel.Destroy(nc,REASON_EFFECT)
end end
Duel.Destroy(tc,REASON_EFFECT)
end end
end end
end end
...@@ -145,4 +148,4 @@ function s.fspop(e,tp,eg,ep,ev,re,r,rp) ...@@ -145,4 +148,4 @@ function s.fspop(e,tp,eg,ep,ev,re,r,rp)
end end
tc:CompleteProcedure() tc:CompleteProcedure()
end end
end end
\ No newline at end of file
...@@ -12,6 +12,7 @@ function s.initial_effect(c) ...@@ -12,6 +12,7 @@ function s.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCountLimit(1,id) e2:SetCountLimit(1,id)
e2:SetCondition(s.setcon) e2:SetCondition(s.setcon)
e2:SetTarget(s.settg) e2:SetTarget(s.settg)
...@@ -19,7 +20,7 @@ function s.initial_effect(c) ...@@ -19,7 +20,7 @@ function s.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--pos --pos
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,0)) e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_POSITION+CATEGORY_MSET) e3:SetCategory(CATEGORY_POSITION+CATEGORY_MSET)
e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN) e3:SetCode(EVENT_FREE_CHAIN)
...@@ -32,7 +33,7 @@ function s.initial_effect(c) ...@@ -32,7 +33,7 @@ function s.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--to hand --to hand
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,1)) e4:SetDescription(aux.Stringid(id,2))
e4:SetCategory(CATEGORY_TODECK) e4:SetCategory(CATEGORY_TODECK)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_PHASE+PHASE_END) e4:SetCode(EVENT_PHASE+PHASE_END)
...@@ -44,8 +45,7 @@ function s.initial_effect(c) ...@@ -44,8 +45,7 @@ function s.initial_effect(c)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function s.setcon(e,tp,eg,ep,ev,re,r,rp) function s.setcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase() return Duel.IsMainPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end end
function s.tffilter(c,tp) function s.tffilter(c,tp)
return c:IsCode(id) return c:IsCode(id)
...@@ -57,9 +57,10 @@ function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -57,9 +57,10 @@ function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function s.setop(e,tp,eg,ep,ev,re,r,rp) function s.setop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=1 then return end if Duel.GetLocationCount(tp,LOCATION_SZONE)<=1 then return end
local pg=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.tffilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,nil,tp)
if pg:GetCount()<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.tffilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,2,2,nil,tp) local g=pg:Select(tp,2,2,nil)
local ct=0
for tc in aux.Next(g) do for tc in aux.Next(g) do
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end end
...@@ -88,7 +89,7 @@ function s.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -88,7 +89,7 @@ function s.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function s.posop(e,tp,eg,ep,ev,re,r,rp) function s.posop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsType(TYPE_MONSTER) then if tc:IsRelateToChain() and tc:IsType(TYPE_MONSTER) then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE) Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
end end
end end
...@@ -105,4 +106,4 @@ function s.tdop(e,tp,eg,ep,ev,re,r,rp) ...@@ -105,4 +106,4 @@ function s.tdop(e,tp,eg,ep,ev,re,r,rp)
if c:IsRelateToChain() and aux.NecroValleyFilter()(c) then if c:IsRelateToChain() and aux.NecroValleyFilter()(c) then
Duel.SendtoDeck(c,nil,SEQ_DECKBOTTOM,REASON_EFFECT) Duel.SendtoDeck(c,nil,SEQ_DECKBOTTOM,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