Skip to content

Commit

Permalink
Fix Coinneach Ken Carn + discard prompt (#1606)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmeldo authored Nov 4, 2023
1 parent d133c30 commit c079e0d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
3 changes: 2 additions & 1 deletion server/game/Constants/Factions.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ const Factions = {
Anarchists: 'anarchists',
FirstPeoples: '1stpeoples',
Entrepreneurs: 'entrepreneurs',
Fearmongers: 'fearmongers'
Fearmongers: 'fearmongers',
Drifters: 'neutral'
};

module.exports = Factions;
8 changes: 6 additions & 2 deletions server/game/cards/17-DofB/CoinneachKenCarn.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const Factions = require('../../Constants/Factions.js');
const DudeCard = require('../../dudecard.js');
/** @typedef {import('../../AbilityDsl')} AbilityDsl */

Expand All @@ -17,11 +18,14 @@ class CoinneachKenCarn extends DudeCard {
const dudes = this.controller.cardsInPlay.filter(card => card.getType() === 'dude');
const factions = [];
dudes.forEach(dude => {
if(!factions.includes(dude.gang_code[0])) {
if(dude.gang_code[0] !== Factions.Drifters && !factions.includes(dude.gang_code[0])) {
factions.push(dude.gang_code[0]);
}
});
const multiFactionDudes = dudes.filter(dude => dude.gang_code.length > 1);
const multiFactionDudes = dudes.filter(dude => {
const dudeMultiFactions = dude.gang_code.filter(code => code !== Factions.Drifters);
return dudeMultiFactions > 1;
});
let remainingMultiFactions = [];
for(const dude of multiFactionDudes) {
const dudeFactions = dude.gang_code.filter(code => !factions.includes(code));
Expand Down
7 changes: 1 addition & 6 deletions server/game/gamesteps/nightfall/discardprompt.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
const PlayerOrderPrompt = require('../playerorderprompt.js');

class DiscardPrompt extends PlayerOrderPrompt {
constructor(game) {
super(game);
this.selectedCards = [];
}

continue() {
if(!this.isComplete()) {
if(this.currentPlayer.discardAllDuringNightfall()) {
Expand Down Expand Up @@ -56,7 +51,7 @@ class DiscardPrompt extends PlayerOrderPrompt {
}

noDiscard(player) {
this.game.addMessage('{0} does not discard any card as part of Nightfall', player);
this.game.queueSimpleStep(() => this.game.addMessage('{0} does not discard any card as part of Nightfall', player));
this.completePlayer();
}
}
Expand Down

0 comments on commit c079e0d

Please sign in to comment.