Commit Graph

79 Commits

Author SHA1 Message Date
Lucas-Meijer
d4070c0300
Mafia: Prevent incorrect alignment. (#9368)
A new theme includes a role that can change someone's alignment as a discard.
Players should not be informed according to their old alignment.
2023-01-28 19:33:52 -05:00
motogp-bit
b819032ce6
Mafia: Fix a bug with cohosts and the sublist (#9300) 2023-01-09 19:21:23 -05:00
motogp-bit
33c1811645
Mafia: Fix a bug with resetgame (#9129) 2022-12-09 17:44:40 -08:00
motogp-bit
998a3a225d
Mafia: Add /mafia resetgame command and some other minor stuff. (#8981) 2022-11-18 13:31:00 -05:00
Mia
2190b17625 Mafia: Fix crash 2022-06-12 19:24:46 -05:00
motogp-bit
9f8eedfc6e
Mafia: Previous Actions + Some Help Messages (#8798) 2022-06-08 13:29:53 -04:00
motogp-bit
6e68e8c59e
Mafia: Add /mafia votelock and /mafia voting (#8703) 2022-04-07 10:08:37 -04:00
ayiadvance
35f6921175
Mafia: Allow action submission details and add /mafia prod (#8702) 2022-03-27 15:23:03 -04:00
ayiadvance
5105cc46a3
Mafia: Fix transitions between deathstates (#8700) 2022-03-22 17:29:14 -07:00
Alexander B
0475b38ae8
RoomGame: Refactor to use generic typing (#8678) 2022-03-13 18:01:54 -07:00
Mia
bd38434a2b Punishments: Don't count custom room punishments toward PunishmentMonitor 2021-10-24 20:02:17 -05:00
Mia
7811795344
Handle new TypeScript version (#8449)
Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2021-08-30 20:11:44 -07:00
Mia
4c9e9fe042
Mafia: Fix crash in /mafia kill 2021-08-08 14:26:00 -05:00
ayiadvance
d3c0b61b5d
Mafia: Allow transitions between death states (#8418) 2021-08-05 12:49:56 -07:00
ayiadvance
c30e53f51d
Remove the word "lynch" from Mafia code (#8412) 2021-07-30 18:43:07 -07:00
Annika
56754afb42 Punishments: Remove getPunishType functions
These are poorly designed as they only return one punishments, but users can now have several.
2021-06-29 17:55:45 -07:00
Mia
09e298f15b
Punishments: Support giving multiple punishments to one user (#8265) 2021-05-31 11:06:01 -07:00
Guangcong Luo
509d0abad4 Refactor out some Object.keys invocations
If you need values, you should be using `Object.values` or
`Object.entries` directly.
2021-05-13 23:02:04 -07:00
Kris Johnson
5331e0e748
Refactor splitTarget to splitUser (#8246) 2021-05-01 00:42:25 -07:00
Guangcong Luo
a480a84ce4 Chat API: Add requireUser
This simplifies a lot of `splitUser` uses that immediately go on
to make sure the user actually exists.
2021-04-30 17:14:35 -07:00
Guangcong Luo
810aff74cd Namespace more server global types 2021-04-25 14:16:27 -07:00
Guangcong Luo
486f292904
Refactor everything to use Utils.sortBy (#8220)
A few uses of `array.sort()` have been left alone:

- sorting in `data/` because they aren't supposed to import anything

- `set-importer` because I still have no clue what that's for and what
  dependencies it is/isn't allowed to have

- `sort()` with no arguments used as a lexical sort (at which point
  `sortBy` offers no benefits)

All other cases have been replaced with `Utils.sortBy`, which should
be a massive increase in readability.

Sort orders should be much more readable now, without needing to puzzle
through sign issues. The order is always low-to-high, A-to-Z,
true-to-false.
2021-04-23 22:41:00 -07:00
Mia
d992b8f5fa
Add more support for custom punishments (#8215) 2021-04-23 22:40:31 -07:00
siteworks
d887c00795
Mafia: Change lynches to vote in the votebox (#8149) 2021-04-02 18:52:13 -04:00
Mia
a4641eaf58
Fix /mafia extend in pages 2021-03-12 16:40:50 -06:00
ayiadvance
23352312de
Change lynch to vote for public messages and add a vote alternative to lynch commands. (#8081) 2021-02-28 08:02:54 -05:00
Zorquax
f47855c863
Mafia: Add /unwin command (#7955) 2021-02-25 15:40:59 -08:00
Annika
c2e97aaaed
Use optional chaining in more places (#8063) 2021-02-22 11:42:05 -08:00
Kris Johnson
80ad124388
Mafia: Fix IDEA picking 2021-02-21 15:11:02 -07:00
Mia
312d410b69 Mafia: Fix /mafia unlynch 2021-02-19 08:21:30 -06:00
Mia
66f717424a Mafia: Fix /ideapick 2021-02-18 09:28:37 -06:00
Mia
9b33890cce Mafia: Fix /mafia sub 2021-02-17 15:30:15 -06:00
Annika
62056a33a9
Mafia: Fix bugs caused by not using /msgroom 2021-02-16 21:19:51 -08:00
Kris Johnson
82b20aaf8e
Use /msgroom in more places (#8042) 2021-02-16 20:10:05 -08:00
zgeorgecsat
d692f2d0e2
Fix /mafia unhostban (#8012) 2021-02-10 21:22:58 -08:00
DayanYT
b996f7283e
Mafia: Fix typo (#7995) 2021-02-05 09:58:04 -05:00
Mia
76c10841ea
Lib: Add an index file for all exports (#7972) 2021-01-31 18:00:19 -08:00
Guangcong Luo
da30a71706 Revert "Remove User#inRooms and User#games (#7815)"
This reverts commit 5c9c84c415.

This also reverts commit 1fc92ef977.
2021-01-30 15:55:55 -05:00
Mia
5c9c84c415
Remove User#inRooms and User#games (#7815) 2021-01-28 10:41:35 -08:00
zgeorgecsat
c0df565f3c
Mafia: Implement gamebans, various updates (#7867)
* Plurality shift is now shown upon hammer.

* Removes night responses drop down option.

* Adds error reply if user tries to use an argument with /mafia action.

* Lists cohosts on the mafia page.

* Playerlists are alphabetized.

* Declares when closed setup is turned on.

* /mafia kill kills multiple users separated by commas.

* Changes for checks

* Add gamebans/refactor hostbans to use Punishments

* Small fixes

* Change for checks

* Suggestions

* Updates for checks

* Make takeidles default and change game name to Mafia

* Update mafia.ts

* Use this.room
2021-01-22 00:52:28 +10:30
zgeorgecsat
6c5a74c949
Mafia: Refactor for errorReply/requireGame (#7862)
* Changed to errorReply and requireGame whenever applicable/

* Use Chat.ErrorMessage in canJoin
2021-01-03 11:44:43 -08:00
zgeorgecsat
5d4529ebcf
Mafia: Support submitting night actions through script (#7749)
* Allows players to submit idles through script

* Added suggestions

Co-authored-by: Student <Student@MacBook-Air-5.hsd1.il.comcast.net>
2020-12-15 14:45:30 +10:30
zgeorgecsat
3ec8821083
Mafia: Fix sub and IDEA bugs (#7705)
* Allows players that subbed out or stopped cohosting to be forceadded into the game.

* Upon subbing, players' pages update after the subbed player is removed from the playertable.

* Allows /mafia dt for ideas

* Shift plurality to the subbed in player.

* Fix clear button

* Adds spaces between roles in role list.

* Syntax fixes

* Add info to /mafia dt <idea>

Co-authored-by: Student <Student@MacBook-Air-5.hsd1.il.comcast.net>
2020-11-26 13:12:03 +10:30
Mia
938d998da0
Mafia: Allow staff to speak in games (#7642) 2020-11-05 04:57:09 -08:00
iscke
99450eba4e
Mafia: Use new requireRoom API (#7552) 2020-10-21 05:27:15 -07:00
Guangcong Luo
9d87616176
Add more style linting rules (#7537)
* Lint arrow-body-style

* Lint prefer-object-spread

Object spread is faster _and_ more readable.

This also fixes a few unnecessary object clones.

* Enable no-parameter-properties

This isn't currently used, but this makes clear that it shouldn't be.

* Refactor more Promises to async/await

* Remove unnecessary code from getDataMoveHTML etc

* Lint prefer-string-starts-ends-with

* Stop using no-undef

According to the typescript-eslint FAQ, this is redundant with
TypeScript, and they're not wrong. This will save us from needing to
specify globals in two different places which will be nice.
2020-10-19 02:42:28 -07:00
whales
3cae09feab Mafia: Fix forcehost 2020-09-13 12:14:49 +09:30
whales
89d1d1a9cf Mafia: Fix broadcasting queue 2020-09-12 00:52:08 +09:30
whalemer
1511fcb821
Mafia: Update permissions (#7324) 2020-09-08 12:25:25 +09:30
Annika
0a26579afa
Make core commands translatable (#7279) 2020-09-06 17:49:53 -07:00