name: Elemental
card_text: "Elemental HERO Neos" + 1 Warrior monster
  Must be Fusion Summoned. Gains ATK equal to half the original ATK of the Warrior Fusion Material used for its Fusion Summon, except "Elemental HERO Neos". Can make a second attack during each Battle Phase. Your opponent takes no battle damage from attacks involving this card.
external_ids: local CARD_ID_0 = 89943723 --Elemental HERO Neos
  
lua: local CARD_ID_0 = 89943723 --Elemental HERO Neos
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcCodeFun(c, CARD_ID_0, aux.FilterBoolFunction(Card.IsRace, RACE_WARRIOR), 1, 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)
  	--atk
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_MATERIAL_CHECK)
  	e2:SetValue(s.valcheck)
  	c:RegisterEffect(e2)
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
  	e3:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e3:SetCondition(s.atkcon)
  	e3:SetOperation(s.atkop)
  	e3:SetLabelObject(e2)
  	c:RegisterEffect(e3)
  	--multiatk
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_SINGLE)
  	e4:SetCode(EFFECT_EXTRA_ATTACK)
  	e4:SetValue(1)
  	c:RegisterEffect(e4)
  	--no battle damage
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_SINGLE)
  	e5:SetCode(EFFECT_NO_BATTLE_DAMAGE)
  	c:RegisterEffect(e5)
  end
  s.material_setcode = 0x8
  function s.valcheck(e, c)
  	local g = c:GetMaterial()
  	local atk = 0
  	local tc = g:GetFirst()
  	if tc:IsCode(CARD_ID_0) or tc:CheckFusionSubstitute(c) then
  		tc = g:GetNext()
  	end
  	if not tc:IsCode(CARD_ID_0) then
  		atk = math.ceil(tc:GetTextAttack() / 2)
  	end
  	e:SetLabel(atk)
  end
  function s.atkcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local atk = e:GetLabelObject():GetLabel()
  	if atk > 0 then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_UPDATE_ATTACK)
  		e1:SetValue(atk)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_DISABLE)
  		c:RegisterEffect(e1)
  	end
  end
  
  
source_text: Elemental
  "Elemental HERO Neos" + 1 Warrior monster
  Must be Fusion Summoned. Gains ATK equal to half the original ATK of the Warrior Fusion Material used for its Fusion Summon, except "Elemental HERO Neos". Can make a second attack during each Battle Phase. Your opponent takes no battle damage from attacks involving this card.
target_text: -- Elemental
  local CARD_ID_0 = 89943723 --Elemental HERO Neos
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcCodeFun(c, CARD_ID_0, aux.FilterBoolFunction(Card.IsRace, RACE_WARRIOR), 1, 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)
  	--atk
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_MATERIAL_CHECK)
  	e2:SetValue(s.valcheck)
  	c:RegisterEffect(e2)
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
  	e3:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e3:SetCondition(s.atkcon)
  	e3:SetOperation(s.atkop)
  	e3:SetLabelObject(e2)
  	c:RegisterEffect(e3)
  	--multiatk
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_SINGLE)
  	e4:SetCode(EFFECT_EXTRA_ATTACK)
  	e4:SetValue(1)
  	c:RegisterEffect(e4)
  	--no battle damage
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_SINGLE)
  	e5:SetCode(EFFECT_NO_BATTLE_DAMAGE)
  	c:RegisterEffect(e5)
  end
  s.material_setcode = 0x8
  function s.valcheck(e, c)
  	local g = c:GetMaterial()
  	local atk = 0
  	local tc = g:GetFirst()
  	if tc:IsCode(CARD_ID_0) or tc:CheckFusionSubstitute(c) then
  		tc = g:GetNext()
  	end
  	if not tc:IsCode(CARD_ID_0) then
  		atk = math.ceil(tc:GetTextAttack() / 2)
  	end
  	e:SetLabel(atk)
  end
  function s.atkcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local atk = e:GetLabelObject():GetLabel()
  	if atk > 0 then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_UPDATE_ATTACK)
  		e1:SetValue(atk)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_DISABLE)
  		c:RegisterEffect(e1)
  	end
  end
  
  