@rpg-engine/long-bow 0.6.18 → 0.6.19
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/components/SkillProgressBar.d.ts +0 -1
- package/dist/long-bow.cjs.development.js +13797 -664
- 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 +13797 -664
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +6 -6
- package/src/components/SkillProgressBar.tsx +3 -2
- package/src/components/SkillsContainer.tsx +7 -29
- package/src/mocks/atlas/icons/icons.json +3927 -735
- package/src/mocks/atlas/icons/icons.png +0 -0
- package/src/mocks/atlas/items/items.json +25238 -12086
- package/src/mocks/atlas/items/items.png +0 -0
- package/src/mocks/skills.mocks.ts +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rpg-engine/long-bow",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.19",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@babel/core": "^7.17.7",
|
|
58
58
|
"@size-limit/preset-small-lib": "^7.0.8",
|
|
59
|
-
"@storybook/addon-essentials": "
|
|
60
|
-
"@storybook/addon-info": "
|
|
61
|
-
"@storybook/addon-links": "
|
|
62
|
-
"@storybook/addons": "
|
|
63
|
-
"@storybook/react": "
|
|
59
|
+
"@storybook/addon-essentials": "6.5.10",
|
|
60
|
+
"@storybook/addon-info": "5.3.21",
|
|
61
|
+
"@storybook/addon-links": "6.5.10",
|
|
62
|
+
"@storybook/addons": "6.5.10",
|
|
63
|
+
"@storybook/react": "6.5.10",
|
|
64
64
|
"@types/react": "^18.0.14",
|
|
65
65
|
"@types/react-dom": "^18.0.5",
|
|
66
66
|
"@types/styled-components": "^5.1.24",
|
|
@@ -17,7 +17,6 @@ export interface ISkillProgressBarProps {
|
|
|
17
17
|
atlasJSON: any;
|
|
18
18
|
atlasIMG: any;
|
|
19
19
|
buffAndDebuff?: number;
|
|
20
|
-
ratio: number;
|
|
21
20
|
}
|
|
22
21
|
|
|
23
22
|
export const SkillProgressBar: React.FC<ISkillProgressBarProps> = ({
|
|
@@ -31,12 +30,14 @@ export const SkillProgressBar: React.FC<ISkillProgressBarProps> = ({
|
|
|
31
30
|
atlasIMG,
|
|
32
31
|
atlasJSON,
|
|
33
32
|
buffAndDebuff,
|
|
34
|
-
ratio,
|
|
35
33
|
}) => {
|
|
36
34
|
if (!skillPointsToNextLevel) {
|
|
37
35
|
skillPointsToNextLevel = getSPForLevel(level + 1);
|
|
38
36
|
}
|
|
39
37
|
|
|
38
|
+
// Calculate the ratio, ensuring it doesn't exceed 100%
|
|
39
|
+
const ratio = Math.min((skillPoints / skillPointsToNextLevel) * 100, 100);
|
|
40
|
+
|
|
40
41
|
const skillsBuffsCalc = (level: number, buffAndDebuff: number): string => {
|
|
41
42
|
const result = level * (buffAndDebuff / 100);
|
|
42
43
|
|
|
@@ -22,12 +22,12 @@ const skillProps = {
|
|
|
22
22
|
attributes: {
|
|
23
23
|
color: uiColors.purple,
|
|
24
24
|
values: {
|
|
25
|
-
stamina: '
|
|
26
|
-
magic: '
|
|
27
|
-
magicResistance: '
|
|
28
|
-
strength: '
|
|
29
|
-
resistance: '
|
|
30
|
-
dexterity: '
|
|
25
|
+
stamina: 'staffs/doom-staff.png',
|
|
26
|
+
magic: 'helmets/yellow-enchanter-hat.png',
|
|
27
|
+
magicResistance: 'gems/amethyst-gem.png',
|
|
28
|
+
strength: 'crafting-resources/dragon-tooth.png',
|
|
29
|
+
resistance: 'books/magic-orb.png',
|
|
30
|
+
dexterity: 'boots/gaias-soleplate.png',
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
33
|
combat: {
|
|
@@ -46,7 +46,7 @@ const skillProps = {
|
|
|
46
46
|
color: uiColors.blue,
|
|
47
47
|
values: {
|
|
48
48
|
fishing: 'foods/fish.png',
|
|
49
|
-
farming: '
|
|
49
|
+
farming: 'tools/watering-can.png',
|
|
50
50
|
mining: 'crafting-resources/iron-ingot.png',
|
|
51
51
|
lumberjacking: 'crafting-resources/greater-wooden-log.png',
|
|
52
52
|
blacksmithing: 'hammers/hammer.png',
|
|
@@ -90,26 +90,6 @@ export const SkillsContainer: React.FC<ISkillContainerProps> = ({
|
|
|
90
90
|
atlasJSON,
|
|
91
91
|
scale,
|
|
92
92
|
}) => {
|
|
93
|
-
const SPRatio = (level: number, skillPoints: number) => {
|
|
94
|
-
const SPLevelActual = getSPForLevel(level + 1);
|
|
95
|
-
const SPLevelBefore = getSPForLevel(level);
|
|
96
|
-
const SPCalc = SPLevelActual - SPLevelBefore;
|
|
97
|
-
if (level === 1) {
|
|
98
|
-
return (skillPoints / SPLevelActual) * 100;
|
|
99
|
-
}
|
|
100
|
-
return ((skillPoints - SPLevelBefore) / SPCalc) * 100;
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
const XPRatio = (level: number, skillPoints: number) => {
|
|
104
|
-
const XPLevelActual = getXPForLevel(level + 1);
|
|
105
|
-
const XPLevelBefore = getXPForLevel(level);
|
|
106
|
-
const XPCalc = XPLevelActual - XPLevelBefore;
|
|
107
|
-
if (level === 1) {
|
|
108
|
-
return (skillPoints / XPLevelActual) * 100;
|
|
109
|
-
}
|
|
110
|
-
return ((skillPoints - XPLevelBefore) / XPCalc) * 100;
|
|
111
|
-
};
|
|
112
|
-
|
|
113
93
|
const onRenderSkillCategory = (
|
|
114
94
|
category: 'attributes' | 'combat' | 'crafting'
|
|
115
95
|
) => {
|
|
@@ -144,7 +124,6 @@ export const SkillsContainer: React.FC<ISkillContainerProps> = ({
|
|
|
144
124
|
atlasIMG={atlasIMG}
|
|
145
125
|
atlasJSON={atlasJSON}
|
|
146
126
|
buffAndDebuff={skillDetails.buffAndDebuff}
|
|
147
|
-
ratio={SPRatio(skillDetails.level, skillDetails.skillPoints)}
|
|
148
127
|
/>
|
|
149
128
|
);
|
|
150
129
|
}
|
|
@@ -178,7 +157,6 @@ export const SkillsContainer: React.FC<ISkillContainerProps> = ({
|
|
|
178
157
|
texturePath={'swords/broad-sword.png'}
|
|
179
158
|
atlasIMG={atlasIMG}
|
|
180
159
|
atlasJSON={atlasJSON}
|
|
181
|
-
ratio={XPRatio(skill.level, skill.experience)}
|
|
182
160
|
/>
|
|
183
161
|
|
|
184
162
|
<p>Combat Skills</p>
|