mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-07 16:17:49 +02:00
API: Add weakenEffect to formulas.hacking namespace (#2626)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Player } from "@player";
|
||||
import { calculateServerGrowth, calculateGrowMoney } from "../Server/formulas/grow";
|
||||
import { numCycleForGrowthCorrected } from "../Server/ServerHelpers";
|
||||
import { getWeakenEffect, numCycleForGrowthCorrected } from "../Server/ServerHelpers";
|
||||
import {
|
||||
calculateMoneyGainRate,
|
||||
calculateLevelUpgradeCost,
|
||||
@@ -235,6 +235,14 @@ export function NetscriptFormulas(): InternalAPI<IFormulas> {
|
||||
checkFormulasAccess(ctx);
|
||||
return calculateWeakenTime(server, person) * 1000;
|
||||
},
|
||||
weakenEffect:
|
||||
(ctx) =>
|
||||
(_threads, _cores = 1) => {
|
||||
const threads = helpers.number(ctx, "threads", _threads);
|
||||
const cores = helpers.number(ctx, "cores", _cores);
|
||||
checkFormulasAccess(ctx);
|
||||
return getWeakenEffect(threads, cores);
|
||||
},
|
||||
},
|
||||
hacknetNodes: {
|
||||
moneyGainRate:
|
||||
|
||||
Reference in New Issue
Block a user