@rpg-engine/long-bow 0.6.54 → 0.6.55

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpg-engine/long-bow",
3
- "version": "0.6.54",
3
+ "version": "0.6.55",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -13,6 +13,7 @@ export interface ISkillProgressBarProps {
13
13
  skillPoints: number;
14
14
  texturePath: string;
15
15
  showSkillPoints?: boolean;
16
+ skillPointsToNextLevel: number;
16
17
  atlasJSON: any;
17
18
  atlasIMG: any;
18
19
  buffAndDebuff?: number;
@@ -23,6 +24,7 @@ export const SkillProgressBar: React.FC<ISkillProgressBarProps> = ({
23
24
  skillName,
24
25
  level,
25
26
  skillPoints: currentSkillPoints,
27
+ skillPointsToNextLevel,
26
28
  texturePath,
27
29
  showSkillPoints = true,
28
30
  atlasIMG,
@@ -33,7 +35,7 @@ export const SkillProgressBar: React.FC<ISkillProgressBarProps> = ({
33
35
  const baseSkillPointsPrevLevel = level > 1 ? getSPForLevel(level - 1) : 0;
34
36
 
35
37
  // Total skill points needed for the next level
36
- const nextLevelSkillPoints = getSPForLevel(level + 1);
38
+ const nextLevelSkillPoints = skillPointsToNextLevel;
37
39
 
38
40
  // Calculate excess skill points above the previous level
39
41
  const excessSkillPoints = Math.max(
@@ -1,4 +1,9 @@
1
- import { ISkill, ISkillDetails } from '@rpg-engine/shared';
1
+ import {
2
+ ISkill,
3
+ ISkillDetails,
4
+ calculateSPToNextLevel,
5
+ getXPForLevel,
6
+ } from '@rpg-engine/shared';
2
7
  import React from 'react';
3
8
  import styled from 'styled-components';
4
9
  import { uiColors } from '../constants/uiColors';
@@ -105,6 +110,11 @@ export const SkillsContainer: React.FC<ISkillContainerProps> = ({
105
110
  continue;
106
111
  }
107
112
 
113
+ const skillPointsToNextLevel = calculateSPToNextLevel(
114
+ skillDetails.skillPoints,
115
+ skillDetails.level
116
+ );
117
+
108
118
  output.push(
109
119
  <SkillProgressBar
110
120
  key={key}
@@ -112,6 +122,7 @@ export const SkillsContainer: React.FC<ISkillContainerProps> = ({
112
122
  bgColor={skillCategoryColor}
113
123
  level={skillDetails.level || 0}
114
124
  skillPoints={Math.round(skillDetails.skillPoints) || 0}
125
+ skillPointsToNextLevel={skillPointsToNextLevel}
115
126
  texturePath={value}
116
127
  atlasIMG={atlasIMG}
117
128
  atlasJSON={atlasJSON}
@@ -143,6 +154,9 @@ export const SkillsContainer: React.FC<ISkillContainerProps> = ({
143
154
  bgColor={uiColors.navyBlue}
144
155
  level={Math.round(skill.level) || 0}
145
156
  skillPoints={Math.round(skill.experience) || 0}
157
+ skillPointsToNextLevel={
158
+ Math.round(getXPForLevel(skill.level + 1)) || 0
159
+ }
146
160
  texturePath={'swords/broad-sword.png'}
147
161
  atlasIMG={atlasIMG}
148
162
  atlasJSON={atlasJSON}