22-- Desrook Archfiend
33local s ,id = GetID ()
44function s .initial_effect (c )
5- -- maintain
5+ -- Once per turn, during your Standby Phase, you must pay 500 LP (this is not optional), or this card is destroyed
66 local e1 = Effect .CreateEffect (c )
77 e1 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS )
88 e1 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE )
99 e1 :SetCode (EVENT_PHASE + PHASE_STANDBY )
1010 e1 :SetRange (LOCATION_MZONE )
1111 e1 :SetCountLimit (1 )
12- e1 :SetCondition (s . mtcon )
12+ e1 :SetCondition (function ( e , tp ) return Duel . IsTurnPlayer ( tp ) end )
1313 e1 :SetOperation (s .mtop )
1414 c :RegisterEffect (e1 )
15- -- disable and destroy
15+ -- Roll a six-sided die when resolving an opponent's card effect that targets this card
1616 local e2 = Effect .CreateEffect (c )
1717 e2 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS )
1818 e2 :SetCode (EVENT_CHAIN_SOLVING )
1919 e2 :SetRange (LOCATION_MZONE )
2020 e2 :SetOperation (s .disop )
2121 c :RegisterEffect (e2 )
22- -- special summon
22+ -- Special Summon 1 "Terrorking Archfiend" from your GY
2323 local e3 = Effect .CreateEffect (c )
24- e3 :SetCategory (CATEGORY_SPECIAL_SUMMON )
2524 e3 :SetDescription (aux .Stringid (id ,0 ))
25+ e3 :SetCategory (CATEGORY_SPECIAL_SUMMON )
2626 e3 :SetType (EFFECT_TYPE_QUICK_O )
2727 e3 :SetProperty (EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_DAMAGE_STEP )
2828 e3 :SetCode (EVENT_TO_GRAVE )
2929 e3 :SetRange (LOCATION_HAND )
30- e3 :SetCost (s . spcost )
30+ e3 :SetCost (aux . SelfToGraveCost )
3131 e3 :SetTarget (s .sptg )
3232 e3 :SetOperation (s .spop )
3333 c :RegisterEffect (e3 )
3434end
35- s .listed_names = {35975813 }
35+ s .listed_names = {35975813 } -- "Terrorking Archfiend"
3636s .roll_dice = true
37- function s .mtcon (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
38- return Duel .GetTurnPlayer ()== tp
39- end
4037function s .mtop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
4138 if Duel .CheckLPCost (tp ,500 ) then
4239 Duel .PayLPCost (tp ,500 )
@@ -45,38 +42,36 @@ function s.mtop(e,tp,eg,ep,ev,re,r,rp)
4542 end
4643end
4744function s .disop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
48- if ep == tp then return end
4945 if not re :IsHasProperty (EFFECT_FLAG_CARD_TARGET ) then return false end
46+ local c = e :GetHandler ()
47+ if not (c :IsRelateToEffect (re ) and ep == 1 - tp ) then return end
5048 local tg = Duel .GetChainInfo (ev ,CHAININFO_TARGET_CARDS )
51- if not tg or not tg :IsContains (e : GetHandler () ) or not Duel .IsChainDisablable (ev ) then return false end
49+ if not tg or not tg :IsContains (c ) or not Duel .IsChainDisablable (ev ) then return false end
5250 local rc = re :GetHandler ()
51+ Duel .Hint (HINT_CARD ,1 - tp ,id )
5352 local dc = Duel .TossDice (tp ,1 )
5453 if dc ~= 3 then return end
5554 if Duel .NegateEffect (ev ) and rc :IsRelateToEffect (re ) then
5655 Duel .Destroy (rc ,REASON_EFFECT )
5756 end
5857end
59- function s .spcost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
60- if chk == 0 then return e :GetHandler ():IsAbleToGraveAsCost () end
61- Duel .SendtoGrave (e :GetHandler (),REASON_COST )
62- end
63- function s .filter (c ,e ,tp )
58+ function s .spfilter (c ,e ,tp )
6459 return c :IsCode (35975813 ) and c :IsPreviousControler (tp ) and c :IsPreviousLocation (LOCATION_ONFIELD )
65- and c :IsCanBeEffectTarget (e ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
60+ and c :IsReason ( REASON_DESTROY ) and c : IsCanBeEffectTarget (e ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
6661end
6762function s .sptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
68- if chkc then return eg :IsContains (chkc ) and s .filter (chkc ,e ,tp ) end
63+ if chkc then return eg :IsContains (chkc ) and s .spfilter (chkc ,e ,tp ) end
6964 if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
70- and eg :IsExists (s .filter ,1 ,nil ,e ,tp ) end
65+ and eg :IsExists (s .spfilter ,1 ,nil ,e ,tp ) end
7166 Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
72- local g = eg :FilterSelect (tp ,s .filter ,1 ,1 ,nil ,e ,tp )
67+ local g = eg :FilterSelect (tp ,s .spfilter ,1 ,1 ,nil ,e ,tp )
7368 Duel .SetTargetCard (g )
74- Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,g ,1 ,0 ,0 )
69+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,g ,1 ,tp ,0 )
7570end
7671function s .spop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
7772 if Duel .GetLocationCount (tp ,LOCATION_MZONE )<= 0 then return end
7873 local tc = Duel .GetFirstTarget ()
79- if tc and tc :IsRelateToEffect (e ) then
74+ if tc :IsRelateToEffect (e ) then
8075 Duel .SpecialSummon (tc ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
8176 end
82- end
77+ end
0 commit comments