UNPKG

fnbr

Version:

A library to interact with Epic Games' Fortnite HTTP and XMPP services

40 lines 1.57 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const Util_1 = require("../../util/Util"); const STWItem_1 = tslib_1.__importDefault(require("./STWItem")); /** * Represents a Save The World profile's schematic */ class STWSchematic extends STWItem_1.default { constructor(client, id, data) { super(client, id, data); const parsedSchematic = (0, Util_1.parseSTWSchematicTemplateId)(data.templateId); this.type = parsedSchematic.type; this.subType = parsedSchematic.subType; this.name = parsedSchematic.name; this.tier = parsedSchematic.tier; this.evoType = parsedSchematic.evoType; this.rarity = parsedSchematic.rarity; this.level = data.attributes.level; this.maxLevelBonus = data.attributes.max_level_bonus; this.xp = data.attributes.xp; this.isSeen = data.attributes.item_seen; this.isFavorite = data.attributes.favorite; this.isRefundable = data.attributes.refundable; this.alterations = data.attributes.alterations; this.alterationBaseRarities = data.attributes.alteration_base_rarities; } /** * The schematic's power level. * Depends on the tier, level, and rarity value */ get powerLevel() { if (!this.rarity || !this.tier) { return 1; } return (0, Util_1.calcSTWNonSurvivorPowerLevel)(this.rarity, this.level, this.tier); } } exports.default = STWSchematic; //# sourceMappingURL=STWSchematic.js.map