name: Hero
card_text: Negate 1 attack from an opponent's monster. You must control a face-up "Elemental HERO" monster to resolve this effect.
external_ids: local SETCARD_ID_0 = 0x3008 --Elemental
  
lua: local SETCARD_ID_0 = 0x3008 --Elemental
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--negate attack
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCondition(s.condition)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetTurnPlayer() ~= tp and aux.bpcon(e, tp, eg, ep, ev, re, r, rp)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetAttacker() and s.discon(e, tp, eg, ep, ev, re, r, rp) then
  		Duel.NegateAttack()
  	else
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  		e1:SetCode(EVENT_ATTACK_ANNOUNCE)
  		e1:SetReset(RESET_PHASE + PHASE_END)
  		e1:SetCountLimit(1)
  		e1:SetCondition(s.discon)
  		e1:SetOperation(s.disop)
  		Duel.RegisterEffect(e1, tp)
  	end
  end
  function s.discon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.disop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_CARD, 0, id)
  	Duel.NegateAttack()
  end
  
  
source_text: Hero
  Negate 1 attack from an opponent's monster. You must control a face-up "Elemental HERO" monster to resolve this effect.
target_text: -- Hero
  local SETCARD_ID_0 = 0x3008 --Elemental
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--negate attack
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCondition(s.condition)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetTurnPlayer() ~= tp and aux.bpcon(e, tp, eg, ep, ev, re, r, rp)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetAttacker() and s.discon(e, tp, eg, ep, ev, re, r, rp) then
  		Duel.NegateAttack()
  	else
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  		e1:SetCode(EVENT_ATTACK_ANNOUNCE)
  		e1:SetReset(RESET_PHASE + PHASE_END)
  		e1:SetCountLimit(1)
  		e1:SetCondition(s.discon)
  		e1:SetOperation(s.disop)
  		Duel.RegisterEffect(e1, tp)
  	end
  end
  function s.discon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.disop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_CARD, 0, id)
  	Duel.NegateAttack()
  end
  
  