-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementing D'Qar Cargo Frigate (#595)
 --------- Co-authored-by: AMMayberry1 <[email protected]>
- Loading branch information
1 parent
ad58d64
commit ba264ed
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import AbilityHelper from '../../../AbilityHelper'; | ||
import { NonLeaderUnitCard } from '../../../core/card/NonLeaderUnitCard'; | ||
|
||
export default class DQarCargoFrigate extends NonLeaderUnitCard { | ||
protected override getImplementationId() { | ||
return { | ||
id: '5422802110', | ||
internalName: 'dqar-cargo-frigate', | ||
}; | ||
} | ||
|
||
protected override setupCardAbilities() { | ||
this.addConstantAbility({ | ||
title: 'This unit gets -1/-0 for each damage on it.', | ||
ongoingEffect: AbilityHelper.ongoingEffects.modifyStats((target) => ({ | ||
power: -(target.damage), hp: 0 | ||
})) | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
describe('D\'Qar Cargo Frigate', function () { | ||
integration(function (contextRef) { | ||
it('D\'Qar Cargo Frigate\'s ability should give this unit gets -1/-0 for each damage on it', function () { | ||
contextRef.setupTest({ | ||
phase: 'action', | ||
player1: { | ||
spaceArena: ['dqar-cargo-frigate'] | ||
}, | ||
player2: { | ||
spaceArena: ['fetts-firespray#pursuing-the-bounty'] | ||
} | ||
}); | ||
|
||
const { context } = contextRef; | ||
|
||
expect(context.dqarCargoFrigate.damage).toBe(0); | ||
expect(context.dqarCargoFrigate.getPower()).toBe(6); | ||
|
||
context.player1.clickCard(context.dqarCargoFrigate); | ||
context.player1.clickCard(context.fettsFirespray); | ||
|
||
expect(context.player2).toBeActivePlayer(); | ||
expect(context.fettsFirespray).toBeInZone('discard'); | ||
expect(context.dqarCargoFrigate.damage).toBe(5); | ||
expect(context.dqarCargoFrigate.getPower()).toBe(1); | ||
}); | ||
}); | ||
}); |