@reldens/skills 0.26.0 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/skill.js
CHANGED
|
@@ -41,6 +41,7 @@ class Skill
|
|
|
41
41
|
// this.failChanceCallback = () => {}; // a callback to customize the fail chance calculation.
|
|
42
42
|
this.castTime = sc.get(props, 'castTime', 0);
|
|
43
43
|
this.owner.isCasting = false;
|
|
44
|
+
this.owner.castingTimer = false;
|
|
44
45
|
this.isValid = true;
|
|
45
46
|
this.usesLimit = sc.get(props, 'usesLimit', 0);
|
|
46
47
|
this.uses = 0;
|
|
@@ -95,10 +96,10 @@ class Skill
|
|
|
95
96
|
if(!this.validateConditions()){
|
|
96
97
|
return false;
|
|
97
98
|
}
|
|
98
|
-
if(this.usesLimit
|
|
99
|
+
if(0 < this.usesLimit && this.uses >= this.usesLimit){
|
|
99
100
|
return false;
|
|
100
101
|
}
|
|
101
|
-
if(this.skillDelay
|
|
102
|
+
if(0 < this.skillDelay){
|
|
102
103
|
this.canActivate = false;
|
|
103
104
|
this.skillActivationTimer = setTimeout(()=> {
|
|
104
105
|
this.canActivate = true;
|
|
@@ -195,7 +196,8 @@ class Skill
|
|
|
195
196
|
}
|
|
196
197
|
if(0 < this.castTime){
|
|
197
198
|
await this.fireEvent(SkillsEvents.SKILL_BEFORE_CAST, this, target);
|
|
198
|
-
this.owner.isCasting =
|
|
199
|
+
this.owner.isCasting = true;
|
|
200
|
+
this.owner.castingTimer = setTimeout(() => {
|
|
199
201
|
skillLogicResult = this.finishExecution(target);
|
|
200
202
|
this.owner.isCasting = false;
|
|
201
203
|
this.fireEvent(SkillsEvents.SKILL_AFTER_CAST, this, target, skillLogicResult);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reldens/skills",
|
|
3
3
|
"scope": "@reldens",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.27.0",
|
|
5
5
|
"description": "Reldens - Skills",
|
|
6
6
|
"author": "Damian A. Pastorini",
|
|
7
7
|
"license": "MIT",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@reldens/modifiers": "^0.22.0",
|
|
44
|
-
"@reldens/storage": "^0.
|
|
45
|
-
"@reldens/utils": "^0.
|
|
44
|
+
"@reldens/storage": "^0.25.0",
|
|
45
|
+
"@reldens/utils": "^0.33.0"
|
|
46
46
|
}
|
|
47
47
|
}
|