--created & coded by Lyris, art at https://www.zerochan.net/3026838 --機氷竜エックリサ local s,id,o=GetID() function s.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY) e1:SetCondition(function(e,tp) return Duel.GetTurnPlayer()==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() if chk==0 then return not c:IsPublic() end local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetDescription(66) e1:SetCode(EFFECT_PUBLIC) e1:SetProperty(EFFECT_FLAG_CLIENT_HINT) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2) c:RegisterEffect(e1) end function s.filter(c,e,tp) return c:IsSetCard(0xd76) and not c:IsCode(id) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.tg(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_GRAVE+LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_HAND) 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 rc0 then if tc:IsPreviousLocation(LOCATION_HAND) then maxc=maxc+1 end local g=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD) if #g>0 and Duel.SelectEffectYesNo(tp,c) then Duel.BreakEffect() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local sg=g:Select(tp,1,maxc,nil) Duel.HintSelection(sg) Duel.Destroy(sg,REASON_EFFECT) end end end