--created by Seth, coded by Lyris --Mextro Hopeseeker local s,id,o=GetID() function s.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:HOPT() e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e3:SetCode(EVENT_BE_MATERIAL) e3:HOPT() e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetCategory(CATEGORY_DRAW) e3:SetCondition(s.drcon) e3:SetTarget(s.drtg) e3:SetOperation(s.drop) c:RegisterEffect(e3) end function s.spcon(e,tp) local ph=Duel.GetCurrentPhase() return Duel.GetTurnPlayer()==tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2) end function s.cfilter(c) return c:IsSetCard(0xee5) and c:IsType(TYPE_LINK) end function s.filter(c,e,tp) return c:IsSetCard(0xee5) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsLink(math.min(Duel.GetMatchingGroupCount(s.cfiltre,tp,LOCATION_MZONE,0,nil),3)) end function s.sptg(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,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) end function s.spop(e,tp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.SpecialSummon(Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil),0,tp,tp,false,false,POS_FACEUP) end function s.drcon(e,tp,eg,ep,ev,re,r) return r==REASON_LINK and e:GetHandler():GetReasonCard():IsSetCard(0xee5) end function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetParam(1) Duel.SetTargetPlayer(tp) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function s.drop(e,tp) local d,p=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM,CHAININFO_TARGET_PLAYER) Duel.Draw(p,d,REASON_EFFECT) end