name: Flash
card_text: 2+ Dragon monsters
  You cannot Summon/Set monsters to a zone this card points to. Once per turn, if a monster(s) is Normal or Special Summoned, to a zone(s) this card points to (except during the Damage Step): You can destroy 1 monster this card points to, and if you do, inflict 500 damage to your opponent. When a card or effect is activated that targets this face-up card (Quick Effect): You can Tribute 1 monster; negate the activation.
lua: function s.initial_effect(c)
  	--link summon
  	c:EnableReviveLimit()
  	aux.AddLinkProcedure(c, aux.FilterBoolFunction(Card.IsLinkRace, RACE_DRAGON), 2)
  	--zone limit
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_MUST_USE_MZONE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetTargetRange(1, 0)
  	e1:SetValue(s.zonelimit)
  	c:RegisterEffect(e1)
  	--destroy
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 0))
  	e3:SetCategory(CATEGORY_REMOVE + CATEGORY_DAMAGE)
  	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e3:SetCode(EVENT_SUMMON_SUCCESS)
  	e3:SetProperty(EFFECT_FLAG_DELAY)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCountLimit(1, EFFECT_COUNT_CODE_SINGLE)
  	e3:SetCondition(s.descon)
  	e3:SetTarget(s.destg)
  	e3:SetOperation(s.desop)
  	c:RegisterEffect(e3)
  	local e4 = e3:Clone()
  	e4:SetCode(EVENT_SPSUMMON_SUCCESS)
  	c:RegisterEffect(e4)
  	--negate
  	local e5 = Effect.CreateEffect(c)
  	e5:SetDescription(aux.Stringid(id, 1))
  	e5:SetCategory(CATEGORY_NEGATE)
  	e5:SetType(EFFECT_TYPE_QUICK_O)
  	e5:SetCode(EVENT_CHAINING)
  	e5:SetRange(LOCATION_MZONE)
  	e5:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DAMAGE_CAL)
  	e5:SetCondition(s.negcon)
  	e5:SetCost(s.negcost)
  	e5:SetTarget(s.negtg)
  	e5:SetOperation(s.negop)
  	c:RegisterEffect(e5)
  end
  function s.zonelimit(e)
  	return 0x7f007f & ~e:GetHandler():GetLinkedZone()
  end
  function s.cfilter(c, ec)
  	if c:IsLocation(LOCATION_MZONE) then
  		return ec:GetLinkedGroup():IsContains(c)
  	else
  		return bit.band(ec:GetLinkedZone(c:GetPreviousControler()), bit.lshift(0x1, c:GetPreviousSequence())) ~= 0
  	end
  end
  function s.descon(e, tp, eg, ep, ev, re, r, rp)
  	return eg:IsExists(s.cfilter, 1, nil, e:GetHandler())
  end
  function s.destg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local g = e:GetHandler():GetLinkedGroup()
  	if chk == 0 then
  		return g:GetCount() > 0
  	end
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_DAMAGE, nil, 0, 1 - tp, 500)
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	local g = e:GetHandler():GetLinkedGroup()
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  	local tg = g:Select(tp, 1, 1, nil)
  	if tg:GetCount() > 0 then
  		Duel.HintSelection(tg)
  		if Duel.Destroy(tg, REASON_EFFECT) > 0 then
  			Duel.Damage(1 - tp, 500, REASON_EFFECT)
  		end
  	end
  end
  function s.negcon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsStatus(STATUS_BATTLE_DESTROYED) then
  		return false
  	end
  	if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then
  		return
  	end
  	local tg = Duel.GetChainInfo(ev, CHAININFO_TARGET_CARDS)
  	return tg and tg:IsContains(c) and Duel.IsChainNegatable(ev)
  end
  function s.costfilter(c)
  	return not c:IsStatus(STATUS_BATTLE_DESTROYED)
  end
  function s.negcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.CheckReleaseGroup(tp, s.costfilter, 1, nil)
  	end
  	local g = Duel.SelectReleaseGroup(tp, s.costfilter, 1, 1, nil)
  	Duel.Release(g, REASON_COST)
  end
  function s.negtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_NEGATE, eg, 1, 0, 0)
  end
  function s.negop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.NegateActivation(ev)
  end
  
  
source_text: Flash
  2+ Dragon monsters
  You cannot Summon/Set monsters to a zone this card points to. Once per turn, if a monster(s) is Normal or Special Summoned, to a zone(s) this card points to (except during the Damage Step): You can destroy 1 monster this card points to, and if you do, inflict 500 damage to your opponent. When a card or effect is activated that targets this face-up card (Quick Effect): You can Tribute 1 monster; negate the activation.
target_text: -- Flash
  function s.initial_effect(c)
  	--link summon
  	c:EnableReviveLimit()
  	aux.AddLinkProcedure(c, aux.FilterBoolFunction(Card.IsLinkRace, RACE_DRAGON), 2)
  	--zone limit
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_MUST_USE_MZONE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetTargetRange(1, 0)
  	e1:SetValue(s.zonelimit)
  	c:RegisterEffect(e1)
  	--destroy
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 0))
  	e3:SetCategory(CATEGORY_REMOVE + CATEGORY_DAMAGE)
  	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e3:SetCode(EVENT_SUMMON_SUCCESS)
  	e3:SetProperty(EFFECT_FLAG_DELAY)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCountLimit(1, EFFECT_COUNT_CODE_SINGLE)
  	e3:SetCondition(s.descon)
  	e3:SetTarget(s.destg)
  	e3:SetOperation(s.desop)
  	c:RegisterEffect(e3)
  	local e4 = e3:Clone()
  	e4:SetCode(EVENT_SPSUMMON_SUCCESS)
  	c:RegisterEffect(e4)
  	--negate
  	local e5 = Effect.CreateEffect(c)
  	e5:SetDescription(aux.Stringid(id, 1))
  	e5:SetCategory(CATEGORY_NEGATE)
  	e5:SetType(EFFECT_TYPE_QUICK_O)
  	e5:SetCode(EVENT_CHAINING)
  	e5:SetRange(LOCATION_MZONE)
  	e5:SetProperty(EFFECT_FLAG_DAMAGE_STEP + EFFECT_FLAG_DAMAGE_CAL)
  	e5:SetCondition(s.negcon)
  	e5:SetCost(s.negcost)
  	e5:SetTarget(s.negtg)
  	e5:SetOperation(s.negop)
  	c:RegisterEffect(e5)
  end
  function s.zonelimit(e)
  	return 0x7f007f & ~e:GetHandler():GetLinkedZone()
  end
  function s.cfilter(c, ec)
  	if c:IsLocation(LOCATION_MZONE) then
  		return ec:GetLinkedGroup():IsContains(c)
  	else
  		return bit.band(ec:GetLinkedZone(c:GetPreviousControler()), bit.lshift(0x1, c:GetPreviousSequence())) ~= 0
  	end
  end
  function s.descon(e, tp, eg, ep, ev, re, r, rp)
  	return eg:IsExists(s.cfilter, 1, nil, e:GetHandler())
  end
  function s.destg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local g = e:GetHandler():GetLinkedGroup()
  	if chk == 0 then
  		return g:GetCount() > 0
  	end
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_DAMAGE, nil, 0, 1 - tp, 500)
  end
  function s.desop(e, tp, eg, ep, ev, re, r, rp)
  	local g = e:GetHandler():GetLinkedGroup()
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DESTROY)
  	local tg = g:Select(tp, 1, 1, nil)
  	if tg:GetCount() > 0 then
  		Duel.HintSelection(tg)
  		if Duel.Destroy(tg, REASON_EFFECT) > 0 then
  			Duel.Damage(1 - tp, 500, REASON_EFFECT)
  		end
  	end
  end
  function s.negcon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsStatus(STATUS_BATTLE_DESTROYED) then
  		return false
  	end
  	if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then
  		return
  	end
  	local tg = Duel.GetChainInfo(ev, CHAININFO_TARGET_CARDS)
  	return tg and tg:IsContains(c) and Duel.IsChainNegatable(ev)
  end
  function s.costfilter(c)
  	return not c:IsStatus(STATUS_BATTLE_DESTROYED)
  end
  function s.negcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.CheckReleaseGroup(tp, s.costfilter, 1, nil)
  	end
  	local g = Duel.SelectReleaseGroup(tp, s.costfilter, 1, 1, nil)
  	Duel.Release(g, REASON_COST)
  end
  function s.negtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_NEGATE, eg, 1, 0, 0)
  end
  function s.negop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.NegateActivation(ev)
  end
  
  