--Spire of Relentless Spirits local s,id=GetID() function s.initial_effect(c) c:SetUniqueOnField(1,0,id) --selfdestroy local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_SINGLE) e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e0:SetRange(LOCATION_SZONE) e0:SetCode(EFFECT_SELF_DESTROY) e0:SetCondition(s.descon) c:RegisterEffect(e0) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) c:RegisterEffect(e1) --Return to GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_TOGRAVE) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_SZONE) e2:SetCountLimit(1) e2:SetTarget(s.gtg) e2:SetOperation(s.gop) c:RegisterEffect(e2) --Literally just Jar of Avarice local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_SZONE) e3:SetCountLimit(1) e3:SetTarget(s.tdtg) e3:SetOperation(s.tdop) c:RegisterEffect(e3) --Tribute prevention local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_FIELD) e4:SetCode(EFFECT_CANNOT_RELEASE) e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e4:SetRange(LOCATION_SZONE) e4:SetTargetRange(0,1) e4:SetValue(s.aclimit) c:RegisterEffect(e4) end --e0 group function s.desfilter(c) return c:IsFaceup() and c:IsCode(04064256) end function s.descon(e) return not Duel.IsExistingMatchingCard(s.desfilter,e:GetHandler():GetControler(),LOCATION_FZONE,0,1,nil) end --e2 Group function s.bfilter(c) return c:IsFaceup() and c:IsType(TYPE_MONSTER) end function s.gtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetMatchingGroupCount(s.bfilter,tp,LOCATION_REMOVED,0,nil)>0 end local g=Duel.GetMatchingGroup(s.bfilter,tp,LOCATION_REMOVED,0,nil) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,g:GetCount(),0,0) end function s.gop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(s.bfilter,tp,LOCATION_REMOVED,0,nil) Duel.SendtoGrave(g,REASON_EFFECT+REASON_RETURN) end --e3 Group function s.filter(c) return c:IsAbleToDeck() end function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc) end if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,5,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,5,5,nil) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,5,0,0) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function s.tdop(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) if tg:FilterCount(Card.IsRelateToEffect,nil,e)~=5 then return end Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) local g=Duel.GetOperatedGroup() if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA) if ct==5 then Duel.BreakEffect() Duel.Draw(tp,1,REASON_EFFECT) end end --e4 Group function s.aclimit(e,re,tp) return re:IsControler(tp) and re:IsRace(RACE_ZOMBIE) and re:IsFaceup() end