bnstooltips 1.21.3 → 1.22.0

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.
@@ -1,4 +1,4 @@
1
- import { Skill, SkillArcaneInfo } from "./ISkill";
1
+ import { Skill, SkillArcaneInfo, SkillArcaneInfo2 } from "./ISkill";
2
2
  export declare function BuildIconPath(iconPath: string, iconIndex?: number): string;
3
3
  export declare function IsNullOrEmpty(property?: string): boolean;
4
4
  export declare function ReplaceIconsInHtmlString(htmlString: string): string;
@@ -14,3 +14,4 @@ export interface IBnsMoney {
14
14
  }
15
15
  export declare function getMoneyObj(money: number): IBnsMoney | null;
16
16
  export declare function GetSkillMasteryValue(points: number, arcaneInfo: SkillArcaneInfo): number;
17
+ export declare function GetSkillMasteryValue2(points: number, arcaneInfo: SkillArcaneInfo2 | undefined): number;
@@ -25,7 +25,19 @@ export interface Skill {
25
25
  };
26
26
  RealCastCondition: RealCastCondition;
27
27
  RealEffects: RealEffects;
28
- ArcaneInfo: SkillArcaneInfo;
28
+ ArcaneInfo?: SkillArcaneInfo;
29
+ ArcaneInfo2?: SkillArcaneInfo2;
30
+ }
31
+ export declare enum ArcaneModifyType {
32
+ None = 0,
33
+ Damage = 1,
34
+ Cooldown = 2
35
+ }
36
+ export interface SkillArcaneInfo2 {
37
+ Type: ArcaneModifyType;
38
+ Breakpoints: {
39
+ [id: number]: number;
40
+ };
29
41
  }
30
42
  export interface SkillArcaneInfo {
31
43
  IsCooldown: boolean;
package/build/index.es.js CHANGED
@@ -151,7 +151,7 @@ function BuildIconPath(iconPath, iconIndex) {
151
151
  iconPath = iconPath.substring(1);
152
152
  }
153
153
  if (iconPath.startsWith("/Game/")) {
154
- var split = iconPath.split('/');
154
+ var split = iconPath.split("/");
155
155
  var last = split[split.length - 1];
156
156
  var penultimate = split[split.length - 2];
157
157
  if (last === penultimate) {
@@ -280,7 +280,7 @@ function getMoneyObj(money) {
280
280
  var copper = 0;
281
281
  if (money === 0)
282
282
  return null;
283
- var digits = money.toString().split('');
283
+ var digits = money.toString().split("");
284
284
  var realDigits = digits.map(Number);
285
285
  var i = 0;
286
286
  var subCurrencyIndex = [0, 0, 0];
@@ -314,13 +314,29 @@ function getMoneyObj(money) {
314
314
  return {
315
315
  Copper: copper,
316
316
  Gold: gold,
317
- Silver: silver
317
+ Silver: silver,
318
318
  };
319
319
  }
320
320
  function GetSkillMasteryValue(points, arcaneInfo) {
321
321
  if (points <= 0 || arcaneInfo == null)
322
322
  return 0;
323
- return arcaneInfo.IsCooldown ? GetSkillMasteryCdValueForPoints(points, arcaneInfo.CooldownBreakpoints) : GetSkillMasteryValueForPoints(points, arcaneInfo.DamageSections);
323
+ return arcaneInfo.IsCooldown
324
+ ? GetSkillMasteryCdValueForPoints(points, arcaneInfo.CooldownBreakpoints)
325
+ : GetSkillMasteryValueForPoints(points, arcaneInfo.DamageSections);
326
+ }
327
+ function GetSkillMasteryValue2(points, arcaneInfo) {
328
+ if (points <= 0 || arcaneInfo == undefined || arcaneInfo == null)
329
+ return 0;
330
+ if (arcaneInfo.Type === 0)
331
+ return 0; // No modification
332
+ if (arcaneInfo.Type === 1) {
333
+ // Damage modification
334
+ return GetSkillMasteryValueForPoints(points, arcaneInfo.Breakpoints);
335
+ }
336
+ if (arcaneInfo.Type === 2) {
337
+ // Cooldown modification
338
+ return GetSkillMasteryCdValueForPoints(points, arcaneInfo.Breakpoints);
339
+ }
324
340
  }
325
341
  /**
326
342
  * Calculates the cooldown reduction value based on skill mastery points and defined breakpoints.
@@ -8896,6 +8912,13 @@ function SkillConditions(_a) {
8896
8912
  React.createElement("div", { key: i, dangerouslySetInnerHTML: { __html: sub.Text } }))); })));
8897
8913
  }
8898
8914
 
8915
+ var ArcaneModifyType;
8916
+ (function (ArcaneModifyType) {
8917
+ ArcaneModifyType[ArcaneModifyType["None"] = 0] = "None";
8918
+ ArcaneModifyType[ArcaneModifyType["Damage"] = 1] = "Damage";
8919
+ ArcaneModifyType[ArcaneModifyType["Cooldown"] = 2] = "Cooldown";
8920
+ })(ArcaneModifyType || (ArcaneModifyType = {}));
8921
+
8899
8922
  function SkillTooltip(_a) {
8900
8923
  var data = _a.data, _b = _a.debug, debug = _b === void 0 ? false : _b, _c = _a.masteryPoints, masteryPoints = _c === void 0 ? 0 : _c, _d = _a.showZeroMastery, showZeroMastery = _d === void 0 ? false : _d, _e = _a.multi, multi = _e === void 0 ? false : _e;
8901
8924
  var skill = data;
@@ -8919,6 +8942,7 @@ function SkillTooltip(_a) {
8919
8942
  AddSubTexts(tooltipBaseProps.subInfoGroups, skill);
8920
8943
  AddBreakValue(tooltipBaseProps.subInfoGroups, skill);
8921
8944
  AddSkillMastery(tooltipBaseProps.subInfoGroups, masteryPoints, skill.ArcaneInfo, showZeroMastery);
8945
+ AddSkillMastery2(tooltipBaseProps.subInfoGroups, masteryPoints, skill.ArcaneInfo2, showZeroMastery);
8922
8946
  AddPvpModifiers(tooltipBaseProps.subInfoGroups, skill);
8923
8947
  AddBoundaries(tooltipBaseProps.subInfoGroups, skill);
8924
8948
  AddConditions(tooltipBaseProps.subInfoGroups, skill);
@@ -8971,9 +8995,45 @@ function AddBreakValue(subInfoGroups, skill) {
8971
8995
  });
8972
8996
  }
8973
8997
  }
8998
+ function AddSkillMastery2(subInfoGroups, masteryPoints, arcaneInfo2, showZeroMastery) {
8999
+ var _a;
9000
+ if (showZeroMastery === void 0) { showZeroMastery = false; }
9001
+ if (arcaneInfo2 == undefined ||
9002
+ masteryPoints == null ||
9003
+ (masteryPoints == 0 && !showZeroMastery) ||
9004
+ arcaneInfo2 == null)
9005
+ return;
9006
+ var masteryValue = GetSkillMasteryValue2(masteryPoints, arcaneInfo2);
9007
+ if (masteryValue == null)
9008
+ return;
9009
+ var formattedMasteryValue = Number.isInteger(masteryValue)
9010
+ ? masteryValue.toString()
9011
+ : masteryValue.toFixed(2).replace(",", ".");
9012
+ var masteryTypeMap = (_a = {},
9013
+ _a[ArcaneModifyType.Damage] = { label: "Damage increase", unit: "%" },
9014
+ _a[ArcaneModifyType.Cooldown] = { label: "Cooldown reduction", unit: " sec." },
9015
+ _a);
9016
+ subInfoGroups.push({
9017
+ title: "",
9018
+ texts: [
9019
+ React.createElement("div", null,
9020
+ React.createElement("div", { style: { display: "flex", alignItems: "center" } },
9021
+ React.createElement("span", { className: "tooltipArg", style: { fontSize: "14px" } }, "Skill Grandmaster"),
9022
+ React.createElement("div", { className: "arcanemark" }),
9023
+ React.createElement("span", { className: "tooltipArg", style: { fontSize: "14px" } }, masteryPoints)),
9024
+ masteryTypeMap[arcaneInfo2.Type] && (React.createElement("div", null,
9025
+ masteryTypeMap[arcaneInfo2.Type].label,
9026
+ ":\u00A0",
9027
+ React.createElement("span", { className: "tooltipArg" },
9028
+ formattedMasteryValue,
9029
+ masteryTypeMap[arcaneInfo2.Type].unit)))),
9030
+ ],
9031
+ });
9032
+ }
8974
9033
  function AddSkillMastery(subInfoGroups, masteryPoints, arcaneInfo, showZeroMastery) {
8975
9034
  if (showZeroMastery === void 0) { showZeroMastery = false; }
8976
- if (masteryPoints == null ||
9035
+ if (arcaneInfo == undefined ||
9036
+ masteryPoints == null ||
8977
9037
  (masteryPoints == 0 && !showZeroMastery) ||
8978
9038
  arcaneInfo == null)
8979
9039
  return;