-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pending changes exported from your codespace
- Loading branch information
Showing
16 changed files
with
237 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,53 @@ | ||
const Event = require("../../core/Event"); | ||
|
||
module.exports = class MafiaEvent extends Event { | ||
constructor(name, game, data) { | ||
super(name, game, data); | ||
constructor(name, modifiers, game, data) { | ||
super(name, modifiers, game, data); | ||
//this.game.queueAlert(`Mafia ${modifiers}`); | ||
} | ||
|
||
getModifierRequirements() { | ||
if(this.modifiers == null) return true; | ||
//this.game.queueAlert("Checks Null"); | ||
if ( | ||
this.game.getStateInfo().dayCount % 2 == 0 && | ||
this.game.dayCount % 2 == 0 && | ||
this.modifiers.includes("Odd") | ||
) { | ||
return false; | ||
} | ||
//this.game.queueAlert(`${this.modifiers} ${this.modifiers.includes("Odd")}`); | ||
if ( | ||
this.game.getStateInfo().dayCount % 1 == 0 && | ||
this.game.dayCount % 2 == 1 && | ||
this.modifiers.includes("Even") | ||
) { | ||
return false; | ||
} | ||
if ( | ||
this.game.getStateInfo().dayCount == 1 && | ||
this.game.dayCount == 1 && | ||
this.modifiers.includes("Delayed") | ||
) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
doEvent() { | ||
if(this.modifiers != null){ | ||
if ( | ||
this.modifiers.includes("One Shot") && | ||
!this.modifiers.includes("Banished") | ||
) { | ||
this.game.PossibleEvents.slice( | ||
this.game.PossibleEvents.indexOf(this.fullName), | ||
1 | ||
); | ||
this.game.PossibleEvents.splice(this.game.PossibleEvents.indexOf(this.fullName),1); | ||
} else if ( | ||
this.modifiers.includes("One Shot") && | ||
this.modifiers.includes("Banished") | ||
) { | ||
this.game.PossibleEvents.slice( | ||
this.game.BanishedEvents.splice( | ||
this.game.BanishedEvents.indexOf(this.fullName), | ||
1 | ||
); | ||
} | ||
} | ||
|
||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
const Event = require("../Event"); | ||
const Action = require("../Action"); | ||
const Random = require("../../../../lib/Random"); | ||
const { | ||
PRIORITY_ITEM_GIVER_DEFAULT, | ||
PRIORITY_BECOME_DEAD_ROLE, | ||
} = require("../const/Priority"); | ||
|
||
module.exports = class Brainblast extends Event { | ||
constructor(modifiers, game) { | ||
super("Brainblast", modifiers, game); | ||
} | ||
|
||
getNormalRequirements() { | ||
return true; | ||
} | ||
|
||
doEvent() { | ||
super.doEvent(); | ||
let victim = Random.randArrayVal(this.game.alivePlayers()); | ||
this.action = new Action({ | ||
actor: victim, | ||
target: victim, | ||
game: this.game, | ||
priority: PRIORITY_ITEM_GIVER_DEFAULT, | ||
labels: ["hidden", "absolute"], | ||
run: function () { | ||
for (const player of this.game.players) { | ||
player.holdItem("CaveIn"); | ||
} | ||
}, | ||
}); | ||
this.game.queueAction(this.action); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const Event = require("../Event"); | ||
const Action = require("../Action"); | ||
const Random = require("../../../../lib/Random"); | ||
const { | ||
PRIORITY_ITEM_GIVER_DEFAULT, | ||
PRIORITY_BECOME_DEAD_ROLE, | ||
} = require("../const/Priority"); | ||
|
||
module.exports = class MissingSupplies extends Event { | ||
constructor(modifiers, game) { | ||
super("No Event", modifiers, game); | ||
|
||
} | ||
|
||
getNormalRequirements() { | ||
return true; | ||
} | ||
|
||
doEvent() { | ||
super.doEvent(); | ||
|
||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
const Item = require("../Item"); | ||
const { PRIORITY_KILL_DEFAULT,MEETING_PRIORITY_JAIL } = require("../const/Priority"); | ||
|
||
|
||
module.exports = class CaveIn extends Item { | ||
constructor() { | ||
super("CaveIn"); | ||
|
||
this.cannotBeStolen = true; | ||
this.cannotBeSnooped = true; | ||
|
||
this.meetings = { | ||
"Caved In": { | ||
actionName: "Convert Player to Food", | ||
states: ["Night"], | ||
flags: ["group", "speech", "voting", "mustAct"], | ||
priority: MEETING_PRIORITY_JAIL, | ||
passiveDead: true, | ||
whileDead: true, | ||
speakDead: true, | ||
targets: { include: ["alive"], exclude: ["dead"] }, | ||
action: { | ||
labels: ["kill", "hidden"], | ||
priority: PRIORITY_KILL_DEFAULT, | ||
power: 3, | ||
item: this, | ||
run: function () { | ||
if (this.dominates()) { | ||
if (!this.target.alive) { | ||
this.game.exorcisePlayer(this.target); | ||
} | ||
this.target.kill("basic", this.actor); | ||
for (let person of this.game.players) { | ||
if (person.alive && person.role.name !== "Turkey") { | ||
person.holdItem("Food", "Fresh Meat"); | ||
} | ||
} | ||
} | ||
|
||
|
||
}, | ||
}, | ||
|
||
}, | ||
}; | ||
|
||
this.listeners = { | ||
state: function () { | ||
const state = this.game.getStateName(); | ||
if (state == "Day" && this.hasBeenNight == true) { | ||
this.drop(); | ||
return; | ||
} | ||
if (state != "Night") { | ||
return; | ||
} | ||
this.hasBeenNight = true; | ||
this.holder.queueAlert( | ||
`Event: Cave In, You all need something to eat!` | ||
); | ||
|
||
}, | ||
}; | ||
|
||
|
||
} | ||
|
||
shouldDisableMeeting(name) { | ||
// do not disable jailing, gov actions | ||
if (this.game.getStateName() != "Night") { | ||
return false; | ||
} | ||
/* | ||
if (this.holder.role.alignment == "Cult") { | ||
return false; | ||
} | ||
*/ | ||
|
||
return name !== "Caved In"; | ||
} | ||
|
||
|
||
}; |
Oops, something went wrong.