name: Red-Eyes
card_text: This card is treated as a Normal Monster while face-up on the field or in the Graveyard. While this card is a Normal Monster on the field, you can Normal Summon it to have it become an Effect Monster with this effect.
  ● If damage calculation is performed involving this card, at the end of the Battle Phase: You can inflict damage to your opponent equal to this card's original ATK. You can only use this effect of "Red-Eyes Black Flare Dragon" once per turn.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.EnableDualAttribute(c)
  	--damage
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_DAMAGE)
  	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_PHASE + PHASE_BATTLE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.damcon)
  	e1:SetTarget(s.damtg)
  	e1:SetOperation(s.damop)
  	c:RegisterEffect(e1)
  end
  function s.damcon(e, tp, eg, ep, ev, re, r, rp)
  	return aux.IsDualState(e) and e:GetHandler():GetBattledGroupCount() > 0
  end
  function s.damtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local atk = e:GetHandler():GetBaseAttack()
  	Duel.SetOperationInfo(0, CATEGORY_DAMAGE, nil, 0, 1 - tp, atk)
  end
  function s.damop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsFaceup() and c:IsRelateToEffect(e) then
  		local atk = c:GetBaseAttack()
  		Duel.Damage(1 - tp, atk, REASON_EFFECT)
  	end
  end
  
  
source_text: Red-Eyes
  This card is treated as a Normal Monster while face-up on the field or in the Graveyard. While this card is a Normal Monster on the field, you can Normal Summon it to have it become an Effect Monster with this effect.
  ● If damage calculation is performed involving this card, at the end of the Battle Phase: You can inflict damage to your opponent equal to this card's original ATK. You can only use this effect of "Red-Eyes Black Flare Dragon" once per turn.
target_text: -- Red-Eyes
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.EnableDualAttribute(c)
  	--damage
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_DAMAGE)
  	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_PHASE + PHASE_BATTLE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.damcon)
  	e1:SetTarget(s.damtg)
  	e1:SetOperation(s.damop)
  	c:RegisterEffect(e1)
  end
  function s.damcon(e, tp, eg, ep, ev, re, r, rp)
  	return aux.IsDualState(e) and e:GetHandler():GetBattledGroupCount() > 0
  end
  function s.damtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local atk = e:GetHandler():GetBaseAttack()
  	Duel.SetOperationInfo(0, CATEGORY_DAMAGE, nil, 0, 1 - tp, atk)
  end
  function s.damop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsFaceup() and c:IsRelateToEffect(e) then
  		local atk = c:GetBaseAttack()
  		Duel.Damage(1 - tp, atk, REASON_EFFECT)
  	end
  end
  
  