@rpg-engine/long-bow 0.8.79 → 0.8.81
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/components/SkillsContainer.d.ts +2 -1
- package/dist/long-bow.cjs.development.js +15 -3
- 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 +16 -4
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/SkillProgressBar.tsx +4 -3
- package/src/components/SkillsContainer.tsx +22 -4
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,
|
|
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, getXPForLevel, getSkillConstants, getSPForLevelExponential, 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';
|
|
@@ -36512,14 +36512,15 @@ var SkillProgressBar = function SkillProgressBar(_ref) {
|
|
|
36512
36512
|
level = _ref.level,
|
|
36513
36513
|
currentSkillPoints = _ref.skillPoints,
|
|
36514
36514
|
skillPointsToNextLevel = _ref.skillPointsToNextLevel,
|
|
36515
|
+
skillPointsForCurrentLevel = _ref.skillPointsForCurrentLevel,
|
|
36515
36516
|
texturePath = _ref.texturePath,
|
|
36516
36517
|
_ref$showSkillPoints = _ref.showSkillPoints,
|
|
36517
36518
|
showSkillPoints = _ref$showSkillPoints === void 0 ? true : _ref$showSkillPoints,
|
|
36518
36519
|
atlasIMG = _ref.atlasIMG,
|
|
36519
36520
|
atlasJSON = _ref.atlasJSON,
|
|
36520
36521
|
buffAndDebuff = _ref.buffAndDebuff;
|
|
36521
|
-
// Skill points needed to start the current level
|
|
36522
|
-
var baseSkillPoints =
|
|
36522
|
+
// Skill points needed to start the current level (passed from parent, calculated with correct formula)
|
|
36523
|
+
var baseSkillPoints = skillPointsForCurrentLevel;
|
|
36523
36524
|
var calculateProgress = function calculateProgress() {
|
|
36524
36525
|
var totalPointsForLevelUp = Math.max(1, skillPointsToNextLevel - baseSkillPoints);
|
|
36525
36526
|
var excessSkillPoints = Math.max(0, currentSkillPoints - baseSkillPoints);
|
|
@@ -36665,6 +36666,7 @@ var skillNameMap = {
|
|
|
36665
36666
|
var SkillsContainer = function SkillsContainer(_ref) {
|
|
36666
36667
|
var onCloseButton = _ref.onCloseButton,
|
|
36667
36668
|
skill = _ref.skill,
|
|
36669
|
+
characterClass = _ref.characterClass,
|
|
36668
36670
|
atlasIMG = _ref.atlasIMG,
|
|
36669
36671
|
atlasJSON = _ref.atlasJSON,
|
|
36670
36672
|
scale = _ref.scale;
|
|
@@ -36684,13 +36686,22 @@ var SkillsContainer = function SkillsContainer(_ref) {
|
|
|
36684
36686
|
if (!skillDetails) {
|
|
36685
36687
|
continue;
|
|
36686
36688
|
}
|
|
36689
|
+
// Get the skill constants for this skill and character class
|
|
36690
|
+
var _getSkillConstants = getSkillConstants(key, characterClass),
|
|
36691
|
+
A = _getSkillConstants.A,
|
|
36692
|
+
b = _getSkillConstants.b,
|
|
36693
|
+
c = _getSkillConstants.c;
|
|
36694
|
+
// Calculate SP thresholds using exponential formula
|
|
36695
|
+
var skillPointsForCurrentLevel = getSPForLevelExponential(skillDetails.level, A, b, c);
|
|
36696
|
+
var skillPointsToNextLevel = getSPForLevelExponential(skillDetails.level + 1, A, b, c);
|
|
36687
36697
|
output.push(React.createElement(SkillProgressBar, {
|
|
36688
36698
|
key: key,
|
|
36689
36699
|
skillName: skillNameMap[key],
|
|
36690
36700
|
bgColor: skillCategoryColor,
|
|
36691
36701
|
level: skillDetails.level || 0,
|
|
36692
36702
|
skillPoints: Math.round(skillDetails.skillPoints) || 0,
|
|
36693
|
-
skillPointsToNextLevel:
|
|
36703
|
+
skillPointsToNextLevel: skillPointsToNextLevel,
|
|
36704
|
+
skillPointsForCurrentLevel: skillPointsForCurrentLevel,
|
|
36694
36705
|
texturePath: value,
|
|
36695
36706
|
atlasIMG: atlasIMG,
|
|
36696
36707
|
atlasJSON: atlasJSON,
|
|
@@ -36716,6 +36727,7 @@ var SkillsContainer = function SkillsContainer(_ref) {
|
|
|
36716
36727
|
level: Math.round(skill.level) || 0,
|
|
36717
36728
|
skillPoints: Math.round(skill.experience) || 0,
|
|
36718
36729
|
skillPointsToNextLevel: Math.round(getXPForLevel(skill.level + 1)) || 0,
|
|
36730
|
+
skillPointsForCurrentLevel: Math.round(getXPForLevel(skill.level)) || 0,
|
|
36719
36731
|
texturePath: 'swords/broad-sword.png',
|
|
36720
36732
|
atlasIMG: atlasIMG,
|
|
36721
36733
|
atlasJSON: atlasJSON
|