Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesCraster committed Feb 4, 2019
2 parents b4641bf + 6b29d23 commit 38af195
Show file tree
Hide file tree
Showing 19 changed files with 2,950 additions and 374 deletions.
2 changes: 2 additions & 0 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ This guide includes instructions on how to easily build OpenWerewolf from source

- [Install Node.js](https://nodejs.org/en/)

- [Install Redis](https://redis.io/download)

- Unzip release.zip, and run:

```
Expand Down
1 change: 1 addition & 0 deletions Core/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ export { Server } from "./server";
export { Game, MessageRoom } from "./game";
export { User } from "./user";
export { Utils, Colors, Stopwatch } from "./utils";
export { Player } from "./player";
2 changes: 2 additions & 0 deletions Core/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export abstract class Game {
this.author = author;
this.license = license;
setInterval(this.pregameLobbyUpdate.bind(this), 500);
setInterval(this.update.bind(this), 500);
}
public get name() {
return this._name;
Expand All @@ -88,6 +89,7 @@ export abstract class Game {
public get users() {
return this._users;
}
protected update() {}
get usernameColorPairs(): Array<NameColorPair> {
let usernameColorPairs = [];
for (let i = 0; i < this._users.length; i++) {
Expand Down
10 changes: 9 additions & 1 deletion Games/Classic/Classic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,15 @@ export class Classic extends Game {
]);
break;
case Alignment.neutral:
player.user.send(`You are a ${role}`, undefined, player.role.color);
if (player.role.backgroundColor) {
player.user.send(
`You are a ${role}`,
undefined,
player.role.backgroundColor,
);
} else {
player.user.send(`You are a ${role}`, undefined, player.role.color);
}
player.user.headerSend([
{ text: "You are a ", color: Colors.white },
{ text: role, color: player.role.color },
Expand Down
4 changes: 3 additions & 1 deletion Games/Classic/Roles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export type Role = {
abilities: Array<{ ability: Ability; uses?: number }>;
passives: Array<Passives>;
color?: Colors;
backgroundColor?: Colors;
};

export namespace GameEndConditions {
Expand Down Expand Up @@ -225,7 +226,8 @@ export namespace Roles {
roleName: "survivor",
alignment: Alignment.neutral,
winCondition: WinConditions.survive,
color: Colors.yellow,
color: Colors.brightYellow,
backgroundColor: Colors.yellow,
abilities: [],
passives: [],
};
Expand Down
143 changes: 143 additions & 0 deletions Games/Local/List.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
{
"defaultLists": [
[
"mafioso",
"jester",
"sherrif",
"vigilante"
],
[
"mafioso",
"doctor",
"escort",
"sherrif",
"survivor"
],
[
"mafioso",
"doctor",
"escort",
"sherrif",
"survivor",
"townie"
],
[
"mafioso",
"mafioso",
"doctor",
"vigilante",
"sherrif",
"townie",
"townie"
],
[
"mafioso",
"mafioso",
"doctor",
"vigilante",
"sherrif",
"townie",
"townie",
"townie"
],
[
"mafioso",
"mafioso",
"doctor",
"vigilante",
"sherrif",
"townie",
"townie",
"townie",
"townie"
],
[
"mafioso",
"mafioso",
"doctor",
"vigilante",
"sherrif",
"townie",
"townie",
"townie",
"townie",
"townie"
],
[
"mafioso",
"mafioso",
"doctor",
"vigilante",
"sherrif",
"townie",
"townie",
"townie",
"townie",
"townie",
"townie"
],
[
"mafioso",
"mafioso",
"doctor",
"vigilante",
"sherrif",
"townie",
"townie",
"townie",
"townie",
"townie",
"townie",
"townie"
],
[
"mafioso",
"mafioso",
"doctor",
"vigilante",
"sherrif",
"townie",
"townie",
"townie",
"townie",
"townie",
"townie",
"townie",
"townie"
],
[
"mafioso",
"mafioso",
"doctor",
"vigilante",
"sherrif",
"townie",
"townie",
"townie",
"townie",
"townie",
"townie",
"townie",
"townie",
"townie"
],
[
"mafioso",
"mafioso",
"doctor",
"vigilante",
"sherrif",
"townie",
"townie",
"townie",
"townie",
"townie",
"townie",
"townie",
"townie",
"townie",
"townie"
]

]
}
Loading

0 comments on commit 38af195

Please sign in to comment.