diff --git a/src/ts/components/shared/chat-box/chat-box.ts b/src/ts/components/shared/chat-box/chat-box.ts index 32748a9..71e61f8 100644 --- a/src/ts/components/shared/chat-box/chat-box.ts +++ b/src/ts/components/shared/chat-box/chat-box.ts @@ -244,7 +244,14 @@ export class ChatBox implements AfterViewInit, OnDestroy { } private say(message: string, chatType: ChatType, entityId: number): boolean { this.game.lastChatMessageType = chatType; - return !!this.game.send(server => server.say(entityId, message, chatType)); + if (message.toLowerCase().startsWith('/shrug')) { + var rawMessage = message.substring(6); + return !!this.game.send(server => + server.say(entityId, ((rawMessage !== '') ? rawMessage + ' ' : '') + `¯\\_(ツ)_/¯`, + chatType)); + } else { + return !!this.game.send(server => server.say(entityId, message, chatType)); + } } private changeChatType(e: KeyboardEvent, chatType: ChatType) { this.chatType = chatType; diff --git a/src/ts/server/commands.ts b/src/ts/server/commands.ts index 3a29117..003524d 100644 --- a/src/ts/server/commands.ts +++ b/src/ts/server/commands.ts @@ -196,6 +196,7 @@ export function createCommands(world: World): Command[] { command(['t', 'think'], '/t - thinking balloon', '', shouldNotBeCalled), command(['w', 'whisper'], '/w - whisper to player', '', shouldNotBeCalled), command(['r', 'reply'], '/r - reply to whisper', '', shouldNotBeCalled), + command(['shrug'], '/shrug - ¯\\_(ツ)_/¯', '', shouldNotBeCalled), command(['e'], '/e - set permanent expression', '', ({ }, { pony }, message) => { pony.exprPermanent = parseExpression(message, true); setEntityExpression(pony, undefined, 0); @@ -608,7 +609,7 @@ chatTypes.set('w', ChatType.Whisper); chatTypes.set('whisper', ChatType.Whisper); export function parseCommand(text: string, type: ChatType): { command?: string; args: string; type: ChatType; } { - if (!isCommand(text)) { + if (!isCommand(text) || text.toLowerCase().startsWith('/shrug')) { return { args: text, type }; }