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 4157104 commit a62c0dd
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/utils/rpg/battle/Battle.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,15 +316,13 @@ class Battle {
let { id, userID, createdAt, updatedAt, ...character } =
await this.getCharacter();

let xpGain = Math.floor(
let xpGain = Math.ceil(
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 a62c0dd

Please sign in to comment.