This commit is contained in:
Olivier Gagnon
2021-11-05 17:12:52 -04:00
parent f8917473f8
commit 88b4a7d862
32 changed files with 97 additions and 79 deletions
@@ -86,7 +86,7 @@ export function prestigeAugmentation(this: PlayerObject): void {
this.karma = 0;
//Reset stats
this.hacking_skill = 1;
this.hacking = 1;
this.strength = 1;
this.defense = 1;
@@ -228,7 +228,7 @@ export function calculateSkill(this: IPlayer, exp: number, mult = 1): number {
}
export function updateSkillLevels(this: IPlayer): void {
this.hacking_skill = Math.max(
this.hacking = Math.max(
1,
Math.floor(this.calculateSkill(this.hacking_exp, this.hacking_mult * BitNodeMultipliers.HackingLevelMultiplier)),
);
@@ -378,7 +378,7 @@ export function gainHackingExp(this: IPlayer, exp: number): void {
this.hacking_exp = 0;
}
this.hacking_skill = calculateSkillF(this.hacking_exp, this.hacking_mult * BitNodeMultipliers.HackingLevelMultiplier);
this.hacking = calculateSkillF(this.hacking_exp, this.hacking_mult * BitNodeMultipliers.HackingLevelMultiplier);
}
export function gainStrengthExp(this: IPlayer, exp: number): void {
@@ -464,7 +464,7 @@ export function gainIntelligenceExp(this: IPlayer, exp: number): void {
export function queryStatFromString(this: IPlayer, str: string): number {
const tempStr = str.toLowerCase();
if (tempStr.includes("hack")) {
return this.hacking_skill;
return this.hacking;
}
if (tempStr.includes("str")) {
return this.strength;
@@ -856,7 +856,7 @@ export function startFactionHackWork(this: IPlayer, router: IRouter, faction: Fa
this.workHackExpGainRate = 0.15 * this.hacking_exp_mult * BitNodeMultipliers.FactionWorkExpGain;
this.workRepGainRate =
((this.hacking_skill + this.intelligence) / CONSTANTS.MaxSkillLevel) *
((this.hacking + this.intelligence) / CONSTANTS.MaxSkillLevel) *
this.faction_rep_mult *
this.getIntelligenceBonus(0.5);
@@ -1180,7 +1180,7 @@ export function getWorkRepGain(this: IPlayer): number {
}
let jobPerformance = companyPosition.calculateJobPerformance(
this.hacking_skill,
this.hacking,
this.strength,
this.defense,
this.dexterity,
@@ -1200,7 +1200,7 @@ export function getWorkRepGain(this: IPlayer): number {
}
// export function getFactionSecurityWorkRepGain(this: IPlayer) {
// var t = 0.9 * (this.hacking_skill / CONSTANTS.MaxSkillLevel +
// var t = 0.9 * (this.hacking / CONSTANTS.MaxSkillLevel +
// this.strength / CONSTANTS.MaxSkillLevel +
// this.defense / CONSTANTS.MaxSkillLevel +
// this.dexterity / CONSTANTS.MaxSkillLevel +
@@ -1209,7 +1209,7 @@ export function getWorkRepGain(this: IPlayer): number {
// }
// export function getFactionFieldWorkRepGain(this: IPlayer) {
// var t = 0.9 * (this.hacking_skill / CONSTANTS.MaxSkillLevel +
// var t = 0.9 * (this.hacking / CONSTANTS.MaxSkillLevel +
// this.strength / CONSTANTS.MaxSkillLevel +
// this.defense / CONSTANTS.MaxSkillLevel +
// this.dexterity / CONSTANTS.MaxSkillLevel +
@@ -1234,7 +1234,7 @@ export function startCreateProgramWork(
//Time needed to complete work affected by hacking skill (linearly based on
//ratio of (your skill - required level) to MAX skill)
//var timeMultiplier = (CONSTANTS.MaxSkillLevel - (this.hacking_skill - reqLevel)) / CONSTANTS.MaxSkillLevel;
//var timeMultiplier = (CONSTANTS.MaxSkillLevel - (this.hacking - reqLevel)) / CONSTANTS.MaxSkillLevel;
//if (timeMultiplier > 1) {timeMultiplier = 1;}
//if (timeMultiplier < 0.01) {timeMultiplier = 0.01;}
this.createProgramReqLvl = reqLevel;
@@ -1264,7 +1264,7 @@ export function startCreateProgramWork(
export function createProgramWork(this: IPlayer, numCycles: number): boolean {
//Higher hacking skill will allow you to create programs faster
const reqLvl = this.createProgramReqLvl;
let skillMult = (this.hacking_skill / reqLvl) * this.getIntelligenceBonus(3); //This should always be greater than 1;
let skillMult = (this.hacking / reqLvl) * this.getIntelligenceBonus(3); //This should always be greater than 1;
skillMult = 1 + (skillMult - 1) / 5; //The divider constant can be adjusted as necessary
//Skill multiplier directly applied to "time worked"
@@ -1293,7 +1293,7 @@ export function finishCreateProgramWork(this: IPlayer, cancelled: boolean): stri
}
if (!cancelled) {
this.gainIntelligenceExp(CONSTANTS.IntelligenceProgramBaseExpGain * this.timeWorked/1000);
this.gainIntelligenceExp((CONSTANTS.IntelligenceProgramBaseExpGain * this.timeWorked) / 1000);
}
this.isWorking = false;
@@ -1977,7 +1977,7 @@ export function isQualified(this: IPlayer, company: Company, position: CompanyPo
const reqCharisma = position.requiredCharisma > 0 ? position.requiredCharisma + offset : 0;
if (
this.hacking_skill >= reqHacking &&
this.hacking >= reqHacking &&
this.strength >= reqStrength &&
this.defense >= reqDefense &&
this.dexterity >= reqDexterity &&
@@ -2035,6 +2035,7 @@ export function reapplyAllSourceFiles(this: IPlayer): void {
applySourceFile(this.sourceFiles[i]);
}
applyExploit();
this.updateSkillLevels();
}
/*************** Check for Faction Invitations *************/
@@ -2075,7 +2076,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] {
!illuminatiFac.alreadyInvited &&
numAugmentations >= 30 &&
this.money.gte(150000000000) &&
this.hacking_skill >= 1500 &&
this.hacking >= 1500 &&
this.strength >= 1200 &&
this.defense >= 1200 &&
this.dexterity >= 1200 &&
@@ -2092,7 +2093,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] {
!daedalusFac.alreadyInvited &&
numAugmentations >= Math.round(30 * BitNodeMultipliers.DaedalusAugsRequirement) &&
this.money.gte(100000000000) &&
(this.hacking_skill >= 2500 ||
(this.hacking >= 2500 ||
(this.strength >= 1500 && this.defense >= 1500 && this.dexterity >= 1500 && this.agility >= 1500))
) {
invitedFactions.push(daedalusFac);
@@ -2106,7 +2107,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] {
!covenantFac.alreadyInvited &&
numAugmentations >= 20 &&
this.money.gte(75000000000) &&
this.hacking_skill >= 850 &&
this.hacking >= 850 &&
this.strength >= 850 &&
this.defense >= 850 &&
this.dexterity >= 850 &&
@@ -2356,7 +2357,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] {
!speakersforthedeadFac.isBanned &&
!speakersforthedeadFac.isMember &&
!speakersforthedeadFac.alreadyInvited &&
this.hacking_skill >= 100 &&
this.hacking >= 100 &&
this.strength >= 300 &&
this.defense >= 300 &&
this.dexterity >= 300 &&
@@ -2375,7 +2376,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] {
!thedarkarmyFac.isBanned &&
!thedarkarmyFac.isMember &&
!thedarkarmyFac.alreadyInvited &&
this.hacking_skill >= 300 &&
this.hacking >= 300 &&
this.strength >= 300 &&
this.defense >= 300 &&
this.dexterity >= 300 &&
@@ -2395,7 +2396,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] {
!thesyndicateFac.isBanned &&
!thesyndicateFac.isMember &&
!thesyndicateFac.alreadyInvited &&
this.hacking_skill >= 200 &&
this.hacking >= 200 &&
this.strength >= 200 &&
this.defense >= 200 &&
this.dexterity >= 200 &&
@@ -2480,7 +2481,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] {
!netburnersFac.isBanned &&
!netburnersFac.isMember &&
!netburnersFac.alreadyInvited &&
this.hacking_skill >= 80 &&
this.hacking >= 80 &&
totalHacknetRam >= 8 &&
totalHacknetCores >= 4 &&
totalHacknetLevels >= 100
@@ -2495,7 +2496,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] {
!tiandihuiFac.isMember &&
!tiandihuiFac.alreadyInvited &&
this.money.gte(1000000) &&
this.hacking_skill >= 50 &&
this.hacking >= 50 &&
(this.city == CityName.Chongqing || this.city == CityName.NewTokyo || this.city == CityName.Ishima)
) {
invitedFactions.push(tiandihuiFac);