Skip to content

Commit 5a64da2

Browse files
authored
Update Action.js
1 parent 8d22e3f commit 5a64da2

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
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;

0 commit comments

Comments
 (0)