--Foolish Future Burial local s,id=GetID() function s.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH) e1:SetTarget(s.target) c:RegisterEffect(e1) end function s.filter(c,e,tp) return c:IsType(TYPE_TIMELEAP) and (Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_DECK,0,1,nil,c) or c:IsAbleToGrave()) end function s.filter2(c,tl) return c:IsType(TYPE_MONSTER) and c:IsAbleToGrave() and c:IsLevel(tl:GetFuture()-1) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) Duel.ConfirmCards(1-tp,g) local tc=g:GetFirst() local b1=tc:IsAbleToGrave() local b2=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_DECK,0,1,nil,tc) local op=0 if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1)) elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(id,0)) else op=Duel.SelectOption(tp,aux.Stringid(id,1))+1 end if op==0 then e:SetCategory(CATEGORY_TOGRAVE) e:SetLabelObject(tc) e:SetOperation(s.operation1) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,tc,1,tp,LOCATION_EXTRA) else e:SetCategory(CATEGORY_TOGRAVE) e:SetLabelObject(tc) e:SetOperation(s.operation2) end end function s.operation1(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetLabelObject() if tc then Duel.SendtoGrave(tc,REASON_EFFECT) end end function s.operation2(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetLabelObject() if tc then e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCountLimit(1) e1:SetOperation(s.tgop) e1:SetReset(RESET_PHASE+PHASE_END) e1:SetLabelObject(tc) Duel.RegisterEffect(e1,tp) end end function s.tgfilter(c,tc) return c:IsType(TYPE_TIMELEAP) and (Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_DECK,0,1,nil,e,tp,c) or c:IsAbleToGrave()) end function s.tgop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_CARD,0,id) local tc=e:GetLabelObject() if tc and Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_DECK,0,1,nil,tc) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.filter2,tp,LOCATION_DECK,0,1,1,nil,tc) if g:GetCount()>0 then Duel.SendtoGrave(g,REASON_EFFECT) end end end