1+ -- フォーリンチーター
2+ -- Fallin' Cheatah
3+ -- scripted by pyrQ
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- This face-up card in the Monster Zone cannot be Tributed, nor used as material for a Fusion, Synchro, Xyz, or Link Summon
7+ local e1a = Effect .CreateEffect (c )
8+ e1a :SetType (EFFECT_TYPE_SINGLE )
9+ e1a :SetProperty (EFFECT_FLAG_SINGLE_RANGE )
10+ e1a :SetCode (EFFECT_UNRELEASABLE_SUM )
11+ e1a :SetRange (LOCATION_MZONE )
12+ e1a :SetValue (1 )
13+ c :RegisterEffect (e1a )
14+ local e1b = e1a :Clone ()
15+ e1b :SetCode (EFFECT_UNRELEASABLE_NONSUM )
16+ c :RegisterEffect (e1b )
17+ local e1c = e1a :Clone ()
18+ e1c :SetCode (EFFECT_CANNOT_BE_MATERIAL )
19+ e1c :SetValue (aux .cannotmatfilter (SUMMON_TYPE_FUSION ,SUMMON_TYPE_SYNCHRO ,SUMMON_TYPE_XYZ ,SUMMON_TYPE_LINK ))
20+ c :RegisterEffect (e1c )
21+ -- Give control of this card to that monster's controller, also that monster cannot be Tributed nor used as material for a Fusion, Synchro, Xyz or Link Summon while this monster is face-up on the field
22+ local e2a = Effect .CreateEffect (c )
23+ e2a :SetDescription (aux .Stringid (id ,0 ))
24+ e2a :SetCategory (CATEGORY_CONTROL )
25+ e2a :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F )
26+ e2a :SetProperty (EFFECT_FLAG_CARD_TARGET ,EFFECT_FLAG2_CHECK_SIMULTANEOUS )
27+ e2a :SetCode (EVENT_CUSTOM + id )
28+ e2a :SetRange (LOCATION_MZONE )
29+ e2a :SetTarget (s .ctrltg )
30+ e2a :SetOperation (s .ctrlop )
31+ e2a :SetLabelObject (Group .CreateGroup ())
32+ c :RegisterEffect (e2a )
33+ -- Keep track of monsters Special Summoned to the opponent's field
34+ local e2b = Effect .CreateEffect (c )
35+ e2b :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS )
36+ e2b :SetProperty (EFFECT_FLAG_CANNOT_DISABLE )
37+ e2b :SetCode (EVENT_SPSUMMON_SUCCESS )
38+ e2b :SetRange (LOCATION_MZONE )
39+ e2b :SetLabelObject (e2a )
40+ e2b :SetOperation (s .regop )
41+ c :RegisterEffect (e2b )
42+ end
43+ function s .tgfilter (c ,e ,opp )
44+ return c :IsControler (opp ) and c :IsLocation (LOCATION_MZONE ) and (not e or c :IsCanBeEffectTarget (e ))
45+ end
46+ function s .regop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
47+ local tg = eg :Filter (s .tgfilter ,nil ,nil ,1 - tp )
48+ if # tg > 0 then
49+ for tc in tg :Iter () do
50+ tc :RegisterFlagEffect (id ,RESET_CHAIN ,0 ,1 )
51+ end
52+ local g = e :GetLabelObject ():GetLabelObject ()
53+ if Duel .GetCurrentChain ()== 0 then g :Clear () end
54+ g :Merge (tg )
55+ g :Remove (function (c ) return c :GetFlagEffect (id )== 0 end ,nil )
56+ e :GetLabelObject ():SetLabelObject (g )
57+ Duel .RaiseSingleEvent (e :GetHandler (),EVENT_CUSTOM + id ,e ,0 ,tp ,tp ,0 )
58+ end
59+ end
60+ function s .ctrlfilter (c ,tp )
61+ return Duel .GetLocationCount (c :GetControler (),LOCATION_MZONE ,tp ,LOCATION_REASON_CONTROL )> 0
62+ end
63+ function s .ctrltg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
64+ local g = e :GetLabelObject ():Filter (s .tgfilter ,nil ,e ,1 - tp ):Match (s .ctrlfilter ,nil ,tp )
65+ if chkc then return g :IsContains (chkc ) and s .tgfilter (chkc ,e ,1 - tp ) end
66+ local c = e :GetHandler ()
67+ if chk == 0 then return true end
68+ if # g > 0 then
69+ local tc = nil
70+ if # g > 1 then
71+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_ATOHAND )
72+ tc = g :Select (tp ,1 ,1 ,nil ):GetFirst ()
73+ else
74+ tc = g :GetFirst ()
75+ end
76+ Duel .SetTargetCard (tc )
77+ Duel .SetOperationInfo (0 ,CATEGORY_CONTROL ,c ,1 ,tp ,0 )
78+ end
79+ end
80+ function s .ctrlop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
81+ local c = e :GetHandler ()
82+ if not c :IsRelateToEffect (e ) then return end
83+ local tc = Duel .GetFirstTarget ()
84+ if tc and tc :IsRelateToEffect (e ) and Duel .GetControl (c ,tc :GetControler ()) and c :IsFaceup () then
85+ c :SetCardTarget (tc )
86+ local fid = c :GetFieldID ()
87+ tc :RegisterFlagEffect (id + 100 ,RESET_EVENT |(RESETS_STANDARD &~RESET_TURN_SET ),EFFECT_FLAG_CLIENT_HINT ,1 ,fid ,aux .Stringid (id ,1 ))
88+ -- That monster cannot be Tributed nor used as material for a Fusion, Synchro, Xyz or Link Summon while this monster is face-up on the field
89+ local e1a = Effect .CreateEffect (c )
90+ e1a :SetType (EFFECT_TYPE_FIELD )
91+ e1a :SetProperty (EFFECT_FLAG_CANNOT_DISABLE )
92+ e1a :SetCode (EFFECT_UNRELEASABLE_SUM )
93+ e1a :SetRange (LOCATION_MZONE )
94+ e1a :SetTarget (function (e ,c ) return c :GetFlagEffectLabel (id + 100 )== fid end )
95+ e1a :SetTargetRange (LOCATION_MZONE ,LOCATION_MZONE )
96+ e1a :SetValue (1 )
97+ e1a :SetReset (RESET_EVENT |RESETS_STANDARD )
98+ c :RegisterEffect (e1a )
99+ local e1b = e1a :Clone ()
100+ e1b :SetCode (EFFECT_UNRELEASABLE_NONSUM )
101+ c :RegisterEffect (e1b )
102+ local e1c = e1a :Clone ()
103+ e1c :SetCode (EFFECT_CANNOT_BE_MATERIAL )
104+ e1c :SetValue (aux .cannotmatfilter (SUMMON_TYPE_FUSION ,SUMMON_TYPE_SYNCHRO ,SUMMON_TYPE_XYZ ,SUMMON_TYPE_LINK ))
105+ c :RegisterEffect (e1c )
106+ end
107+ end
0 commit comments