--Eternna Sprite - Wyss function c213065.initial_effect(c) --xyz summon aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x2700),3,2) c:EnableReviveLimit() --spsummon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(213065,0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_PRE_DAMAGE_CALCULATE) e1:SetCountLimit(1,213065) e1:SetCondition(c213065.spcon) e1:SetTarget(c213065.sptg) e1:SetOperation(c213065.spop) c:RegisterEffect(e1) --afterbattle local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(213065,1)) e2:SetCategory(CATEGORY_TODECK+CATEGORY_DAMAGE) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_PHASE+PHASE_BATTLE) e2:SetCountLimit(1,213066) e2:SetRange(LOCATION_MZONE) e2:SetCondition(c213065.btcon) e2:SetCost(c213065.btcost) e2:SetTarget(c213065.bttg) e2:SetOperation(c213065.btop) c:RegisterEffect(e2) end function c213065.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetBattleTarget()~=nil end function c213065.spfilter2(c,e,tp) return c:IsType(TYPE_XYZ) and c:IsRank(3) and c:IsSetCard(0x2700) and not c:IsCode(213065) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 end function c213065.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c213065.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) end function c213065.spop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c213065.spfilter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end function c213065.btcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetBattledGroupCount()>0 end function c213065.btcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) end function c213065.bttg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function c213065.btop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Draw(p,d,REASON_EFFECT) end