Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Fix Regal Bearing message (#3859)
Browse files Browse the repository at this point in the history
* Fix Regal Bearing message

It used the number of the dials before they would be changed by Regal Bearing

* Fix code style
  • Loading branch information
The-Outcast authored and marcsoiferman-cm committed Dec 30, 2019
1 parent 92993a8 commit 0df25f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/game/cards/09.4-TCoH/RegalBearing.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ class RegalBearing extends DrawCard {
return 0;
}

return Math.abs(context.player.showBid - context.player.opponent.showBid);
// Players honor bid will be one but this is calculated before dials are changed.
return Math.abs(1 - context.player.opponent.showBid);
}
}

Expand Down
4 changes: 4 additions & 0 deletions test/server/cards/09.4-TCoH/RegalBearing.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ describe('Regal Bearing', function() {
this.player2.pass();
this.player1.clickCard(this.regalBearing);

expect(this.getChatLogs(5)).toContain('player1 plays Regal Bearing to set their bid dial to 1 and draw 4 cards.');
expect(this.player1.hand.length).toBe(4);
expect(this.fineKatana.location).toBe('hand');
expect(this.ornateFan.location).toBe('hand');
Expand All @@ -98,6 +99,7 @@ describe('Regal Bearing', function() {

this.player1.clickCard(this.regalBearing);

expect(this.getChatLogs(5)).toContain('player1 plays Regal Bearing to set their bid dial to 1 and draw 4 cards.');
expect(this.player1.player.showBid).toBe(1);
expect(this.player1.hand.length).toBe(5);
expect(this.fineKatana.location).toBe('hand');
Expand Down Expand Up @@ -159,6 +161,8 @@ describe('Regal Bearing', function() {
this.player1.clickPrompt('1');
this.player2.clickPrompt('1');

expect(this.getChatLogs(10)).not.toContain('player1 plays Regal Bearing to set their bid dial to 1 and draw 4 cards.');
expect(this.getChatLogs(10)).not.toContain('player1 plays Regal Bearing to set their bid dial to 1 and draw 0 cards.');
expect(this.player1.hand.length).toBe(1);
expect(this.fineKatana.location).toBe('conflict deck');
expect(this.ornateFan.location).toBe('conflict deck');
Expand Down

0 comments on commit 0df25f4

Please sign in to comment.