1+ -- うかのみつねのおなり
2+ -- Ukanomitsune-no-Onari
3+ -- scripted by Naim
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ c :EnableReviveLimit ()
7+ -- Link Summon procedure: 2 LIGHT monsters, including a Beast monster
8+ Link .AddProcedure (c ,aux .FilterBoolFunctionEx (Card .IsAttribute ,ATTRIBUTE_LIGHT ),2 ,2 ,s .matcheck )
9+ -- Your opponent cannot target cards in the Field Zones with card effects
10+ local e1 = Effect .CreateEffect (c )
11+ e1 :SetType (EFFECT_TYPE_FIELD )
12+ e1 :SetProperty (EFFECT_FLAG_IGNORE_IMMUNE + EFFECT_FLAG_SET_AVAILABLE )
13+ e1 :SetCode (EFFECT_CANNOT_BE_EFFECT_TARGET )
14+ e1 :SetRange (LOCATION_MZONE )
15+ e1 :SetTargetRange (LOCATION_FZONE ,LOCATION_FZONE )
16+ e1 :SetValue (aux .tgoval )
17+ c :RegisterEffect (e1 )
18+ -- Set 1 Quick-Play Spell from your GY
19+ local e2 = Effect .CreateEffect (c )
20+ e2 :SetDescription (aux .Stringid (id ,0 ))
21+ e2 :SetCategory (CATEGORY_LEAVE_GRAVE )
22+ e2 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
23+ e2 :SetProperty (EFFECT_FLAG_DELAY + EFFECT_FLAG_CARD_TARGET )
24+ e2 :SetCode (EVENT_SPSUMMON_SUCCESS )
25+ e2 :SetCountLimit (1 ,id )
26+ e2 :SetCondition (function (e ) return e :GetHandler ():IsLinkSummoned () end )
27+ e2 :SetTarget (s .settg )
28+ e2 :SetOperation (s .setop )
29+ c :RegisterEffect (e2 )
30+ -- Apply effects up to the number of cards in the Field Zones
31+ local e3 = Effect .CreateEffect (c )
32+ e3 :SetDescription (aux .Stringid (id ,1 ))
33+ e3 :SetCategory (CATEGORY_DESTROY + CATEGORY_DAMAGE )
34+ e3 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
35+ e3 :SetProperty (EFFECT_FLAG_DELAY )
36+ e3 :SetCode (EVENT_DESTROYED )
37+ e3 :SetCountLimit (1 ,{id ,1 })
38+ e3 :SetTarget (s .efftg )
39+ e3 :SetOperation (s .effop )
40+ c :RegisterEffect (e3 )
41+ end
42+ function s .matcheck (g ,lc ,sumtype ,tp )
43+ return g :IsExists (Card .IsRace ,1 ,nil ,RACE_BEAST ,lc ,sumtype ,tp )
44+ end
45+ function s .setfilter (c )
46+ return c :IsQuickPlaySpell () and c :IsSSetable ()
47+ end
48+ function s .settg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
49+ if chkc then return chkc :IsLocation (LOCATION_GRAVE ) and chkc :IsControler (tp ) and s .setfilter (chkc ) end
50+ if chk == 0 then return Duel .IsExistingTarget (s .setfilter ,tp ,LOCATION_GRAVE ,0 ,1 ,nil ) end
51+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SET )
52+ local g = Duel .SelectTarget (tp ,s .setfilter ,tp ,LOCATION_GRAVE ,0 ,1 ,1 ,nil )
53+ Duel .SetOperationInfo (0 ,CATEGORY_LEAVE_GRAVE ,g ,1 ,tp ,0 )
54+ end
55+ function s .setop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
56+ local tc = Duel .GetFirstTarget ()
57+ if tc :IsRelateToEffect (e ) and tc :IsSSetable () then
58+ Duel .SSet (tp ,tc )
59+ end
60+ end
61+ function s .efftg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
62+ if chk == 0 then return Duel .GetFieldGroupCount (0 ,LOCATION_FZONE ,LOCATION_FZONE )> 0 end
63+ Duel .SetPossibleOperationInfo (0 ,CATEGORY_DESTROY ,nil ,1 ,1 - tp ,LOCATION_ONFIELD )
64+ Duel .SetPossibleOperationInfo (0 ,CATEGORY_DAMAGE ,nil ,1 ,1 - tp ,1500 )
65+ end
66+ function s .effop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
67+ local ct = Duel .GetFieldGroupCount (0 ,LOCATION_FZONE ,LOCATION_FZONE )
68+ if ct == 0 then return end
69+ local g = Duel .GetFieldGroup (tp ,0 ,LOCATION_ONFIELD )
70+ local b1 =# g > 0
71+ local b2 = true
72+ local b3 = b1 and ct == 2
73+ local op = Duel .SelectEffect (tp ,
74+ {b1 ,aux .Stringid (id ,2 )},
75+ {b2 ,aux .Stringid (id ,3 )},
76+ {b3 ,aux .Stringid (id ,4 )})
77+ local breakeffect = false
78+ if op &1 > 0 then
79+ -- Destroy 1 card your opponent controls
80+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_DESTROY )
81+ local sg = g :Select (tp ,1 ,1 ,nil )
82+ if # sg > 0 then
83+ Duel .HintSelection (sg )
84+ Duel .Destroy (sg ,REASON_EFFECT )
85+ breakeffect = true
86+ end
87+ end
88+ if op &2 > 0 then
89+ -- Inflict 1500 damage to your opponent
90+ if breakeffect then Duel .BreakEffect () end
91+ Duel .Damage (1 - tp ,1500 ,REASON_EFFECT )
92+ end
93+ end
0 commit comments