Skip to content

Commit

Permalink
fix xp
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirabellier committed Feb 24, 2024
1 parent cca850a commit 4157104
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils/rpg/battle/Battle.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,13 +316,15 @@ class Battle {
let { id, userID, createdAt, updatedAt, ...character } =
await this.getCharacter();

const xpGain = Math.floor(
let xpGain = Math.floor(
1 *
((5 * (this.opponent.level - this.character.level)) /
this.character.level +
4),
);

if (xpGain < 1) xpGain = 1;

character.xp += xpGain;

schemas.character().update(
Expand Down

0 comments on commit 4157104

Please sign in to comment.