@rpg-engine/long-bow 0.4.83 → 0.4.85
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 +1 -0
- package/dist/long-bow.cjs.development.js +27 -8
- 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 +28 -9
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/SkillProgressBar.tsx +3 -5
- package/src/components/SkillsContainer.tsx +32 -3
- package/src/mocks/skills.mocks.ts +6 -6
package/dist/long-bow.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { Component, useState, useEffect, useRef, useMemo, Fragment } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
-
import { GRID_WIDTH, GRID_HEIGHT, ShortcutType, getItemTextureKeyPath, ItemContainerType, ItemType, DepotSocketEvents, ItemSocketEvents, ItemSocketEventsDisplayLabels, ActionsForInventory, ActionsForEquipmentSet, ActionsForLoot, ActionsForMapContainer, ItemRarities, ItemSubType, ItemSlotType, isMobileOrTablet, getSPForLevel, PeriodOfDay } from '@rpg-engine/shared';
|
|
3
|
+
import { GRID_WIDTH, GRID_HEIGHT, ShortcutType, getItemTextureKeyPath, ItemContainerType, ItemType, DepotSocketEvents, ItemSocketEvents, ItemSocketEventsDisplayLabels, ActionsForInventory, ActionsForEquipmentSet, ActionsForLoot, ActionsForMapContainer, ItemRarities, ItemSubType, ItemSlotType, isMobileOrTablet, getSPForLevel, getXPForLevel, PeriodOfDay } from '@rpg-engine/shared';
|
|
4
4
|
import dayjs from 'dayjs';
|
|
5
5
|
import { ErrorBoundary as ErrorBoundary$1 } from 'react-error-boundary';
|
|
6
6
|
import { RxPaperPlane } from 'react-icons/rx';
|
|
@@ -16679,12 +16679,11 @@ var SkillProgressBar = function SkillProgressBar(_ref) {
|
|
|
16679
16679
|
showSkillPoints = _ref$showSkillPoints === void 0 ? true : _ref$showSkillPoints,
|
|
16680
16680
|
atlasIMG = _ref.atlasIMG,
|
|
16681
16681
|
atlasJSON = _ref.atlasJSON,
|
|
16682
|
-
buffAndDebuff = _ref.buffAndDebuff
|
|
16682
|
+
buffAndDebuff = _ref.buffAndDebuff,
|
|
16683
|
+
ratio = _ref.ratio;
|
|
16683
16684
|
if (!skillPointsToNextLevel) {
|
|
16684
16685
|
skillPointsToNextLevel = getSPForLevel(level + 1);
|
|
16685
16686
|
}
|
|
16686
|
-
var nextLevelSPWillbe = skillPoints + skillPointsToNextLevel;
|
|
16687
|
-
var ratio = skillPoints / nextLevelSPWillbe * 100;
|
|
16688
16687
|
var skillsBuffsCalc = function skillsBuffsCalc() {
|
|
16689
16688
|
if (buffAndDebuff) {
|
|
16690
16689
|
return 1 + buffAndDebuff / 100;
|
|
@@ -16701,7 +16700,7 @@ var SkillProgressBar = function SkillProgressBar(_ref) {
|
|
|
16701
16700
|
}))) : React.createElement(React.Fragment, null)), React.createElement(ProgressBarContainer$1, null, React.createElement(SimpleProgressBar, {
|
|
16702
16701
|
value: ratio,
|
|
16703
16702
|
bgColor: bgColor
|
|
16704
|
-
}))), showSkillPoints && React.createElement(SkillDisplayContainer, null, React.createElement(SkillPointsDisplay, null, skillPoints, "/",
|
|
16703
|
+
}))), showSkillPoints && React.createElement(SkillDisplayContainer, null, React.createElement(SkillPointsDisplay, null, skillPoints, "/", skillPointsToNextLevel)));
|
|
16705
16704
|
};
|
|
16706
16705
|
var ProgressBarContainer$1 = /*#__PURE__*/styled.div.withConfig({
|
|
16707
16706
|
displayName: "SkillProgressBar__ProgressBarContainer",
|
|
@@ -16823,6 +16822,24 @@ var SkillsContainer = function SkillsContainer(_ref) {
|
|
|
16823
16822
|
atlasIMG = _ref.atlasIMG,
|
|
16824
16823
|
atlasJSON = _ref.atlasJSON,
|
|
16825
16824
|
scale = _ref.scale;
|
|
16825
|
+
var SPRatio = function SPRatio(level, skillPoints) {
|
|
16826
|
+
var SPLevelActual = getSPForLevel(level + 1);
|
|
16827
|
+
var SPLevelBefore = getSPForLevel(level);
|
|
16828
|
+
var SPCalc = SPLevelActual - SPLevelBefore;
|
|
16829
|
+
if (level === 1) {
|
|
16830
|
+
return skillPoints / SPLevelActual * 100;
|
|
16831
|
+
}
|
|
16832
|
+
return (skillPoints - SPLevelBefore) / SPCalc * 100;
|
|
16833
|
+
};
|
|
16834
|
+
var XPRatio = function XPRatio(level, skillPoints) {
|
|
16835
|
+
var XPLevelActual = getXPForLevel(level + 1);
|
|
16836
|
+
var XPLevelBefore = getXPForLevel(level);
|
|
16837
|
+
var XPCalc = XPLevelActual - XPLevelBefore;
|
|
16838
|
+
if (level === 1) {
|
|
16839
|
+
return skillPoints / XPLevelActual * 100;
|
|
16840
|
+
}
|
|
16841
|
+
return (skillPoints - XPLevelBefore) / XPCalc * 100;
|
|
16842
|
+
};
|
|
16826
16843
|
var onRenderSkillCategory = function onRenderSkillCategory(category) {
|
|
16827
16844
|
var skillCategory = skillProps[category];
|
|
16828
16845
|
var skillCategoryColor = skillCategory.color;
|
|
@@ -16842,11 +16859,12 @@ var SkillsContainer = function SkillsContainer(_ref) {
|
|
|
16842
16859
|
bgColor: skillCategoryColor,
|
|
16843
16860
|
level: skillDetails.level || 0,
|
|
16844
16861
|
skillPoints: Math.round(skillDetails.skillPoints) || 0,
|
|
16845
|
-
skillPointsToNextLevel: Math.round(skillDetails.
|
|
16862
|
+
skillPointsToNextLevel: Math.round(getSPForLevel(skillDetails.level + 1)) || 0,
|
|
16846
16863
|
texturePath: value,
|
|
16847
16864
|
atlasIMG: atlasIMG,
|
|
16848
16865
|
atlasJSON: atlasJSON,
|
|
16849
|
-
buffAndDebuff: skillDetails.buffAndDebuff
|
|
16866
|
+
buffAndDebuff: skillDetails.buffAndDebuff,
|
|
16867
|
+
ratio: SPRatio(skillDetails.level, skillDetails.skillPoints)
|
|
16850
16868
|
}));
|
|
16851
16869
|
}
|
|
16852
16870
|
return output;
|
|
@@ -16867,10 +16885,11 @@ var SkillsContainer = function SkillsContainer(_ref) {
|
|
|
16867
16885
|
bgColor: uiColors.navyBlue,
|
|
16868
16886
|
level: Math.round(skill.level) || 0,
|
|
16869
16887
|
skillPoints: Math.round(skill.experience) || 0,
|
|
16870
|
-
skillPointsToNextLevel: Math.round(skill.
|
|
16888
|
+
skillPointsToNextLevel: Math.round(getXPForLevel(skill.level + 1)) || 0,
|
|
16871
16889
|
texturePath: 'swords/broad-sword.png',
|
|
16872
16890
|
atlasIMG: atlasIMG,
|
|
16873
|
-
atlasJSON: atlasJSON
|
|
16891
|
+
atlasJSON: atlasJSON,
|
|
16892
|
+
ratio: XPRatio(skill.level, skill.experience)
|
|
16874
16893
|
}), React.createElement("p", null, "Combat Skills"), React.createElement("hr", {
|
|
16875
16894
|
className: "golden"
|
|
16876
16895
|
})), onRenderSkillCategory('combat'), React.createElement(SkillSplitDiv, null, React.createElement("p", null, "Crafting Skills"), React.createElement("hr", {
|