--created by LeonDuvall, coded by Lyris --Cloudy Concentrated Magitate local s,id,o=GetID() function s.initial_effect(c) c:EnableReviveLimit() aux.AddLinkProcedure(c,s.mfilter,1,1) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_DESTROYED) e1:SetRange(LOCATION_REMOVED) e1:HOPT() e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e1:SetCondition(s.thcon) e1:SetCost(s.thcost) e1:SetTarget(s.thtg) e1:SetOperation(s.thop) c:RegisterEffect(e1) end function s.mfilter(c) return c:IsLevelBelow(4) and not c:IsLinkAttribute(ATTRIBUTE_DARK) and c:IsSetCard(0xd16) end function s.cfilter(c,tp) return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp) and c:GetPreviousLevelOnField()==5 and c:IsPreviousSetCard(0xd16) end function s.thcon(e,tp,eg) return eg:FilterCount(s.cfilter,nil,tp)==1 end function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return c:IsAbleToExtraAsCost() end Duel.SendtoDeck(c,nil,SEQ_DECKTOP,REASON_COST) end function s.filter(c) return c:IsSetCard(0xd16) and c:IsAbleToHand() end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function s.thop(e,tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil) Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end