Skip to content

Commit 705c3ae

Browse files
authored
Finished 2nd person descriptions + bug fixes/role changes (UltiMafia#2577)
Superhero no longer gives a random power. Blessed now saves from heartbreak. Broken Jack-In-The-Boxes now do nothing.
1 parent 3e66bea commit 705c3ae

File tree

5 files changed

+294
-251
lines changed

5 files changed

+294
-251
lines changed

Games/types/Mafia/effects/Lovesick.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const Effect = require("../Effect");
2+
const Action = require("../Action");
23

34
module.exports = class Lovesick extends Effect {
45
constructor(lover) {
@@ -9,7 +10,19 @@ module.exports = class Lovesick extends Effect {
910
this.listeners = {
1011
death: function (player, killer, deathType, instant) {
1112
if (player == this.lover) {
12-
this.player.kill("love", this.lover, instant);
13+
var action = new Action({
14+
labels: ["kill", "hidden"],
15+
actor: this.lover,
16+
target: this.player,
17+
game: this.player.game,
18+
priority: 0,
19+
run: function () {
20+
if (this.dominates()){
21+
this.target.kill("love", this.lover, instant);
22+
}
23+
},
24+
});
25+
action.do();
1326
}
1427
},
1528
};

Games/types/Mafia/items/JackInTheBox.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ module.exports = class JackInTheBox extends Item {
3232
if (this.target == "None") return;
3333
this.item.drop("No");
3434

35+
if(this.item.broken || this.item.magicCult){
36+
return;
37+
}
38+
3539
let effect = this.actor.giveEffect(
3640
"ExtraRoleEffect",
3741
this.target,

Games/types/Mafia/roles/cards/GiveSuperpowers.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,32 @@ module.exports = class GiveSuperpowers extends Card {
88
super(role);
99

1010
this.dayShorten = 0;
11+
this.actions = [
12+
{
13+
priority: PRIORITY_INVESTIGATIVE_DEFAULT,
14+
run: function () {
15+
if (!this.actor.alive) return;
16+
if (this.game.getStateName() != "Dusk") return;
1117

18+
let teammates = this.game.players.filter(
19+
(p) =>
20+
this.game.getRoleAlignment(p.getRoleName()) == "Independent" &&
21+
!this.game
22+
.getRoleTags(
23+
this.game.formatRoleInternal(p.getRoleName(), p.role.modifier)
24+
)
25+
.includes("Lone")
26+
);
27+
28+
for (let v = 0; v < teammates.length; v++) {
29+
teammates
30+
.filter((p) => p)
31+
[v].holdItem("WackyJoinFactionMeeting", this.actor.role.name);
32+
}
33+
},
34+
}];
35+
36+
/*
1237
this.actions = [
1338
{
1439
priority: PRIORITY_INVESTIGATIVE_DEFAULT,
@@ -233,5 +258,6 @@ module.exports = class GiveSuperpowers extends Card {
233258
},
234259
},
235260
];
261+
*/
236262
}
237263
};

0 commit comments

Comments
 (0)