--Alien Cotylosaur function c213145.initial_effect(c) --extra material local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_ADD_EXTRA_TRIBUTE) e1:SetTargetRange(0,LOCATION_MZONE) e1:SetTarget(aux.TargetBoolFunction(c213145.mfilter)) e1:SetValue(POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT) e2:SetRange(LOCATION_MZONE) e2:SetTargetRange(LOCATION_HAND,0) e2:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_MONSTER)) e2:SetLabelObject(e1) c:RegisterEffect(e2) --spsummon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(213145,0)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,213145) e3:SetCost(c213145.cost) e3:SetTarget(c213145.target) e3:SetOperation(c213145.operation) c:RegisterEffect(e3) end function c213145.mfilter(c) return c:GetCounter(0x100e)>0 end function c213145.costfilter(c,tp) return c:IsRace(RACE_REPTILE) and Duel.GetMZoneCount(tp,c,tp)>0 end function c213145.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckReleaseGroup(tp,c213145.costfilter,1,nil,tp) end local g=Duel.SelectReleaseGroup(tp,c213145.costfilter,1,1,nil,tp) Duel.Release(g,REASON_COST) end function c213145.filter(c,e,tp) return c:IsSetCard(0xc) and not c:IsCode(213145) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c213145.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c213145.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function c213145.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c213145.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end