33-- Scripted by Larry126
44local s ,id = GetID ()
55function s .initial_effect (c )
6- -- pendulum summon
7- Pendulum .AddProcedure (c )
8- -- revive limit
96 c :EnableReviveLimit ()
10- -- spsummon condition
7+ -- Pendulum Summon procedure
8+ Pendulum .AddProcedure (c )
9+ -- Special Summon Restriction
1110 local e1 = Effect .CreateEffect (c )
1211 e1 :SetType (EFFECT_TYPE_SINGLE )
1312 e1 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE )
1413 e1 :SetCode (EFFECT_SPSUMMON_CONDITION )
1514 c :RegisterEffect (e1 )
16- -- special summon rule
15+ -- Special Summon procedure: Tribute 1 each "Starving Venom Fusion Dragon", "Clear Wing Synchro Dragon", and "Dark Rebellion Xyz Dragon"
1716 local e2 = Effect .CreateEffect (c )
1817 e2 :SetType (EFFECT_TYPE_FIELD )
1918 e2 :SetCode (EFFECT_SPSUMMON_PROC )
2019 e2 :SetProperty (EFFECT_FLAG_UNCOPYABLE )
2120 e2 :SetRange (LOCATION_HAND )
2221 e2 :SetCondition (s .hspcon )
22+ e2 :SetTarget (s .hsptg )
2323 e2 :SetOperation (s .hspop )
2424 c :RegisterEffect (e2 )
25- -- atk/def
25+ -- ATK/DEF become equal to your opponent's LP
2626 local e3 = Effect .CreateEffect (c )
2727 e3 :SetType (EFFECT_TYPE_SINGLE )
2828 e3 :SetCode (EFFECT_SET_ATTACK )
2929 e3 :SetProperty (EFFECT_FLAG_SINGLE_RANGE )
3030 e3 :SetRange (LOCATION_MZONE )
31- e3 :SetValue (s . atkval )
31+ e3 :SetValue (function ( e , c ) return math.floor ( Duel . GetLP ( 1 - e : GetHandlerPlayer ())) end )
3232 c :RegisterEffect (e3 )
3333 local e4 = e3 :Clone ()
3434 e4 :SetCode (EFFECT_SET_DEFENSE )
3535 c :RegisterEffect (e4 )
36- -- todeck
36+ -- Shuffle all cards on the field and in the GYs into the Deck, except for this card
3737 local e5 = Effect .CreateEffect (c )
3838 e5 :SetDescription (aux .Stringid (16306932 ,2 ))
3939 e5 :SetCategory (CATEGORY_TODECK )
4040 e5 :SetType (EFFECT_TYPE_IGNITION )
4141 e5 :SetRange (LOCATION_MZONE )
42- e5 :SetCost (s . tdcost )
42+ e5 :SetCost (aux . PayLPCost ( 1 / 2 ) )
4343 e5 :SetTarget (s .tdtg )
4444 e5 :SetOperation (s .tdop )
4545 c :RegisterEffect (e5 )
4646end
4747s .listed_names = {41209827 ,82044279 ,16195942 }
48- function s .hspfilter1 (c ,g ,ft )
49- local rg = Group .FromCards (c )
50- local ct = ft
51- if c :IsLocation (LOCATION_MZONE ) and c :GetSequence ()< 5 then ct = ct + 1 end
52- return c :IsCode (41209827 ) and g :IsExists (s .hspfilter2 ,1 ,rg ,g ,rg ,ft )
53- end
54- function s .hspfilter2 (c ,g ,rg ,ft )
55- local rg2 = rg :Clone ()
56- rg2 :AddCard (c )
57- local ct = ft
58- if c :IsLocation (LOCATION_MZONE ) and c :GetSequence ()< 5 then ct = ct + 1 end
59- return c :IsCode (82044279 ) and g :IsExists (s .hspfilter3 ,1 ,rg2 ,ft )
48+ function s .rescon (sg ,e ,tp ,mg )
49+ return aux .ChkfMMZ (1 )(sg ,e ,tp ,mg ) and sg :IsExists (s .chk ,1 ,nil ,sg ,Group .CreateGroup (),41209827 ,82044279 ,16195942 )
6050end
61- function s .hspfilter3 (c ,ft )
62- local ct = ft
63- if c :IsLocation (LOCATION_MZONE ) and c :GetSequence ()< 5 then ct = ct + 1 end
64- return c :IsCode (16195942 ) and ct > 0
51+ function s .chk (c ,sg ,g ,code ,...)
52+ if not c :IsCode (code ) then return false end
53+ local res
54+ if ... then
55+ g :AddCard (c )
56+ res = sg :IsExists (s .chk ,1 ,g ,sg ,g ,... )
57+ g :RemoveCard (c )
58+ else
59+ res = true
60+ end
61+ return res
6562end
6663function s .hspcon (e ,c )
6764 if c == nil then return true end
6865 local tp = c :GetControler ()
69- local ft = Duel .GetLocationCount (tp ,LOCATION_MZONE )
70- if ft <- 2 then return false end
71- local g = Duel .GetReleaseGroup (tp ):Filter (Card .IsRace ,nil ,RACE_DRAGON )
72- return g :IsExists (s .hspfilter1 ,1 ,nil ,g ,ft )
66+ local rg = Duel .GetReleaseGroup (tp )
67+ local g1 = rg :Filter (Card .IsCode ,nil ,41209827 )
68+ local g2 = rg :Filter (Card .IsCode ,nil ,82044279 )
69+ local g3 = rg :Filter (Card .IsCode ,nil ,16195942 )
70+ local g = g1 :Clone ()
71+ g :Merge (g2 )
72+ g :Merge (g3 )
73+ return Duel .GetLocationCount (tp ,LOCATION_MZONE )>- 3 and # g1 > 0 and # g2 > 0 and # g3 > 0 and aux .SelectUnselectGroup (g ,e ,tp ,3 ,3 ,s .rescon ,0 )
7374end
74- function s .hspop (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,c )
75- local ft = Duel .GetLocationCount (tp ,LOCATION_MZONE )
76- local g = Duel .GetReleaseGroup (tp ):Filter (Card .IsRace ,nil ,RACE_DRAGON )
77- Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_RELEASE )
78- local g1 = g :FilterSelect (tp ,s .hspfilter1 ,1 ,1 ,nil ,g ,ft )
79- Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_RELEASE )
80- local g2 = g :FilterSelect (tp ,s .hspfilter2 ,1 ,1 ,g1 ,g ,g1 ,ft )
75+ function s .hsptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,c )
76+ local rg = Duel .GetReleaseGroup (tp )
77+ local g1 = rg :Filter (Card .IsCode ,nil ,41209827 )
78+ local g2 = rg :Filter (Card .IsCode ,nil ,82044279 )
79+ local g3 = rg :Filter (Card .IsCode ,nil ,16195942 )
8180 g1 :Merge (g2 )
82- Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_RELEASE )
83- local g3 = g :FilterSelect (tp ,s .hspfilter3 ,1 ,1 ,g1 ,ft )
8481 g1 :Merge (g3 )
85- Duel .Release (g1 ,REASON_COST + REASON_MATERIAL )
86- end
87- function s .atkval (e ,c )
88- return math.floor (Duel .GetLP (1 - e :GetHandlerPlayer ()))
82+ local g1 = aux .SelectUnselectGroup (g1 ,e ,tp ,3 ,3 ,s .rescon ,1 ,tp ,HINTMSG_RELEASE ,s .rescon ,nil ,true )
83+ if # g1 > 0 then
84+ g1 :KeepAlive ()
85+ e :SetLabelObject (g1 )
86+ return true
87+ end
88+ return false
8989end
90- function s .tdcost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
91- if chk == 0 then return true end
92- Duel .PayLPCost (tp ,math.floor (Duel .GetLP (tp )/ 2 ))
90+ function s .hspop (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,c )
91+ local g1 = e :GetLabelObject ()
92+ if not g1 then return end
93+ Duel .Release (g1 ,REASON_COST )
94+ g1 :DeleteGroup ()
9395end
9496function s .tdtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
95- local g = Duel .GetMatchingGroup (Card .IsAbleToDeck ,tp ,LOCATION_ONFIELD + LOCATION_GRAVE ,LOCATION_ONFIELD + LOCATION_GRAVE ,e :GetHandler ())
97+ local g = Duel .GetMatchingGroup (Card .IsAbleToDeck ,tp ,LOCATION_ONFIELD | LOCATION_GRAVE ,LOCATION_ONFIELD | LOCATION_GRAVE ,e :GetHandler ())
9698 if chk == 0 then return # g > 0 end
9799 Duel .SetOperationInfo (0 ,CATEGORY_TODECK ,g ,# g ,0 ,0 )
98100end
99101function s .tdop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
100- local g = Duel .GetMatchingGroup (Card .IsAbleToDeck ,tp ,LOCATION_ONFIELD + LOCATION_GRAVE ,LOCATION_ONFIELD + LOCATION_GRAVE ,e :GetHandler ())
102+ local g = Duel .GetMatchingGroup (Card .IsAbleToDeck ,tp ,LOCATION_ONFIELD | LOCATION_GRAVE ,LOCATION_ONFIELD | LOCATION_GRAVE ,e :GetHandler ())
101103 if # g > 0 then
102104 Duel .SendtoDeck (g ,nil ,SEQ_DECKSHUFFLE ,REASON_EFFECT )
103105 end
104- end
106+ end
0 commit comments