1
+ -- ミサイル・ナイト
1
2
-- Missile Knight
2
3
local s ,id = GetID ()
3
4
function s .initial_effect (c )
4
- -- destroy
5
- local e2 = Effect .CreateEffect (c )
6
- e2 :SetDescription (aux .Stringid (id ,0 ))
7
- e2 :SetCategory (CATEGORY_DESTROY )
8
- e2 :SetType (EFFECT_TYPE_IGNITION )
9
- e2 :SetRange (LOCATION_GRAVE )
10
- e2 :SetProperty (EFFECT_FLAG_CARD_TARGET )
11
- e2 :SetCondition (s .descon )
12
- e2 :SetCost (Cost .SelfBanish )
13
- e2 :SetTarget (s .destg )
14
- e2 :SetOperation (s .desop )
15
- c :RegisterEffect (e2 )
5
+ -- Destroy 1 monster on the field if you destroyed a monster this turn
6
+ local e1 = Effect .CreateEffect (c )
7
+ e1 :SetDescription (aux .Stringid (id ,0 ))
8
+ e1 :SetCategory (CATEGORY_DESTROY )
9
+ e1 :SetType (EFFECT_TYPE_QUICK_O )
10
+ e1 :SetProperty (EFFECT_FLAG_CARD_TARGET )
11
+ e1 :SetCode (EVENT_FREE_CHAIN )
12
+ e1 :SetRange (LOCATION_GRAVE )
13
+ e1 :SetCondition (function (e ,tp ) return s [tp ]> 0 end )
14
+ e1 :SetCost (Cost .SelfBanish )
15
+ e1 :SetTarget (s .destg )
16
+ e1 :SetOperation (s .desop )
17
+ c :RegisterEffect (e1 )
18
+ -- Check for monsters destroyed during a given turn
16
19
aux .GlobalCheck (s ,function ()
17
20
s [0 ]= 0
18
21
s [1 ]= 0
@@ -27,27 +30,24 @@ function s.initial_effect(c)
27
30
end )
28
31
end )
29
32
end
30
- function s .spfilter (c ,tp )
33
+ function s .chkfilter (c ,tp )
31
34
return c :IsPreviousLocation (LOCATION_MZONE ) and (c :IsReason (REASON_BATTLE ) or c :IsReason (REASON_EFFECT ) and c :GetReasonPlayer ()== tp )
32
35
end
33
36
function s .checkop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
34
- if eg :IsExists (s .spfilter ,1 ,nil ,tp ) then
37
+ if eg :IsExists (s .chkfilter ,1 ,nil ,tp ) then
35
38
s [tp ]= s [tp ]+ 1
36
39
end
37
40
end
38
- function s .descon (e ,tp )
39
- return s [tp ]> 0
40
- end
41
41
function s .destg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
42
42
if chkc then return chkc :IsLocation (LOCATION_MZONE ) end
43
- if chk == 0 then return true end
43
+ if chk == 0 then return Duel . IsExistingTarget ( aux . TRUE , tp , LOCATION_MZONE , LOCATION_MZONE , 1 , 1 , nil ) end
44
44
Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_DESTROY )
45
45
local g = Duel .SelectTarget (tp ,aux .TRUE ,tp ,LOCATION_MZONE ,LOCATION_MZONE ,1 ,1 ,nil )
46
- Duel .SetOperationInfo (0 ,CATEGORY_DESTROY ,g ,# g , 0 ,0 )
46
+ Duel .SetOperationInfo (0 ,CATEGORY_DESTROY ,g ,1 , tp ,0 )
47
47
end
48
48
function s .desop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
49
49
local tc = Duel .GetFirstTarget ()
50
50
if tc and tc :IsRelateToEffect (e ) then
51
51
Duel .Destroy (tc ,REASON_EFFECT )
52
52
end
53
- end
53
+ end
0 commit comments