@rpg-engine/long-bow 0.8.93 → 0.8.95
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 +25 -18
- 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 +26 -19
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/SkillProgressBar.tsx +23 -8
- package/src/components/SkillsContainer.tsx +4 -7
- package/src/components/Spellbook/Spell.tsx +1 -1
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, getSkillConstants, getLevelFromSP,
|
|
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, getLevelFromXP, getSkillConstants, getLevelFromSP, getXPForLevel, 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';
|
|
@@ -36529,7 +36529,6 @@ var SkillProgressBar = function SkillProgressBar(_ref) {
|
|
|
36529
36529
|
skillName = _ref.skillName,
|
|
36530
36530
|
skillKey = _ref.skillKey,
|
|
36531
36531
|
characterClass = _ref.characterClass,
|
|
36532
|
-
level = _ref.level,
|
|
36533
36532
|
currentSkillPoints = _ref.skillPoints,
|
|
36534
36533
|
texturePath = _ref.texturePath,
|
|
36535
36534
|
_ref$showSkillPoints = _ref.showSkillPoints,
|
|
@@ -36539,11 +36538,13 @@ var SkillProgressBar = function SkillProgressBar(_ref) {
|
|
|
36539
36538
|
buffAndDebuff = _ref.buffAndDebuff;
|
|
36540
36539
|
// Use CharacterClass.None as default if skillKey is provided but characterClass is not
|
|
36541
36540
|
var effectiveClass = characterClass != null ? characterClass : CharacterClass.None;
|
|
36542
|
-
// Calculate the effective level based on actual SP (handles data inconsistencies)
|
|
36541
|
+
// Calculate the effective level based on actual SP/XP (handles data inconsistencies)
|
|
36543
36542
|
var calculateEffectiveLevel = function calculateEffectiveLevel() {
|
|
36544
36543
|
if (!skillKey) {
|
|
36545
|
-
|
|
36544
|
+
// Character level: uses cubic formula (level³ * 3)
|
|
36545
|
+
return Math.max(1, getLevelFromXP(currentSkillPoints));
|
|
36546
36546
|
}
|
|
36547
|
+
// Skills: use exponential formula with class-based constants
|
|
36547
36548
|
var _getSkillConstants = getSkillConstants(skillKey, effectiveClass),
|
|
36548
36549
|
A = _getSkillConstants.A,
|
|
36549
36550
|
b = _getSkillConstants.b,
|
|
@@ -36552,12 +36553,20 @@ var SkillProgressBar = function SkillProgressBar(_ref) {
|
|
|
36552
36553
|
return Math.max(1, actualLevel); // Minimum level is always 1 in our system
|
|
36553
36554
|
};
|
|
36554
36555
|
var effectiveLevel = calculateEffectiveLevel();
|
|
36555
|
-
// Calculate progress based on actual SP position
|
|
36556
|
+
// Calculate progress based on actual SP/XP position
|
|
36556
36557
|
var calculateProgress = function calculateProgress() {
|
|
36557
|
-
//
|
|
36558
|
-
|
|
36559
|
-
|
|
36560
|
-
|
|
36558
|
+
// Character level uses cubic XP formula, skills use exponential SP formula
|
|
36559
|
+
if (!skillKey) {
|
|
36560
|
+
// Character level: uses cubic formula (level³ * 3)
|
|
36561
|
+
var _actualLevel = Math.max(1, getLevelFromXP(currentSkillPoints));
|
|
36562
|
+
var currentLevelXP = getXPForLevel(_actualLevel);
|
|
36563
|
+
var nextLevelXP = getXPForLevel(_actualLevel + 1);
|
|
36564
|
+
var _range = nextLevelXP - currentLevelXP;
|
|
36565
|
+
var _progressInLevel = currentSkillPoints - currentLevelXP;
|
|
36566
|
+
return Math.min(99.99, Math.max(0, _progressInLevel / Math.max(1, _range) * 100));
|
|
36567
|
+
}
|
|
36568
|
+
// Skills: use exponential formula with class-based constants
|
|
36569
|
+
var _getSkillConstants2 = getSkillConstants(skillKey, effectiveClass),
|
|
36561
36570
|
A = _getSkillConstants2.A,
|
|
36562
36571
|
b = _getSkillConstants2.b,
|
|
36563
36572
|
c = _getSkillConstants2.c;
|
|
@@ -36732,16 +36741,14 @@ var SkillsContainer = function SkillsContainer(_ref) {
|
|
|
36732
36741
|
if (!skillDetails) {
|
|
36733
36742
|
return 0; // continue
|
|
36734
36743
|
}
|
|
36735
|
-
// Calculate skillPointsToNextLevel using exponential formula
|
|
36744
|
+
// Calculate skillPointsToNextLevel using exponential formula with character class
|
|
36736
36745
|
var calcSkillPointsToNextLevel = function calcSkillPointsToNextLevel() {
|
|
36737
|
-
|
|
36738
|
-
|
|
36739
|
-
|
|
36740
|
-
|
|
36741
|
-
|
|
36742
|
-
|
|
36743
|
-
}
|
|
36744
|
-
return Math.round(getSPForLevel(skillDetails.level + 1));
|
|
36746
|
+
var effectiveClass = characterClass != null ? characterClass : CharacterClass.None;
|
|
36747
|
+
var _getSkillConstants = getSkillConstants(key, effectiveClass),
|
|
36748
|
+
A = _getSkillConstants.A,
|
|
36749
|
+
b = _getSkillConstants.b,
|
|
36750
|
+
c = _getSkillConstants.c;
|
|
36751
|
+
return Math.round(getSPForLevelExponential(skillDetails.level + 1, A, b, c));
|
|
36745
36752
|
};
|
|
36746
36753
|
output.push(React.createElement(SkillProgressBar, {
|
|
36747
36754
|
key: key,
|
|
@@ -37151,7 +37158,7 @@ var SKILL_NAMES = {
|
|
|
37151
37158
|
shielding: 'shielding',
|
|
37152
37159
|
fishing: 'fishing',
|
|
37153
37160
|
cooking: 'cooking',
|
|
37154
|
-
|
|
37161
|
+
fistFighting: 'fist fighting'
|
|
37155
37162
|
};
|
|
37156
37163
|
var getSkillName = function getSkillName(attribute) {
|
|
37157
37164
|
return SKILL_NAMES[attribute] || attribute;
|