22-- Sabatiel - The Philosopher's Stone (VG)
33local s ,id = GetID ()
44function s .initial_effect (c )
5- -- Activate
5+ -- Activate (Add to hand when your "Winged Kuriboh" is destroyed)
66 local e1 = Effect .CreateEffect (c )
77 e1 :SetCategory (CATEGORY_TOHAND )
88 e1 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O )
@@ -13,7 +13,7 @@ function s.initial_effect(c)
1313 e1 :SetTarget (s .thtg )
1414 e1 :SetOperation (s .thop )
1515 c :RegisterEffect (e1 )
16- -- Activate
16+ -- Activate (Add 1 card from your Deck or GY to hand OR increase your monster's ATK)
1717 local e2 = Effect .CreateEffect (c )
1818 e2 :SetType (EFFECT_TYPE_ACTIVATE )
1919 e2 :SetCode (EVENT_FREE_CHAIN )
@@ -22,15 +22,15 @@ function s.initial_effect(c)
2222 e2 :SetOperation (s .activate )
2323 c :RegisterEffect (e2 )
2424end
25- s .listed_names = {57116033 } -- Winged Kuriboh
25+ s .listed_names = {57116033 } -- " Winged Kuriboh"
2626function s .cfilter (c ,tp )
2727 return c :IsCode (57116033 ) and c :IsPreviousControler (tp )
2828 and c :IsPreviousLocation (LOCATION_ONFIELD ) and c :IsPreviousPosition (POS_FACEUP )
2929end
3030function s .thcon (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
3131 return eg :IsExists (s .cfilter ,1 ,nil ,tp )
3232end
33- function s .thtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk , chkc )
33+ function s .thtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
3434 if chk == 0 then return e :GetHandler ():IsAbleToHand () end
3535 Duel .SetOperationInfo (0 ,CATEGORY_TOHAND ,e :GetHandler (),1 ,0 ,0 )
3636end
@@ -52,19 +52,16 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
5252 if chk == 0 then
5353 if ct < 3 then
5454 return s .cost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,0 )
55- and Duel .IsExistingMatchingCard (Card .IsAbleToHand ,tp ,LOCATION_DECK + LOCATION_GRAVE ,0 ,1 ,nil )
55+ and Duel .IsExistingMatchingCard (Card .IsAbleToHand ,tp ,LOCATION_DECK | LOCATION_GRAVE ,0 ,1 ,nil )
5656 else
5757 return Duel .IsExistingTarget (Card .IsFaceup ,tp ,LOCATION_MZONE ,0 ,1 ,nil )
5858 end
5959 end
60- ct = ct + 1
6160 if ct < 3 then
6261 s .cost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,1 )
63- e :GetHandler ():SetTurnCounter (ct )
64- e :SetLabel (ct )
6562 e :SetCategory (CATEGORY_TOHAND + CATEGORY_SEARCH )
6663 e :SetProperty (0 )
67- Duel .SetOperationInfo (0 ,CATEGORY_TOHAND ,nil ,1 ,tp ,LOCATION_DECK + LOCATION_GRAVE )
64+ Duel .SetOperationInfo (0 ,CATEGORY_TOHAND ,nil ,1 ,tp ,LOCATION_DECK | LOCATION_GRAVE )
6865 else
6966 e :SetCategory (CATEGORY_ATKCHANGE )
7067 e :SetProperty (EFFECT_FLAG_CARD_TARGET )
@@ -81,8 +78,12 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
8178end
8279function s .activate1 (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
8380 local c = e :GetHandler ()
81+ local ct = e :GetLabel ()
82+ ct = ct + 1
83+ c :SetTurnCounter (ct )
84+ e :SetLabel (ct )
8485 Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_ATOHAND )
85- local g = Duel .SelectMatchingCard (tp ,Card .IsAbleToHand ,tp ,LOCATION_DECK + LOCATION_GRAVE ,0 ,1 ,1 ,nil )
86+ local g = Duel .SelectMatchingCard (tp ,Card .IsAbleToHand ,tp ,LOCATION_DECK | LOCATION_GRAVE ,0 ,1 ,1 ,nil )
8687 if # g > 0 then
8788 Duel .SendtoHand (g ,nil ,REASON_EFFECT )
8889 Duel .ConfirmCards (1 - tp ,g )
@@ -103,4 +104,4 @@ function s.activate2(e,tp,eg,ep,ev,re,r,rp)
103104 e1 :SetValue (tc :GetAttack ()* ct )
104105 tc :RegisterEffect (e1 )
105106 end
106- end
107+ end
0 commit comments