--Flotta Sverdånd --Scripted by: XGlitchy30 local s,id=GetID() function s.initial_effect(c) c:SetUniqueOnField(1,0,id) --activate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) --destroy local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_DAMAGE+CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_SZONE) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCountLimit(1) e2:SetCost(s.atkcost) e2:SetTarget(s.atktg) e2:SetOperation(s.atkop) c:RegisterEffect(e2) --act in hand local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_TRAP_ACT_IN_HAND) e3:SetCondition(s.handcon) c:RegisterEffect(e3) end function s.tgfilter(c) return c:IsSetCard(0x24d) and c:IsAbleToHand() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.operation(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.tgfilter,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 function s.cfilter(c) return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_WARRIOR) and c:IsDiscardable() end function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil) end Duel.DiscardHand(tp,s.cfilter,1,1,REASON_COST+REASON_DISCARD) end function s.df(c) return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:GetAttack()>0 end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and s.df(chkc) end if chk==0 then return Duel.IsExistingTarget(s.df,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,s.df,tp,0,LOCATION_MZONE,1,1,nil) local d=g:GetFirst():GetAttack() Duel.SetTargetPlayer(tp) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,d) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function s.sf(c,e,tp) return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x24d) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local tc=Duel.GetFirstTarget() local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then local dam=Duel.Damage(p,tc:GetAttack(),REASON_EFFECT) if dam>0 and Duel.Destroy(tc,REASON_EFFECT)>0 and dam>=2000 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,s.sf,tp,LOCATION_DECK,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end end end function s.cf(c) return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsSetCard(0x24d) end function s.handcon(e) return Duel.IsExistingMatchingCard(s.cf,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) end