--created & coded by Lyris, art by KrysFun of DeviantArt --機氷竜エターンドラ local s,id,o=GetID() function s.initial_effect(c) c:EnableReviveLimit() aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0xd76),4,2) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_MZONE) e1:SetCountLimit(1,id) e1:SetCategory(CATEGORY_DRAW) e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return rp~=tp end) e1:SetCost(s.cost) e1:SetTarget(s.tg) e1:SetOperation(s.op) c:RegisterEffect(e1) if not s.global_check then s.global_check=true s[0]={} s[1]={} local race=1 while race0 then local rc=1 while rc0 then return false end local tp=sump if targetp then tp=targetp end return s[tp][c:GetRace()] and s[tp][c:GetRace()]>1 end function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local g=c:GetOverlayGroup():Filter(Card.IsSetCard,nil,0xd76) if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) and #g>0 end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVEXYZ) Duel.SendtoGrave(g:Select(tp,1,1,nil),REASON_COST) Duel.RaiseSingleEvent(c,EVENT_DETACH_MATERIAL,e,0,0,0,0) end function s.tg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.IsPlayerCanDraw(1-tp,1) end Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,PLAYER_ALL,1) end function s.op(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if Duel.GetFlagEffect(tp,id)==0 then local rc=1 while rc