--created by Seth, coded by Lyris --Mextro Observer local s,id,o=GetID() function s.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:HOPT() e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCost(s.spcost) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetCode(EVENT_BE_MATERIAL) e2:HOPT() e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e2:SetCondition(s.thcon) e2:SetOperation(s.thop) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_FREE_CHAIN) e3:SetRange(LOCATION_GRAVE) e3:HOPT() e3:SetCategory(CATEGORY_TOEXTRA) e3:SetCost(s.tdcost) e3:SetTarget(s.tdtg) e3:SetOperation(s.tdop) c:RegisterEffect(e3) end function s.spcost(e,_,_,_,_,_,_,_,chk) local c=e:GetHandler() if chk==0 then return c:IsDiscardable() end Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD) end function s.filter(c,e,tp) return c:IsLevelBelow(4) and c:IsSetCard(0xee5) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end function s.sptg(e,tp,_,_,_,_,_,_,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.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,aux.NecroValleyFilter(s.filter),tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil,e,tp),0,tp,tp,false,false,POS_FACEUP_DEFENSE) end function s.thcon(e,_,_,_,_,_,r) return r==REASON_LINK and e:GetHandler():GetReasonCard():IsSetCard(0xee5) end function s.afilter(c) return c:IsSetCard(0xee5) and c:IsAbleToHand() end function s.thop(e,tp) if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<3 then return end local g=Duel.GetDecktopGroup(tp,3) Duel.ConfirmCards(tp,g) local tg=g:Filter(s.afilter,1,nil) if #tg>0 and Duel.SelectEffectYesNo(tp,e:GetHandler(),1190) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local sg=tg:Select(tp,1,1,nil) Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,sg) end end function s.tdcost(e,tp,_,_,_,_,_,_,chk) local c=e:GetHandler() if chk==0 then return c:IsAbleToDeckAsCost() end Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_COST) end function s.dfilter(c) return c:IsSetCard(0xee5) and c:IsType(TYPE_LINK) and c:IsAbleToExtra() end function s.tdtg(e,tp,_,_,_,_,_,_,chk) if chk==0 then return Duel.IsExistingMatchingCard(s.dfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,nil,1,tp,LOCATION_GRAVE) end function s.tdop(e,tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(tp,s.dfilter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.HintSelection(g) Duel.SendtoDeck(g,nil,SEQ_DECKTOP,REASON_EFFECT) end