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)
return c:IsType(TYPE_MONSTER) and c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
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 chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingTarget(c33700028.spfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil,e,tp) end
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and c33700028.spfilter(chkc,e,tp) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
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)
end
function c33700028.spop(e,tp,eg,ep,ev,re,r,rp)
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)
end
end
......@@ -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)
c:RegisterEffect(e1,true)
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)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and chkc:IsAbleToDeck() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToDeck,tp,LOCATION_REMOVED,0,1,nil) 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(c33700028.tdfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
......
--向空挥拳!
function c33703032.initial_effect(c)
--这张卡在自己场上有且仅有1只怪兽存在的场合可以从手卡发动。
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
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:SetCategory(CATEGORY_DISABLE+CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c33703032.condition)
e1:SetTarget(c33703032.target)
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)
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
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
--自己场上只有这张卡和1只怪兽的场合才能发动。自己场上的怪兽的攻击力·守备力变成5000。
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
Duel.NegateActivation(i)
local te=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT)
if Duel.IsChainNegatable(i) then dg:AddCard(te:GetHandler()) 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
function c33703032.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsFaceup(),tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
for i=1,ev do Duel.NegateEffect(i) end
local sg=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
for sc in aux.Next(sg) do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetCode(EFFECT_SET_BASE_ATTACK_FINAL)
e1:SetValue(5000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_DEFENSE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(5000)
tc:RegisterEffect(e2)
--自己没有手卡的场合,自己场上的怪兽直到下个对方的结束阶段时不受效果影响。
if Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0 then
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_BASE_DEFENSE_FINAL)
sc:RegisterEffect(e2)
end
if Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0 then
local tg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,0,nil)
for tc in aux.Next(tg) do
local e3=Effect.CreateEffect(c)
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:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e3:SetValue(c33703032.efilter)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
e3:SetValue(c33703032.value)
tc:RegisterEffect(e3)
end
tc=g:GetNext()
end
--是自己回合的场合,这个回合结束。
if Duel.GetTurnPlayer()==1-tp then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetCode(EFFECT_SKIP_TURN)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,2)
Duel.RegisterEffect(e1,tp)
if Duel.GetTurnPlayer()==tp then
Duel.SkipPhase(tp,PHASE_DRAW,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(tp,PHASE_STANDBY,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(tp,PHASE_MAIN1,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(tp,PHASE_BATTLE,RESET_PHASE+PHASE_END,1,1)
Duel.SkipPhase(tp,PHASE_MAIN2,RESET_PHASE+PHASE_END,1)
local e4=Effect.CreateEffect(c)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
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
function c33703032.value(e,te)
return te:GetOwner()~=e:GetOwner()
end
\ No newline at end of file
function c33703032.efilter(e,re)
return e:GetHandler()~=re:GetOwner()
end
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)
local tc=c:GetEquipTarget()
if xg:GetCount()>0 then
local code=xg:GetFirst():GetOriginalCode()
tc:ReplaceEffect(code,0)
tc:ReplaceEffect(code,RESET_EVENT+RESETS_STANDARD)
end
--change setcard
local e0=Effect.CreateEffect(c)
......@@ -98,6 +98,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetRange(LOCATION_MZONE)
e0:SetValue(0x442)
e0:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e0,true)
end
end
......
......@@ -47,6 +47,42 @@ function s.initial_effect(c)
e2:SetValue(s.repval)
e2:SetOperation(s.repop)
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
s.MergedDelayedEventInfotable={}
local ge1=Effect.GlobalEffect()
......@@ -57,6 +93,8 @@ function s.initial_effect(c)
Duel.RegisterEffect(ge1,0)
end
end
s.donotapply=false
function s.resetop()
aux.ClearTableRecursive(s.MergedDelayedEventInfotable)
end
......@@ -100,28 +138,42 @@ end
--E2
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))
and c:IsSetCard(ARCHE_BRAND_810) and c:IsAbleToDeck()
and (not c:IsOnField() or c:IsFaceup())
local deckchk=c:IsLocation(LOCATION_DECK)
local dest=c:GetDestination()
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
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
Duel.Hint(HINT_CARD,tp,id)
local c=e:GetHandler()
local g=eg:Filter(s.repfilter,nil)
local ct=#g
local fid=e:GetFieldID()
e:SetLabel(fid)
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)
end
for tc in aux.Next(g) do
tc:RegisterFlagEffect(FLAG_REDIRECTED,0,0,1,fid)
if chk~=id then
for tc in aux.Next(g) do
tc:RegisterFlagEffect(FLAG_REDIRECTED,0,0,1,fid)
end
end
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 check=#rg==0
rg:Merge(dg)
if #rg>1 then
local og=rg:Filter(Card.IsLocation,nil,LOCATION_DECK)
local ct1=og:FilterCount(Card.IsControler,nil,tp)
......@@ -144,11 +196,20 @@ function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.MoveSequence(tc,SEQ_DECKBOTTOM)
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
Duel.Draw(tp,1,REASON_EFFECT)
end
return true
else return false end
else
return false
end
end
function s.repval(e,c)
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