Skip to content

Commit

Permalink
chore: Settings page converted to mUI (#1746)
Browse files Browse the repository at this point in the history
Didn't test *every* setting but most work just as they did before

---------

Co-authored-by: Golbolco <[email protected]>
  • Loading branch information
Golbolco and Golbolco authored Oct 14, 2024
1 parent c1da3af commit 70a466e
Show file tree
Hide file tree
Showing 17 changed files with 383 additions and 506 deletions.
43 changes: 27 additions & 16 deletions Games/core/Meeting.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,33 +424,44 @@ module.exports = class Meeting {
break;
case "neighbors":
//this.game.alivePlayers().indexOf(self);
if (this.game.alivePlayers().indexOf(player) == (this.game.alivePlayers().indexOf(self)+ 1) % players.length
|| (this.game.alivePlayers().indexOf(player) == (this.game.alivePlayers().indexOf(self)- 1 + players.length) % players.length)){
if (
this.game.alivePlayers().indexOf(player) ==
(this.game.alivePlayers().indexOf(self) + 1) %
players.length ||
this.game.alivePlayers().indexOf(player) ==
(this.game.alivePlayers().indexOf(self) -
1 +
players.length) %
players.length
) {
includePlayer[player.id] = include;
}
else if (this.game.deadPlayers().indexOf(player) == (this.game.deadPlayers().indexOf(self)+ 1) % players.length
|| (this.game.deadPlayers().indexOf(player) == (this.game.deadPlayers().indexOf(self)- 1 + players.length) % players.length)){
} else if (
this.game.deadPlayers().indexOf(player) ==
(this.game.deadPlayers().indexOf(self) + 1) %
players.length ||
this.game.deadPlayers().indexOf(player) ==
(this.game.deadPlayers().indexOf(self) - 1 + players.length) %
players.length
) {
includePlayer[player.id] = include;
}
break;
case "even":
//this.game.alivePlayers().indexOf(self);
if (this.game.alivePlayers().indexOf(player)%2 == 0){
if (this.game.alivePlayers().indexOf(player) % 2 == 0) {
includePlayer[player.id] = include;
}
else if (this.game.deadPlayers().indexOf(player)%2 == 0){
} else if (this.game.deadPlayers().indexOf(player) % 2 == 0) {
includePlayer[player.id] = include;
}
break;
case "odd":
//this.game.alivePlayers().indexOf(self);
if (this.game.alivePlayers().indexOf(player)%2 == 1){
includePlayer[player.id] = include;
}
else if(this.game.deadPlayers().indexOf(player)%2 == 1){
includePlayer[player.id] = include;
}
break;
//this.game.alivePlayers().indexOf(self);
if (this.game.alivePlayers().indexOf(player) % 2 == 1) {
includePlayer[player.id] = include;
} else if (this.game.deadPlayers().indexOf(player) % 2 == 1) {
includePlayer[player.id] = include;
}
break;
case "members":
if (this.members[player.id]) includePlayer[player.id] = include;
break;
Expand Down
4 changes: 1 addition & 3 deletions Games/types/Mafia/Game.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,11 +336,9 @@ module.exports = class MafiaGame extends Game {
};
}

formatRole(role){

formatRole(role) {
var roleName = role.split(":")[0];
var modifiers = role.split(":")[1];
return `${roleName}${modifiers ? ` (${modifiers})` : ""}`;
}

};
19 changes: 10 additions & 9 deletions Games/types/Mafia/items/Retirement.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,18 @@ module.exports = class Retirement extends Item {
return;
}

let players = this.game.players.filter((p) => p.role.name == this.currRole);
let players = this.game.players.filter(
(p) => p.role.name == this.currRole
);

if(players.length <= 0){
if (players.length <= 0) {
this.holder.queueAlert(
`You are a retired ${this.currRole}. You know that no one in this town is a ${this.currRole}`
);
}
else{
this.holder.queueAlert(
`You are a retired ${this.currRole}. You remember a few people you worked with!`
);
`You are a retired ${this.currRole}. You know that no one in this town is a ${this.currRole}`
);
} else {
this.holder.queueAlert(
`You are a retired ${this.currRole}. You remember a few people you worked with!`
);
}

for (const player of this.game.players) {
Expand Down
28 changes: 14 additions & 14 deletions Games/types/Mafia/items/WackyFactionRoleReveal.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ module.exports = class WackyFactionRoleReveal extends Item {
this.meetingName = meetingName;
this.meetings[this.meetingName] = {
states: ["Night"],
flags: ["group", "anonymous", "voting"],
targets: { include: ["alive"]},
action: {
labels: ["hidden", "absolute","reveal","group", "multiActor"],
priority: PRIORITY_REVEAL_DEFAULT,
item: this,
run: function () {
//this.target.role.revealToPlayer(this.actor);
for(let p of this.game.players){
if (this.actor.faction == p.faction){
this.target.role.revealToPlayer(p);
}
flags: ["group", "anonymous", "voting"],
targets: { include: ["alive"] },
action: {
labels: ["hidden", "absolute", "reveal", "group", "multiActor"],
priority: PRIORITY_REVEAL_DEFAULT,
item: this,
run: function () {
//this.target.role.revealToPlayer(this.actor);
for (let p of this.game.players) {
if (this.actor.faction == p.faction) {
this.target.role.revealToPlayer(p);
}
this.item.drop();
},
}
this.item.drop();
},
},
};
}
};
3 changes: 1 addition & 2 deletions Games/types/Mafia/items/WackyJoinFactionMeeting.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ module.exports = class WackyJoinFactionMeeting extends Item {
}
},
},

},
};
}
Expand All @@ -55,4 +54,4 @@ function excludeMafiaOnlyIfNotAnonymous(player) {
if (player.faction && FACTION_KILL.includes(player.faction)) {
return true;
}
}
}
2 changes: 0 additions & 2 deletions Games/types/Mafia/items/WackyRoleLearner.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,3 @@ module.exports = class WackyRoleLearner extends Item {
};
}
};


10 changes: 5 additions & 5 deletions Games/types/Mafia/roles/cards/ChoirOfRoles.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ module.exports = class ChoirOfRoles extends Card {
this.target.kill("condemn", this.actor);
}
} //End if
else{
if(this.actor.role.data.singer){
this.actor.queueAlert(
`${this.actor.role.data.singer.name} was singing about ${this.actor.role.data.singAbout}, Your guess was Incorrect. You cannot Guess ${this.target.name} tomorrow!`);
else {
if (this.actor.role.data.singer) {
this.actor.queueAlert(
`${this.actor.role.data.singer.name} was singing about ${this.actor.role.data.singAbout}, Your guess was Incorrect. You cannot Guess ${this.target.name} tomorrow!`
);
}
}

},
},
},
Expand Down
Loading

0 comments on commit 70a466e

Please sign in to comment.