name: Symphonic
card_text: Pendulum Scale = 1
  [ Pendulum Effect ]
  Unless you have a "Symphonic Warrior" card in your other Pendulum Zone, this card's Pendulum Scale becomes 4. Once per turn, during your End Phase: You can target 1 of your banished "Symphonic Warrior" monsters; add it to your hand.
  ----------------------------------------
  [ Monster Effect ]
  You can Special Summon this card (from your hand) by removing 3 Symphonic Counters from your field. After you Normal or Special Summon this card, you can Normal Summon 1 monster during your Main Phase this turn, in addition to your Normal Summon/Set. (You can only gain this effect once per turn.)
external_ids: local SETCARD_ID_0 = 0x1066 --Symphonic
  local COUNTER_ID_0 = 0x35 --Symphonic
  
lua: local SETCARD_ID_0 = 0x1066 --Symphonic
  local COUNTER_ID_0 = 0x35 --Symphonic
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--pendulum summon
  	aux.EnablePendulumAttribute(c)
  	--scale
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_CHANGE_LSCALE)
  	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e2:SetRange(LOCATION_PZONE)
  	e2:SetCondition(s.slcon)
  	e2:SetValue(4)
  	c:RegisterEffect(e2)
  	local e3 = e2:Clone()
  	e3:SetCode(EFFECT_CHANGE_RSCALE)
  	c:RegisterEffect(e3)
  	--tohand
  	local e4 = Effect.CreateEffect(c)
  	e4:SetCategory(CATEGORY_TOHAND)
  	e4:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e4:SetCode(EVENT_PHASE + PHASE_END)
  	e4:SetRange(LOCATION_PZONE)
  	e4:SetCountLimit(1)
  	e4:SetCondition(s.thcon)
  	e4:SetTarget(s.thtg)
  	e4:SetOperation(s.thop)
  	c:RegisterEffect(e4)
  	--spsummon
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_FIELD)
  	e5:SetCode(EFFECT_SPSUMMON_PROC)
  	e5:SetProperty(EFFECT_FLAG_UNCOPYABLE)
  	e5:SetRange(LOCATION_HAND)
  	e5:SetCondition(s.spcon)
  	e5:SetOperation(s.spop)
  	c:RegisterEffect(e5)
  	--extra summon
  	local e6 = Effect.CreateEffect(c)
  	e6:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
  	e6:SetCode(EVENT_SUMMON_SUCCESS)
  	e6:SetOperation(s.sumop)
  	c:RegisterEffect(e6)
  	local e7 = e6:Clone()
  	e7:SetCode(EVENT_SPSUMMON_SUCCESS)
  	c:RegisterEffect(e7)
  end
  function s.thcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetTurnPlayer() == tp
  end
  function s.thfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
  end
  function s.thtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_REMOVED) and s.thfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.thfilter, tp, LOCATION_REMOVED, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  	local g = Duel.SelectTarget(tp, s.thfilter, tp, LOCATION_REMOVED, 0, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, g, 1, 0, 0)
  end
  function s.thop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) then
  		Duel.SendtoHand(tc, nil, REASON_EFFECT)
  		Duel.ConfirmCards(1 - tp, tc)
  	end
  end
  function s.slcon(e)
  	return not Duel.IsExistingMatchingCard(Card.IsSetCard, e:GetHandlerPlayer(), LOCATION_PZONE, 0, 1, e:GetHandler(), 0x1066)
  end
  function s.spcon(e, c)
  	if c == nil then
  		return true
  	end
  	local tp = c:GetControler()
  	return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsCanRemoveCounter(tp, 1, 0, COUNTER_ID_0, 3, REASON_COST)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp, c)
  	Duel.RemoveCounter(tp, 1, 0, COUNTER_ID_0, 3, REASON_COST)
  end
  function s.sumop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetFlagEffect(tp, id) ~= 0 then
  		return
  	end
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetTargetRange(LOCATION_HAND + LOCATION_MZONE, 0)
  	e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e1, tp)
  	Duel.RegisterFlagEffect(tp, id, RESET_PHASE + PHASE_END, 0, 1)
  end
  
  
source_text: Symphonic
  Pendulum Scale = 1
  [ Pendulum Effect ]
  Unless you have a "Symphonic Warrior" card in your other Pendulum Zone, this card's Pendulum Scale becomes 4. Once per turn, during your End Phase: You can target 1 of your banished "Symphonic Warrior" monsters; add it to your hand.
  ----------------------------------------
  [ Monster Effect ]
  You can Special Summon this card (from your hand) by removing 3 Symphonic Counters from your field. After you Normal or Special Summon this card, you can Normal Summon 1 monster during your Main Phase this turn, in addition to your Normal Summon/Set. (You can only gain this effect once per turn.)
target_text: -- Symphonic
  local SETCARD_ID_0 = 0x1066 --Symphonic
  local COUNTER_ID_0 = 0x35 --Symphonic
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--pendulum summon
  	aux.EnablePendulumAttribute(c)
  	--scale
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_CHANGE_LSCALE)
  	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e2:SetRange(LOCATION_PZONE)
  	e2:SetCondition(s.slcon)
  	e2:SetValue(4)
  	c:RegisterEffect(e2)
  	local e3 = e2:Clone()
  	e3:SetCode(EFFECT_CHANGE_RSCALE)
  	c:RegisterEffect(e3)
  	--tohand
  	local e4 = Effect.CreateEffect(c)
  	e4:SetCategory(CATEGORY_TOHAND)
  	e4:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e4:SetCode(EVENT_PHASE + PHASE_END)
  	e4:SetRange(LOCATION_PZONE)
  	e4:SetCountLimit(1)
  	e4:SetCondition(s.thcon)
  	e4:SetTarget(s.thtg)
  	e4:SetOperation(s.thop)
  	c:RegisterEffect(e4)
  	--spsummon
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_FIELD)
  	e5:SetCode(EFFECT_SPSUMMON_PROC)
  	e5:SetProperty(EFFECT_FLAG_UNCOPYABLE)
  	e5:SetRange(LOCATION_HAND)
  	e5:SetCondition(s.spcon)
  	e5:SetOperation(s.spop)
  	c:RegisterEffect(e5)
  	--extra summon
  	local e6 = Effect.CreateEffect(c)
  	e6:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
  	e6:SetCode(EVENT_SUMMON_SUCCESS)
  	e6:SetOperation(s.sumop)
  	c:RegisterEffect(e6)
  	local e7 = e6:Clone()
  	e7:SetCode(EVENT_SPSUMMON_SUCCESS)
  	c:RegisterEffect(e7)
  end
  function s.thcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetTurnPlayer() == tp
  end
  function s.thfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
  end
  function s.thtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_REMOVED) and s.thfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.thfilter, tp, LOCATION_REMOVED, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  	local g = Duel.SelectTarget(tp, s.thfilter, tp, LOCATION_REMOVED, 0, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, g, 1, 0, 0)
  end
  function s.thop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) then
  		Duel.SendtoHand(tc, nil, REASON_EFFECT)
  		Duel.ConfirmCards(1 - tp, tc)
  	end
  end
  function s.slcon(e)
  	return not Duel.IsExistingMatchingCard(Card.IsSetCard, e:GetHandlerPlayer(), LOCATION_PZONE, 0, 1, e:GetHandler(), 0x1066)
  end
  function s.spcon(e, c)
  	if c == nil then
  		return true
  	end
  	local tp = c:GetControler()
  	return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsCanRemoveCounter(tp, 1, 0, COUNTER_ID_0, 3, REASON_COST)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp, c)
  	Duel.RemoveCounter(tp, 1, 0, COUNTER_ID_0, 3, REASON_COST)
  end
  function s.sumop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetFlagEffect(tp, id) ~= 0 then
  		return
  	end
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetTargetRange(LOCATION_HAND + LOCATION_MZONE, 0)
  	e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
  	e1:SetReset(RESET_PHASE + PHASE_END)
  	Duel.RegisterEffect(e1, tp)
  	Duel.RegisterFlagEffect(tp, id, RESET_PHASE + PHASE_END, 0, 1)
  end
  
  