1+ -- ガリバー・チェーン
12-- Gulliver Chain
23local s ,id = GetID ()
34function s .initial_effect (c )
4- -- activate
5+ -- When a monster(s) on the field changes its position: Target 1 of those monsters; change that target to face-up Defense Position.
56 local e1 = Effect .CreateEffect (c )
6- e1 :SetProperty ( EFFECT_FLAG_CARD_TARGET )
7+ e1 :SetCategory ( CATEGORY_POSITION )
78 e1 :SetType (EFFECT_TYPE_ACTIVATE )
9+ e1 :SetProperty (EFFECT_FLAG_CARD_TARGET )
810 e1 :SetCode (EVENT_CHANGE_POS )
9- e1 :SetCondition (s .condition )
1011 e1 :SetTarget (s .target )
1112 e1 :SetOperation (s .operation )
1213 c :RegisterEffect (e1 )
1314 local e2 = Effect .CreateEffect (c )
1415 e2 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS )
1516 e2 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE )
16- e2 :SetRange (LOCATION_SZONE )
1717 e2 :SetCode (EVENT_CHAIN_SOLVED )
18+ e2 :SetRange (LOCATION_SZONE )
1819 e2 :SetLabelObject (e1 )
1920 e2 :SetCondition (aux .PersistentTgCon )
2021 e2 :SetOperation (aux .PersistentTgOp (true ))
2122 c :RegisterEffect (e2 )
22- -- destroy
23+ -- When the targeted monster is changed to Attack Position, destroy it and this card.
2324 local e3 = Effect .CreateEffect (c )
2425 e3 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS )
2526 e3 :SetCode (EVENT_CHANGE_POS )
26- e3 :SetOperation (s .desop )
2727 e3 :SetRange (LOCATION_SZONE )
28+ e3 :SetCondition (s .descon )
29+ e3 :SetOperation (s .desop )
2830 c :RegisterEffect (e3 )
2931end
30- function s .condition (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
31- return re and rp == tp
32- end
33- function s .filter (c ,e ,tp )
34- return c :IsControler (1 - tp ) and c :IsCanBeEffectTarget (e ) and c :IsLocation (LOCATION_MZONE )
32+ function s .filter (c ,e )
33+ return c :IsCanBeEffectTarget (e ) and c :IsLocation (LOCATION_MZONE )
3534end
3635function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
37- local g = eg :Filter (s .filter ,nil ,e , tp )
36+ local g = eg :Filter (s .filter ,nil ,e )
3837 if chkc then return g :IsContains (chkc ) end
3938 if chk == 0 then return # g > 0 end
4039 Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_POSCHANGE )
@@ -51,11 +50,14 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
5150 Duel .ChangePosition (tc ,POS_FACEUP_DEFENSE )
5251 end
5352end
53+ function s .descon (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
54+ local tc = e :GetHandler ():GetFirstCardTarget ()
55+ return tc and eg :IsContains (tc ) and tc :IsAttackPos ()
56+ end
5457function s .desop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
58+ Duel .Hint (HINT_CARD ,0 ,id )
5559 local c = e :GetHandler ()
5660 local tc = c :GetFirstCardTarget ()
57- if tc and tc :IsAttackPos () then
58- local g = Group .FromCards (tc ,c )
59- Duel .Destroy (g ,REASON_EFFECT )
60- end
61- end
61+ local g = Group .FromCards (tc ,c )
62+ Duel .Destroy (g ,REASON_EFFECT )
63+ end
0 commit comments