33-- scripted by Rundas
44local s ,id = GetID ()
55function s .initial_effect (c )
6- Fusion .AddProcMix (c ,true ,true ,aux .FilterBoolFunctionEx (Card .IsSetCard ,SET_DESPIA ),s .matfilter )
76 c :EnableReviveLimit ()
8- -- Change the ATK of all monsters currently on the field to 0, except Level 8 or higher Fusion Monsters
7+ -- Fusion Materials: 1 "Despia" monster + 1 LIGHT or DARK monster
8+ Fusion .AddProcMix (c ,true ,true ,aux .FilterBoolFunctionEx (Card .IsSetCard ,SET_DESPIA ),aux .FilterBoolFunctionEx (Card .IsAttribute ,ATTRIBUTE_LIGHT |ATTRIBUTE_DARK ))
9+ -- Change the ATK of all monsters currently on the field to 0 until the end of this turn, except Level 8 or higher Fusion Monsters
910 local e1 = Effect .CreateEffect (c )
1011 e1 :SetDescription (aux .Stringid (id ,0 ))
1112 e1 :SetCategory (CATEGORY_ATKCHANGE )
1213 e1 :SetType (EFFECT_TYPE_QUICK_O )
1314 e1 :SetCode (EVENT_FREE_CHAIN )
1415 e1 :SetRange (LOCATION_MZONE )
15- e1 :SetHintTiming (0 ,TIMING_MAIN_END )
1616 e1 :SetCountLimit (1 ,id )
17+ e1 :SetHintTiming (0 ,TIMING_MAIN_END |TIMINGS_CHECK_MONSTER )
1718 e1 :SetCondition (function () return Duel .IsMainPhase () end )
1819 e1 :SetTarget (s .atktg )
1920 e1 :SetOperation (s .atkop )
@@ -26,61 +27,57 @@ function s.initial_effect(c)
2627 e2 :SetProperty (EFFECT_FLAG_DELAY )
2728 e2 :SetCode (EVENT_LEAVE_FIELD )
2829 e2 :SetCountLimit (1 ,{id ,1 })
29- e2 :SetCondition (s .thcon )
30- e2 :SetTarget (s .thtg )
31- e2 :SetOperation (s .thop )
30+ e2 :SetCondition (s .thspcon )
31+ e2 :SetTarget (s .thsptg )
32+ e2 :SetOperation (s .thspop )
3233 c :RegisterEffect (e2 )
3334end
3435s .listed_series = {SET_DESPIA }
3536s .listed_names = {CARD_ALBAZ }
36- function s .matfilter (c ,fc ,st ,tp )
37- return c :IsAttribute (ATTRIBUTE_LIGHT ,fc ,st ,tp ) or c :IsAttribute (ATTRIBUTE_DARK ,fc ,st ,tp )
38- end
3937function s .atkfilter (c )
40- return c :IsFaceup () and c : GetAttack () > 0 and not (c :IsType ( TYPE_FUSION ) and c :IsLevelAbove ( 8 ))
38+ return c :HasNonZeroAttack () and not (c :IsLevelAbove ( 8 ) and c :IsType ( TYPE_FUSION ))
4139end
4240function s .atktg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
4341 local g = Duel .GetMatchingGroup (s .atkfilter ,tp ,LOCATION_MZONE ,LOCATION_MZONE ,nil )
4442 if chk == 0 then return # g > 0 end
45- Duel .SetOperationInfo (0 ,CATEGORY_ATKCHANGE ,g ,# g ,PLAYER_ALL , LOCATION_MZONE )
43+ Duel .SetOperationInfo (0 ,CATEGORY_ATKCHANGE ,g ,# g ,tp , 0 )
4644end
4745function s .atkop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
4846 local g = Duel .GetMatchingGroup (s .atkfilter ,tp ,LOCATION_MZONE ,LOCATION_MZONE ,nil )
4947 if # g == 0 then return end
5048 local c = e :GetHandler ()
5149 for tc in g :Iter () do
52- -- Change the ATK to 0 until the end of this turn
50+ -- Their ATK becomes 0 until the end of this turn
5351 local e1 = Effect .CreateEffect (c )
5452 e1 :SetType (EFFECT_TYPE_SINGLE )
53+ e1 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE )
5554 e1 :SetCode (EFFECT_SET_ATTACK_FINAL )
5655 e1 :SetValue (0 )
5756 e1 :SetReset (RESETS_STANDARD_PHASE_END )
5857 tc :RegisterEffect (e1 )
5958 end
6059end
61- function s .thcon (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
60+ function s .thspcon (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
6261 local c = e :GetHandler ()
6362 return rp == 1 - tp and c :IsReason (REASON_EFFECT ) and c :IsPreviousPosition (POS_FACEUP ) and c :IsPreviousControler (tp )
6463end
65- function s .thfilter (c ,e ,tp ,ft )
66- return (( c :IsSetCard (SET_DESPIA ) and c :IsMonster ( )) or c :IsCode ( CARD_ALBAZ ) )
67- and ( c : IsAbleToHand () or ( c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false ) and ft > 0 ))
64+ function s .thspfilter (c ,e ,tp ,mzone_chk )
65+ return (c :IsSetCard (SET_DESPIA ) or c :IsCode ( CARD_ALBAZ )) and c :IsMonster () and ( c : IsAbleToHand ( )
66+ or ( mzone_chk and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )))
6867end
69- function s .thtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
70- local ft = Duel .GetLocationCount (tp ,LOCATION_MZONE )
71- if chk == 0 then return Duel .IsExistingMatchingCard (s .thfilter ,tp ,LOCATION_DECK ,0 ,1 ,nil ,e ,tp ,ft ) end
68+ function s .thsptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
69+ if chk == 0 then return Duel .IsExistingMatchingCard (s .thspfilter ,tp ,LOCATION_DECK ,0 ,1 ,nil ,e ,tp ,Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0 ) end
7270 Duel .SetPossibleOperationInfo (0 ,CATEGORY_TOHAND ,nil ,1 ,tp ,LOCATION_DECK )
7371 Duel .SetPossibleOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,LOCATION_DECK )
7472end
75- function s .thop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
76- local ft = Duel .GetLocationCount (tp ,LOCATION_MZONE )
73+ function s .thspop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
74+ local mzone_chk = Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
7775 Duel .Hint (HINT_SELECTMSG ,tp ,aux .Stringid (id ,2 ))
78- local tc = Duel .SelectMatchingCard (tp ,s .thfilter ,tp ,LOCATION_DECK ,0 ,1 ,1 ,nil ,e ,tp ,ft ):GetFirst ()
79- if tc then
80- aux .ToHandOrElse (tc ,tp ,function (c )
81- return tc :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false ) and ft > 0 end ,
82- function (c )
83- Duel .SpecialSummon (tc ,0 ,tp ,tp ,false ,false ,POS_FACEUP ) end ,
84- aux .Stringid (id ,3 ))
85- end
86- end
76+ local sc = Duel .SelectMatchingCard (tp ,s .thspfilter ,tp ,LOCATION_DECK ,0 ,1 ,1 ,nil ,e ,tp ,mzone_chk ):GetFirst ()
77+ if not sc then return end
78+ aux .ToHandOrElse (sc ,tp ,
79+ function () return mzone_chk and sc :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false ) end ,
80+ function () Duel .SpecialSummon (sc ,0 ,tp ,tp ,false ,false ,POS_FACEUP ) end ,
81+ aux .Stringid (id ,3 )
82+ )
83+ end
0 commit comments