freeslot("S_PLAY_PIZZATIME")

states[S_PLAY_PIZZATIME] = {
	sprite = SPR_PLAY,
	frame = SPR2_TWIN,
	tics = 2,
	nextstate = S_PLAY_PIZZATIME
}

local function pizzatime(p)
	if (PTJE and PTJE.pizzatime)
	or (PizzaTime and PizzaTime.sync.PizzaTime)
		return true
	else
		return false
	end
end

addHook("PlayerThink", function(p)
	if p.mo.skin == "prpeppino"
	and pizzatime(p)
	and p.mo.state == S_PLAY_STND
		p.mo.state = S_PLAY_PIZZATIME
	end
	if p.mo.state == S_PLAY_PIZZATIME
	and p.speed ~= 0
		p.mo.state = S_PLAY_WALK
	end
end)