Castle Quest 2 related code.