33-- Scripted by Eerie Code
44local s ,id = GetID ()
55function s .initial_effect (c )
6- -- Activate
6+ -- Add 2 "Malefic" cards from the Deck to the hand
77 local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
89 e1 :SetCategory (CATEGORY_TOHAND + CATEGORY_SEARCH )
910 e1 :SetType (EFFECT_TYPE_ACTIVATE )
1011 e1 :SetCode (EVENT_FREE_CHAIN )
@@ -14,36 +15,42 @@ function s.initial_effect(c)
1415 e1 :SetOperation (s .activate )
1516 c :RegisterEffect (e1 )
1617end
17- s .listed_series = {0x23 }
18- s .listed_names = {18378992 }
18+ s .listed_series = {SET_MALEFIC }
19+ s .listed_names = {id }
1920function s .cfilter (c )
20- return c :IsSetCard (0x23 ) and c :IsAbleToRemoveAsCost () and aux .SpElimFilter (c ,true )
21+ return c :IsSetCard (SET_MALEFIC ) and c :IsAbleToRemoveAsCost () and aux .SpElimFilter (c ,true )
2122end
22- function s .filter (c ,g )
23- return c :IsSetCard (0x23 ) and not c :IsCode (id ) and c :IsAbleToHand () and not g :IsExists (Card .IsCode ,1 ,nil ,c :GetCode ())
23+ function s .thfilter (c ,g )
24+ return c :IsSetCard (SET_MALEFIC ) and not c :IsCode (id ) and c :IsAbleToHand () and not g :IsExists (Card .IsCode ,1 ,nil ,c :GetCode ())
2425end
2526function s .rescon (sg ,e ,tp ,mg )
26- local g = Duel .GetMatchingGroup (s .filter ,tp ,LOCATION_DECK ,0 ,nil ,sg )
27+ local g = Duel .GetMatchingGroup (s .thfilter ,tp ,LOCATION_DECK ,0 ,nil ,sg )
2728 return g :GetClassCount (Card .GetCode )> 1
2829end
2930function s .cost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
30- local g = Duel .GetMatchingGroup (s .cfilter ,tp ,LOCATION_GRAVE + LOCATION_MZONE ,0 ,nil ,tp )
31- if chk == 0 then return aux .SelectUnselectGroup (g ,e ,tp ,2 ,2 ,s .rescon ,0 ) end
31+ e :SetLabel (100 )
32+ if chk == 0 then return true end
33+ end
34+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
35+ if chk == 0 then
36+ if e :GetLabel ()~= 100 then return false end
37+ local g = Duel .GetMatchingGroup (s .cfilter ,tp ,LOCATION_GRAVE |LOCATION_MZONE ,0 ,nil ,tp )
38+ return # g >= 2 and aux .SelectUnselectGroup (g ,e ,tp ,2 ,2 ,s .rescon ,0 )
39+ end
40+ local g = Duel .GetMatchingGroup (s .cfilter ,tp ,LOCATION_GRAVE |LOCATION_MZONE ,0 ,nil ,tp )
3241 local rg = aux .SelectUnselectGroup (g ,e ,tp ,2 ,2 ,s .rescon ,1 ,tp ,HINTMSG_REMOVE )
3342 Duel .Remove (rg ,POS_FACEUP ,REASON_COST )
3443 rg :KeepAlive ()
3544 e :SetLabelObject (rg )
36- end
37- function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
38- if chk == 0 then return true end
3945 Duel .SetOperationInfo (0 ,CATEGORY_TOHAND ,nil ,2 ,tp ,LOCATION_DECK )
4046end
4147function s .activate (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
4248 local rg = e :GetLabelObject ()
43- local hg = Duel .GetMatchingGroup (s .filter ,tp ,LOCATION_DECK ,0 ,nil ,rg )
49+ local hg = Duel .GetMatchingGroup (s .thfilter ,tp ,LOCATION_DECK ,0 ,nil ,rg )
4450 local g = aux .SelectUnselectGroup (hg ,e ,tp ,2 ,2 ,aux .dncheck ,1 ,tp ,HINTMSG_ATOHAND )
4551 if # g == 2 then
4652 Duel .SendtoHand (g ,nil ,REASON_EFFECT )
4753 Duel .ConfirmCards (1 - tp ,g )
4854 end
55+ rg :DeleteGroup ()
4956end
0 commit comments