name: Elemental
card_text: "Elemental HERO Clayman" + "Elemental HERO Burstinatrix"
  Must be Fusion Summoned. This card can attack directly while in Defense Position. If it does, apply its ATK for damage calculation, and its ATK is halved during damage calculation only.
external_ids: local CARD_ID_0 = 84327329 --Elemental HERO Clayman
  local CARD_ID_1 = 58932615 --Elemental HERO Burstinatrix
  
lua: local CARD_ID_0 = 84327329 --Elemental HERO Clayman
  local CARD_ID_1 = 58932615 --Elemental HERO Burstinatrix
  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)
  	--
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_DIRECT_ATTACK)
  	e2:SetCondition(s.dacon)
  	c:RegisterEffect(e2)
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_SINGLE)
  	e3:SetCode(EFFECT_DEFENSE_ATTACK)
  	c:RegisterEffect(e3)
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_SINGLE)
  	e4:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
  	e4:SetCondition(s.dacon)
  	e4:SetValue(1)
  	c:RegisterEffect(e4)
  	--atkdown
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_SINGLE)
  	e5:SetCode(EFFECT_SET_ATTACK_FINAL)
  	e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e5:SetRange(LOCATION_MZONE)
  	e5:SetCondition(s.atkcon)
  	e5:SetValue(s.atkval)
  	c:RegisterEffect(e5)
  end
  s.material_setcode = 0x8
  function s.dacon(e)
  	return e:GetHandler():IsDefensePos()
  end
  function s.atkcon(e)
  	if Duel.GetCurrentPhase() ~= PHASE_DAMAGE_CAL then
  		return false
  	end
  	local c = e:GetHandler()
  	return c:IsDefensePos() and c == Duel.GetAttacker() and Duel.GetAttackTarget() == nil and c:GetEffectCount(EFFECT_DIRECT_ATTACK) == 1
  end
  function s.atkval(e, c)
  	return math.ceil(c:GetAttack() / 2)
  end
  
  
source_text: Elemental
  "Elemental HERO Clayman" + "Elemental HERO Burstinatrix"
  Must be Fusion Summoned. This card can attack directly while in Defense Position. If it does, apply its ATK for damage calculation, and its ATK is halved during damage calculation only.
target_text: -- Elemental
  local CARD_ID_0 = 84327329 --Elemental HERO Clayman
  local CARD_ID_1 = 58932615 --Elemental HERO Burstinatrix
  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)
  	--
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_DIRECT_ATTACK)
  	e2:SetCondition(s.dacon)
  	c:RegisterEffect(e2)
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_SINGLE)
  	e3:SetCode(EFFECT_DEFENSE_ATTACK)
  	c:RegisterEffect(e3)
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_SINGLE)
  	e4:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
  	e4:SetCondition(s.dacon)
  	e4:SetValue(1)
  	c:RegisterEffect(e4)
  	--atkdown
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_SINGLE)
  	e5:SetCode(EFFECT_SET_ATTACK_FINAL)
  	e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e5:SetRange(LOCATION_MZONE)
  	e5:SetCondition(s.atkcon)
  	e5:SetValue(s.atkval)
  	c:RegisterEffect(e5)
  end
  s.material_setcode = 0x8
  function s.dacon(e)
  	return e:GetHandler():IsDefensePos()
  end
  function s.atkcon(e)
  	if Duel.GetCurrentPhase() ~= PHASE_DAMAGE_CAL then
  		return false
  	end
  	local c = e:GetHandler()
  	return c:IsDefensePos() and c == Duel.GetAttacker() and Duel.GetAttackTarget() == nil and c:GetEffectCount(EFFECT_DIRECT_ATTACK) == 1
  end
  function s.atkval(e, c)
  	return math.ceil(c:GetAttack() / 2)
  end
  
  