@reldens/skills 0.26.0 → 0.28.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.
@@ -19,7 +19,7 @@ class SkillOwnerConditionsModel extends ObjectionJsRawModel
19
19
  {
20
20
  const { SkillModel } = require('./skill-model');
21
21
  return {
22
- parent_level: {
22
+ parent_skill: {
23
23
  relation: this.BelongsToOneRelation,
24
24
  modelClass: SkillModel,
25
25
  join: {
@@ -19,7 +19,7 @@ class SkillOwnerEffectsModel extends ObjectionJsRawModel
19
19
  {
20
20
  const { SkillModel } = require('./skill-model');
21
21
  return {
22
- parent_level: {
22
+ parent_skill: {
23
23
  relation: this.BelongsToOneRelation,
24
24
  modelClass: SkillModel,
25
25
  join: {
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 > 0 && this.uses >= this.usesLimit){
99
+ if(0 < this.usesLimit && this.uses >= this.usesLimit){
99
100
  return false;
100
101
  }
101
- if(this.skillDelay > 0){
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 = setTimeout(() => {
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.26.0",
4
+ "version": "0.28.0",
5
5
  "description": "Reldens - Skills",
6
6
  "author": "Damian A. Pastorini",
7
7
  "license": "MIT",
@@ -40,8 +40,8 @@
40
40
  "url": "https://github.com/damian-pastorini/reldens-skills/issues"
41
41
  },
42
42
  "dependencies": {
43
- "@reldens/modifiers": "^0.22.0",
44
- "@reldens/storage": "^0.20.0",
45
- "@reldens/utils": "^0.30.0"
43
+ "@reldens/modifiers": "^0.23.0",
44
+ "@reldens/storage": "^0.27.0",
45
+ "@reldens/utils": "^0.35.0"
46
46
  }
47
47
  }