Ghost
If only your opponent controls a monster, you can Special Summon this card (from your hand). Cannot be destroyed by battle, except with monsters Special Summoned from the Extra Deck. If this card attacks a Defense Position monster, inflict piercing battle damage.
local s, id, o = GetID()
function s.initial_effect(c)
	--special summon
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_FIELD)
	e1:SetCode(EFFECT_SPSUMMON_PROC)
	e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
	e1:SetRange(LOCATION_HAND)
	e1:SetCondition(s.spcon)
	c:RegisterEffect(e1)
	--battle indes
	local e2 = Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_SINGLE)
	e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
	e2:SetRange(LOCATION_MZONE)
	e2:SetValue(s.indes)
	c:RegisterEffect(e2)
	--pierce
	local e3 = Effect.CreateEffect(c)
	e3:SetType(EFFECT_TYPE_SINGLE)
	e3:SetCode(EFFECT_PIERCE)
	c:RegisterEffect(e3)
end
function s.spcon(e, c)
	if c == nil then
		return true
	end
	local tp = c:GetControler()
	return Duel.GetFieldGroupCount(tp, LOCATION_MZONE, 0) == 0 and Duel.GetFieldGroupCount(tp, 0, LOCATION_MZONE) > 0 and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
end
function s.indes(e, c)
	return not c:IsSummonLocation(LOCATION_EXTRA)
end


Ghost
If only your opponent controls a monster, you can Special Summon this card (from your hand). Cannot be destroyed by battle, except with monsters Special Summoned from the Extra Deck. If this card attacks a Defense Position monster, inflict piercing battle damage.
-- Ghost
local s, id, o = GetID()
function s.initial_effect(c)
	--special summon
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_FIELD)
	e1:SetCode(EFFECT_SPSUMMON_PROC)
	e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
	e1:SetRange(LOCATION_HAND)
	e1:SetCondition(s.spcon)
	c:RegisterEffect(e1)
	--battle indes
	local e2 = Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_SINGLE)
	e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
	e2:SetRange(LOCATION_MZONE)
	e2:SetValue(s.indes)
	c:RegisterEffect(e2)
	--pierce
	local e3 = Effect.CreateEffect(c)
	e3:SetType(EFFECT_TYPE_SINGLE)
	e3:SetCode(EFFECT_PIERCE)
	c:RegisterEffect(e3)
end
function s.spcon(e, c)
	if c == nil then
		return true
	end
	local tp = c:GetControler()
	return Duel.GetFieldGroupCount(tp, LOCATION_MZONE, 0) == 0 and Duel.GetFieldGroupCount(tp, 0, LOCATION_MZONE) > 0 and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
end
function s.indes(e, c)
	return not c:IsSummonLocation(LOCATION_EXTRA)
end

