11-- 地獄蛆
2+ -- Hell Grub
23Duel .LoadScript (" c420.lua" )
34local s ,id = GetID ()
45function s .initial_effect (c )
5- -- spsummon
6+ -- Special Summon 1 Synchro Monster that was previously Summoned this Duel with its effects negated
67 local e1 = Effect .CreateEffect (c )
78 e1 :SetDescription (aux .Stringid (38667773 ,0 ))
89 e1 :SetCategory (CATEGORY_SPECIAL_SUMMON )
9- e1 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F )
10+ e1 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
1011 e1 :SetCode (EVENT_SUMMON_SUCCESS )
1112 e1 :SetCost (s .spcost )
1213 e1 :SetTarget (s .sptg )
@@ -21,29 +22,33 @@ function s.initial_effect(c)
2122 aux .GlobalCheck (s ,function ()
2223 local ge1 = Effect .CreateEffect (c )
2324 ge1 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS )
24- ge1 :SetCode (EVENT_SUMMON_SUCCESS )
25+ ge1 :SetCode (EVENT_SPSUMMON_SUCCESS )
2526 ge1 :SetProperty (EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DELAY )
2627 ge1 :SetOperation (s .checkop )
2728 Duel .RegisterEffect (ge1 ,0 )
2829 local ge2 = ge1 :Clone ()
2930 ge2 :SetCode (EVENT_FLIP_SUMMON_SUCCESS )
3031 Duel .RegisterEffect (ge2 ,0 )
31- local ge3 = ge1 :Clone ()
32- ge3 :SetCode (EVENT_SPSUMMON_SUCCESS )
33- Duel .RegisterEffect (ge3 ,0 )
3432 end )
3533end
36- function s .costfilter (c ,e ,tp )
37- return c :IsHell () and c :IsAbleToGraveAsCost ()
34+ s .listed_series = {0x567 } -- "Hell" archetype
35+ function s .checkop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
36+ local g = eg :Filter (Card .IsSynchroMonster ,nil )
37+ for tc in g :Iter () do
38+ tc :RegisterFlagEffect (id ,0 ,0 ,0 )
39+ end
40+ end
41+ function s .spcostfilter (c )
42+ return c :IsHell () and c :IsMonster () and c :IsAbleToGraveAsCost ()
3843end
3944function s .spcost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
40- if chk == 0 then return Duel .IsExistingMatchingCard (s .costfilter ,tp ,LOCATION_MZONE ,0 ,1 ,e : GetHandler () ) end
45+ if chk == 0 then return Duel .IsExistingMatchingCard (s .spcostfilter ,tp ,LOCATION_HAND ,0 ,1 ,nil ) end
4146 Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TOGRAVE )
42- local cc = Duel .SelectMatchingCard (tp ,s .costfilter ,tp ,LOCATION_MZONE ,0 ,1 ,1 ,e : GetHandler () )
43- Duel .SendtoGrave (cc ,REASON_COST )
47+ local sc = Duel .SelectMatchingCard (tp ,s .spcostfilter ,tp ,LOCATION_HAND ,0 ,1 ,1 ,nil )
48+ Duel .SendtoGrave (sc ,REASON_COST )
4449end
45- function s .filter (c ,e ,tp )
46- if c : GetFlagEffect (id )== 0 or not c :IsType (TYPE_SYNCHRO ) or not c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false ) then return false end
50+ function s .spfilter (c ,e ,tp )
51+ if not c : HasFlagEffect (id ) or not c :IsType (TYPE_SYNCHRO ) or not c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false ) then return false end
4752 if c :IsLocation (LOCATION_EXTRA ) then
4853 return Duel .GetLocationCountFromEx (tp )> 0
4954 else
@@ -55,27 +60,11 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
5560 Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,LOCATION_EXTRA |LOCATION_GRAVE |LOCATION_REMOVED )
5661end
5762function s .spop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
63+ local c = e :GetHandler ()
5864 Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
59- local tc = Duel .SelectMatchingCard (tp ,aux .NecroValleyFilter (s .filter ),tp ,LOCATION_EXTRA |LOCATION_GRAVE |LOCATION_REMOVED ,0 ,1 ,1 ,nil ,e ,tp ):GetFirst ()
65+ local tc = Duel .SelectMatchingCard (tp ,aux .NecroValleyFilter (s .spfilter ),tp ,LOCATION_EXTRA |LOCATION_GRAVE |LOCATION_REMOVED ,0 ,1 ,1 ,nil ,e ,tp ):GetFirst ()
6066 if tc and Duel .SpecialSummonStep (tc ,0 ,tp ,tp ,false ,false ,POS_FACEUP ) then
61- local e1 = Effect .CreateEffect (e :GetHandler ())
62- e1 :SetType (EFFECT_TYPE_SINGLE )
63- e1 :SetCode (EFFECT_DISABLE )
64- e1 :SetReset (RESET_EVENT + RESETS_STANDARD )
65- tc :RegisterEffect (e1 )
66- local e2 = Effect .CreateEffect (e :GetHandler ())
67- e2 :SetType (EFFECT_TYPE_SINGLE )
68- e2 :SetCode (EFFECT_DISABLE_EFFECT )
69- e2 :SetReset (RESET_EVENT + RESETS_STANDARD )
70- tc :RegisterEffect (e2 )
67+ tc :NegateEffects (c )
7168 Duel .SpecialSummonComplete ()
7269 end
7370end
74- function s .checkop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
75- local g = eg :Filter (Card .IsType ,nil ,TYPE_SYNCHRO )
76- local tc = g :GetFirst ()
77- while tc do
78- tc :RegisterFlagEffect (id ,0 ,0 ,0 )
79- tc = g :GetNext ()
80- end
81- end
0 commit comments