Commit 64b8ed47 authored by Huangnan's avatar Huangnan

fix

parent ed5ca1e3
Pipeline #40246 passed with stage
in 3 minutes and 30 seconds
......@@ -8,6 +8,7 @@ function s.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
......
......@@ -69,33 +69,34 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
local tc=g:GetFirst()
if not tc then return end
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_TRAP+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
local ge1=Effect.CreateEffect(c)
ge1:SetDescription(aux.Stringid(id,1))
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
ge1:SetCode(EVENT_PHASE+PHASE_END)
if Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_END then
e1:SetReset(EVENT_PHASE+PHASE_END+RESET_SELF_TURN,2)
e1:SetValue(Duel.GetTurnCount())
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_TURN_SET+EVENT_PHASE+PHASE_END+RESET_SELF_TURN,0,2)
else
e1:SetReset(EVENT_PHASE+PHASE_END+RESET_SELF_TURN)
e1:SetValue(0)
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_TURN_SET+EVENT_PHASE+PHASE_END+RESET_SELF_TURN,0,1)
if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_TRAP+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
local ge1=Effect.CreateEffect(c)
ge1:SetDescription(aux.Stringid(id,1))
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
ge1:SetCode(EVENT_PHASE+PHASE_END)
if Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_END then
ge1:SetReset(EVENT_PHASE+PHASE_END+RESET_SELF_TURN,2)
ge1:SetValue(Duel.GetTurnCount())
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+EVENT_PHASE+PHASE_END+RESET_SELF_TURN,0,2)
else
ge1:SetReset(EVENT_PHASE+PHASE_END+RESET_SELF_TURN)
ge1:SetValue(0)
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+EVENT_PHASE+PHASE_END+RESET_SELF_TURN,0,1)
end
ge1:SetCountLimit(1)
ge1:SetCondition(s.descon)
ge1:SetOperation(s.desop)
Duel.RegisterEffect(ge1,tp)
end
ge1:SetCountLimit(1)
ge1:SetCondition(s.descon)
ge1:SetOperation(s.desop)
Duel.RegisterEffect(ge1,tp)
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()~=tp or Duel.GetTurnCount()==e:GetValue() then return false end
......
......@@ -55,17 +55,11 @@ function cm.spfilter(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and (c:IsAttribute(ATTRIBUTE_DARK) or c:IsAttribute(ATTRIBUTE_WATER)) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function cm.filter4(c,e)
return c:IsAbleToDeck() and c:GetFlagEffect(18700544)>0 and c:IsRace(RACE_AQUA)
end
function cm.filter5(c,e)
return not c:IsImmuneToEffect(e) and c:IsAbleToDeck() and c:GetFlagEffect(18700544)>0 and c:IsRace(RACE_AQUA)
end
function cm.chkfilter(c,tp)
return c:IsCode(18700548,18700552)
end
function cm.fcheck(tp,sg,fc)
if Duel.IsExistingMatchingCard(cm.chkfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) then
if Duel.IsExistingMatchingCard(cm.chkfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil) then
return sg:FilterCount(Card.IsControler,nil,1-tp)<=1
else
return sg:FilterCount(Card.IsControler,nil,1-tp)<=0
......@@ -81,15 +75,11 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local chkf=tp
local mg1=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_REMOVED,0,nil,e)
local mg2=Duel.GetMatchingGroup(cm.filter1,tp,0,LOCATION_MZONE,nil)
local mg3=Duel.GetMatchingGroup(cm.filter4,tp,0,LOCATION_MZONE+LOCATION_GRAVE,nil)
if Duel.IsExistingMatchingCard(cm.chkfilter,tp,LOCATION_MZONE+LOCATION_REMOVED,0,1,nil,tp) and mg2:GetCount()>0 then
if Duel.IsExistingMatchingCard(cm.chkfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,tp) and mg2:GetCount()>0 then
mg1:Merge(mg2)
aux.FCheckAdditional=cm.fcheck
aux.GCheckAdditional=cm.gcheck(tp)
end
if Duel.IsExistingMatchingCard(cm.filter4,tp,LOCATION_MZONE+LOCATION_REMOVED,0,1,nil,tp) and mg3:GetCount()>0 then
mg1:Merge(mg3)
end
local res=Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
aux.FCheckAdditional=nil
aux.GCheckAdditional=nil
......@@ -109,16 +99,12 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_REMOVED,0,nil,e)
local mg2=Duel.GetMatchingGroup(cm.filter3,tp,0,LOCATION_MZONE+LOCATION_GRAVE,nil,e)
local mg3=Duel.GetMatchingGroup(cm.filter5,tp,0,LOCATION_MZONE+LOCATION_GRAVE,nil,e)
local mg2=Duel.GetMatchingGroup(cm.filter3,tp,0,LOCATION_MZONE,nil,e)
local exmat=false
if Duel.IsExistingMatchingCard(cm.chkfilter,tp,LOCATION_MZONE+LOCATION_REMOVED,0,1,nil,tp) and mg2:GetCount()>0 then
if Duel.IsExistingMatchingCard(cm.chkfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,tp) and mg2:GetCount()>0 then
mg1:Merge(mg2)
exmat=true
end
if Duel.IsExistingMatchingCard(cm.filter4,tp,LOCATION_MZONE+LOCATION_REMOVED,0,1,nil,tp) and mg3:GetCount()>0 then
mg1:Merge(mg3)
end
if exmat then
aux.FCheckAdditional=cm.fcheck
aux.GCheckAdditional=cm.gcheck(tp)
......
......@@ -57,10 +57,10 @@ function cm.filter4(c)
return c:IsType(TYPE_SPELL) and c:IsSetCard(0x820) and c:IsFaceup() and c:IsAbleToHand()
end
function cm.sptg3(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_REMOVED+LOCATION_GRAVE) and cm.filter4(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter4,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,nil) end
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_REMOVED) and cm.filter4(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter4,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,cm.filter4,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,1,nil)
local g=Duel.SelectTarget(tp,cm.filter4,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function cm.spop3(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -110,8 +110,8 @@ function cm.initial_effect(c)
c:RegisterEffect(e4)
end
function cm.ffilter(c,fc,sub,mg,sg)
return not sg or not sg:IsExists(Card.IsFusionAttribute,1,c,c:GetFusionAttribute()) and sg:IsExists(Card.IsControler,1,nil,fc:GetControler())
and c:IsRace(RACE_REPTILE) or c:IsRace(RACE_WINDBEAST) or c:IsRace(RACE_AQUA) or c:IsRace(RACE_BEAST) or c:IsRace(RACE_DRAGON) or c:IsRace(RACE_INSECT)
return not sg or (sg:IsExists(Card.IsControler,1,nil,fc:GetControler())
and (c:IsRace(RACE_REPTILE) or c:IsRace(RACE_WINDBEAST) or c:IsRace(RACE_AQUA) or c:IsRace(RACE_BEAST) or c:IsRace(RACE_DRAGON) or c:IsRace(RACE_INSECT)))
end
function cm.cfilter(c)
return c:IsCode(m+1) or c:IsCode(m+2) or c:IsCode(m+3) or c:IsCode(m+4) or c:IsCode(m+5) or c:IsCode(m+6)
......@@ -356,22 +356,20 @@ function cm.op2(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(g) do
if tc:IsLocation(LOCATION_MZONE) and tc:IsFaceup() then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
if tc:IsPosition(POS_FACEDOWN_DEFENSE) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
elseif tc:IsLocation(LOCATION_MZONE) and tc:IsFacedown() then
Duel.ChangePosition(tc,POS_FACEUP_ATTACK)
if tc:IsPosition(POS_FACEDOWN_DEFENSE) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
end
......
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