Naked man guilty of attacking officer with medieval-looking weapon