mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2025-01-08 22:37:37 +01:00
Blade action count replenishes more consistently
This commit is contained in:
parent
faa6f75027
commit
f7adadd671
4
dist/engine.bundle.js
vendored
4
dist/engine.bundle.js
vendored
File diff suppressed because one or more lines are too long
2
dist/engineStyle.bundle.js
vendored
2
dist/engineStyle.bundle.js
vendored
@ -1,2 +1,2 @@
|
||||
!function(n){function t(t){for(var e,i,f=t[0],c=t[1],l=t[2],p=0,s=[];p<f.length;p++)i=f[p],u[i]&&s.push(u[i][0]),u[i]=0;for(e in c)Object.prototype.hasOwnProperty.call(c,e)&&(n[e]=c[e]);for(a&&a(t);s.length;)s.shift()();return r.push.apply(r,l||[]),o()}function o(){for(var n,t=0;t<r.length;t++){for(var o=r[t],e=!0,f=1;f<o.length;f++){var c=o[f];0!==u[c]&&(e=!1)}e&&(r.splice(t--,1),n=i(i.s=o[0]))}return n}var e={},u={1:0},r=[];function i(t){if(e[t])return e[t].exports;var o=e[t]={i:t,l:!1,exports:{}};return n[t].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=n,i.c=e,i.d=function(n,t,o){i.o(n,t)||Object.defineProperty(n,t,{enumerable:!0,get:o})},i.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},i.t=function(n,t){if(1&t&&(n=i(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.__esModule)return n;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var e in n)i.d(o,e,function(t){return n[t]}.bind(null,e));return o},i.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return i.d(t,"a",t),t},i.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},i.p="";var f=window.webpackJsonp=window.webpackJsonp||[],c=f.push.bind(f);f.push=t,f=f.slice();for(var l=0;l<f.length;l++)t(f[l]);var a=c;r.push([769,0]),o()}({706:function(n,t,o){},708:function(n,t,o){},710:function(n,t,o){},712:function(n,t,o){},714:function(n,t,o){},716:function(n,t,o){},718:function(n,t,o){},720:function(n,t,o){},722:function(n,t,o){},724:function(n,t,o){},726:function(n,t,o){},728:function(n,t,o){},730:function(n,t,o){},732:function(n,t,o){},734:function(n,t,o){},736:function(n,t,o){},738:function(n,t,o){},740:function(n,t,o){},742:function(n,t,o){},744:function(n,t,o){},746:function(n,t,o){},748:function(n,t,o){},750:function(n,t,o){},752:function(n,t,o){},754:function(n,t,o){},756:function(n,t,o){},758:function(n,t,o){},760:function(n,t,o){},762:function(n,t,o){},764:function(n,t,o){},766:function(n,t,o){},769:function(n,t,o){"use strict";o.r(t);o(768),o(766),o(764),o(762),o(760),o(758),o(756),o(754),o(752),o(750),o(748),o(746),o(744),o(742),o(740),o(738),o(736),o(734),o(732),o(730),o(728),o(726),o(724),o(722),o(720),o(718),o(716),o(714),o(712),o(710),o(708),o(706)}});
|
||||
!function(n){function t(t){for(var e,i,f=t[0],c=t[1],l=t[2],p=0,s=[];p<f.length;p++)i=f[p],u[i]&&s.push(u[i][0]),u[i]=0;for(e in c)Object.prototype.hasOwnProperty.call(c,e)&&(n[e]=c[e]);for(a&&a(t);s.length;)s.shift()();return r.push.apply(r,l||[]),o()}function o(){for(var n,t=0;t<r.length;t++){for(var o=r[t],e=!0,f=1;f<o.length;f++){var c=o[f];0!==u[c]&&(e=!1)}e&&(r.splice(t--,1),n=i(i.s=o[0]))}return n}var e={},u={1:0},r=[];function i(t){if(e[t])return e[t].exports;var o=e[t]={i:t,l:!1,exports:{}};return n[t].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=n,i.c=e,i.d=function(n,t,o){i.o(n,t)||Object.defineProperty(n,t,{enumerable:!0,get:o})},i.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},i.t=function(n,t){if(1&t&&(n=i(n)),8&t)return n;if(4&t&&"object"==typeof n&&n&&n.__esModule)return n;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:n}),2&t&&"string"!=typeof n)for(var e in n)i.d(o,e,function(t){return n[t]}.bind(null,e));return o},i.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return i.d(t,"a",t),t},i.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},i.p="";var f=window.webpackJsonp=window.webpackJsonp||[],c=f.push.bind(f);f.push=t,f=f.slice();for(var l=0;l<f.length;l++)t(f[l]);var a=c;r.push([770,0]),o()}({707:function(n,t,o){},709:function(n,t,o){},711:function(n,t,o){},713:function(n,t,o){},715:function(n,t,o){},717:function(n,t,o){},719:function(n,t,o){},721:function(n,t,o){},723:function(n,t,o){},725:function(n,t,o){},727:function(n,t,o){},729:function(n,t,o){},731:function(n,t,o){},733:function(n,t,o){},735:function(n,t,o){},737:function(n,t,o){},739:function(n,t,o){},741:function(n,t,o){},743:function(n,t,o){},745:function(n,t,o){},747:function(n,t,o){},749:function(n,t,o){},751:function(n,t,o){},753:function(n,t,o){},755:function(n,t,o){},757:function(n,t,o){},759:function(n,t,o){},761:function(n,t,o){},763:function(n,t,o){},765:function(n,t,o){},767:function(n,t,o){},770:function(n,t,o){"use strict";o.r(t);o(769),o(767),o(765),o(763),o(761),o(759),o(757),o(755),o(753),o(751),o(749),o(747),o(745),o(743),o(741),o(739),o(737),o(735),o(733),o(731),o(729),o(727),o(725),o(723),o(721),o(719),o(717),o(715),o(713),o(711),o(709),o(707)}});
|
||||
//# sourceMappingURL=engineStyle.bundle.js.map
|
26
dist/vendor.bundle.js
vendored
26
dist/vendor.bundle.js
vendored
File diff suppressed because one or more lines are too long
@ -40,7 +40,6 @@ export interface IActionParams {
|
||||
isStealth?: boolean;
|
||||
isKill?: boolean;
|
||||
count?: number;
|
||||
countGrowth?: number;
|
||||
weights?: StatsMultiplier;
|
||||
decays?: StatsMultiplier;
|
||||
teamCount?: number;
|
||||
@ -78,7 +77,6 @@ export class Action implements IAction {
|
||||
* Growth rate is an integer and the count will increase by that integer every "cycle"
|
||||
*/
|
||||
count: number = getRandomInt(1e3, 25e3);
|
||||
countGrowth: number = getRandomInt(1, 5);
|
||||
|
||||
// Weighting of each stat in determining action success rate
|
||||
weights: StatsMultiplier = {
|
||||
@ -122,7 +120,6 @@ export class Action implements IAction {
|
||||
if (params && params.isKill) this.isKill = params.isKill;
|
||||
|
||||
if (params && params.count) this.count = params.count;
|
||||
if (params && params.countGrowth) this.countGrowth = params.countGrowth;
|
||||
|
||||
if (params && params.weights) this.weights = params.weights;
|
||||
if (params && params.decays) this.decays = params.decays;
|
||||
|
@ -9,7 +9,6 @@ export class BlackOperation extends Operation {
|
||||
constructor(params: IOperationParams | null = null) {
|
||||
super(params);
|
||||
this.count = 1;
|
||||
this.countGrowth = 0;
|
||||
}
|
||||
|
||||
// To be implemented by subtypes
|
||||
|
@ -7,6 +7,7 @@ import { IBladeburner } from "./IBladeburner";
|
||||
import { IActionIdentifier } from "./IActionIdentifier";
|
||||
import { ActionIdentifier } from "./ActionIdentifier";
|
||||
import { ActionTypes } from "./data/ActionTypes";
|
||||
import { Growths } from "./data/Growths";
|
||||
import { BlackOperations } from "./BlackOperations";
|
||||
import { BlackOperation } from "./BlackOperation";
|
||||
import { Operation } from "./Operation";
|
||||
@ -1857,7 +1858,6 @@ export class Bladeburner implements IBladeburner {
|
||||
rankGain: 0.3,
|
||||
hpLoss: 0.5,
|
||||
count: getRandomInt(25, 150),
|
||||
countGrowth: getRandomInt(5, 75) / 10,
|
||||
weights: {
|
||||
hack: 0,
|
||||
str: 0.05,
|
||||
@ -1890,7 +1890,6 @@ export class Bladeburner implements IBladeburner {
|
||||
rankGain: 0.9,
|
||||
hpLoss: 1,
|
||||
count: getRandomInt(5, 150),
|
||||
countGrowth: getRandomInt(5, 75) / 10,
|
||||
weights: {
|
||||
hack: 0,
|
||||
str: 0.15,
|
||||
@ -1923,7 +1922,6 @@ export class Bladeburner implements IBladeburner {
|
||||
rankGain: 0.6,
|
||||
hpLoss: 1,
|
||||
count: getRandomInt(5, 150),
|
||||
countGrowth: getRandomInt(5, 75) / 10,
|
||||
weights: {
|
||||
hack: 0,
|
||||
str: 0.2,
|
||||
@ -1960,7 +1958,6 @@ export class Bladeburner implements IBladeburner {
|
||||
rankGain: 2.2,
|
||||
rankLoss: 0.2,
|
||||
count: getRandomInt(1, 100),
|
||||
countGrowth: getRandomInt(10, 40) / 10,
|
||||
weights: {
|
||||
hack: 0.25,
|
||||
str: 0.05,
|
||||
@ -1996,7 +1993,6 @@ export class Bladeburner implements IBladeburner {
|
||||
rankLoss: 0.4,
|
||||
hpLoss: 2,
|
||||
count: getRandomInt(1, 100),
|
||||
countGrowth: getRandomInt(10, 40) / 10,
|
||||
weights: {
|
||||
hack: 0.2,
|
||||
str: 0.05,
|
||||
@ -2030,7 +2026,6 @@ export class Bladeburner implements IBladeburner {
|
||||
rankLoss: 0.5,
|
||||
hpLoss: 2.5,
|
||||
count: getRandomInt(1, 150),
|
||||
countGrowth: getRandomInt(3, 40) / 10,
|
||||
weights: {
|
||||
hack: 0.25,
|
||||
str: 0.05,
|
||||
@ -2065,7 +2060,6 @@ export class Bladeburner implements IBladeburner {
|
||||
rankLoss: 2.5,
|
||||
hpLoss: 50,
|
||||
count: getRandomInt(1, 150),
|
||||
countGrowth: getRandomInt(2, 40) / 10,
|
||||
weights: {
|
||||
hack: 0.1,
|
||||
str: 0.2,
|
||||
@ -2100,7 +2094,6 @@ export class Bladeburner implements IBladeburner {
|
||||
rankLoss: 2,
|
||||
hpLoss: 10,
|
||||
count: getRandomInt(1, 150),
|
||||
countGrowth: getRandomInt(1, 20) / 10,
|
||||
weights: {
|
||||
hack: 0.1,
|
||||
str: 0.1,
|
||||
@ -2136,7 +2129,6 @@ export class Bladeburner implements IBladeburner {
|
||||
rankLoss: 4,
|
||||
hpLoss: 5,
|
||||
count: getRandomInt(1, 150),
|
||||
countGrowth: getRandomInt(1, 20) / 10,
|
||||
weights: {
|
||||
hack: 0.1,
|
||||
str: 0.1,
|
||||
@ -2211,14 +2203,28 @@ export class Bladeburner implements IBladeburner {
|
||||
|
||||
// Count increase for contracts/operations
|
||||
for (const contract of Object.values(this.contracts) as Contract[]) {
|
||||
let growthF = Growths[contract.name];
|
||||
if (growthF === undefined)
|
||||
throw new Error(
|
||||
`growth formula for action '${contract.name}' is undefined`,
|
||||
);
|
||||
contract.count +=
|
||||
(seconds * contract.countGrowth) /
|
||||
BladeburnerConstants.ActionCountGrowthPeriod;
|
||||
(seconds * growthF()) / BladeburnerConstants.ActionCountGrowthPeriod;
|
||||
console.log(
|
||||
(seconds * growthF()) / BladeburnerConstants.ActionCountGrowthPeriod,
|
||||
);
|
||||
}
|
||||
for (const op of Object.values(this.operations) as Operation[]) {
|
||||
op.count +=
|
||||
(seconds * op.countGrowth) /
|
||||
BladeburnerConstants.ActionCountGrowthPeriod;
|
||||
const growthF = Growths[op.name];
|
||||
if (growthF === undefined)
|
||||
throw new Error(
|
||||
`growth formula for action '${op.name}' is undefined`,
|
||||
);
|
||||
if (growthF !== undefined) {
|
||||
op.count +=
|
||||
(seconds * growthF()) /
|
||||
BladeburnerConstants.ActionCountGrowthPeriod;
|
||||
}
|
||||
}
|
||||
|
||||
// Chaos goes down very slowly
|
||||
|
@ -48,7 +48,6 @@ export interface IAction {
|
||||
* Growth rate is an integer and the count will increase by that integer every "cycle"
|
||||
*/
|
||||
count: number;
|
||||
countGrowth: number;
|
||||
|
||||
// Weighting of each stat in determining action success rate
|
||||
weights: IStatsMultiplier;
|
||||
|
24
src/Bladeburner/data/Growths.ts
Normal file
24
src/Bladeburner/data/Growths.ts
Normal file
@ -0,0 +1,24 @@
|
||||
import { getRandomInt } from "../../../utils/helpers/getRandomInt";
|
||||
|
||||
export const Growths: {
|
||||
[key: string]: (() => number) | undefined;
|
||||
["Tracking"]: () => number;
|
||||
["Bounty Hunter"]: () => number;
|
||||
["Retirement"]: () => number;
|
||||
["Investigation"]: () => number;
|
||||
["Undercover Operation"]: () => number;
|
||||
["Sting Operation"]: () => number;
|
||||
["Raid"]: () => number;
|
||||
["Stealth Retirement Operation"]: () => number;
|
||||
["Assassination"]: () => number;
|
||||
} = {
|
||||
Tracking: () => getRandomInt(5, 75) / 10,
|
||||
"Bounty Hunter": () => getRandomInt(5, 75) / 10,
|
||||
Retirement: () => getRandomInt(5, 75) / 10,
|
||||
Investigation: () => getRandomInt(10, 40) / 10,
|
||||
"Undercover Operation": () => getRandomInt(10, 40) / 10,
|
||||
"Sting Operation": () => getRandomInt(3, 40) / 10,
|
||||
Raid: () => getRandomInt(2, 40) / 10,
|
||||
"Stealth Retirement Operation": () => getRandomInt(1, 20) / 10,
|
||||
Assassination: () => getRandomInt(1, 20) / 10,
|
||||
};
|
@ -54,7 +54,10 @@ export function findCrime(roughName: string): Crime | null {
|
||||
return Crimes.GrandTheftAuto;
|
||||
} else if (roughName.includes("kidnap")) {
|
||||
return Crimes.Kidnap;
|
||||
} else if (roughName.includes("assassinate")) {
|
||||
} else if (
|
||||
roughName.includes("assassinate") ||
|
||||
roughName.includes("assassination")
|
||||
) {
|
||||
return Crimes.Assassination;
|
||||
} else if (roughName.includes("heist")) {
|
||||
return Crimes.Heist;
|
||||
|
Loading…
Reference in New Issue
Block a user