Skill rebalancing, analytic data tracking

This commit is contained in:
2025-02-08 20:35:36 -08:00
parent 5ecafa0d4a
commit bd48a26adf
7 changed files with 55 additions and 16 deletions

View File

@ -5,6 +5,7 @@ export class PlayerProgress {
#stats: Record<Stat, number>
#exp: number;
#blood: number
#itemsPurloined: number
#skillsLearned: number[] // use the raw ID representation for indexOf
#untrimmedSkillsAvailable: Skill[]
@ -17,6 +18,7 @@ export class PlayerProgress {
};
this.#exp = 0;
this.#blood = 0;
this.#itemsPurloined = 0;
this.#skillsLearned = [];
this.#untrimmedSkillsAvailable = []
@ -74,6 +76,14 @@ export class PlayerProgress {
return true;
}
purloinItem() {
this.#itemsPurloined += 1;
}
getItemsPurloined() {
return this.#itemsPurloined
}
add(stat: Stat, amount: number) {
if (amount != Math.floor(amount)) {
throw `stat increment must be integer: ${amount}`