22-- Skull Conductor
33local s ,id = GetID ()
44function s .initial_effect (c )
5- -- destroy
5+ -- Destroy this face-up card
66 local e1 = Effect .CreateEffect (c )
77 e1 :SetDescription (aux .Stringid (id ,0 ))
88 e1 :SetCategory (CATEGORY_DESTROY )
99 e1 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F )
10+ e1 :SetCode (EVENT_PHASE |PHASE_BATTLE )
1011 e1 :SetRange (LOCATION_MZONE )
1112 e1 :SetCountLimit (1 )
12- e1 :SetCode (EVENT_PHASE |PHASE_BATTLE )
1313 e1 :SetTarget (s .destg )
1414 e1 :SetOperation (s .desop )
1515 c :RegisterEffect (e1 )
16- -- spsummon
16+ -- Special Summon up to 2 Zombie-Type monsters from your hand whose combined ATK is exactly 2000
1717 local e2 = Effect .CreateEffect (c )
1818 e2 :SetDescription (aux .Stringid (id ,1 ))
1919 e2 :SetCategory (CATEGORY_SPECIAL_SUMMON )
@@ -26,47 +26,42 @@ function s.initial_effect(c)
2626end
2727function s .destg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
2828 if chk == 0 then return true end
29- Duel .SetOperationInfo (0 ,CATEGORY_DESTROY ,e :GetHandler (),1 ,0 ,0 )
29+ Duel .SetOperationInfo (0 ,CATEGORY_DESTROY ,e :GetHandler (),1 ,tp ,0 )
3030end
3131function s .desop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
3232 local c = e :GetHandler ()
3333 if c :IsRelateToEffect (e ) and c :IsFaceup () then
3434 Duel .Destroy (c ,REASON_EFFECT )
3535 end
3636end
37- function s .spfilter (c ,e ,tp ,satk )
38- local atk = c :GetAttack ()
39- return atk >= 0 and (not satk or atk == satk ) and c :IsRace (RACE_ZOMBIE )
40- and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
37+ function s .spfilter (c ,e ,tp )
38+ return c :IsRace (RACE_ZOMBIE ) and c :IsAttackAbove (0 ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
39+ end
40+ function s .rescon (ft )
41+ return function (sg ,e ,tp ,mg )
42+ return ft >=# sg and sg :GetSum (Card .GetAttack )== 2000 ,ft <# sg
43+ end
4144end
4245function s .sptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
4346 if chk == 0 then
4447 local ft = Duel .GetLocationCount (tp ,LOCATION_MZONE )
4548 if ft <= 0 then return false end
46- if ft == 1 or Duel .IsPlayerAffectedByEffect (tp ,CARD_BLUEEYES_SPIRIT ) then
47- return Duel .IsExistingMatchingCard (s .spfilter ,tp ,LOCATION_HAND ,0 ,1 ,e :GetHandler (),e ,tp ,2000 )
48- else
49- local g = Duel .GetMatchingGroup (s .spfilter ,tp ,LOCATION_HAND ,0 ,e :GetHandler (),e ,tp )
50- return g :CheckWithSumEqual (Card .GetAttack ,2000 ,1 ,2 )
51- end
49+ ft = math.min (ft ,2 )
50+ if Duel .IsPlayerAffectedByEffect (tp ,CARD_BLUEEYES_SPIRIT ) then ft = 1 end
51+ local g = Duel .GetMatchingGroup (s .spfilter ,tp ,LOCATION_HAND ,0 ,e :GetHandler (),e ,tp )
52+ return # g > 0 and aux .SelectUnselectGroup (g ,e ,tp ,1 ,ft ,s .rescon (ft ),0 )
5253 end
5354 Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,LOCATION_HAND )
5455end
5556function s .spop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
5657 local ft = Duel .GetLocationCount (tp ,LOCATION_MZONE )
57- if ft <= 0 then return end
58- if ft == 1 or Duel .IsPlayerAffectedByEffect (tp ,CARD_BLUEEYES_SPIRIT ) then
59- Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
60- local g = Duel .SelectMatchingCard (tp ,s .spfilter ,tp ,LOCATION_HAND ,0 ,1 ,1 ,nil ,e ,tp ,2000 )
61- if # g > 0 then
62- Duel .SpecialSummon (g ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
63- end
64- else
65- local g = Duel .GetMatchingGroup (s .spfilter ,tp ,LOCATION_HAND ,0 ,nil ,e ,tp )
66- if g :CheckWithSumEqual (Card .GetAttack ,2000 ,1 ,2 ) then
67- Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
68- local sg = g :SelectWithSumEqual (tp ,Card .GetAttack ,2000 ,1 ,2 )
69- Duel .SpecialSummon (sg ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
70- end
58+ if ft <= 0 then return false end
59+ ft = math.min (ft ,2 )
60+ if Duel .IsPlayerAffectedByEffect (tp ,CARD_BLUEEYES_SPIRIT ) then ft = 1 end
61+ local g = Duel .GetMatchingGroup (s .spfilter ,tp ,LOCATION_HAND ,0 ,nil ,e ,tp )
62+ if # g == 0 then return end
63+ local sg = aux .SelectUnselectGroup (g ,e ,tp ,1 ,ft ,s .rescon (ft ),1 ,tp ,HINTMSG_SPSUMMON ,s .rescon (ft ))
64+ if # sg > 0 then
65+ Duel .SpecialSummon (sg ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
7166 end
72- end
67+ end
0 commit comments