mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-27 01:53:48 +01:00
Merge pull request #3199 from phyzical/bugfix/fix-sleeve-shock-check
purchaseSleeveAug
This commit is contained in:
commit
629707dc32
@ -30,6 +30,20 @@ export function NetscriptSleeve(player: IPlayer, workerScript: WorkerScript, hel
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getSleeveStats = function (sleeveNumber: any): any {
|
||||||
|
const sl = player.sleeves[sleeveNumber];
|
||||||
|
return {
|
||||||
|
shock: 100 - sl.shock,
|
||||||
|
sync: sl.sync,
|
||||||
|
hacking: sl.hacking,
|
||||||
|
strength: sl.strength,
|
||||||
|
defense: sl.defense,
|
||||||
|
dexterity: sl.dexterity,
|
||||||
|
agility: sl.agility,
|
||||||
|
charisma: sl.charisma,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
getNumSleeves: function (): number {
|
getNumSleeves: function (): number {
|
||||||
helper.updateDynamicRam("getNumSleeves", getRamCost(player, "sleeve", "getNumSleeves"));
|
helper.updateDynamicRam("getNumSleeves", getRamCost(player, "sleeve", "getNumSleeves"));
|
||||||
@ -150,18 +164,7 @@ export function NetscriptSleeve(player: IPlayer, workerScript: WorkerScript, hel
|
|||||||
helper.updateDynamicRam("getSleeveStats", getRamCost(player, "sleeve", "getSleeveStats"));
|
helper.updateDynamicRam("getSleeveStats", getRamCost(player, "sleeve", "getSleeveStats"));
|
||||||
checkSleeveAPIAccess("getSleeveStats");
|
checkSleeveAPIAccess("getSleeveStats");
|
||||||
checkSleeveNumber("getSleeveStats", sleeveNumber);
|
checkSleeveNumber("getSleeveStats", sleeveNumber);
|
||||||
|
return getSleeveStats(sleeveNumber)
|
||||||
const sl = player.sleeves[sleeveNumber];
|
|
||||||
return {
|
|
||||||
shock: 100 - sl.shock,
|
|
||||||
sync: sl.sync,
|
|
||||||
hacking: sl.hacking,
|
|
||||||
strength: sl.strength,
|
|
||||||
defense: sl.defense,
|
|
||||||
dexterity: sl.dexterity,
|
|
||||||
agility: sl.agility,
|
|
||||||
charisma: sl.charisma,
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
getTask: function (asleeveNumber: any = 0): {
|
getTask: function (asleeveNumber: any = 0): {
|
||||||
task: string;
|
task: string;
|
||||||
@ -289,7 +292,7 @@ export function NetscriptSleeve(player: IPlayer, workerScript: WorkerScript, hel
|
|||||||
checkSleeveAPIAccess("purchaseSleeveAug");
|
checkSleeveAPIAccess("purchaseSleeveAug");
|
||||||
checkSleeveNumber("purchaseSleeveAug", sleeveNumber);
|
checkSleeveNumber("purchaseSleeveAug", sleeveNumber);
|
||||||
|
|
||||||
if (player.sleeves[sleeveNumber].shock > 0){
|
if (getSleeveStats(sleeveNumber).shock > 0) {
|
||||||
throw helper.makeRuntimeErrorMsg("sleeve.purchaseSleeveAug", `Sleeve shock too high: Sleeve ${sleeveNumber}`);
|
throw helper.makeRuntimeErrorMsg("sleeve.purchaseSleeveAug", `Sleeve shock too high: Sleeve ${sleeveNumber}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user