mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-18 13:43:49 +01:00
fix getActionRepGain
This commit is contained in:
parent
0ec4ef31ab
commit
80d751e32b
@ -116,9 +116,9 @@ export function NetscriptBladeburner(): InternalAPI<INetscriptBladeburner> {
|
||||
}
|
||||
},
|
||||
getActionEstimatedSuccessChance: (ctx) => (_type, _name) => {
|
||||
const bladeburner = getBladeburner(ctx);
|
||||
const type = helpers.string(ctx, "type", _type);
|
||||
const name = helpers.string(ctx, "name", _name);
|
||||
const bladeburner = getBladeburner(ctx);
|
||||
try {
|
||||
const chance = bladeburner.getActionEstimatedSuccessChanceNetscriptFn(Player, type, name);
|
||||
if (typeof chance === "string") {
|
||||
@ -133,24 +133,18 @@ export function NetscriptBladeburner(): InternalAPI<INetscriptBladeburner> {
|
||||
}
|
||||
},
|
||||
getActionRepGain: (ctx) => (_type, _name, _level) => {
|
||||
checkBladeburnerAccess(ctx);
|
||||
const type = helpers.string(ctx, "type", _type);
|
||||
const name = helpers.string(ctx, "name", _name);
|
||||
const level = helpers.number(ctx, "level", _level);
|
||||
checkBladeburnerAccess(ctx);
|
||||
const action = getBladeburnerActionObject(ctx, type, name);
|
||||
let rewardMultiplier;
|
||||
if (level == null || isNaN(level)) {
|
||||
rewardMultiplier = Math.pow(action.rewardFac, action.level - 1);
|
||||
} else {
|
||||
rewardMultiplier = Math.pow(action.rewardFac, level - 1);
|
||||
}
|
||||
|
||||
const level = _level === undefined ? action.level : helpers.number(ctx, "level", _level);
|
||||
const rewardMultiplier = Math.pow(action.rewardFac, level - 1);
|
||||
return action.rankGain * rewardMultiplier * BitNodeMultipliers.BladeburnerRank;
|
||||
},
|
||||
getActionCountRemaining: (ctx) => (_type, _name) => {
|
||||
const bladeburner = getBladeburner(ctx);
|
||||
const type = helpers.string(ctx, "type", _type);
|
||||
const name = helpers.string(ctx, "name", _name);
|
||||
const bladeburner = getBladeburner(ctx);
|
||||
try {
|
||||
return bladeburner.getActionCountRemainingNetscriptFn(type, name, ctx.workerScript);
|
||||
} catch (e: unknown) {
|
||||
|
Loading…
Reference in New Issue
Block a user