@rpg-engine/long-bow 0.8.92 → 0.8.94

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.
@@ -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, getSPForLevelExponential, getXPForLevel, getSPForLevel, 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, getLevelFromSP, getSPForLevelExponential, 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';
@@ -36732,16 +36732,14 @@ var SkillsContainer = function SkillsContainer(_ref) {
36732
36732
  if (!skillDetails) {
36733
36733
  return 0; // continue
36734
36734
  }
36735
- // Calculate skillPointsToNextLevel using exponential formula if characterClass available
36735
+ // Calculate skillPointsToNextLevel using exponential formula with character class
36736
36736
  var calcSkillPointsToNextLevel = function calcSkillPointsToNextLevel() {
36737
- if (characterClass) {
36738
- var _getSkillConstants = getSkillConstants(key, characterClass),
36739
- A = _getSkillConstants.A,
36740
- b = _getSkillConstants.b,
36741
- c = _getSkillConstants.c;
36742
- return Math.round(getSPForLevelExponential(skillDetails.level + 1, A, b, c));
36743
- }
36744
- return Math.round(getSPForLevel(skillDetails.level + 1));
36737
+ var effectiveClass = characterClass != null ? characterClass : CharacterClass.None;
36738
+ var _getSkillConstants = getSkillConstants(key, effectiveClass),
36739
+ A = _getSkillConstants.A,
36740
+ b = _getSkillConstants.b,
36741
+ c = _getSkillConstants.c;
36742
+ return Math.round(getSPForLevelExponential(skillDetails.level + 1, A, b, c));
36745
36743
  };
36746
36744
  output.push(React.createElement(SkillProgressBar, {
36747
36745
  key: key,
@@ -37142,6 +37140,20 @@ var SpellInfoWrapper = function SpellInfoWrapper(_ref) {
37142
37140
  }));
37143
37141
  };
37144
37142
 
37143
+ var SKILL_NAMES = {
37144
+ magicLevel: 'magic level',
37145
+ distanceFighting: 'distance fighting',
37146
+ swordFighting: 'sword fighting',
37147
+ axeFighting: 'axe fighting',
37148
+ clubFighting: 'club fighting',
37149
+ shielding: 'shielding',
37150
+ fishing: 'fishing',
37151
+ cooking: 'cooking',
37152
+ fistFighting: 'fist fighting'
37153
+ };
37154
+ var getSkillName = function getSkillName(attribute) {
37155
+ return SKILL_NAMES[attribute] || attribute;
37156
+ };
37145
37157
  var Spell = function Spell(_ref) {
37146
37158
  var _spell$texturePath;
37147
37159
  var atlasIMG = _ref.atlasIMG,
@@ -37149,16 +37161,31 @@ var Spell = function Spell(_ref) {
37149
37161
  spellKey = _ref.spellKey,
37150
37162
  charMana = _ref.charMana,
37151
37163
  charMagicLevel = _ref.charMagicLevel,
37164
+ charSkillLevels = _ref.charSkillLevels,
37152
37165
  onPointerUp = _ref.onPointerUp,
37153
37166
  isSettingShortcut = _ref.isSettingShortcut,
37154
37167
  spell = _ref.spell,
37155
37168
  activeCooldown = _ref.activeCooldown;
37156
37169
  var manaCost = spell.manaCost,
37157
37170
  minMagicLevelRequired = spell.minMagicLevelRequired,
37171
+ minSkillLevelRequired = spell.minSkillLevelRequired,
37172
+ attribute = spell.attribute,
37158
37173
  magicWords = spell.magicWords,
37159
37174
  name = spell.name,
37160
37175
  description = spell.description;
37161
- var disabled = isSettingShortcut ? charMagicLevel < minMagicLevelRequired : manaCost > charMana || charMagicLevel < minMagicLevelRequired;
37176
+ var getRequiredLevel = function getRequiredLevel() {
37177
+ return minSkillLevelRequired != null ? minSkillLevelRequired : minMagicLevelRequired;
37178
+ };
37179
+ var getCharacterSkillLevel = function getCharacterSkillLevel() {
37180
+ if (attribute && charSkillLevels) {
37181
+ var _charSkillLevels$attr;
37182
+ return (_charSkillLevels$attr = charSkillLevels[attribute]) != null ? _charSkillLevels$attr : 0;
37183
+ }
37184
+ return charMagicLevel;
37185
+ };
37186
+ var requiredLevel = getRequiredLevel();
37187
+ var characterSkillLevel = getCharacterSkillLevel();
37188
+ var disabled = isSettingShortcut ? characterSkillLevel < requiredLevel : manaCost > charMana || characterSkillLevel < requiredLevel;
37162
37189
  var CONTAINER_STYLE = {
37163
37190
  width: '32px',
37164
37191
  height: '32px'
@@ -37170,7 +37197,7 @@ var Spell = function Spell(_ref) {
37170
37197
  onPointerUp: onPointerUp == null ? void 0 : onPointerUp.bind(null, spellKey),
37171
37198
  isSettingShortcut: isSettingShortcut && !disabled,
37172
37199
  className: "spell"
37173
- }, disabled && React.createElement(Overlay$3, null, charMagicLevel < minMagicLevelRequired ? 'Low magic level' : manaCost > charMana && 'No mana'), React.createElement(SpellImage, null, activeCooldown && activeCooldown > 0 ? React.createElement("span", {
37200
+ }, disabled && React.createElement(Overlay$3, null, characterSkillLevel < requiredLevel ? "Low " + getSkillName(attribute || 'magic level') + " level" : manaCost > charMana && 'No mana'), React.createElement(SpellImage, null, activeCooldown && activeCooldown > 0 ? React.createElement("span", {
37174
37201
  className: "cooldown"
37175
37202
  }, activeCooldown.toFixed(activeCooldown > 10 ? 0 : 1)) : null, React.createElement(SpriteFromAtlas, {
37176
37203
  atlasIMG: atlasIMG,
@@ -37228,6 +37255,7 @@ var Spellbook = function Spellbook(_ref) {
37228
37255
  spells = _ref.spells,
37229
37256
  magicLevel = _ref.magicLevel,
37230
37257
  mana = _ref.mana,
37258
+ charSkillLevels = _ref.charSkillLevels,
37231
37259
  onSpellClick = _ref.onSpellClick,
37232
37260
  setSpellShortcut = _ref.setSpellShortcut,
37233
37261
  shortcuts = _ref.shortcuts,
@@ -37288,6 +37316,7 @@ var Spellbook = function Spellbook(_ref) {
37288
37316
  atlasJSON: iconAtlasJSON,
37289
37317
  charMana: mana,
37290
37318
  charMagicLevel: magicLevel,
37319
+ charSkillLevels: charSkillLevels,
37291
37320
  onPointerUp: settingShortcutIndex !== -1 ? setShortcut : onSpellClick,
37292
37321
  spellKey: spell.key,
37293
37322
  isSettingShortcut: settingShortcutIndex !== -1,