Skip to content

Commit

Permalink
Auditor Info File and Changes (#1816)
Browse files Browse the repository at this point in the history
Auditor can learn more types of things.

---------

Co-authored-by: SawJester <[email protected]>
  • Loading branch information
SawJester and SawJester authored Jan 9, 2025
1 parent 9ff7324 commit 2a851f4
Show file tree
Hide file tree
Showing 26 changed files with 475 additions and 394 deletions.
73 changes: 37 additions & 36 deletions Games/types/LiarsDice/Game.js
Original file line number Diff line number Diff line change
Expand Up @@ -775,20 +775,21 @@ module.exports = class LiarsDiceGame extends Game {

//Removes one dice from a player and eliminate if no more dice
removeDice(player, amount, midRound) {

if(amount == null || amount <= 0){
if (amount == null || amount <= 0) {
amount = 1;
}

player.diceNum = player.diceNum - amount;

if(midRound == true){
player.queueAlert(`You lose a Dice but you won't learn which until this turn ends!`);
if (midRound == true) {
player.queueAlert(
`You lose a Dice but you won't learn which until this turn ends!`
);
let dice;
for(let x = 0; x < amount; x++){
dice = player.rolledDice.pop();
this.allDice -= 1;
this.allRolledDice.splice(this.allRolledDice.indexOf(dice),1);
for (let x = 0; x < amount; x++) {
dice = player.rolledDice.pop();
this.allDice -= 1;
this.allRolledDice.splice(this.allRolledDice.indexOf(dice), 1);
}
}

Expand Down Expand Up @@ -907,41 +908,41 @@ module.exports = class LiarsDiceGame extends Game {
}

addDice(player, amount, midRound, noMessage) {
if(amount == null || amount <= 0){
if (amount == null || amount <= 0) {
amount = 1;
}
player.diceNum = player.diceNum + amount;
if(noMessage != true){
this.sendAlert(`${player.name} has Gained a Dice!`);
if (noMessage != true) {
this.sendAlert(`${player.name} has Gained a Dice!`);
}
if(midRound == true){
player.queueAlert(`You gain a Dice!`);
if (midRound == true) {
player.queueAlert(`You gain a Dice!`);
let dice;
let info;
for(let x = 0; x < amount; x++){
dice = Math.floor(Math.random() * 6) + 1;
player.rolledDice.push(dice);
if (dice == 1) {
info =":Dice1:";
}
if (dice == 2) {
info =":Dice2:";
}
if (dice == 3) {
info = ":Dice3:";
}
if (dice == 4) {
info = ":Dice4:";
}
if (dice == 5) {
info = ":Dice5:";
}
if (dice == 6) {
info = ":Dice6:";
}
for (let x = 0; x < amount; x++) {
dice = Math.floor(Math.random() * 6) + 1;
player.rolledDice.push(dice);
if (dice == 1) {
info = ":Dice1:";
}
if (dice == 2) {
info = ":Dice2:";
}
if (dice == 3) {
info = ":Dice3:";
}
if (dice == 4) {
info = ":Dice4:";
}
if (dice == 5) {
info = ":Dice5:";
}
if (dice == 6) {
info = ":Dice6:";
}
player.queueAlert(`You gain a ${info} !`);
this.allDice += 1;
this.allRolledDice.push(dice);
this.allDice += 1;
this.allRolledDice.push(dice);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Games/types/LiarsDice/const/ImportantMeetings.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const IMPORTANT_MEETINGS = [
"separationText",
];

const ROLE_MEETINGS = ["Snoop", "Shoot", "Spy","Propose"];
const ROLE_MEETINGS = ["Snoop", "Shoot", "Spy", "Propose"];

module.exports = {
IMPORTANT_MEETINGS,
Expand Down
4 changes: 1 addition & 3 deletions Games/types/LiarsDice/items/Gun.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ module.exports = class Gun extends Item {
this.game.queueAlert(
`:gun: Someone pulls a gun and shoots at ${this.target.name}!`
);
this.game.queueAlert(
`${this.target.name} Loses a Dice!`
);
this.game.queueAlert(`${this.target.name} Loses a Dice!`);
/*
this.target.queueAlert(
`You lose a Dice but you won't learn which until this turn ends!`
Expand Down
14 changes: 6 additions & 8 deletions Games/types/LiarsDice/items/ProposalOffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,15 @@ module.exports = class ProposalOffer extends Item {
return;
}
this.game.queueAlert(
`${this.actor.name} ${isAccepted} the proposal.`
);
`${this.actor.name} ${isAccepted} the proposal.`
);
this.game.addDice(this.actor, 1, true);
this.game.addDice(this.item.proposer, 1, true);

}
else{
} else {
this.game.queueAlert(
`${this.actor.name} ${isAccepted} the proposal.`
);
this.game.removeDice(this.item.proposer, 1, true);
`${this.actor.name} ${isAccepted} the proposal.`
);
this.game.removeDice(this.item.proposer, 1, true);
}

this.item.drop();
Expand Down
6 changes: 3 additions & 3 deletions Games/types/LiarsDice/items/Propose.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ module.exports = class Propose extends Item {
action: {
item: this,
run: function () {
if(this.item.selectedPlayers.includes(this.target)){
if (this.item.selectedPlayers.includes(this.target)) {
this.actor.queueAlert(
`You already proposed to ${this.target.name}, Choose another player!`
);
`You already proposed to ${this.target.name}, Choose another player!`
);
return;
}
this.item.selectedPlayers.push(this.target);
Expand Down
4 changes: 2 additions & 2 deletions Games/types/LiarsDice/roles/cards/TakeNoDiceOnLieCall.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ module.exports = class GainDiceOnCorrectLieCall extends Card {
return;
}
this.game.queueAlert(
`${this.player.name} gains a Gun and ${Bidder.name} keeps their Dice!`
);
`${this.player.name} gains a Gun and ${Bidder.name} keeps their Dice!`
);
this.player.holdItem("Gun");
this.game.addDice(Bidder, 1, false, true);
},
Expand Down
10 changes: 10 additions & 0 deletions Games/types/Mafia/Information.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ module.exports = class MafiaInformation {
}
}

processInfoItem(item) {
if (item != null) {
if (item.broken == true || item.magicCult == true) {
if (!this.isFalse()) {
this.makeFalse();
}
}
}
}

getInfoRaw() {
this.game.events.emit("Information", this);
}
Expand Down
3 changes: 3 additions & 0 deletions Games/types/Mafia/information/BinaryAlignmentInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ module.exports = class BinaryAlignmentInfo extends Information {

//return `You Learn that your Target is ${this.mainInfo}`
}
getInfoSpecial() {
return `${this.target.name} is ${this.mainInfo}`;
}

isTrue() {
if (!this.isAppearanceEvil(this.target)) {
Expand Down
5 changes: 4 additions & 1 deletion Games/types/Mafia/information/CompareAlignmentInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,12 @@ module.exports = class CompareAlignmentInfo extends Information {

getInfoFormated() {
super.getInfoRaw();
return `You Learn that your ${this.targetA.name} and ${this.targetB.name} have ${this.mainInfo} Alignments.`;
return `You Learn that ${this.targetA.name} and ${this.targetB.name} have ${this.mainInfo} Alignments.`;
//return `You Learn that your Target's Alignment is ${this.mainInfo}`
}
getInfoSpecial() {
return `${this.targetA.name} and ${this.targetB.name} have ${this.mainInfo} Alignments.`;
}

isTrue() {
let alignmentA = this.getAlignment(this.targetA);
Expand Down
6 changes: 6 additions & 0 deletions Games/types/Mafia/information/DirectionToEvilInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ module.exports = class DirectionToEvilInfo extends Information {
}
return `You Learn that the closest Evil Player to your Target is ${this.mainInfo} them on the Player List`;
}
getInfoSpecial() {
if (this.target == this.creator) {
return `The closest Evil Player to you is ${this.mainInfo} you on the Player List`;
}
return `The closest Evil Player to ${this.target.name} is ${this.mainInfo} them on the Player List`;
}

isTrue() {
let alive = this.game.alivePlayers();
Expand Down
4 changes: 4 additions & 0 deletions Games/types/Mafia/information/EvilDeadCountInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ module.exports = class EvilDeadCountInfo extends Information {
return `You Learn that ${this.mainInfo} Dead Players are Evil.`;
}

getInfoSpecial() {
return `There are ${this.mainInfo} Dead Evil Players.`;
}

isTrue() {
let evilCount;
let players = this.game.deadPlayers();
Expand Down
6 changes: 5 additions & 1 deletion Games/types/Mafia/information/EvilPairsInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ module.exports = class EvilPairsInfo extends Information {

getInfoFormated() {
super.getInfoRaw();
return `You Learn that there are ${this.mainInfo} Pairs of Evil Players Neighboring another eachother.`;
return `You Learn that there are ${this.mainInfo} Pairs of Evil Players Neighboring another Evil Player.`;
}

getInfoSpecial() {
return `There are ${this.mainInfo} Pairs of Evil Players Neighboring another Evil player.`;
}

isTrue() {
Expand Down
14 changes: 14 additions & 0 deletions Games/types/Mafia/information/ExcessRolesInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,20 @@ module.exports = class ExcessRolesInfo extends Information {
//return `You Learn that your Target's Role is ${this.mainInfo}`
}

getInfoSpecial() {
let shuffledChosen = Random.randomizeArray(this.mainInfo).map((r) =>
this.game.formatRole(r)
);
if (this.LimtedExcess && this.mainInfo.length <= 0) {
return `There are 0 Excess Roles!`;
}
if (this.LimtedExcess) {
return `${shuffledChosen} are Excess Roles`;
}
return `${this.amount} of the Excess Roles is ${shuffledChosen}`;
//return `You Learn that your Target's Role is ${this.mainInfo}`
}

isTrue() {
let roles = this.game.PossibleRoles.filter((r) => r);
let players = this.game.players.filter((p) => p.role);
Expand Down
13 changes: 13 additions & 0 deletions Games/types/Mafia/information/GuessPlayerNeighborRoleInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,19 @@ module.exports = class GuessPlayerNeighborRoleInfo extends Information {
)} was ${guess}!`;
}

getInfoSpecial() {
let guess;
if (this.mainInfo == true) {
return `${this.target.name} Neighbors ${addArticle(
this.game.formatRole(this.role)
)}!`;
} else {
return `${this.target.name} does not Neighbor ${addArticle(
this.game.formatRole(this.role)
)}!`;
}
}

isTrue() {
let correctCount = 0;
let alive = this.game.alivePlayers();
Expand Down
13 changes: 13 additions & 0 deletions Games/types/Mafia/information/GuessPlayerVisitRoleInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,19 @@ module.exports = class GuessPlayerVisitRoleInfo extends Information {
)} was ${guess}!`;
}

getInfoSpecial() {
let guess;
if (this.mainInfo == true) {
return `${this.target.name} Visited ${addArticle(
this.game.formatRole(this.role)
)} last night`;
} else {
return `${this.target.name} did not Visit ${addArticle(
this.game.formatRole(this.role)
)} last night`;
}
}

isTrue() {
let correctCount = 0;
let alive = this.game.alivePlayers();
Expand Down
12 changes: 12 additions & 0 deletions Games/types/Mafia/information/ItemInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ module.exports = class ItemInfo extends Information {
//return `You Learn that your Target is ${this.mainInfo}`
}

getInfoSpecial() {
let items = this.mainInfo;
let itemsToAlert = "nothing";
if (items.length > 0) {
itemsToAlert = items.join(", ");
}

return `${this.target.name} is holding ${itemsToAlert}.`;

//return `You Learn that your Target is ${this.mainInfo}`
}

isTrue() {
let items = this.snoopAllItems(this.target, true);
if (this.mainInfo.length != items.length) {
Expand Down
7 changes: 7 additions & 0 deletions Games/types/Mafia/information/NeighborAlignmentInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ module.exports = class NeighborAlignmentInfo extends Information {
return `You Learn that your Target has ${this.mainInfo} Evil Neighbors`;
}

getInfoSpecial() {
if (this.target == this.creator) {
return `You have ${this.mainInfo} Evil Neighbors`;
}
return `${this.target.name} has ${this.mainInfo} Evil Neighbors`;
}

isTrue() {
let role;
let trueRole;
Expand Down
Loading

0 comments on commit 2a851f4

Please sign in to comment.