name: Serial
card_text: Activate only when you activate one of your Normal Spell Cards. Discard all the cards in your hand to the Graveyard. The effect of this card becomes the same as the Normal Spell Card.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_CHAINING)
  	e1:SetCondition(s.condition)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return re:GetActiveType() == TYPE_SPELL and re:IsHasType(EFFECT_TYPE_ACTIVATE) and rp == tp
  end
  function s.cfilter(c)
  	return c:IsDiscardable() and c:IsAbleToGraveAsCost()
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	local hg = Duel.GetFieldGroup(tp, LOCATION_HAND, 0)
  	hg:RemoveCard(e:GetHandler())
  	if chk == 0 then
  		return hg:GetCount() > 0 and hg:FilterCount(s.cfilter, nil) == hg:GetCount()
  	end
  	Duel.SendtoGrave(hg, REASON_COST + REASON_DISCARD)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	local ftg = re:GetTarget()
  	if chkc then
  		return ftg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	end
  	if chk == 0 then
  		e:SetCostCheck(false)
  		return not ftg or ftg(e, tp, eg, ep, ev, re, r, rp, chk)
  	end
  	if re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then
  		e:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	end
  	if ftg then
  		e:SetCostCheck(false)
  		ftg(e, tp, eg, ep, ev, re, r, rp, chk)
  	end
  	Duel.ClearOperationInfo(0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local fop = re:GetOperation()
  	fop(e, tp, eg, ep, ev, re, r, rp)
  end
  
  
source_text: Serial
  Activate only when you activate one of your Normal Spell Cards. Discard all the cards in your hand to the Graveyard. The effect of this card becomes the same as the Normal Spell Card.
target_text: -- Serial
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_CHAINING)
  	e1:SetCondition(s.condition)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return re:GetActiveType() == TYPE_SPELL and re:IsHasType(EFFECT_TYPE_ACTIVATE) and rp == tp
  end
  function s.cfilter(c)
  	return c:IsDiscardable() and c:IsAbleToGraveAsCost()
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	local hg = Duel.GetFieldGroup(tp, LOCATION_HAND, 0)
  	hg:RemoveCard(e:GetHandler())
  	if chk == 0 then
  		return hg:GetCount() > 0 and hg:FilterCount(s.cfilter, nil) == hg:GetCount()
  	end
  	Duel.SendtoGrave(hg, REASON_COST + REASON_DISCARD)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	local ftg = re:GetTarget()
  	if chkc then
  		return ftg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	end
  	if chk == 0 then
  		e:SetCostCheck(false)
  		return not ftg or ftg(e, tp, eg, ep, ev, re, r, rp, chk)
  	end
  	if re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then
  		e:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	end
  	if ftg then
  		e:SetCostCheck(false)
  		ftg(e, tp, eg, ep, ev, re, r, rp, chk)
  	end
  	Duel.ClearOperationInfo(0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local fop = re:GetOperation()
  	fop(e, tp, eg, ep, ev, re, r, rp)
  end
  
  