11-- 魔鍵銃-バトスバスター
2- -- Magikey Blaster - Batosbuster
2+ -- Magikey Mechmusket - Batosbuster
33-- Scripted by The Razgriz
44local s ,id = GetID ()
55function s .initial_effect (c )
66 c :EnableReviveLimit ()
7- -- Add 1 Magikey card from Deck to hand
7+ -- Add 1 " Magikey" card from your Deck to hand
88 local e1 = Effect .CreateEffect (c )
99 e1 :SetDescription (aux .Stringid (id ,0 ))
1010 e1 :SetCategory (CATEGORY_TOHAND + CATEGORY_SEARCH )
1111 e1 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
1212 e1 :SetProperty (EFFECT_FLAG_DELAY + EFFECT_FLAG_DAMAGE_STEP )
1313 e1 :SetCode (EVENT_SPSUMMON_SUCCESS )
1414 e1 :SetCountLimit (1 ,id )
15- e1 :SetCondition (s . thcon )
15+ e1 :SetCondition (function ( e ) return e : GetHandler (): IsRitualSummoned () end )
1616 e1 :SetTarget (s .thtg )
1717 e1 :SetOperation (s .thop )
1818 c :RegisterEffect (e1 )
19- -- Place cards on bottom of Deck to negate monster effect on battle
19+ -- Place cards on bottom of Deck to negate effects of attacking monster
2020 local e2 = Effect .CreateEffect (c )
2121 e2 :SetDescription (aux .Stringid (id ,1 ))
2222 e2 :SetCategory (CATEGORY_TODECK + CATEGORY_DISABLE + CATEGORY_DRAW )
@@ -29,13 +29,9 @@ function s.initial_effect(c)
2929 e2 :SetOperation (s .atkop )
3030 c :RegisterEffect (e2 )
3131end
32- s .listed_names = {99426088 }
33- s .listed_series = {0x167 }
34- function s .thcon (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
35- return e :GetHandler ():IsSummonType (SUMMON_TYPE_RITUAL )
36- end
32+ s .listed_series = {SET_MAGIKEY }
3733function s .thfilter (c )
38- return c :IsSetCard (0x167 ) and c :IsAbleToHand ()
34+ return c :IsSetCard (SET_MAGIKEY ) and c :IsAbleToHand ()
3935end
4036function s .thtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
4137 if chk == 0 then return Duel .IsExistingMatchingCard (s .thfilter ,tp ,LOCATION_DECK ,0 ,1 ,nil ) end
@@ -50,14 +46,15 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
5046 end
5147end
5248function s .atkfilter (c )
53- return c :IsMonster () and (c :IsType (TYPE_NORMAL ) or c :IsSetCard (0x167 ))
49+ return c :IsMonster () and (c :IsType (TYPE_NORMAL ) or c :IsSetCard (SET_MAGIKEY ))
5450end
5551function s .atkcon (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
52+ local g = Duel .GetMatchingGroup (s .atkfilter ,tp ,LOCATION_GRAVE ,0 ,nil )
5653 local c = e :GetHandler ()
5754 local bc = c :GetBattleTarget ()
5855 if bc and bc :IsFaceup () then
5956 local att = 0
60- for gc in aux . Next ( Duel . GetMatchingGroup ( s . atkfilter , tp , LOCATION_GRAVE , 0 , nil ) ) do
57+ for gc in g : Iter ( ) do
6158 att = att |gc :GetAttribute ()
6259 end
6360 return not bc :IsStatus (STATUS_DISABLED ) and bc :GetAttribute ()&att ~= 0
7370function s .atkop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
7471 local c = e :GetHandler ()
7572 local tc = c :GetBattleTarget ()
76- local hg = Duel .GetFieldGroupCount (tp ,LOCATION_HAND ,0 )
77- if hg == 0 then return end
73+ local hg = Duel .GetFieldGroup (tp ,LOCATION_HAND ,0 )
74+ if # hg == 0 then return end
7875 Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TODECK )
7976 local g = Duel .SelectMatchingCard (tp ,Card .IsAbleToDeck ,tp ,LOCATION_HAND ,0 ,1 ,hg ,nil )
80- if # g > 0 and Duel .SendtoDeck (g ,tp ,SEQ_DECKBOTTOM ,REASON_EFFECT )> 0
77+ if # g > 0 and Duel .SendtoDeck (g ,tp ,SEQ_DECKBOTTOM ,REASON_EFFECT )> 0 and g : FilterCount ( Card . IsLocation , LOCATION_DECK ) ==# g
8178 and tc and tc :IsRelateToBattle () and tc :IsFaceup () and tc :IsControler (1 - tp )
8279 and not tc :IsImmuneToEffect (e ) and not tc :IsStatus (STATUS_DISABLED ) then
83- -- Negate its effects
84- local e1 = Effect .CreateEffect (c )
85- e1 :SetType (EFFECT_TYPE_SINGLE )
86- e1 :SetCode (EFFECT_DISABLE )
87- e1 :SetReset (RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END )
88- tc :RegisterEffect (e1 ,true )
80+ -- Negate its effects, then draw cards equal to the number of cards placed under the Deck
81+ tc :NegateEffects (c ,RESETS_STANDARD_PHASE_END )
8982 Duel .BreakEffect ()
9083 Duel .Draw (tp ,# g ,REASON_EFFECT )
9184 end
0 commit comments