mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-17 21:23:54 +01:00
bugfix
This commit is contained in:
parent
f8917473f8
commit
88b4a7d862
@ -16,6 +16,8 @@ migrated (only for ns2):
|
||||
|
||||
not migrated (require manual changes sometimes):
|
||||
|
||||
* getPlayer().hacking_skill renamed `hacking`
|
||||
* same thing in sleeves
|
||||
* getPurchasedServers won't let you query for ips instead of hostnames.
|
||||
* getStats is deprecated in favor getPlayer
|
||||
* getCharacterInformation is deprecated in favor getPlayer
|
||||
|
@ -224,7 +224,7 @@ export class Action implements IAction {
|
||||
let high = real + diff;
|
||||
const city = inst.getCurrentCity();
|
||||
const r = city.pop / city.popEst;
|
||||
|
||||
console.log(`${est} ${real}`);
|
||||
if (r < 1) low *= r;
|
||||
else high *= r;
|
||||
return [clamp(low), clamp(high)];
|
||||
|
@ -1424,7 +1424,7 @@ export class Bladeburner implements IBladeburner {
|
||||
case ActionTypes["Field Analysis"]: {
|
||||
// Does not use stamina. Effectiveness depends on hacking, int, and cha
|
||||
let eff =
|
||||
0.04 * Math.pow(player.hacking_skill, 0.3) +
|
||||
0.04 * Math.pow(player.hacking, 0.3) +
|
||||
0.04 * Math.pow(player.intelligence, 0.9) +
|
||||
0.02 * Math.pow(player.charisma, 0.3);
|
||||
eff *= player.bladeburner_analysis_mult;
|
||||
|
@ -110,7 +110,7 @@ export class Crime {
|
||||
|
||||
successRate(p: IPlayerOrSleeve): number {
|
||||
let chance: number =
|
||||
this.hacking_success_weight * p.hacking_skill +
|
||||
this.hacking_success_weight * p.hacking +
|
||||
this.strength_success_weight * p.strength +
|
||||
this.defense_success_weight * p.defense +
|
||||
this.dexterity_success_weight * p.dexterity +
|
||||
|
@ -12,7 +12,7 @@ export interface ICrime {
|
||||
}
|
||||
|
||||
export interface IPerson {
|
||||
hacking_skill: number;
|
||||
hacking: number;
|
||||
strength: number;
|
||||
defense: number;
|
||||
dexterity: number;
|
||||
@ -24,7 +24,7 @@ export interface IPerson {
|
||||
|
||||
export function calculateCrimeSuccessChance(crime: ICrime, person: IPerson): number {
|
||||
let chance: number =
|
||||
crime.hacking_success_weight * person.hacking_skill +
|
||||
crime.hacking_success_weight * person.hacking +
|
||||
crime.strength_success_weight * person.strength +
|
||||
crime.defense_success_weight * person.defense +
|
||||
crime.dexterity_success_weight * person.dexterity +
|
||||
|
@ -9,7 +9,7 @@ import { Server } from "./Server/Server";
|
||||
export function calculateHackingChance(server: Server, player: IPlayer): number {
|
||||
const hackFactor = 1.75;
|
||||
const difficultyMult = (100 - server.hackDifficulty) / 100;
|
||||
const skillMult = hackFactor * player.hacking_skill;
|
||||
const skillMult = hackFactor * player.hacking;
|
||||
const skillChance = (skillMult - server.requiredHackingSkill) / skillMult;
|
||||
const chance =
|
||||
skillChance * difficultyMult * player.hacking_chance_mult * calculateIntelligenceBonus(player.intelligence, 1);
|
||||
@ -48,7 +48,7 @@ export function calculatePercentMoneyHacked(server: Server, player: IPlayer): nu
|
||||
const balanceFactor = 240;
|
||||
|
||||
const difficultyMult = (100 - server.hackDifficulty) / 100;
|
||||
const skillMult = (player.hacking_skill - (server.requiredHackingSkill - 1)) / player.hacking_skill;
|
||||
const skillMult = (player.hacking - (server.requiredHackingSkill - 1)) / player.hacking;
|
||||
const percentMoneyHacked = (difficultyMult * skillMult * player.hacking_money_mult) / balanceFactor;
|
||||
if (percentMoneyHacked < 0) {
|
||||
return 0;
|
||||
@ -71,7 +71,7 @@ export function calculateHackingTime(server: Server, player: IPlayer): number {
|
||||
const diffFactor = 2.5;
|
||||
let skillFactor = diffFactor * difficultyMult + baseDiff;
|
||||
// tslint:disable-next-line
|
||||
skillFactor /= player.hacking_skill + baseSkill;
|
||||
skillFactor /= player.hacking + baseSkill;
|
||||
|
||||
const hackTimeMultiplier = 5;
|
||||
const hackingTime =
|
||||
|
@ -36,7 +36,7 @@ export function netscriptCanHack(server: Server, p: IPlayer): IReturnStatus {
|
||||
}
|
||||
|
||||
const s = server;
|
||||
if (s.requiredHackingSkill > p.hacking_skill) {
|
||||
if (s.requiredHackingSkill > p.hacking) {
|
||||
return {
|
||||
res: false,
|
||||
msg: `Cannot hack ${server.hostname} server because your hacking skill is not high enough`,
|
||||
|
@ -73,26 +73,26 @@ function checkForMessagesToSend(): void {
|
||||
if (!redPillFlag) {
|
||||
sendMessage(redpill);
|
||||
}
|
||||
} else if (jumper0 && !jumper0.recvd && Player.hacking_skill >= 25) {
|
||||
} else if (jumper0 && !jumper0.recvd && Player.hacking >= 25) {
|
||||
sendMessage(jumper0);
|
||||
const flightName = Programs.Flight.name;
|
||||
const homeComp = Player.getHomeComputer();
|
||||
if (!homeComp.programs.includes(flightName)) {
|
||||
homeComp.programs.push(flightName);
|
||||
}
|
||||
} else if (jumper1 && !jumper1.recvd && Player.hacking_skill >= 40) {
|
||||
} else if (jumper1 && !jumper1.recvd && Player.hacking >= 40) {
|
||||
sendMessage(jumper1);
|
||||
} else if (cybersecTest && !cybersecTest.recvd && Player.hacking_skill >= 50) {
|
||||
} else if (cybersecTest && !cybersecTest.recvd && Player.hacking >= 50) {
|
||||
sendMessage(cybersecTest);
|
||||
} else if (jumper2 && !jumper2.recvd && Player.hacking_skill >= 175) {
|
||||
} else if (jumper2 && !jumper2.recvd && Player.hacking >= 175) {
|
||||
sendMessage(jumper2);
|
||||
} else if (nitesecTest && !nitesecTest.recvd && Player.hacking_skill >= 200) {
|
||||
} else if (nitesecTest && !nitesecTest.recvd && Player.hacking >= 200) {
|
||||
sendMessage(nitesecTest);
|
||||
} else if (jumper3 && !jumper3.recvd && Player.hacking_skill >= 350) {
|
||||
} else if (jumper3 && !jumper3.recvd && Player.hacking >= 350) {
|
||||
sendMessage(jumper3);
|
||||
} else if (jumper4 && !jumper4.recvd && Player.hacking_skill >= 490) {
|
||||
} else if (jumper4 && !jumper4.recvd && Player.hacking >= 490) {
|
||||
sendMessage(jumper4);
|
||||
} else if (bitrunnersTest && !bitrunnersTest.recvd && Player.hacking_skill >= 500) {
|
||||
} else if (bitrunnersTest && !bitrunnersTest.recvd && Player.hacking >= 500) {
|
||||
sendMessage(bitrunnersTest);
|
||||
}
|
||||
}
|
||||
|
@ -1229,8 +1229,8 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
|
||||
getHackingLevel: function (): any {
|
||||
updateDynamicRam("getHackingLevel", getRamCost("getHackingLevel"));
|
||||
Player.updateSkillLevels();
|
||||
workerScript.log("getHackingLevel", `returned ${Player.hacking_skill}`);
|
||||
return Player.hacking_skill;
|
||||
workerScript.log("getHackingLevel", `returned ${Player.hacking}`);
|
||||
return Player.hacking;
|
||||
},
|
||||
getHackingMultipliers: function (): any {
|
||||
updateDynamicRam("getHackingMultipliers", getRamCost("getHackingMultipliers"));
|
||||
@ -2085,7 +2085,7 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
|
||||
helper.updateDynamicRam("getPlayer", getRamCost("getPlayer"));
|
||||
|
||||
const data = {
|
||||
hacking_skill: Player.hacking_skill,
|
||||
hacking: Player.hacking,
|
||||
hp: Player.hp,
|
||||
max_hp: Player.max_hp,
|
||||
strength: Player.strength,
|
||||
|
@ -630,7 +630,7 @@ export function NetscriptSingularity(
|
||||
workerScript.log("getStats", `getStats is deprecated, please use getplayer`);
|
||||
|
||||
return {
|
||||
hacking: player.hacking_skill,
|
||||
hacking: player.hacking,
|
||||
strength: player.strength,
|
||||
defense: player.defense,
|
||||
dexterity: player.dexterity,
|
||||
|
@ -139,7 +139,7 @@ export function NetscriptSleeve(player: IPlayer, workerScript: WorkerScript, hel
|
||||
getSleeveStats: function (asleeveNumber: any = 0): {
|
||||
shock: number;
|
||||
sync: number;
|
||||
hacking_skill: number;
|
||||
hacking: number;
|
||||
strength: number;
|
||||
defense: number;
|
||||
dexterity: number;
|
||||
@ -155,7 +155,7 @@ export function NetscriptSleeve(player: IPlayer, workerScript: WorkerScript, hel
|
||||
return {
|
||||
shock: 100 - sl.shock,
|
||||
sync: sl.sync,
|
||||
hacking_skill: sl.hacking_skill,
|
||||
hacking: sl.hacking,
|
||||
strength: sl.strength,
|
||||
defense: sl.defense,
|
||||
dexterity: sl.dexterity,
|
||||
|
@ -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 +
|
||||
|
@ -14,13 +14,13 @@ import { calculateHackingTime, calculateGrowTime, calculateWeakenTime } from "..
|
||||
|
||||
function requireHackingLevel(lvl: number) {
|
||||
return function (p: IPlayer) {
|
||||
return p.hacking_skill >= lvl;
|
||||
return p.hacking >= lvl;
|
||||
};
|
||||
}
|
||||
|
||||
function bitFlumeRequirements() {
|
||||
return function (p: IPlayer) {
|
||||
return p.sourceFiles.length > 0 && p.hacking_skill >= 1;
|
||||
return p.sourceFiles.length > 0 && p.hacking >= 1;
|
||||
};
|
||||
}
|
||||
|
||||
@ -306,12 +306,11 @@ export const programsMetadata: IProgramCreationParams[] = [
|
||||
create: null,
|
||||
run: (router: IRouter, terminal: ITerminal, player: IPlayer): void => {
|
||||
const numAugReq = Math.round(BitNodeMultipliers.DaedalusAugsRequirement * 30);
|
||||
const fulfilled =
|
||||
player.augmentations.length >= numAugReq && player.money.gt(1e11) && player.hacking_skill >= 2500;
|
||||
const fulfilled = player.augmentations.length >= numAugReq && player.money.gt(1e11) && player.hacking >= 2500;
|
||||
if (!fulfilled) {
|
||||
terminal.print(`Augmentations: ${player.augmentations.length} / ${numAugReq}`);
|
||||
terminal.print(`Money: ${numeralWrapper.formatMoney(player.money.toNumber())} / $100b`);
|
||||
terminal.print(`Hacking skill: ${player.hacking_skill} / 2500`);
|
||||
terminal.print(`Hacking skill: ${player.hacking} / 2500`);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -293,7 +293,6 @@ function loadGame(saveString: string): boolean {
|
||||
if (saveObj.hasOwnProperty("VersionSave")) {
|
||||
try {
|
||||
const ver = JSON.parse(saveObj.VersionSave, Reviver);
|
||||
console.log(ver);
|
||||
evaluateVersionCompatibility(ver);
|
||||
|
||||
if (window.location.href.toLowerCase().includes("bitburner-beta")) {
|
||||
|
4
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
4
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@ -2,7 +2,7 @@
|
||||
* @public
|
||||
*/
|
||||
interface Player {
|
||||
hacking_skill: number;
|
||||
hacking: number;
|
||||
hp: number;
|
||||
max_hp: number;
|
||||
strength: number;
|
||||
@ -815,7 +815,7 @@ export interface SleeveSkills {
|
||||
/** current sync of the sleeve [0-100] */
|
||||
sync: number;
|
||||
/** current hacking skill of the sleeve */
|
||||
hacking_skill: number;
|
||||
hacking: number;
|
||||
/** current strength of the sleeve */
|
||||
strength: number;
|
||||
/** current defense of the sleeve */
|
||||
|
@ -29,7 +29,7 @@ export function backdoor(
|
||||
);
|
||||
} else if (!normalServer.hasAdminRights) {
|
||||
terminal.error("You do not have admin rights for this machine! Cannot backdoor");
|
||||
} else if (normalServer.requiredHackingSkill > player.hacking_skill) {
|
||||
} else if (normalServer.requiredHackingSkill > player.hacking) {
|
||||
terminal.error(
|
||||
"Your hacking skill is not high enough to use backdoor on this machine. Try analyzing the machine to determine the required hacking skill",
|
||||
);
|
||||
|
@ -34,7 +34,7 @@ export function grow(
|
||||
terminal.error("You do not have admin rights for this machine! Cannot grow");
|
||||
return;
|
||||
}
|
||||
if (normalServer.requiredHackingSkill > player.hacking_skill) {
|
||||
if (normalServer.requiredHackingSkill > player.hacking) {
|
||||
terminal.error(
|
||||
"Your hacking skill is not high enough to attempt hacking this machine. Try analyzing the machine to determine the required hacking skill",
|
||||
);
|
||||
|
@ -34,7 +34,7 @@ export function hack(
|
||||
terminal.error("You do not have admin rights for this machine! Cannot hack");
|
||||
return;
|
||||
}
|
||||
if (normalServer.requiredHackingSkill > player.hacking_skill) {
|
||||
if (normalServer.requiredHackingSkill > player.hacking) {
|
||||
terminal.error(
|
||||
"Your hacking skill is not high enough to attempt hacking this machine. Try analyzing the machine to determine the required hacking skill",
|
||||
);
|
||||
|
@ -34,7 +34,7 @@ export function weaken(
|
||||
terminal.error("You do not have admin rights for this machine! Cannot weaken");
|
||||
return;
|
||||
}
|
||||
if (normalServer.requiredHackingSkill > player.hacking_skill) {
|
||||
if (normalServer.requiredHackingSkill > player.hacking) {
|
||||
terminal.error(
|
||||
"Your hacking skill is not high enough to attempt hacking this machine. Try analyzing the machine to determine the required hacking skill",
|
||||
);
|
||||
|
@ -303,7 +303,7 @@ export function CharacterStats(): React.ReactElement {
|
||||
<Typography noWrap>Hacking: </Typography>
|
||||
</TableCell>
|
||||
<TableCell align="right">
|
||||
<Typography noWrap>{numeralWrapper.formatSkill(player.hacking_skill)} </Typography>
|
||||
<Typography noWrap>{numeralWrapper.formatSkill(player.hacking)} </Typography>
|
||||
</TableCell>
|
||||
<TableCell align="right">
|
||||
<Typography noWrap>({numeralWrapper.formatExp(player.hacking_exp)} exp)</Typography>
|
||||
|
@ -192,9 +192,7 @@ export function CharacterOverview({ save, killScripts }: IProps): React.ReactEle
|
||||
<Typography classes={{ root: classes.hack }}>Hack </Typography>
|
||||
</TableCell>
|
||||
<TableCell align="right" classes={{ root: classes.cell }}>
|
||||
<Typography classes={{ root: classes.hack }}>
|
||||
{numeralWrapper.formatSkill(player.hacking_skill)}
|
||||
</Typography>
|
||||
<Typography classes={{ root: classes.hack }}>{numeralWrapper.formatSkill(player.hacking)}</Typography>
|
||||
</TableCell>
|
||||
<TableCell align="right" classes={{ root: classes.cell }}>
|
||||
<Typography id="overview-hack-hook" classes={{ root: classes.hack }}>
|
||||
|
@ -63,6 +63,14 @@ export function ThemeEditorModal(props: IProps): React.ReactElement {
|
||||
...Settings.theme,
|
||||
});
|
||||
|
||||
function resetTheme(): void {
|
||||
setCustomTheme({
|
||||
...defaultSettings.theme,
|
||||
});
|
||||
Object.assign(Settings.theme, defaultSettings.theme);
|
||||
ThemeEvents.emit();
|
||||
}
|
||||
|
||||
function onThemeChange(event: React.ChangeEvent<HTMLInputElement>): void {
|
||||
try {
|
||||
const importedTheme = JSON.parse(event.target.value);
|
||||
@ -299,7 +307,18 @@ export function ThemeEditorModal(props: IProps): React.ReactElement {
|
||||
/>
|
||||
<br />
|
||||
<br />
|
||||
<TextField label={"import / export theme"} value={JSON.stringify(customTheme)} onChange={onThemeChange} />
|
||||
<TextField
|
||||
label={"import / export theme"}
|
||||
value={JSON.stringify(customTheme)}
|
||||
onChange={onThemeChange}
|
||||
InputProps={{
|
||||
endAdornment: (
|
||||
<IconButton onClick={resetTheme} size="large">
|
||||
<ReplyIcon />
|
||||
</IconButton>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user