--O.H.C Void Eater --O.H.C Divoratore del Vuoto --Scripted by: XGlitchy30 local s,id,o=GetID() function s.initial_effect(c) c:EnableReviveLimit() --[[Must be Special Summoned (from your hand) by banishing 5 monsters from your GY with 0 ATK/DEF.]] local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_SINGLE) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e0:SetCode(EFFECT_SPSUMMON_CONDITION) c:RegisterEffect(e0) local e1=Effect.CreateEffect(c) e1:Desc(0) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE|EFFECT_FLAG_CANNOT_DISABLE) e1:SetRange(LOCATION_HAND) e1:SetCondition(s.spcon) e1:SetTarget(s.sptg) e1:SetOperation(s.spop) c:RegisterEffect(e1) --[[If this card battles a monster, neither monster can be destroyed by that battle.]] local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_FIELD) e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e2:SetRange(LOCATION_MZONE) e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e2:SetTarget(s.indtg) e2:SetValue(1) c:RegisterEffect(e2) --[[This card gains ATK/DEF equal to the number of banished monsters with 0 ATK/DEF x 1000.]] local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e3:SetCode(EFFECT_UPDATE_ATTACK) e3:SetRange(LOCATION_MZONE) e3:SetValue(s.atkval) c:RegisterEffect(e3) e3:UpdateDefenseClone(c) --[[During the Main Phase (Quick Effect): You can shuffle all your banished monsters into the Deck; banish all cards on the field, and if you do, neither player takes battle damage until the end of the next turn.]] local e4=Effect.CreateEffect(c) e4:Desc(1) e4:SetCategory(CATEGORY_REMOVE) e4:SetType(EFFECT_TYPE_QUICK_O) e4:SetCode(EVENT_FREE_CHAIN) e4:SetRange(LOCATION_MZONE) e4:HOPT() e4:SetRelevantTimings() e4:SetCondition(aux.MainPhaseCond()) e4:SetCost(s.rmcost) e4:SetTarget(s.rmtg) e4:SetOperation(s.rmop) c:RegisterEffect(e4) end --E1 function s.spfilter(c) return c:IsMonster() and c:IsStats(0,0) and c:IsAbleToRemoveAsCost() end function s.spcon(e,c) if c==nil then return true end local tp=e:GetHandlerPlayer() local rg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_GRAVE,0,nil) return #rg>1 and rg:CheckSubGroup(aux.mzctcheck,5,5,tp) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,c) local rg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_GRAVE,0,nil) local g=rg:SelectSubGroup(tp,aux.mzctcheck,false,5,5,tp) if #g>0 then g:KeepAlive() e:SetLabelObject(g) return true end return false end function s.spop(e,tp,eg,ep,ev,re,r,rp,c) local g=e:GetLabelObject() if not g then return end Duel.Remove(g,POS_FACEUP,REASON_COST) g:DeleteGroup() end --E2 function s.indtg(e,c) local tc=e:GetHandler() return c==tc or c==tc:GetBattleTarget() end --E3 function s.atkfilter(c) return c:IsFaceup() and c:IsMonster() and c:IsStats(0,0) end function s.atkval(e,c) return Duel.GetMatchingGroupCount(s.atkfilter,0,LOCATION_REMOVED,LOCATION_REMOVED,nil)*1000 end --E4 function s.rmcost(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(aux.Faceup(Card.IsMonster),tp,LOCATION_REMOVED,0,nil) if chk==0 then return #g>0 and g:FilterCount(Card.IsAbleToDeckAsCost,nil)==#g end Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST) end function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) if chk==0 then return #g>0 end Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,PLAYER_ALL,LOCATION_ONFIELD) end function s.rmop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil) if #g>0 and Duel.Remove(g,POS_FACEUP,REASON_EFFECT)>0 then local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_AVOID_BATTLE_DAMAGE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetTargetRange(1,1) e1:SetValue(1) e1:SetReset(RESET_PHASE|PHASE_END,2) Duel.RegisterEffect(e1,tp) end end