1+ -- 夕極精のコスモスター
2+ -- Cosmostar the White Hole Polairy
3+ -- scripted by YoshiDuels
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- fusion material
7+ c :EnableReviveLimit ()
8+ Fusion .AddProcMixN (c ,true ,true ,s .matfilter ,3 )
9+ -- Special Summon
10+ local e1 = Effect .CreateEffect (c )
11+ e1 :SetDescription (aux .Stringid (id ,1 ))
12+ e1 :SetCategory (CATEGORY_SPECIAL_SUMMON )
13+ e1 :SetType (EFFECT_TYPE_IGNITION )
14+ e1 :SetRange (LOCATION_MZONE )
15+ e1 :SetCountLimit (1 )
16+ e1 :SetCondition (s .condition )
17+ e1 :SetTarget (s .target )
18+ e1 :SetOperation (s .operation )
19+ c :RegisterEffect (e1 )
20+ end
21+ s .listed_names = {160017058 }
22+ function s .matfilter (c ,fc ,sumtype ,tp )
23+ return c :IsRace (RACE_GALAXY ,fc ,sumtype ,tp ) and c :IsAttack (900 )
24+ end
25+ function s .condition (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
26+ local c = e :GetHandler ()
27+ return c :IsSummonPhaseMain () and c :IsStatus (STATUS_SPSUMMON_TURN ) and c :IsSummonType (SUMMON_TYPE_FUSION )
28+ end
29+ function s .filter (c ,e ,tp )
30+ return c :IsRace (RACE_GALAXY ) and c :IsType (TYPE_FUSION ) and c :IsDefense (1900 ,2600 ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
31+ end
32+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
33+ if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
34+ and Duel .IsExistingMatchingCard (s .filter ,tp ,LOCATION_GRAVE ,0 ,1 ,nil ,e ,tp ) end
35+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,LOCATION_GRAVE )
36+ end
37+ function s .thfilter (c )
38+ return c :IsCode (160017058 ) and c :IsAbleToHand ()
39+ end
40+ function s .operation (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
41+ local c = e :GetHandler ()
42+ -- Effect
43+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
44+ local g = Duel .SelectMatchingCard (tp ,s .filter ,tp ,LOCATION_GRAVE ,0 ,1 ,1 ,nil ,e ,tp )
45+ if # g > 0 and Duel .SpecialSummon (g ,0 ,tp ,tp ,false ,false ,POS_FACEUP )> 0 then
46+ if Duel .IsExistingMatchingCard (aux .NecroValleyFilter (s .thfilter ),tp ,LOCATION_GRAVE ,0 ,1 ,nil ) and Duel .SelectYesNo (tp ,aux .Stringid (id ,1 )) then
47+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_ATOHAND )
48+ local g2 = Duel .SelectMatchingCard (tp ,aux .NecroValleyFilter (s .thfilter ),tp ,LOCATION_GRAVE ,0 ,1 ,1 ,nil )
49+ if # g2 > 0 then
50+ Duel .BreakEffect ()
51+ Duel .SendtoHand (g2 ,nil ,REASON_EFFECT )
52+ Duel .ConfirmCards (1 - tp ,g2 )
53+ end
54+ end
55+ end
56+ -- Cannot activate the effect of "Cosmostar the White Hole Polairy"
57+ local e1 = Effect .CreateEffect (c )
58+ e1 :SetDescription (aux .Stringid (id ,1 ))
59+ e1 :SetType (EFFECT_TYPE_FIELD )
60+ e1 :SetCode (EFFECT_CANNOT_ACTIVATE )
61+ e1 :SetProperty (EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CLIENT_HINT )
62+ e1 :SetTargetRange (1 ,0 )
63+ e1 :SetValue (s .aclimit )
64+ e1 :SetReset (RESET_PHASE |PHASE_END )
65+ Duel .RegisterEffect (e1 ,tp )
66+ end
67+ function s .aclimit (e ,re ,tp )
68+ return re :GetHandler ():IsCode (id )
69+ end
0 commit comments