Fix #1889: Add skill progress to overview

Adds a progress bar for each stat to show how close to level up you are.
This commit is contained in:
Martin Fournier
2021-12-17 09:35:54 -05:00
parent 6c5842d2e7
commit 84c77c1d2c
6 changed files with 149 additions and 4 deletions

View File

@@ -26,7 +26,7 @@ import { Locations } from "../../Locations/Locations";
import { CityName } from "../../Locations/data/CityNames";
import { LocationName } from "../../Locations/data/LocationNames";
import { Sleeve } from "../../PersonObjects/Sleeve/Sleeve";
import { calculateSkill as calculateSkillF } from "../formulas/skill";
import { calculateSkill as calculateSkillF, calculateSkillProgress as calculateSkillProgressF, getEmptySkillProgress, ISkillProgress } from "../formulas/skill";
import { calculateIntelligenceBonus } from "../formulas/intelligence";
import {
getHackingWorkRepGain,
@@ -226,6 +226,11 @@ export function calculateSkill(this: IPlayer, exp: number, mult = 1): number {
return calculateSkillF(exp, mult);
}
//Calculates skill level progress based on experience. The same formula will be used for every skill
export function calculateSkillProgress(this: IPlayer, exp: number, mult = 1): ISkillProgress {
return calculateSkillProgressF(exp, mult);
}
export function updateSkillLevels(this: IPlayer): void {
this.hacking = Math.max(
1,