Spirit
When monsters in the Graveyard are removed from play, remove monsters on your side of the field from play as substitutes. This card remains active until the end of the turn that it is activated. The substitutes remain removed from play.
function s.initial_effect(c)
	--Activate
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_ACTIVATE)
	e1:SetCode(EVENT_FREE_CHAIN)
	e1:SetOperation(s.activate)
	c:RegisterEffect(e1)
end
function s.activate(e, tp, eg, ep, ev, re, r, rp)
	local e1 = Effect.CreateEffect(e:GetHandler())
	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
	e1:SetCode(EFFECT_SEND_REPLACE)
	e1:SetTarget(s.reptg)
	e1:SetValue(s.repval)
	e1:SetReset(RESET_PHASE + PHASE_END)
	Duel.RegisterEffect(e1, tp)
end
function s.repfilter(c)
	return c:IsLocation(LOCATION_GRAVE) and c:GetDestination() == LOCATION_REMOVED and c:IsType(TYPE_MONSTER)
end
function s.reptg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		local count = eg:FilterCount(s.repfilter, nil)
		return Duel.IsExistingMatchingCard(Card.IsAbleToRemove, tp, LOCATION_MZONE, 0, count, nil)
	end
	local count = eg:FilterCount(s.repfilter, nil)
	Duel.Hint(HINT_SELECTMSG, tp, aux.Stringid(id, 0))
	local rg = Duel.SelectMatchingCard(tp, Card.IsAbleToRemove, tp, LOCATION_MZONE, 0, count, count, nil)
	Duel.Remove(rg, POS_FACEUP, REASON_EFFECT)
	return true
end
function s.repval(e, c)
	return s.repfilter(c)
end


Spirit
When monsters in the Graveyard are removed from play, remove monsters on your side of the field from play as substitutes. This card remains active until the end of the turn that it is activated. The substitutes remain removed from play.
-- Spirit
function s.initial_effect(c)
	--Activate
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_ACTIVATE)
	e1:SetCode(EVENT_FREE_CHAIN)
	e1:SetOperation(s.activate)
	c:RegisterEffect(e1)
end
function s.activate(e, tp, eg, ep, ev, re, r, rp)
	local e1 = Effect.CreateEffect(e:GetHandler())
	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
	e1:SetCode(EFFECT_SEND_REPLACE)
	e1:SetTarget(s.reptg)
	e1:SetValue(s.repval)
	e1:SetReset(RESET_PHASE + PHASE_END)
	Duel.RegisterEffect(e1, tp)
end
function s.repfilter(c)
	return c:IsLocation(LOCATION_GRAVE) and c:GetDestination() == LOCATION_REMOVED and c:IsType(TYPE_MONSTER)
end
function s.reptg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		local count = eg:FilterCount(s.repfilter, nil)
		return Duel.IsExistingMatchingCard(Card.IsAbleToRemove, tp, LOCATION_MZONE, 0, count, nil)
	end
	local count = eg:FilterCount(s.repfilter, nil)
	Duel.Hint(HINT_SELECTMSG, tp, aux.Stringid(id, 0))
	local rg = Duel.SelectMatchingCard(tp, Card.IsAbleToRemove, tp, LOCATION_MZONE, 0, count, count, nil)
	Duel.Remove(rg, POS_FACEUP, REASON_EFFECT)
	return true
end
function s.repval(e, c)
	return s.repfilter(c)
end

