@rpg-engine/long-bow 0.8.83 → 0.8.84
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/dist/long-bow.cjs.development.js +10 -7
- package/dist/long-bow.cjs.development.js.map +1 -1
- package/dist/long-bow.cjs.production.min.js +1 -1
- package/dist/long-bow.cjs.production.min.js.map +1 -1
- package/dist/long-bow.esm.js +10 -7
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/SkillProgressBar.tsx +11 -7
- package/src/mocks/skills.mocks.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rpg-engine/long-bow",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.84",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"dependencies": {
|
|
85
85
|
"@capacitor/core": "^6.1.0",
|
|
86
86
|
"@rollup/plugin-image": "^2.1.1",
|
|
87
|
-
"@rpg-engine/shared": "^0.10.
|
|
87
|
+
"@rpg-engine/shared": "^0.10.33",
|
|
88
88
|
"dayjs": "^1.11.2",
|
|
89
89
|
"font-awesome": "^4.7.0",
|
|
90
90
|
"fs-extra": "^10.1.0",
|
|
@@ -54,7 +54,7 @@ export const SkillProgressBar: React.FC<ISkillProgressBarProps> = ({
|
|
|
54
54
|
|
|
55
55
|
const { A, b, c } = getSkillConstants(skillKey, effectiveClass);
|
|
56
56
|
const actualLevel = Math.floor(getLevelFromSP(currentSkillPoints, A, b, c));
|
|
57
|
-
return Math.max(
|
|
57
|
+
return Math.max(1, actualLevel); // Minimum level is always 1 in our system
|
|
58
58
|
};
|
|
59
59
|
|
|
60
60
|
const effectiveLevel = calculateEffectiveLevel();
|
|
@@ -72,13 +72,17 @@ export const SkillProgressBar: React.FC<ISkillProgressBarProps> = ({
|
|
|
72
72
|
|
|
73
73
|
const { A, b, c } = getSkillConstants(skillKey, effectiveClass);
|
|
74
74
|
|
|
75
|
-
//
|
|
76
|
-
const
|
|
77
|
-
const
|
|
75
|
+
// Get the actual calculated level (might be 0 for magic)
|
|
76
|
+
const actualLevel = Math.floor(getLevelFromSP(currentSkillPoints, A, b, c));
|
|
77
|
+
const calcLevel = Math.max(c, actualLevel); // Use c as minimum for calculation
|
|
78
|
+
|
|
79
|
+
// Calculate SP thresholds based on actual position
|
|
80
|
+
const spForCalcLevel = getSPForLevelExponential(calcLevel, A, b, c);
|
|
81
|
+
const spForNextLevel = getSPForLevelExponential(calcLevel + 1, A, b, c);
|
|
78
82
|
|
|
79
|
-
// Progress within current
|
|
80
|
-
const range = spForNextLevel -
|
|
81
|
-
const progressInLevel = currentSkillPoints -
|
|
83
|
+
// Progress within current level range
|
|
84
|
+
const range = spForNextLevel - spForCalcLevel;
|
|
85
|
+
const progressInLevel = currentSkillPoints - spForCalcLevel;
|
|
82
86
|
|
|
83
87
|
return Math.min(100, Math.max(0, (progressInLevel / Math.max(1, range)) * 100));
|
|
84
88
|
};
|