1+ -- 神芸なる知恵の乙女
2+ -- Artmage Non Finito
3+ -- scripted by Naim
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ c :EnableReviveLimit ()
7+ -- Fusion Materials: 2 "Artmage" monsters
8+ Fusion .AddProcMixN (c ,true ,true ,aux .FilterBoolFunctionEx (Card .IsSetCard ,SET_ARTMAGE ),2 )
9+ c :AddMustBeFusionSummoned ()
10+ -- You can only Fusion Summon or Special Summon by its alternate procedure "Artmage Nonfinite" once per turn
11+ local e0 = Effect .CreateEffect (c )
12+ e0 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS )
13+ e0 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE )
14+ e0 :SetCode (EVENT_SPSUMMON_SUCCESS )
15+ e0 :SetCondition (s .regcon )
16+ e0 :SetOperation (s .regop )
17+ c :RegisterEffect (e0 )
18+ -- You can Special Summon this card by discarding 1 Spell/Trap and Tributing 1 Level 7 or higher "Artmage" monster in your hand or field
19+ local e1 = Effect .CreateEffect (c )
20+ e1 :SetDescription (aux .Stringid (id ,0 ))
21+ e1 :SetType (EFFECT_TYPE_FIELD )
22+ e1 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE )
23+ e1 :SetCode (EFFECT_SPSUMMON_PROC )
24+ e1 :SetRange (LOCATION_EXTRA )
25+ e1 :SetCondition (s .selfspcon )
26+ e1 :SetTarget (s .selfsptg )
27+ e1 :SetOperation (s .selfspop )
28+ e1 :SetValue (1 )
29+ c :RegisterEffect (e1 )
30+ -- Set 1 "Artmage" Spell/Trap from your Deck
31+ local e2 = Effect .CreateEffect (c )
32+ e2 :SetDescription (aux .Stringid (id ,1 ))
33+ e2 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
34+ e2 :SetProperty (EFFECT_FLAG_DELAY )
35+ e2 :SetCode (EVENT_SPSUMMON_SUCCESS )
36+ e2 :SetTarget (s .settg )
37+ e2 :SetOperation (s .setop )
38+ c :RegisterEffect (e2 )
39+ -- Fusion Summon 1 Fusion Monster by using monsters you control
40+ local fusion_params = {handler = c ,matfilter = Fusion .OnFieldMat }
41+ local e3 = Effect .CreateEffect (c )
42+ e3 :SetDescription (aux .Stringid (id ,2 ))
43+ e3 :SetCategory (CATEGORY_SPECIAL_SUMMON + CATEGORY_FUSION_SUMMON )
44+ e3 :SetType (EFFECT_TYPE_QUICK_O )
45+ e3 :SetCode (EVENT_FREE_CHAIN )
46+ e3 :SetRange (LOCATION_MZONE )
47+ e3 :SetCountLimit (1 )
48+ e3 :SetCondition (function (e ,tp ) return Duel .IsTurnPlayer (1 - tp ) end )
49+ e3 :SetTarget (Fusion .SummonEffTG (fusion_params ))
50+ e3 :SetOperation (Fusion .SummonEffOP (fusion_params ))
51+ e3 :SetHintTiming (0 ,TIMING_STANDBY_PHASE |TIMING_MAIN_END |TIMINGS_CHECK_MONSTER_E )
52+ c :RegisterEffect (e3 )
53+ end
54+ s .listed_series = {SET_ARTMAGE }
55+ s .listed_names = {id }
56+ function s .regcon (e )
57+ local c = e :GetHandler ()
58+ return c :IsFusionSummoned () or c :IsSummonType (SUMMON_TYPE_SPECIAL + 1 )
59+ end
60+ function s .regop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
61+ -- Prevent another Fusion Summon or Special Summon by its alternate procedure of "Artmage Nonfinite" that turn
62+ local e1 = Effect .CreateEffect (e :GetHandler ())
63+ e1 :SetType (EFFECT_TYPE_FIELD )
64+ e1 :SetProperty (EFFECT_FLAG_PLAYER_TARGET )
65+ e1 :SetCode (EFFECT_CANNOT_SPECIAL_SUMMON )
66+ e1 :SetTargetRange (1 ,0 )
67+ e1 :SetTarget (function (e ,c ,sump ,sumtype )
68+ return c :IsCode (id ) and (sumtype &SUMMON_TYPE_FUSION == SUMMON_TYPE_FUSION or sumtype &SUMMON_TYPE_SPECIAL + 1 == SUMMON_TYPE_SPECIAL + 1 )
69+ end )
70+ e1 :SetReset (RESET_PHASE |PHASE_END )
71+ Duel .RegisterEffect (e1 ,tp )
72+ end
73+ function s .selfspcostfilter (c ,tp ,fc )
74+ return c :IsLevelAbove (7 ) and c :IsSetCard (SET_ARTMAGE ) and Duel .GetLocationCountFromEx (tp ,tp ,c ,fc )> 0
75+ end
76+ function s .selfspcon (e ,c )
77+ if not c then return true end
78+ if c :IsFaceup () then return false end
79+ local tp = c :GetControler ()
80+ return Duel .IsExistingMatchingCard (aux .AND (Card .IsSpellTrap ,Card .IsDiscardable ),tp ,LOCATION_HAND ,0 ,1 ,nil )
81+ and Duel .CheckReleaseGroup (tp ,s .selfspcostfilter ,1 ,true ,1 ,true ,c ,tp ,nil ,nil ,nil ,tp ,c )
82+ end
83+ function s .selfsptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,c )
84+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_DISCARD )
85+ local dg = Duel .SelectMatchingCard (tp ,aux .AND (Card .IsSpellTrap ,Card .IsDiscardable ),tp ,LOCATION_HAND ,0 ,1 ,1 ,true ,nil )
86+ if not dg then return false end
87+ local rg = Duel .SelectReleaseGroup (tp ,s .selfspcostfilter ,1 ,1 ,true ,true ,true ,c ,tp ,nil ,false ,nil ,tp ,c )
88+ if not rg then return false end
89+ e :SetLabelObject (dg + rg )
90+ return true
91+ end
92+ function s .selfspop (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,c )
93+ local g = e :GetLabelObject ()
94+ if not g or # g ~= 2 then return end
95+ local dg ,rg = g :Split (Card .IsSpellTrap ,nil )
96+ Duel .SendtoGrave (dg ,REASON_COST |REASON_MATERIAL |REASON_DISCARD )
97+ Duel .Release (rg ,REASON_COST |REASON_MATERIAL )
98+ end
99+ function s .setfilter (c )
100+ return c :IsSetCard (SET_ARTMAGE ) and c :IsSpellTrap () and c :IsSSetable ()
101+ end
102+ function s .settg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
103+ if chk == 0 then return Duel .IsExistingMatchingCard (s .setfilter ,tp ,LOCATION_DECK ,0 ,1 ,nil ) end
104+ end
105+ function s .setop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
106+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SET )
107+ local g = Duel .SelectMatchingCard (tp ,s .setfilter ,tp ,LOCATION_DECK ,0 ,1 ,1 ,nil )
108+ if # g > 0 then
109+ Duel .SSet (tp ,g )
110+ end
111+ end
0 commit comments