--created by Seth, coded by KitsuneTailsPrower aka somen00b --Shadow NOVA's Assault local s,id,o=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id) e1:SetCondition(s.condition) e1:SetCost(s.cost) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) --gain effect local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetRange(LOCATION_GRAVE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCode(EVENT_FREE_CHAIN) e2:SetCountLimit(1,id) e2:SetCost(aux.bfgcost) e2:SetTarget(s.target2) e2:SetOperation(s.activate2) c:RegisterEffect(e2) Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter) end function s.counterfilter(c) return c:IsSetCard(0xe1f) and c:IsLocation(LOCATION_EXTRA) end function s.condition(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,0) local sg=g:Filter(Card.IsFaceup,nil) return sg:GetCount()<=0 end function s.splimit(e,c) return not c:IsAttribute(ATTRIBUTE_DARK) and c:IsLocation(LOCATION_EXTRA) end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetTargetRange(1,0) e1:SetTarget(s.splimit) e1:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e1,tp) end function s.filter(c,e,tp) return c:IsLevelBelow(4) and c:IsSetCard(0xe1f) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function s.activate(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end function s.filter2(c) return c:IsFaceup() and c:IsSetCard(0xe1f) and c:GetFlagEffect(c:GetCode())==0 end function s.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter2(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter2,tp,LOCATION_MZONE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,s.filter2,tp,LOCATION_MZONE,0,1,1,nil) end function s.activate2(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() then tc:RegisterFlagEffect(tc:GetCode(),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END-RESET_TOGRAVE-RESET_REMOVE-RESET_LEAVE,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(tc:GetCode(),0)) end end