mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-25 17:13:47 +01:00
IPVGO: Add getCheatCount(). (#1734)
This commit is contained in:
parent
b01527a9dc
commit
0bf378a1b0
21
markdown/bitburner.gocheat.getcheatcount.md
Normal file
21
markdown/bitburner.gocheat.getcheatcount.md
Normal file
@ -0,0 +1,21 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [GoCheat](./bitburner.gocheat.md) > [getCheatCount](./bitburner.gocheat.getcheatcount.md)
|
||||
|
||||
## GoCheat.getCheatCount() method
|
||||
|
||||
Returns the number of times you've attempted to cheat in the current game.
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
getCheatCount(): number;
|
||||
```
|
||||
**Returns:**
|
||||
|
||||
number
|
||||
|
||||
## Remarks
|
||||
|
||||
RAM cost: 1 GB Requires BitNode 14.2 to use
|
||||
|
@ -4,15 +4,22 @@
|
||||
|
||||
## GoCheat.getCheatSuccessChance() method
|
||||
|
||||
Returns your chance of successfully playing one of the special moves in the ns.go.cheat API. Scales with your crime success rate stat.
|
||||
Returns your chance of successfully playing one of the special moves in the ns.go.cheat API. Scales up with your crime success rate stat. Scales down with the number of times you've attempted to cheat in the current game.
|
||||
|
||||
Warning: if you fail to play a cheat move, your turn will be skipped. After your first cheat attempt, if you fail, there is a small (\~10%) chance you will instantly be ejected from the subnet.
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
getCheatSuccessChance(): number;
|
||||
getCheatSuccessChance(cheatCount?: number): number;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| cheatCount | number | _(Optional)_ Optional override for the number of cheats already attempted. Defaults to the number of cheats attempted in the current game. |
|
||||
|
||||
**Returns:**
|
||||
|
||||
number
|
||||
|
@ -17,7 +17,8 @@ export interface GoCheat
|
||||
| Method | Description |
|
||||
| --- | --- |
|
||||
| [destroyNode(x, y)](./bitburner.gocheat.destroynode.md) | <p>Attempts to destroy an empty node, leaving an offline dead space that does not count as territory or provide open node access to adjacent routers.</p><p>Success chance can be seen via ns.go.getCheatSuccessChance()</p><p>Warning: if you fail to play a cheat move, your turn will be skipped. After your first cheat attempt, if you fail, there is a small (\~10%) chance you will instantly be ejected from the subnet.</p> |
|
||||
| [getCheatSuccessChance()](./bitburner.gocheat.getcheatsuccesschance.md) | <p>Returns your chance of successfully playing one of the special moves in the ns.go.cheat API. Scales with your crime success rate stat.</p><p>Warning: if you fail to play a cheat move, your turn will be skipped. After your first cheat attempt, if you fail, there is a small (\~10%) chance you will instantly be ejected from the subnet.</p> |
|
||||
| [getCheatCount()](./bitburner.gocheat.getcheatcount.md) | Returns the number of times you've attempted to cheat in the current game. |
|
||||
| [getCheatSuccessChance(cheatCount)](./bitburner.gocheat.getcheatsuccesschance.md) | <p>Returns your chance of successfully playing one of the special moves in the ns.go.cheat API. Scales up with your crime success rate stat. Scales down with the number of times you've attempted to cheat in the current game.</p><p>Warning: if you fail to play a cheat move, your turn will be skipped. After your first cheat attempt, if you fail, there is a small (\~10%) chance you will instantly be ejected from the subnet.</p> |
|
||||
| [playTwoMoves(x1, y1, x2, y2)](./bitburner.gocheat.playtwomoves.md) | <p>Attempts to place two routers at once on empty nodes. Note that this ignores other move restrictions, so you can suicide your own routers if they have no access to empty ports and do not capture any enemy routers.</p><p>Success chance can be seen via ns.go.getCheatSuccessChance()</p><p>Warning: if you fail to play a cheat move, your turn will be skipped. After your first cheat attempt, if you fail, there is a small (\~10%) chance you will instantly be ejected from the subnet.</p> |
|
||||
| [removeRouter(x, y)](./bitburner.gocheat.removerouter.md) | <p>Attempts to remove an existing router, leaving an empty node behind.</p><p>Success chance can be seen via ns.go.getCheatSuccessChance()</p><p>Warning: if you fail to play a cheat move, your turn will be skipped. After your first cheat attempt, if you fail, there is a small (\~10%) chance you will instantly be ejected from the subnet.</p> |
|
||||
| [repairOfflineNode(x, y)](./bitburner.gocheat.repairofflinenode.md) | <p>Attempts to repair an offline node, leaving an empty playable node behind.</p><p>Success chance can be seen via ns.go.getCheatSuccessChance()</p><p>Warning: if you fail to play a cheat move, your turn will be skipped. After your first cheat attempt, if you fail, there is a small (\~10%) chance you will instantly be ejected from the subnet.</p> |
|
||||
|
@ -272,6 +272,7 @@ const go = {
|
||||
},
|
||||
cheat: {
|
||||
getCheatSuccessChance: 1,
|
||||
getCheatCount: 1,
|
||||
removeRouter: 8,
|
||||
playTwoMoves: 8,
|
||||
repairOfflineNode: 8,
|
||||
|
@ -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) =>
|
||||
|
15
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
15
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@ -4399,16 +4399,27 @@ export interface GoAnalysis {
|
||||
export interface GoCheat {
|
||||
/**
|
||||
* Returns your chance of successfully playing one of the special moves in the ns.go.cheat API.
|
||||
* Scales with your crime success rate stat.
|
||||
* Scales up with your crime success rate stat.
|
||||
* Scales down with the number of times you've attempted to cheat in the current game.
|
||||
*
|
||||
* Warning: if you fail to play a cheat move, your turn will be skipped. After your first cheat attempt, if you fail, there is a
|
||||
* small (~10%) chance you will instantly be ejected from the subnet.
|
||||
*
|
||||
* @param cheatCount - Optional override for the number of cheats already attempted. Defaults to the number of cheats attempted in the current game.
|
||||
*
|
||||
* @remarks
|
||||
* RAM cost: 1 GB
|
||||
* Requires BitNode 14.2 to use
|
||||
*/
|
||||
getCheatSuccessChance(): number;
|
||||
getCheatSuccessChance(cheatCount?: number): number;
|
||||
/**
|
||||
* Returns the number of times you've attempted to cheat in the current game.
|
||||
*
|
||||
* @remarks
|
||||
* RAM cost: 1 GB
|
||||
* Requires BitNode 14.2 to use
|
||||
*/
|
||||
getCheatCount(): number;
|
||||
/**
|
||||
* Attempts to remove an existing router, leaving an empty node behind.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user