@reldens/skills 0.12.1 → 0.13.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.
@@ -52,8 +52,8 @@ class Sender
52
52
  if(nextLevelExp > 0){
53
53
  messageData.ne = nextLevelExp;
54
54
  }
55
- // @NOTE: we could send just this.currentLabel but better check if there's an specific one for this level
56
- // and don't send extra information we already have on the client.
55
+ // @NOTE: we could send just this.currentLabel but better check if there's a specific one for this level and
56
+ // don't send extra information we already have on the client.
57
57
  if(classPath.labelsByLevel[classPath.currentLevel]){
58
58
  messageData.nl = classPath.labelsByLevel[classPath.currentLevel];
59
59
  }
@@ -121,9 +121,7 @@ class Sender
121
121
 
122
122
  async onSkillAttachApplyDamage(skill, target, damage, newValue)
123
123
  {
124
- let messageData = {
125
- d: damage
126
- };
124
+ let messageData = {d: damage};
127
125
  if(typeof skill.owner.getSkillExtraData === 'function'){
128
126
  Object.assign(messageData, {extraData: skill.owner.getSkillExtraData({skill, target})});
129
127
  }
@@ -137,7 +135,7 @@ class Sender
137
135
 
138
136
  async runBehaviors(messageData, actionName, behavior, ownerId)
139
137
  {
140
- // @NOTE: since the sender is a new instance for each SkillsServer but it's listening on a single EventsManager
138
+ // @NOTE: since the sender is a new instance for each SkillsServer, but it's listening on a single EventsManager
141
139
  // which fires the event for every player then we need to check if the current event fired was related to the
142
140
  // current player.
143
141
  if(this.classPath.getOwnerId() !== ownerId){
@@ -81,8 +81,8 @@ class Attack extends Skill
81
81
  let modifiedValue = (!this.allowEffectBelowZero && affectedPropertyValue < damage)
82
82
  ? 0
83
83
  : affectedPropertyValue - damage;
84
- await this.fireEvent(SkillsEvents.SKILL_ATTACK_APPLY_DAMAGE, this, target, damage, modifiedValue);
85
84
  this.setAffectedPropertyValue(target, modifiedValue);
85
+ await this.fireEvent(SkillsEvents.SKILL_ATTACK_APPLY_DAMAGE, this, target, damage, modifiedValue);
86
86
  }
87
87
 
88
88
  calculateCriticalDamage(damage, targetDodge, ownerAim, dodgeAimDiff)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@reldens/skills",
3
3
  "scope": "@reldens",
4
- "version": "0.12.1",
4
+ "version": "0.13.0",
5
5
  "description": "Reldens - Skills",
6
6
  "author": "Damian A. Pastorini",
7
7
  "license": "MIT",