Added regeneration

This commit is contained in:
Martin
2022-11-28 14:34:34 +01:00
parent 692bb7c35c
commit a0bd11b61d
7 changed files with 61 additions and 7 deletions

View File

@@ -12,7 +12,8 @@ export class Upgrader {
this.player = player;
this.setTypeMaps(UpgradeType.WeaponLength, this.upgradeWeaponLength.bind(this), settings.maxWeaponLengthUpgrades);
this.setTypeMaps(UpgradeType.WeaponDamage, this.upgradeWeaponDamage, settings.maxWeaponDamageUpgrades);
this.setTypeMaps(UpgradeType.WeaponDamage, this.upgradeWeaponDamage.bind(this), settings.maxWeaponDamageUpgrades);
this.setTypeMaps(UpgradeType.Regeneration, this.upgradeRegeneration.bind(this), settings.maxRegenerationUpgrades);
}
public upgradeSkill(type: UpgradeType): void {
@@ -49,6 +50,10 @@ export class Upgrader {
this.player.Weapon.upgradeWeaponDamage();
}
private upgradeRegeneration(): void {
this.player.Regeneration.upgrade();
}
private isMaxLevel(type: UpgradeType): boolean {
return this.typeToMaxLevel.get(type) <= this.typeToLevel.get(type);
}