name: Darklight
card_text: Tribute 1 DARK monster with 1500 or more ATK; destroy all monsters that were Special Summoned this turn.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_DESTROY)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(0, TIMINGS_CHECK_MONSTER + TIMING_END_PHASE)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	e:SetLabel(1)
  	return true
  end
  function s.costfilter(c)
  	return c:IsAttribute(ATTRIBUTE_DARK) and c:IsAttackAbove(1500) and Duel.IsExistingMatchingCard(s.dfilter, 0, LOCATION_MZONE, LOCATION_MZONE, 1, c)
  end
  function s.dfilter(c)
  	return c:IsStatus(STATUS_SPSUMMON_TURN)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		if e:GetLabel() ~= 0 then
  			e:SetLabel(0)
  			return Duel.CheckReleaseGroup(tp, s.costfilter, 1, nil)
  		else
  			return Duel.IsExistingMatchingCard(s.dfilter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil)
  		end
  	end
  	if e:GetLabel() == 1 then
  		e:SetLabel(0)
  		local rg = Duel.SelectReleaseGroup(tp, s.costfilter, 1, 1, nil)
  		Duel.Release(rg, REASON_COST)
  	end
  	local g = Duel.GetMatchingGroup(s.dfilter, tp, LOCATION_MZONE, LOCATION_MZONE, nil)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, g:GetCount(), 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(s.dfilter, tp, LOCATION_MZONE, LOCATION_MZONE, nil)
  	Duel.Destroy(g, REASON_EFFECT)
  end
  
  
source_text: Darklight
  Tribute 1 DARK monster with 1500 or more ATK; destroy all monsters that were Special Summoned this turn.
target_text: -- Darklight
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_DESTROY)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(0, TIMINGS_CHECK_MONSTER + TIMING_END_PHASE)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	e:SetLabel(1)
  	return true
  end
  function s.costfilter(c)
  	return c:IsAttribute(ATTRIBUTE_DARK) and c:IsAttackAbove(1500) and Duel.IsExistingMatchingCard(s.dfilter, 0, LOCATION_MZONE, LOCATION_MZONE, 1, c)
  end
  function s.dfilter(c)
  	return c:IsStatus(STATUS_SPSUMMON_TURN)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		if e:GetLabel() ~= 0 then
  			e:SetLabel(0)
  			return Duel.CheckReleaseGroup(tp, s.costfilter, 1, nil)
  		else
  			return Duel.IsExistingMatchingCard(s.dfilter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil)
  		end
  	end
  	if e:GetLabel() == 1 then
  		e:SetLabel(0)
  		local rg = Duel.SelectReleaseGroup(tp, s.costfilter, 1, 1, nil)
  		Duel.Release(rg, REASON_COST)
  	end
  	local g = Duel.GetMatchingGroup(s.dfilter, tp, LOCATION_MZONE, LOCATION_MZONE, nil)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, g:GetCount(), 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(s.dfilter, tp, LOCATION_MZONE, LOCATION_MZONE, nil)
  	Duel.Destroy(g, REASON_EFFECT)
  end
  
  