1+ -- 黒き魔族-レオ・ウィザード
2+ -- Leo Wizard, the Dark Mage
3+ -- scripted by Naim
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Monsters whose original Level is 4 or lower with more than 1350 ATK and/or DEF require 1 Tribute to Normal Summon from the hand
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetType (EFFECT_TYPE_FIELD )
10+ e1 :SetProperty (EFFECT_FLAG_IGNORE_IMMUNE )
11+ e1 :SetCode (EFFECT_LIMIT_SUMMON_PROC )
12+ e1 :SetRange (LOCATION_MZONE )
13+ e1 :SetTargetRange (LOCATION_HAND ,LOCATION_HAND )
14+ e1 :SetCondition (s .nsumcon )
15+ e1 :SetTarget (aux .FieldSummonProcTg (s .nsumtg ,s .nsumcost ))
16+ e1 :SetOperation (s .nsumop )
17+ e1 :SetValue (SUMMON_TYPE_TRIBUTE )
18+ c :RegisterEffect (e1 )
19+ -- Destroy a LIGHT monster that this card is battling
20+ local e2 = Effect .CreateEffect (c )
21+ e2 :SetDescription (aux .Stringid (id ,1 ))
22+ e2 :SetCategory (CATEGORY_DESTROY )
23+ e2 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
24+ e2 :SetCode (EVENT_BATTLE_START )
25+ e2 :SetTarget (s .destg )
26+ e2 :SetOperation (s .desop )
27+ c :RegisterEffect (e2 )
28+ -- Add 1 monster with 1350 ATK from your Deck to your hand
29+ local e3 = Effect .CreateEffect (c )
30+ e3 :SetDescription (aux .Stringid (id ,2 ))
31+ e3 :SetCategory (CATEGORY_TOHAND + CATEGORY_SEARCH )
32+ e3 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
33+ e3 :SetProperty (EFFECT_FLAG_DELAY )
34+ e3 :SetCode (EVENT_DESTROYED )
35+ e3 :SetCountLimit (1 ,id )
36+ e3 :SetCondition (function (e ) return e :GetHandler ():IsReason (REASON_BATTLE |REASON_EFFECT ) end )
37+ e3 :SetTarget (s .thtg )
38+ e3 :SetOperation (s .thop )
39+ c :RegisterEffect (e3 )
40+ end
41+ function s .nsumcon (e ,c ,minc )
42+ if c == nil then return true end
43+ local tp = c :GetControler ()
44+ local rg = Duel .GetReleaseGroup (tp )
45+ return aux .SelectUnselectGroup (rg ,e ,tp ,1 ,1 ,aux .ChkfMMZ (1 ),0 )
46+ end
47+ function s .nsumtg (e ,c )
48+ return c :GetOriginalLevel ()<= 4 and (c :GetAttack ()> 1350 or c :GetDefense ()> 1350 )
49+ end
50+ function s .nsumcost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,c )
51+ local rg = Duel .GetReleaseGroup (tp )
52+ local g = aux .SelectUnselectGroup (rg ,e ,tp ,1 ,1 ,aux .ChkfMMZ (1 ),1 ,tp ,HINTMSG_RELEASE ,nil ,nil ,true )
53+ if # g > 0 then
54+ g :KeepAlive ()
55+ e :SetLabelObject (g )
56+ return true
57+ end
58+ return false
59+ end
60+ function s .nsumop (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,c )
61+ local g = e :GetLabelObject ()
62+ if not g then return end
63+ c :SetMaterial (g )
64+ Duel .Release (g ,REASON_COST |REASON_SUMMON |REASON_MATERIAL )
65+ g :DeleteGroup ()
66+ end
67+ function s .destg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
68+ local bc = e :GetHandler ():GetBattleTarget ()
69+ if chk == 0 then return bc and bc :IsFaceup () and bc :IsAttribute (ATTRIBUTE_LIGHT ) end
70+ Duel .SetOperationInfo (0 ,CATEGORY_DESTROY ,bc ,1 ,tp ,0 )
71+ end
72+ function s .desop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
73+ local bc = e :GetHandler ():GetBattleTarget ()
74+ if bc and bc :IsRelateToBattle () then
75+ Duel .Destroy (bc ,REASON_EFFECT )
76+ end
77+ end
78+ function s .thfilter (c )
79+ return c :IsAttack (1350 ) and c :IsAbleToHand ()
80+ end
81+ function s .thtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
82+ if chk == 0 then return Duel .IsExistingMatchingCard (s .thfilter ,tp ,LOCATION_DECK ,0 ,1 ,nil ) end
83+ Duel .SetOperationInfo (0 ,CATEGORY_TOHAND ,nil ,1 ,tp ,LOCATION_DECK )
84+ end
85+ function s .thop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
86+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_ATOHAND )
87+ local g = Duel .SelectMatchingCard (tp ,s .thfilter ,tp ,LOCATION_DECK ,0 ,1 ,1 ,nil )
88+ if # g > 0 then
89+ Duel .SendtoHand (g ,nil ,REASON_EFFECT )
90+ Duel .ConfirmCards (1 - tp ,g )
91+ end
92+ end
0 commit comments