--[[ Zero Revival Card Author: Jake Original script by: ? Fixed by: XGlitchy30 ]] local s,id=GetID() function s.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetDescription(id,0) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:HOPT(true) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) end function s.spfilter(c,e,tp) return c:IsSetCard(ARCHE_CODE_JAKE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.tgfilter(c) return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsRace(RACE_MACHINE) and c:IsLevel(7) and c:IsAbleToGrave() end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) local a=Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) local b=Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) if chk==0 then return a or b end local op=aux.Option(tp,id,1,a,b) Duel.SetTargetParam(op) if op==0 then e:SetCategory(CATEGORY_SPECIAL_SUMMON) e:SetProperty(EFFECT_FLAG_CARD_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) elseif op==1 then e:SetCategory(CATEGORY_TOGRAVE) e:SetProperty(0) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK) end end function s.activate(e,tp,eg,ep,ev,re,r,rp) local op=Duel.GetTargetParam() if op==0 then local tc=Duel.GetFirstTarget() if tc:IsRelateToChain() and tc:IsMonster() and tc:IsSetCard(ARCHE_CODE_JAKE) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end elseif op==1 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.SendtoGrave(g,REASON_EFFECT) end end end