22-- Doomking Balerdroch
33local s ,id = GetID ()
44function s .initial_effect (c )
5- -- negate and/ or banish
5+ -- Negate an activated effect or Banish 1 monster from the field or GY.
66 local e1 = Effect .CreateEffect (c )
77 e1 :SetDescription (aux .Stringid (id ,0 ))
88 e1 :SetCategory (CATEGORY_DISABLE + CATEGORY_REMOVE )
@@ -14,7 +14,7 @@ function s.initial_effect(c)
1414 e1 :SetTarget (s .disrmtg )
1515 e1 :SetOperation (s .disrmop )
1616 c :RegisterEffect (e1 )
17- -- spsummon
17+ -- Special Summon this card in Defense Position
1818 local e2 = Effect .CreateEffect (c )
1919 e2 :SetDescription (aux .Stringid (id ,3 ))
2020 e2 :SetCategory (CATEGORY_SPECIAL_SUMMON )
@@ -33,23 +33,23 @@ function s.disrmcost(e,tp,eg,ep,ev,re,r,rp,chk)
3333 c :RegisterFlagEffect (id ,RESET_CHAIN ,0 ,1 )
3434end
3535function s .disrmcon (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
36- local race , code1 ,code2 = Duel .GetChainInfo (ev ,CHAININFO_TRIGGERING_RACE ,CHAININFO_TRIGGERING_CODE ,CHAININFO_TRIGGERING_CODE2 )
37- return race &RACE_ZOMBIE > 0 and code1 ~= id and code2 ~= id
36+ local trig_typ , trig_race , code1 ,code2 = Duel .GetChainInfo (ev , CHAININFO_TRIGGERING_TYPE ,CHAININFO_TRIGGERING_RACE ,CHAININFO_TRIGGERING_CODE ,CHAININFO_TRIGGERING_CODE2 )
37+ return trig_typ & TYPE_MONSTER > 0 and trig_race &RACE_ZOMBIE > 0 and code1 ~= id and code2 ~= id
3838end
3939function s .filter (c )
4040 return c :IsMonster () and c :IsAbleToRemove ()
4141end
4242function s .disrmtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
4343 local b1 = Duel .IsChainDisablable (ev ) and Duel .GetFlagEffect (tp ,id )== 0
44- local b2 = Duel .IsExistingMatchingCard (aux .NecroValleyFilter (s .filter ),tp ,LOCATION_MZONE + LOCATION_GRAVE ,LOCATION_MZONE + LOCATION_GRAVE ,1 ,nil )
44+ local b2 = Duel .IsExistingMatchingCard (aux .NecroValleyFilter (s .filter ),tp ,LOCATION_MZONE | LOCATION_GRAVE ,LOCATION_MZONE | LOCATION_GRAVE ,1 ,nil )
4545 and Duel .GetFlagEffect (tp ,id + 1 )== 0
4646 if chk == 0 then return b1 or b2 end
4747 Duel .SetPossibleOperationInfo (0 ,CATEGORY_DISABLE ,eg ,1 ,0 ,0 )
48- Duel .SetPossibleOperationInfo (0 ,CATEGORY_REMOVE ,nil ,1 ,PLAYER_EITHER ,LOCATION_MZONE + LOCATION_GRAVE )
48+ Duel .SetPossibleOperationInfo (0 ,CATEGORY_REMOVE ,nil ,1 ,PLAYER_EITHER ,LOCATION_MZONE | LOCATION_GRAVE )
4949end
5050function s .disrmop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
5151 local b1 = Duel .IsChainDisablable (ev ) and Duel .GetFlagEffect (tp ,id )== 0
52- local b2 = Duel .IsExistingMatchingCard (aux .NecroValleyFilter (s .filter ),tp ,LOCATION_MZONE + LOCATION_GRAVE ,LOCATION_MZONE + LOCATION_GRAVE ,1 ,nil )
52+ local b2 = Duel .IsExistingMatchingCard (aux .NecroValleyFilter (s .filter ),tp ,LOCATION_MZONE | LOCATION_GRAVE ,LOCATION_MZONE | LOCATION_GRAVE ,1 ,nil )
5353 and Duel .GetFlagEffect (tp ,id + 1 )== 0
5454 local op = 0
5555 if b1 and b2 then op = Duel .SelectOption (tp ,aux .Stringid (id ,1 ),aux .Stringid (id ,2 ))
@@ -58,24 +58,25 @@ function s.disrmop(e,tp,eg,ep,ev,re,r,rp)
5858 else return end
5959 if op == 0 then
6060 Duel .NegateEffect (ev )
61- Duel .RegisterFlagEffect (tp ,id ,RESET_PHASE + PHASE_END ,0 ,1 )
61+ Duel .RegisterFlagEffect (tp ,id ,RESET_PHASE | PHASE_END ,0 ,1 )
6262 else
6363 Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_REMOVE )
64- local g = Duel .SelectMatchingCard (tp ,aux .NecroValleyFilter (s .filter ),tp ,LOCATION_MZONE + LOCATION_GRAVE ,LOCATION_MZONE + LOCATION_GRAVE ,1 ,1 ,nil )
64+ local g = Duel .SelectMatchingCard (tp ,aux .NecroValleyFilter (s .filter ),tp ,LOCATION_MZONE | LOCATION_GRAVE ,LOCATION_MZONE | LOCATION_GRAVE ,1 ,1 ,nil )
6565 Duel .Remove (g ,POS_FACEUP ,REASON_EFFECT )
66- Duel .RegisterFlagEffect (tp ,id + 1 ,RESET_PHASE + PHASE_END ,0 ,1 )
66+ Duel .RegisterFlagEffect (tp ,id + 1 ,RESET_PHASE | PHASE_END ,0 ,1 )
6767 end
6868end
6969function s .spcon (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
7070 return Duel .IsExistingMatchingCard (Card .IsFaceup ,tp ,LOCATION_FZONE ,LOCATION_FZONE ,1 ,nil )
7171end
7272function s .sptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
73+ local c = e :GetHandler ()
7374 if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
74- and e : GetHandler () :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false ) end
75- Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,e : GetHandler () ,1 ,0 ,0 )
75+ and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false ) end
76+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,c ,1 ,tp ,0 )
7677end
7778function s .spop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
7879 local c = e :GetHandler ()
7980 if not c :IsRelateToEffect (e ) then return end
8081 Duel .SpecialSummon (c ,0 ,tp ,tp ,false ,false ,POS_FACEUP_DEFENSE )
81- end
82+ end
0 commit comments