3
3
-- Scripted by edo9300
4
4
local s ,id = GetID ()
5
5
function s .initial_effect (c )
6
- local e1 = Fusion .CreateSummonEff ({handler = c ,fusfilter = aux .FilterBoolFunction (Card .IsAttribute ,ATTRIBUTE_DARK ),extrafil = s .extrafil ,stage2 = s .stage2 })
7
- local tg = e1 :GetTarget ()
8
- local op = e1 :GetOperation ()
9
- e1 :SetTarget (s .target (tg ))
10
- e1 :SetOperation (s .operation (op ))
11
- e1 :SetCost (s .cost (tg ))
6
+ local e1 = Effect .CreateEffect (c )
7
+ e1 :SetDescription (aux .Stringid (id ,0 ))
8
+ e1 :SetCategory (CATEGORY_SPECIAL_SUMMON + CATEGORY_FUSION_SUMMON + CATEGORY_RECOVER )
9
+ e1 :SetType (EFFECT_TYPE_ACTIVATE )
10
+ e1 :SetCode (EVENT_FREE_CHAIN )
12
11
e1 :SetCountLimit (1 ,id ,EFFECT_COUNT_CODE_OATH )
12
+ e1 :SetCost (s .spcost )
13
+ e1 :SetTarget (s .sptg )
14
+ e1 :SetOperation (s .spop )
13
15
c :RegisterEffect (e1 )
14
16
end
15
17
s .listed_series = {SET_DARKLORD }
16
- function s .target (target )
17
- return function (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
18
- if chk == 0 then
19
- if e :GetLabel ()== 0 then
20
- return target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,0 )
21
- end
22
- e :SetLabel (0 )
23
- return true
24
- end
25
- e :SetLabel (0 )
26
- return target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
27
- end
28
- end
29
- function s .operation (operation )
30
- return function (e ,...)
31
- e :SetLabel (1 )
32
- local res = operation (e ,... )
33
- e :SetLabel (0 )
34
- return res
18
+ function s .fextra (exc )
19
+ return function (e ,tp ,mg )
20
+ return nil ,s .costcardcheck (exc )
35
21
end
36
22
end
37
- function s .check ( e )
23
+ function s .costcardcheck ( exc )
38
24
return function (tp ,sg ,fc )
39
- return e : GetLabel () == 1 or ( not e : GetLabelObject () or not sg :IsContains (e : GetLabelObject () ))
25
+ return not ( exc and sg :IsContains (exc ))
40
26
end
41
27
end
42
- function s .extrafil (e ,tp ,mg1 )
43
- return nil ,s .check (e )
28
+ function s .costfilter (c ,e ,tp ,eg ,ep ,ev ,re ,r ,rp )
29
+ if not (c :IsSetCard (SET_DARKLORD ) and c :IsMonster () and (c :IsLocation (LOCATION_HAND ) or c :IsFaceup ()) and c :IsAbleToGraveAsCost ()) then return false end
30
+ local params = {fusfilter = aux .FilterBoolFunction (Card .IsAttribute ,ATTRIBUTE_DARK ),extrafil = s .fextra (c )}
31
+ return Fusion .SummonEffTG (params )(e ,tp ,eg ,ep ,ev ,re ,r ,rp ,0 )
44
32
end
45
- function s .costfilter (c ,target ,e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
46
- e :SetLabelObject (c )
47
- local res = c :IsSetCard (SET_DARKLORD ) and c :IsMonster () and (c :IsLocation (LOCATION_HAND ) or c :IsFaceup ())
48
- and c :IsAbleToGraveAsCost () and target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,0 )
49
- e :SetLabelObject (nil )
50
- return res
33
+ function s .spcost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
34
+ e :SetLabel (100 )
35
+ if chk == 0 then return Duel .IsExistingMatchingCard (s .costfilter ,tp ,LOCATION_HAND |LOCATION_MZONE ,0 ,1 ,nil ,e ,tp ,eg ,ep ,ev ,re ,r ,rp ) end
36
+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TOGRAVE )
37
+ local g = Duel .SelectMatchingCard (tp ,s .costfilter ,tp ,LOCATION_HAND |LOCATION_MZONE ,0 ,1 ,1 ,nil ,e ,tp ,eg ,ep ,ev ,re ,r ,rp )
38
+ Duel .SendtoGrave (g ,REASON_COST )
39
+ e :SetLabelObject (g :GetFirst ())
51
40
end
52
- function s .cost (target )
53
- return function (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
54
- if chk == 0 then
55
- e :SetLabel (0 )
56
- local res = Duel .IsExistingMatchingCard (s .costfilter ,tp ,LOCATION_HAND |LOCATION_MZONE ,0 ,1 ,nil ,target ,e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
57
- if res then e :SetLabel (1 ) end
58
- return res
59
- end
60
- Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TOGRAVE )
61
- local g = Duel .SelectMatchingCard (tp ,s .costfilter ,tp ,LOCATION_HAND |LOCATION_MZONE ,0 ,1 ,1 ,nil ,target ,e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
62
- Duel .SendtoGrave (g ,REASON_COST )
63
- e :SetLabelObject (g :GetFirst ())
41
+ function s .sptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
42
+ if chk == 0 then
43
+ local params = {fusfilter = aux .FilterBoolFunction (Card .IsAttribute ,ATTRIBUTE_DARK )}
44
+ return e :GetLabel ()== 100 or Fusion .SummonEffTG (params )(e ,tp ,eg ,ep ,ev ,re ,r ,rp ,0 )
45
+ end
46
+ local cost_card = e :GetLabelObject ()
47
+ if cost_card then
48
+ Duel .SetOperationInfo (0 ,CATEGORY_RECOVER ,nil ,1 ,tp ,cost_card :GetBaseAttack ())
49
+ end
50
+ end
51
+ function s .spop (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
52
+ local cost_card = e :GetLabelObject ()
53
+ local params = {}
54
+ if cost_card then
55
+ params = {fusfilter = aux .FilterBoolFunction (Card .IsAttribute ,ATTRIBUTE_DARK ),extrafil = s .fextra (cost_card ),stage2 = s .stage2 }
56
+ else
57
+ params = {fusfilter = aux .FilterBoolFunction (Card .IsAttribute ,ATTRIBUTE_DARK )}
64
58
end
59
+ Fusion .SummonEffOP (params )(e ,tp ,eg ,ep ,ev ,re ,r ,rp ,1 )
65
60
end
66
61
function s .stage2 (e ,tc ,tp ,sg ,chk )
67
62
if chk == 1 and e :IsHasType (EFFECT_TYPE_ACTIVATE ) and e :GetLabelObject () then
@@ -70,7 +65,6 @@ function s.stage2(e,tc,tp,sg,chk)
70
65
Duel .BreakEffect ()
71
66
Duel .Recover (tp ,lp ,REASON_EFFECT )
72
67
end
73
- e :SetLabel (0 )
74
68
e :SetLabelObject (nil )
75
69
end
76
70
end
0 commit comments