2021-09-05 01:09:30 +02:00
|
|
|
import { IPlayer } from "../IPlayer";
|
|
|
|
import { Faction } from "../../Faction/Faction";
|
|
|
|
import { CONSTANTS } from "../../Constants";
|
|
|
|
import { BitNodeMultipliers } from "../../BitNode/BitNodeMultipliers";
|
2021-04-18 17:18:56 +02:00
|
|
|
|
|
|
|
function mult(f: Faction): number {
|
2021-09-05 01:09:30 +02:00
|
|
|
let favorMult = 1 + f.favor / 100;
|
|
|
|
if (isNaN(favorMult)) {
|
|
|
|
favorMult = 1;
|
|
|
|
}
|
|
|
|
return favorMult * BitNodeMultipliers.FactionWorkRepGain;
|
2021-04-18 17:18:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export function getHackingWorkRepGain(p: IPlayer, f: Faction): number {
|
2021-09-05 01:09:30 +02:00
|
|
|
return (
|
|
|
|
((p.hacking_skill + p.intelligence / 3) / CONSTANTS.MaxSkillLevel) *
|
|
|
|
p.faction_rep_mult *
|
|
|
|
p.getIntelligenceBonus(1) *
|
|
|
|
mult(f)
|
|
|
|
);
|
2021-04-18 17:18:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export function getFactionSecurityWorkRepGain(p: IPlayer, f: Faction): number {
|
2021-09-05 01:09:30 +02:00
|
|
|
const t =
|
|
|
|
(0.9 *
|
|
|
|
(p.hacking_skill / CONSTANTS.MaxSkillLevel +
|
|
|
|
p.strength / CONSTANTS.MaxSkillLevel +
|
|
|
|
p.defense / CONSTANTS.MaxSkillLevel +
|
|
|
|
p.dexterity / CONSTANTS.MaxSkillLevel +
|
|
|
|
p.agility / CONSTANTS.MaxSkillLevel +
|
|
|
|
p.intelligence / CONSTANTS.MaxSkillLevel)) /
|
|
|
|
4.5;
|
|
|
|
return t * p.faction_rep_mult * mult(f) * p.getIntelligenceBonus(1);
|
2021-04-18 17:18:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export function getFactionFieldWorkRepGain(p: IPlayer, f: Faction): number {
|
2021-09-05 01:09:30 +02:00
|
|
|
const t =
|
|
|
|
(0.9 *
|
|
|
|
(p.hacking_skill / CONSTANTS.MaxSkillLevel +
|
|
|
|
p.strength / CONSTANTS.MaxSkillLevel +
|
|
|
|
p.defense / CONSTANTS.MaxSkillLevel +
|
|
|
|
p.dexterity / CONSTANTS.MaxSkillLevel +
|
|
|
|
p.agility / CONSTANTS.MaxSkillLevel +
|
|
|
|
p.charisma / CONSTANTS.MaxSkillLevel +
|
|
|
|
p.intelligence / CONSTANTS.MaxSkillLevel)) /
|
|
|
|
5.5;
|
|
|
|
return t * p.faction_rep_mult * mult(f) * p.getIntelligenceBonus(1);
|
2021-04-18 17:18:56 +02:00
|
|
|
}
|