module.exports = class Communication { help(room, mobile, input) { var topic = input.join(" ").trim(); switch(topic) { case "say": libs.Output.toMobile(mobile.id, "Since MUDs are multiplayer, being able to communicate with other players is pretty important. You can use this command to talk with players and NPCs."); libs.Output.toMobile(mobile.id, "* say [message] - will cause your character to say the message to the room you are currently in."); return true; case "shout": libs.Output.toMobile(mobile.id, "You can communicate to everyone across the server using this command"); libs.Output.toMobile(mobile.id, "* shout [message] - will cause your character to shout the message to the entire server."); return true; } } say(room, mobile, input) { var message = input.join(" "); libs.Output.toMobile(mobile.id, "You say '" + message + "'", mobile); libs.Output.toRoom(mobile.roomId, mobile.name + " says '" + message + "'", mobile); return true; } shout(room, mobile, input) { var message = input.join(" "); libs.Output.toMobile(mobile.id, "{global}You shout '" + message + "'{/global}", mobile); libs.Output.worldToMobiles("{global}" + mobile.name + " shouts '" + message + "'{/global}", mobile); libs.Output.toServer(mobile.name + " shouts '" + message + "'"); return true; } emote(room, mobile, input) { var message = input.join(" "); libs.Output.toMobile(mobile.id, "You emote: '" + message + "'", mobile); libs.Output.toRoom(mobile.roomId, mobile.name + " " + message, mobile); return true; } announce(room, mobile, input) { libs.Output.toMobile(mobile.id, "You announce your stats:"); var hpPercent = parseInt(100*(mobile.health / mobile.maxHealth)); libs.Output.toMobile(mobile.id, "HP: "+ hpPercent + "%"); libs.Output.toRoom(mobile.roomId, mobile.name + ": HP is " + hpPercent + "%", mobile); return true; } mud_getErrorMessage() { return "A {error}glitch{/error} appears in your mouth and prevents you from speaking."; } };