--Tender Hunter local ref,id=GetID() function ref.initial_effect(c) aux.AddMagickProcCustom(c,ref.magcon,aux.MagickMatCost,nil,aux.FilterBoolFunction(Card.IsType,TYPE_MONSTER),1) --Search local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,1)) e1:SetCategory(CATEGORY_DECKDES) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetTarget(ref.thtg) e1:SetOperation(ref.thop) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCondition(function(e) return e:GetHandler():IsSummonType(SUMMON_TYPE_MAGICK) end) c:RegisterEffect(e2) --Banish local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,2)) e2:SetCategory(CATEGORY_REMOVE) e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE) e2:SetCode(EVENT_TO_GRAVE) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1,id) e2:SetTarget(ref.rmtg) e2:SetOperation(ref.rmop) c:RegisterEffect(e2) end function ref.magcon(e,tp,eg,ep,ev,re,r,rp) local phase=Duel.GetCurrentPhase() return phase==PHASE_MAIN1 or phase==PHASE_MAIN2 end --Search function ref.thfilter(c) return (c:IsCode(28916109) or c:IsCode(28916119)) and c:IsAbleToHand() end function ref.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(ref.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function ref.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,ref.thfilter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end --Banish function ref.rmfilter(c,e) return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove() and c:IsCanBeEffectTarget(e) end function ref.fselect(g) return g:GetClassCount(Card.GetRace)==1 end function ref.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:GetLocation()==LOCATION_GRAVE and chkc:IsType(TYPE_MONSTER) and chkc:IsAbleToRemove() end if chk==0 then return Duel.IsExistingMatchingCard(ref.rmfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e) end local g=Duel.GetMatchingGroup(ref.rmfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,e) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local sg=g:SelectSubGroup(tp,ref.fselect,false,1,5) Duel.SetTargetCard(sg) Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,sg:GetCount(),PLAYER_ALL,LOCATION_GRAVE) end function ref.rmop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local sg=g:Filter(Card.IsRelateToEffect,nil,e) Duel.Remove(sg,POS_FACEUP,REASON_EFFECT) end