work on sleeve new work system

This commit is contained in:
Olivier Gagnon
2022-07-27 20:37:32 -04:00
parent 315b2adf30
commit ebe953b498
19 changed files with 816 additions and 467 deletions

View File

@@ -1,8 +1,8 @@
import { IPlayer } from "../IPlayer";
import { Faction } from "../../Faction/Faction";
import { CONSTANTS } from "../../Constants";
import { BitNodeMultipliers } from "../../BitNode/BitNodeMultipliers";
import { CalculateShareMult } from "../../NetworkShare/Share";
import { IPerson } from "../IPerson";
function mult(f: Faction): number {
let favorMult = 1 + f.favor / 100;
@@ -12,7 +12,7 @@ function mult(f: Faction): number {
return favorMult * BitNodeMultipliers.FactionWorkRepGain;
}
export function getHackingWorkRepGain(p: IPlayer, f: Faction): number {
export function getHackingWorkRepGain(p: IPerson, f: Faction): number {
return (
((p.skills.hacking + p.skills.intelligence / 3) / CONSTANTS.MaxSkillLevel) *
p.mults.faction_rep *
@@ -22,7 +22,7 @@ export function getHackingWorkRepGain(p: IPlayer, f: Faction): number {
);
}
export function getFactionSecurityWorkRepGain(p: IPlayer, f: Faction): number {
export function getFactionSecurityWorkRepGain(p: IPerson, f: Faction): number {
const t =
(0.9 *
(p.skills.strength +
@@ -35,7 +35,7 @@ export function getFactionSecurityWorkRepGain(p: IPlayer, f: Faction): number {
return t * p.mults.faction_rep * mult(f) * p.getIntelligenceBonus(1);
}
export function getFactionFieldWorkRepGain(p: IPlayer, f: Faction): number {
export function getFactionFieldWorkRepGain(p: IPerson, f: Faction): number {
const t =
(0.9 *
(p.skills.strength +