Initial commit

This commit is contained in:
2023-03-18 20:58:14 +01:00
commit 3ccab02cc8
23 changed files with 6684 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
export class Adventurer {
id: string;
name: string;
portrait: string;
level: number;
exp: number;
attackPerLevel: number;
defensePerLevel: number;
busy: boolean;
constructor(id: string, name: string, portrait: string, attackPerLevel: number, defensePerLevel: number) {
this.id = id;
this.name = name;
this.portrait = portrait;
this.attackPerLevel = attackPerLevel;
this.defensePerLevel = defensePerLevel;
this.level = 1;
this.exp = 0;
this.busy = false;
}
levelUp(): void {
this.exp = 0;
this.level += 1;
}
canLevelUp(): boolean {
const requirement = this.level * 3;
return this.exp >= requirement;
}
}