name: Elemental
card_text: "Elemental HERO Avian" + "Elemental HERO Burstinatrix"
  Must be Fusion Summoned. When this card destroys a monster by battle and sends it to the GY: Inflict damage to your opponent equal to the ATK of the destroyed monster in the GY.
external_ids: local CARD_ID_0 = 58932615 --Elemental HERO Burstinatrix
  local CARD_ID_1 = 21844576 --Elemental HERO Avian
  
lua: local CARD_ID_0 = 58932615 --Elemental HERO Burstinatrix
  local CARD_ID_1 = 21844576 --Elemental HERO Avian
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcCode2(c, CARD_ID_1, CARD_ID_0, true, true)
  	--spsummon condition
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetCode(EFFECT_SPSUMMON_CONDITION)
  	e1:SetValue(aux.fuslimit)
  	c:RegisterEffect(e1)
  	--damage
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_DAMAGE)
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e2:SetCode(EVENT_BATTLE_DESTROYING)
  	e2:SetCondition(s.damcon)
  	e2:SetTarget(s.damtg)
  	e2:SetOperation(s.damop)
  	c:RegisterEffect(e2)
  end
  s.material_setcode = 0x8
  function s.damcon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local bc = c:GetBattleTarget()
  	return c:IsRelateToBattle() and bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER)
  end
  function s.damtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local bc = e:GetHandler():GetBattleTarget()
  	Duel.SetTargetCard(bc)
  	local dam = bc:GetAttack()
  	if dam < 0 then
  		dam = 0
  	end
  	Duel.SetTargetPlayer(1 - tp)
  	Duel.SetTargetParam(dam)
  	Duel.SetOperationInfo(0, CATEGORY_DAMAGE, nil, 0, 1 - tp, dam)
  end
  function s.damop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) then
  		local p = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER)
  		local dam = tc:GetAttack()
  		if dam < 0 then
  			dam = 0
  		end
  		Duel.Damage(p, dam, REASON_EFFECT)
  	end
  end
  
  
source_text: Elemental
  "Elemental HERO Avian" + "Elemental HERO Burstinatrix"
  Must be Fusion Summoned. When this card destroys a monster by battle and sends it to the GY: Inflict damage to your opponent equal to the ATK of the destroyed monster in the GY.
target_text: -- Elemental
  local CARD_ID_0 = 58932615 --Elemental HERO Burstinatrix
  local CARD_ID_1 = 21844576 --Elemental HERO Avian
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcCode2(c, CARD_ID_1, CARD_ID_0, true, true)
  	--spsummon condition
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e1:SetCode(EFFECT_SPSUMMON_CONDITION)
  	e1:SetValue(aux.fuslimit)
  	c:RegisterEffect(e1)
  	--damage
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_DAMAGE)
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e2:SetCode(EVENT_BATTLE_DESTROYING)
  	e2:SetCondition(s.damcon)
  	e2:SetTarget(s.damtg)
  	e2:SetOperation(s.damop)
  	c:RegisterEffect(e2)
  end
  s.material_setcode = 0x8
  function s.damcon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local bc = c:GetBattleTarget()
  	return c:IsRelateToBattle() and bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER)
  end
  function s.damtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local bc = e:GetHandler():GetBattleTarget()
  	Duel.SetTargetCard(bc)
  	local dam = bc:GetAttack()
  	if dam < 0 then
  		dam = 0
  	end
  	Duel.SetTargetPlayer(1 - tp)
  	Duel.SetTargetParam(dam)
  	Duel.SetOperationInfo(0, CATEGORY_DAMAGE, nil, 0, 1 - tp, dam)
  end
  function s.damop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) then
  		local p = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER)
  		local dam = tc:GetAttack()
  		if dam < 0 then
  			dam = 0
  		end
  		Duel.Damage(p, dam, REASON_EFFECT)
  	end
  end
  
  