mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-18 20:25:45 +01:00
lint and made a some code more robust to older save file
This commit is contained in:
parent
6c84d64e67
commit
c3b2c6396c
@ -61,14 +61,7 @@ import { NetscriptCorporation } from "./NetscriptFunctions/Corporation";
|
|||||||
import { NetscriptFormulas } from "./NetscriptFunctions/Formulas";
|
import { NetscriptFormulas } from "./NetscriptFunctions/Formulas";
|
||||||
import { NetscriptStockMarket } from "./NetscriptFunctions/StockMarket";
|
import { NetscriptStockMarket } from "./NetscriptFunctions/StockMarket";
|
||||||
import { NetscriptGrafting } from "./NetscriptFunctions/Grafting";
|
import { NetscriptGrafting } from "./NetscriptFunctions/Grafting";
|
||||||
import {
|
import { NS, RecentScript as IRecentScript, BasicHGWOptions, ProcessInfo } from "./ScriptEditor/NetscriptDefinitions";
|
||||||
NS,
|
|
||||||
RecentScript as IRecentScript,
|
|
||||||
BasicHGWOptions,
|
|
||||||
ProcessInfo,
|
|
||||||
MoneySource as IMoneySource,
|
|
||||||
MoneySources as IMoneySources,
|
|
||||||
} from "./ScriptEditor/NetscriptDefinitions";
|
|
||||||
import { NetscriptSingularity } from "./NetscriptFunctions/Singularity";
|
import { NetscriptSingularity } from "./NetscriptFunctions/Singularity";
|
||||||
|
|
||||||
import { dialogBoxCreate } from "./ui/React/DialogBox";
|
import { dialogBoxCreate } from "./ui/React/DialogBox";
|
||||||
|
@ -51,8 +51,10 @@ export function gainDefenseExp(this: Person, exp: number): void {
|
|||||||
this.mults.defense * BitNodeMultipliers.DefenseLevelMultiplier,
|
this.mults.defense * BitNodeMultipliers.DefenseLevelMultiplier,
|
||||||
);
|
);
|
||||||
const ratio = this.hp.current / this.hp.max;
|
const ratio = this.hp.current / this.hp.max;
|
||||||
this.hp.max = Math.floor(10 + this.skills.defense / 10);
|
this.hp = {
|
||||||
this.hp.current = Math.round(this.hp.max * ratio);
|
max: Math.floor(10 + this.skills.defense / 10),
|
||||||
|
current: Math.round(this.hp.max * ratio),
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function gainDexterityExp(this: Person, exp: number): void {
|
export function gainDexterityExp(this: Person, exp: number): void {
|
||||||
@ -194,8 +196,10 @@ export function updateSkillLevels(this: Person): void {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const ratio: number = this.hp.current / this.hp.max;
|
const ratio: number = this.hp.current / this.hp.max;
|
||||||
this.hp.max = Math.floor(10 + this.skills.defense / 10);
|
this.hp = {
|
||||||
this.hp.current = Math.round(this.hp.max * ratio);
|
max: Math.floor(10 + this.skills.defense / 10),
|
||||||
|
current: Math.round(this.hp.max * ratio),
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function hasAugmentation(this: Person, augName: string, ignoreQueued = false) {
|
export function hasAugmentation(this: Person, augName: string, ignoreQueued = false) {
|
||||||
|
Loading…
Reference in New Issue
Block a user