-
Notifications
You must be signed in to change notification settings - Fork 0
/
PriestTests.js
73 lines (70 loc) · 2.48 KB
/
PriestTests.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
tests.testLesserHeal = function() {
var p1 = new Player([], new Priest());
var p2 = new Player([], new Mage());
var game = new Hearthstone([p1, p2], 0);
p1.currentMana = 2;
assert(29, p1.hero.hp);
p1.turn.useHeroPower(p1.hero);
assert(30, p1.hero.hp);
};
tests.testPowerWordShield = function() {
var p1 = new Player([], new Priest());
var p2 = new Player([], new Mage());
var game = new Hearthstone([p1, p2], 0);
p1.hand.push(NeutralCards.StonetuskBoar.copy());
p1.hand.push(PriestCards.PowerWordShield.copy());
p1.currentMana = 2;
p1.turn.playCard(p1.hand[0], 0);
assert(1, p1.minions[0].currentHp);
assert(29, p1.hero.hp);
p1.turn.playCard(p1.hand[0], undefined, p1.minions[0]);
assert(3, p1.minions[0].currentHp);
assert(27, p1.hero.hp);
};
tests.testInnerFire = function() {
var p1 = new Player([], new Priest());
var p2 = new Player([], new Mage());
var game = new Hearthstone([p1, p2], 0);
p1.hand.push(NeutralCards.SludgeBelcher.copy());
p1.hand.push(PriestCards.InnerFire.copy());
p1.currentMana = 6;
p1.turn.playCard(p1.hand[0], 0);
assert(3, p1.minions[0].getCurrentAttack());
p1.turn.playCard(p1.hand[0], undefined, p1.minions[0]);
assert(5, p1.minions[0].getCurrentAttack());
};
tests.testShadowMadness = function() {
var p1 = new Player([], new Paladin());
var p2 = new Player([], new Priest());
var game = new Hearthstone([p1, p2], 0);
p1.hand.push(NeutralCards.SludgeBelcher.copy());
p1.hand.push(NeutralCards.MogushanWarden.copy());
p1.currentMana = 11;
p1.turn.playCard(p1.hand[0], 0);
p1.turn.playCard(p1.hand[0], 1);
p1.turn.endTurn();
p2.hand.push(PriestCards.ShadowMadness.copy());
p2.currentMana = 4;
assert(0, p2.minions.length);
assert(2, p1.minions.length);
// Attempt to control the Sludge Belcher but fail.
p2.turn.playCard(p2.hand[1], undefined, p1.minions[0]);
assert(0, p2.minions.length);
assert(2, p1.minions.length);
assert(4, p2.currentMana);
// Control Mogushan Warden.
p2.turn.playCard(p2.hand[1], undefined, p1.minions[1]);
assert(1, p2.minions.length);
assert(1, p1.minions.length);
assert(0, p2.currentMana);
// Run Mogushan Warden into Sludge Belcher.
assert(7, p2.minions[0].currentHp);
assert(5, p1.minions[0].currentHp);
p2.turn.minionAttack(p2.minions[0], p1.minions[0]);
assert(4, p2.minions[0].currentHp);
assert(4, p1.minions[0].currentHp);
p2.turn.endTurn();
// Verify Mogushan Warden returns to player 1.
assert(0, p2.minions.length);
assert(2, p1.minions.length);
};