1+ -- 正義の伝説 カイバーマン
2+ -- Legend of Justice Kaibaman
3+ -- scripted by Naim
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Show 3 "Blue-Eyes White Dragon" in your hand/Deck/field/GY, then Special Summon 1 "Blue-Eyes White Dragon" from your hand, Deck, or GY
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetCategory (CATEGORY_SPECIAL_SUMMON )
10+ e1 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
11+ e1 :SetProperty (EFFECT_FLAG_DELAY )
12+ e1 :SetCode (EVENT_SUMMON_SUCCESS )
13+ e1 :SetCountLimit (1 ,id )
14+ e1 :SetTarget (s .sptg )
15+ e1 :SetOperation (s .spop )
16+ c :RegisterEffect (e1 )
17+ local e2 = e1 :Clone ()
18+ e2 :SetCode (EVENT_SPSUMMON_SUCCESS )
19+ c :RegisterEffect (e2 )
20+ -- Add 1 "Blue-Eyes" monster from your Deck to your hand
21+ local e3 = Effect .CreateEffect (c )
22+ e3 :SetDescription (aux .Stringid (id ,1 ))
23+ e3 :SetCategory (CATEGORY_TOHAND + CATEGORY_SEARCH )
24+ e3 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O )
25+ e3 :SetProperty (EFFECT_FLAG_DELAY ,EFFECT_FLAG2_CHECK_SIMULTANEOUS )
26+ e3 :SetCode (EVENT_SPSUMMON_SUCCESS )
27+ e3 :SetRange (LOCATION_GRAVE )
28+ e3 :SetCountLimit (1 ,{id ,1 })
29+ e3 :SetCondition (s .thcon )
30+ e3 :SetCost (Cost .SelfBanish )
31+ e3 :SetTarget (s .thtg )
32+ e3 :SetOperation (s .thop )
33+ c :RegisterEffect (e3 )
34+ end
35+ s .listed_names = {CARD_BLUEEYES_W_DRAGON }
36+ s .listed_series = {SET_BLUE_EYES }
37+ function s .showfilter (c )
38+ return c :IsCode (CARD_BLUEEYES_W_DRAGON ) and (c :IsFaceup () or not c :IsOnField ())
39+ end
40+ function s .spfilter (c ,e ,tp )
41+ return c :IsCode (CARD_BLUEEYES_W_DRAGON ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
42+ end
43+ function s .sptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
44+ if chk == 0 then return Duel .IsExistingMatchingCard (s .showfilter ,tp ,LOCATION_HAND |LOCATION_DECK |LOCATION_ONFIELD |LOCATION_GRAVE ,0 ,3 ,nil )
45+ and Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
46+ and Duel .IsExistingMatchingCard (s .spfilter ,tp ,LOCATION_HAND |LOCATION_DECK |LOCATION_GRAVE ,0 ,1 ,nil ,e ,tp ) end
47+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,LOCATION_HAND |LOCATION_DECK |LOCATION_GRAVE )
48+ end
49+ function s .spop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
50+ local rg = Duel .GetMatchingGroup (s .showfilter ,tp ,LOCATION_HAND |LOCATION_DECK |LOCATION_ONFIELD |LOCATION_GRAVE ,0 ,nil )
51+ if # rg > 3 then
52+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_CONFIRM )
53+ rg = Duel .SelectMatchingCard (tp ,s .showfilter ,tp ,LOCATION_HAND |LOCATION_DECK |LOCATION_ONFIELD |LOCATION_GRAVE ,0 ,3 ,3 ,nil )
54+ end
55+ if # rg == 3 then
56+ local fieldgraveg ,handdeckg = rg :Split (Card .IsLocation ,nil ,LOCATION_ONFIELD |LOCATION_GRAVE )
57+ if # fieldgraveg > 0 then Duel .HintSelection (fieldgraveg ) end
58+ if # handdeckg > 0 then Duel .ConfirmCards (1 - tp ,handdeckg ) end
59+ if rg :IsExists (Card .IsLocation ,1 ,nil ,LOCATION_HAND ) then Duel .ShuffleHand (tp ) end
60+ if rg :IsExists (Card .IsLocation ,1 ,nil ,LOCATION_DECK ) then Duel .ShuffleDeck (tp ) end
61+ if Duel .GetLocationCount (tp ,LOCATION_MZONE )<= 0 then return end
62+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
63+ local g = Duel .SelectMatchingCard (tp ,aux .NecroValleyFilter (s .spfilter ),tp ,LOCATION_HAND |LOCATION_DECK |LOCATION_GRAVE ,0 ,1 ,1 ,nil ,e ,tp )
64+ if # g > 0 then
65+ Duel .BreakEffect ()
66+ Duel .SpecialSummon (g ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
67+ end
68+ end
69+ end
70+ function s .thconfilter (c ,tp )
71+ return c :IsCode (CARD_BLUEEYES_W_DRAGON ) and c :IsFaceup () and c :IsSummonPlayer (tp )
72+ end
73+ function s .thcon (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
74+ return eg :IsExists (s .thconfilter ,1 ,nil ,tp )
75+ end
76+ function s .thfilter (c )
77+ return c :IsSetCard (SET_BLUE_EYES ) and c :IsMonster () and c :IsAbleToHand ()
78+ end
79+ function s .thtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
80+ if chk == 0 then return Duel .IsExistingMatchingCard (s .thfilter ,tp ,LOCATION_DECK ,0 ,1 ,nil ) end
81+ Duel .SetOperationInfo (0 ,CATEGORY_TOHAND ,nil ,1 ,tp ,LOCATION_DECK )
82+ end
83+ function s .thop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
84+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_ATOHAND )
85+ local g = Duel .SelectMatchingCard (tp ,s .thfilter ,tp ,LOCATION_DECK ,0 ,1 ,1 ,nil )
86+ if # g > 0 then
87+ Duel .SendtoHand (g ,nil ,REASON_EFFECT )
88+ Duel .ConfirmCards (1 - tp ,g )
89+ end
90+ end
0 commit comments