mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-18 13:43:49 +01:00
Merge branch 'uptodate' of https://github.com/Mughur/bitburner-src into docupdate
This commit is contained in:
commit
e7588de19c
@ -1,26 +1,16 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
|
|
||||||
.dist
|
|
||||||
.tmp
|
|
||||||
.package
|
.package
|
||||||
.build
|
.build
|
||||||
.cypress/
|
.app
|
||||||
|
|
||||||
dist/
|
dist
|
||||||
input/
|
input
|
||||||
assets/
|
assets
|
||||||
doc/
|
doc
|
||||||
markdown/
|
markdown
|
||||||
|
electron
|
||||||
|
tools
|
||||||
|
src/ThirdParty
|
||||||
|
|
||||||
|
|
||||||
test/netscript/
|
|
||||||
|
|
||||||
electron/lib
|
|
||||||
electron/greenworks.js
|
|
||||||
src/ThirdParty/*
|
|
||||||
src/JSInterpreter.js
|
|
||||||
tools/engines-check/
|
|
||||||
|
|
||||||
editor.main.js
|
|
||||||
main.bundle.js
|
|
||||||
webpack.config.js
|
webpack.config.js
|
||||||
|
67
.github/workflows/check-for-generated-files.yml
vendored
67
.github/workflows/check-for-generated-files.yml
vendored
@ -35,51 +35,30 @@ jobs:
|
|||||||
|
|
||||||
- name: Warn when bundle files were changed
|
- name: Warn when bundle files were changed
|
||||||
id: warn-bundles-changed
|
id: warn-bundles-changed
|
||||||
if: steps.changed-bundle-files.outputs.any_changed == 'true'
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
echo "One or more files in the bundle files were changed." >> warnings.txt
|
echo "Creating label (if it does not exist)"
|
||||||
|
LABEL="validation: bundle files modified"
|
||||||
|
gh --repo "${{ github.repository }}" \
|
||||||
|
label create "$LABEL" --description "Modifications to this pull request are suggested" --color D93F0B || true
|
||||||
|
|
||||||
- name: Warn when documentation markdown files were changed
|
if [ "${{ steps.changed-bundle-files.outputs.any_changed }}" == "false" ]; then
|
||||||
id: warn-markdown-changed
|
echo "No forbidden files included, removing warning"
|
||||||
if: steps.changed-markdown-doc-files.outputs.any_changed == 'true'
|
gh --repo "${{ github.repository }}" \
|
||||||
run: |
|
pr edit "${{ github.event.number }}" --remove-label "$LABEL" || true
|
||||||
echo "One or more files in the markdown documentation were changed." >> warnings.txt
|
|
||||||
|
|
||||||
- name: Print Warnings
|
|
||||||
id: get-warnings
|
|
||||||
run: |
|
|
||||||
if [ -f warnings.txt ]
|
|
||||||
then
|
|
||||||
echo "::set-output name=has_warnings::true"
|
|
||||||
else
|
else
|
||||||
echo "::set-output name=has_warnings::false"
|
echo "Forbidden files included, generating warning"
|
||||||
touch warnings.txt
|
|
||||||
|
touch comment.txt
|
||||||
|
echo "## Generated build or documentation files were included. PRs should not normally contain any generated files." >> comment.txt
|
||||||
|
echo "" >> comment.txt
|
||||||
|
echo "Review the changes and ensure that including built files was necessary." >> comment.txt
|
||||||
|
|
||||||
|
echo "Add pr label"
|
||||||
|
gh --repo "${{ github.repository }}" \
|
||||||
|
pr edit "${{ github.event.number }}" --add-label "$LABEL"
|
||||||
|
echo "And comment on the pr"
|
||||||
|
gh --repo "${{ github.repository }}" \
|
||||||
|
pr comment "${{ github.event.number }}" --body-file comment.txt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Get Comment Body
|
|
||||||
id: get-comment-body
|
|
||||||
if: steps.get-warnings.outputs.has_warnings == 'true'
|
|
||||||
run: |
|
|
||||||
cat warnings.txt > comment.txt
|
|
||||||
echo "" >> comment.txt
|
|
||||||
echo "Please do not commit files generated by webpack or generated markdown" >> comment.txt
|
|
||||||
echo "" >> comment.txt
|
|
||||||
echo "See [CONTRIBUTING.md](https://github.com/bitburner-official/bitburner-src/blob/dev/doc/CONTRIBUTING.md) for details." >> comment.txt
|
|
||||||
|
|
||||||
body=$(cat comment.txt)
|
|
||||||
body="${body//'%'/'%25'}"
|
|
||||||
body="${body//$'\n'/'%0A'}"
|
|
||||||
body="${body//$'\r'/'%0D'}"
|
|
||||||
|
|
||||||
echo ::set-output name=body::$body
|
|
||||||
- name: Add github comment on problem
|
|
||||||
if: steps.get-warnings.outputs.has_warnings == 'true'
|
|
||||||
uses: peter-evans/commit-comment@v1
|
|
||||||
with:
|
|
||||||
body: ${{ steps.get-comment-body.outputs.body }}
|
|
||||||
- name: Flag as error
|
|
||||||
if: steps.get-warnings.outputs.has_warnings == 'true'
|
|
||||||
run: |
|
|
||||||
COMMIT_WARNINGS=$(cat warnings.txt)
|
|
||||||
echo "::warning:: $COMMIT_WARNINGS"
|
|
||||||
exit 1
|
|
||||||
|
6
.github/workflows/ci-pr.yml
vendored
6
.github/workflows/ci-pr.yml
vendored
@ -1,7 +1,7 @@
|
|||||||
name: CI Pull Request
|
name: CI Pull Request
|
||||||
|
|
||||||
on:
|
on:
|
||||||
# Triggers the workflow on pull request events but only for the dev branch, checking only diffs
|
# Triggers the workflow on pull request events but only for the dev branch
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [dev]
|
branches: [dev]
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ jobs:
|
|||||||
- name: Install npm dependencies
|
- name: Install npm dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
- name: Run linter
|
- name: Run linter
|
||||||
run: npm run lint:report-diff
|
run: npm run lint:report
|
||||||
prettier:
|
prettier:
|
||||||
name: Prettier
|
name: Prettier
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -54,7 +54,7 @@ jobs:
|
|||||||
- name: Install npm dependencies
|
- name: Install npm dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
- name: Run prettier check
|
- name: Run prettier check
|
||||||
run: npm run format:report-diff
|
run: npm run format:report
|
||||||
test:
|
test:
|
||||||
name: Test
|
name: Test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
node_modules
|
node_modules
|
||||||
package.json
|
package.json
|
||||||
dist
|
dist
|
||||||
doc/build/
|
doc/build
|
||||||
doc/source
|
doc/source
|
||||||
.build
|
.build
|
||||||
.package
|
.package
|
||||||
|
.app
|
||||||
|
|
||||||
editor.main.js
|
editor.main.js
|
||||||
main.bundle.js
|
main.bundle.js
|
||||||
|
11
package.json
11
package.json
@ -102,14 +102,12 @@
|
|||||||
"doc": "npx api-extractor run && npx api-documenter markdown && rm input/bitburner.api.json && rm -r input",
|
"doc": "npx api-extractor run && npx api-documenter markdown && rm input/bitburner.api.json && rm -r input",
|
||||||
"format": "prettier --write .",
|
"format": "prettier --write .",
|
||||||
"format:report": "prettier -c .",
|
"format:report": "prettier -c .",
|
||||||
"format:report-diff": "bash -c 'if [[ $(git diff --name-only --diff-filter=ACMRTUXB origin/dev | grep -E \"(.js$|.jsx$|.ts$|.tsx$)\" | wc -c) -ne 0 ]]; then prettier -c $(git diff --name-only --diff-filter=ACMRTUXB origin/dev | grep -E \"(.js$|.jsx$|.ts$|.tsx$)\" | xargs); fi'",
|
|
||||||
"start": "http-server -p 8000",
|
"start": "http-server -p 8000",
|
||||||
"start:dev": "webpack serve --progress --env devServer --mode development",
|
"start:dev": "webpack serve --progress --env devServer --mode development",
|
||||||
"build": "bash ./tools/build.sh",
|
"build": "bash ./tools/build.sh production",
|
||||||
"build:dev": "webpack --mode development",
|
"build:dev": "bash ./tools/build.sh development",
|
||||||
"lint": "eslint --fix --ext js,jsx,ts,tsx --max-warnings 0 src",
|
"lint": "eslint --fix --ext js,jsx,ts,tsx --max-warnings 0 src",
|
||||||
"lint:report": "eslint --ext js,jsx,ts,tsx --max-warnings 0 src",
|
"lint:report": "eslint --ext js,jsx,ts,tsx --max-warnings 0 src",
|
||||||
"lint:report-diff": "eslint --max-warnings 0 $(git diff --name-only --diff-filter=ACMRTUXB origin/dev | grep -E \"(.js$|.jsx$|.ts$|.tsx$)\" | xargs)",
|
|
||||||
"preinstall": "node ./tools/engines-check/engines-check.js",
|
"preinstall": "node ./tools/engines-check/engines-check.js",
|
||||||
"postinstall": "cd electron && npm install",
|
"postinstall": "cd electron && npm install",
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
@ -117,11 +115,6 @@
|
|||||||
"watch": "webpack --watch --mode production",
|
"watch": "webpack --watch --mode production",
|
||||||
"watch:dev": "webpack --watch --mode development",
|
"watch:dev": "webpack --watch --mode development",
|
||||||
"electron": "bash ./tools/package-electron.sh",
|
"electron": "bash ./tools/package-electron.sh",
|
||||||
"electron:packager": "electron-packager .package bitburner --platform all --arch x64,armv7l,arm64,mips64el --out .build --overwrite --icon .package/icon.png --no-prune",
|
|
||||||
"electron:packager-all": "electron-packager .package bitburner --platform all --arch x64,armv7l,arm64,mips64el --out .build --overwrite --icon .package/icon.png",
|
|
||||||
"electron:packager-win": "electron-packager .package bitburner --platform win32 --arch x64 --out .build --overwrite --icon .package/icon.png",
|
|
||||||
"electron:packager-mac": "electron-packager .package bitburner --platform darwin --arch x64 --out .build --overwrite --icon .package/icon.png",
|
|
||||||
"electron:packager-linux": "electron-packager .package bitburner --platform linux --arch x64 --out .build --overwrite --icon .package/icon.png",
|
|
||||||
"allbuild": "npm run build && npm run electron && git add --all && git commit -m \"allbuild commit $(git rev-parse --short HEAD)\" && git push -u origin dev",
|
"allbuild": "npm run build && npm run electron && git add --all && git commit -m \"allbuild commit $(git rev-parse --short HEAD)\" && git push -u origin dev",
|
||||||
"preversion": "npm install && npm run test",
|
"preversion": "npm install && npm run test",
|
||||||
"version": "sh ./tools/build-release.sh && git add --all",
|
"version": "sh ./tools/build-release.sh && git add --all",
|
||||||
|
@ -15,7 +15,7 @@ import { IndustryType, EmployeePositions } from "./Enums";
|
|||||||
// This structure + import * as corpConstants allows easier type definitions for individual properties.
|
// This structure + import * as corpConstants allows easier type definitions for individual properties.
|
||||||
|
|
||||||
/** Names of all corporation game states */
|
/** Names of all corporation game states */
|
||||||
export const stateNames: CorpStateName[] = ["START", "PURCHASE", "PRODUCTION", "SALE", "EXPORT"],
|
export const stateNames: CorpStateName[] = ["START", "PURCHASE", "PRODUCTION", "EXPORT", "SALE"],
|
||||||
// TODO: remove IndustryType and EmployeePositions enums and just use the typed strings.
|
// TODO: remove IndustryType and EmployeePositions enums and just use the typed strings.
|
||||||
/** Names of all corporation employee positions */
|
/** Names of all corporation employee positions */
|
||||||
employeePositions: CorpEmployeePosition[] = Object.values(EmployeePositions),
|
employeePositions: CorpEmployeePosition[] = Object.values(EmployeePositions),
|
||||||
|
@ -1,54 +1,52 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
import Accordion from "@mui/material/Accordion";
|
import Accordion from "@mui/material/Accordion";
|
||||||
import AccordionSummary from "@mui/material/AccordionSummary";
|
import AccordionSummary from "@mui/material/AccordionSummary";
|
||||||
import AccordionDetails from "@mui/material/AccordionDetails";
|
import AccordionDetails from "@mui/material/AccordionDetails";
|
||||||
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
|
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
|
||||||
|
import Button from "@mui/material/Button";
|
||||||
import { Adjuster } from "./Adjuster";
|
import { Adjuster } from "./Adjuster";
|
||||||
import { Player } from "@player";
|
import { Player } from "@player";
|
||||||
|
import { CityName } from "../../Enums";
|
||||||
|
|
||||||
const bigNumber = 1e27;
|
const bigNumber = 1e27;
|
||||||
|
|
||||||
export function Bladeburner(): React.ReactElement {
|
export function Bladeburner(): React.ReactElement {
|
||||||
|
if (!Player.bladeburner) return <></>;
|
||||||
const bladeburner = Player.bladeburner;
|
const bladeburner = Player.bladeburner;
|
||||||
if (bladeburner === null) return <></>;
|
|
||||||
function modifyBladeburnerRank(modify: number): (x: number) => void {
|
|
||||||
return function (rank: number): void {
|
|
||||||
if (!bladeburner) return;
|
|
||||||
bladeburner.changeRank(Player, rank * modify);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function resetBladeburnerRank(): void {
|
// Rank functions
|
||||||
if (!bladeburner) return;
|
const modifyBladeburnerRank = (modify: number) => (rank: number) => bladeburner.changeRank(Player, rank * modify);
|
||||||
|
const resetBladeburnerRank = () => {
|
||||||
bladeburner.rank = 0;
|
bladeburner.rank = 0;
|
||||||
bladeburner.maxRank = 0;
|
bladeburner.maxRank = 0;
|
||||||
}
|
};
|
||||||
|
const addTonsBladeburnerRank = () => bladeburner.changeRank(Player, bigNumber);
|
||||||
|
|
||||||
function addTonsBladeburnerRank(): void {
|
// Skill point functions
|
||||||
if (!bladeburner) return;
|
const modifyBladeburnerSP = (modify: number) => (skillPoints: number) => {
|
||||||
|
bladeburner.skillPoints += skillPoints * modify;
|
||||||
|
};
|
||||||
|
const resetBladeburnerSP = () => {
|
||||||
|
bladeburner.skillPoints = 0;
|
||||||
|
bladeburner.totalSkillPoints = 0;
|
||||||
|
};
|
||||||
|
const addTonsBladeburnerSP = () => (bladeburner.skillPoints = bigNumber);
|
||||||
|
|
||||||
bladeburner.changeRank(Player, bigNumber);
|
// Cycles functions
|
||||||
}
|
const modifyBladeburnerCycles = (modify: number) => (cycles: number) => (bladeburner.storedCycles += cycles * modify);
|
||||||
|
const resetBladeburnerCycles = () => (bladeburner.storedCycles = 0);
|
||||||
|
const addTonsBladeburnerCycles = () => (bladeburner.storedCycles += bigNumber);
|
||||||
|
|
||||||
function modifyBladeburnerCycles(modify: number): (x: number) => void {
|
// Chaos functions
|
||||||
return function (cycles: number): void {
|
const wipeAllChaos = () => Object.values(CityName).forEach((city) => (bladeburner.cities[city].chaos = 0));
|
||||||
if (!bladeburner) return;
|
const wipeActiveCityChaos = () => (bladeburner.cities[bladeburner.city].chaos = 0);
|
||||||
bladeburner.storedCycles += cycles * modify;
|
const addAllChaos = (modify: number) => (chaos: number) => {
|
||||||
};
|
Object.values(CityName).forEach((city) => (bladeburner.cities[city].chaos += chaos * modify));
|
||||||
}
|
};
|
||||||
|
const addTonsAllChaos = () => {
|
||||||
function resetBladeburnerCycles(): void {
|
Object.values(CityName).forEach((city) => (bladeburner.cities[city].chaos += bigNumber));
|
||||||
if (!bladeburner) return;
|
};
|
||||||
bladeburner.storedCycles = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
function addTonsBladeburnerCycles(): void {
|
|
||||||
if (!bladeburner) return;
|
|
||||||
bladeburner.storedCycles += bigNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Accordion TransitionProps={{ unmountOnExit: true }}>
|
<Accordion TransitionProps={{ unmountOnExit: true }}>
|
||||||
@ -75,7 +73,22 @@ export function Bladeburner(): React.ReactElement {
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<Typography>Cycles:</Typography>
|
<Typography>SP:</Typography>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Adjuster
|
||||||
|
label="skill points"
|
||||||
|
placeholder="amt"
|
||||||
|
tons={addTonsBladeburnerSP}
|
||||||
|
add={modifyBladeburnerSP(1)}
|
||||||
|
subtract={modifyBladeburnerSP(-1)}
|
||||||
|
reset={resetBladeburnerSP}
|
||||||
|
/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<Typography>Cycles: </Typography>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<Adjuster
|
<Adjuster
|
||||||
@ -88,9 +101,25 @@ export function Bladeburner(): React.ReactElement {
|
|||||||
/>
|
/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<Typography title="This is for ALL cities">Chaos:</Typography>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<Adjuster
|
||||||
|
label="chaos in all cities"
|
||||||
|
placeholder="amt"
|
||||||
|
tons={addTonsAllChaos}
|
||||||
|
add={addAllChaos(1)}
|
||||||
|
subtract={addAllChaos(-1)}
|
||||||
|
reset={wipeAllChaos}
|
||||||
|
/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</AccordionDetails>
|
</AccordionDetails>
|
||||||
|
<Button onClick={wipeActiveCityChaos}>Clear Active City's Chaos</Button>
|
||||||
</Accordion>
|
</Accordion>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
|
|
||||||
import Accordion from "@mui/material/Accordion";
|
import Accordion from "@mui/material/Accordion";
|
||||||
import AccordionSummary from "@mui/material/AccordionSummary";
|
import AccordionSummary from "@mui/material/AccordionSummary";
|
||||||
import AccordionDetails from "@mui/material/AccordionDetails";
|
import AccordionDetails from "@mui/material/AccordionDetails";
|
||||||
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
|
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
|
||||||
|
|
||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
import Button from "@mui/material/Button";
|
import Button from "@mui/material/Button";
|
||||||
import { Money } from "../../ui/React/Money";
|
import { Money } from "../../ui/React/Money";
|
||||||
@ -15,59 +13,68 @@ import { Bladeburner } from "../../Bladeburner/Bladeburner";
|
|||||||
import { GangConstants } from "../../Gang/data/Constants";
|
import { GangConstants } from "../../Gang/data/Constants";
|
||||||
import { FactionNames } from "../../Faction/data/FactionNames";
|
import { FactionNames } from "../../Faction/data/FactionNames";
|
||||||
import { checkForMessagesToSend } from "../../Message/MessageHelpers";
|
import { checkForMessagesToSend } from "../../Message/MessageHelpers";
|
||||||
|
import { ThemeEvents } from "../../Themes/ui/Theme";
|
||||||
|
|
||||||
export function General(): React.ReactElement {
|
export function General(): React.ReactElement {
|
||||||
const [error, setError] = useState(false);
|
const [error, setError] = useState(false);
|
||||||
const [corporationName, setCorporationName] = useState("");
|
const [corporationName, setCorporationName] = useState("");
|
||||||
const [gangFaction, setGangFaction] = useState("");
|
const [gangFaction, setGangFaction] = useState("Slum Snakes");
|
||||||
|
const [devMoney, setDevMoney] = useState(0);
|
||||||
|
|
||||||
function addMoney(n: number) {
|
// Money functions
|
||||||
return function () {
|
const addCustomMoney = () => !Number.isNaN(devMoney) && Player.gainMoney(devMoney, "other");
|
||||||
Player.gainMoney(n, "other");
|
const addMoney = (n: number) => () => Player.gainMoney(n, "other");
|
||||||
};
|
const setMoney = (n: number) => () => (Player.money = Number(n));
|
||||||
}
|
|
||||||
|
|
||||||
function upgradeRam(): void {
|
// Ram functions
|
||||||
Player.getHomeComputer().maxRam *= 2;
|
const upgradeRam = () => (Player.getHomeComputer().maxRam *= 2);
|
||||||
}
|
|
||||||
|
|
||||||
function quickB1tFlum3(): void {
|
// Node-clearing functions
|
||||||
Router.toBitVerse(true, true);
|
const quickB1tFlum3 = () => Router.toBitVerse(true, true);
|
||||||
}
|
const b1tflum3 = () => Router.toBitVerse(true, false);
|
||||||
|
const quickHackW0r1dD43m0n = () => Router.toBitVerse(false, true);
|
||||||
|
const hackW0r1dD43m0n = () => Router.toBitVerse(false, false);
|
||||||
|
|
||||||
function b1tflum3(): void {
|
// Corp functions
|
||||||
Router.toBitVerse(true, false);
|
const createCorporation = () => {
|
||||||
}
|
|
||||||
|
|
||||||
function quickHackW0r1dD43m0n(): void {
|
|
||||||
Router.toBitVerse(false, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
function hackW0r1dD43m0n(): void {
|
|
||||||
Router.toBitVerse(false, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createCorporation(): void {
|
|
||||||
Player.startCorporation(corporationName);
|
Player.startCorporation(corporationName);
|
||||||
}
|
// Rerender so the corp menu option will show up immediately on the devmenu page selection
|
||||||
|
ThemeEvents.emit();
|
||||||
|
};
|
||||||
|
const destroyCorporation = () => {
|
||||||
|
Player.corporation = null;
|
||||||
|
// Rerender so the corp menu option will be removed immediately on the devmenu page selection
|
||||||
|
ThemeEvents.emit();
|
||||||
|
};
|
||||||
|
|
||||||
function joinBladeburner(): void {
|
// Blade functions
|
||||||
|
const joinBladeburner = () => {
|
||||||
Player.bladeburner = new Bladeburner();
|
Player.bladeburner = new Bladeburner();
|
||||||
}
|
// Rerender so the blade menu option will show up immediately on the devmenu page selection
|
||||||
|
ThemeEvents.emit();
|
||||||
|
};
|
||||||
|
const leaveBladeburner = () => {
|
||||||
|
Player.bladeburner = null;
|
||||||
|
// Rerender so the blade menu option will be removed immediately on the devmenu page selection
|
||||||
|
ThemeEvents.emit();
|
||||||
|
};
|
||||||
|
|
||||||
function startGang(): void {
|
// Gang functions
|
||||||
|
const startGang = () => {
|
||||||
const isHacking = gangFaction === FactionNames.NiteSec || gangFaction === FactionNames.TheBlackHand;
|
const isHacking = gangFaction === FactionNames.NiteSec || gangFaction === FactionNames.TheBlackHand;
|
||||||
Player.startGang(gangFaction, isHacking);
|
Player.startGang(gangFaction, isHacking);
|
||||||
}
|
// Rerender so the gang menu option will show up immediately on the devmenu page selection
|
||||||
|
ThemeEvents.emit();
|
||||||
function setGangFactionDropdown(event: SelectChangeEvent<string>): void {
|
};
|
||||||
setGangFaction(event.target.value);
|
const stopGang = () => {
|
||||||
}
|
Player.gang = null;
|
||||||
|
// Rerender so the gang menu option will be removed immediately on the devmenu page selection
|
||||||
function checkMessages(): void {
|
ThemeEvents.emit();
|
||||||
checkForMessagesToSend();
|
};
|
||||||
}
|
const setGangFactionDropdown = (event: SelectChangeEvent<string>) => setGangFaction(event.target.value);
|
||||||
|
|
||||||
|
// Misc functions
|
||||||
|
const checkMessages = () => checkForMessagesToSend();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (error) throw new ReferenceError("Manually thrown error");
|
if (error) throw new ReferenceError("Manually thrown error");
|
||||||
}, [error]);
|
}, [error]);
|
||||||
@ -78,6 +85,14 @@ export function General(): React.ReactElement {
|
|||||||
<Typography>General</Typography>
|
<Typography>General</Typography>
|
||||||
</AccordionSummary>
|
</AccordionSummary>
|
||||||
<AccordionDetails>
|
<AccordionDetails>
|
||||||
|
<Button
|
||||||
|
onClick={setMoney(0)}
|
||||||
|
title="This sets your money to $0, this means the money you had will just vanish without being accounted for where it went and may offset some metrics."
|
||||||
|
>
|
||||||
|
<pre>
|
||||||
|
= <Money money={0} />
|
||||||
|
</pre>
|
||||||
|
</Button>
|
||||||
<Button onClick={addMoney(1e6)}>
|
<Button onClick={addMoney(1e6)}>
|
||||||
<pre>
|
<pre>
|
||||||
+ <Money money={1e6} />
|
+ <Money money={1e6} />
|
||||||
@ -105,23 +120,42 @@ export function General(): React.ReactElement {
|
|||||||
</Button>
|
</Button>
|
||||||
<Button onClick={upgradeRam}>+ RAM</Button>
|
<Button onClick={upgradeRam}>+ RAM</Button>
|
||||||
<br />
|
<br />
|
||||||
<Typography>Corporation Name:</Typography>
|
<Typography>Add Custom Money</Typography>
|
||||||
<TextField value={corporationName} onChange={(x) => setCorporationName(x.target.value)} />
|
<TextField onChange={(x) => setDevMoney(parseFloat(x.target.value))} />
|
||||||
<Button onClick={createCorporation}>Create Corporation</Button>
|
<Button onClick={addCustomMoney}>Give Money</Button>
|
||||||
<br />
|
<br />
|
||||||
<Typography>Gang Faction:</Typography>
|
{Player.corporation ? (
|
||||||
<Select value={gangFaction} onChange={setGangFactionDropdown}>
|
<Button onClick={destroyCorporation}>Destroy Corporation</Button>
|
||||||
{GangConstants.Names.map((factionName) => (
|
) : (
|
||||||
<MenuItem key={factionName} value={factionName}>
|
<>
|
||||||
{factionName}
|
<Typography>Corporation Name:</Typography>
|
||||||
</MenuItem>
|
<TextField value={corporationName} onChange={(x) => setCorporationName(x.target.value)} />
|
||||||
))}
|
<Button onClick={createCorporation}>Create Corporation</Button>
|
||||||
</Select>
|
</>
|
||||||
<Button onClick={startGang}>Start Gang</Button>
|
)}
|
||||||
<br />
|
<br />
|
||||||
<Button onClick={joinBladeburner}>Join BladeBurner</Button>
|
{Player.gang ? (
|
||||||
|
<Button onClick={stopGang}>Stop Gang</Button>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<Typography>Gang Faction:</Typography>
|
||||||
|
<Select value={gangFaction} onChange={setGangFactionDropdown}>
|
||||||
|
{GangConstants.Names.map((factionName) => (
|
||||||
|
<MenuItem key={factionName} value={factionName}>
|
||||||
|
{factionName}
|
||||||
|
</MenuItem>
|
||||||
|
))}
|
||||||
|
</Select>
|
||||||
|
<Button onClick={startGang}>Start Gang</Button>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
<br />
|
||||||
|
{Player.bladeburner ? (
|
||||||
|
<Button onClick={leaveBladeburner}>Leave BladeBurner</Button>
|
||||||
|
) : (
|
||||||
|
<Button onClick={joinBladeburner}>Join BladeBurner</Button>
|
||||||
|
)}
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<Button onClick={quickB1tFlum3}>Quick b1t_flum3.exe</Button>
|
<Button onClick={quickB1tFlum3}>Quick b1t_flum3.exe</Button>
|
||||||
<Button onClick={b1tflum3}>Run b1t_flum3.exe</Button>
|
<Button onClick={b1tflum3}>Run b1t_flum3.exe</Button>
|
||||||
<Button onClick={quickHackW0r1dD43m0n}>Quick w0rld_d34m0n</Button>
|
<Button onClick={quickHackW0r1dD43m0n}>Quick w0rld_d34m0n</Button>
|
||||||
|
4
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
4
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@ -7604,7 +7604,7 @@ interface CorporationInfo {
|
|||||||
dividendTax: number;
|
dividendTax: number;
|
||||||
/** Your earnings as a shareholder per second this cycle */
|
/** Your earnings as a shareholder per second this cycle */
|
||||||
dividendEarnings: number;
|
dividendEarnings: number;
|
||||||
/** State of the corporation. Possible states are START, PURCHASE, PRODUCTION, SALE, EXPORT. */
|
/** State of the corporation. Possible states are START, PURCHASE, PRODUCTION, EXPORT, SALE. */
|
||||||
state: string;
|
state: string;
|
||||||
/** Array of all division names */
|
/** Array of all division names */
|
||||||
divisions: string[];
|
divisions: string[];
|
||||||
@ -7662,7 +7662,7 @@ interface CorpConstants {
|
|||||||
minEmployeeDecay: number;
|
minEmployeeDecay: number;
|
||||||
}
|
}
|
||||||
/** @public */
|
/** @public */
|
||||||
type CorpStateName = "START" | "PURCHASE" | "PRODUCTION" | "SALE" | "EXPORT";
|
type CorpStateName = "START" | "PURCHASE" | "PRODUCTION" | "EXPORT" | "SALE";
|
||||||
|
|
||||||
/** @public */
|
/** @public */
|
||||||
type CorpMaterialName =
|
type CorpMaterialName =
|
||||||
|
@ -12,3 +12,4 @@ export { Theme as DiscordLike } from "./discord-like";
|
|||||||
export { Theme as OneDark } from "./one-dark";
|
export { Theme as OneDark } from "./one-dark";
|
||||||
export { Theme as MutedGoldBlue } from "./muted-gold-blue";
|
export { Theme as MutedGoldBlue } from "./muted-gold-blue";
|
||||||
export { Theme as Light } from "./light";
|
export { Theme as Light } from "./light";
|
||||||
|
export { Theme as IronMan } from "./iron-man";
|
||||||
|
45
src/Themes/data/iron-man/index.ts
Normal file
45
src/Themes/data/iron-man/index.ts
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
import { IPredefinedTheme } from "../../Themes";
|
||||||
|
import img1 from "./screenshot.png";
|
||||||
|
|
||||||
|
export const Theme: IPredefinedTheme = {
|
||||||
|
name: "Iron Man",
|
||||||
|
credit: "Matti#2942",
|
||||||
|
description: "Mark 42. Threw a little hot rod red in there.",
|
||||||
|
reference: "https://discord.com/channels/415207508303544321/921991895230611466/1069233364927787089",
|
||||||
|
screenshot: img1,
|
||||||
|
colors: {
|
||||||
|
primarylight: "#FFFEFC",
|
||||||
|
primary: "#FFA95E",
|
||||||
|
primarydark: "#E8BC71",
|
||||||
|
successlight: "#00FF00",
|
||||||
|
success: "#0c0",
|
||||||
|
successdark: "#090",
|
||||||
|
errorlight: "#FF0B0B",
|
||||||
|
error: "#FF0000",
|
||||||
|
errordark: "#770000",
|
||||||
|
secondarylight: "#FFC596",
|
||||||
|
secondary: "#DA3F3F",
|
||||||
|
secondarydark: "#6E1D1D",
|
||||||
|
warninglight: "#ff0",
|
||||||
|
warning: "#cc0",
|
||||||
|
warningdark: "#990",
|
||||||
|
infolight: "#FFFFFF",
|
||||||
|
info: "#B6E9FF",
|
||||||
|
infodark: "#5596CF",
|
||||||
|
welllight: "#8A2121",
|
||||||
|
well: "#350000",
|
||||||
|
white: "#fff",
|
||||||
|
black: "#000",
|
||||||
|
hp: "#FF4E4E",
|
||||||
|
money: "#C2F26F",
|
||||||
|
hack: "#D5FFB2",
|
||||||
|
combat: "#E39C5A",
|
||||||
|
cha: "#CA4444",
|
||||||
|
int: "#6495ed",
|
||||||
|
rep: "#E39C5A",
|
||||||
|
disabled: "#3C0C0C",
|
||||||
|
backgroundprimary: "#2C0707",
|
||||||
|
backgroundsecondary: "#551212",
|
||||||
|
button: "#8A2121",
|
||||||
|
},
|
||||||
|
};
|
BIN
src/Themes/data/iron-man/screenshot.png
Normal file
BIN
src/Themes/data/iron-man/screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 64 KiB |
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# builds the game in the root folder
|
# builds the game in the root folder
|
||||||
webpack --mode production
|
webpack --mode $1
|
||||||
|
|
||||||
# Clear out any files remaining from old builds and recreate folder
|
# Clear out any files remaining from old builds and recreate folder
|
||||||
rm -rf .app
|
rm -rf .app
|
||||||
|
Loading…
Reference in New Issue
Block a user