upgrade section and first upgrade,

correctly update guild upgrade cost
This commit is contained in:
2023-03-26 20:16:52 +02:00
parent fae1faded5
commit 9dcb403289
4 changed files with 78 additions and 2 deletions
+2
View File
@@ -26,10 +26,12 @@ export class Guild {
this.level += 1;
if (this.level >= 7) {
this.displayUpgradeCost = "Max level";
this.upgradeCost = null;
} else {
const newCost = this.getUpgradeCost();
if (newCost === null) return;
this.displayUpgradeCost = newCost;
this.upgradeCost = newCost;
}
}
@@ -14,13 +14,14 @@ export class AdventurerCapacityUpgrade extends GuildUpgrade {
}
getCostForLevel(level: number): number {
return 1500 + ((level - 1) * 1.15 * 1500);
const scalingFactor = Math.pow(1.25, level - 1);
return Math.floor(1500 * scalingFactor * Math.pow(level, 1.25));
}
/**
* Returns the number of adventurers the guild can have
*/
getAdventurerCapacity(): number {
return 2 + this.level ;
return 1 + this.level ;
}
}