name: Pendulum
card_text: Fusion Summon 1 Fusion Monster from your Extra Deck, using monsters you control as Fusion Materials. If you have 2 cards in your Pendulum Zones, you can also use cards in your Pendulum Zones as Fusion Material(s). You can only activate 1 "Pendulum Fusion" per turn.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = FusionSpell.CreateSummonEffect(c, {
  		pre_select_mat_location = s.pre_select_mat_location,
  	})
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	c:RegisterEffect(e1)
  end
  
  function s.pre_select_mat_location(tc, tp)
  	local location = LOCATION_MZONE
  	if Duel.GetFieldGroupCount(tp, LOCATION_PZONE, 0) >= 2 then
  		location = location | LOCATION_PZONE
  	end
  	return location
  end
  
  
source_text: Pendulum
  Fusion Summon 1 Fusion Monster from your Extra Deck, using monsters you control as Fusion Materials. If you have 2 cards in your Pendulum Zones, you can also use cards in your Pendulum Zones as Fusion Material(s). You can only activate 1 "Pendulum Fusion" per turn.
target_text: -- Pendulum
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = FusionSpell.CreateSummonEffect(c, {
  		pre_select_mat_location = s.pre_select_mat_location,
  	})
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	c:RegisterEffect(e1)
  end
  
  function s.pre_select_mat_location(tc, tp)
  	local location = LOCATION_MZONE
  	if Duel.GetFieldGroupCount(tp, LOCATION_PZONE, 0) >= 2 then
  		location = location | LOCATION_PZONE
  	end
  	return location
  end
  
  