name: Magical
card_text: When your opponent's card(s) in their hand are discarded to the Graveyard, inflict 500 points of damage to their Life Points for each card that was discarded.
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_FREE_CHAIN)
  	c:RegisterEffect(e1)
  	--damage
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetProperty(EFFECT_FLAG_DELAY)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetCode(EVENT_TO_GRAVE)
  	e2:SetOperation(s.damop)
  	c:RegisterEffect(e2)
  end
  function s.filter(c, tp)
  	return c:IsPreviousLocation(LOCATION_HAND) and c:IsControler(1 - tp) and c:IsPreviousControler(1 - tp) and c:IsReason(REASON_DISCARD)
  end
  function s.damop(e, tp, eg, ep, ev, re, r, rp)
  	local ct = eg:FilterCount(s.filter, nil, tp)
  	Duel.Damage(1 - tp, ct * 500, REASON_EFFECT)
  end
  
  
source_text: Magical
  When your opponent's card(s) in their hand are discarded to the Graveyard, inflict 500 points of damage to their Life Points for each card that was discarded.
target_text: -- Magical
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e1)
  	--damage
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetProperty(EFFECT_FLAG_DELAY)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetCode(EVENT_TO_GRAVE)
  	e2:SetOperation(s.damop)
  	c:RegisterEffect(e2)
  end
  function s.filter(c, tp)
  	return c:IsPreviousLocation(LOCATION_HAND) and c:IsControler(1 - tp) and c:IsPreviousControler(1 - tp) and c:IsReason(REASON_DISCARD)
  end
  function s.damop(e, tp, eg, ep, ev, re, r, rp)
  	local ct = eg:FilterCount(s.filter, nil, tp)
  	Duel.Damage(1 - tp, ct * 500, REASON_EFFECT)
  end
  
  