name: Elemental
card_text: "Elemental HERO Avian" + "Elemental HERO Burstinatrix" + "Elemental HERO Clayman" + "Elemental HERO Bubbleman"
  Must be Fusion Summoned and cannot be Special Summoned by other ways. While face-up on the field, this card is also WIND, WATER, FIRE, and EARTH-Attribute. When this card is Fusion Summoned: Shuffle all banished cards into the Deck(s). This card gains 300 ATK for each monster your opponent controls that shares an Attribute with this card.
external_ids: local CARD_ID_0 = 79979666 --Elemental HERO Bubbleman
  local CARD_ID_1 = 84327329 --Elemental HERO Clayman
  local CARD_ID_2 = 58932615 --Elemental HERO Burstinatrix
  local CARD_ID_3 = 21844576 --Elemental HERO Avian
  
lua: local CARD_ID_0 = 79979666 --Elemental HERO Bubbleman
  local CARD_ID_1 = 84327329 --Elemental HERO Clayman
  local CARD_ID_2 = 58932615 --Elemental HERO Burstinatrix
  local CARD_ID_3 = 21844576 --Elemental HERO Avian
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcCode4(c, CARD_ID_3, CARD_ID_2, CARD_ID_1, CARD_ID_0, true, true)
  	--spsummon condition
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e2:SetCode(EFFECT_SPSUMMON_CONDITION)
  	e2:SetValue(aux.fuslimit)
  	c:RegisterEffect(e2)
  	--attribute
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_SINGLE)
  	e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCode(EFFECT_ADD_ATTRIBUTE)
  	e3:SetValue(0xf)
  	c:RegisterEffect(e3)
  	--return
  	local e4 = Effect.CreateEffect(c)
  	e4:SetDescription(aux.Stringid(id, 0))
  	e4:SetCategory(CATEGORY_TODECK)
  	e4:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e4:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e4:SetCondition(s.retcon)
  	e4:SetTarget(s.rettg)
  	e4:SetOperation(s.retop)
  	c:RegisterEffect(e4)
  	--atk
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_SINGLE)
  	e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e5:SetRange(LOCATION_MZONE)
  	e5:SetCode(EFFECT_UPDATE_ATTACK)
  	e5:SetValue(s.val)
  	c:RegisterEffect(e5)
  end
  s.material_setcode = 0x8
  function s.retcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
  end
  function s.rettg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local g = Duel.GetMatchingGroup(Card.IsAbleToDeck, tp, LOCATION_REMOVED, LOCATION_REMOVED, nil)
  	Duel.SetOperationInfo(0, CATEGORY_TODECK, g, g:GetCount(), 0, 0)
  end
  function s.retop(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(nil, tp, LOCATION_REMOVED, LOCATION_REMOVED, nil)
  	Duel.SendtoDeck(g, nil, SEQ_DECKSHUFFLE, REASON_EFFECT)
  end
  function s.atkfilter(c, att)
  	return c:IsFaceup() and c:IsAttribute(att)
  end
  function s.val(e, c)
  	return Duel.GetMatchingGroupCount(s.atkfilter, c:GetControler(), 0, LOCATION_MZONE, nil, c:GetAttribute()) * 300
  end
  
  
source_text: Elemental
  "Elemental HERO Avian" + "Elemental HERO Burstinatrix" + "Elemental HERO Clayman" + "Elemental HERO Bubbleman"
  Must be Fusion Summoned and cannot be Special Summoned by other ways. While face-up on the field, this card is also WIND, WATER, FIRE, and EARTH-Attribute. When this card is Fusion Summoned: Shuffle all banished cards into the Deck(s). This card gains 300 ATK for each monster your opponent controls that shares an Attribute with this card.
target_text: -- Elemental
  local CARD_ID_0 = 79979666 --Elemental HERO Bubbleman
  local CARD_ID_1 = 84327329 --Elemental HERO Clayman
  local CARD_ID_2 = 58932615 --Elemental HERO Burstinatrix
  local CARD_ID_3 = 21844576 --Elemental HERO Avian
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcCode4(c, CARD_ID_3, CARD_ID_2, CARD_ID_1, CARD_ID_0, true, true)
  	--spsummon condition
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
  	e2:SetCode(EFFECT_SPSUMMON_CONDITION)
  	e2:SetValue(aux.fuslimit)
  	c:RegisterEffect(e2)
  	--attribute
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_SINGLE)
  	e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCode(EFFECT_ADD_ATTRIBUTE)
  	e3:SetValue(0xf)
  	c:RegisterEffect(e3)
  	--return
  	local e4 = Effect.CreateEffect(c)
  	e4:SetDescription(aux.Stringid(id, 0))
  	e4:SetCategory(CATEGORY_TODECK)
  	e4:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e4:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e4:SetCondition(s.retcon)
  	e4:SetTarget(s.rettg)
  	e4:SetOperation(s.retop)
  	c:RegisterEffect(e4)
  	--atk
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_SINGLE)
  	e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e5:SetRange(LOCATION_MZONE)
  	e5:SetCode(EFFECT_UPDATE_ATTACK)
  	e5:SetValue(s.val)
  	c:RegisterEffect(e5)
  end
  s.material_setcode = 0x8
  function s.retcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
  end
  function s.rettg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local g = Duel.GetMatchingGroup(Card.IsAbleToDeck, tp, LOCATION_REMOVED, LOCATION_REMOVED, nil)
  	Duel.SetOperationInfo(0, CATEGORY_TODECK, g, g:GetCount(), 0, 0)
  end
  function s.retop(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(nil, tp, LOCATION_REMOVED, LOCATION_REMOVED, nil)
  	Duel.SendtoDeck(g, nil, SEQ_DECKSHUFFLE, REASON_EFFECT)
  end
  function s.atkfilter(c, att)
  	return c:IsFaceup() and c:IsAttribute(att)
  end
  function s.val(e, c)
  	return Duel.GetMatchingGroupCount(s.atkfilter, c:GetControler(), 0, LOCATION_MZONE, nil, c:GetAttribute()) * 300
  end
  
  