name: Quantum
card_text: Activate this card by declaring 1 Monster Type and 1 Attribute; Special Summon this card as a Normal Monster (Level 4/ATK 0/DEF 2200) with that Type and Attribute. (This card is also still a Trap.)
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(0, TIMING_END_PHASE)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		local rac = 0
  		local crac = 1
  		while bit.band(RACE_ALL, crac) ~= 0 do
  			local catt = 1
  			for iatt = 0, 7 do
  				if Duel.IsPlayerCanSpecialSummonMonster(tp, id, 0, TYPES_NORMAL_TRAP_MONSTER, 0, 2200, 4, crac, catt) then
  					rac = rac + crac
  					break
  				end
  				catt = catt * 2
  			end
  			crac = crac * 2
  		end
  		e:SetLabel(rac)
  		return e:IsCostChecked() and rac ~= 0 and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_RACE)
  	local crac = Duel.AnnounceRace(tp, 1, e:GetLabel())
  	local att = 0
  	local catt = 1
  	for iatt = 0, 7 do
  		if Duel.IsPlayerCanSpecialSummonMonster(tp, id, 0, TYPES_NORMAL_TRAP_MONSTER, 0, 2200, 4, crac, catt) then
  			att = att + catt
  		end
  		catt = catt * 2
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATTRIBUTE)
  	catt = Duel.AnnounceAttribute(tp, 1, att)
  	e:SetLabel(crac)
  	Duel.SetTargetParam(catt)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, e:GetHandler(), 1, 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local rac = e:GetLabel()
  	local att = Duel.GetChainInfo(0, CHAININFO_TARGET_PARAM)
  	if not Duel.IsPlayerCanSpecialSummonMonster(tp, id, 0, TYPES_NORMAL_TRAP_MONSTER, 0, 2200, 4, rac, att) then
  		return
  	end
  	c:AddMonsterAttribute(TYPE_NORMAL + TYPE_TRAP, att, rac, 0, 0, 0)
  	Duel.SpecialSummon(c, 0, tp, tp, true, false, POS_FACEUP)
  end
  
  
source_text: Quantum
  Activate this card by declaring 1 Monster Type and 1 Attribute; Special Summon this card as a Normal Monster (Level 4/ATK 0/DEF 2200) with that Type and Attribute. (This card is also still a Trap.)
target_text: -- Quantum
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetHintTiming(0, TIMING_END_PHASE)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		local rac = 0
  		local crac = 1
  		while bit.band(RACE_ALL, crac) ~= 0 do
  			local catt = 1
  			for iatt = 0, 7 do
  				if Duel.IsPlayerCanSpecialSummonMonster(tp, id, 0, TYPES_NORMAL_TRAP_MONSTER, 0, 2200, 4, crac, catt) then
  					rac = rac + crac
  					break
  				end
  				catt = catt * 2
  			end
  			crac = crac * 2
  		end
  		e:SetLabel(rac)
  		return e:IsCostChecked() and rac ~= 0 and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_RACE)
  	local crac = Duel.AnnounceRace(tp, 1, e:GetLabel())
  	local att = 0
  	local catt = 1
  	for iatt = 0, 7 do
  		if Duel.IsPlayerCanSpecialSummonMonster(tp, id, 0, TYPES_NORMAL_TRAP_MONSTER, 0, 2200, 4, crac, catt) then
  			att = att + catt
  		end
  		catt = catt * 2
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATTRIBUTE)
  	catt = Duel.AnnounceAttribute(tp, 1, att)
  	e:SetLabel(crac)
  	Duel.SetTargetParam(catt)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, e:GetHandler(), 1, 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local rac = e:GetLabel()
  	local att = Duel.GetChainInfo(0, CHAININFO_TARGET_PARAM)
  	if not Duel.IsPlayerCanSpecialSummonMonster(tp, id, 0, TYPES_NORMAL_TRAP_MONSTER, 0, 2200, 4, rac, att) then
  		return
  	end
  	c:AddMonsterAttribute(TYPE_NORMAL + TYPE_TRAP, att, rac, 0, 0, 0)
  	Duel.SpecialSummon(c, 0, tp, tp, true, false, POS_FACEUP)
  end
  
  