33-- scripted by edo9300
44local s ,id = GetID ()
55function s .initial_effect (c )
6- local e1 = Ritual .CreateProc ({handler = c ,lvtype = RITPROC_EQUAL ,filter = aux .FilterBoolFunction (Card .IsSetCard ,SET_DOGMATIKA ),extrafil = s .extragroup ,
7- extraop = s .extraop ,stage2 = s .stage2 ,forcedselection = s .ritcheck })
6+ -- Ritual Summon any "Dogmatika" Ritual Monster
7+ local e1 = Ritual .CreateProc ({
8+ handler = c ,
9+ lvtype = RITPROC_EQUAL ,
10+ filter = function (c ) return c :IsSetCard (SET_DOGMATIKA ) end ,
11+ extrafil = function (e ,tp ) return Duel .GetMatchingGroup (aux .AND (Card .HasLevel ,Card .IsAbleToGrave ),tp ,LOCATION_EXTRA ,0 ,nil ) end ,
12+ extraop = s .extraop ,
13+ stage2 = s .stage2 ,
14+ forcedselection = s .ritcheck
15+ })
816 e1 :SetCountLimit (1 ,id ,EFFECT_COUNT_CODE_OATH )
917 c :RegisterEffect (e1 )
1018end
1119s .listed_series = {SET_DOGMATIKA }
12- function s .matfilter1 (c )
13- return c :IsAbleToGrave () and c :IsLevelAbove (1 )
14- end
15- function s .extragroup (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
16- return Duel .GetMatchingGroup (s .matfilter1 ,tp ,LOCATION_EXTRA ,0 ,nil )
17- end
1820function s .extraop (mat ,e ,tp ,eg ,ep ,ev ,re ,r ,rp ,tc )
19- local mat2 = mat :Filter (Card .IsLocation ,nil ,LOCATION_EXTRA )
20- mat :Sub (mat2 )
21- Duel .ReleaseRitualMaterial (mat )
22- Duel .SendtoGrave (mat2 ,REASON_EFFECT + REASON_MATERIAL + REASON_RITUAL )
21+ local extra_mat = mat :Filter (Card .IsLocation ,nil ,LOCATION_EXTRA )
22+ if # extra_mat > 0 then
23+ Duel .SendtoGrave (extra_mat ,REASON_EFFECT |REASON_MATERIAL |REASON_RITUAL )
24+ else
25+ Duel .ReleaseRitualMaterial (mat )
26+ end
2327end
2428function s .stage2 (mat ,e ,tp ,eg ,ep ,ev ,re ,r ,rp ,tc )
25- local e0 = Effect .CreateEffect (e :GetHandler ())
26- e0 :SetType (EFFECT_TYPE_FIELD )
27- e0 :SetProperty (EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CLIENT_HINT )
28- e0 :SetDescription (aux .Stringid (id ,0 ))
29- e0 :SetCode (EFFECT_CANNOT_SPECIAL_SUMMON )
30- e0 :SetReset (RESET_PHASE |PHASE_END |RESET_SELF_TURN )
31- e0 :SetTargetRange (1 ,0 )
32- e0 :SetTarget (s .splimit )
33- Duel .RegisterEffect (e0 ,tp )
34- end
35- function s .splimit (e ,c ,sump ,sumtype ,sumpos ,targetp )
36- return c :IsLocation (LOCATION_EXTRA )
29+ if not e :IsHasType (EFFECT_TYPE_ACTIVATE ) then return end
30+ -- For the rest of this turn after this card resolves, you cannot Special Summon monsters from the Extra Deck
31+ local e1 = Effect .CreateEffect (e :GetHandler ())
32+ e1 :SetDescription (aux .Stringid (id ,0 ))
33+ e1 :SetType (EFFECT_TYPE_FIELD )
34+ e1 :SetProperty (EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CLIENT_HINT )
35+ e1 :SetCode (EFFECT_CANNOT_SPECIAL_SUMMON )
36+ e1 :SetTargetRange (1 ,0 )
37+ e1 :SetTarget (function (e ,c ) return c :IsLocation (LOCATION_EXTRA ) end )
38+ e1 :SetReset (RESET_PHASE |PHASE_END )
39+ Duel .RegisterEffect (e1 ,tp )
3740end
3841function s .ritcheck (e ,tp ,g ,sc )
39- local extrac = g :FilterCount (Card .IsLocation ,nil ,LOCATION_EXTRA )
40- local gc =# g
41- return extrac == 0 or extrac == 1 and gc == 1 ,extrac > 1 or extrac == 1 and gc > 1
42- end
42+ local extra_ct = g :FilterCount (Card .IsLocation ,nil ,LOCATION_EXTRA )
43+ return extra_ct == 0 or # g == 1 ,extra_ct > 1 or (extra_ct == 1 and # g > 1 )
44+ end
0 commit comments