--created by LeonDuvall, coded by Lyris --Skypiercer Stuka local s,id,o=GetID() function s.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE) e1:SetRange(LOCATION_HAND) e1:SetCondition(s.spcon) e1:SetOperation(s.spop) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetCategory(CATEGORY_DRAW) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCost(s.drcost) e2:SetTarget(s.drtg) e2:SetOperation(s.drop) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e3) local e4=Effect.CreateEffect(c) e4:SetCategory(CATEGORY_REMOVE) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_TO_GRAVE) e4:SetProperty(EFFECT_FLAG_DELAY) e4:SetCountLimit(1,id) e4:SetCondition(s.gycon) e4:SetTarget(s.gytg) e4:SetOperation(s.gyop) c:RegisterEffect(e4) end function s.cfilter(c) return c:IsFaceup() and c:IsSetCard(0x3bb) end function s.spcon(e,c) if c==nil then return true end local tp=c:GetControler() return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end function s.spop(e,tp,eg,ep,ev,e,re,r,rp,c) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,1,nil) Duel.SendtoGrave(g,REASON_COST+REASON_RETURN) end function s.drcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.banishfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,s.banishfilter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.Remove(g,POS_FACEUP,REASON_COST) end function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function s.drop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if Duel.Draw(tp,1,REASON_EFFECT)>0 and c:IsFaceup() and c:IsRelateToEffect(e) then Duel.BreakEffect() local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_LEVEL) e1:SetValue(Duel.AnnounceLevel(tp,1,2)) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE) c:RegisterEffect(e1) end end function s.gycon(e,tp,eg,ep,ev,re,r,rp) return not e:GetHandler():IsPreviousLocation(LOCATION_DECK) end function s.gytg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_GRAVE) end function s.gyop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end end function s.spfilter(c) return c:IsSetCard(0x3bb) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck() end function s.banishfilter(c) return c:IsSetCard(0x3bb) and c:IsAbleToRemove() end function s.lvval(e,c) return Duel.GetMatchingGroup(s.lvfilter,0,LOCATION_MZONE,LOCATION_MZONE,c):GetSum(Card.GetLevel) end function s.lvfilter(c) return c:IsFaceup() and c:IsSetCard(0x3bb) and c:GetLevel()>0 end