--Spiritualist Training function c84607228.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,84607228) e1:SetOperation(c84607228.activate) c:RegisterEffect(e1) --To Hand local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP) e2:SetCode(EVENT_RELEASE) e2:SetRange(LOCATION_SZONE) e2:SetCountLimit(1) e2:SetCondition(c84607228.thcon) e2:SetTarget(c84607228.thtg) e2:SetOperation(c84607228.thop) c:RegisterEffect(e2) end function c84607228.thfilter(c) return c:IsSetCard(0x7ce) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() end function c84607228.activate(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local g=Duel.GetMatchingGroup(c84607228.thfilter,tp,LOCATION_DECK,0,nil) if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(84607228,0)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local sg=g:Select(tp,1,1,nil) Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,sg) end end function c84607228.thfilter2(c,tp) return c:IsSetCard(0x7ce) and c:IsType(TYPE_MONSTER) and c:IsPreviousLocation(LOCATION_MZONE+LOCATION_HAND) and c:GetPreviousControler()==tp end function c84607228.thcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(c84607228.thfilter2,1,nil,tp) end function c84607228.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local g=eg:Filter(c84607228.thfilter2,nil,tp) Duel.SetTargetCard(g) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end function c84607228.thop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local rg=g:Select(tp,1,1,nil) if rg:GetCount()>0 then Duel.SendtoHand(rg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,rg) end end --Once per turn, if a "Spiritualist" monster(s) is tributed: add 1 of those cards to your hand. You can only activate 1 "Spiritualist Training" per turn.