Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Card: TSs - All Or Nothing #1631

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/cardpool-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@
|:heavy_check_mark: | 17018| Calling The Cavalry
| | 17019| Rite Of Profane Abstersion
|:heavy_multiplication_x:| 17020| Showboating
| | 17021| All Or Nothing
|:heavy_check_mark: | 17021| All Or Nothing

## `10-BMR` Blood Moon Rising

Expand Down
44 changes: 44 additions & 0 deletions server/game/cards/09.3-TSs/AllOrNothing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
const ActionCard = require('../../actioncard.js');

class AllOrNothing extends ActionCard {
setupCardAbilities() {
this.job({
title: 'All Or Nothing',
playType: 'noon',
target: {
activePromptTitle: 'Select location',
cardCondition: { location: 'play area' },
cardType: ['location']
},
message: context => this.game.addMessage('{0} plays {1} marking {2}.',
this.owner, this, context.target),
onSuccess: (job, context) => {
let messg = "{0} uses {1}";
const NofAtts = job.mark.attachments.length;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use camelCase on var names, so they can avoid being mistaken for ClassNames

if(NofAtts > 0) {
context.player.discardCards(job.mark.attachments, () => {
messg += " to discard " + NofAtts + " attachments";
}, { isCardEffect: true }, context);
}
if(['deed','townsquare'].includes(job.mark.getType())) {
const chasedDudes = job.mark.getDudes(dude => dude.isWanted() || dude.hasKeyword('abomination'));
const NofBadDudes = chasedDudes.length;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use camelCase on var names, so they can avoid being mistaken for ClassNames

context.player.discardCards(chasedDudes, () => {
messg += (NofAtts?" and ":" to discard ") + NofBadDudes + " dudes from {2}";
}, { isCardEffect: true }, context);
} else if(NofAtts > 0) {
messg += " from {2}";
} else {
messg += " on {2} to no notable effect";
}
this.game.queueSimpleStep(() => {
this.game.addMessage(messg, this.owner, this, job.mark);
});
}
});
}
}

AllOrNothing.code = '17021';

module.exports = AllOrNothing;
Loading