hook in data sources for adventurers and quests,

programatically generate quest rewards,
change damage math,
This commit is contained in:
2023-03-25 14:42:17 +01:00
parent 9ac13c4cae
commit c71eeda11f
13 changed files with 163 additions and 32 deletions
+11 -3
View File
@@ -4,21 +4,21 @@ export class Adventurer {
portrait: string;
level: number;
exp: number;
attackPerLevel: number;
attackExponent: number;
busy: boolean;
constructor(
id: string,
name: string,
portrait: string,
attackPerLevel: number,
attackExponent: number,
level: number = 1,
exp: number = 0
) {
this.id = id;
this.name = name;
this.portrait = portrait;
this.attackPerLevel = attackPerLevel;
this.attackExponent = attackExponent;
this.level = level;
this.exp = exp;
this.busy = false;
@@ -44,4 +44,12 @@ export class Adventurer {
return (this.exp / this.getNextLevelExpRequirement()) * 100;
}
getAttack(): number {
return Math.floor(2 * this.level ^ this.attackExponent);
}
getDPS(): number {
return this.getAttack() * 4;
}
}