Yang
All monsters your opponent controls must attack, if able. During either player's Main Phase or Battle Phase: You can send this face-up card from your Spell & Trap Zone to the Graveyard; immediately after this effect resolves, Synchro Summon 1 Synchro Monster, using 1 or more "Yang Zing" monsters you control as Synchro Materials.
local SETCARD_ID_0 = 0x9e --Yang

local SETCARD_ID_0 = 0x9e --Yang
local s, id, o = GetID()
function s.initial_effect(c)
	--Activate
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_ACTIVATE)
	e1:SetCode(EVENT_FREE_CHAIN)
	c:RegisterEffect(e1)
	--must attack
	local e2 = Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_FIELD)
	e2:SetCode(EFFECT_MUST_ATTACK)
	e2:SetRange(LOCATION_SZONE)
	e2:SetTargetRange(0, LOCATION_MZONE)
	c:RegisterEffect(e2)
	--synchro effect
	local e4 = Effect.CreateEffect(c)
	e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
	e4:SetType(EFFECT_TYPE_QUICK_O)
	e4:SetCode(EVENT_FREE_CHAIN)
	e4:SetHintTiming(0, TIMING_BATTLE_START + TIMING_BATTLE_END)
	e4:SetRange(LOCATION_SZONE)
	e4:SetCondition(s.sccon)
	e4:SetCost(s.sccost)
	e4:SetTarget(s.sctg)
	e4:SetOperation(s.scop)
	c:RegisterEffect(e4)
end
function s.sccon(e, tp, eg, ep, ev, re, r, rp)
	local ph = Duel.GetCurrentPhase()
	return ph == PHASE_MAIN1 or (ph >= PHASE_BATTLE_START and ph <= PHASE_BATTLE) or ph == PHASE_MAIN2
end
function s.mfilter(c)
	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER)
end
function s.syncheck(g, tp, syncard)
	return g:IsExists(s.mfilter, 1, nil) and syncard:IsSynchroSummonable(nil, g, #g - 1, #g - 1) and aux.SynMixHandCheck(g, tp, syncard)
end
function s.spfilter(c, tp, mg)
	return mg:CheckSubGroup(s.syncheck, 2, #mg, tp, c)
end
function s.sccost(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return e:GetHandler():IsAbleToGraveAsCost()
	end
	Duel.SendtoGrave(e:GetHandler(), REASON_COST)
end
function s.sctg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		local mg = Duel.GetSynchroMaterial(tp)
		if mg:IsExists(Card.GetHandSynchro, 1, nil) then
			local mg2 = Duel.GetMatchingGroup(nil, tp, LOCATION_HAND, 0, nil)
			if mg2:GetCount() > 0 then
				mg:Merge(mg2)
			end
		end
		return Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_EXTRA, 0, 1, nil, tp, mg)
	end
	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_EXTRA)
end
function s.scop(e, tp, eg, ep, ev, re, r, rp)
	local mg = Duel.GetSynchroMaterial(tp)
	if mg:IsExists(Card.GetHandSynchro, 1, nil) then
		local mg2 = Duel.GetMatchingGroup(nil, tp, LOCATION_HAND, 0, nil)
		if mg2:GetCount() > 0 then
			mg:Merge(mg2)
		end
	end
	local g = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_EXTRA, 0, nil, tp, mg)
	if g:GetCount() > 0 then
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
		local sg = g:Select(tp, 1, 1, nil)
		local sc = sg:GetFirst()
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SMATERIAL)
		local tg = mg:SelectSubGroup(tp, s.syncheck, false, 2, #mg, tp, sc)
		Duel.SynchroSummon(tp, sc, nil, tg, #tg - 1, #tg - 1)
	end
end


Yang
All monsters your opponent controls must attack, if able. During either player's Main Phase or Battle Phase: You can send this face-up card from your Spell & Trap Zone to the Graveyard; immediately after this effect resolves, Synchro Summon 1 Synchro Monster, using 1 or more "Yang Zing" monsters you control as Synchro Materials.
-- Yang
local SETCARD_ID_0 = 0x9e --Yang
local s, id, o = GetID()
function s.initial_effect(c)
	--Activate
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_ACTIVATE)
	e1:SetCode(EVENT_FREE_CHAIN)
	c:RegisterEffect(e1)
	--must attack
	local e2 = Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_FIELD)
	e2:SetCode(EFFECT_MUST_ATTACK)
	e2:SetRange(LOCATION_SZONE)
	e2:SetTargetRange(0, LOCATION_MZONE)
	c:RegisterEffect(e2)
	--synchro effect
	local e4 = Effect.CreateEffect(c)
	e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
	e4:SetType(EFFECT_TYPE_QUICK_O)
	e4:SetCode(EVENT_FREE_CHAIN)
	e4:SetHintTiming(0, TIMING_BATTLE_START + TIMING_BATTLE_END)
	e4:SetRange(LOCATION_SZONE)
	e4:SetCondition(s.sccon)
	e4:SetCost(s.sccost)
	e4:SetTarget(s.sctg)
	e4:SetOperation(s.scop)
	c:RegisterEffect(e4)
end
function s.sccon(e, tp, eg, ep, ev, re, r, rp)
	local ph = Duel.GetCurrentPhase()
	return ph == PHASE_MAIN1 or (ph >= PHASE_BATTLE_START and ph <= PHASE_BATTLE) or ph == PHASE_MAIN2
end
function s.mfilter(c)
	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER)
end
function s.syncheck(g, tp, syncard)
	return g:IsExists(s.mfilter, 1, nil) and syncard:IsSynchroSummonable(nil, g, #g - 1, #g - 1) and aux.SynMixHandCheck(g, tp, syncard)
end
function s.spfilter(c, tp, mg)
	return mg:CheckSubGroup(s.syncheck, 2, #mg, tp, c)
end
function s.sccost(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return e:GetHandler():IsAbleToGraveAsCost()
	end
	Duel.SendtoGrave(e:GetHandler(), REASON_COST)
end
function s.sctg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		local mg = Duel.GetSynchroMaterial(tp)
		if mg:IsExists(Card.GetHandSynchro, 1, nil) then
			local mg2 = Duel.GetMatchingGroup(nil, tp, LOCATION_HAND, 0, nil)
			if mg2:GetCount() > 0 then
				mg:Merge(mg2)
			end
		end
		return Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_EXTRA, 0, 1, nil, tp, mg)
	end
	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_EXTRA)
end
function s.scop(e, tp, eg, ep, ev, re, r, rp)
	local mg = Duel.GetSynchroMaterial(tp)
	if mg:IsExists(Card.GetHandSynchro, 1, nil) then
		local mg2 = Duel.GetMatchingGroup(nil, tp, LOCATION_HAND, 0, nil)
		if mg2:GetCount() > 0 then
			mg:Merge(mg2)
		end
	end
	local g = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_EXTRA, 0, nil, tp, mg)
	if g:GetCount() > 0 then
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
		local sg = g:Select(tp, 1, 1, nil)
		local sc = sg:GetFirst()
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SMATERIAL)
		local tg = mg:SelectSubGroup(tp, s.syncheck, false, 2, #mg, tp, sc)
		Duel.SynchroSummon(tp, sc, nil, tg, #tg - 1, #tg - 1)
	end
end

