--Mantra Kitsune --Automate ID local scard,s_id=GetID() function scard.initial_effect(c) Card.IsMantra=Card.IsMantra or (function(tc) return tc:IsSetCard(0x7d0) or (tc:GetCode()>30200 and tc:GetCode()<30230) end) --Bounce local e1=Effect.CreateEffect(c) e1:Desc(0) e1:SetCategory(CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_TO_GRAVE) e1:SetProperty(EFFECT_FLAG_DDD+EFFECT_FLAG_CARD_TARGET) e1:SetCondition(scard.bcon) e1:SetTarget(scard.target) e1:SetOperation(scard.operation) e1:SetCountLimit(1,s_id+EFFECT_COUNT_CODE_OATH) c:RegisterEffect(e1) end function scard.bcon(e,tp,eg,ep,ev,re,r,rp) if not re then return false end local c=e:GetHandler() local rc=re:GetHandler() return rc:IsMantra() and c:IsReason(REASON_EFFECT|REASON_COST) end function scard.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsAbleToHand() end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,1,nil) Duel.SetCardOperationInfo(g,CATEGORY_TOHAND) end function scard.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToChain() then Duel.SendtoHand(tc,nil,REASON_EFFECT) end end