bnstooltips 1.18.18 → 1.19.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.
package/build/index.js CHANGED
@@ -1581,6 +1581,7 @@ var BnsItemDto = /** @class */ (function () {
1581
1581
  this.slateStones.push(SlateStoneDto.fromJS(item));
1582
1582
  }
1583
1583
  }
1584
+ this.randomEffects = _data["randomEffects"] ? ItemRandomEffectsDto.fromJS(_data["randomEffects"]) : undefined;
1584
1585
  }
1585
1586
  };
1586
1587
  BnsItemDto.fromJS = function (data) {
@@ -1687,6 +1688,7 @@ var BnsItemDto = /** @class */ (function () {
1687
1688
  data["slateStones"].push(item.toJSON());
1688
1689
  }
1689
1690
  }
1691
+ data["randomEffects"] = this.randomEffects ? this.randomEffects.toJSON() : undefined;
1690
1692
  return data;
1691
1693
  };
1692
1694
  return BnsItemDto;
@@ -1964,6 +1966,37 @@ var ItemDescriptionDto = /** @class */ (function () {
1964
1966
  };
1965
1967
  return ItemDescriptionDto;
1966
1968
  }());
1969
+ var ItemEffectDto = /** @class */ (function () {
1970
+ function ItemEffectDto(data) {
1971
+ if (data) {
1972
+ for (var property in data) {
1973
+ if (data.hasOwnProperty(property))
1974
+ this[property] = data[property];
1975
+ }
1976
+ }
1977
+ }
1978
+ ItemEffectDto.prototype.init = function (_data) {
1979
+ if (_data) {
1980
+ this.id = _data["id"];
1981
+ this.text = _data["text"];
1982
+ this.weight = _data["weight"];
1983
+ }
1984
+ };
1985
+ ItemEffectDto.fromJS = function (data) {
1986
+ data = typeof data === 'object' ? data : {};
1987
+ var result = new ItemEffectDto();
1988
+ result.init(data);
1989
+ return result;
1990
+ };
1991
+ ItemEffectDto.prototype.toJSON = function (data) {
1992
+ data = typeof data === 'object' ? data : {};
1993
+ data["id"] = this.id;
1994
+ data["text"] = this.text;
1995
+ data["weight"] = this.weight;
1996
+ return data;
1997
+ };
1998
+ return ItemEffectDto;
1999
+ }());
1967
2000
  var ItemIconDto = /** @class */ (function () {
1968
2001
  function ItemIconDto(data) {
1969
2002
  if (data) {
@@ -2181,6 +2214,53 @@ var ItemImproveEffectOptionWithNameDto = /** @class */ (function () {
2181
2214
  };
2182
2215
  return ItemImproveEffectOptionWithNameDto;
2183
2216
  }());
2217
+ var ItemRandomEffectsDto = /** @class */ (function () {
2218
+ function ItemRandomEffectsDto(data) {
2219
+ if (data) {
2220
+ for (var property in data) {
2221
+ if (data.hasOwnProperty(property))
2222
+ this[property] = data[property];
2223
+ }
2224
+ }
2225
+ }
2226
+ ItemRandomEffectsDto.prototype.init = function (_data) {
2227
+ if (_data) {
2228
+ this.alias = _data["alias"];
2229
+ this.randomEffectCount = _data["randomEffectCount"];
2230
+ this.totalWeight = _data["totalWeight"];
2231
+ this.itemSkillName = _data["itemSkillName"];
2232
+ if (Array.isArray(_data["randomEffects"])) {
2233
+ this.randomEffects = [];
2234
+ for (var _i = 0, _a = _data["randomEffects"]; _i < _a.length; _i++) {
2235
+ var item = _a[_i];
2236
+ this.randomEffects.push(ItemEffectDto.fromJS(item));
2237
+ }
2238
+ }
2239
+ }
2240
+ };
2241
+ ItemRandomEffectsDto.fromJS = function (data) {
2242
+ data = typeof data === 'object' ? data : {};
2243
+ var result = new ItemRandomEffectsDto();
2244
+ result.init(data);
2245
+ return result;
2246
+ };
2247
+ ItemRandomEffectsDto.prototype.toJSON = function (data) {
2248
+ data = typeof data === 'object' ? data : {};
2249
+ data["alias"] = this.alias;
2250
+ data["randomEffectCount"] = this.randomEffectCount;
2251
+ data["totalWeight"] = this.totalWeight;
2252
+ data["itemSkillName"] = this.itemSkillName;
2253
+ if (Array.isArray(this.randomEffects)) {
2254
+ data["randomEffects"] = [];
2255
+ for (var _i = 0, _a = this.randomEffects; _i < _a.length; _i++) {
2256
+ var item = _a[_i];
2257
+ data["randomEffects"].push(item.toJSON());
2258
+ }
2259
+ }
2260
+ return data;
2261
+ };
2262
+ return ItemRandomEffectsDto;
2263
+ }());
2184
2264
  var ItemRandomStatDto = /** @class */ (function () {
2185
2265
  function ItemRandomStatDto(data) {
2186
2266
  if (data) {
@@ -8252,6 +8332,7 @@ function ItemTooltip(_a) {
8252
8332
  AddJobstyleToggles(setHasSkillModifiers, tooltipBaseProps.subInfoGroups, jobstyles, jobstyle, setJobstyle);
8253
8333
  }
8254
8334
  AddTopText(tooltipBaseProps.subInfoGroups, item);
8335
+ AddRandomEffects(tooltipBaseProps.subInfoGroups, item);
8255
8336
  AddSkillDescriptions(tooltipBaseProps.subInfoGroups, item, itemCombats, jobstyle);
8256
8337
  AddSkillModifiers(tooltipBaseProps.subInfoGroups, item, false, jobstyle);
8257
8338
  AddEtchingStones(tooltipBaseProps.subInfoGroups, item);
@@ -8325,6 +8406,18 @@ function AddTopText(subInfoGroups, item) {
8325
8406
  texts: [React__default["default"].createElement(TopText, __assign({}, item))],
8326
8407
  });
8327
8408
  }
8409
+ function AddRandomEffects(subInfoGroups, item) {
8410
+ if (item.randomEffects == null || item.randomEffects.randomEffectCount == 0 || item.randomEffects.randomEffects == null || item.randomEffects.randomEffects.length == 0)
8411
+ return;
8412
+ subInfoGroups.push({
8413
+ title: "",
8414
+ texts: [
8415
+ React__default["default"].createElement("div", null,
8416
+ React__default["default"].createElement("div", { id: item.randomEffects.alias, dangerouslySetInnerHTML: { __html: item.randomEffects.itemSkillName } }),
8417
+ item.randomEffects.randomEffects.map(function (effect) { return (React__default["default"].createElement("div", { key: item.randomEffects.alias + "_" + effect.id, dangerouslySetInnerHTML: { __html: effect.text } })); }))
8418
+ ]
8419
+ });
8420
+ }
8328
8421
  function AddSkillDescriptions(subInfoGroups, item, itemCombats, jobstyle) {
8329
8422
  if (item.skills == null || item.skills.length == 0)
8330
8423
  return;
@@ -8354,6 +8447,14 @@ function AddRandomSubStatCount(subInfoGroups, item) {
8354
8447
  React__default["default"].createElement("span", { className: "00008130.UI.Label_Green03_12" }, item.randomSubStatCount),
8355
8448
  "\u00A0random secondary stat(s).")]
8356
8449
  });
8450
+ if (item.randomEffects != null && item.randomEffects.randomEffects.length > 1)
8451
+ subInfoGroups.push({
8452
+ title: "Random effects:",
8453
+ texts: [React__default["default"].createElement("div", { className: "00008130.UI.Vital_LightBlue" },
8454
+ "This item has\u00A0",
8455
+ React__default["default"].createElement("span", { className: "00008130.UI.Label_Green03_12" }, item.randomEffects.randomEffectCount),
8456
+ "\u00A0random effect(s).")]
8457
+ });
8357
8458
  }
8358
8459
  function AddSetBonus(subInfoGroups, item, jobstyle) {
8359
8460
  if (item.setBonus == null)