name: Elemental
card_text: "Elemental HERO Avian" + "Elemental HERO Sparkman" + "Elemental HERO Bubbleman"
  Must be Fusion Summoned and cannot be Special Summoned by other ways. You can send 1 other card you control to the Graveyard to target 1 monster you control; while this card is face-up on the field, that monster cannot be destroyed by battle.
external_ids: local CARD_ID_0 = 79979666 --Elemental HERO Bubbleman
  local CARD_ID_1 = 20721928 --Elemental HERO Sparkman
  local CARD_ID_2 = 21844576 --Elemental HERO Avian
  
lua: local CARD_ID_0 = 79979666 --Elemental HERO Bubbleman
  local CARD_ID_1 = 20721928 --Elemental HERO Sparkman
  local CARD_ID_2 = 21844576 --Elemental HERO Avian
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcCode3(c, CARD_ID_2, 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)
  	--set target
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  s.material_setcode = 0x8
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost, tp, LOCATION_ONFIELD, 0, 1, e:GetHandler())
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.SelectMatchingCard(tp, Card.IsAbleToGraveAsCost, tp, LOCATION_ONFIELD, 0, 1, 1, e:GetHandler())
  	Duel.SendtoGrave(g, REASON_COST)
  end
  function s.tgfilter(c, ec)
  	return c:GetFlagEffect(id) == 0 and not ec:IsHasCardTarget(c)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	local c = e:GetHandler()
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.tgfilter(chkc, c)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.tgfilter, tp, LOCATION_MZONE, 0, 1, nil, c)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TARGET)
  	Duel.SelectTarget(tp, s.tgfilter, tp, LOCATION_MZONE, 0, 1, 1, nil, c)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if c:IsFacedown() or not c:IsRelateToEffect(e) then
  		return
  	end
  	if not tc:IsRelateToEffect(e) then
  		return
  	end
  	if c == tc then
  		tc:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD, 0, 0)
  	else
  		c:SetCardTarget(tc)
  	end
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e1:SetCondition(s.indcon)
  	e1:SetValue(1)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  	tc:RegisterEffect(e1)
  end
  function s.indcon(e)
  	local c = e:GetHandler()
  	local rc = e:GetOwner()
  	if c == rc then
  		return c:GetFlagEffect(id) ~= 0
  	else
  		return rc:IsHasCardTarget(c)
  	end
  end
  
  
source_text: Elemental
  "Elemental HERO Avian" + "Elemental HERO Sparkman" + "Elemental HERO Bubbleman"
  Must be Fusion Summoned and cannot be Special Summoned by other ways. You can send 1 other card you control to the Graveyard to target 1 monster you control; while this card is face-up on the field, that monster cannot be destroyed by battle.
target_text: -- Elemental
  local CARD_ID_0 = 79979666 --Elemental HERO Bubbleman
  local CARD_ID_1 = 20721928 --Elemental HERO Sparkman
  local CARD_ID_2 = 21844576 --Elemental HERO Avian
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcCode3(c, CARD_ID_2, 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)
  	--set target
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  s.material_setcode = 0x8
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost, tp, LOCATION_ONFIELD, 0, 1, e:GetHandler())
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.SelectMatchingCard(tp, Card.IsAbleToGraveAsCost, tp, LOCATION_ONFIELD, 0, 1, 1, e:GetHandler())
  	Duel.SendtoGrave(g, REASON_COST)
  end
  function s.tgfilter(c, ec)
  	return c:GetFlagEffect(id) == 0 and not ec:IsHasCardTarget(c)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	local c = e:GetHandler()
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.tgfilter(chkc, c)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.tgfilter, tp, LOCATION_MZONE, 0, 1, nil, c)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TARGET)
  	Duel.SelectTarget(tp, s.tgfilter, tp, LOCATION_MZONE, 0, 1, 1, nil, c)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if c:IsFacedown() or not c:IsRelateToEffect(e) then
  		return
  	end
  	if not tc:IsRelateToEffect(e) then
  		return
  	end
  	if c == tc then
  		tc:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD, 0, 0)
  	else
  		c:SetCardTarget(tc)
  	end
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
  	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e1:SetCondition(s.indcon)
  	e1:SetValue(1)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  	tc:RegisterEffect(e1)
  end
  function s.indcon(e)
  	local c = e:GetHandler()
  	local rc = e:GetOwner()
  	if c == rc then
  		return c:GetFlagEffect(id) ~= 0
  	else
  		return rc:IsHasCardTarget(c)
  	end
  end
  
  