--Sunseeker Shield function c96770225.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --decrease tribute local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(96770225,0)) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_SUMMON_PROC) e2:SetRange(LOCATION_SZONE) e2:SetTargetRange(LOCATION_HAND,0) e2:SetCountLimit(1) e2:SetCondition(c96770225.ntcon) e2:SetTarget(c96770225.nttg) c:RegisterEffect(e2) --special summon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(96770225,1)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_ACTIVATE) e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e3:SetCost(c96770225.cost) e3:SetTarget(c96770225.target) e3:SetOperation(c96770225.activate) c:RegisterEffect(e3) local e4=e3:Clone() e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e4:SetRange(LOCATION_SZONE) e4:SetCountLimit(1) c:RegisterEffect(e4) --search local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(96770225,2)) e5:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e5:SetProperty(EFFECT_FLAG_DELAY) e5:SetCode(EVENT_TO_GRAVE) e5:SetCondition(c96770225.thcon) e5:SetTarget(c96770225.thtg) e5:SetOperation(c96770225.thop) c:RegisterEffect(e5) end function c96770225.ntcon(e,c,minc) if c==nil then return true end return minc==0 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 end function c96770225.nttg(e,c) return c:IsLevelAbove(5) and c:IsSetCard(0xff7) end function c96770225.cfilter(c,e,tp) return c:IsFaceup() and c:IsType(TYPE_LINK) and c:IsSummonType(SUMMON_TYPE_LINK) and Duel.IsExistingTarget(c96770225.filter,tp,LOCATION_GRAVE,0,1,nil) end function c96770225.filter(c) return c:IsSetCard(0xff7) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() end function c96770225.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():GetFlagEffect(96770225)==0 end e:GetHandler():RegisterFlagEffect(96770225,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1) end function c96770225.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c96770225.filter(chkc) end if chk==0 then return eg:IsExists(c96770225.cfilter,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,c96770225.filter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end function c96770225.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,tc) end end function c96770225.thcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) end function c96770225.thfilter(c) return c:IsSetCard(0xff7) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() end function c96770225.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c96770225.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function c96770225.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c96770225.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