Commit d35841b1 authored by Huangnan's avatar Huangnan

fix

parent f316ebf0
Pipeline #40871 failed with stages
in 8 minutes and 8 seconds
......@@ -46,7 +46,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP)
if Duel.IsExistingMatchingCard(Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,c) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local dg=Duel.SelectMatchingCard(tp,Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,c)
local dg=Duel.SelectMatchingCard(tp,Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if dg:GetCount()>0 then
Duel.ChangePosition(dg,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
end
......@@ -60,88 +60,55 @@ function s.desfilter(c)
return not c:IsLocation(LOCATION_SZONE) or c:GetSequence()<5
end
function s.seqfilter(c,seq,tp)
local loc=LOCATION_MZONE
if seq>8 then
loc=LOCATION_SZONE
seq=seq-8
end
if seq>=5 and seq<=7 then return false end
local cseq=c:GetSequence()
local cloc=c:GetLocation()
if cloc==LOCATION_SZONE and cseq>=5 then return false end
if cloc==LOCATION_MZONE and cseq>=5 and loc==LOCATION_MZONE
and (seq==1 and cseq==5 or seq==3 and cseq==6) then return true end
return cseq==seq and cloc~=loc or cloc==loc and math.abs(cseq-seq)==1
end
function s.desfilter2(c)
return not c:IsLocation(LOCATION_SZONE) or c:GetSequence()<5
end
function s.exmzfilter2(c,seq)
return c:GetSequence()==seq
end
function s.seqfilter2(c,seq,tp)
local loc=LOCATION_MZONE
if seq>=8 then
loc=LOCATION_SZONE
seq=seq-8
if cloc&LOCATION_SZONE~=0 and cseq>=5 then return false end
if cloc&LOCATION_MZONE~=0 and cseq>=5 then
if c:IsControler(tp) then
return seq==1 and cseq==6 or seq==3 and cseq==5
else
return seq==1 and cseq==5 or seq==3 and cseq==6
end
end
if seq>=5 and loc==LOCATION_SZONE then return false end
if seq==7 and loc==LOCATION_MZONE then return false end
local cseq=c:GetSequence()
local cloc=c:GetLocation()
if cloc==LOCATION_SZONE and cseq>=5 then return false end
if cloc==LOCATION_MZONE and cseq>=5 and loc==LOCATION_MZONE
and (seq==1 and cseq==5 or seq==3 and cseq==6) then return true end
if cloc==LOCATION_MZONE and seq>=5 and loc==LOCATION_MZONE
and Duel.IsExistingMatchingCard(s.exmzfilter2,tp,0,LOCATION_MZONE,1,nil,seq) then
return seq==5 and cseq==1 or seq==6 and cseq==3
if c:IsControler(tp) then
return false
end
return cseq==seq and cloc~=loc or seq<5 and cseq<5 and cloc==loc and math.abs(cseq-seq)==1
if cloc&LOCATION_MZONE~=0 then
return cseq==seq or seq<5 and cseq<5 and math.abs(cseq-seq)==1
else
return cseq==seq
end
return false
end
function s.seqtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.desfilter,tp,0,LOCATION_ONFIELD,1,nil) or Duel.IsExistingMatchingCard(s.desfilter2,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,0,LOCATION_ONFIELD)
if chk==0 then return Duel.IsExistingMatchingCard(s.desfilter,tp,LOCATION_MZONE,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,1-tp,LOCATION_ONFIELD)
end
function s.seqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
local filter=0
for i=0,6 do
if not Duel.IsExistingMatchingCard(s.seqfilter,tp,0,LOCATION_ONFIELD,1,nil,i,tp) then
filter=filter|1<<(i+16)
end
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ZONE)
local flag=Duel.SelectField(tp,1,0,LOCATION_ONFIELD,filter)
Duel.Hint(HINT_ZONE,tp,flag)
local seq=math.log(flag>>16,2)
local g=Duel.GetMatchingGroup(s.seqfilter,tp,0,LOCATION_ONFIELD,nil,seq,tp)
Duel.Destroy(g,REASON_EFFECT)
else
local filter=0
for i=0,15 do
if not Duel.IsExistingMatchingCard(s.seqfilter2,tp,LOCATION_ONFIELD,0,1,nil,i,tp) then
filter=filter|1<<(i)
end
local filter=0
for i=0,6 do
if not Duel.IsExistingMatchingCard(s.seqfilter,tp,LOCATION_MZONE,LOCATION_ONFIELD,1,nil,i,tp) then
filter=filter|1<<(i+16)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ZONE)
local flag=Duel.SelectField(tp,1,LOCATION_ONFIELD,0,filter)
Duel.Hint(HINT_ZONE,tp,flag)
local seq=math.log(flag,2)
local g=Duel.GetMatchingGroup(s.seqfilter2,tp,LOCATION_ONFIELD,0,nil,seq,tp)
Duel.Destroy(g,REASON_EFFECT)
end
if Duel.IsExistingMatchingCard(Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local dg=Duel.SelectMatchingCard(tp,Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if dg:GetCount()>0 then
Duel.ChangePosition(dg,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local flag=Duel.SelectField(tp,1,LOCATION_ONFIELD,LOCATION_ONFIELD,filter)
Duel.Hint(HINT_ZONE,tp,flag)
local seq=math.log(flag>>16,2)
local g=Duel.GetMatchingGroup(s.seqfilter,tp,LOCATION_MZONE,LOCATION_ONFIELD,nil,seq,tp)
Duel.Destroy(g,REASON_EFFECT)
if Duel.IsExistingMatchingCard(Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local dg=Duel.SelectMatchingCard(tp,Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if dg:GetCount()>0 then
Duel.ChangePosition(dg,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
end
end
end
--
function s.filter(c,e,tp)
return c:IsSetCard(0x52a3) and ((c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable() and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 ) or (c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0))
return c:IsSetCard(0x52a3) and (c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable() and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 ) or (c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0)
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
......
......@@ -75,19 +75,39 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function s.filter2(c)
return c:IsFaceup() and c:IsAbleToDeck()
end
function s.retg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
function s.retg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and aux.NegateAnyFilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(Card.NegateAnyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local ct=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local tg=Duel.SelectTarget(tp,Card.NegateAnyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,tg,1,0,0)
end
function s.reop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,s.filter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,aux.ExceptThisCard(e))
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsCanBeDisabledByEffect(e,false) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
end
end
\ No newline at end of file
......@@ -3,7 +3,7 @@ function c50225005.initial_effect(c)
aux.EnablePendulumAttribute(c,false)
c:EnableReviveLimit()
aux.AddFusionProcCode3(c,50218101,50218102,50218103,true,true)
aux.AddContactFusionProcedure(c,Card.IsAbleToRemoveAsCost,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,aux.ContactFusionSendToDeck(c))
aux.AddContactFusionProcedure(c,Card.IsAbleToRemoveAsCost,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,Duel.Remove,POS_FACEUP,REASON_COST+REASON_MATERIAL)
--spsummon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -3,7 +3,7 @@ function c50225010.initial_effect(c)
aux.EnablePendulumAttribute(c,false)
c:EnableReviveLimit()
aux.AddFusionProcCode3(c,50218104,50218105,50218106,true,true)
aux.AddContactFusionProcedure(c,Card.IsAbleToRemoveAsCost,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,aux.ContactFusionSendToDeck(c))
aux.AddContactFusionProcedure(c,Card.IsAbleToRemoveAsCost,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,Duel.Remove,POS_FACEUP,REASON_COST+REASON_MATERIAL)
--spsummon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -19,7 +19,7 @@ function s.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FLIP)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(s.thtg)
......
......@@ -18,7 +18,7 @@ function s.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FLIP)
e2:SetCode(EVENT_FLIP)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
......
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