name: Elemental
card_text: "Elemental HERO Neos" + "Neo-Spacian Grand Mole" + "Neo-Spacian Dark Panther"
  Must first be Special Summoned (from your Extra Deck) by shuffling the above cards you control into the Deck. (You do not use "Polymerization".) If this card is Special Summoned from the Extra Deck: Draw cards equal to the number of cards your opponent controls, then negate the effects of 1 face-up card on the field until the end of this turn. Once per turn, during the End Phase: Shuffle this card into the Extra Deck, and if you do, banish all cards on the field face-down.
external_ids: local CARD_ID_0 = 89943723 --Elemental HERO Neos
  local CARD_ID_1 = 43237273 --Neo-Spacian Dark Panther
  local CARD_ID_2 = 80344569 --Neo-Spacian Grand Mole
  
lua: local CARD_ID_0 = 89943723 --Elemental HERO Neos
  local CARD_ID_1 = 43237273 --Neo-Spacian Dark Panther
  local CARD_ID_2 = 80344569 --Neo-Spacian Grand Mole
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcCode3(c, CARD_ID_0, CARD_ID_2, CARD_ID_1, false, false)
  	aux.AddContactFusionProcedure(c, Card.IsAbleToDeckOrExtraAsCost, LOCATION_ONFIELD, 0, aux.ContactFusionSendToDeck(c))
  	--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(s.splimit)
  	c:RegisterEffect(e1)
  	--return
  	aux.EnableNeosReturn(c, s.retop, s.set_category)
  	--draw
  	local e5 = Effect.CreateEffect(c)
  	e5:SetDescription(aux.Stringid(id, 1))
  	e5:SetCategory(CATEGORY_DRAW + CATEGORY_DISABLE)
  	e5:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e5:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e5:SetCondition(s.drcon)
  	e5:SetTarget(s.drtg)
  	e5:SetOperation(s.drop)
  	c:RegisterEffect(e5)
  end
  s.material_setcode = 0x8
  function s.splimit(e, se, sp, st)
  	return not e:GetHandler():IsLocation(LOCATION_EXTRA)
  end
  function s.set_category(e, tp, eg, ep, ev, re, r, rp)
  	e:SetCategory(CATEGORY_TODECK + CATEGORY_REMOVE)
  	local g = Duel.GetMatchingGroup(Card.IsAbleToRemove, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, e:GetHandler(), tp, POS_FACEDOWN)
  	Duel.SetOperationInfo(0, CATEGORY_REMOVE, g, #g, 0, 0)
  end
  function s.retop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if not c:IsRelateToEffect(e) or c:IsFacedown() then
  		return
  	end
  	Duel.SendtoDeck(c, nil, SEQ_DECKSHUFFLE, REASON_EFFECT)
  	if c:IsLocation(LOCATION_EXTRA) then
  		local g = Duel.GetMatchingGroup(Card.IsAbleToRemove, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, nil, tp, POS_FACEDOWN)
  		Duel.Remove(g, POS_FACEDOWN, REASON_EFFECT)
  	end
  end
  function s.drcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsPreviousLocation(LOCATION_EXTRA)
  end
  function s.drtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetTargetPlayer(tp)
  	local ct = Duel.GetFieldGroupCount(tp, 0, LOCATION_ONFIELD)
  	Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, tp, ct)
  end
  function s.drop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local p = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER)
  	local d = Duel.GetFieldGroupCount(tp, 0, LOCATION_ONFIELD)
  	local g = Duel.GetMatchingGroup(aux.NegateAnyFilter, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, nil)
  	if Duel.Draw(p, d, REASON_EFFECT) ~= 0 and #g > 0 then
  		Duel.BreakEffect()
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DISABLE)
  		local sg = g:Select(tp, 1, 1, nil)
  		local tc = sg:GetFirst()
  		Duel.NegateRelatedChain(tc, RESET_TURN_SET)
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e1:SetCode(EFFECT_DISABLE)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		tc:RegisterEffect(e1)
  		local e2 = Effect.CreateEffect(c)
  		e2:SetType(EFFECT_TYPE_SINGLE)
  		e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e2:SetCode(EFFECT_DISABLE_EFFECT)
  		e2:SetValue(RESET_TURN_SET)
  		e2:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		tc:RegisterEffect(e2)
  		if tc:IsType(TYPE_TRAPMONSTER) then
  			local e3 = Effect.CreateEffect(c)
  			e3:SetType(EFFECT_TYPE_SINGLE)
  			e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  			e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
  			e3:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  			tc:RegisterEffect(e3)
  		end
  	end
  end
  
  
source_text: Elemental
  "Elemental HERO Neos" + "Neo-Spacian Grand Mole" + "Neo-Spacian Dark Panther"
  Must first be Special Summoned (from your Extra Deck) by shuffling the above cards you control into the Deck. (You do not use "Polymerization".) If this card is Special Summoned from the Extra Deck: Draw cards equal to the number of cards your opponent controls, then negate the effects of 1 face-up card on the field until the end of this turn. Once per turn, during the End Phase: Shuffle this card into the Extra Deck, and if you do, banish all cards on the field face-down.
target_text: -- Elemental
  local CARD_ID_0 = 89943723 --Elemental HERO Neos
  local CARD_ID_1 = 43237273 --Neo-Spacian Dark Panther
  local CARD_ID_2 = 80344569 --Neo-Spacian Grand Mole
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--fusion material
  	c:EnableReviveLimit()
  	aux.AddFusionProcCode3(c, CARD_ID_0, CARD_ID_2, CARD_ID_1, false, false)
  	aux.AddContactFusionProcedure(c, Card.IsAbleToDeckOrExtraAsCost, LOCATION_ONFIELD, 0, aux.ContactFusionSendToDeck(c))
  	--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(s.splimit)
  	c:RegisterEffect(e1)
  	--return
  	aux.EnableNeosReturn(c, s.retop, s.set_category)
  	--draw
  	local e5 = Effect.CreateEffect(c)
  	e5:SetDescription(aux.Stringid(id, 1))
  	e5:SetCategory(CATEGORY_DRAW + CATEGORY_DISABLE)
  	e5:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e5:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e5:SetCondition(s.drcon)
  	e5:SetTarget(s.drtg)
  	e5:SetOperation(s.drop)
  	c:RegisterEffect(e5)
  end
  s.material_setcode = 0x8
  function s.splimit(e, se, sp, st)
  	return not e:GetHandler():IsLocation(LOCATION_EXTRA)
  end
  function s.set_category(e, tp, eg, ep, ev, re, r, rp)
  	e:SetCategory(CATEGORY_TODECK + CATEGORY_REMOVE)
  	local g = Duel.GetMatchingGroup(Card.IsAbleToRemove, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, e:GetHandler(), tp, POS_FACEDOWN)
  	Duel.SetOperationInfo(0, CATEGORY_REMOVE, g, #g, 0, 0)
  end
  function s.retop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if not c:IsRelateToEffect(e) or c:IsFacedown() then
  		return
  	end
  	Duel.SendtoDeck(c, nil, SEQ_DECKSHUFFLE, REASON_EFFECT)
  	if c:IsLocation(LOCATION_EXTRA) then
  		local g = Duel.GetMatchingGroup(Card.IsAbleToRemove, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, nil, tp, POS_FACEDOWN)
  		Duel.Remove(g, POS_FACEDOWN, REASON_EFFECT)
  	end
  end
  function s.drcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsPreviousLocation(LOCATION_EXTRA)
  end
  function s.drtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetTargetPlayer(tp)
  	local ct = Duel.GetFieldGroupCount(tp, 0, LOCATION_ONFIELD)
  	Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, tp, ct)
  end
  function s.drop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local p = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER)
  	local d = Duel.GetFieldGroupCount(tp, 0, LOCATION_ONFIELD)
  	local g = Duel.GetMatchingGroup(aux.NegateAnyFilter, tp, LOCATION_ONFIELD, LOCATION_ONFIELD, nil)
  	if Duel.Draw(p, d, REASON_EFFECT) ~= 0 and #g > 0 then
  		Duel.BreakEffect()
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DISABLE)
  		local sg = g:Select(tp, 1, 1, nil)
  		local tc = sg:GetFirst()
  		Duel.NegateRelatedChain(tc, RESET_TURN_SET)
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e1:SetCode(EFFECT_DISABLE)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		tc:RegisterEffect(e1)
  		local e2 = Effect.CreateEffect(c)
  		e2:SetType(EFFECT_TYPE_SINGLE)
  		e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e2:SetCode(EFFECT_DISABLE_EFFECT)
  		e2:SetValue(RESET_TURN_SET)
  		e2:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  		tc:RegisterEffect(e2)
  		if tc:IsType(TYPE_TRAPMONSTER) then
  			local e3 = Effect.CreateEffect(c)
  			e3:SetType(EFFECT_TYPE_SINGLE)
  			e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  			e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
  			e3:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  			tc:RegisterEffect(e3)
  		end
  	end
  end
  
  