--Mantra Wiseman --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) --Recover local e1=Effect.CreateEffect(c) e1:Desc(0) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1) e1:SetCost(scard.cost) e1:SetTarget(scard.target) e1:SetOperation(scard.operation) c:RegisterEffect(e1) end function scard.handfilter(c) return c:IsMantra() and c:IsAbleToHand() end function scard.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD) end function scard.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and scard.handfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(scard.handfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectTarget(tp,scard.handfilter,tp,LOCATION_GRAVE,0,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() and Duel.SendtoHand(tc,nil,REASON_EFFECT)>0 and aux.PLChk(tc,tp,LOCATION_HAND) then Duel.ConfirmCards(1-tp,Group.FromCards(tc)) if tc:IsMonster(TYPE_EFFECT) and tc:HasLevel() and tc:IsLevelBelow(4) and not tc:IsCode(s_id) and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(30212,2)) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end end