Skip to content

Commit a12aa47

Browse files
authored
Narcissistic fix (#2582)
1 parent 8d22e3f commit a12aa47

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

Games/types/Mafia/Action.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,28 @@ module.exports = class MafiaAction extends Action {
329329
}
330330
}
331331

332+
// for the secondary actions of actor to be on target
333+
redirectAllSecondaryActions(actor, target, label) {
334+
actor = actor || this.actor;
335+
target = target || this.target;
336+
337+
for (let action of this.game.actions[0]) {
338+
if (label && !action.hasLabel(label)) {
339+
continue;
340+
}
341+
342+
if (
343+
action.priority > this.priority &&
344+
!action.hasLabel("uncontrollable") &&
345+
!action.hasLabel("mafia") &&
346+
!action.hasLabel("primary") &&
347+
action.actor == actor
348+
) {
349+
action.setAllTargets(target);
350+
}
351+
}
352+
}
353+
332354
// for every action targeting originalTarget, make the action target newTarget
333355
redirectAllActionsOnTarget(originalTarget, newTarget, label) {
334356
originalTarget = originalTarget || this.target;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports = class TargetSelf50Percent extends Card {
1818
labels: ["block", "hidden", "absolute"],
1919
run: function () {
2020
if (Random.randInt(0, 1) == 0) {
21-
this.redirectAllActions(this.actor, this.actor);
21+
this.redirectAllSecondaryActions(this.actor, this.actor);
2222
}
2323
},
2424
},

0 commit comments

Comments
 (0)