@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.
- package/dist/components/Spellbook/Spell.d.ts +1 -0
- package/dist/components/Spellbook/Spellbook.d.ts +1 -0
- package/dist/long-bow.cjs.development.js +40 -11
- 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 +41 -12
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/SkillsContainer.tsx +4 -7
- package/src/components/Spellbook/Spell.tsx +38 -4
- package/src/components/Spellbook/Spellbook.tsx +3 -0
|
@@ -7,6 +7,7 @@ export interface ISpellbookProps {
|
|
|
7
7
|
spells: ISpell[];
|
|
8
8
|
magicLevel: number;
|
|
9
9
|
mana: number;
|
|
10
|
+
charSkillLevels?: Record<string, number>;
|
|
10
11
|
onSpellClick: (spellKey: string) => void;
|
|
11
12
|
setSpellShortcut: (key: string, index: number) => void;
|
|
12
13
|
shortcuts: IShortcut[];
|
|
@@ -36735,16 +36735,14 @@ var SkillsContainer = function SkillsContainer(_ref) {
|
|
|
36735
36735
|
if (!skillDetails) {
|
|
36736
36736
|
return 0; // continue
|
|
36737
36737
|
}
|
|
36738
|
-
// Calculate skillPointsToNextLevel using exponential formula
|
|
36738
|
+
// Calculate skillPointsToNextLevel using exponential formula with character class
|
|
36739
36739
|
var calcSkillPointsToNextLevel = function calcSkillPointsToNextLevel() {
|
|
36740
|
-
|
|
36741
|
-
|
|
36742
|
-
|
|
36743
|
-
|
|
36744
|
-
|
|
36745
|
-
|
|
36746
|
-
}
|
|
36747
|
-
return Math.round(shared.getSPForLevel(skillDetails.level + 1));
|
|
36740
|
+
var effectiveClass = characterClass != null ? characterClass : shared.CharacterClass.None;
|
|
36741
|
+
var _getSkillConstants = shared.getSkillConstants(key, effectiveClass),
|
|
36742
|
+
A = _getSkillConstants.A,
|
|
36743
|
+
b = _getSkillConstants.b,
|
|
36744
|
+
c = _getSkillConstants.c;
|
|
36745
|
+
return Math.round(shared.getSPForLevelExponential(skillDetails.level + 1, A, b, c));
|
|
36748
36746
|
};
|
|
36749
36747
|
output.push(React__default.createElement(SkillProgressBar, {
|
|
36750
36748
|
key: key,
|
|
@@ -37145,6 +37143,20 @@ var SpellInfoWrapper = function SpellInfoWrapper(_ref) {
|
|
|
37145
37143
|
}));
|
|
37146
37144
|
};
|
|
37147
37145
|
|
|
37146
|
+
var SKILL_NAMES = {
|
|
37147
|
+
magicLevel: 'magic level',
|
|
37148
|
+
distanceFighting: 'distance fighting',
|
|
37149
|
+
swordFighting: 'sword fighting',
|
|
37150
|
+
axeFighting: 'axe fighting',
|
|
37151
|
+
clubFighting: 'club fighting',
|
|
37152
|
+
shielding: 'shielding',
|
|
37153
|
+
fishing: 'fishing',
|
|
37154
|
+
cooking: 'cooking',
|
|
37155
|
+
fistFighting: 'fist fighting'
|
|
37156
|
+
};
|
|
37157
|
+
var getSkillName = function getSkillName(attribute) {
|
|
37158
|
+
return SKILL_NAMES[attribute] || attribute;
|
|
37159
|
+
};
|
|
37148
37160
|
var Spell = function Spell(_ref) {
|
|
37149
37161
|
var _spell$texturePath;
|
|
37150
37162
|
var atlasIMG = _ref.atlasIMG,
|
|
@@ -37152,16 +37164,31 @@ var Spell = function Spell(_ref) {
|
|
|
37152
37164
|
spellKey = _ref.spellKey,
|
|
37153
37165
|
charMana = _ref.charMana,
|
|
37154
37166
|
charMagicLevel = _ref.charMagicLevel,
|
|
37167
|
+
charSkillLevels = _ref.charSkillLevels,
|
|
37155
37168
|
onPointerUp = _ref.onPointerUp,
|
|
37156
37169
|
isSettingShortcut = _ref.isSettingShortcut,
|
|
37157
37170
|
spell = _ref.spell,
|
|
37158
37171
|
activeCooldown = _ref.activeCooldown;
|
|
37159
37172
|
var manaCost = spell.manaCost,
|
|
37160
37173
|
minMagicLevelRequired = spell.minMagicLevelRequired,
|
|
37174
|
+
minSkillLevelRequired = spell.minSkillLevelRequired,
|
|
37175
|
+
attribute = spell.attribute,
|
|
37161
37176
|
magicWords = spell.magicWords,
|
|
37162
37177
|
name = spell.name,
|
|
37163
37178
|
description = spell.description;
|
|
37164
|
-
var
|
|
37179
|
+
var getRequiredLevel = function getRequiredLevel() {
|
|
37180
|
+
return minSkillLevelRequired != null ? minSkillLevelRequired : minMagicLevelRequired;
|
|
37181
|
+
};
|
|
37182
|
+
var getCharacterSkillLevel = function getCharacterSkillLevel() {
|
|
37183
|
+
if (attribute && charSkillLevels) {
|
|
37184
|
+
var _charSkillLevels$attr;
|
|
37185
|
+
return (_charSkillLevels$attr = charSkillLevels[attribute]) != null ? _charSkillLevels$attr : 0;
|
|
37186
|
+
}
|
|
37187
|
+
return charMagicLevel;
|
|
37188
|
+
};
|
|
37189
|
+
var requiredLevel = getRequiredLevel();
|
|
37190
|
+
var characterSkillLevel = getCharacterSkillLevel();
|
|
37191
|
+
var disabled = isSettingShortcut ? characterSkillLevel < requiredLevel : manaCost > charMana || characterSkillLevel < requiredLevel;
|
|
37165
37192
|
var CONTAINER_STYLE = {
|
|
37166
37193
|
width: '32px',
|
|
37167
37194
|
height: '32px'
|
|
@@ -37173,7 +37200,7 @@ var Spell = function Spell(_ref) {
|
|
|
37173
37200
|
onPointerUp: onPointerUp == null ? void 0 : onPointerUp.bind(null, spellKey),
|
|
37174
37201
|
isSettingShortcut: isSettingShortcut && !disabled,
|
|
37175
37202
|
className: "spell"
|
|
37176
|
-
}, disabled && React__default.createElement(Overlay$3, null,
|
|
37203
|
+
}, disabled && React__default.createElement(Overlay$3, null, characterSkillLevel < requiredLevel ? "Low " + getSkillName(attribute || 'magic level') + " level" : manaCost > charMana && 'No mana'), React__default.createElement(SpellImage, null, activeCooldown && activeCooldown > 0 ? React__default.createElement("span", {
|
|
37177
37204
|
className: "cooldown"
|
|
37178
37205
|
}, activeCooldown.toFixed(activeCooldown > 10 ? 0 : 1)) : null, React__default.createElement(SpriteFromAtlas, {
|
|
37179
37206
|
atlasIMG: atlasIMG,
|
|
@@ -37231,6 +37258,7 @@ var Spellbook = function Spellbook(_ref) {
|
|
|
37231
37258
|
spells = _ref.spells,
|
|
37232
37259
|
magicLevel = _ref.magicLevel,
|
|
37233
37260
|
mana = _ref.mana,
|
|
37261
|
+
charSkillLevels = _ref.charSkillLevels,
|
|
37234
37262
|
onSpellClick = _ref.onSpellClick,
|
|
37235
37263
|
setSpellShortcut = _ref.setSpellShortcut,
|
|
37236
37264
|
shortcuts = _ref.shortcuts,
|
|
@@ -37291,6 +37319,7 @@ var Spellbook = function Spellbook(_ref) {
|
|
|
37291
37319
|
atlasJSON: iconAtlasJSON,
|
|
37292
37320
|
charMana: mana,
|
|
37293
37321
|
charMagicLevel: magicLevel,
|
|
37322
|
+
charSkillLevels: charSkillLevels,
|
|
37294
37323
|
onPointerUp: settingShortcutIndex !== -1 ? setShortcut : onSpellClick,
|
|
37295
37324
|
spellKey: spell.key,
|
|
37296
37325
|
isSettingShortcut: settingShortcutIndex !== -1,
|