1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- 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.mud_getName() + " 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.mud_getName() + " shouts '" + message + "'{/global}", mobile);
- libs.Output.toServer(mobile.mud_getName() + " 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.mud_getName() + " " + message, mobile);
- return true;
- }
- announce(room, mobile, input) {
- libs.Output.toMobile(mobile.id, "You announce your stats:", mobile);
- var hpPercent = parseInt(100*(mobile.health / mobile.maxHealth));
- libs.Output.toMobile(mobile.id, "HP: "+ hpPercent + "%");
- libs.Output.toRoom(mobile.roomId, mobile.mud_getName() + ": HP is " + hpPercent + "%");
- return true;
- }
- mud_getErrorMessage() {
- return "A {error}glitch{/error} appears in your mouth and prevents you from speaking.";
- }
- };
|