1+ -- 黄昏の堕天使ルシファー
2+ -- Lucifer, Darklord of the Evening Twilight
3+ -- Scripted by The Razgriz
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ c :EnableReviveLimit ()
7+ -- Fusion Materials: 2 Level 6 or higher DARK Fairy monsters
8+ Fusion .AddProcMixN (c ,true ,true ,s .matfilter ,2 )
9+ -- Your opponent cannot target this card with card effects
10+ local e1 = Effect .CreateEffect (c )
11+ e1 :SetType (EFFECT_TYPE_SINGLE )
12+ e1 :SetProperty (EFFECT_FLAG_SINGLE_RANGE )
13+ e1 :SetCode (EFFECT_CANNOT_BE_EFFECT_TARGET )
14+ e1 :SetRange (LOCATION_MZONE )
15+ e1 :SetValue (aux .tgoval )
16+ c :RegisterEffect (e1 )
17+ -- Set 1 "Darklord" Spell and 1 "Darklord" Trap from your Deck
18+ local e2 = Effect .CreateEffect (c )
19+ e2 :SetDescription (aux .Stringid (id ,0 ))
20+ e2 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
21+ e2 :SetProperty (EFFECT_FLAG_DELAY )
22+ e2 :SetCode (EVENT_SPSUMMON_SUCCESS )
23+ e2 :SetCountLimit (1 ,id )
24+ e2 :SetCondition (function (e ) return e :GetHandler ():IsFusionSummoned () end )
25+ e2 :SetTarget (s .settg )
26+ e2 :SetOperation (s .setop )
27+ c :RegisterEffect (e2 )
28+ -- Apply the effect of 1 "Darklord" Spell/Trap in your GY, then shuffle it into the Deck
29+ local e3 = Effect .CreateEffect (c )
30+ e3 :SetDescription (aux .Stringid (id ,1 ))
31+ e3 :SetCategory (CATEGORY_TODECK )
32+ e3 :SetType (EFFECT_TYPE_QUICK_O )
33+ e3 :SetProperty (EFFECT_FLAG_CARD_TARGET )
34+ e3 :SetCode (EVENT_FREE_CHAIN )
35+ e3 :SetRange (LOCATION_MZONE )
36+ e3 :SetCountLimit (1 ,{id ,1 })
37+ e3 :SetCost (Cost .PayLP (1000 ))
38+ e3 :SetTarget (s .copytg )
39+ e3 :SetOperation (s .copyop )
40+ e3 :SetHintTiming (0 ,TIMING_STANDBY_PHASE |TIMING_MAIN_END |TIMINGS_CHECK_MONSTER_E )
41+ c :RegisterEffect (e3 )
42+ end
43+ s .listed_series = {SET_DARKLORD }
44+ function s .matfilter (c ,fc ,sumtype ,sump )
45+ return c :IsLevelAbove (6 ) and c :IsAttribute (ATTRIBUTE_DARK ,fc ,sumtype ,sump ) and c :IsRace (RACE_FAIRY ,fc ,sumtype ,sump )
46+ end
47+ function s .setfilter (c )
48+ return c :IsSetCard (SET_DARKLORD ) and c :IsSpellTrap () and c :IsSSetable ()
49+ end
50+ function s .rescon (stzone_chk )
51+ return function (sg ,e ,tp ,mg )
52+ return # sg == 2 and (stzone_chk or sg :IsExists (Card .IsFieldSpell ,1 ,nil )) and sg :IsExists (Card .IsSpell ,1 ,nil ) and sg :IsExists (Card .IsTrap ,1 ,nil )
53+ end
54+ end
55+ function s .settg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
56+ if chk == 0 then
57+ local stzone_chk = Duel .GetLocationCount (tp ,LOCATION_SZONE )>= 2
58+ local g = Duel .GetMatchingGroup (s .setfilter ,tp ,LOCATION_DECK ,0 ,nil )
59+ return # g >= 2 and aux .SelectUnselectGroup (g ,e ,tp ,2 ,2 ,s .rescon (stzone_chk ),0 )
60+ end
61+ end
62+ function s .setop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
63+ local stzone_chk = Duel .GetLocationCount (tp ,LOCATION_SZONE )>= 2
64+ local g = Duel .GetMatchingGroup (s .setfilter ,tp ,LOCATION_DECK ,0 ,nil )
65+ local sg = aux .SelectUnselectGroup (g ,e ,tp ,2 ,2 ,s .rescon (stzone_chk ),1 ,tp ,HINTMSG_SET )
66+ if # sg == 2 then
67+ Duel .SSet (tp ,sg )
68+ end
69+ end
70+ function s .copyfilter (c )
71+ return c :IsSetCard (SET_DARKLORD ) and c :IsSpellTrap () and c :IsAbleToDeck () and c :CheckActivateEffect (false ,true ,false )~= nil
72+ end
73+ function s .copytg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
74+ if chkc then return chkc :IsLocation (LOCATION_GRAVE ) and chkc :IsControler (tp ) and s .copyfilter (chkc ) end
75+ if chk == 0 then return Duel .IsExistingTarget (s .copyfilter ,tp ,LOCATION_GRAVE ,0 ,1 ,nil ) end
76+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TARGET )
77+ local g = Duel .SelectTarget (tp ,s .copyfilter ,tp ,LOCATION_GRAVE ,0 ,1 ,1 ,nil )
78+ Duel .SetOperationInfo (0 ,CATEGORY_TODECK ,g ,1 ,tp ,0 )
79+ end
80+ function s .copyop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
81+ local tc = Duel .GetFirstTarget ()
82+ if not tc :IsRelateToEffect (e ) then return end
83+ local te ,ceg ,cep ,cev ,cre ,cr ,crp = tc :CheckActivateEffect (false ,true ,true )
84+ if not te then return end
85+ local tg = te :GetTarget ()
86+ local op = te :GetOperation ()
87+ if tg then tg (te ,tp ,Group .CreateGroup (),PLAYER_NONE ,0 ,e ,REASON_EFFECT ,PLAYER_NONE ,1 ) end
88+ Duel .BreakEffect ()
89+ tc :CreateEffectRelation (te )
90+ Duel .BreakEffect ()
91+ local g = Duel .GetChainInfo (0 ,CHAININFO_TARGET_CARDS )
92+ for etc in aux .Next (g ) do
93+ etc :CreateEffectRelation (te )
94+ end
95+ if op then op (te ,tp ,Group .CreateGroup (),PLAYER_NONE ,0 ,e ,REASON_EFFECT ,PLAYER_NONE ,1 ) end
96+ tc :ReleaseEffectRelation (te )
97+ for etc in aux .Next (g ) do
98+ etc :ReleaseEffectRelation (te )
99+ end
100+ Duel .BreakEffect ()
101+ Duel .SendtoDeck (te :GetHandler (),nil ,SEQ_DECKSHUFFLE ,REASON_EFFECT )
102+ end
0 commit comments