Commit 36dced4b authored by Tachibana's avatar Tachibana

eme

parent 770d9763
Pipeline #8409 passed with stages
in 29 minutes and 48 seconds
...@@ -71,6 +71,9 @@ function c33200501.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -71,6 +71,9 @@ function c33200501.thop(e,tp,eg,ep,ev,re,r,rp)
end end
--e3 --e3
function c33200501.exfilter(c)
return not c:IsPublic()
end
function c33200501.coffilter(c) function c33200501.coffilter(c)
return c:GetFlagEffect(33200507)>0 and not c:IsDisabled() return c:GetFlagEffect(33200507)>0 and not c:IsDisabled()
end end
...@@ -79,10 +82,10 @@ function c33200501.rmfilter(c,opt) ...@@ -79,10 +82,10 @@ function c33200501.rmfilter(c,opt)
end end
function c33200501.tztg(e,tp,eg,ep,ev,re,r,rp,chk) function c33200501.tztg(e,tp,eg,ep,ev,re,r,rp,chk)
local tm=Duel.GetFlagEffect(tp,33200503) local tm=Duel.GetFlagEffect(tp,33200503)
if chk==0 then return Duel.GetFlagEffect(tp,e:GetHandler():GetCode())<tm+1 and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end if chk==0 then return Duel.GetFlagEffect(tp,e:GetHandler():GetOriginalCode())<tm+1 and Duel.IsExistingMatchingCard(c33200501.exfilter,tp,0,LOCATION_HAND,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE)
e:SetLabel(Duel.AnnounceType(tp)) e:SetLabel(Duel.AnnounceType(tp))
Duel.RegisterFlagEffect(tp,e:GetHandler():GetCode(),RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,e:GetHandler():GetOriginalCode(),RESET_PHASE+PHASE_END,0,1)
e:GetHandler():RegisterFlagEffect(33200500,RESET_EVENT+RESET_CHAIN,0,1) e:GetHandler():RegisterFlagEffect(33200500,RESET_EVENT+RESET_CHAIN,0,1)
end end
function c33200501.tzop(e,tp,eg,ep,ev,re,r,rp) function c33200501.tzop(e,tp,eg,ep,ev,re,r,rp)
...@@ -90,18 +93,22 @@ function c33200501.tzop(e,tp,eg,ep,ev,re,r,rp) ...@@ -90,18 +93,22 @@ function c33200501.tzop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND,nil) local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND,nil)
if g:GetCount()==0 then return end if g:GetCount()==0 then return end
if not Duel.IsPlayerAffectedByEffect(tp,33200505) then if not Duel.IsPlayerAffectedByEffect(tp,33200505) then
local sg=g:RandomSelect(1-tp,1) local sg=g:Filter(c33200501.exfilter,nil):RandomSelect(1-tp,1)
local sgc=sg:GetFirst() local sgc=sg:GetFirst()
Duel.ConfirmCards(tp,sgc) Duel.ConfirmCards(tp,sgc)
Duel.ShuffleHand(1-tp) Duel.ShuffleHand(1-tp)
local opt=e:GetLabel() local opt=e:GetLabel()
if (opt==0 and sgc:IsType(TYPE_MONSTER)) or (opt==1 and sgc:IsType(TYPE_SPELL)) or (opt==2 and sgc:IsType(TYPE_TRAP)) then if (opt==0 and sgc:IsType(TYPE_MONSTER)) or (opt==1 and sgc:IsType(TYPE_SPELL)) or (opt==2 and sgc:IsType(TYPE_TRAP)) then
local dtm=Duel.GetFlagEffect(tp,33200506) local dtm=Duel.GetFlagEffect(tp,33200506)
local cof=Duel.GetMatchingGroupCount(c33200501.coffilter,tp,LOCATION_ONFIELD,0,1,nil) local co=Duel.GetMatchingGroup(c33200501.coffilter,tp,LOCATION_ONFIELD,0,1,nil)
local cof=co:GetCount()
if dtm>cof then dtm=cof end if dtm>cof then dtm=cof end
if Duel.Damage(1-tp,800,REASON_EFFECT) and dtm>=1 then if Duel.Damage(1-tp,800,REASON_EFFECT) and dtm>=1 then
Duel.Hint(HINT_CARD,tp,33200506) Duel.Hint(HINT_CARD,tp,33200506)
Duel.Draw(tp,dtm,REASON_EFFECT) Duel.Draw(tp,dtm,REASON_EFFECT)
for drc in aux.Next(co) do
drc:RegisterFlagEffect(33200508,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end end
if Duel.IsExistingMatchingCard(c33200501.rmfilter,tp,0,LOCATION_ONFIELD,1,nil,opt) and Duel.SelectYesNo(tp,aux.Stringid(33200501,2)) then if Duel.IsExistingMatchingCard(c33200501.rmfilter,tp,0,LOCATION_ONFIELD,1,nil,opt) and Duel.SelectYesNo(tp,aux.Stringid(33200501,2)) then
local rmg=Duel.SelectMatchingCard(tp,c33200501.rmfilter,tp,0,LOCATION_ONFIELD,1,1,nil,opt) local rmg=Duel.SelectMatchingCard(tp,c33200501.rmfilter,tp,0,LOCATION_ONFIELD,1,1,nil,opt)
...@@ -111,17 +118,21 @@ function c33200501.tzop(e,tp,eg,ep,ev,re,r,rp) ...@@ -111,17 +118,21 @@ function c33200501.tzop(e,tp,eg,ep,ev,re,r,rp)
end end
else else
Duel.ConfirmCards(tp,g) Duel.ConfirmCards(tp,g)
local sg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_HAND,1,1,nil) local sg=Duel.SelectMatchingCard(tp,c33200501.exfilter,tp,0,LOCATION_HAND,1,1,nil)
local sgc=sg:GetFirst() local sgc=sg:GetFirst()
Duel.ShuffleHand(1-tp) Duel.ShuffleHand(1-tp)
local opt=e:GetLabel() local opt=e:GetLabel()
if (opt==0 and sgc:IsType(TYPE_MONSTER)) or (opt==1 and sgc:IsType(TYPE_SPELL)) or (opt==2 and sgc:IsType(TYPE_TRAP)) then if (opt==0 and sgc:IsType(TYPE_MONSTER)) or (opt==1 and sgc:IsType(TYPE_SPELL)) or (opt==2 and sgc:IsType(TYPE_TRAP)) then
local dtm=Duel.GetFlagEffect(tp,33200506) local dtm=Duel.GetFlagEffect(tp,33200506)
local cof=Duel.GetMatchingGroupCount(c33200501.coffilter,tp,LOCATION_ONFIELD,0,1,nil) local co=Duel.GetMatchingGroup(c33200501.coffilter,tp,LOCATION_ONFIELD,0,1,nil)
local cof=co:GetCount()
if dtm>cof then dtm=cof end if dtm>cof then dtm=cof end
if Duel.Damage(1-tp,800,REASON_EFFECT) and dtm>=1 then if Duel.Damage(1-tp,800,REASON_EFFECT) and dtm>=1 then
Duel.Hint(HINT_CARD,tp,33200506) Duel.Hint(HINT_CARD,tp,33200506)
Duel.Draw(tp,dtm,REASON_EFFECT) Duel.Draw(tp,dtm,REASON_EFFECT)
for drc in aux.Next(co) do
drc:RegisterFlagEffect(33200508,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end end
if Duel.IsExistingMatchingCard(c33200501.rmfilter,tp,0,LOCATION_ONFIELD,1,nil,opt) and Duel.SelectYesNo(tp,aux.Stringid(33200501,2)) then if Duel.IsExistingMatchingCard(c33200501.rmfilter,tp,0,LOCATION_ONFIELD,1,nil,opt) and Duel.SelectYesNo(tp,aux.Stringid(33200501,2)) then
local rmg=Duel.SelectMatchingCard(tp,c33200501.rmfilter,tp,0,LOCATION_ONFIELD,1,1,nil,opt) local rmg=Duel.SelectMatchingCard(tp,c33200501.rmfilter,tp,0,LOCATION_ONFIELD,1,1,nil,opt)
......
...@@ -55,5 +55,4 @@ end ...@@ -55,5 +55,4 @@ end
function c33200506.regop(e,tp,eg,ep,ev,re,r,rp) function c33200506.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,33200506,RESET_EVENT+RESET_CHAIN,0,1) Duel.RegisterFlagEffect(tp,33200506,RESET_EVENT+RESET_CHAIN,0,1)
e:GetHandler():RegisterFlagEffect(33200507,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1) e:GetHandler():RegisterFlagEffect(33200507,RESET_EVENT+RESETS_STANDARD+RESET_CHAIN,0,1)
e:GetHandler():RegisterFlagEffect(33200508,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end end
\ No newline at end of file
...@@ -25,6 +25,9 @@ function c33200507.initial_effect(c) ...@@ -25,6 +25,9 @@ function c33200507.initial_effect(c)
end end
--e1 --e1
function c33200507.exfilter(c)
return not c:IsPublic()
end
function c33200507.coffilter(c) function c33200507.coffilter(c)
return c:GetFlagEffect(33200507)>0 and not c:IsDisabled() return c:GetFlagEffect(33200507)>0 and not c:IsDisabled()
end end
...@@ -32,7 +35,7 @@ function c33200507.desfilter(c,sgc) ...@@ -32,7 +35,7 @@ function c33200507.desfilter(c,sgc)
return ((c:IsType(TYPE_MONSTER) and sgc:IsType(TYPE_MONSTER)) or (c:IsType(TYPE_SPELL) and sgc:IsType(TYPE_SPELL)) or (c:IsType(TYPE_TRAP) and sgc:IsType(TYPE_TRAP))) and not c:IsPublic() return ((c:IsType(TYPE_MONSTER) and sgc:IsType(TYPE_MONSTER)) or (c:IsType(TYPE_SPELL) and sgc:IsType(TYPE_SPELL)) or (c:IsType(TYPE_TRAP) and sgc:IsType(TYPE_TRAP))) and not c:IsPublic()
end end
function c33200507.tztg(e,tp,eg,ep,ev,re,r,rp,chk) function c33200507.tztg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>0 and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>0 and Duel.IsExistingMatchingCard(c33200507.exfilter,tp,0,LOCATION_HAND,1,nil) end
e:GetHandler():RegisterFlagEffect(33200500,RESET_EVENT+RESET_CHAIN,0,1) e:GetHandler():RegisterFlagEffect(33200500,RESET_EVENT+RESET_CHAIN,0,1)
end end
function c33200507.tzop(e,tp,eg,ep,ev,re,r,rp) function c33200507.tzop(e,tp,eg,ep,ev,re,r,rp)
...@@ -43,17 +46,21 @@ function c33200507.tzop(e,tp,eg,ep,ev,re,r,rp) ...@@ -43,17 +46,21 @@ function c33200507.tzop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmDecktop(1-tp,1) Duel.ConfirmDecktop(1-tp,1)
local dg=Duel.GetDecktopGroup(1-tp,1) local dg=Duel.GetDecktopGroup(1-tp,1)
local dgc=dg:GetFirst() local dgc=dg:GetFirst()
local sg=g:RandomSelect(1-tp,1) local sg=g:Filter(c33200507.exfilter,nil):RandomSelect(1-tp,1)
local sgc=sg:GetFirst() local sgc=sg:GetFirst()
Duel.ConfirmCards(tp,sgc) Duel.ConfirmCards(tp,sgc)
Duel.ShuffleHand(1-tp) Duel.ShuffleHand(1-tp)
if (dgc:IsType(TYPE_MONSTER) and not sgc:IsType(TYPE_MONSTER)) or (dgc:IsType(TYPE_SPELL) and not sgc:IsType(TYPE_SPELL)) or (dgc:IsType(TYPE_TRAP) and not sgc:IsType(TYPE_TRAP)) then if (dgc:IsType(TYPE_MONSTER) and not sgc:IsType(TYPE_MONSTER)) or (dgc:IsType(TYPE_SPELL) and not sgc:IsType(TYPE_SPELL)) or (dgc:IsType(TYPE_TRAP) and not sgc:IsType(TYPE_TRAP)) then
local dtm=Duel.GetFlagEffect(tp,33200506) local dtm=Duel.GetFlagEffect(tp,33200506)
local cof=Duel.GetMatchingGroupCount(c33200507.coffilter,tp,LOCATION_ONFIELD,0,1,nil) local co=Duel.GetMatchingGroup(c33200506.coffilter,tp,LOCATION_ONFIELD,0,1,nil)
local cof=co:GetCount()
if dtm>cof then dtm=cof end if dtm>cof then dtm=cof end
if Duel.Damage(1-tp,800,REASON_EFFECT) and dtm>=1 then if Duel.Damage(1-tp,800,REASON_EFFECT) and dtm>=1 then
Duel.Hint(HINT_CARD,tp,33200506) Duel.Hint(HINT_CARD,tp,33200506)
Duel.Draw(tp,dtm,REASON_EFFECT) Duel.Draw(tp,dtm,REASON_EFFECT)
for drc in aux.Next(co) do
drc:RegisterFlagEffect(33200508,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end end
end end
if Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) if Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil)
...@@ -74,16 +81,20 @@ function c33200507.tzop(e,tp,eg,ep,ev,re,r,rp) ...@@ -74,16 +81,20 @@ function c33200507.tzop(e,tp,eg,ep,ev,re,r,rp)
local dg=Duel.GetDecktopGroup(1-tp,1) local dg=Duel.GetDecktopGroup(1-tp,1)
local dgc=dg:GetFirst() local dgc=dg:GetFirst()
Duel.ConfirmCards(tp,g) Duel.ConfirmCards(tp,g)
local sg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_HAND,1,1,nil) local sg=Duel.SelectMatchingCard(tp,c33200507.exfilter,tp,0,LOCATION_HAND,1,1,nil)
local sgc=sg:GetFirst() local sgc=sg:GetFirst()
Duel.ShuffleHand(1-tp) Duel.ShuffleHand(1-tp)
if (dgc:IsType(TYPE_MONSTER) and not sgc:IsType(TYPE_MONSTER)) or (dgc:IsType(TYPE_SPELL) and not sgc:IsType(TYPE_SPELL)) or (dgc:IsType(TYPE_TRAP) and not sgc:IsType(TYPE_TRAP)) then if (dgc:IsType(TYPE_MONSTER) and not sgc:IsType(TYPE_MONSTER)) or (dgc:IsType(TYPE_SPELL) and not sgc:IsType(TYPE_SPELL)) or (dgc:IsType(TYPE_TRAP) and not sgc:IsType(TYPE_TRAP)) then
local dtm=Duel.GetFlagEffect(tp,33200506) local dtm=Duel.GetFlagEffect(tp,33200506)
local cof=Duel.GetMatchingGroupCount(c33200507.coffilter,tp,LOCATION_ONFIELD,0,1,nil) local co=Duel.GetMatchingGroup(c33200506.coffilter,tp,LOCATION_ONFIELD,0,1,nil)
local cof=co:GetCount()
if dtm>cof then dtm=cof end if dtm>cof then dtm=cof end
if Duel.Damage(1-tp,800,REASON_EFFECT) and dtm>=1 then if Duel.Damage(1-tp,800,REASON_EFFECT) and dtm>=1 then
Duel.Hint(HINT_CARD,tp,33200506) Duel.Hint(HINT_CARD,tp,33200506)
Duel.Draw(tp,dtm,REASON_EFFECT) Duel.Draw(tp,dtm,REASON_EFFECT)
for drc in aux.Next(co) do
drc:RegisterFlagEffect(33200508,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end end
end end
if Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) and Duel.IsExistingMatchingCard(c33200507.desfilter,tp,LOCATION_HAND,0,1,nil,sgc) and Duel.SelectYesNo(tp,aux.Stringid(33200507,0)) then if Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) and Duel.IsExistingMatchingCard(c33200507.desfilter,tp,LOCATION_HAND,0,1,nil,sgc) and Duel.SelectYesNo(tp,aux.Stringid(33200507,0)) then
......
...@@ -38,13 +38,16 @@ function c33200509.spop(e,tp,eg,ep,ev,re,r,rp,c) ...@@ -38,13 +38,16 @@ function c33200509.spop(e,tp,eg,ep,ev,re,r,rp,c)
end end
--e3 --e3
function c33200509.exfilter(c)
return not c:IsPublic()
end
function c33200509.thfilter(c,opt) function c33200509.thfilter(c,opt)
return ((opt==0 and c:IsType(TYPE_MONSTER)) or (opt==1 and c:IsType(TYPE_SPELL)) or (opt==2 and c:IsType(TYPE_TRAP))) and c:IsAbleToHand() and aux.IsCodeListed(c,33200500) return ((opt==0 and c:IsType(TYPE_MONSTER)) or (opt==1 and c:IsType(TYPE_SPELL)) or (opt==2 and c:IsType(TYPE_TRAP))) and c:IsAbleToHand() and aux.IsCodeListed(c,33200500)
end end
function c33200509.tztg(e,tp,eg,ep,ev,re,r,rp,chk) function c33200509.tztg(e,tp,eg,ep,ev,re,r,rp,chk)
local tm=Duel.GetFlagEffect(tp,33200503) local tm=Duel.GetFlagEffect(tp,33200503)
if chk==0 then return Duel.GetFlagEffect(tp,e:GetHandler():GetCode())<tm+1 and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 end if chk==0 then return Duel.GetFlagEffect(tp,e:GetHandler():GetOriginalCode())<tm+1 and Duel.IsExistingMatchingCard(c33200509.exfilter,tp,0,LOCATION_HAND,1,nil) and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 end
Duel.RegisterFlagEffect(tp,e:GetHandler():GetCode(),RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,e:GetHandler():GetOriginalCode(),RESET_PHASE+PHASE_END,0,1)
e:GetHandler():RegisterFlagEffect(33200500,RESET_EVENT+RESET_CHAIN,0,1) e:GetHandler():RegisterFlagEffect(33200500,RESET_EVENT+RESET_CHAIN,0,1)
end end
function c33200509.tzop(e,tp,eg,ep,ev,re,r,rp) function c33200509.tzop(e,tp,eg,ep,ev,re,r,rp)
...@@ -53,7 +56,7 @@ function c33200509.tzop(e,tp,eg,ep,ev,re,r,rp) ...@@ -53,7 +56,7 @@ function c33200509.tzop(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()==0 or Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<=4 then return end if g:GetCount()==0 or Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<=4 then return end
if not Duel.IsPlayerAffectedByEffect(tp,33200505) then if not Duel.IsPlayerAffectedByEffect(tp,33200505) then
Duel.ConfirmDecktop(tp,5) Duel.ConfirmDecktop(tp,5)
local sg=g:RandomSelect(1-tp,1) local sg=g:Filter(c33200509.exfilter,nil):RandomSelect(1-tp,1)
local sgc=sg:GetFirst() local sgc=sg:GetFirst()
Duel.ConfirmCards(tp,sgc) Duel.ConfirmCards(tp,sgc)
local opt=3 local opt=3
...@@ -78,7 +81,7 @@ function c33200509.tzop(e,tp,eg,ep,ev,re,r,rp) ...@@ -78,7 +81,7 @@ function c33200509.tzop(e,tp,eg,ep,ev,re,r,rp)
else else
Duel.ConfirmDecktop(tp,5) Duel.ConfirmDecktop(tp,5)
Duel.ConfirmCards(tp,g) Duel.ConfirmCards(tp,g)
local sg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_HAND,1,1,nil) local sg=Duel.SelectMatchingCard(tp,c33200509.exfilter,tp,0,LOCATION_HAND,1,1,nil)
local sgc=sg:GetFirst() local sgc=sg:GetFirst()
local opt=3 local opt=3
if sgc:IsType(TYPE_MONSTER) then opt=0 end if sgc:IsType(TYPE_MONSTER) then opt=0 end
......
...@@ -72,6 +72,9 @@ function c33200511.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -72,6 +72,9 @@ function c33200511.thop(e,tp,eg,ep,ev,re,r,rp)
end end
--e3 --e3
function c33200511.exfilter(c)
return not c:IsPublic()
end
function c33200511.rmfilter(c,opt) function c33200511.rmfilter(c,opt)
return (opt==0 and c:IsType(TYPE_MONSTER)) or (opt==1 and c:IsType(TYPE_SPELL)) or (opt==2 and c:IsType(TYPE_TRAP)) and c:IsAbleToRemove() and c:IsFaceup() return (opt==0 and c:IsType(TYPE_MONSTER)) or (opt==1 and c:IsType(TYPE_SPELL)) or (opt==2 and c:IsType(TYPE_TRAP)) and c:IsAbleToRemove() and c:IsFaceup()
end end
...@@ -80,8 +83,8 @@ function c33200511.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -80,8 +83,8 @@ function c33200511.condition(e,tp,eg,ep,ev,re,r,rp)
end end
function c33200511.tztg(e,tp,eg,ep,ev,re,r,rp,chk) function c33200511.tztg(e,tp,eg,ep,ev,re,r,rp,chk)
local tm=Duel.GetFlagEffect(tp,33200503) local tm=Duel.GetFlagEffect(tp,33200503)
if chk==0 then return Duel.GetFlagEffect(tp,e:GetHandler():GetCode())<tm+1 and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end if chk==0 then return Duel.GetFlagEffect(tp,e:GetHandler():GetOriginalCode())<tm+1 and uel.IsExistingMatchingCard(c33200511.exfilter,tp,0,LOCATION_HAND,1,nil) end
Duel.RegisterFlagEffect(tp,e:GetHandler():GetCode(),RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,e:GetHandler():GetOriginalCode(),RESET_PHASE+PHASE_END,0,1)
e:GetHandler():RegisterFlagEffect(33200500,RESET_EVENT+RESET_CHAIN,0,1) e:GetHandler():RegisterFlagEffect(33200500,RESET_EVENT+RESET_CHAIN,0,1)
end end
function c33200511.tzop(e,tp,eg,ep,ev,re,r,rp) function c33200511.tzop(e,tp,eg,ep,ev,re,r,rp)
...@@ -93,7 +96,7 @@ function c33200511.tzop(e,tp,eg,ep,ev,re,r,rp) ...@@ -93,7 +96,7 @@ function c33200511.tzop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND,nil) local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND,nil)
if g:GetCount()==0 then return end if g:GetCount()==0 then return end
if not Duel.IsPlayerAffectedByEffect(tp,33200505) then if not Duel.IsPlayerAffectedByEffect(tp,33200505) then
local sg=g:RandomSelect(1-tp,1) local sg=g:Filter(c33200511.exfilter,nil):RandomSelect(1-tp,1)
local sgc=sg:GetFirst() local sgc=sg:GetFirst()
Duel.ConfirmCards(tp,sgc) Duel.ConfirmCards(tp,sgc)
Duel.ShuffleHand(1-tp) Duel.ShuffleHand(1-tp)
...@@ -102,7 +105,7 @@ function c33200511.tzop(e,tp,eg,ep,ev,re,r,rp) ...@@ -102,7 +105,7 @@ function c33200511.tzop(e,tp,eg,ep,ev,re,r,rp)
end end
else else
Duel.ConfirmCards(tp,g) Duel.ConfirmCards(tp,g)
local sg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_HAND,1,1,nil) local sg=Duel.SelectMatchingCard(tp,c33200511.exfilter,tp,0,LOCATION_HAND,1,1,nil)
local sgc=sg:GetFirst() local sgc=sg:GetFirst()
Duel.ShuffleHand(1-tp) Duel.ShuffleHand(1-tp)
if (opt==0 and sgc:IsType(TYPE_MONSTER)) or (opt==1 and sgc:IsType(TYPE_SPELL)) or (opt==2 and sgc:IsType(TYPE_TRAP)) then if (opt==0 and sgc:IsType(TYPE_MONSTER)) or (opt==1 and sgc:IsType(TYPE_SPELL)) or (opt==2 and sgc:IsType(TYPE_TRAP)) then
......
...@@ -86,6 +86,9 @@ function c33200516.smop(e,tp,eg,ep,ev,re,r,rp) ...@@ -86,6 +86,9 @@ function c33200516.smop(e,tp,eg,ep,ev,re,r,rp)
end end
--e3 --e3
function c33200516.exfilter(c)
return not c:IsPublic()
end
function c33200516.coffilter(c) function c33200516.coffilter(c)
return c:GetFlagEffect(33200507)>0 and not c:IsDisabled() return c:GetFlagEffect(33200507)>0 and not c:IsDisabled()
end end
...@@ -94,10 +97,10 @@ function c33200516.rmfilter(c,opt) ...@@ -94,10 +97,10 @@ function c33200516.rmfilter(c,opt)
end end
function c33200516.tztg(e,tp,eg,ep,ev,re,r,rp,chk) function c33200516.tztg(e,tp,eg,ep,ev,re,r,rp,chk)
local tm=Duel.GetFlagEffect(tp,33200503) local tm=Duel.GetFlagEffect(tp,33200503)
if chk==0 then return Duel.GetFlagEffect(tp,e:GetHandler():GetCode())<tm+1 and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end if chk==0 then return Duel.GetFlagEffect(tp,e:GetHandler():GetOriginalCode())<tm+1 and Duel.IsExistingMatchingCard(c33200516.exfilter,tp,0,LOCATION_HAND,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE)
e:SetLabel(Duel.AnnounceType(tp)) e:SetLabel(Duel.AnnounceType(tp))
Duel.RegisterFlagEffect(tp,e:GetHandler():GetCode(),RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,e:GetHandler():GetOriginalCode(),RESET_PHASE+PHASE_END,0,1)
e:GetHandler():RegisterFlagEffect(33200500,RESET_EVENT+RESET_CHAIN,0,1) e:GetHandler():RegisterFlagEffect(33200500,RESET_EVENT+RESET_CHAIN,0,1)
end end
function c33200516.tzop(e,tp,eg,ep,ev,re,r,rp) function c33200516.tzop(e,tp,eg,ep,ev,re,r,rp)
...@@ -105,7 +108,7 @@ function c33200516.tzop(e,tp,eg,ep,ev,re,r,rp) ...@@ -105,7 +108,7 @@ function c33200516.tzop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND,nil) local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND,nil)
if g:GetCount()==0 then return end if g:GetCount()==0 then return end
if not Duel.IsPlayerAffectedByEffect(tp,33200505) then if not Duel.IsPlayerAffectedByEffect(tp,33200505) then
local sg=g:RandomSelect(1-tp,1) local sg=g:Filter(c33200516.exfilter,nil):RandomSelect(1-tp,1)
local sgc=sg:GetFirst() local sgc=sg:GetFirst()
Duel.ConfirmCards(tp,sgc) Duel.ConfirmCards(tp,sgc)
Duel.ShuffleHand(1-tp) Duel.ShuffleHand(1-tp)
...@@ -121,18 +124,22 @@ function c33200516.tzop(e,tp,eg,ep,ev,re,r,rp) ...@@ -121,18 +124,22 @@ function c33200516.tzop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave(sgc,REASON_EFFECT) Duel.SendtoGrave(sgc,REASON_EFFECT)
else else
local dtm=Duel.GetFlagEffect(tp,33200506) local dtm=Duel.GetFlagEffect(tp,33200506)
local cof=Duel.GetMatchingGroupCount(c33200516.coffilter,tp,LOCATION_ONFIELD,0,1,nil) local co=Duel.GetMatchingGroup(c33200516.coffilter,tp,LOCATION_ONFIELD,0,1,nil)
local cof=co:GetCount()
if dtm>cof then dtm=cof end if dtm>cof then dtm=cof end
if Duel.Damage(1-tp,800,REASON_EFFECT) and dtm>=1 then if Duel.Damage(1-tp,800,REASON_EFFECT) and dtm>=1 then
Duel.Hint(HINT_CARD,tp,33200506) Duel.Hint(HINT_CARD,tp,33200506)
Duel.Draw(tp,dtm,REASON_EFFECT) Duel.Draw(tp,dtm,REASON_EFFECT)
for drc in aux.Next(co) do
drc:RegisterFlagEffect(33200508,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end end
Duel.Destroy(c,REASON_EFFECT) Duel.Destroy(c,REASON_EFFECT)
end end
end end
else else
Duel.ConfirmCards(tp,g) Duel.ConfirmCards(tp,g)
local sg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_HAND,1,1,nil) local sg=Duel.SelectMatchingCard(tp,c33200516.exfilter,tp,0,LOCATION_HAND,1,1,nil)
local sgc=sg:GetFirst() local sgc=sg:GetFirst()
Duel.ShuffleHand(1-tp) Duel.ShuffleHand(1-tp)
local opt=e:GetLabel() local opt=e:GetLabel()
...@@ -142,11 +149,15 @@ function c33200516.tzop(e,tp,eg,ep,ev,re,r,rp) ...@@ -142,11 +149,15 @@ function c33200516.tzop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave(sgc,REASON_EFFECT) Duel.SendtoGrave(sgc,REASON_EFFECT)
else else
local dtm=Duel.GetFlagEffect(tp,33200506) local dtm=Duel.GetFlagEffect(tp,33200506)
local cof=Duel.GetMatchingGroupCount(c33200516.coffilter,tp,LOCATION_ONFIELD,0,1,nil) local co=Duel.GetMatchingGroup(c33200516.coffilter,tp,LOCATION_ONFIELD,0,1,nil)
local cof=co:GetCount()
if dtm>cof then dtm=cof end if dtm>cof then dtm=cof end
if Duel.Damage(1-tp,800,REASON_EFFECT) and dtm>=1 then if Duel.Damage(1-tp,800,REASON_EFFECT) and dtm>=1 then
Duel.Hint(HINT_CARD,tp,33200506) Duel.Hint(HINT_CARD,tp,33200506)
Duel.Draw(tp,dtm,REASON_EFFECT) Duel.Draw(tp,dtm,REASON_EFFECT)
for drc in aux.Next(co) do
drc:RegisterFlagEffect(33200508,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end end
Duel.Destroy(c,REASON_EFFECT) Duel.Destroy(c,REASON_EFFECT)
end end
......
...@@ -65,11 +65,15 @@ function c33200520.negop(e,tp,eg,ep,ev,re,r,rp) ...@@ -65,11 +65,15 @@ function c33200520.negop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(eg,REASON_EFFECT) Duel.Destroy(eg,REASON_EFFECT)
Duel.BreakEffect() Duel.BreakEffect()
local dtm=Duel.GetFlagEffect(tp,33200506) local dtm=Duel.GetFlagEffect(tp,33200506)
local cof=Duel.GetMatchingGroupCount(c33200520.coffilter,tp,LOCATION_ONFIELD,0,1,nil) local co=Duel.GetMatchingGroup(c33200520.coffilter,tp,LOCATION_ONFIELD,0,1,nil)
local cof=co:GetCount()
if dtm>cof then dtm=cof end if dtm>cof then dtm=cof end
if Duel.Damage(1-tp,800,REASON_EFFECT) and dtm>=1 then if Duel.Damage(1-tp,800,REASON_EFFECT) and dtm>=1 then
Duel.Hint(HINT_CARD,tp,33200506) Duel.Hint(HINT_CARD,tp,33200506)
Duel.Draw(tp,dtm,REASON_EFFECT) Duel.Draw(tp,dtm,REASON_EFFECT)
for drc in aux.Next(co) do
drc:RegisterFlagEffect(33200508,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end end
end 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