Commit f316ebf0 authored by Huangnan's avatar Huangnan

fix

parent 54dd4f9f
Pipeline #40864 failed with stages
in 8 minutes and 3 seconds
...@@ -19,7 +19,7 @@ function s.initial_effect(c) ...@@ -19,7 +19,7 @@ function s.initial_effect(c)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id+20000) e1:SetCountLimit(1)
e1:SetTarget(s.tg1) e1:SetTarget(s.tg1)
e1:SetOperation(s.op1) e1:SetOperation(s.op1)
c:RegisterEffect(e1) c:RegisterEffect(e1)
......
...@@ -21,6 +21,7 @@ function s.initial_effect(c) ...@@ -21,6 +21,7 @@ function s.initial_effect(c)
e4:SetType(EFFECT_TYPE_IGNITION) e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetRange(LOCATION_GRAVE) e4:SetRange(LOCATION_GRAVE)
e4:SetCountLimit(1,id+10000)
e4:SetCondition(s.poscon) e4:SetCondition(s.poscon)
e4:SetCost(aux.bfgcost) e4:SetCost(aux.bfgcost)
e4:SetTarget(s.postg) e4:SetTarget(s.postg)
......
...@@ -67,9 +67,8 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -67,9 +67,8 @@ function s.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.HintSelection(cg) Duel.HintSelection(cg)
Duel.ChangePosition(cg:GetFirst(),POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK) Duel.ChangePosition(cg:GetFirst(),POS_FACEUP_DEFENSE,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
end end
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
local dam=Duel.GetMatchingGroupCount(Card.IsFacedown,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)*100 Duel.Damage(p,d,REASON_EFFECT)
Duel.Damage(p,dam,REASON_EFFECT)
if Duel.IsPlayerCanDraw(tp,1) if Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,nil) and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,nil)
......
...@@ -72,7 +72,7 @@ function s.spfilter(c,e,tp) ...@@ -72,7 +72,7 @@ function s.spfilter(c,e,tp)
end end
function s.rmop(e,tp,eg,ep,ev,re,r,rp) function s.rmop(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)
if Duel.Draw(p,d,REASON_EFFECT)~=0 then if Duel.Draw(p,d,REASON_EFFECT)~=0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
......
...@@ -46,7 +46,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -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) 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 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) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local dg=Duel.SelectMatchingCard(tp,Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) local dg=Duel.SelectMatchingCard(tp,Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,c)
if dg:GetCount()>0 then if dg:GetCount()>0 then
Duel.ChangePosition(dg,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK) Duel.ChangePosition(dg,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
end end
...@@ -60,55 +60,88 @@ function s.desfilter(c) ...@@ -60,55 +60,88 @@ function s.desfilter(c)
return not c:IsLocation(LOCATION_SZONE) or c:GetSequence()<5 return not c:IsLocation(LOCATION_SZONE) or c:GetSequence()<5
end end
function s.seqfilter(c,seq,tp) 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 cseq=c:GetSequence()
local cloc=c:GetLocation() local cloc=c:GetLocation()
if cloc&LOCATION_SZONE~=0 and cseq>=5 then return false end if cloc==LOCATION_SZONE and cseq>=5 then return false end
if cloc&LOCATION_MZONE~=0 and cseq>=5 then if cloc==LOCATION_MZONE and cseq>=5 and loc==LOCATION_MZONE
if c:IsControler(tp) then and (seq==1 and cseq==5 or seq==3 and cseq==6) then return true end
return seq==1 and cseq==6 or seq==3 and cseq==5 return cseq==seq and cloc~=loc or cloc==loc and math.abs(cseq-seq)==1
else end
return seq==1 and cseq==5 or seq==3 and cseq==6 function s.desfilter2(c)
end return not c:IsLocation(LOCATION_SZONE) or c:GetSequence()<5
end end
if c:IsControler(tp) then function s.exmzfilter2(c,seq)
return false 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
end end
if cloc&LOCATION_MZONE~=0 then if seq>=5 and loc==LOCATION_SZONE then return false end
return cseq==seq or seq<5 and cseq<5 and math.abs(cseq-seq)==1 if seq==7 and loc==LOCATION_MZONE then return false end
else local cseq=c:GetSequence()
return cseq==seq 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
end end
return false return cseq==seq and cloc~=loc or seq<5 and cseq<5 and cloc==loc and math.abs(cseq-seq)==1
end end
function s.seqtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.seqtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.desfilter,tp,LOCATION_MZONE,LOCATION_ONFIELD,1,nil) end 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,1-tp,LOCATION_ONFIELD) Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,0,LOCATION_ONFIELD)
end end
function s.seqop(e,tp,eg,ep,ev,re,r,rp) function s.seqop(e,tp,eg,ep,ev,re,r,rp)
local filter=0 if Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
for i=0,6 do local filter=0
if not Duel.IsExistingMatchingCard(s.seqfilter,tp,LOCATION_MZONE,LOCATION_ONFIELD,1,nil,i,tp) then for i=0,6 do
filter=filter|1<<(i+16) if not Duel.IsExistingMatchingCard(s.seqfilter,tp,0,LOCATION_ONFIELD,1,nil,i,tp) then
filter=filter|1<<(i+16)
end
end end
end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local flag=Duel.SelectField(tp,1,0,LOCATION_ONFIELD,filter)
local flag=Duel.SelectField(tp,1,LOCATION_ONFIELD,LOCATION_ONFIELD,filter) Duel.Hint(HINT_ZONE,tp,flag)
Duel.Hint(HINT_ZONE,tp,flag) local seq=math.log(flag>>16,2)
local seq=math.log(flag>>16,2) local g=Duel.GetMatchingGroup(s.seqfilter,tp,0,LOCATION_ONFIELD,nil,seq,tp)
local g=Duel.GetMatchingGroup(s.seqfilter,tp,LOCATION_MZONE,LOCATION_ONFIELD,nil,seq,tp) Duel.Destroy(g,REASON_EFFECT)
Duel.Destroy(g,REASON_EFFECT) else
if Duel.IsExistingMatchingCard(Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then local filter=0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) for i=0,15 do
local dg=Duel.SelectMatchingCard(tp,Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) if not Duel.IsExistingMatchingCard(s.seqfilter2,tp,LOCATION_ONFIELD,0,1,nil,i,tp) then
if dg:GetCount()>0 then filter=filter|1<<(i)
Duel.ChangePosition(dg,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK) end
end 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 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
end
end end
-- --
function s.filter(c,e,tp) 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 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.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
......
...@@ -66,7 +66,7 @@ function s.seqop(e,tp,eg,ep,ev,re,r,rp) ...@@ -66,7 +66,7 @@ function s.seqop(e,tp,eg,ep,ev,re,r,rp)
if dg:GetCount()>0 then if dg:GetCount()>0 then
local tc=dg:GetFirst() local tc=dg:GetFirst()
if tc:IsFaceup() then if tc:IsFaceup() then
Duel.ChangePosition(dg,POS_FACEUP_DEFENSE) Duel.ChangePosition(dg,POS_FACEDOWN_DEFENSE)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION) e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
......
...@@ -4,6 +4,7 @@ local m,cm=rk.set(16114216,nil,1) ...@@ -4,6 +4,7 @@ local m,cm=rk.set(16114216,nil,1)
function cm.initial_effect(c) function cm.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
......
...@@ -68,15 +68,15 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -68,15 +68,15 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function Card.RegisterEffect(rc,te,...) function Card.RegisterEffect(rc,te,...)
if (te:GetRange()&LOCATION_ONFIELD>0 or te:GetCode()==EVENT_SUMMON_SUCCESS or te:GetCode()==EVENT_SPSUMMON_SUCCESS or te:IsHasType(EFFECT_TYPE_ACTIVATE)) and te:GetOperation() then if (te:GetRange()&LOCATION_ONFIELD>0 or te:GetCode()==EVENT_SUMMON_SUCCESS or te:GetCode()==EVENT_SPSUMMON_SUCCESS or te:IsHasType(EFFECT_TYPE_ACTIVATE)) and te:GetOperation()~=nil then
local cost=te:GetCost() local cost=te:GetCost()
local target=te:GetTarget() local target=te:GetTarget()
local operation=te:GetOperation() local operation=te:GetOperation()
if (not target or target(de,tp,eg,ep,ev,re,r,rp,0)) and (#catcheffect == 0 or #catcheffect[rc:GetOriginalCodeRule()] == 0 or not cm.is_include(te:GetDescription(),catcheffect[rc:GetOriginalCodeRule()])) then if (not target or target(de,tp,eg,ep,ev,re,r,rp,0)) and (#catcheffect == 0 or #catcheffect[rc:GetOriginalCodeRule()] == 0 or not cm.is_include(te:GetDescription(),catcheffect[rc:GetOriginalCodeRule()])) then
if #afilter == 0 then if #afilter == 0 then
afilter = {rc:GetOriginalCodeRule(),OPCODE_ISCODE} afilter = {rc:GetOriginalCodeRule(),OPCODE_ISCODE}
else else
table.insert(afilter,te:GetHandler():GetOriginalCodeRule()) table.insert(afilter,rc:GetOriginalCodeRule())
table.insert(afilter,OPCODE_ISCODE) table.insert(afilter,OPCODE_ISCODE)
table.insert(afilter,OPCODE_OR) table.insert(afilter,OPCODE_OR)
end end
...@@ -93,7 +93,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -93,7 +93,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local code=tc:GetOriginalCode() local code=tc:GetOriginalCode()
Duel.CreateToken(tp,code) Duel.CreateToken(tp,code)
end end
if flag_catch and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then if flag_catch and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE)
local ac=Duel.AnnounceCard(tp,table.unpack(afilter)) local ac=Duel.AnnounceCard(tp,table.unpack(afilter))
......
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