name: Gigantic
card_text: 2 Level 2 monsters
  For this card's Xyz Summon, you can treat Link-2 monsters you control as Level 2 monsters for material. The original ATK of this card that has a Fusion, Synchro, Xyz, or Link Monster as material becomes doubled. During your Main Phase: You can activate this effect; detach 1 material from a monster you control, and if you do, Special Summon 1 Level 2 monster from your Deck, also neither player can Special Summon for the rest of this turn, except Level/Rank/Link 2 monsters. You can only use this effect of "Gigantic Spright" once per turn.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	c:EnableReviveLimit()
  	aux.AddXyzProcedureLevelFree(c, s.mfilter, nil, 2, 2)
  	--atk
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCode(EFFECT_SET_BASE_ATTACK)
  	e1:SetCondition(s.adcon)
  	e1:SetValue(s.atkval)
  	c:RegisterEffect(e1)
  	--spsummon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1, id)
  	e2:SetTarget(s.sptg)
  	e2:SetOperation(s.spop)
  	c:RegisterEffect(e2)
  end
  function s.mfilter(c, xyzc)
  	return c:IsXyzLevel(xyzc, 2) or c:IsLink(2)
  end
  function s.adcon(e)
  	return e:GetHandler():GetOverlayGroup():IsExists(Card.IsType, 1, nil, TYPE_FUSION + TYPE_SYNCHRO + TYPE_XYZ + TYPE_LINK)
  end
  function s.atkval(e, c)
  	return c:GetBaseAttack() * 2
  end
  function s.spfilter(c, e, tp)
  	return c:IsLevel(2) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.CheckRemoveOverlayCard(tp, 1, 0, 1, REASON_EFFECT)
  			and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
  			and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_DECK, 0, 1, nil, e, tp)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_DECK)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_DECK, 0, nil, e, tp)
  	if Duel.RemoveOverlayCard(tp, 1, 0, 1, 1, REASON_EFFECT) ~= 0 and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and g:GetCount() > 0 then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  		local sg = g:Select(tp, 1, 1, nil)
  		Duel.SpecialSummon(sg, 0, tp, tp, false, false, POS_FACEUP)
  	end
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	e1:SetTargetRange(1, 1)
  	e1:SetTarget(s.splimit)
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e1, tp)
  end
  function s.splimit(e, c)
  	return not c:IsLevel(2) and not c:IsRank(2) and not c:IsLink(2)
  end
  
  
source_text: Gigantic
  2 Level 2 monsters
  For this card's Xyz Summon, you can treat Link-2 monsters you control as Level 2 monsters for material. The original ATK of this card that has a Fusion, Synchro, Xyz, or Link Monster as material becomes doubled. During your Main Phase: You can activate this effect; detach 1 material from a monster you control, and if you do, Special Summon 1 Level 2 monster from your Deck, also neither player can Special Summon for the rest of this turn, except Level/Rank/Link 2 monsters. You can only use this effect of "Gigantic Spright" once per turn.
target_text: -- Gigantic
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	c:EnableReviveLimit()
  	aux.AddXyzProcedureLevelFree(c, s.mfilter, nil, 2, 2)
  	--atk
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCode(EFFECT_SET_BASE_ATTACK)
  	e1:SetCondition(s.adcon)
  	e1:SetValue(s.atkval)
  	c:RegisterEffect(e1)
  	--spsummon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1, id)
  	e2:SetTarget(s.sptg)
  	e2:SetOperation(s.spop)
  	c:RegisterEffect(e2)
  end
  function s.mfilter(c, xyzc)
  	return c:IsXyzLevel(xyzc, 2) or c:IsLink(2)
  end
  function s.adcon(e)
  	return e:GetHandler():GetOverlayGroup():IsExists(Card.IsType, 1, nil, TYPE_FUSION + TYPE_SYNCHRO + TYPE_XYZ + TYPE_LINK)
  end
  function s.atkval(e, c)
  	return c:GetBaseAttack() * 2
  end
  function s.spfilter(c, e, tp)
  	return c:IsLevel(2) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.CheckRemoveOverlayCard(tp, 1, 0, 1, REASON_EFFECT)
  			and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
  			and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_DECK, 0, 1, nil, e, tp)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_DECK)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_DECK, 0, nil, e, tp)
  	if Duel.RemoveOverlayCard(tp, 1, 0, 1, 1, REASON_EFFECT) ~= 0 and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and g:GetCount() > 0 then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  		local sg = g:Select(tp, 1, 1, nil)
  		Duel.SpecialSummon(sg, 0, tp, tp, false, false, POS_FACEUP)
  	end
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	e1:SetTargetRange(1, 1)
  	e1:SetTarget(s.splimit)
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e1, tp)
  end
  function s.splimit(e, c)
  	return not c:IsLevel(2) and not c:IsRank(2) and not c:IsLink(2)
  end
  
  