BLADEBURNER: Allow unsafe positive integers for skill upgrade count (#1211)

This commit is contained in:
Snarling
2024-04-08 06:33:45 -04:00
committed by GitHub
parent 7ae309edda
commit be437c83f6
2 changed files with 9 additions and 16 deletions
+2 -2
View File
@@ -202,14 +202,14 @@ export function NetscriptBladeburner(): InternalAPI<INetscriptBladeburner> {
getSkillUpgradeCost: (ctx) => (_skillName, _count) => {
const bladeburner = getBladeburner(ctx);
const skillName = getEnumHelper("BladeSkillName").nsGetMember(ctx, _skillName, "skillName");
const count = helpers.positiveSafeInteger(ctx, "count", _count ?? 1);
const count = helpers.positiveInteger(ctx, "count", _count ?? 1);
const currentLevel = bladeburner.getSkillLevel(skillName);
return Skills[skillName].calculateCost(currentLevel, count);
},
upgradeSkill: (ctx) => (_skillName, _count) => {
const bladeburner = getBladeburner(ctx);
const skillName = getEnumHelper("BladeSkillName").nsGetMember(ctx, _skillName, "skillName");
const count = helpers.positiveSafeInteger(ctx, "count", _count ?? 1);
const count = helpers.positiveInteger(ctx, "count", _count ?? 1);
const attempt = bladeburner.upgradeSkill(skillName, count);
helpers.log(ctx, () => attempt.message);
return !!attempt.success;