Commit aac6a59b authored by Huangnan's avatar Huangnan

fix

parent 409af086
Pipeline #39865 failed with stages
in 34 seconds
...@@ -34,16 +34,15 @@ function c33700028.spfilter(c,e,tp) ...@@ -34,16 +34,15 @@ function c33700028.spfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsType(TYPE_MONSTER) and c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c33700028.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c33700028.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and c53389254.spfilter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_REMOVED) and c33700028.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetMZoneCount(tp)>0 if chk==0 then return true end
and Duel.IsExistingTarget(c33700028.spfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c33700028.spfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,c33700028.spfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end end
function c33700028.spop(e,tp,eg,ep,ev,re,r,rp) function c33700028.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end end
end end
...@@ -57,9 +56,12 @@ function c33700028.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -57,9 +56,12 @@ function c33700028.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1,true) c:RegisterEffect(e1,true)
end end
function c33700028.tdfilter(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function c33700028.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c33700028.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and chkc:IsAbleToDeck() end if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c33700028.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToDeck,tp,LOCATION_REMOVED,0,1,nil) end if chk==0 then return Duel.IsExistingTarget(c33700028.tdfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,LOCATION_REMOVED,0,1,1,nil) local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
......
--向空挥拳! --向空挥拳!
function c33703032.initial_effect(c) function c33703032.initial_effect(c)
--这张卡在自己场上有且仅有1只怪兽存在的场合可以从手卡发动。 --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCategory(CATEGORY_DISABLE+CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e1:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e1:SetCondition(c33703032.handcon)
c:RegisterEffect(e1)
--自己场上只有这张卡和1只怪兽的场合才能发动。自己场上的怪兽的攻击力·守备力变成5000。自己没有手卡的场合,自己场上的怪兽直到下个对方的结束阶段时不受效果影响。是自己回合的场合,这个回合结束。
local e2=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c33703032.condition)
e1:SetTarget(c33703032.target) e1:SetTarget(c33703032.target)
e1:SetOperation(c33703032.activate) e1:SetOperation(c33703032.activate)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(c33703032.handcon)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end
--这张卡在自己场上有且仅有1只怪兽存在的场合可以从手卡发动。
function c33703032.handcon(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_MZONE,0)==1 and Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_ONFIELD,0)==1
end end
function c33703032.condition(e,tp,eg,ep,ev,re,r,rp) function c33703032.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_ONFIELD,0)==2 and Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_MZONE,0)==1 and Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_SZONE,0)==1 if not (Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==1
and not Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,0,2,e:GetHandler())) then return false end
for i=1,ev do
if Duel.IsChainDisablable(i) then return true end
end
return false
end end
--自己场上只有这张卡和1只怪兽的场合才能发动。自己场上的怪兽的攻击力·守备力变成5000。
function c33703032.target(e,tp,eg,ep,ev,re,r,rp,chk) function c33703032.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local dg=Group.CreateGroup()
for i=1,ev do for i=1,ev do
Duel.NegateActivation(i) local te=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT)
if Duel.IsChainNegatable(i) then dg:AddCard(te:GetHandler()) end
end end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup(),tp,LOCATION_MZONE,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_DISABLE,dg,dg:GetCount(),0,0)
end end
function c33703032.activate(e,tp,eg,ep,ev,re,r,rp) function c33703032.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsFaceup(),tp,LOCATION_MZONE,0,nil) for i=1,ev do Duel.NegateEffect(i) end
local tc=g:GetFirst() local sg=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
while tc do for sc in aux.Next(sg) do
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK) e1:SetCode(EFFECT_SET_BASE_ATTACK_FINAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(5000) e1:SetValue(5000)
tc:RegisterEffect(e1) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
local e2=Effect.CreateEffect(c) sc:RegisterEffect(e1)
e2:SetType(EFFECT_TYPE_SINGLE) local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE) e2:SetCode(EFFECT_SET_BASE_DEFENSE_FINAL)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) sc:RegisterEffect(e2)
e2:SetReset(RESET_EVENT+RESETS_STANDARD) end
e2:SetValue(5000) if Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0 then
tc:RegisterEffect(e2) local tg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,0,nil)
--自己没有手卡的场合,自己场上的怪兽直到下个对方的结束阶段时不受效果影响。 for tc in aux.Next(tg) do
if Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0 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_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_IMMUNE_EFFECT) e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e3:SetValue(c33703032.efilter)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN) e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
e3:SetValue(c33703032.value)
tc:RegisterEffect(e3) tc:RegisterEffect(e3)
end end
tc=g:GetNext()
end end
--是自己回合的场合,这个回合结束。 if Duel.GetTurnPlayer()==tp then
if Duel.GetTurnPlayer()==1-tp then Duel.SkipPhase(tp,PHASE_DRAW,RESET_PHASE+PHASE_END,1)
local e1=Effect.CreateEffect(e:GetHandler()) Duel.SkipPhase(tp,PHASE_STANDBY,RESET_PHASE+PHASE_END,1)
e1:SetType(EFFECT_TYPE_FIELD) Duel.SkipPhase(tp,PHASE_MAIN1,RESET_PHASE+PHASE_END,1)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) Duel.SkipPhase(tp,PHASE_BATTLE,RESET_PHASE+PHASE_END,1,1)
e1:SetTargetRange(1,0) Duel.SkipPhase(tp,PHASE_MAIN2,RESET_PHASE+PHASE_END,1)
e1:SetCode(EFFECT_SKIP_TURN) local e4=Effect.CreateEffect(c)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,2) e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
Duel.RegisterEffect(e1,tp) e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_BP)
e4:SetTargetRange(1,0)
e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,tp)
end end
end end
function c33703032.value(e,te) function c33703032.efilter(e,re)
return te:GetOwner()~=e:GetOwner() return e:GetHandler()~=re:GetOwner()
end end
\ No newline at end of file function c33703032.handcon(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_MZONE,0)==1
and not Duel.IsExistingMatchingCard(aux.TRUE,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,2,nil)
end
...@@ -88,7 +88,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp) ...@@ -88,7 +88,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
local tc=c:GetEquipTarget() local tc=c:GetEquipTarget()
if xg:GetCount()>0 then if xg:GetCount()>0 then
local code=xg:GetFirst():GetOriginalCode() local code=xg:GetFirst():GetOriginalCode()
tc:ReplaceEffect(code,0) tc:ReplaceEffect(code,RESET_EVENT+RESETS_STANDARD)
end end
--change setcard --change setcard
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
...@@ -98,6 +98,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp) ...@@ -98,6 +98,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetRange(LOCATION_MZONE) e0:SetRange(LOCATION_MZONE)
e0:SetValue(0x442) e0:SetValue(0x442)
e0:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e0,true) tc:RegisterEffect(e0,true)
end end
end end
......
...@@ -47,6 +47,42 @@ function s.initial_effect(c) ...@@ -47,6 +47,42 @@ function s.initial_effect(c)
e2:SetValue(s.repval) e2:SetValue(s.repval)
e2:SetOperation(s.repop) e2:SetOperation(s.repop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(id)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(1,0)
c:RegisterEffect(e3)
if not s.global_check then
s.global_check=true
local _DiscardDeck = Duel.DiscardDeck
function Duel.DiscardDeck(p,v,r)
local g=Duel.GetDecktopGroup(p,v)
local eset={Duel.IsPlayerAffectedByEffect(p,id)}
for _,e in ipairs(eset) do
if s.reptg(e,p,g,p,0,self_reference_effect,r,p,0) then
local eg=g:Filter(s.repfilter,nil)
if #eg>0 then
Duel.ConfirmCards(p,eg)
end
local rg=s.reptg(e,p,g,p,0,self_reference_effect,r,p,id)
if aux.GetValueType(rg)=="Group" then
g:Sub(rg)
if #g>0 then
s.donotapply=true
local ct=Duel.SendtoGrave(g,r,self_reference_tp)
s.donotapply=false
Duel.Draw(p,1,REASON_EFFECT)
return ct
end
end
end
end
return _DiscardDeck(p,v,r)
end
end
if not s.MergedDelayedEventInfotable then if not s.MergedDelayedEventInfotable then
s.MergedDelayedEventInfotable={} s.MergedDelayedEventInfotable={}
local ge1=Effect.GlobalEffect() local ge1=Effect.GlobalEffect()
...@@ -57,6 +93,8 @@ function s.initial_effect(c) ...@@ -57,6 +93,8 @@ function s.initial_effect(c)
Duel.RegisterEffect(ge1,0) Duel.RegisterEffect(ge1,0)
end end
end end
s.donotapply=false
function s.resetop() function s.resetop()
aux.ClearTableRecursive(s.MergedDelayedEventInfotable) aux.ClearTableRecursive(s.MergedDelayedEventInfotable)
end end
...@@ -100,28 +138,42 @@ end ...@@ -100,28 +138,42 @@ end
--E2 --E2
function s.repfilter(c) function s.repfilter(c)
return not c:IsLocation(LOCATION_SZONE|LOCATION_DECK) and c:GetDestination()==LOCATION_GRAVE and (c:IsMonster() or c:IsLocation(LOCATION_MZONE)) local deckchk=c:IsLocation(LOCATION_DECK)
and c:IsSetCard(ARCHE_BRAND_810) and c:IsAbleToDeck() local dest=c:GetDestination()
and (not c:IsOnField() or c:IsFaceup()) return not c:IsLocation(LOCATION_SZONE) and (dest==LOCATION_GRAVE or (deckchk and c:DestinationRedirect(LOCATION_GRAVE)==0)) and c:IsFaceupEx() and (c:IsMonster() or c:IsLocation(LOCATION_MZONE))
and c:IsSetCard(ARCHE_BRAND_810)
and (c:IsAbleToDeck() or deckchk)
end end
function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return r&(REASON_BATTLE|REASON_EFFECT)>0 and eg:IsExists(s.repfilter,1,nil) and Duel.IsPlayerCanDraw(tp,1) end if chk==0 then return not s.donotapply and r&(REASON_BATTLE|REASON_EFFECT)>0 and eg:IsExists(s.repfilter,1,nil) and Duel.IsPlayerCanDraw(tp,1) end
if Duel.SelectEffectYesNo(tp,e:GetHandler()) then if Duel.SelectEffectYesNo(tp,e:GetHandler()) then
Duel.Hint(HINT_CARD,tp,id)
local c=e:GetHandler() local c=e:GetHandler()
local g=eg:Filter(s.repfilter,nil) local g=eg:Filter(s.repfilter,nil)
local ct=#g local ct=#g
local fid=e:GetFieldID() local fid=e:GetFieldID()
e:SetLabel(fid) e:SetLabel(fid)
if ct>1 then if ct>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
g=g:Select(tp,1,ct,nil) g=g:Select(tp,1,ct,nil)
end end
for tc in aux.Next(g) do if chk~=id then
tc:RegisterFlagEffect(FLAG_REDIRECTED,0,0,1,fid) for tc in aux.Next(g) do
tc:RegisterFlagEffect(FLAG_REDIRECTED,0,0,1,fid)
end
end end
local seq=#g==1 and SEQ_DECKBOTTOM or SEQ_DECKTOP local seq=#g==1 and SEQ_DECKBOTTOM or SEQ_DECKTOP
if Duel.SendtoDeck(g,nil,seq,REASON_EFFECT)>0 then local dg=g:Filter(Card.IsLocation,nil,LOCATION_DECK)
if #dg>0 then
Duel.ConfirmCards(1-tp,dg)
end
local tg=g:Filter(aux.TRUE,dg)
Duel.HintSelection(tg)
local ct=Duel.SendtoDeck(tg,nil,seq,REASON_EFFECT)
if ct>0 or #dg>0 then
local rg=Duel.GetGroupOperatedByThisEffect(e):Filter(Card.IsLocation,nil,LOCATION_DECK) local rg=Duel.GetGroupOperatedByThisEffect(e):Filter(Card.IsLocation,nil,LOCATION_DECK)
local check=#rg==0
rg:Merge(dg)
if #rg>1 then if #rg>1 then
local og=rg:Filter(Card.IsLocation,nil,LOCATION_DECK) local og=rg:Filter(Card.IsLocation,nil,LOCATION_DECK)
local ct1=og:FilterCount(Card.IsControler,nil,tp) local ct1=og:FilterCount(Card.IsControler,nil,tp)
...@@ -144,11 +196,20 @@ function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -144,11 +196,20 @@ function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.MoveSequence(tc,SEQ_DECKBOTTOM) Duel.MoveSequence(tc,SEQ_DECKBOTTOM)
end end
end end
elseif check then
local tc=rg:GetFirst()
Duel.MoveSequence(tc,SEQ_DECKBOTTOM)
end
if chk==id then
return rg
else
Duel.Draw(tp,1,REASON_EFFECT)
end end
Duel.Draw(tp,1,REASON_EFFECT)
end end
return true return true
else return false end else
return false
end
end end
function s.repval(e,c) function s.repval(e,c)
return c:HasFlagEffectLabel(FLAG_REDIRECTED,e:GetLabel()) return c:HasFlagEffectLabel(FLAG_REDIRECTED,e:GetLabel())
......
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