@rpg-engine/long-bow 0.8.80 → 0.8.82
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 +3 -0
- package/dist/components/SkillsContainer.d.ts +2 -1
- package/dist/long-bow.cjs.development.js +55 -24
- 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 +56 -25
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/SkillProgressBar.tsx +19 -3
- package/src/components/SkillsContainer.tsx +17 -3
- package/src/mocks/skills.mocks.ts +21 -9
package/dist/long-bow.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ import React, { useState, useEffect, Component, useRef, useCallback, useContext,
|
|
|
2
2
|
import styled, { css, keyframes, createGlobalStyle } from 'styled-components';
|
|
3
3
|
import { BeatLoader } from 'react-spinners';
|
|
4
4
|
import { v4 } from 'uuid';
|
|
5
|
-
import { GRID_WIDTH, GRID_HEIGHT, ShortcutType, getItemTextureKeyPath, ItemContainerType, ItemType, DepotSocketEvents, ItemSocketEvents, ItemSocketEventsDisplayLabels, ActionsForInventory, ActionsForEquipmentSet, ActionsForLoot, ActionsForMapContainer, ItemQualityLevel, ItemRarities, ItemSubType, isMobile, TaskType, TaskStatus, isMobileOrTablet, RewardType, ItemSlotType, NPCSubtype, EntityAttackType, NPCAlignment, VideoGuideCategory, VideoGuideLanguage, CharacterClass, QuestStatus, getSPForLevel, getXPForLevel, MetadataType, PurchaseType, UserAccountTypes, PaymentCurrency, PeriodOfDay } from '@rpg-engine/shared';
|
|
5
|
+
import { GRID_WIDTH, GRID_HEIGHT, ShortcutType, getItemTextureKeyPath, ItemContainerType, ItemType, DepotSocketEvents, ItemSocketEvents, ItemSocketEventsDisplayLabels, ActionsForInventory, ActionsForEquipmentSet, ActionsForLoot, ActionsForMapContainer, ItemQualityLevel, ItemRarities, ItemSubType, isMobile, TaskType, TaskStatus, isMobileOrTablet, RewardType, ItemSlotType, NPCSubtype, EntityAttackType, NPCAlignment, VideoGuideCategory, VideoGuideLanguage, CharacterClass, QuestStatus, getSkillConstants, getSPForLevelExponential, getSPForLevel, getXPForLevel, MetadataType, PurchaseType, UserAccountTypes, PaymentCurrency, PeriodOfDay } from '@rpg-engine/shared';
|
|
6
6
|
import dayjs from 'dayjs';
|
|
7
7
|
import { ErrorBoundary as ErrorBoundary$1 } from 'react-error-boundary';
|
|
8
8
|
import { FaTimes, FaDiscord, FaWhatsapp, FaSearch, FaThumbtack, FaBoxOpen, FaChevronLeft, FaChevronRight, FaClipboardList, FaChevronUp, FaChevronDown, FaReddit, FaTrash, FaShoppingBag, FaInfoCircle, FaCartPlus, FaArrowLeft, FaHistory, FaShoppingCart } from 'react-icons/fa';
|
|
@@ -36509,6 +36509,8 @@ var Tooltip = /*#__PURE__*/styled.div.withConfig({
|
|
|
36509
36509
|
var SkillProgressBar = function SkillProgressBar(_ref) {
|
|
36510
36510
|
var bgColor = _ref.bgColor,
|
|
36511
36511
|
skillName = _ref.skillName,
|
|
36512
|
+
skillKey = _ref.skillKey,
|
|
36513
|
+
characterClass = _ref.characterClass,
|
|
36512
36514
|
level = _ref.level,
|
|
36513
36515
|
currentSkillPoints = _ref.skillPoints,
|
|
36514
36516
|
skillPointsToNextLevel = _ref.skillPointsToNextLevel,
|
|
@@ -36519,7 +36521,17 @@ var SkillProgressBar = function SkillProgressBar(_ref) {
|
|
|
36519
36521
|
atlasJSON = _ref.atlasJSON,
|
|
36520
36522
|
buffAndDebuff = _ref.buffAndDebuff;
|
|
36521
36523
|
// Skill points needed to start the current level
|
|
36522
|
-
var baseSkillPoints =
|
|
36524
|
+
var baseSkillPoints = useMemo(function () {
|
|
36525
|
+
if (skillKey && characterClass) {
|
|
36526
|
+
var _getSkillConstants = getSkillConstants(skillKey, characterClass),
|
|
36527
|
+
A = _getSkillConstants.A,
|
|
36528
|
+
b = _getSkillConstants.b,
|
|
36529
|
+
c = _getSkillConstants.c;
|
|
36530
|
+
return getSPForLevelExponential(level, A, b, c);
|
|
36531
|
+
}
|
|
36532
|
+
// Fallback to old formula for backwards compatibility
|
|
36533
|
+
return getSPForLevel(level);
|
|
36534
|
+
}, [level, skillKey, characterClass]);
|
|
36523
36535
|
var calculateProgress = function calculateProgress() {
|
|
36524
36536
|
var totalPointsForLevelUp = Math.max(1, skillPointsToNextLevel - baseSkillPoints);
|
|
36525
36537
|
var excessSkillPoints = Math.max(0, currentSkillPoints - baseSkillPoints);
|
|
@@ -36665,6 +36677,7 @@ var skillNameMap = {
|
|
|
36665
36677
|
var SkillsContainer = function SkillsContainer(_ref) {
|
|
36666
36678
|
var onCloseButton = _ref.onCloseButton,
|
|
36667
36679
|
skill = _ref.skill,
|
|
36680
|
+
characterClass = _ref.characterClass,
|
|
36668
36681
|
atlasIMG = _ref.atlasIMG,
|
|
36669
36682
|
atlasJSON = _ref.atlasJSON,
|
|
36670
36683
|
scale = _ref.scale;
|
|
@@ -36672,30 +36685,48 @@ var SkillsContainer = function SkillsContainer(_ref) {
|
|
|
36672
36685
|
var skillCategory = skillProps[category];
|
|
36673
36686
|
var skillCategoryColor = skillCategory.color;
|
|
36674
36687
|
var output = [];
|
|
36688
|
+
var _loop = function _loop() {
|
|
36689
|
+
var _Object$entries$_i = _Object$entries[_i],
|
|
36690
|
+
key = _Object$entries$_i[0],
|
|
36691
|
+
value = _Object$entries$_i[1];
|
|
36692
|
+
if (key === 'stamina') {
|
|
36693
|
+
return 0; // continue
|
|
36694
|
+
}
|
|
36695
|
+
//@ts-ignore
|
|
36696
|
+
var skillDetails = skill[key];
|
|
36697
|
+
if (!skillDetails) {
|
|
36698
|
+
return 0; // continue
|
|
36699
|
+
}
|
|
36700
|
+
// Calculate skillPointsToNextLevel using exponential formula if characterClass available
|
|
36701
|
+
var calcSkillPointsToNextLevel = function calcSkillPointsToNextLevel() {
|
|
36702
|
+
if (characterClass) {
|
|
36703
|
+
var _getSkillConstants = getSkillConstants(key, characterClass),
|
|
36704
|
+
A = _getSkillConstants.A,
|
|
36705
|
+
b = _getSkillConstants.b,
|
|
36706
|
+
c = _getSkillConstants.c;
|
|
36707
|
+
return Math.round(getSPForLevelExponential(skillDetails.level + 1, A, b, c));
|
|
36708
|
+
}
|
|
36709
|
+
return Math.round(getSPForLevel(skillDetails.level + 1));
|
|
36710
|
+
};
|
|
36711
|
+
output.push(React.createElement(SkillProgressBar, {
|
|
36712
|
+
key: key,
|
|
36713
|
+
skillName: skillNameMap[key],
|
|
36714
|
+
skillKey: key,
|
|
36715
|
+
characterClass: characterClass,
|
|
36716
|
+
bgColor: skillCategoryColor,
|
|
36717
|
+
level: skillDetails.level || 0,
|
|
36718
|
+
skillPoints: Math.round(skillDetails.skillPoints) || 0,
|
|
36719
|
+
skillPointsToNextLevel: calcSkillPointsToNextLevel(),
|
|
36720
|
+
texturePath: value,
|
|
36721
|
+
atlasIMG: atlasIMG,
|
|
36722
|
+
atlasJSON: atlasJSON,
|
|
36723
|
+
buffAndDebuff: skillDetails.buffAndDebuff
|
|
36724
|
+
}));
|
|
36725
|
+
},
|
|
36726
|
+
_ret;
|
|
36675
36727
|
for (var _i = 0, _Object$entries = Object.entries(skillCategory.values); _i < _Object$entries.length; _i++) {
|
|
36676
|
-
|
|
36677
|
-
|
|
36678
|
-
value = _Object$entries$_i[1];
|
|
36679
|
-
if (key === 'stamina') {
|
|
36680
|
-
continue;
|
|
36681
|
-
}
|
|
36682
|
-
//@ts-ignore
|
|
36683
|
-
var skillDetails = skill[key];
|
|
36684
|
-
if (!skillDetails) {
|
|
36685
|
-
continue;
|
|
36686
|
-
}
|
|
36687
|
-
output.push(React.createElement(SkillProgressBar, {
|
|
36688
|
-
key: key,
|
|
36689
|
-
skillName: skillNameMap[key],
|
|
36690
|
-
bgColor: skillCategoryColor,
|
|
36691
|
-
level: skillDetails.level || 0,
|
|
36692
|
-
skillPoints: Math.round(skillDetails.skillPoints) || 0,
|
|
36693
|
-
skillPointsToNextLevel: Math.round(getSPForLevel(skillDetails.level + 1)) || 0,
|
|
36694
|
-
texturePath: value,
|
|
36695
|
-
atlasIMG: atlasIMG,
|
|
36696
|
-
atlasJSON: atlasJSON,
|
|
36697
|
-
buffAndDebuff: skillDetails.buffAndDebuff
|
|
36698
|
-
}));
|
|
36728
|
+
_ret = _loop();
|
|
36729
|
+
if (_ret === 0) continue;
|
|
36699
36730
|
}
|
|
36700
36731
|
return output;
|
|
36701
36732
|
};
|