1- -- Piri Reis Map
1+ -- ピリ・レイスの地図 (Anime)
2+ -- Piri Reis Map (Anime)
23local s ,id = GetID ()
34function s .initial_effect (c )
4- -- Activate
5- local e1 = Effect .CreateEffect (c )
6- e1 :SetCategory (CATEGORY_TOHAND + CATEGORY_SEARCH )
7- e1 :SetType (EFFECT_TYPE_ACTIVATE )
8- e1 :SetCode (EVENT_FREE_CHAIN )
9- e1 :SetTarget (s .target )
10- e1 :SetOperation (s .activate )
11- c :RegisterEffect (e1 )
5+ -- Activate
6+ local e1 = Effect .CreateEffect (c )
7+ e1 :SetCategory (CATEGORY_TOHAND + CATEGORY_SEARCH )
8+ e1 :SetType (EFFECT_TYPE_ACTIVATE )
9+ e1 :SetCode (EVENT_FREE_CHAIN )
10+ e1 :SetTarget (s .target )
11+ e1 :SetOperation (s .activate )
12+ c :RegisterEffect (e1 )
1213end
13- function s .afilter (c )
14- return c :GetAttack () == 0 and c :IsMonster () and c :IsAbleToHand ()
14+ function s .thfilter (c )
15+ return c :IsAttack ( 0 ) and c :IsMonster () and c :IsAbleToHand ()
1516end
1617function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
17- if chk == 0 then return Duel .IsExistingMatchingCard (s .afilter ,tp ,LOCATION_DECK ,0 ,1 ,nil ) end
18- Duel .SetOperationInfo (0 ,CATEGORY_TOHAND ,nil ,1 ,tp ,LOCATION_DECK )
18+ if chk == 0 then return Duel .IsExistingMatchingCard (s .thfilter ,tp ,LOCATION_DECK ,0 ,1 ,nil ) end
19+ Duel .SetOperationInfo (0 ,CATEGORY_TOHAND ,nil ,1 ,tp ,LOCATION_DECK )
1920end
2021function s .activate (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
21- Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_ATOHAND )
22- local tc = Duel .SelectMatchingCard (tp ,s .afilter ,tp ,LOCATION_DECK ,0 ,1 ,1 ,nil ):GetFirst ()
23- if tc and Duel .SendtoHand (tc ,nil ,REASON_EFFECT ) then
24- Duel .ConfirmCards (1 - tp ,tc )
25- local e1 = Effect .CreateEffect (e :GetHandler ())
26- e1 :SetType (EFFECT_TYPE_SINGLE )
27- e1 :SetCode (EFFECT_SUMMON_COST )
28- e1 :SetOperation (s .sumcost )
29- e1 :SetReset (RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END )
30- tc :RegisterEffect (e1 )
31- local e2 = e1 :Clone ()
32- e2 :SetCode (EFFECT_SPSUMMON_COST )
33- tc :RegisterEffect (e2 )
34- end
22+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_ATOHAND )
23+ local tc = Duel .SelectMatchingCard (tp ,s .thfilter ,tp ,LOCATION_DECK ,0 ,1 ,1 ,nil ):GetFirst ()
24+ if tc then
25+ Duel .SendtoHand (tc ,nil ,REASON_EFFECT )
26+ Duel .ConfirmCards (1 - tp ,tc )
27+ end
28+ local e1 = Effect .CreateEffect (e :GetHandler ())
29+ e1 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS )
30+ e1 :SetProperty (EFFECT_FLAG_PLAYER_TARGET )
31+ e1 :SetCode (EVENT_SUMMON_SUCCESS )
32+ e1 :SetLabelObject (tc )
33+ e1 :SetCondition (function (e ,tp ,eg ,ep ,ev ,re ,r ,rp ) return eg :IsContains (e :GetLabelObject ()) end )
34+ e1 :SetOperation (function (e ,tp ,eg ,ep ,ev ,re ,r ,rp ) Duel .SetLP (tp ,Duel .GetLP (tp )/ 2 ) end )
35+ e1 :SetReset (RESET_PHASE |PHASE_END )
36+ Duel .RegisterEffect (e1 ,tp )
3537end
36- function s .sumcost (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
37- Duel .SetLP (tp ,Duel .GetLP (tp )/ 2 )
38- end
0 commit comments