Commit Graph

67 Commits

Author SHA1 Message Date
Bär Halberkamp
08d4e622cb Fix mafia votes 2016-10-11 17:55:09 +02:00
panpawn
76285471a0 Fix double errorReply while muted in some cases (#2830)
Due to the recent refactor that changed how `this.canTalk` works, if a user was muted in a room, and then tried to do a command that wasn't allowed to be used if they can't talk, it would send two replies: "You are muted and cannot talk in this room." AND "You cannot do this while unable to talk."

This makes it so that if you're using a command while muted that isn't allowed to be used if you can't talk, it will just use the "You are muted and cannot talk in this room." errorReply.
2016-10-08 20:58:16 -07:00
Bär Halberkamp
617f821291 Mafia: fix mistake 2016-10-05 00:49:39 +02:00
Bär Halberkamp
b986aa580a Mafia: Refactor votes 2016-10-02 15:41:36 +02:00
Bär Halberkamp
43de9b45df Mafia: bold people in votes 2016-10-02 15:41:36 +02:00
Guangcong Luo
d6f5404e7e Rename CommandParser to Chat
We had a lot of discussion in Dev and a somewhat-close poll, but in
the end "Chat" was a better name than "Messages", and also has the
advantage of being shorter (which is nice for Chat.html and
Chat.plural which should be short).
2016-09-30 18:31:15 -07:00
Guangcong Luo
da1b318707 Move text processing from Tools to CommandParser
The following functions have been renamed:

- Tools.html to CommandParser.html
- Tools.plural to CommandParser.plural
- Tools.escapeHTML to CommandParser.escapeHTML
- Tools.toDurationString to CommandParser.toDurationString
- Tools.toTimeStamp to CommandParser.toTimestamp
  (notice the lowercase 's')

This is in preparation for a rename of Tools to Dex (by removing the
non-dex-related functions) and a rename of CommandParser to either
Messages or Chat.
2016-09-30 18:04:13 -07:00
Bär Halberkamp
12c2e292c4 Mafia: fix spelling mistake 2016-09-30 04:32:25 +02:00
Bär Halberkamp
0d94959437 Mafia: display an announcement when town doesn't lynch 2016-09-30 04:32:25 +02:00
Bär Halberkamp
6473efcb27 Mafia: Allow changing your vote/target 2016-09-29 21:46:39 +02:00
Bär Halberkamp
c7f53370e9 Mafia: Fix day counter 2016-09-29 21:46:39 +02:00
Bär Halberkamp
8c9abad529 Mafia: fix a stupid typo 2016-09-24 22:50:19 +02:00
Taylor Everding
1a1f64fe95 Remove .js extension from requires (#2725) 2016-08-30 00:04:40 -05:00
Ivo Julca
62a5397083 Lint: Use latest version and features of ESLint 2016-08-03 01:24:36 -05:00
Quinton Lee
b0cef1f17f Follow all player renames in roomgames (#2538)
Fixes various crashes caused by roomgame players changing names outside
of the room
2016-04-30 02:03:05 -07:00
Ivo Julca
22779102cc Lint: Add miscellaneous extra rules
Among the newly added rules, there are quite a few intended to enforce
compliance of CONTRIBUTING.md-blessed idioms, as well as ensure
safe usage of classes and constant bindings.

We are also now enforcing usage of early return in commands.js,
which has 100% compliance as of fd2c45c.
2016-04-25 21:52:21 -05:00
Bär Halberkamp
26beeaabcf Mafia: Improve abstaining 2016-04-05 03:50:27 +02:00
Bär Halberkamp
7f4a18f90f Mafia: add HTML escaping
thanks slayer95 for pointing this out
2016-03-30 13:37:31 +02:00
Bär Halberkamp
8efcad4e41 Mafia: Show list of players and roles every day 2016-03-30 02:46:09 +02:00
Bär Halberkamp
9ae7f1887a Mafia: games start on day 1 2016-03-30 02:10:40 +02:00
Bär Halberkamp
e0598ff171 Mafia: fix oversights 2016-03-30 02:09:30 +02:00
Bär Halberkamp
998892332c Mafia: change the pregame window when the game starts 2016-03-29 04:18:54 +02:00
Bär Halberkamp
0faca2d8da Display pregame when users join 2016-03-29 04:18:54 +02:00
Bär Halberkamp
22b8349957 Mafia: Fix one mafia vote counting for everyone 2016-03-29 04:18:54 +02:00
Bär Halberkamp
d51b5041da Mafia: make the game actually progress once day is reached 2016-03-29 04:18:54 +02:00
Bär Halberkamp
285462e9f2 Mafia: make the different cop variations show up in the pregame 2016-03-24 20:13:31 +01:00
Bär Halberkamp
ccdc293d9f Mafia: add 'dethy' as a shortcut to make a dethy game 2016-03-23 21:01:50 +01:00
Bär Halberkamp
3465829e22 Add permissions for roomgames 2016-02-26 22:19:19 +01:00
Bär Halberkamp
f5a4e28205 Specify which game is in progress 2016-02-17 21:09:44 +01:00
Bär Halberkamp
4dd80754a4 Mafia: add an "autoModchat" option 2016-02-17 21:09:44 +01:00
Bär Halberkamp
370d49c078 Allow mafia roles with abilities that can only be used once 2016-02-17 21:09:44 +01:00
Guangcong Luo
b665660608 Refactor for more ES6 features
Now that nodejs/node#3072 is mostly fixed, we can finally start using
Node 4+ features.

This refactor:

- uses arrow functions where appropriate

  Note that arrow functions still aren't used in Mocha, where `this`
  is sometimes meaningful.

  This also removes the need for .bind() nearly everywhere, as well
  as the `self = this` trick.

- refactors Validator and Connection into ES6 classes

- no longer uses Array#forEach for iterating arrays

  We strongly prefer for (let i = 0; i < arr.length; i++) because of
  performance reasons. Most forEaches have been replaced with for..of,
  though, which is 5x slower than the long-form loop but 2x faster
  than forEach, which is good enough outside of most inner loops.

  The only exception is tournaments, which is due for a more invasive
  refactor soon anyway.
2016-02-10 17:40:21 -06:00
Bär Halberkamp
52fb36bcc2 Mafia: fix bug 2016-02-03 02:32:53 +01:00
Bär Halberkamp
01f93492b1 Mafia: implement new roles 2016-01-29 02:44:31 +01:00
Bär Halberkamp
8a9db339bc Mafia: Allow players to have their vote count different amounts 2016-01-28 16:20:25 +01:00
Bär Halberkamp
f0c10298fd Mafia: make the 10 seconds left message less intrusive 2016-01-23 20:48:30 +01:00
Bär Halberkamp
cf057f512c Mafia: fix bugs 2016-01-23 20:46:52 +01:00
Bär Halberkamp
49e16d003a Mafia: implement the latest changes to the RoomGame API 2016-01-20 19:10:08 +01:00
=
69495ebd07 Mafia plugin: Mafia scripts should not have the executable flag 2016-01-18 03:38:51 -04:00
Bär Halberkamp
97c9d96e89 Mafia: Update mafia with the new RoomGame features 2016-01-15 15:03:28 +01:00
Bär Halberkamp
6089893b3e Mafia: Allow exporting of the current mafia game 2016-01-07 02:13:05 +01:00
Guangcong Luo
e624b9d5c7 Merge pull request #2350 from xfix/unify-style
Make code style consistent between files
2015-12-31 23:36:19 +00:00
Konrad Borowski
81f602b8d8 Always use trailing comma for multiline objects 2016-01-01 00:20:07 +01:00
Bär Halberkamp
f469c1bfa4 Mafia: set allowRenames to true 2015-12-28 23:35:27 +01:00
Bär Halberkamp
bdeb6b9a24 Mafia: allow JSON game setups to be used instead of lists of roles 2015-12-28 23:35:27 +01:00
Bär Halberkamp
ddb4a6f1b5 Mafia: Improve voting once again 2015-12-25 02:22:01 +01:00
Bär Halberkamp
b1276eda1e Mafia: Fix copypaste error 2015-12-25 02:05:28 +01:00
Bär Halberkamp
a24815dd16 Mafia: Show the class image after voting 2015-12-24 18:28:46 +01:00
Bär Halberkamp
ad9af90c8f Mafia: Make the game end if there's a single town member as well 2015-12-24 18:28:46 +01:00
Bär Halberkamp
c71d95d040 Mafia: Fix timer for cases where there's a vote but no event 2015-12-24 18:28:46 +01:00