--Remnants of the Silent Star function c97569836.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,97569836+EFFECT_COUNT_CODE_OATH) e1:SetTarget(c97569836.target) e1:SetOperation(c97569836.operation) c:RegisterEffect(e1) --Banish local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(97569836,0)) e2:SetCategory(CATEGORY_REMOVE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,97569837) e2:SetCode(EVENT_FREE_CHAIN) e2:SetCost(c97569836.rmcost) e2:SetCondition(c97569836.rmcon) e2:SetTarget(c97569836.rmtg) e2:SetOperation(c97569836.rmop) c:RegisterEffect(e2) end function c97569836.filter(c,e,tp) return c:IsSetCard(0xd0a1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c97569836.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c97569836.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE) end function c97569836.operation(e,tp,eg,ep,ev,re,r,rp) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) if ft<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) if Duel.IsPlayerAffectedByEffect(tp,97569836) then ft=1 end local g=Duel.SelectMatchingCard(tp,c97569836.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,ft,nil,e,tp) if g:GetCount()>0 then local fid=e:GetHandler():GetFieldID() local tc=g:GetFirst() while tc do Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) tc:RegisterFlagEffect(97569836,RESET_EVENT+0x1fe0000,0,1,fid) tc:RegisterFlagEffect(0,RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(97569836,0)) tc=g:GetNext() end Duel.SpecialSummonComplete() g:KeepAlive() local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e1:SetCountLimit(1) e1:SetLabel(fid) e1:SetLabelObject(g) e1:SetCondition(c97569836.retcon) e1:SetOperation(c97569836.retop) Duel.RegisterEffect(e1,tp) end end function c97569836.retfilter(c,fid) return c:GetFlagEffectLabel(97569836)==fid end function c97569836.retcon(e,tp,eg,ep,ev,re,r,rp) local g=e:GetLabelObject() if not g:IsExists(c97569836.retfilter,1,nil,e:GetLabel()) then g:DeleteGroup() e:Reset() return false else return true end end function c97569836.retop(e,tp,eg,ep,ev,re,r,rp) local g=e:GetLabelObject() local tg=g:Filter(c97569836.retfilter,nil,e:GetLabel()) Duel.SendtoHand(tg,nil,REASON_EFFECT) end function c97569836.rmcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST) end function c97569836.rmfilter(c) return c:IsFaceup() and c:IsSetCard(0xd0a1) and c:IsAbleToRemove() end function c97569836.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and c97569836.rmfilter(chkc,e,tp) end if chk==0 then return Duel.IsExistingTarget(c97569836.rmfilter,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectTarget(tp,c97569836.rmfilter,tp,LOCATION_MZONE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) end function c97569836.rmop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.Remove(tc,0,REASON_EFFECT+REASON_TEMPORARY)~=0 then tc:RegisterFlagEffect(97569936,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END) e1:SetLabelObject(tc) e1:SetCountLimit(1) e1:SetCondition(c97569836.retcon2) e1:SetOperation(c97569836.retop2) Duel.RegisterEffect(e1,tp) end end function c97569836.retcon2(e,tp,eg,ep,ev,re,r,rp) return e:GetLabelObject():GetFlagEffect(97569936)~=0 end function c97569836.retop2(e,tp,eg,ep,ev,re,r,rp) Duel.ReturnToField(e:GetLabelObject()) end function c97569836.rmcon(e,tp,eg,ep,ev,re,r,rp) return not aux.exccon(e) end