Skip to content

Commit

Permalink
BITNODE: IPvGO territory control strategy game (bitburner-official#934)
Browse files Browse the repository at this point in the history
  • Loading branch information
ficocelliguy authored and G4mingJon4s committed Mar 23, 2024
1 parent 81c499e commit 653c0f3
Show file tree
Hide file tree
Showing 67 changed files with 7,842 additions and 43 deletions.
21 changes: 21 additions & 0 deletions markdown/bitburner.go.analysis.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Go](./bitburner.go.md) &gt; [analysis](./bitburner.go.analysis.md)

## Go.analysis property

Tools to analyze the IPvGO subnet.

**Signature:**

```typescript
analysis: {
getValidMoves(): boolean[][];

getChains(): (number | null)[][];

getLiberties(): number[][];

getControlledEmptyNodes(): string[];
};
```
55 changes: 55 additions & 0 deletions markdown/bitburner.go.cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Go](./bitburner.go.md) &gt; [cheat](./bitburner.go.cheat.md)

## Go.cheat property

Illicit and dangerous IPvGO tools. Not for the faint of heart. Requires Bitnode 14.2 to use.

**Signature:**

```typescript
cheat: {
getCheatSuccessChance(): number;
removeRouter(
x: number,
y: number,
): Promise<{
type: "invalid" | "move" | "pass" | "gameOver";
x: number;
y: number;
success: boolean;
}>;
playTwoMoves(
x1: number,
y1: number,
x2: number,
x2: number,
): Promise<{
type: "invalid" | "move" | "pass" | "gameOver";
x: number;
y: number;
success: boolean;
}>;

repairOfflineNode(
x: number,
y: number,
): Promise<{
type: "invalid" | "move" | "pass" | "gameOver";
x: number;
y: number;
success: boolean;
}>;

destroyNode(
x: number,
y: number,
): Promise<{
type: "invalid" | "move" | "pass" | "gameOver";
x: number;
y: number;
success: boolean;
}>;
};
```
38 changes: 38 additions & 0 deletions markdown/bitburner.go.getboardstate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Go](./bitburner.go.md) &gt; [getBoardState](./bitburner.go.getboardstate.md)

## Go.getBoardState() method

Retrieves a simplified version of the board state. "X" represents black pieces, "O" white, and "." empty points. "\#" are dead nodes that are not part of the subnet. (They are not territory nor open nodes.)

For example, a 5x5 board might look like this:

```
[
"XX.O.",
"X..OO",
".XO..",
"XXO.#",
".XO.#",
]
```
Each string represents a vertical column on the board, and each character in the string represents a point.

Traditional notation for Go is e.g. "B,1" referring to second ("B") column, first rank. This is the equivalent of index \[1\]\[0\].

Note that the \[0\]\[0\] point is shown on the bottom-left on the visual board (as is traditional), and each string represents a vertical column on the board. In other words, the printed example above can be understood to be rotated 90 degrees clockwise compared to the board UI as shown in the IPvGO subnet tab.

**Signature:**

```typescript
getBoardState(): string[];
```
**Returns:**

string\[\]

## Remarks

RAM cost: 4 GB

17 changes: 17 additions & 0 deletions markdown/bitburner.go.getopponent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Go](./bitburner.go.md) &gt; [getOpponent](./bitburner.go.getopponent.md)

## Go.getOpponent() method

Returns the name of the opponent faction in the current subnet. "Netburners" \| "Slum Snakes" \| "The Black Hand" \| "Tetrads" \| "Daedalus" \| "Illuminati"

**Signature:**

```typescript
getOpponent(): opponents;
```
**Returns:**

opponents

39 changes: 39 additions & 0 deletions markdown/bitburner.go.makemove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Go](./bitburner.go.md) &gt; [makeMove](./bitburner.go.makemove.md)

## Go.makeMove() method

Make a move on the IPvGO subnet gameboard, and await the opponent's response. x:0 y:0 represents the bottom-left corner of the board in the UI.

**Signature:**

```typescript
makeMove(
x: number,
y: number,
): Promise<{
type: "invalid" | "move" | "pass" | "gameOver";
x: number;
y: number;
success: boolean;
}>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| x | number | |
| y | number | |

**Returns:**

Promise&lt;{ type: "invalid" \| "move" \| "pass" \| "gameOver"; x: number; y: number; success: boolean; }&gt;

a promise that contains if your move was valid and successful, the opponent move's x and y coordinates (or pass) in response, or an indication if the game has ended

## Remarks

RAM cost: 4 GB

41 changes: 41 additions & 0 deletions markdown/bitburner.go.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Go](./bitburner.go.md)

## Go interface

IPvGO api

**Signature:**

```typescript
export interface Go
```

## Properties

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [analysis](./bitburner.go.analysis.md) | | { getValidMoves(): boolean\[\]\[\]; getChains(): (number \| null)\[\]\[\]; getLiberties(): number\[\]\[\]; getControlledEmptyNodes(): string\[\]; } | Tools to analyze the IPvGO subnet. |
| [cheat](./bitburner.go.cheat.md) | | { getCheatSuccessChance(): number; removeRouter( x: number, y: number, ): Promise&lt;{ type: "invalid" \| "move" \| "pass" \| "gameOver"; x: number; y: number; success: boolean; }&gt;; playTwoMoves( x1: number, y1: number, x2: number, x2: number, ): Promise&lt;{ type: "invalid" \| "move" \| "pass" \| "gameOver"; x: number; y: number; success: boolean; }&gt;; repairOfflineNode( x: number, y: number, ): Promise&lt;{ type: "invalid" \| "move" \| "pass" \| "gameOver"; x: number; y: number; success: boolean; }&gt;; destroyNode( x: number, y: number, ): Promise&lt;{ type: "invalid" \| "move" \| "pass" \| "gameOver"; x: number; y: number; success: boolean; }&gt;; } | Illicit and dangerous IPvGO tools. Not for the faint of heart. Requires Bitnode 14.2 to use. |

## Methods

| Method | Description |
| --- | --- |
| [getBoardState()](./bitburner.go.getboardstate.md) | <p>Retrieves a simplified version of the board state. "X" represents black pieces, "O" white, and "." empty points. "\#" are dead nodes that are not part of the subnet. (They are not territory nor open nodes.)</p><p>For example, a 5x5 board might look like this:</p>
```
[
"XX.O.",
"X..OO",
".XO..",
"XXO.#",
".XO.#",
]
```
<p>Each string represents a vertical column on the board, and each character in the string represents a point.</p><p>Traditional notation for Go is e.g. "B,1" referring to second ("B") column, first rank. This is the equivalent of index \[1\]\[0\].</p><p>Note that the \[0\]\[0\] point is shown on the bottom-left on the visual board (as is traditional), and each string represents a vertical column on the board. In other words, the printed example above can be understood to be rotated 90 degrees clockwise compared to the board UI as shown in the IPvGO subnet tab.</p> |
| [getOpponent()](./bitburner.go.getopponent.md) | Returns the name of the opponent faction in the current subnet. "Netburners" \| "Slum Snakes" \| "The Black Hand" \| "Tetrads" \| "Daedalus" \| "Illuminati" |
| [makeMove(x, y)](./bitburner.go.makemove.md) | Make a move on the IPvGO subnet gameboard, and await the opponent's response. x:0 y:0 represents the bottom-left corner of the board in the UI. |
| [passTurn()](./bitburner.go.passturn.md) | <p>Pass the player's turn rather than making a move, and await the opponent's response. This ends the game if the opponent passed on the previous turn, or if the opponent passes on their following turn.</p><p>This can also be used if you pick up the game in a state where the opponent needs to play next. For example: if BitBurner was closed while waiting for the opponent to make a move, you may need to call passTurn() to get them to play their move on game start.</p> |
| [resetBoardState(opponent, boardSize)](./bitburner.go.resetboardstate.md) | <p>Gets new IPvGO subnet with the specified size owned by the listed faction, ready for the player to make a move. This will reset your win streak if the current game is not complete and you have already made moves.</p><p>Note that some factions will have a few routers on the subnet at this state.</p><p>opponent is "Netburners" or "Slum Snakes" or "The Black Hand" or "Daedalus" or "Illuminati",</p> |
30 changes: 30 additions & 0 deletions markdown/bitburner.go.passturn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Go](./bitburner.go.md) &gt; [passTurn](./bitburner.go.passturn.md)

## Go.passTurn() method

Pass the player's turn rather than making a move, and await the opponent's response. This ends the game if the opponent passed on the previous turn, or if the opponent passes on their following turn.

This can also be used if you pick up the game in a state where the opponent needs to play next. For example: if BitBurner was closed while waiting for the opponent to make a move, you may need to call passTurn() to get them to play their move on game start.

**Signature:**

```typescript
passTurn(): Promise<{
type: "invalid" | "move" | "pass" | "gameOver";
x: number;
y: number;
success: boolean;
}>;
```
**Returns:**

Promise&lt;{ type: "invalid" \| "move" \| "pass" \| "gameOver"; x: number; y: number; success: boolean; }&gt;

a promise that contains if your move was valid and successful, the opponent move's x and y coordinates (or pass) in response, or an indication if the game has ended

## Remarks

RAM cost: 0 GB

38 changes: 38 additions & 0 deletions markdown/bitburner.go.resetboardstate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Go](./bitburner.go.md) &gt; [resetBoardState](./bitburner.go.resetboardstate.md)

## Go.resetBoardState() method

Gets new IPvGO subnet with the specified size owned by the listed faction, ready for the player to make a move. This will reset your win streak if the current game is not complete and you have already made moves.

Note that some factions will have a few routers on the subnet at this state.

opponent is "Netburners" or "Slum Snakes" or "The Black Hand" or "Daedalus" or "Illuminati",

**Signature:**

```typescript
resetBoardState(
opponent: "Netburners" | "Slum Snakes" | "The Black Hand" | "Tetrads" | "Daedalus" | "Illuminati",
boardSize: 5 | 7 | 9 | 13,
): string[] | undefined;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| opponent | "Netburners" \| "Slum Snakes" \| "The Black Hand" \| "Tetrads" \| "Daedalus" \| "Illuminati" | |
| boardSize | 5 \| 7 \| 9 \| 13 | |

**Returns:**

string\[\] \| undefined

a simplified version of the board state as an array of strings representing the board columns. See ns.Go.getBoardState() for full details

## Remarks

RAM cost: 0 GB

1 change: 1 addition & 0 deletions markdown/bitburner.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
| [GangOtherInfoObject](./bitburner.gangotherinfoobject.md) | |
| [GangTaskStats](./bitburner.gangtaskstats.md) | Object representing data representing a gang member task. |
| [GangTerritory](./bitburner.gangterritory.md) | |
| [Go](./bitburner.go.md) | IPvGO api |
| [Grafting](./bitburner.grafting.md) | Grafting API |
| [HackingFormulas](./bitburner.hackingformulas.md) | Hacking formulas |
| [HackingMultipliers](./bitburner.hackingmultipliers.md) | Hack related multipliers. |
Expand Down
18 changes: 18 additions & 0 deletions markdown/bitburner.ns.go.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NS](./bitburner.ns.md) &gt; [go](./bitburner.ns.go.md)

## NS.go property

Namespace for Go functions.

**Signature:**

```typescript
readonly go: Go;
```

## Remarks

RAM cost: 0 GB

1 change: 1 addition & 0 deletions markdown/bitburner.ns.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export async function main(ns) {
| [enums](./bitburner.ns.enums.md) | | [NSEnums](./bitburner.nsenums.md) | |
| [formulas](./bitburner.ns.formulas.md) | <code>readonly</code> | [Formulas](./bitburner.formulas.md) | Namespace for formulas functions. |
| [gang](./bitburner.ns.gang.md) | <code>readonly</code> | [Gang](./bitburner.gang.md) | Namespace for gang functions. Contains spoilers. |
| [go](./bitburner.ns.go.md) | <code>readonly</code> | [Go](./bitburner.go.md) | Namespace for Go functions. |
| [grafting](./bitburner.ns.grafting.md) | <code>readonly</code> | [Grafting](./bitburner.grafting.md) | Namespace for grafting functions. Contains spoilers. |
| [hacknet](./bitburner.ns.hacknet.md) | <code>readonly</code> | [Hacknet](./bitburner.hacknet.md) | Namespace for hacknet functions. Some of this API contains spoilers. |
| [infiltration](./bitburner.ns.infiltration.md) | <code>readonly</code> | [Infiltration](./bitburner.infiltration.md) | Namespace for infiltration functions. |
Expand Down
15 changes: 9 additions & 6 deletions src/Augmentation/ui/PlayerMultipliers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ export function PlayerMultipliers(): React.ReactElement {
},
{
mult: "Hacking Speed",
current: current.hacking_speed,
augmented: rawEffect.hacking_speed * mults.hacking_speed,
current: Player.mults.hacking_speed,
augmented: Player.mults.hacking_speed * mults.hacking_speed,
bnMult: currentNodeMults.HackingSpeedMultiplier,
},
{
mult: "Hacking Money",
Expand Down Expand Up @@ -241,8 +242,9 @@ export function PlayerMultipliers(): React.ReactElement {
},
{
mult: "Company Reputation Gain",
current: current.company_rep,
augmented: rawEffect.company_rep * mults.company_rep,
current: Player.mults.company_rep,
augmented: Player.mults.company_rep * mults.company_rep,
bnMult: currentNodeMults.CompanyWorkRepGain,
color: Settings.theme.combat,
},
{
Expand All @@ -261,8 +263,9 @@ export function PlayerMultipliers(): React.ReactElement {
},
{
mult: "Crime Success Chance",
current: current.crime_success,
augmented: rawEffect.crime_success * mults.crime_success,
current: Player.mults.crime_success,
augmented: Player.mults.crime_success * mults.crime_success,
bnMult: currentNodeMults.CrimeSuccessRate,
color: Settings.theme.combat,
},
{
Expand Down
Loading

0 comments on commit 653c0f3

Please sign in to comment.