Skip to content

Commit

Permalink
use job stats for player stats
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyria committed Aug 21, 2023
1 parent 522fb74 commit 97bbac9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions server/src/modules/player/player.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,16 @@ export class PlayerService {

async getTotalStats(player: Player): Promise<Record<Stat, number>> {
const base = zeroStats();

// get job stats
const job = this.contentService.getJob(player.job);
if (!job) return base;

Object.keys(job.statGainsPerLevel).forEach((stat) => {
base[stat as Stat] += job.statGainsPerLevel[stat as Stat] * player.level;
});

// get equipment stats
const equipment = await this.inventoryService.getEquipmentFor(
player.userId,
);
Expand Down

0 comments on commit 97bbac9

Please sign in to comment.