11-- No More Mrs. Nice Mai!
2+ -- Re-scripted by The Razgriz
23local s ,id = GetID ()
34function s .initial_effect (c )
4- aux .AddSkillProcedure (c ,1 ,false )
5+ -- Activate
6+ aux .AddSkillProcedure (c ,1 ,false ,s .flipcon ,s .flipop )
57 local e1 = Effect .CreateEffect (c )
6- e1 :SetProperty (EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_DISABLE )
78 e1 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS )
9+ e1 :SetProperty (EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_DISABLE )
810 e1 :SetCode (EVENT_STARTUP )
911 e1 :SetCountLimit (1 )
1012 e1 :SetRange (0x5f )
13+ e1 :SetLabelObject (e )
1114 e1 :SetLabel (0 )
12- e1 :SetOperation (s .flipop2 )
15+ e1 :SetOperation (s .op )
1316 c :RegisterEffect (e1 )
1417end
15- function s .flipop2 (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
16- -- immune
17- local e1 = Effect .CreateEffect (e :GetHandler ())
18+ function s .op (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
19+ local c = e :GetHandler ()
20+ -- Effect handling for battle damage from your monsters
21+ aux .GlobalCheck (s ,function ()
22+ local ge1 = Effect .CreateEffect (c )
23+ ge1 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS )
24+ ge1 :SetProperty (EFFECT_FLAG_DAMAGE_STEP )
25+ ge1 :SetCode (EVENT_BATTLE_DAMAGE )
26+ ge1 :SetCondition (function (e ,tp ,eg ,ep ,ev ,re ,r ,rp ) return ep == 1 - tp end )
27+ ge1 :SetOperation (s .checkop )
28+ Duel .RegisterEffect (ge1 ,0 )
29+ end )
30+ -- Destroy 1 Spell/Trap card on the field
31+ local e1 = Effect .CreateEffect (c )
1832 e1 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS )
19- e1 :SetCode (EVENT_BATTLE_DESTROYING )
33+ e1 :SetCode (EVENT_PHASE |PHASE_BATTLE )
34+ e1 :SetRange (0x5f )
35+ e1 :SetCountLimit (1 )
2036 e1 :SetCondition (s .descon )
2137 e1 :SetOperation (s .desop )
2238 Duel .RegisterEffect (e1 ,tp )
2339end
24- function s .afilter (c ,tp )
25- return c :IsControler (tp )
26- end
27- function s .descon (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
28- return eg :IsExists (s .afilter ,1 ,nil ,tp )
29- and Duel .IsExistingMatchingCard (s .filter ,tp ,LOCATION_ONFIELD ,LOCATION_ONFIELD ,1 ,nil )
40+ function s .checkop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
41+ if eg :IsExists (Card .IsControler ,1 ,nil ,tp ) then
42+ -- OPT damage flag register
43+ Duel .RegisterFlagEffect (tp ,id + 100 ,RESET_PHASE |PHASE_END ,0 ,1 )
44+ end
3045end
31- function s .filter ( c )
32- return c : IsType ( TYPE_SPELL + TYPE_TRAP )
46+ function s .flipcon ( e , tp , eg , ep , ev , re , r , rp )
47+ return aux . CanActivateSkill ( tp ) and Duel . GetFlagEffect ( tp , id ) == 0
3348end
34- function s .desop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
49+ function s .flipop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
3550 Duel .Hint (HINT_SKILL_FLIP ,tp ,id |(1 << 32 ))
3651 Duel .Hint (HINT_CARD ,tp ,id )
37- -- opt register
38- Duel .RegisterFlagEffect (tp ,id + 1 ,RESET_PHASE + PHASE_END ,0 ,0 )
39- local dg = Duel .GetMatchingGroup (s .filter ,tp ,LOCATION_ONFIELD ,LOCATION_ONFIELD ,nil )
40- Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_DESTROY )
41- local sg = dg :Select (tp ,1 ,1 ,nil )
42- Duel .HintSelection (sg )
43- Duel .Destroy (sg ,REASON_EFFECT )
44- end
52+ Duel .RegisterFlagEffect (tp ,id ,0 ,0 ,0 )
53+ Duel .ResetFlagEffect (tp ,id + 100 ,0 ,0 ,0 )
54+ end
55+ function s .descon (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
56+ return Duel .IsTurnPlayer (tp ) and Duel .IsExistingMatchingCard (Card .IsSpellTrap ,tp ,LOCATION_ONFIELD ,LOCATION_ONFIELD ,1 ,nil ) and Duel .GetFlagEffect (tp ,id + 100 )> 0
57+ end
58+ function s .desop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
59+ if Duel .SelectYesNo (tp ,aux .Stringid (id ,0 )) then
60+ Duel .Hint (HINT_SKILL_FLIP ,tp ,id |(1 << 32 ))
61+ Duel .Hint (HINT_CARD ,tp ,id )
62+ -- Destroy 1 Spell/Trap Card on the field
63+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_DESTROY )
64+ local g = Duel .SelectMatchingCard (tp ,Card .IsSpellTrap ,tp ,LOCATION_ONFIELD ,LOCATION_ONFIELD ,1 ,1 ,nil )
65+ if # g > 0 then
66+ Duel .HintSelection (g ,true )
67+ Duel .Destroy (g ,REASON_EFFECT )
68+ end
69+ end
70+ end
0 commit comments