Swordsoul
1 Tuner + 1+ non-Tuner monsters
For each banished card, this card gains 100 ATK/DEF and monsters your opponent controls lose 100 ATK/DEF. If this card would be destroyed by card effect, you can banish 1 card from your GY instead. If a card(s) is banished (except during the Damage Step): You can banish 1 card each from both your opponent's field and GY. You can only use this effect of "Swordsoul Supreme Sovereign - Chengying" once per turn.
local s, id, o = GetID()
function s.initial_effect(c)
	--synchro summon
	aux.AddSynchroProcedure(c, nil, aux.NonTuner(nil), 1)
	c:EnableReviveLimit()
	--atk/def gain
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_SINGLE)
	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
	e1:SetCode(EFFECT_UPDATE_ATTACK)
	e1:SetRange(LOCATION_MZONE)
	e1:SetValue(s.value)
	c:RegisterEffect(e1)
	local e2 = e1:Clone()
	e2:SetCode(EFFECT_UPDATE_DEFENSE)
	c:RegisterEffect(e2)
	--atk/def down
	local e3 = Effect.CreateEffect(c)
	e3:SetType(EFFECT_TYPE_FIELD)
	e3:SetCode(EFFECT_UPDATE_ATTACK)
	e3:SetRange(LOCATION_MZONE)
	e3:SetTargetRange(0, LOCATION_MZONE)
	e3:SetValue(s.value1)
	c:RegisterEffect(e3)
	local e4 = e3:Clone()
	e4:SetCode(EFFECT_UPDATE_DEFENSE)
	c:RegisterEffect(e4)
	--destroy replace
	local e5 = Effect.CreateEffect(c)
	e5:SetType(EFFECT_TYPE_CONTINUOUS + EFFECT_TYPE_SINGLE)
	e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
	e5:SetRange(LOCATION_MZONE)
	e5:SetCode(EFFECT_DESTROY_REPLACE)
	e5:SetTarget(s.desreptg)
	c:RegisterEffect(e5)
	--remove
	local e6 = Effect.CreateEffect(c)
	e6:SetDescription(aux.Stringid(id, 0))
	e6:SetCategory(CATEGORY_REMOVE)
	e6:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
	e6:SetProperty(EFFECT_FLAG_DELAY)
	e6:SetRange(LOCATION_MZONE)
	e6:SetCode(EVENT_REMOVE)
	e6:SetCountLimit(1, id)
	e6:SetTarget(s.remtg)
	e6:SetOperation(s.remop)
	c:RegisterEffect(e6)
end
function s.value(e, c)
	return Duel.GetFieldGroupCount(c:GetControler(), LOCATION_REMOVED, LOCATION_REMOVED) * 100
end
function s.value1(e, c)
	return Duel.GetFieldGroupCount(c:GetControler(), LOCATION_REMOVED, LOCATION_REMOVED) * -100
end
function s.desreptg(e, tp, eg, ep, ev, re, r, rp, chk)
	local c = e:GetHandler()
	if chk == 0 then
		return not c:IsReason(REASON_REPLACE) and c:IsReason(REASON_EFFECT) and Duel.IsExistingMatchingCard(Card.IsAbleToRemove, tp, LOCATION_GRAVE, 0, 1, nil)
	end
	if Duel.SelectEffectYesNo(tp, c, 96) then
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
		local g = Duel.SelectMatchingCard(tp, Card.IsAbleToRemove, tp, LOCATION_GRAVE, 0, 1, 1, nil)
		Duel.Remove(g, POS_FACEUP, REASON_EFFECT + REASON_REPLACE)
		return true
	else
		return false
	end
end
function s.remtg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return Duel.IsExistingMatchingCard(Card.IsAbleToRemove, tp, 0, LOCATION_ONFIELD, 1, nil) and Duel.IsExistingMatchingCard(Card.IsAbleToRemove, tp, 0, LOCATION_GRAVE, 1, nil)
	end
	Duel.SetOperationInfo(0, CATEGORY_REMOVE, nil, 2, 0, LOCATION_ONFIELD + LOCATION_GRAVE)
end
function s.remop(e, tp, eg, ep, ev, re, r, rp)
	local g1 = Duel.GetMatchingGroup(Card.IsAbleToRemove, tp, 0, LOCATION_ONFIELD, nil)
	local g2 = Duel.GetMatchingGroup(Card.IsAbleToRemove, tp, 0, LOCATION_GRAVE, nil)
	if g1:GetCount() > 0 and g2:GetCount() > 0 then
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
		local sg1 = g1:Select(tp, 1, 1, nil)
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
		local sg2 = g2:Select(tp, 1, 1, nil)
		sg1:Merge(sg2)
		Duel.HintSelection(sg1)
		Duel.Remove(sg1, POS_FACEUP, REASON_EFFECT)
	end
end


Swordsoul
1 Tuner + 1+ non-Tuner monsters
For each banished card, this card gains 100 ATK/DEF and monsters your opponent controls lose 100 ATK/DEF. If this card would be destroyed by card effect, you can banish 1 card from your GY instead. If a card(s) is banished (except during the Damage Step): You can banish 1 card each from both your opponent's field and GY. You can only use this effect of "Swordsoul Supreme Sovereign - Chengying" once per turn.
-- Swordsoul
local s, id, o = GetID()
function s.initial_effect(c)
	--synchro summon
	aux.AddSynchroProcedure(c, nil, aux.NonTuner(nil), 1)
	c:EnableReviveLimit()
	--atk/def gain
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_SINGLE)
	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
	e1:SetCode(EFFECT_UPDATE_ATTACK)
	e1:SetRange(LOCATION_MZONE)
	e1:SetValue(s.value)
	c:RegisterEffect(e1)
	local e2 = e1:Clone()
	e2:SetCode(EFFECT_UPDATE_DEFENSE)
	c:RegisterEffect(e2)
	--atk/def down
	local e3 = Effect.CreateEffect(c)
	e3:SetType(EFFECT_TYPE_FIELD)
	e3:SetCode(EFFECT_UPDATE_ATTACK)
	e3:SetRange(LOCATION_MZONE)
	e3:SetTargetRange(0, LOCATION_MZONE)
	e3:SetValue(s.value1)
	c:RegisterEffect(e3)
	local e4 = e3:Clone()
	e4:SetCode(EFFECT_UPDATE_DEFENSE)
	c:RegisterEffect(e4)
	--destroy replace
	local e5 = Effect.CreateEffect(c)
	e5:SetType(EFFECT_TYPE_CONTINUOUS + EFFECT_TYPE_SINGLE)
	e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
	e5:SetRange(LOCATION_MZONE)
	e5:SetCode(EFFECT_DESTROY_REPLACE)
	e5:SetTarget(s.desreptg)
	c:RegisterEffect(e5)
	--remove
	local e6 = Effect.CreateEffect(c)
	e6:SetDescription(aux.Stringid(id, 0))
	e6:SetCategory(CATEGORY_REMOVE)
	e6:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
	e6:SetProperty(EFFECT_FLAG_DELAY)
	e6:SetRange(LOCATION_MZONE)
	e6:SetCode(EVENT_REMOVE)
	e6:SetCountLimit(1, id)
	e6:SetTarget(s.remtg)
	e6:SetOperation(s.remop)
	c:RegisterEffect(e6)
end
function s.value(e, c)
	return Duel.GetFieldGroupCount(c:GetControler(), LOCATION_REMOVED, LOCATION_REMOVED) * 100
end
function s.value1(e, c)
	return Duel.GetFieldGroupCount(c:GetControler(), LOCATION_REMOVED, LOCATION_REMOVED) * -100
end
function s.desreptg(e, tp, eg, ep, ev, re, r, rp, chk)
	local c = e:GetHandler()
	if chk == 0 then
		return not c:IsReason(REASON_REPLACE) and c:IsReason(REASON_EFFECT) and Duel.IsExistingMatchingCard(Card.IsAbleToRemove, tp, LOCATION_GRAVE, 0, 1, nil)
	end
	if Duel.SelectEffectYesNo(tp, c, 96) then
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
		local g = Duel.SelectMatchingCard(tp, Card.IsAbleToRemove, tp, LOCATION_GRAVE, 0, 1, 1, nil)
		Duel.Remove(g, POS_FACEUP, REASON_EFFECT + REASON_REPLACE)
		return true
	else
		return false
	end
end
function s.remtg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return Duel.IsExistingMatchingCard(Card.IsAbleToRemove, tp, 0, LOCATION_ONFIELD, 1, nil) and Duel.IsExistingMatchingCard(Card.IsAbleToRemove, tp, 0, LOCATION_GRAVE, 1, nil)
	end
	Duel.SetOperationInfo(0, CATEGORY_REMOVE, nil, 2, 0, LOCATION_ONFIELD + LOCATION_GRAVE)
end
function s.remop(e, tp, eg, ep, ev, re, r, rp)
	local g1 = Duel.GetMatchingGroup(Card.IsAbleToRemove, tp, 0, LOCATION_ONFIELD, nil)
	local g2 = Duel.GetMatchingGroup(Card.IsAbleToRemove, tp, 0, LOCATION_GRAVE, nil)
	if g1:GetCount() > 0 and g2:GetCount() > 0 then
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
		local sg1 = g1:Select(tp, 1, 1, nil)
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
		local sg2 = g2:Select(tp, 1, 1, nil)
		sg1:Merge(sg2)
		Duel.HintSelection(sg1)
		Duel.Remove(sg1, POS_FACEUP, REASON_EFFECT)
	end
end

