mirror of
https://github.com/YouHaveTrouble/GuildMaster.git
synced 2026-05-12 06:26:59 +00:00
adventurer exp bars
This commit is contained in:
@@ -25,7 +25,18 @@ export class Adventurer {
|
||||
}
|
||||
|
||||
canLevelUp(): boolean {
|
||||
const requirement = this.level * 3;
|
||||
return this.exp >= requirement;
|
||||
return this.exp >= this.getNextLevelExpRequirement();
|
||||
}
|
||||
|
||||
getNextLevelExpRequirement(): number {
|
||||
return this.level * 3;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the percentage of exp to the next level
|
||||
*/
|
||||
getExpPercentage(): number {
|
||||
return (this.exp / this.getNextLevelExpRequirement()) * 100;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user