IPVGO: Add getCheatCount(). (#1734)

This commit is contained in:
ballardrog
2024-10-27 18:52:23 -07:00
committed by GitHub
parent b01527a9dc
commit 0bf378a1b0
6 changed files with 55 additions and 7 deletions
+9 -2
View File
@@ -100,9 +100,16 @@ export function NetscriptGo(): InternalAPI<NSGo> {
},
},
cheat: {
getCheatSuccessChance: (ctx: NetscriptContext) => () => {
getCheatSuccessChance:
(ctx: NetscriptContext) =>
(_cheatCount = Go.currentGame.cheatCount) => {
checkCheatApiAccess(error(ctx));
const cheatCount = helpers.number(ctx, "cheatCount", _cheatCount);
return cheatSuccessChance(cheatCount);
},
getCheatCount: (ctx: NetscriptContext) => () => {
checkCheatApiAccess(error(ctx));
return cheatSuccessChance(Go.currentGame.cheatCount);
return Go.currentGame.cheatCount;
},
removeRouter:
(ctx: NetscriptContext) =>