Ghost
If your opponent Special Summons a monster(s) face-up (except during the Damage Step): You can discard this card, then target 1 of those face-up monsters; negate its effects until the end of this turn, also if that face-up monster leaves the field this turn, its controller takes damage equal to its original ATK. You can only use this effect of "Ghost Mourner & Moonlit Chill" once per turn.
local s, id, o = GetID()
function s.initial_effect(c)
	--disable
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_DISABLE + CATEGORY_DAMAGE)
	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
	e1:SetCode(EVENT_CUSTOM + id)
	e1:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_DELAY)
	e1:SetRange(LOCATION_HAND)
	e1:SetCountLimit(1, id)
	e1:SetCondition(s.discon)
	e1:SetCost(s.discost)
	e1:SetTarget(s.distg)
	e1:SetOperation(s.disop)
	c:RegisterEffect(e1)
	aux.RegisterMergedDelayedEvent(c, id, EVENT_SPSUMMON_SUCCESS)
end
function s.cfilter(c, tp)
	return c:IsFaceup() and c:IsSummonPlayer(1 - tp) and (aux.NegateMonsterFilter(c) or c:GetAttack() > 0)
end
function s.discon(e, tp, eg, ep, ev, re, r, rp)
	return eg:IsExists(s.cfilter, 1, nil, tp)
end
function s.discost(e, tp, eg, ep, ev, re, r, rp, chk)
	local c = e:GetHandler()
	if chk == 0 then
		return c:IsDiscardable()
	end
	Duel.SendtoGrave(c, REASON_COST + REASON_DISCARD)
end
function s.disfilter(c, g)
	return g:IsContains(c)
end
function s.distg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
	local g = eg:Filter(s.cfilter, nil, tp)
	if chkc then
		return chkc:IsLocation(LOCATION_MZONE) and s.disfilter(chkc, g)
	end
	if chk == 0 then
		return Duel.IsExistingTarget(s.disfilter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil, g)
	end
	if g:GetCount() == 1 then
		Duel.SetTargetCard(g)
	else
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TARGET)
		Duel.SelectTarget(tp, s.disfilter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, nil, g)
	end
end
function s.disop(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	local tc = Duel.GetFirstTarget()
	if tc:IsRelateToEffect(e) and tc:IsFaceup() then
		Duel.NegateRelatedChain(tc, RESET_TURN_SET)
		local e1 = Effect.CreateEffect(c)
		e1:SetType(EFFECT_TYPE_SINGLE)
		e1:SetCode(EFFECT_DISABLE)
		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
		tc:RegisterEffect(e1)
		local e2 = Effect.CreateEffect(c)
		e2:SetType(EFFECT_TYPE_SINGLE)
		e2:SetCode(EFFECT_DISABLE_EFFECT)
		e2:SetValue(RESET_TURN_SET)
		e2:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
		tc:RegisterEffect(e2)
		local fid = c:GetFieldID()
		tc:RegisterFlagEffect(id, RESET_EVENT + RESET_TURN_SET + RESET_OVERLAY + RESET_MSCHANGE + RESET_PHASE + PHASE_END, EFFECT_FLAG_CLIENT_HINT, 1, fid, aux.Stringid(id, 1))
		local e3 = Effect.CreateEffect(c)
		e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
		e3:SetCode(EVENT_LEAVE_FIELD)
		e3:SetLabel(fid)
		e3:SetLabelObject(tc)
		e3:SetReset(RESET_PHASE + PHASE_END)
		e3:SetOperation(s.damop)
		Duel.RegisterEffect(e3, tp)
	end
end
function s.damop(e, tp, eg, ep, ev, re, r, rp)
	local tc = e:GetLabelObject()
	if not eg:IsContains(tc) then
		return
	end
	if tc:GetFlagEffectLabel(id) ~= e:GetLabel() then
		e:Reset()
		return
	end
	Duel.Hint(HINT_CARD, 0, id)
	Duel.Damage(tc:GetPreviousControler(), tc:GetBaseAttack(), REASON_EFFECT)
	tc:ResetFlagEffect(id)
	e:Reset()
end


Ghost
If your opponent Special Summons a monster(s) face-up (except during the Damage Step): You can discard this card, then target 1 of those face-up monsters; negate its effects until the end of this turn, also if that face-up monster leaves the field this turn, its controller takes damage equal to its original ATK. You can only use this effect of "Ghost Mourner & Moonlit Chill" once per turn.
-- Ghost
local s, id, o = GetID()
function s.initial_effect(c)
	--disable
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_DISABLE + CATEGORY_DAMAGE)
	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
	e1:SetCode(EVENT_CUSTOM + id)
	e1:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_DELAY)
	e1:SetRange(LOCATION_HAND)
	e1:SetCountLimit(1, id)
	e1:SetCondition(s.discon)
	e1:SetCost(s.discost)
	e1:SetTarget(s.distg)
	e1:SetOperation(s.disop)
	c:RegisterEffect(e1)
	aux.RegisterMergedDelayedEvent(c, id, EVENT_SPSUMMON_SUCCESS)
end
function s.cfilter(c, tp)
	return c:IsFaceup() and c:IsSummonPlayer(1 - tp) and (aux.NegateMonsterFilter(c) or c:GetAttack() > 0)
end
function s.discon(e, tp, eg, ep, ev, re, r, rp)
	return eg:IsExists(s.cfilter, 1, nil, tp)
end
function s.discost(e, tp, eg, ep, ev, re, r, rp, chk)
	local c = e:GetHandler()
	if chk == 0 then
		return c:IsDiscardable()
	end
	Duel.SendtoGrave(c, REASON_COST + REASON_DISCARD)
end
function s.disfilter(c, g)
	return g:IsContains(c)
end
function s.distg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
	local g = eg:Filter(s.cfilter, nil, tp)
	if chkc then
		return chkc:IsLocation(LOCATION_MZONE) and s.disfilter(chkc, g)
	end
	if chk == 0 then
		return Duel.IsExistingTarget(s.disfilter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil, g)
	end
	if g:GetCount() == 1 then
		Duel.SetTargetCard(g)
	else
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TARGET)
		Duel.SelectTarget(tp, s.disfilter, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, nil, g)
	end
end
function s.disop(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	local tc = Duel.GetFirstTarget()
	if tc:IsRelateToEffect(e) and tc:IsFaceup() then
		Duel.NegateRelatedChain(tc, RESET_TURN_SET)
		local e1 = Effect.CreateEffect(c)
		e1:SetType(EFFECT_TYPE_SINGLE)
		e1:SetCode(EFFECT_DISABLE)
		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
		tc:RegisterEffect(e1)
		local e2 = Effect.CreateEffect(c)
		e2:SetType(EFFECT_TYPE_SINGLE)
		e2:SetCode(EFFECT_DISABLE_EFFECT)
		e2:SetValue(RESET_TURN_SET)
		e2:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
		tc:RegisterEffect(e2)
		local fid = c:GetFieldID()
		tc:RegisterFlagEffect(id, RESET_EVENT + RESET_TURN_SET + RESET_OVERLAY + RESET_MSCHANGE + RESET_PHASE + PHASE_END, EFFECT_FLAG_CLIENT_HINT, 1, fid, aux.Stringid(id, 1))
		local e3 = Effect.CreateEffect(c)
		e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
		e3:SetCode(EVENT_LEAVE_FIELD)
		e3:SetLabel(fid)
		e3:SetLabelObject(tc)
		e3:SetReset(RESET_PHASE + PHASE_END)
		e3:SetOperation(s.damop)
		Duel.RegisterEffect(e3, tp)
	end
end
function s.damop(e, tp, eg, ep, ev, re, r, rp)
	local tc = e:GetLabelObject()
	if not eg:IsContains(tc) then
		return
	end
	if tc:GetFlagEffectLabel(id) ~= e:GetLabel() then
		e:Reset()
		return
	end
	Duel.Hint(HINT_CARD, 0, id)
	Duel.Damage(tc:GetPreviousControler(), tc:GetBaseAttack(), REASON_EFFECT)
	tc:ResetFlagEffect(id)
	e:Reset()
end

