Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Fixes + Insightful rework + Added Host to Wacky Words and Liars Dice, + Added Governor to Wacky Words #1771

Merged
merged 64 commits into from
Nov 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
e3a75eb
Update Ascetic.js
SawJester Nov 28, 2024
da9aa89
Prettified Code!
SawJester Nov 28, 2024
ae8893f
Update AskDeadQuestion.js
SawJester Nov 28, 2024
17e43c5
Prettified Code!
SawJester Nov 28, 2024
437b099
Update Astral.js
SawJester Nov 28, 2024
fc474dc
Prettified Code!
SawJester Nov 28, 2024
5f94f71
Update BecomeAlignmentOfVisitors.js
SawJester Nov 28, 2024
ec9ee8b
Prettified Code!
SawJester Nov 28, 2024
412792f
Update BecomeExcessRole.js
SawJester Nov 28, 2024
c006f87
Prettified Code!
SawJester Nov 28, 2024
f7682e4
Update BegumsSenses.js
SawJester Nov 28, 2024
7718be4
Prettified Code!
SawJester Nov 28, 2024
af7431e
Update BlockIfVisited.js
SawJester Nov 28, 2024
d8960c2
Prettified Code!
SawJester Nov 28, 2024
91d9f37
Update BlockTargets.js
SawJester Nov 28, 2024
8f32986
Prettified Code!
SawJester Nov 28, 2024
f6530b9
Update Bouncy.js
SawJester Nov 28, 2024
f48bd2f
Prettified Code!
SawJester Nov 28, 2024
d2f2c3b
Update CheckSuccessfulVisit.js
SawJester Nov 28, 2024
e57a963
Prettified Code!
SawJester Nov 28, 2024
89f983f
Update ChoirOfRoles.js
SawJester Nov 28, 2024
791baa1
Prettified Code!
SawJester Nov 28, 2024
ba04d47
Update CleanseVisitors.js
SawJester Nov 28, 2024
9fb5140
Prettified Code!
SawJester Nov 28, 2024
96b8f38
Update Commuting.js
SawJester Nov 28, 2024
e2a4ea9
Prettified Code!
SawJester Nov 28, 2024
b3b539a
Update CleanseVisitors.js
SawJester Nov 28, 2024
f481fd7
Update Complex.js
SawJester Nov 28, 2024
d385d3f
Prettified Code!
SawJester Nov 28, 2024
7f56450
Update ConvertVisitors.js
SawJester Nov 28, 2024
8a4febd
Prettified Code!
SawJester Nov 28, 2024
2004366
Update CountEvilVotes.js
SawJester Nov 28, 2024
d402e98
Prettified Code!
SawJester Nov 28, 2024
7c8ee0d
Update CountEvilVotes.js
SawJester Nov 28, 2024
074bb48
Prettified Code!
SawJester Nov 28, 2024
f913421
Update CountVisitors.js
SawJester Nov 28, 2024
d16f9f1
Prettified Code!
SawJester Nov 28, 2024
8047656
Update CultWinsIfNoCondemn.js
SawJester Nov 28, 2024
83ad11d
Prettified Code!
SawJester Nov 28, 2024
58662e9
Update CountWrongReveals.js
SawJester Nov 28, 2024
2d49857
Prettified Code!
SawJester Nov 28, 2024
c6d3ada
Update CondemnReveal.js
SawJester Nov 28, 2024
52e8b80
Prettified Code!
SawJester Nov 28, 2024
5ffb3e7
-m "Message"
SawJester Nov 29, 2024
ffff810
Prettified Code!
SawJester Nov 29, 2024
7de9745
Update roles.js
SawJester Nov 29, 2024
dedbc59
Prettified Code!
SawJester Nov 29, 2024
555da84
Update modifiers.js
SawJester Nov 29, 2024
865a6f6
Prettified Code!
SawJester Nov 29, 2024
91f207c
Create Host.js
SawJester Nov 30, 2024
f31e074
Update WinIfLastAlive.js
SawJester Nov 30, 2024
2abb9db
Update Game.js
SawJester Nov 30, 2024
60b2eff
Create Host.js
SawJester Nov 30, 2024
9709fb1
Create PromptMaker.js
SawJester Nov 30, 2024
bab1dd5
Update ResponseGiver.js
SawJester Nov 30, 2024
db631b1
Update Game.js
SawJester Nov 30, 2024
5d34ce6
Update HostWackyWords.jsx
SawJester Nov 30, 2024
77cc0ac
Update game.js
SawJester Nov 30, 2024
3d4e40a
Update roles.js
SawJester Nov 30, 2024
03b670c
Update Constants.jsx
SawJester Nov 30, 2024
a50f085
Update roles.css
SawJester Nov 30, 2024
215378c
-m "Wacky and Liar Host"
SawJester Nov 30, 2024
08c28a7
Merge pull request #3 from SawJester/HostnBroker
SawJester Nov 30, 2024
197fa8f
Prettified Code!
SawJester Nov 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions Games/types/LiarsDice/Game.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,22 @@ module.exports = class LiarsDiceGame extends Game {
this.sendAlert(`Good luck... You'll probably need it.`);

//start of game - randomizes player order, and gives dice to everyone.
this.randomizedPlayers = Random.randomizeArray(this.players.array());
this.hasHost = this.setup.roles[0]["Host:"];
if (this.hasHost) {
let hostPlayer = this.players.array()[0];
this.randomizedPlayers = Random.randomizeArray(
this.players.array()
).filter((p) => p != hostPlayer);
} else {
this.randomizedPlayers = Random.randomizeArray(this.players.array());
}
this.randomizedPlayersCopy = this.randomizedPlayers;

this.randomizedPlayers.forEach((player) => {
player.diceNum = this.startingDice;
});

// super.start();
this.rollDice();
this.startRoundRobin();

Expand Down Expand Up @@ -923,7 +932,7 @@ module.exports = class LiarsDiceGame extends Game {
},
});

if (player.alive) {
if (player.alive && player != this.hostPlayer) {
this.sendAlert(
`${player.name} left, but their ${player.rolledDice.length} dice will still count towards this round's total.`
);
Expand Down
10 changes: 10 additions & 0 deletions Games/types/LiarsDice/roles/Host/Host.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const Role = require("../../Role");

module.exports = class Host extends Role {
constructor(player, data) {
super("Host", player, data);

this.alignment = "Host";
this.cards = ["TownCore"];
}
};
6 changes: 5 additions & 1 deletion Games/types/LiarsDice/roles/cards/WinIfLastAlive.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ module.exports = class WinIfLastAlive extends Card {
this.winCheck = {
priority: 0,
check: function (counts, winners, aliveCount) {
if (aliveCount <= 1 && this.player.alive)
let nonHostAlive = this.game
.alivePlayers()
.filter((p) => p.role.name != "Host");

if (nonHostAlive.length <= 1 && this.player.alive)
winners.addPlayer(this.player, this.name);
},
};
Expand Down
24 changes: 23 additions & 1 deletion Games/types/Mafia/roles/cards/Ascetic.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
const Card = require("../../Card");
const Action = require("../../Action");
const { PRIORITY_UNTARGETABLE } = require("../../const/Priority");

module.exports = class Ascetic extends Card {
constructor(role) {
super(role);

/*
this.actions = [
{
priority: PRIORITY_UNTARGETABLE,
Expand All @@ -16,5 +17,26 @@ module.exports = class Ascetic extends Card {
},
},
];
*/
this.listeners = {
state: function (stateInfo) {
if (!this.player.alive) {
return;
}
if (!stateInfo.name.match(/Night/)) {
return;
}
var action = new Action({
actor: this.player,
priority: PRIORITY_UNTARGETABLE,
game: this.player.game,
labels: ["stop", "hidden"],
run: function () {
this.makeUntargetable(this.actor, "kill");
},
});
this.game.queueAction(action);
},
};
}
};
85 changes: 83 additions & 2 deletions Games/types/Mafia/roles/cards/AskDeadQuestion.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const Card = require("../../Card");
const Action = require("../../Action");
const {
PRIORITY_DAY_DEFAULT,
PRIORITY_INVESTIGATIVE_DEFAULT,
Expand All @@ -25,10 +26,23 @@ module.exports = class AskDeadQuestion extends Card {
'Answer Mourner asking "' + this.actor.role.data.question + '"';
this.actor.role.mournerYes = 0;
this.actor.role.mournerNo = 0;
if (!this.actor.role.data.question) {
return;
}
for (let player of this.game.players) {
if (!player.alive) {
player.holdItem("Mourned", {
mourner: this.actor,
question: this.actor.role.data.question,
meetingName: this.actor.role.data.meetingName,
});
}
}
},
},
},
};
/*
this.actions = [
// give mourned item to dead
{
Expand All @@ -39,7 +53,10 @@ module.exports = class AskDeadQuestion extends Card {
return;
}

if (this.game.getStateName() !== "Day") {
if (
this.game.getStateName() !== "Day" &&
this.game.getStateName() !== "Dusk"
) {
return;
}

Expand Down Expand Up @@ -67,7 +84,10 @@ module.exports = class AskDeadQuestion extends Card {
return;
}

if (this.game.getStateName() !== "Night") {
if (
this.game.getStateName() !== "Night" &&
this.game.getStateName() !== "Dawn"
) {
return;
}

Expand Down Expand Up @@ -104,5 +124,66 @@ module.exports = class AskDeadQuestion extends Card {
},
},
];
*/

this.listeners = {
state: function (stateInfo) {
if (stateInfo.name.match(/Day/)) {
}
if (!stateInfo.name.match(/Night/)) {
return;
}
var action = new Action({
actor: this.player,
game: this.player.game,
priority: PRIORITY_INVESTIGATIVE_DEFAULT,
run: function () {
if (!this.actor.alive) {
return;
}

if (
this.game.getStateName() !== "Night" &&
this.game.getStateName() !== "Dawn"
) {
return;
}

if (!this.actor.role.data.question) {
return;
}

let numYes = this.actor.role.mournerYes;
let numNo = this.actor.role.mournerNo;

let totalResponses = numYes + numNo;

let percentNo = Math.round((numNo / totalResponses) * 100);
let percentYes = Math.round((numYes / totalResponses) * 100);

if (this.actor.hasEffect("FalseMode")) {
if (totalResponses === 0) {
percentYes = 100;
percentNo = 0;
totalResponses = totalResponses + 1;
} else {
let temp = percentNo;
percentNo = percentYes;
percentYes = temp;
}
}

if (totalResponses === 0)
this.actor.queueAlert(`You receive no responses from the dead.`);
else
this.actor.queueAlert(
`The dead has replied with ${percentYes}% Yes's and ${percentNo}% No's to your question "${this.actor.role.data.question}".`
);
},
});

this.game.queueAction(action);
},
};
}
};
28 changes: 27 additions & 1 deletion Games/types/Mafia/roles/cards/Astral.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
const Card = require("../../Card");
const Action = require("../../Action");
const { PRIORITY_MODIFY_ACTION_LABELS } = require("../../const/Priority");

module.exports = class Astral extends Card {
constructor(role) {
super(role);

/*
this.actions = [
{
priority: PRIORITY_MODIFY_ACTION_LABELS,
Expand All @@ -23,5 +24,30 @@ module.exports = class Astral extends Card {
},
},
];
*/
this.listeners = {
state: function (stateInfo) {
if (!stateInfo.name.match(/Night/)) {
return;
}
var action = new Action({
actor: this.player,
game: this.player.game,
priority: PRIORITY_MODIFY_ACTION_LABELS,
labels: ["absolute", "hidden"],
run: function () {
for (let action of this.game.actions[0]) {
if (
action.priority > this.priority &&
action.actors.includes(this.actor)
) {
action.labels = [...action.labels, "hidden"];
}
}
},
});
this.game.queueAction(action);
},
};
}
};
53 changes: 36 additions & 17 deletions Games/types/Mafia/roles/cards/BecomeAlignmentOfVisitors.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const Card = require("../../Card");
const Action = require("../../Action");
const {
PRIORITY_BLOCK_VISITORS,
PRIORITY_WIN_CHECK_DEFAULT,
Expand All @@ -7,7 +8,7 @@ const {
module.exports = class BecomeAlignmentOfVisitors extends Card {
constructor(role) {
super(role);

/*
this.actions = [
{
priority: PRIORITY_BLOCK_VISITORS - 1,
Expand All @@ -27,25 +28,43 @@ module.exports = class BecomeAlignmentOfVisitors extends Card {
this.actor.faction = visit.faction;
return;
}
/*
for (let action of this.game.actions[0]) {
if (action.target == this.actor && !action.hasLabel("hidden")) {
},
},
];
*/
this.listeners = {
state: function (stateInfo) {
if (!this.player.alive) {
return;
}
if (!stateInfo.name.match(/Night/)) {
return;
}
var action = new Action({
actor: this.player,
target: target,
game: this.player.game,
priority: PRIORITY_BLOCK_VISITORS - 1,
labels: ["block", "hidden"],
run: function () {
if (!this.actor.alive) return;

if (
action.priority > this.priority
) {
if (this.dominates(action.actor)) {
this.blockWithMindRot(action.actor);
}
for (let visit of this.getVisitors(this.actor)) {
if (this.dominates(visit)) {
this.blockWithMindRot(visit);
}
this.actor.queueAlert(`After Hitchhiking with a player you feel like Supporting the ${action.actors [0].role.alignment}.`);
this.actor.role.alignment = action.actor.role.alignment;
return;

this.actor.queueAlert(
`After Hitchhiking with a player you feel like Supporting the ${visit.faction}.`
);
this.actor.faction = visit.faction;
return;
}
}
*/
},
},
});

this.game.queueAction(action);
},
];
};
}
};
Loading