1+ -- ユーカリ・モール
2+ -- Eucalyptus Mole
3+ -- scripted by pyrQ
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Special Summon 1 Level 4 or lower Beast monster from your Deck in face-down Defense Position
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetCategory (CATEGORY_SPECIAL_SUMMON + CATEGORY_POSITION )
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 .fdsptg )
15+ e1 :SetOperation (s .fdspop )
16+ c :RegisterEffect (e1 )
17+ local e2 = e1 :Clone ()
18+ e2 :SetCode (EVENT_SPSUMMON_SUCCESS )
19+ c :RegisterEffect (e2 )
20+ -- Special Summon 1 "Koala" monster from your Deck
21+ local e3 = Effect .CreateEffect (c )
22+ e3 :SetDescription (aux .Stringid (id ,1 ))
23+ e3 :SetCategory (CATEGORY_SPECIAL_SUMMON + CATEGORY_ATKCHANGE )
24+ e3 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
25+ e3 :SetProperty (EFFECT_FLAG_DELAY )
26+ e3 :SetCode (EVENT_DESTROYED )
27+ e3 :SetCountLimit (1 ,{id ,1 })
28+ e3 :SetTarget (s .koalasptg )
29+ e3 :SetOperation (s .koalaspop )
30+ c :RegisterEffect (e3 )
31+ end
32+ s .listed_series = {SET_KOALA }
33+ function s .fdspfilter (c ,e ,tp )
34+ return c :IsLevelBelow (4 ) and c :IsRace (RACE_BEAST ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false ,POS_FACEDOWN_DEFENSE )
35+ end
36+ function s .fdsptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
37+ if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
38+ and Duel .IsExistingMatchingCard (s .fdspfilter ,tp ,LOCATION_DECK ,0 ,1 ,nil ,e ,tp ) end
39+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,LOCATION_DECK )
40+ Duel .SetPossibleOperationInfo (0 ,CATEGORY_POSITION ,e :GetHandler (),1 ,tp ,POS_FACEUP_DEFENSE )
41+ end
42+ function s .fdspop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
43+ if Duel .GetLocationCount (tp ,LOCATION_MZONE )<= 0 then return end
44+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
45+ local g = Duel .SelectMatchingCard (tp ,s .fdspfilter ,tp ,LOCATION_DECK ,0 ,1 ,1 ,nil ,e ,tp )
46+ if # g > 0 and Duel .SpecialSummon (g ,0 ,tp ,tp ,false ,false ,POS_FACEDOWN_DEFENSE )> 0 then
47+ Duel .ConfirmCards (1 - tp ,g )
48+ local c = e :GetHandler ()
49+ if c :IsRelateToEffect (e ) and c :IsAttackPos () then
50+ Duel .BreakEffect ()
51+ Duel .ChangePosition (c ,POS_FACEUP_DEFENSE )
52+ end
53+ end
54+ end
55+ function s .koalaspfilter (c ,e ,tp )
56+ return c :IsSetCard (SET_KOALA ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
57+ end
58+ function s .koalasptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
59+ if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
60+ and Duel .IsExistingMatchingCard (s .koalaspfilter ,tp ,LOCATION_DECK ,0 ,1 ,nil ,e ,tp ) end
61+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,LOCATION_DECK )
62+ end
63+ function s .koalaspop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
64+ if Duel .GetLocationCount (tp ,LOCATION_MZONE )<= 0 then return end
65+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
66+ local g = Duel .SelectMatchingCard (tp ,s .koalaspfilter ,tp ,LOCATION_DECK ,0 ,1 ,1 ,nil ,e ,tp )
67+ if # g > 0 and Duel .SpecialSummon (g ,0 ,tp ,tp ,false ,false ,POS_FACEUP )> 0 then
68+ local c = e :GetHandler ()
69+ aux .RegisterClientHint (c ,0 ,tp ,1 ,0 ,aux .Stringid (id ,2 ))
70+ -- Non-Effect Beast monsters you control gain ATK equal to their own original DEF
71+ local e1 = Effect .CreateEffect (c )
72+ e1 :SetType (EFFECT_TYPE_FIELD )
73+ e1 :SetCode (EFFECT_UPDATE_ATTACK )
74+ e1 :SetTargetRange (LOCATION_MZONE ,0 )
75+ e1 :SetTarget (function (e ,c ) return c :IsNonEffectMonster () and c :IsRace (RACE_BEAST ) end )
76+ e1 :SetValue (function (e ,c ) return c :GetBaseDefense () end )
77+ e1 :SetReset (RESET_PHASE |PHASE_END ,2 )
78+ Duel .RegisterEffect (e1 ,tp )
79+ end
80+ end
0 commit comments