@wfcd/profile-parser 1.5.0 → 2.0.1
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/Ability-D1F1s_19.js +25 -0
- package/dist/Ability-DzKgEG5R.d.ts +19 -0
- package/dist/Ability.d.ts +2 -0
- package/dist/Ability.js +3 -0
- package/dist/ArchonCrystal.d.ts +23 -0
- package/dist/ArchonCrystal.js +29 -0
- package/dist/ChallengeProgress-B8Kv32oi.d.ts +20 -0
- package/dist/ChallengeProgress-DKKtijWw.js +26 -0
- package/dist/ChallengeProgress.d.ts +2 -0
- package/dist/ChallengeProgress.js +3 -0
- package/dist/Enemy-BqxhFdkB.js +44 -0
- package/dist/Enemy-toy1Spyi.d.ts +44 -0
- package/dist/Enemy.d.ts +2 -0
- package/dist/Enemy.js +3 -0
- package/dist/Intrinsics-CqFOpLxp.js +67 -0
- package/dist/Intrinsics-azrsOZJd.d.ts +67 -0
- package/dist/Intrinsics.d.ts +2 -0
- package/dist/Intrinsics.js +3 -0
- package/dist/ItemConfig-7as-gjPG.d.ts +51 -0
- package/dist/ItemConfig-uU36aJFJ.js +50 -0
- package/dist/ItemConfig.d.ts +4 -0
- package/dist/ItemConfig.js +5 -0
- package/dist/LoadOutInventory-BsPRtXfG.d.ts +53 -0
- package/dist/LoadOutInventory-CPVZJ_W5.js +52 -0
- package/dist/LoadOutInventory.d.ts +8 -0
- package/dist/LoadOutInventory.js +9 -0
- package/dist/LoadOutItem-B_6G9dXC.js +127 -0
- package/dist/LoadOutItem-BlRFZMNd.d.ts +120 -0
- package/dist/LoadOutItem.d.ts +6 -0
- package/dist/LoadOutItem.js +7 -0
- package/dist/LoadOutPreset-BshJF0LH.d.ts +83 -0
- package/dist/LoadOutPreset-CMbZo-II.js +83 -0
- package/dist/LoadOutPreset.d.ts +2 -0
- package/dist/LoadOutPreset.js +4 -0
- package/dist/Mission-BZgLMluh.d.ts +53 -0
- package/dist/Mission-D2n1i5R2.js +55 -0
- package/dist/Mission.d.ts +2 -0
- package/dist/Mission.js +3 -0
- package/dist/OperatorLoadOuts-B8bEy2dp.js +76 -0
- package/dist/OperatorLoadOuts-Dk2uMwby.d.ts +75 -0
- package/dist/OperatorLoadOuts.d.ts +4 -0
- package/dist/OperatorLoadOuts.js +5 -0
- package/dist/Polarity--RYq3iwF.js +28 -0
- package/dist/Polarity-DDWqEVm2.d.ts +26 -0
- package/dist/Polarity.d.ts +2 -0
- package/dist/Polarity.js +3 -0
- package/dist/Profile-WWZ2BDf0.js +193 -0
- package/dist/Profile-rva_Xss5.d.ts +212 -0
- package/dist/Profile.d.ts +15 -0
- package/dist/Profile.js +16 -0
- package/dist/ProfileParser.d.ts +71 -0
- package/dist/ProfileParser.js +71 -0
- package/dist/Pvp-Cb1KNKvw.d.ts +36 -0
- package/dist/Pvp-hyzYfVBB.js +36 -0
- package/dist/Pvp.d.ts +2 -0
- package/dist/Pvp.js +3 -0
- package/dist/Race-5Q0StEkE.js +35 -0
- package/dist/Race-DCxzjMpC.d.ts +32 -0
- package/dist/Race.d.ts +2 -0
- package/dist/Race.js +3 -0
- package/dist/Scan-BWfZiLoW.d.ts +27 -0
- package/dist/Scan-Dlrv6viG.js +27 -0
- package/dist/Scan.d.ts +2 -0
- package/dist/Scan.js +3 -0
- package/dist/Skin-BbUkegH1.d.ts +28 -0
- package/dist/Skin-D6v6jC9U.js +36 -0
- package/dist/Skin.d.ts +2 -0
- package/dist/Skin.js +4 -0
- package/dist/Stats-Bm1bpQe5.js +305 -0
- package/dist/Stats-DtkR2w1A.d.ts +325 -0
- package/dist/Stats.d.ts +9 -0
- package/dist/Stats.js +10 -0
- package/dist/Syndicate-CjUKKAsk.js +33 -0
- package/dist/Syndicate-FSUt1PP5.d.ts +33 -0
- package/dist/Syndicate.d.ts +2 -0
- package/dist/Syndicate.js +3 -0
- package/dist/Utils-C3kZCO6a.js +60 -0
- package/dist/Utils-C7BZqK4e.d.ts +37 -0
- package/dist/Utils.d.ts +2 -0
- package/dist/Utils.js +3 -0
- package/dist/Weapon-4KlXEHQF.js +64 -0
- package/dist/Weapon-DAJp-nbn.d.ts +32 -0
- package/dist/Weapon.d.ts +2 -0
- package/dist/Weapon.js +3 -0
- package/dist/XpInfo-CXC3I0NQ.js +35 -0
- package/dist/XpInfo-ChJ_lJaH.d.ts +34 -0
- package/dist/XpInfo.d.ts +2 -0
- package/dist/XpInfo.js +4 -0
- package/package.json +34 -32
- package/src/Ability.js +0 -22
- package/src/ArchonCrystal.js +0 -26
- package/src/ChallengeProgress.js +0 -23
- package/src/Enemy.js +0 -47
- package/src/Intrinsics.js +0 -77
- package/src/ItemConfig.js +0 -52
- package/src/LoadOutInventory.js +0 -53
- package/src/LoadOutItem.js +0 -155
- package/src/LoadOutPreset.js +0 -90
- package/src/Mission.js +0 -58
- package/src/OperatorLoadOuts.js +0 -77
- package/src/Polarity.js +0 -25
- package/src/Profile.js +0 -213
- package/src/ProfileParser.js +0 -50
- package/src/Pvp.js +0 -35
- package/src/Race.js +0 -33
- package/src/Scan.js +0 -22
- package/src/Skin.js +0 -33
- package/src/Stats.js +0 -340
- package/src/Syndicate.js +0 -34
- package/src/Utils.js +0 -66
- package/src/Weapon.js +0 -59
- package/src/XpInfo.js +0 -35
- package/types/Ability.d.ts +0 -20
- package/types/ArchonCrystal.d.ts +0 -22
- package/types/ChallengeProgress.d.ts +0 -21
- package/types/Enemy.d.ts +0 -41
- package/types/Intrinsics.d.ts +0 -66
- package/types/ItemConfig.d.ts +0 -21
- package/types/LoadOutInventory.d.ts +0 -45
- package/types/LoadOutItem.d.ts +0 -92
- package/types/LoadOutPreset.d.ts +0 -45
- package/types/Mission.d.ts +0 -35
- package/types/OperatorLoadOuts.d.ts +0 -35
- package/types/Polarity.d.ts +0 -21
- package/types/Profile.d.ts +0 -154
- package/types/ProfileParser.d.ts +0 -41
- package/types/Pvp.d.ts +0 -31
- package/types/Race.d.ts +0 -28
- package/types/Scan.d.ts +0 -20
- package/types/Skin.d.ts +0 -19
- package/types/Stats.d.ts +0 -255
- package/types/Syndicate.d.ts +0 -26
- package/types/Utils.d.ts +0 -3
- package/types/Weapon.d.ts +0 -51
- package/types/XpInfo.d.ts +0 -28
package/dist/XpInfo.js
ADDED
package/package.json
CHANGED
|
@@ -1,56 +1,58 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wfcd/profile-parser",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Parser for Digital Extreme's profile data",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "src/ProfileParser.js",
|
|
7
6
|
"exports": {
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
7
|
+
"./Parser": {
|
|
8
|
+
"types": "./dist/ProfileParser.d.ts",
|
|
9
|
+
"default": "./dist/ProfileParser.js"
|
|
10
|
+
},
|
|
11
|
+
"./Profile": {
|
|
12
|
+
"types": "./dist/Profile.d.ts",
|
|
13
|
+
"default": "./dist/Profile.js"
|
|
11
14
|
},
|
|
12
15
|
"./XpInfo": {
|
|
13
|
-
"
|
|
14
|
-
"
|
|
16
|
+
"types": "./dist/XpInfo.d.ts",
|
|
17
|
+
"default": "./dist/XpInfo.js"
|
|
15
18
|
},
|
|
16
19
|
"./Stats": {
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
},
|
|
20
|
-
"./Profile": {
|
|
21
|
-
"import": "./src/Profile.js",
|
|
22
|
-
"types": "./types/index.d.ts"
|
|
20
|
+
"types": "./dist/Stats.d.ts",
|
|
21
|
+
"default": "./dist/Stats.js"
|
|
23
22
|
}
|
|
24
23
|
},
|
|
25
24
|
"public": true,
|
|
26
25
|
"files": [
|
|
27
|
-
"
|
|
26
|
+
"dist",
|
|
28
27
|
"LICENSE",
|
|
29
28
|
"README.md",
|
|
30
29
|
"types"
|
|
31
30
|
],
|
|
32
31
|
"devDependencies": {
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
35
|
-
"
|
|
36
|
-
"
|
|
32
|
+
"@biomejs/biome": "2.0.6",
|
|
33
|
+
"@types/chai": "^5.2.2",
|
|
34
|
+
"@types/mocha": "^10.0.10",
|
|
35
|
+
"@wfcd/eslint-config": "^1.6.3",
|
|
36
|
+
"c8": "^10.1.3",
|
|
37
|
+
"chai": "^5.2.0",
|
|
37
38
|
"chai-json-equal": "^0.0.1",
|
|
38
39
|
"coveralls": "^3.1.1",
|
|
39
|
-
"husky": "^9.
|
|
40
|
-
"install-peerdeps": "^3.0.
|
|
41
|
-
"lint-staged": "^
|
|
42
|
-
"mocha": "^
|
|
43
|
-
"
|
|
40
|
+
"husky": "^9.1.7",
|
|
41
|
+
"install-peerdeps": "^3.0.7",
|
|
42
|
+
"lint-staged": "^16.1.2",
|
|
43
|
+
"mocha": "^11.7.1",
|
|
44
|
+
"tsdown": "^0.12.9",
|
|
45
|
+
"tsx": "^4.20.3",
|
|
46
|
+
"typescript": "^5.8.3"
|
|
44
47
|
},
|
|
45
48
|
"scripts": {
|
|
46
|
-
"
|
|
49
|
+
"build": "tsdown",
|
|
50
|
+
"build:docs": "tsdown && jsdoc -c .github/docs/conf.json -d docs",
|
|
47
51
|
"coverage": "npm test && c8 report --reporter=text-lcov | coveralls",
|
|
48
|
-
"lint": "
|
|
49
|
-
"lint:fix": "
|
|
50
|
-
"prepublishOnly": "npm run build
|
|
51
|
-
"
|
|
52
|
-
"build:types": "tsc -p tsconfig.declaration.json",
|
|
53
|
-
"prepare": "husky && if [ \"$NODE_ENV\" = \"dev\" ] ; then npx -p install-peerdeps@latest install-peerdeps @wfcd/eslint-config@latest -S ; fi"
|
|
52
|
+
"lint": "biome lint",
|
|
53
|
+
"lint:fix": "biome lint --write",
|
|
54
|
+
"prepublishOnly": "npm run build",
|
|
55
|
+
"test": "c8 mocha"
|
|
54
56
|
},
|
|
55
57
|
"author": "SlayerOrnstein",
|
|
56
58
|
"license": "MIT",
|
|
@@ -58,7 +60,7 @@
|
|
|
58
60
|
"node": ">=20.0.0"
|
|
59
61
|
},
|
|
60
62
|
"peerDependencies": {
|
|
61
|
-
"@wfcd/items": "^1.1270.
|
|
62
|
-
"warframe-worldstate-data": "^
|
|
63
|
+
"@wfcd/items": "^1.1270.626",
|
|
64
|
+
"warframe-worldstate-data": "^3.0.0"
|
|
63
65
|
}
|
|
64
66
|
}
|
package/src/Ability.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents a players used ability
|
|
3
|
-
* @module
|
|
4
|
-
*/
|
|
5
|
-
export default class Ability {
|
|
6
|
-
/**
|
|
7
|
-
* @param {Object} ability The ability
|
|
8
|
-
*/
|
|
9
|
-
constructor(ability) {
|
|
10
|
-
/**
|
|
11
|
-
* The ability unique name
|
|
12
|
-
* @type {String}
|
|
13
|
-
*/
|
|
14
|
-
this.uniqueName = ability.type;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* How many time the ability was used in the player's lifetime
|
|
18
|
-
* @type {number}
|
|
19
|
-
*/
|
|
20
|
-
this.used = ability.used;
|
|
21
|
-
}
|
|
22
|
-
}
|
package/src/ArchonCrystal.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { archonShardColor, archonShardUpgradeType } from 'warframe-worldstate-data/utilities';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Represents an Archon shard
|
|
5
|
-
* @module
|
|
6
|
-
*/
|
|
7
|
-
export default class ArchonCrystal {
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* @param {Object} crystal The archon crystal object
|
|
11
|
-
* @param {string} locale The locale to get translations in
|
|
12
|
-
*/
|
|
13
|
-
constructor(crystal, locale = 'en') {
|
|
14
|
-
/**
|
|
15
|
-
* Archon shard color
|
|
16
|
-
* @type {String}
|
|
17
|
-
*/
|
|
18
|
-
this.color = archonShardColor(crystal.Color, locale);
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Archon shard modifier
|
|
22
|
-
* @type {String}
|
|
23
|
-
*/
|
|
24
|
-
this.modifier = archonShardUpgradeType(crystal.Color, crystal.UpgradeType, locale);
|
|
25
|
-
}
|
|
26
|
-
}
|
package/src/ChallengeProgress.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Player completed or in progress challenges
|
|
3
|
-
* @module
|
|
4
|
-
*/
|
|
5
|
-
export default class ChallengeProgress {
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
-
* @param {Object} challenge The challenge object to parse
|
|
9
|
-
*/
|
|
10
|
-
constructor(challenge) {
|
|
11
|
-
/**
|
|
12
|
-
* Name of the challenge
|
|
13
|
-
* @type {String}
|
|
14
|
-
*/
|
|
15
|
-
this.name = challenge.Name;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Progress towards completing this challenge
|
|
19
|
-
* @type {number}
|
|
20
|
-
*/
|
|
21
|
-
this.progress = challenge.Progress;
|
|
22
|
-
}
|
|
23
|
-
}
|
package/src/Enemy.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* An enemy killed/executed by player
|
|
3
|
-
* @module
|
|
4
|
-
*/
|
|
5
|
-
export default class Enemy {
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
-
* @param {Object} enemy The enemy
|
|
9
|
-
*/
|
|
10
|
-
constructor(enemy) {
|
|
11
|
-
/**
|
|
12
|
-
* Enenmy's unique name
|
|
13
|
-
* @type {String}
|
|
14
|
-
*/
|
|
15
|
-
this.uniqueName = enemy.type;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* How many times the player has killed this enemy type
|
|
19
|
-
* @type {number}
|
|
20
|
-
*/
|
|
21
|
-
this.kills = enemy.kills;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* The amount of kills that were headshots
|
|
25
|
-
* @type {number}
|
|
26
|
-
*/
|
|
27
|
-
this.headshots = enemy.headshots;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* The amount of kills that were finishers
|
|
31
|
-
* @type {number}
|
|
32
|
-
*/
|
|
33
|
-
this.executions = enemy.executions;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* The amount of kills that were assits
|
|
37
|
-
* @type {number}
|
|
38
|
-
*/
|
|
39
|
-
this.assists = enemy.assists;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* How many times this enemy type has killed the player
|
|
43
|
-
* @type {number}
|
|
44
|
-
*/
|
|
45
|
-
this.deaths = enemy.deaths;
|
|
46
|
-
}
|
|
47
|
-
}
|
package/src/Intrinsics.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Player's intrinsics ranks
|
|
3
|
-
* @module
|
|
4
|
-
*/
|
|
5
|
-
export default class Intrinsics {
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
-
* @param {Object} skills The intrinsics object
|
|
9
|
-
*/
|
|
10
|
-
constructor(skills) {
|
|
11
|
-
/**
|
|
12
|
-
* Intrinsic points for railjack
|
|
13
|
-
* @type {number}
|
|
14
|
-
*/
|
|
15
|
-
this.railjack = Math.floor((skills.LPP_SPACE ?? 0) / 1000);
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Railjack engineering rank
|
|
19
|
-
* @type {number}
|
|
20
|
-
*/
|
|
21
|
-
this.engineering = skills.LPS_ENGINEERING ?? 0;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Railjack gunnery rank
|
|
25
|
-
* @type {number}
|
|
26
|
-
*/
|
|
27
|
-
this.gunnery = skills.LPS_GUNNERY ?? 0;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Railjack piloting rank
|
|
31
|
-
* @type {number}
|
|
32
|
-
*/
|
|
33
|
-
this.piloting = skills.LPS_PILOTING ?? 0;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Railjack tactical rank
|
|
37
|
-
* @type {number}
|
|
38
|
-
*/
|
|
39
|
-
this.tactical = skills.LPS_TACTICAL ?? 0;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Railjack command rank
|
|
43
|
-
* @type {number}
|
|
44
|
-
*/
|
|
45
|
-
this.command = skills.LPS_COMMAND ?? 0;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Intrinsic points for railjack
|
|
49
|
-
* @type {number}
|
|
50
|
-
*/
|
|
51
|
-
this.drifter = Math.floor((skills.LPP_DRIFTER ?? 0) / 1000);
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Drifter riding rank
|
|
55
|
-
* @type {number}
|
|
56
|
-
*/
|
|
57
|
-
this.riding = skills.LPS_DRIFT_RIDING ?? 0;
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Drifter combat rank
|
|
61
|
-
* @type {number}
|
|
62
|
-
*/
|
|
63
|
-
this.combat = skills.LPS_DRIFT_COMBAT ?? 0;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Drifter opportunity rank
|
|
67
|
-
* @type {number}
|
|
68
|
-
*/
|
|
69
|
-
this.opportunity = skills.LPS_DRIFT_OPPORTUNITY ?? 0;
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Drifter endurance rank
|
|
73
|
-
* @type {number}
|
|
74
|
-
*/
|
|
75
|
-
this.endurance = skills.LPS_DRIFT_ENDURANCE ?? 0;
|
|
76
|
-
}
|
|
77
|
-
}
|
package/src/ItemConfig.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { colors } from '@wfcd/items/utilities';
|
|
2
|
-
|
|
3
|
-
import Skin from './Skin.js';
|
|
4
|
-
import { mapToHex } from './Utils.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Item customizations such as colors and applied skins
|
|
8
|
-
* @module
|
|
9
|
-
*/
|
|
10
|
-
export default class ItemConfig {
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
* @param {Object} config The configuration
|
|
14
|
-
*/
|
|
15
|
-
constructor(config) {
|
|
16
|
-
/**
|
|
17
|
-
* Array of unique names for the skins applied to item
|
|
18
|
-
* @type {Array<String> | undefined}
|
|
19
|
-
*/
|
|
20
|
-
this.skins = config.Skins?.filter(Boolean).map((s) => new Skin({ ItemType: s }));
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Array of PVP unique name upgrades applied
|
|
24
|
-
* @type {Array<String>}
|
|
25
|
-
*/
|
|
26
|
-
if (config.PvpUpgrades) this.conclaveUpgrades = config.PvpUpgrades;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Primary colors applied to item if they exist
|
|
30
|
-
* @type {module:"@wfcd/items".ColorMap | undefined}
|
|
31
|
-
*/
|
|
32
|
-
if (config.pricol) this.primaryColor = colors.mapColors(mapToHex(config.pricol));
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Sigil colors applied to item if they exist
|
|
36
|
-
* @type {module:"@wfcd/items".ColorMap | undefined}
|
|
37
|
-
*/
|
|
38
|
-
if (config.sigcol) this.sigilColor = colors.mapColors(mapToHex(config.sigcol));
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Attachment colors applied to item if they exist
|
|
42
|
-
* @type {module:"@wfcd/items".ColorMap | undefined}
|
|
43
|
-
*/
|
|
44
|
-
if (config.attcol) this.attachmentsColor = colors.mapColors(mapToHex(config.attcol));
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Syandana colors applied to item if they exist
|
|
48
|
-
* @type {module:"@wfcd/items".ColorMap | undefined}
|
|
49
|
-
*/
|
|
50
|
-
if (config.syancol) this.syandanaColor = colors.mapColors(mapToHex(config.syancol));
|
|
51
|
-
}
|
|
52
|
-
}
|
package/src/LoadOutInventory.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import LoadOutItem from './LoadOutItem.js';
|
|
2
|
-
import Skin from './Skin.js';
|
|
3
|
-
import XpInfo from './XpInfo.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Player loudout
|
|
7
|
-
* @module
|
|
8
|
-
*/
|
|
9
|
-
export default class LoadOutInventory {
|
|
10
|
-
/**
|
|
11
|
-
*
|
|
12
|
-
* @param {Object} item The loadout data
|
|
13
|
-
* @param {string} [locale='en'] The locale to return loudout items in
|
|
14
|
-
* @param {boolean} [withItem=false] Whether or not to include items
|
|
15
|
-
*/
|
|
16
|
-
constructor(item, locale = 'en', withItem = false) {
|
|
17
|
-
/**
|
|
18
|
-
* Skins applied to weapons
|
|
19
|
-
* @type {WeaponSkin}
|
|
20
|
-
*/
|
|
21
|
-
this.weaponSkins = item.WeaponSkins.map((s) => new Skin(s));
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* An array of the player's currently equiped Warframe (or powersuits)
|
|
25
|
-
* @type {LoadOutItem}
|
|
26
|
-
*/
|
|
27
|
-
this.suits = item.Suits.map((s) => new LoadOutItem(s, locale));
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* An array of the player's currently equiped secondary weapon
|
|
31
|
-
* @type {LoadOutItem | undefined}
|
|
32
|
-
*/
|
|
33
|
-
this.secondary = item.Pistols?.map((p) => new LoadOutItem(p, locale));
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* An array of the player's currently equiped primary weapon
|
|
37
|
-
* @type {LoadOutItem | undefined}
|
|
38
|
-
*/
|
|
39
|
-
this.primary = item.LongGuns?.map((lg) => new LoadOutItem(lg, locale));
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* An array of the player's currently equiped melee weapon
|
|
43
|
-
* @type {LoadOutItem | undefined}
|
|
44
|
-
*/
|
|
45
|
-
this.melee = item.Melee?.map((m) => new LoadOutItem(m, locale));
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Items that have counted towards the players mastery rank
|
|
49
|
-
* @type {XpInfo}
|
|
50
|
-
*/
|
|
51
|
-
this.xpInfo = item.XPInfo.map((xp) => new XpInfo(xp, locale, withItem));
|
|
52
|
-
}
|
|
53
|
-
}
|
package/src/LoadOutItem.js
DELETED
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import { colors } from '@wfcd/items/utilities';
|
|
2
|
-
import { parseDate, toTitleCase } from 'warframe-worldstate-data/utilities';
|
|
3
|
-
|
|
4
|
-
import ItemConfig from './ItemConfig.js';
|
|
5
|
-
import Polarity from './Polarity.js';
|
|
6
|
-
import { find } from './Utils.js';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* An an item in LoadOutInventory
|
|
10
|
-
* @module
|
|
11
|
-
*/
|
|
12
|
-
export default class LoadOutItem {
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* @param {Object} weapon The loadout item from LoadoutInventory
|
|
16
|
-
* @param {string} [locale='en'] The locale to return item in
|
|
17
|
-
*/
|
|
18
|
-
constructor(weapon, locale = 'en') {
|
|
19
|
-
/**
|
|
20
|
-
* Item ID
|
|
21
|
-
* @type {String}
|
|
22
|
-
*/
|
|
23
|
-
this.itemId = weapon.ItemId.$oid;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Item unique name
|
|
27
|
-
* @type {String}
|
|
28
|
-
*/
|
|
29
|
-
this.uniqueName = weapon.ItemType;
|
|
30
|
-
|
|
31
|
-
const item = find(weapon.ItemType, locale);
|
|
32
|
-
if (item) {
|
|
33
|
-
/**
|
|
34
|
-
* Item in-game name
|
|
35
|
-
* @type {String}
|
|
36
|
-
*/
|
|
37
|
-
this.name = item.name;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Complete item from @wfcd/items
|
|
41
|
-
* @type {module:"@wfcd/items".Item}
|
|
42
|
-
*/
|
|
43
|
-
this.item = item;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (weapon.ItemName) {
|
|
47
|
-
const [, nemesis] = weapon.ItemName.split('|');
|
|
48
|
-
|
|
49
|
-
if (nemesis !== undefined) {
|
|
50
|
-
/**
|
|
51
|
-
* The name of the Lich, Sister, or Technocyte
|
|
52
|
-
* @type {String}
|
|
53
|
-
*/
|
|
54
|
-
this.nemesis = toTitleCase(nemesis);
|
|
55
|
-
} else {
|
|
56
|
-
this.name = weapon.ItemName;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Configuration for this weapon. Such as colors and skins applied by the player
|
|
62
|
-
* @type {Array<ItemConfig>}
|
|
63
|
-
*/
|
|
64
|
-
this.configs = weapon.Configs.map((c) => new ItemConfig(c));
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* The upgrade that was applied to this weapon
|
|
68
|
-
* @type {String}
|
|
69
|
-
*/
|
|
70
|
-
if (weapon.upgradeType) this.upgradeType = weapon.UpgradeType;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Information on the upgradeType that was applied
|
|
74
|
-
* TODO need model for for fingerprint
|
|
75
|
-
*/
|
|
76
|
-
this.upgradeFingerprint = weapon.UpgradeFingerprint;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* @type {number}
|
|
80
|
-
*/
|
|
81
|
-
this.features = weapon.Features;
|
|
82
|
-
|
|
83
|
-
// Not sure what this is for
|
|
84
|
-
/**
|
|
85
|
-
* @type {number}
|
|
86
|
-
*/
|
|
87
|
-
this.upgradeVer = weapon.UpgradeVer;
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* XP earned with this weapon
|
|
91
|
-
* @type {number}
|
|
92
|
-
*/
|
|
93
|
-
this.xp = weapon.XP;
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* How many mod slots are currently polarized.
|
|
97
|
-
* @type {number}
|
|
98
|
-
*/
|
|
99
|
-
this.polarized = weapon.Polarized;
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Which polarity types exist on the weapon
|
|
103
|
-
* @type {Array<Polarity> | undefined}
|
|
104
|
-
*/
|
|
105
|
-
this.polarity = weapon.Polarity?.map((p) => new Polarity(p));
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Focus lens applied
|
|
109
|
-
* @type {String}
|
|
110
|
-
*/
|
|
111
|
-
this.focuseLens = weapon.FocusLens;
|
|
112
|
-
|
|
113
|
-
// Not sure what this is for
|
|
114
|
-
/**
|
|
115
|
-
* @type {number}
|
|
116
|
-
*/
|
|
117
|
-
this.customizationSlotPurchases = weapon.CustomizationSlotPurchases;
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Primary colors applied to item if they exist
|
|
121
|
-
* @type {module:"@wfcd/items".ColorMap | undefined}
|
|
122
|
-
*/
|
|
123
|
-
if (weapon.pricol) this.primaryColor = colors.mapColors(weapon.pricol);
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Sigil colors applied to item if they exist
|
|
127
|
-
* @type {module:"@wfcd/items".ColorMap | undefined}
|
|
128
|
-
*/
|
|
129
|
-
if (weapon.sigcol) this.sigilColor = colors.mapColors(weapon.sigcol.toString(16));
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* Whether prime details are enabled or not
|
|
133
|
-
* @type {boolean}
|
|
134
|
-
*/
|
|
135
|
-
this.enablePrime = weapon.ugly ?? false;
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Attachment colors applied to item if they exist
|
|
139
|
-
* @type {module:"@wfcd/items".ColorMap | undefined}
|
|
140
|
-
*/
|
|
141
|
-
if (weapon.attcol) this.attachmentsColor = colors.mapColors(weapon.attcol.toString(16));
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Syandana colors applied to item if they exist
|
|
145
|
-
* @type {module:"@wfcd/items".ColorMap | undefined}
|
|
146
|
-
*/
|
|
147
|
-
if (weapon.syancol) this.syandanaColor = colors.mapColors(weapon.syancol.toString(16));
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* If set will show when the player's warframe was infested.
|
|
151
|
-
* @type {module:"@wfcd/items".ColorMap | undefined}
|
|
152
|
-
*/
|
|
153
|
-
if (weapon.InfestationDate) this.infestationDate = parseDate(weapon.InfestationDate);
|
|
154
|
-
}
|
|
155
|
-
}
|
package/src/LoadOutPreset.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { translatePolarity } from 'warframe-worldstate-data/utilities';
|
|
2
|
-
|
|
3
|
-
import { numberToLetter } from './Utils.js';
|
|
4
|
-
|
|
5
|
-
class SlotPreset {
|
|
6
|
-
constructor(slot) {
|
|
7
|
-
if (slot?.ItemId?.$oid) this.id = slot.ItemId.$oid;
|
|
8
|
-
|
|
9
|
-
if (slot?.mod !== undefined) this.modPreset = numberToLetter(slot.mod);
|
|
10
|
-
|
|
11
|
-
if (slot?.cus !== undefined) this.appearancePreset = numberToLetter(slot.cus);
|
|
12
|
-
|
|
13
|
-
this.isHidden = slot?.hide ?? false;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export default class LoadOutPreset {
|
|
18
|
-
constructor(preset) {
|
|
19
|
-
/**
|
|
20
|
-
* Focus School
|
|
21
|
-
* @type {String}
|
|
22
|
-
*/
|
|
23
|
-
this.focusSchool = translatePolarity(preset.FocusSchool);
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Preset icon
|
|
27
|
-
*
|
|
28
|
-
* Note:
|
|
29
|
-
* Icon in-game seems to be an image of whatever Warframe is equipped on it
|
|
30
|
-
* @type {String}
|
|
31
|
-
*/
|
|
32
|
-
this.icon = preset.PresetIcon;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Whether this preset is a favorite
|
|
36
|
-
* @type {boolean}
|
|
37
|
-
*/
|
|
38
|
-
this.isFavorite = preset.Favorite;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Preset name
|
|
42
|
-
* @type {String}
|
|
43
|
-
*/
|
|
44
|
-
this.name = preset.n;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Warframe equipped in preset
|
|
48
|
-
* @type {SlotPreset}
|
|
49
|
-
*/
|
|
50
|
-
this.warframe = new SlotPreset(preset.s);
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Primary equipped in preset
|
|
54
|
-
* @type {SlotPreset}
|
|
55
|
-
*/
|
|
56
|
-
if (preset.l) this.primary = new SlotPreset(preset.l);
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Secondary equipped in preset
|
|
60
|
-
* @type {SlotPreset}
|
|
61
|
-
*/
|
|
62
|
-
if (preset.p) this.secondary = new SlotPreset(preset.p);
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Heavy equipped in preset
|
|
66
|
-
* @type {SlotPreset}
|
|
67
|
-
*/
|
|
68
|
-
if (preset.h) this.heavy = new SlotPreset(preset.h);
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Melee equiped in preset
|
|
72
|
-
* @type {SlotPreset}
|
|
73
|
-
*/
|
|
74
|
-
if (preset.m) this.melee = new SlotPreset(preset.m);
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Exalted ability
|
|
78
|
-
* @type {SlotPreset}
|
|
79
|
-
*/
|
|
80
|
-
if (preset.a) this.exalted = new SlotPreset(preset.a);
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Secondary exalted ability
|
|
84
|
-
*
|
|
85
|
-
* i.e Sevagoth has his shadow and his shadow's claws both of which can be modded separately
|
|
86
|
-
* @type {SlotPreset}
|
|
87
|
-
*/
|
|
88
|
-
if (preset.b) this.exaltedB = new SlotPreset(preset.b);
|
|
89
|
-
}
|
|
90
|
-
}
|