Skip to content

Commit fef0125

Browse files
committed
feat(character): add support for parsing Reaper and Sage levels and as active class
fixes #19
1 parent c74514c commit fef0125

8 files changed

Lines changed: 2830 additions & 188 deletions

File tree

docs/api/classes/client_LodestoneClient.default.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Client for interfacing with the Final Fantasy XIV Lodestone.
2929

3030
#### Defined in
3131

32-
[LodestoneClient.ts:53](https://github.com/XIVStats/lodestone/blob/f3bda9e/src/client/LodestoneClient.ts#L53)
32+
[LodestoneClient.ts:53](https://github.com/XIVStats/lodestone/blob/c74514c/src/client/LodestoneClient.ts#L53)
3333

3434
## Properties
3535

@@ -43,4 +43,4 @@ An instance will be generated by default, but as a consumer you can provide your
4343

4444
#### Defined in
4545

46-
[LodestoneClient.ts:49](https://github.com/XIVStats/lodestone/blob/f3bda9e/src/client/LodestoneClient.ts#L49)
46+
[LodestoneClient.ts:49](https://github.com/XIVStats/lodestone/blob/c74514c/src/client/LodestoneClient.ts#L49)

src/config/ClassConfig.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,10 @@ export default class ClassConfig {
6565
className: Class.Astrologian,
6666
imagePath: 'lds/h/3/umwvB9TpD5eWyIdhVuksPuV__k.png',
6767
},
68-
// Sage - (Not enabling until Endwalker release)
69-
// {
70-
// className: Class.Sage,
71-
// imagePath: 'XXXXXX'
72-
// },
68+
{
69+
className: Class.Sage,
70+
imagePath: 'lds/h/u/0blXNf6dtQ7j1039qlIpMf8M1E.png',
71+
},
7372
// DPS
7473
{
7574
className: Class.Pugilist, // Monk
@@ -135,11 +134,10 @@ export default class ClassConfig {
135134
className: Class.BlueMage,
136135
imagePath: 'lds/h/0/SsnnfFXS_AKGbrcBnIEA0J_jUk.png',
137136
},
138-
// Reaper - (Not enabling until Endwalker release)
139-
// {
140-
// className: Class.Reaper,
141-
// imagePath: 'XXXXXX'
142-
// },
137+
{
138+
className: Class.Reaper,
139+
imagePath: 'lds/h/H/ZEiwU3soVZIobM2RZSG8LnhYEY.png',
140+
},
143141
// DoH
144142
{
145143
className: Class.Carpenter,

src/entity/Class.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const enum Class {
3333
Conjurer = 'White Mage / Conjurer',
3434
Scholar = 'Scholar',
3535
Astrologian = 'Astrologian',
36-
// Sage = 'Sage', (Not enabling until Endwalker release)
36+
Sage = 'Sage',
3737
// DPS
3838
Pugilist = 'Monk / Pugilist',
3939
Lancer = 'Dragoon / Lancer',
@@ -46,7 +46,7 @@ const enum Class {
4646
Arcanist = 'Summoner / Arcanist',
4747
RedMage = 'Red Mage',
4848
BlueMage = 'Blue Mage (Limited Job)',
49-
// Reaper = 'Reaper', (Not enabling until Endwalker release)
49+
Reaper = 'Reaper',
5050
// DoH
5151
Carpenter = 'Carpenter',
5252
Blacksmith = 'Blacksmith',

src/entity/__tests__/Character.test.ts

Lines changed: 91 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -50,27 +50,27 @@ describe('Character', () => {
5050
gear: {
5151
arm: {
5252
category: GearCategory.Arm,
53-
name: 'Weathered Tishtrya',
54-
id: '000c99173df',
55-
iLvl: 430,
53+
name: 'Exarchic Cane',
54+
id: '8aa1be1728a?hq=1',
55+
iLvl: 510,
5656
},
5757
head: {
5858
category: GearCategory.Head,
59-
name: 'Ronkan Visor of Healing',
60-
id: '71537a2985f',
61-
iLvl: 440,
59+
name: 'Exarchic Circlet of Healing',
60+
id: '5fffa0cb64b?hq=1',
61+
iLvl: 510,
6262
},
6363
body: {
6464
category: GearCategory.Body,
65-
name: 'Ronkan Robe of Healing',
66-
id: 'ccc2a4ebfbd',
67-
iLvl: 440,
65+
name: 'Neo-Ishgardian Top of Healing',
66+
id: '96e994d56ae',
67+
iLvl: 480,
6868
},
6969
hands: {
7070
category: GearCategory.Hands,
71-
name: 'Ronkan Armguards of Healing',
72-
id: '26c8e806fde',
73-
iLvl: 440,
71+
name: 'Neo-Ishgardian Gloves of Healing',
72+
id: '41cccfe5212?hq=1',
73+
iLvl: 480,
7474
},
7575
waist: {
7676
category: GearCategory.Waist,
@@ -80,39 +80,39 @@ describe('Character', () => {
8080
},
8181
legs: {
8282
category: GearCategory.Legs,
83-
name: 'Edengate Pantaloons of Healing',
84-
id: '82d2ccf47ea',
85-
iLvl: 450,
83+
name: 'Exarchic Hose of Healing',
84+
id: '8421f0db039?hq=1',
85+
iLvl: 510,
8686
},
8787
feet: {
8888
category: GearCategory.Feet,
89-
name: 'Edengate Sandals of Healing',
90-
id: '71d504e6cfe',
91-
iLvl: 450,
89+
name: 'Exarchic Shoes of Healing',
90+
id: 'c31aef0901f?hq=1',
91+
iLvl: 510,
9292
},
9393
earrings: {
9494
category: GearCategory.Earrings,
95-
name: 'Ronkan Earrings of Healing',
96-
id: 'c3c1d1140d8',
97-
iLvl: 440,
95+
name: 'Crystarium Earrings of Healing',
96+
id: 'e90fe40b436',
97+
iLvl: 490,
9898
},
9999
necklace: {
100100
category: GearCategory.Necklace,
101-
name: 'Edengate Choker of Healing',
102-
id: 'dcacaad338a',
103-
iLvl: 450,
101+
name: 'Neo-Ishgardian Choker of Healing',
102+
id: 'e129bc8a2e4',
103+
iLvl: 480,
104104
},
105105
bracelets: {
106106
category: GearCategory.Bracelets,
107-
name: 'Ronkan Bracelets of Healing',
108-
id: 'c4da6050bab',
109-
iLvl: 440,
107+
name: 'Neo-Ishgardian Wristbands of Healing',
108+
id: '2a6a86be422?hq=1',
109+
iLvl: 480,
110110
},
111111
ringOne: {
112112
category: GearCategory.Ring,
113-
name: 'Edengate Ring of Healing',
114-
id: 'f38b0ba900a',
115-
iLvl: 450,
113+
name: 'Exarchic Ring of Healing',
114+
id: '54b8ff24b67?hq=1',
115+
iLvl: 510,
116116
},
117117
ringTwo: {
118118
category: GearCategory.Ring,
@@ -149,6 +149,10 @@ describe('Character', () => {
149149
class: Class.Conjurer,
150150
level: 80,
151151
},
152+
sage: {
153+
class: Class.Sage,
154+
level: 0,
155+
},
152156
scholar: {
153157
class: Class.Scholar,
154158
level: 71,
@@ -173,6 +177,10 @@ describe('Character', () => {
173177
class: Class.Samurai,
174178
level: 55,
175179
},
180+
reaper: {
181+
class: Class.Reaper,
182+
level: 0,
183+
},
176184
bardArcher: {
177185
class: Class.Archer,
178186
level: 15,
@@ -187,7 +195,7 @@ describe('Character', () => {
187195
},
188196
blackMageThaumaturge: {
189197
class: Class.Thaumaturge,
190-
level: 74,
198+
level: 77,
191199
},
192200
summonerArcanist: {
193201
class: Class.Arcanist,
@@ -291,13 +299,65 @@ describe('Character', () => {
291299
race: 'Lalafell',
292300
}
293301

302+
// Character with Sage active
303+
const expectedCharacterFour: Character = {
304+
id: 11886902,
305+
name: 'Sey Moore',
306+
activeClass: Class.Sage,
307+
cityState: 'Gridania',
308+
clan: 'Dunesfolk',
309+
homeWorld: 'Cerberus',
310+
title: 'Monster Hunter',
311+
dataCenter: 'Chaos',
312+
freeCompany: 'Cerberus (Chaos)',
313+
gender: 'Male',
314+
grandCompany: 'Order of the Twin Adder',
315+
grandCompanyRank: 'Serpent Captain',
316+
guardian: 'Rhalgr, the Destroyer',
317+
nameDay: '6th Sun of the 6th Astral Moon',
318+
race: 'Lalafell',
319+
classes: {
320+
sage: {
321+
class: Class.Sage,
322+
level: 76,
323+
},
324+
},
325+
}
326+
327+
// Character with reaper active
328+
const expectedCharacterFive: Character = {
329+
id: 11886902,
330+
name: 'Refler Desu',
331+
activeClass: Class.Reaper,
332+
cityState: "Ul'dah",
333+
clan: 'Xaela',
334+
homeWorld: 'Cerberus',
335+
title: 'The Liberator',
336+
dataCenter: 'Chaos',
337+
freeCompany: 'Cerberus (Chaos)',
338+
gender: 'Female',
339+
grandCompany: 'Maelstrom',
340+
grandCompanyRank: 'Second Storm Lieutenant',
341+
guardian: 'Azeyma, the Warden',
342+
nameDay: '7th Sun of the 1st Astral Moon',
343+
race: 'Au Ra',
344+
classes: {
345+
reaper: {
346+
class: Class.Reaper,
347+
level: 80,
348+
},
349+
},
350+
}
351+
294352
// TODO: Test character with shield
295353
// TODO: test character with no free company
296354

297355
describe.each([
298356
[11886902, "P'tajha Rihll", expectedCharacterOne],
299357
[38531003, 'Aurora Nyxx', expectedCharacterTwo],
300358
[27218992, 'Shamir Kotmine', expectedCharacterThree],
359+
[18001255, 'Sey Moore', expectedCharacterFour],
360+
[28309293, 'Refler Desu', expectedCharacterFive],
301361
])('for character %s - %s', (charId, name, expected) => {
302362
let resultantCharacter: Character
303363
const nonObjectAttributes = Object.entries(expected).filter((pair) => typeof pair[1] !== 'object')

0 commit comments

Comments
 (0)