22-- Tri-Gate Wizard
33local s ,id = GetID ()
44function s .initial_effect (c )
5- -- Link Summon procedure
6- Link .AddProcedure (c ,s .matfilter ,2 )
75 c :EnableReviveLimit ()
8- -- Double damage
6+ -- Link Summon procedure: 2+ monsters, except Tokens
7+ Link .AddProcedure (c ,aux .FilterBoolFunctionEx (aux .NOT (Card .IsType ),TYPE_TOKEN ),2 )
8+ -- If a monster co-linked to this card battles your opponent's monster, any battle damage it inflicts to your opponent is doubled
99 local e1 = Effect .CreateEffect (c )
1010 e1 :SetType (EFFECT_TYPE_FIELD )
11+ e1 :SetProperty (EFFECT_FLAG_IGNORE_IMMUNE )
1112 e1 :SetCode (EFFECT_CHANGE_BATTLE_DAMAGE )
1213 e1 :SetRange (LOCATION_MZONE )
1314 e1 :SetTargetRange (LOCATION_MZONE ,LOCATION_MZONE )
14- e1 :SetTarget (s .damtg )
15+ e1 :SetTarget (s .doubledamtg )
1516 e1 :SetValue (aux .ChangeBattleDamage (1 ,DOUBLE_DAMAGE ))
1617 c :RegisterEffect (e1 )
17- -- Banish card
18+ -- Banish 1 card on the field
1819 local e2 = Effect .CreateEffect (c )
1920 e2 :SetDescription (aux .Stringid (id ,0 ))
2021 e2 :SetCategory (CATEGORY_REMOVE )
2122 e2 :SetType (EFFECT_TYPE_IGNITION )
2223 e2 :SetProperty (EFFECT_FLAG_CARD_TARGET )
2324 e2 :SetRange (LOCATION_MZONE )
2425 e2 :SetCountLimit (1 )
25- e2 :SetCondition (s . rmcon )
26+ e2 :SetCondition (function ( e ) return e : GetHandler (): GetMutualLinkedGroupCount () >= 2 end )
2627 e2 :SetTarget (s .rmtg )
2728 e2 :SetOperation (s .rmop )
2829 c :RegisterEffect (e2 )
29- -- Negate activation
30+ -- Negate the activation of a card or effect, and if you do, banish that card
3031 local e3 = Effect .CreateEffect (c )
3132 e3 :SetDescription (aux .Stringid (id ,1 ))
3233 e3 :SetCategory (CATEGORY_NEGATE + CATEGORY_REMOVE )
@@ -40,41 +41,36 @@ function s.initial_effect(c)
4041 e3 :SetOperation (s .negop )
4142 c :RegisterEffect (e3 )
4243end
43- function s .matfilter (c ,lc ,sumtype ,tp )
44- return not c :IsType (TYPE_TOKEN ,lc ,sumtype ,tp )
45- end
46- function s .damtg (e ,c )
44+ function s .doubledamtg (e ,c )
45+ local bc = c :GetBattleTarget ()
4746 local lg = e :GetHandler ():GetMutualLinkedGroup ()
48- return lg :IsContains (c ) and c :GetBattleTarget ()~= nil and c :GetBattleTarget ():GetControler ()== 1 - e :GetHandlerPlayer ()
49- end
50- function s .rmcon (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
51- return e :GetHandler ():GetMutualLinkedGroupCount ()>= 2
47+ return lg :IsContains (c ) and bc and bc :IsControler (1 - e :GetHandlerPlayer ())
5248end
5349function s .rmtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
5450 if chkc then return chkc :IsOnField () and chkc :IsAbleToRemove () end
5551 if chk == 0 then return Duel .IsExistingTarget (Card .IsAbleToRemove ,tp ,LOCATION_ONFIELD ,LOCATION_ONFIELD ,1 ,nil ) end
5652 Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_REMOVE )
5753 local g = Duel .SelectTarget (tp ,Card .IsAbleToRemove ,tp ,LOCATION_ONFIELD ,LOCATION_ONFIELD ,1 ,1 ,nil )
58- Duel .SetOperationInfo (0 ,CATEGORY_REMOVE ,g ,1 ,0 ,0 )
54+ Duel .SetOperationInfo (0 ,CATEGORY_REMOVE ,g ,1 ,tp ,0 )
5955end
6056function s .rmop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
6157 local tc = Duel .GetFirstTarget ()
62- if tc and tc :IsRelateToEffect (e ) then
58+ if tc :IsRelateToEffect (e ) then
6359 Duel .Remove (tc ,POS_FACEUP ,REASON_EFFECT )
6460 end
6561end
6662function s .negcon (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
6763 local c = e :GetHandler ()
68- return not c :IsStatus (STATUS_BATTLE_DESTROYED ) and Duel .IsChainNegatable (ev ) and c : GetMutualLinkedGroupCount () >= 3
64+ return c : GetMutualLinkedGroupCount () >= 3 and not c :IsStatus (STATUS_BATTLE_DESTROYED ) and Duel .IsChainNegatable (ev )
6965end
7066function s .negtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
7167 local rc = re :GetHandler ()
7268 local relation = rc :IsRelateToEffect (re )
7369 if chk == 0 then return rc :IsAbleToRemove (tp )
7470 or (not relation and Duel .IsPlayerCanRemove (tp )) end
75- Duel .SetOperationInfo (0 ,CATEGORY_NEGATE ,eg ,1 ,0 ,0 )
71+ Duel .SetOperationInfo (0 ,CATEGORY_NEGATE ,eg ,1 ,tp ,0 )
7672 if relation then
77- Duel .SetOperationInfo (0 ,CATEGORY_REMOVE ,rc ,1 ,rc : GetControler (), rc : GetLocation () )
73+ Duel .SetOperationInfo (0 ,CATEGORY_REMOVE ,rc ,1 ,tp , 0 )
7874 else
7975 Duel .SetOperationInfo (0 ,CATEGORY_REMOVE ,nil ,0 ,0 ,rc :GetPreviousLocation ())
8076 end
0 commit comments