-
-
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.
Miller/Vampire now show with Modifiers
- Loading branch information
Showing
21 changed files
with
613 additions
and
8 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
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,63 @@ | ||
module.exports = class MafiaInformation{ | ||
constructor(name, creator, game) { | ||
this.name = name; | ||
this.creator = creator; | ||
this.game = game; | ||
this.mainInfo = true; | ||
} | ||
|
||
processInfo(){ | ||
if(this.creator != null){ | ||
if(this.creator.hasEffect("TrueMode")){ | ||
if(!this.isTrue()){ | ||
this.makeTrue(); | ||
} | ||
} | ||
else if(this.creator.hasEffect("FalseMode")){ | ||
if(!this.isFalse()){ | ||
this.makeFalse(); | ||
} | ||
} | ||
else if(this.creator.hasEffect("UnfavorableMode")){ | ||
if(!this.isUnfavorable()){ | ||
this.makeUnfavorable(); | ||
} | ||
} | ||
else if(this.creator.hasEffect("FavorableMode")){ | ||
if(!this.isFavorable()){ | ||
this.makeFavorable(); | ||
} | ||
} | ||
} | ||
} | ||
|
||
getInfoRaw(){ | ||
this.game.events.emit("Information",this); | ||
} | ||
|
||
getInfoFormated(){ | ||
this.game.events.emit("Information",this); | ||
} | ||
|
||
isTrue() { | ||
return true; | ||
} | ||
isFalse() { | ||
return false; | ||
} | ||
isFavorable(){ | ||
return false; | ||
} | ||
isUnfavorable(){ | ||
return true; | ||
} | ||
|
||
makeTrue() { | ||
} | ||
makeFalse() { | ||
} | ||
makeFavorable(){ | ||
} | ||
makeUnfavorable(){ | ||
} | ||
}; |
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,8 @@ | ||
const Effect = require("../Effect"); | ||
|
||
module.exports = class FavorableMode extends Effect { | ||
constructor(lifespan) { | ||
super("FavorableMode"); | ||
this.lifespan = lifespan || Infinity; | ||
} | ||
}; |
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,8 @@ | ||
const Effect = require("../Effect"); | ||
|
||
module.exports = class TrueMode extends Effect { | ||
constructor(lifespan) { | ||
super("TrueMode"); | ||
this.lifespan = lifespan || Infinity; | ||
} | ||
}; |
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,8 @@ | ||
const Effect = require("../Effect"); | ||
|
||
module.exports = class UnfavorableMode extends Effect { | ||
constructor(lifespan) { | ||
super("UnfavorableMode"); | ||
this.lifespan = lifespan || Infinity; | ||
} | ||
}; |
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,108 @@ | ||
const Information = require("../Information"); | ||
const Random = require("../../../../lib/Random"); | ||
const { | ||
EVIL_FACTIONS, | ||
NOT_EVIL_FACTIONS, | ||
CULT_FACTIONS, | ||
MAFIA_FACTIONS, | ||
FACTION_LEARN_TEAM, | ||
FACTION_WIN_WITH_MAJORITY, | ||
FACTION_WITH_MEETING, | ||
FACTION_KILL, | ||
} = require("../const/FactionList"); | ||
|
||
module.exports = class AlignmentInfo extends Information{ | ||
constructor(creator, game, target) { | ||
super("Alignment Info", creator, game); | ||
if(target == null){ | ||
this.randomTarget = true; | ||
target = Random.randArrayVal(this.game.alivePlayers()); | ||
} | ||
this.target = target; | ||
let role = this.target.getAppearance("investigate", true); | ||
let trueRole = this.target.getAppearance("real", true); | ||
if(role = trueRole){ | ||
this.mainInfo = this.target.faction; | ||
} | ||
else{ | ||
this.mainInfo = game.getRoleAlignment(role); | ||
} | ||
} | ||
|
||
getInfoRaw(){ | ||
super.getInfoRaw(); | ||
return this.mainInfo; | ||
} | ||
|
||
getInfoFormated(){ | ||
super.getInfoRaw(); | ||
if(this.randomTarget == true){ | ||
return `You Learn that your ${this.target.name}'s Alignment is ${this.mainInfo}` | ||
} | ||
return `You Learn that your Target's Alignment is ${this.mainInfo}` | ||
} | ||
|
||
isTrue() { | ||
if(this.target.faction == this.mainInfo){ | ||
return true; | ||
} | ||
else{ | ||
return false; | ||
} | ||
} | ||
isFalse() { | ||
if(this.target.faction != this.mainInfo){ | ||
return true; | ||
} | ||
else{ | ||
return false; | ||
} | ||
} | ||
isFavorable(){ | ||
if(this.mainInfo != this.creator.faction){ | ||
return false; | ||
} | ||
else{ | ||
return true; | ||
} | ||
} | ||
isUnfavorable(){ | ||
if(this.mainInfo == this.creator.faction){ | ||
return false; | ||
} | ||
else{ | ||
return true; | ||
} | ||
} | ||
|
||
makeTrue() { | ||
this.mainInfo = this.target.faction; | ||
} | ||
makeFalse() { | ||
if(EVIL_FACTIONS.includes(this.target.faction) || (this.target.faction == "Independent" && this.game.getRoleTags(this.target.role.name).includes("Hostile"))){ | ||
this.mainInfo = "Village"; | ||
} | ||
else{ | ||
for(let player of this.game.players){ | ||
if(EVIL_FACTIONS.includes(player) && player.faction != this.target.faction){ | ||
this.mainInfo = player.faction; | ||
} | ||
} | ||
} | ||
} | ||
makeFavorable(){ | ||
this.mainInfo = this.creator.faction; | ||
} | ||
makeUnfavorable(){ | ||
if(EVIL_FACTIONS.includes(this.creator.faction) || (this.creator.faction == "Independent" && this.game.getRoleTags(this.creator.role.name).includes("Hostile"))){ | ||
this.mainInfo = "Village"; | ||
} | ||
else{ | ||
for(let player of this.game.players){ | ||
if(EVIL_FACTIONS.includes(player) && player.faction != this.creator.faction){ | ||
this.mainInfo = player.faction; | ||
} | ||
} | ||
} | ||
} | ||
}; |
Oops, something went wrong.