Skip to content

Commit 7e2b580

Browse files
committed
Don't make skills deduct resource cost if skill exits
1 parent 544a314 commit 7e2b580

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

src/Skill.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,21 +98,22 @@ class Skill {
9898
}
9999
}
100100

101-
if (this.resource.cost) {
102-
const paid = this.payResourceCost(player);
103-
if (!paid) {
104-
return false;
105-
}
106-
}
107-
108101
if (this.initiatesCombat) {
109102
player.initiateCombat(target);
110103
}
111104

112105
// allow skills to not incur the cooldown if they return false in run
113106
if (this.run(args, player, target) !== false) {
107+
if (this.resource.cost) {
108+
const paid = this.payResourceCost(player);
109+
if (!paid) {
110+
return false;
111+
}
112+
}
113+
114114
this.cooldown(player);
115115
}
116+
116117
return true;
117118
}
118119

0 commit comments

Comments
 (0)