--Cosmic Archaeamphora function c213155.initial_effect(c) --link summon aux.AddLinkProcedure(c,c213155.mfilter,1,1) c:EnableReviveLimit() --splimit local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCondition(c213155.condition) e1:SetOperation(c213155.regop) c:RegisterEffect(e1) --tohand local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(213155,0)) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCountLimit(1,213155) e2:SetCondition(c213155.condition) e2:SetTarget(c213155.thtg) e2:SetOperation(c213155.thop) c:RegisterEffect(e2) end function c213155.mfilter(c) return c:IsLevelBelow(4) and c:IsLinkRace(RACE_REPTILE) end function c213155.condition(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) end function c213155.regop(e,tp,eg,ep,ev,re,r,rp) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetTargetRange(1,0) e1:SetReset(RESET_PHASE+PHASE_END) e1:SetTarget(c213155.splimit) Duel.RegisterEffect(e1,tp) end function c213155.splimit(e,c,sump,sumtype,sumpos,targetp,se) return c:IsCode(213155) and bit.band(sumtype,SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK end function c213155.thfilter(c) return c:IsCode(213160,213165,213170) and c:IsAbleToHand() end function c213155.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c213155.thfilter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function c213155.thop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c213155.thfilter,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