1+ -- 覚醒のステゴケラトプス
2+ -- Awakened Stegoceratops
3+ -- Scripted by YoshiDuels
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Mill and add to hand
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetCategory (CATEGORY_DECKDES + CATEGORY_TOHAND )
10+ e1 :SetType (EFFECT_TYPE_IGNITION )
11+ e1 :SetRange (LOCATION_MZONE )
12+ e1 :SetCountLimit (1 )
13+ e1 :SetCondition (s .condition )
14+ e1 :SetCost (s .cost )
15+ e1 :SetTarget (s .target )
16+ e1 :SetOperation (s .operation )
17+ c :RegisterEffect (e1 )
18+ end
19+ s .listed_names = {160213051 } -- Ultra Evolution Miracle
20+ function s .filter (c )
21+ return c :IsMonster () and not c :IsRace (RACE_DINOSAUR )
22+ end
23+ function s .condition (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
24+ return Duel .IsExistingMatchingCard (Card .IsMonster ,tp ,LOCATION_GRAVE ,0 ,1 ,nil )
25+ and not Duel .IsExistingMatchingCard (s .filter ,tp ,LOCATION_GRAVE ,0 ,1 ,nil )
26+ end
27+ function s .cost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
28+ if chk == 0 then return Duel .CheckLPCost (tp ,500 ) end
29+ end
30+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
31+ if chk == 0 then return Duel .IsPlayerCanDiscardDeck (tp ,3 ) end
32+ Duel .SetOperationInfo (0 ,CATEGORY_DECKDES ,nil ,0 ,tp ,3 )
33+ Duel .SetPossibleOperationInfo (0 ,CATEGORY_TOHAND ,nil ,1 ,tp ,LOCATION_GRAVE )
34+ end
35+ function s .thfilter (c )
36+ return (c :IsCode (160213051 ) or (c :IsMonster () and c :IsRace (RACE_DINOSAUR ) and c :IsAttribute (ATTRIBUTE_EARTH ) and c :IsAttack (1100 ))) and c :IsAbleToHand ()
37+ end
38+ function s .operation (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
39+ -- Requirement
40+ Duel .PayLPCost (tp ,500 )
41+ -- Effect
42+ if Duel .DiscardDeck (tp ,3 ,REASON_EFFECT )< 1 then return end
43+ if Duel .IsExistingMatchingCard (aux .NecroValleyFilter (s .thfilter ),tp ,LOCATION_GRAVE ,0 ,1 ,nil ) and Duel .SelectYesNo (tp ,aux .Stringid (id ,1 )) then
44+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_ATOHAND )
45+ local g = Duel .SelectMatchingCard (tp ,aux .NecroValleyFilter (s .thfilter ),tp ,LOCATION_GRAVE ,0 ,1 ,1 ,nil )
46+ if # g > 0 then
47+ Duel .BreakEffect ()
48+ Duel .SendtoHand (g ,nil ,REASON_EFFECT )
49+ Duel .ConfirmCards (1 - tp ,g )
50+ end
51+ end
52+ end
0 commit comments