name: Doom
card_text: Must be Special Summoned with "The Fang of Critias", using "Crush Card Virus". If this card is Special Summoned: Look at your opponent's hand, all monsters they control, and all cards they draw until the end of their 3rd turn after this effect's activation, and destroy all those monsters with 1500 or more ATK.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	c:EnableReviveLimit()
  	--spsummon condition
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_SPSUMMON_CONDITION)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	c:RegisterEffect(e1)
  	--
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_DESTROY)
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e2:SetTarget(s.target)
  	e2:SetOperation(s.operation)
  	c:RegisterEffect(e2)
  end
  s.material_trap = 57728570
  function s.tgfilter(c)
  	return c:IsFaceup() and c:GetAttack() >= 1500
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local g = Duel.GetMatchingGroup(s.tgfilter, tp, 0, LOCATION_MZONE, nil)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, g:GetCount(), 0, 0)
  end
  function s.filter(c)
  	return c:IsType(TYPE_MONSTER) and c:IsAttackAbove(1500)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local conf = Duel.GetFieldGroup(tp, 0, LOCATION_MZONE + LOCATION_HAND)
  	if conf:GetCount() > 0 then
  		Duel.ConfirmCards(tp, conf)
  		local dg = conf:Filter(s.filter, nil)
  		Duel.Destroy(dg, REASON_EFFECT)
  		Duel.ShuffleHand(1 - tp)
  	end
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e1:SetProperty(EFFECT_FLAG_DELAY)
  	e1:SetCode(EVENT_DRAW)
  	e1:SetOperation(s.desop)
  	e1:SetReset(RESET_PHASE + PHASE_END + RESET_OPPO_TURN, 3)
  	Duel.RegisterEffect(e1, tp)
  	local e2 = Effect.CreateEffect(e:GetHandler())
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetCode(EVENT_PHASE + PHASE_END)
  	e2:SetCountLimit(1)
  	e2:SetCondition(s.turncon)
  	e2:SetOperation(s.turnop)
  	e2:SetReset(RESET_PHASE + PHASE_END + RESET_OPPO_TURN, 3)
  	Duel.RegisterEffect(e2, tp)
  	e2:SetLabelObject(e1)
  	e:GetHandler():RegisterFlagEffect(1082946, RESET_PHASE + PHASE_END + RESET_OPPO_TURN, 0, 3)
  	s[e:GetHandler()] = e2
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	if ep == e:GetOwnerPlayer() then
  		return
  	end
  	local hg = eg:Filter(Card.IsLocation, nil, LOCATION_HAND)
  	if hg:GetCount() == 0 then
  		return
  	end
  	Duel.ConfirmCards(1 - ep, hg)
  	local dg = hg:Filter(s.filter, nil)
  	Duel.Destroy(dg, REASON_EFFECT)
  	Duel.ShuffleHand(ep)
  end
  function s.turncon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetTurnPlayer() ~= tp
  end
  function s.turnop(e, tp, eg, ep, ev, re, r, rp)
  	local ct = e:GetLabel()
  	ct = ct + 1
  	e:SetLabel(ct)
  	e:GetHandler():SetTurnCounter(ct)
  	if ct == 3 then
  		e:GetLabelObject():Reset()
  		e:GetOwner():ResetFlagEffect(1082946)
  	end
  end
  
  
source_text: Doom
  Must be Special Summoned with "The Fang of Critias", using "Crush Card Virus". If this card is Special Summoned: Look at your opponent's hand, all monsters they control, and all cards they draw until the end of their 3rd turn after this effect's activation, and destroy all those monsters with 1500 or more ATK.
target_text: -- Doom
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:EnableReviveLimit()
  	--spsummon condition
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_SPSUMMON_CONDITION)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	c:RegisterEffect(e1)
  	--
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_DESTROY)
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e2:SetTarget(s.target)
  	e2:SetOperation(s.operation)
  	c:RegisterEffect(e2)
  end
  s.material_trap = 57728570
  function s.tgfilter(c)
  	return c:IsFaceup() and c:GetAttack() >= 1500
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local g = Duel.GetMatchingGroup(s.tgfilter, tp, 0, LOCATION_MZONE, nil)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, g:GetCount(), 0, 0)
  end
  function s.filter(c)
  	return c:IsType(TYPE_MONSTER) and c:IsAttackAbove(1500)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local conf = Duel.GetFieldGroup(tp, 0, LOCATION_MZONE + LOCATION_HAND)
  	if conf:GetCount() > 0 then
  		Duel.ConfirmCards(tp, conf)
  		local dg = conf:Filter(s.filter, nil)
  		Duel.Destroy(dg, REASON_EFFECT)
  		Duel.ShuffleHand(1 - tp)
  	end
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e1:SetProperty(EFFECT_FLAG_DELAY)
  	e1:SetCode(EVENT_DRAW)
  	e1:SetOperation(s.desop)
  	e1:SetReset(RESET_PHASE + PHASE_END + RESET_OPPO_TURN, 3)
  	Duel.RegisterEffect(e1, tp)
  	local e2 = Effect.CreateEffect(e:GetHandler())
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetCode(EVENT_PHASE + PHASE_END)
  	e2:SetCountLimit(1)
  	e2:SetCondition(s.turncon)
  	e2:SetOperation(s.turnop)
  	e2:SetReset(RESET_PHASE + PHASE_END + RESET_OPPO_TURN, 3)
  	Duel.RegisterEffect(e2, tp)
  	e2:SetLabelObject(e1)
  	e:GetHandler():RegisterFlagEffect(1082946, RESET_PHASE + PHASE_END + RESET_OPPO_TURN, 0, 3)
  	s[e:GetHandler()] = e2
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	if ep == e:GetOwnerPlayer() then
  		return
  	end
  	local hg = eg:Filter(Card.IsLocation, nil, LOCATION_HAND)
  	if hg:GetCount() == 0 then
  		return
  	end
  	Duel.ConfirmCards(1 - ep, hg)
  	local dg = hg:Filter(s.filter, nil)
  	Duel.Destroy(dg, REASON_EFFECT)
  	Duel.ShuffleHand(ep)
  end
  function s.turncon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetTurnPlayer() ~= tp
  end
  function s.turnop(e, tp, eg, ep, ev, re, r, rp)
  	local ct = e:GetLabel()
  	ct = ct + 1
  	e:SetLabel(ct)
  	e:GetHandler():SetTurnCounter(ct)
  	if ct == 3 then
  		e:GetLabelObject():Reset()
  		e:GetOwner():ResetFlagEffect(1082946)
  	end
  end
  
  