name: Damage
card_text: Activate only when an effect that inflicts damage is activated. Negate its activation and effect, and each player draws 1 card.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_NEGATE + CATEGORY_DRAW)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_CHAINING)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	local ex = Duel.GetOperationInfo(ev, CATEGORY_DAMAGE)
  	return ex and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsPlayerCanDraw(tp, 1) and Duel.IsPlayerCanDraw(1 - tp, 1)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_NEGATE, eg, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, PLAYER_ALL, 1)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	Duel.NegateActivation(ev)
  	Duel.Draw(tp, 1, REASON_EFFECT)
  	Duel.Draw(1 - tp, 1, REASON_EFFECT)
  end
  
  
source_text: Damage
  Activate only when an effect that inflicts damage is activated. Negate its activation and effect, and each player draws 1 card.
target_text: -- Damage
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_NEGATE + CATEGORY_DRAW)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_CHAINING)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	local ex = Duel.GetOperationInfo(ev, CATEGORY_DAMAGE)
  	return ex and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsPlayerCanDraw(tp, 1) and Duel.IsPlayerCanDraw(1 - tp, 1)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_NEGATE, eg, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, PLAYER_ALL, 1)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	Duel.NegateActivation(ev)
  	Duel.Draw(tp, 1, REASON_EFFECT)
  	Duel.Draw(1 - tp, 1, REASON_EFFECT)
  end
  
  