mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-26 11:10:58 +02:00
bugfix
This commit is contained in:
@@ -73,7 +73,7 @@ export interface IPlayer {
|
||||
totalPlaytime: number;
|
||||
|
||||
// Stats
|
||||
hacking_skill: number;
|
||||
hacking: number;
|
||||
strength: number;
|
||||
defense: number;
|
||||
dexterity: number;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
export interface IPlayerOrSleeve {
|
||||
// Stats
|
||||
hacking_skill: number;
|
||||
hacking: number;
|
||||
strength: number;
|
||||
defense: number;
|
||||
dexterity: number;
|
||||
|
||||
@@ -35,7 +35,7 @@ export abstract class Person {
|
||||
/**
|
||||
* Stats
|
||||
*/
|
||||
hacking_skill = 1;
|
||||
hacking = 1;
|
||||
strength = 1;
|
||||
defense = 1;
|
||||
dexterity = 1;
|
||||
@@ -136,7 +136,7 @@ export abstract class Person {
|
||||
getFactionFieldWorkRepGain(): number {
|
||||
const t =
|
||||
(0.9 *
|
||||
(this.hacking_skill / CONSTANTS.MaxSkillLevel +
|
||||
(this.hacking / CONSTANTS.MaxSkillLevel +
|
||||
this.strength / CONSTANTS.MaxSkillLevel +
|
||||
this.defense / CONSTANTS.MaxSkillLevel +
|
||||
this.dexterity / CONSTANTS.MaxSkillLevel +
|
||||
@@ -151,7 +151,7 @@ export abstract class Person {
|
||||
* when doing Hacking Work for a faction
|
||||
*/
|
||||
getFactionHackingWorkRepGain(): number {
|
||||
return (this.hacking_skill / CONSTANTS.MaxSkillLevel) * this.faction_rep_mult;
|
||||
return (this.hacking / CONSTANTS.MaxSkillLevel) * this.faction_rep_mult;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -161,7 +161,7 @@ export abstract class Person {
|
||||
getFactionSecurityWorkRepGain(): number {
|
||||
const t =
|
||||
(0.9 *
|
||||
(this.hacking_skill / CONSTANTS.MaxSkillLevel +
|
||||
(this.hacking / CONSTANTS.MaxSkillLevel +
|
||||
this.strength / CONSTANTS.MaxSkillLevel +
|
||||
this.defense / CONSTANTS.MaxSkillLevel +
|
||||
this.dexterity / CONSTANTS.MaxSkillLevel +
|
||||
@@ -201,7 +201,7 @@ export abstract class Person {
|
||||
* Update all stat levels
|
||||
*/
|
||||
updateStatLevels(): void {
|
||||
this.hacking_skill = Math.max(
|
||||
this.hacking = Math.max(
|
||||
1,
|
||||
Math.floor(this.calculateStat(this.hacking_exp, this.hacking_mult * BitNodeMultipliers.HackingLevelMultiplier)),
|
||||
);
|
||||
|
||||
@@ -80,7 +80,7 @@ export class PlayerObject implements IPlayer {
|
||||
totalPlaytime: number;
|
||||
|
||||
// Stats
|
||||
hacking_skill: number;
|
||||
hacking: number;
|
||||
strength: number;
|
||||
defense: number;
|
||||
dexterity: number;
|
||||
@@ -287,7 +287,7 @@ export class PlayerObject implements IPlayer {
|
||||
|
||||
constructor() {
|
||||
//Skills and stats
|
||||
this.hacking_skill = 1;
|
||||
this.hacking = 1;
|
||||
|
||||
//Combat stats
|
||||
this.hp = 10;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -123,7 +123,7 @@ export function ResleeveElem(props: IProps): React.ReactElement {
|
||||
<Grid container>
|
||||
<Grid item xs={3}>
|
||||
<Typography>
|
||||
Hacking: {numeralWrapper.formatSkill(props.resleeve.hacking_skill)} (
|
||||
Hacking: {numeralWrapper.formatSkill(props.resleeve.hacking)} (
|
||||
{numeralWrapper.formatExp(props.resleeve.hacking_exp)} exp)
|
||||
<br />
|
||||
Strength: {numeralWrapper.formatSkill(props.resleeve.strength)} (
|
||||
|
||||
@@ -58,7 +58,7 @@ const SortFunctions: {
|
||||
TotalNumAugmentations: (a: Resleeve, b: Resleeve) => number;
|
||||
} = {
|
||||
Cost: (a: Resleeve, b: Resleeve): number => a.getCost() - b.getCost(),
|
||||
Hacking: (a: Resleeve, b: Resleeve): number => a.hacking_skill - b.hacking_skill,
|
||||
Hacking: (a: Resleeve, b: Resleeve): number => a.hacking - b.hacking,
|
||||
Strength: (a: Resleeve, b: Resleeve): number => a.strength - b.strength,
|
||||
Defense: (a: Resleeve, b: Resleeve): number => a.defense - b.defense,
|
||||
Dexterity: (a: Resleeve, b: Resleeve): number => a.dexterity - b.dexterity,
|
||||
@@ -68,8 +68,8 @@ const SortFunctions: {
|
||||
getAverage(a.strength, a.defense, a.dexterity, a.agility) -
|
||||
getAverage(b.strength, b.defense, b.dexterity, b.agility),
|
||||
AverageAllStats: (a: Resleeve, b: Resleeve): number =>
|
||||
getAverage(a.hacking_skill, a.strength, a.defense, a.dexterity, a.agility, a.charisma) -
|
||||
getAverage(b.hacking_skill, b.strength, b.defense, b.dexterity, b.agility, b.charisma),
|
||||
getAverage(a.hacking, a.strength, a.defense, a.dexterity, a.agility, a.charisma) -
|
||||
getAverage(b.hacking, b.strength, b.defense, b.dexterity, b.agility, b.charisma),
|
||||
TotalNumAugmentations: (a: Resleeve, b: Resleeve): number => a.augmentations.length - b.augmentations.length,
|
||||
};
|
||||
|
||||
|
||||
@@ -397,7 +397,7 @@ export class Sleeve extends Person {
|
||||
}
|
||||
|
||||
const jobPerformance: number = companyPosition.calculateJobPerformance(
|
||||
this.hacking_skill,
|
||||
this.hacking,
|
||||
this.strength,
|
||||
this.defense,
|
||||
this.dexterity,
|
||||
|
||||
@@ -17,7 +17,7 @@ export function MoreStatsModal(props: IProps): React.ReactElement {
|
||||
rows={[
|
||||
[
|
||||
<>Hacking: </>,
|
||||
props.sleeve.hacking_skill,
|
||||
props.sleeve.hacking,
|
||||
<> ({numeralWrapper.formatExp(props.sleeve.hacking_exp)} exp)</>,
|
||||
],
|
||||
[
|
||||
|
||||
@@ -17,7 +17,7 @@ export function StatsElement(props: IProps): React.ReactElement {
|
||||
</>,
|
||||
],
|
||||
["City: ", <>{props.sleeve.city}</>],
|
||||
["Hacking: ", <>{numeralWrapper.formatSkill(props.sleeve.hacking_skill)}</>],
|
||||
["Hacking: ", <>{numeralWrapper.formatSkill(props.sleeve.hacking)}</>],
|
||||
["Strength: ", <>{numeralWrapper.formatSkill(props.sleeve.strength)}</>],
|
||||
["Defense: ", <>{numeralWrapper.formatSkill(props.sleeve.defense)}</>],
|
||||
["Dexterity: ", <>{numeralWrapper.formatSkill(props.sleeve.dexterity)}</>],
|
||||
|
||||
@@ -13,7 +13,7 @@ function mult(f: Faction): number {
|
||||
|
||||
export function getHackingWorkRepGain(p: IPlayer, f: Faction): number {
|
||||
return (
|
||||
((p.hacking_skill + p.intelligence / 3) / CONSTANTS.MaxSkillLevel) *
|
||||
((p.hacking + p.intelligence / 3) / CONSTANTS.MaxSkillLevel) *
|
||||
p.faction_rep_mult *
|
||||
p.getIntelligenceBonus(1) *
|
||||
mult(f)
|
||||
@@ -23,7 +23,7 @@ export function getHackingWorkRepGain(p: IPlayer, f: Faction): number {
|
||||
export function getFactionSecurityWorkRepGain(p: IPlayer, f: Faction): number {
|
||||
const t =
|
||||
(0.9 *
|
||||
(p.hacking_skill / CONSTANTS.MaxSkillLevel +
|
||||
(p.hacking / CONSTANTS.MaxSkillLevel +
|
||||
p.strength / CONSTANTS.MaxSkillLevel +
|
||||
p.defense / CONSTANTS.MaxSkillLevel +
|
||||
p.dexterity / CONSTANTS.MaxSkillLevel +
|
||||
@@ -36,7 +36,7 @@ export function getFactionSecurityWorkRepGain(p: IPlayer, f: Faction): number {
|
||||
export function getFactionFieldWorkRepGain(p: IPlayer, f: Faction): number {
|
||||
const t =
|
||||
(0.9 *
|
||||
(p.hacking_skill / CONSTANTS.MaxSkillLevel +
|
||||
(p.hacking / CONSTANTS.MaxSkillLevel +
|
||||
p.strength / CONSTANTS.MaxSkillLevel +
|
||||
p.defense / CONSTANTS.MaxSkillLevel +
|
||||
p.dexterity / CONSTANTS.MaxSkillLevel +
|
||||
|
||||
Reference in New Issue
Block a user