Skip to content

Commit

Permalink
UPDATE: new Cherished Family Servant
Browse files Browse the repository at this point in the history
  • Loading branch information
lsocrate committed Dec 29, 2023
1 parent a8a882c commit cbd8061
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 83 deletions.
31 changes: 0 additions & 31 deletions server/game/cards/18.1-EL01/Scorpion/CherishedFamilyServant.js

This file was deleted.

25 changes: 25 additions & 0 deletions server/game/cards/18.1-EL01/Scorpion/CherishedFamilyServant.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import AbilityDsl from '../../../abilitydsl';
import { CardTypes, Locations, Players } from '../../../Constants';
import DrawCard from '../../../drawcard';

export default class CherishedFamilyServant extends DrawCard {
static id = 'cherished-family-servant';

setupCardAbilities() {
this.persistentEffect({
location: Locations.Any,
targetLocation: Locations.Any,
effect: AbilityDsl.effects.entersPlayForOpponent()
});

this.persistentEffect({
match: (card, context) =>
card.getType() === CardTypes.Attachment &&
card.hasTrait('poison') &&
card.parent &&
context.source.controller === card.parent.controller,
effect: AbilityDsl.effects.addKeyword('ancestral'),
targetController: Players.Any
});
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe('Cherished Family Servant', function() {
integration(function() {
beforeEach(function() {
describe('Cherished Family Servant', function () {
integration(function () {
beforeEach(function () {
this.setupTest({
phase: 'conflict',
player1: {
Expand Down Expand Up @@ -31,10 +31,12 @@ describe('Cherished Family Servant', function() {
this.player2.pass();
});

it('should enter play under the control of your opponent', function() {
it('should enter play under the control of your opponent', function () {
this.player1.clickCard(this.servant);
this.player1.clickPrompt('1');
expect(this.getChatLogs(1)).toContain('player1 plays Cherished Family Servant at home with 1 additional fate');
expect(this.getChatLogs(1)).toContain(
'player1 plays Cherished Family Servant at home with 1 additional fate'
);
expect(this.servant.controller.name).toBe(this.player2.name);
this.player2.clickCard(this.jade);
expect(this.player2).toBeAbleToSelect(this.mystic);
Expand All @@ -45,7 +47,7 @@ describe('Cherished Family Servant', function() {
expect(this.jade.location).toBe('play area');
});

it('should give poison attachmenst ancestral when dire', function() {
it('should give poison attachments on friendly characters ancestral', function () {
this.player1.clickCard(this.servant);
this.player1.clickPrompt('0');

Expand All @@ -63,51 +65,5 @@ describe('Cherished Family Servant', function() {
this.player1.clickCard(this.mystic);
expect(this.madness.location).toBe('hand');
});

it('should not give poison attachmenst ancestral when not dire', function() {
this.player1.clickCard(this.servant);
this.player1.clickPrompt('1');

expect(this.madness.hasKeyword('ancestral')).toBe(false);
expect(this.koku.hasKeyword('ancestral')).toBe(false);

this.noMoreActions();
this.initiateConflict({
type: 'military',
attackers: [this.shugenja],
defenders: [this.mystic]
});
this.player2.pass();
this.player1.clickCard(this.assassination);
this.player1.clickCard(this.mystic);
expect(this.madness.location).toBe('conflict discard pile');
});

it('should not lose fate or be discarded during the fate phase when not dishonored', function() {
this.player1.clickCard(this.servant);
this.player1.clickPrompt('1');

this.servantFate = this.servant.fate;

this.advancePhases('fate');

this.player1.clickPrompt('Done');
this.player2.clickPrompt('Done');
expect(this.servant.fate).toBe(this.servantFate);
});

it('should lose fate during the fate phase when dishonored', function() {
this.player1.clickCard(this.servant);
this.player1.clickPrompt('1');
this.servant.dishonor();

this.servantFate = this.servant.fate;

this.advancePhases('fate');

this.player1.clickPrompt('Done');
this.player2.clickPrompt('Done');
expect(this.servant.fate).toBe(this.servantFate - 1);
});
});
});

0 comments on commit cbd8061

Please sign in to comment.