BITNODE: IPvGO territory control strategy game (#934)

This commit is contained in:
Michael Ficocelli
2023-12-26 11:45:27 -05:00
committed by GitHub
parent c6141f2adf
commit 7ef12a0323
68 changed files with 7833 additions and 17 deletions
+3 -1
View File
@@ -16,7 +16,7 @@ import * as generalMethods from "./PlayerObjectGeneralMethods";
import * as serverMethods from "./PlayerObjectServerMethods";
import * as workMethods from "./PlayerObjectWorkMethods";
import { setPlayer } from "../../Player";
import { setPlayer } from "@player";
import { CompanyName, FactionName, JobName, LocationName } from "@enums";
import { HashManager } from "../../Hacknet/HashManager";
import { MoneySourceTracker } from "../../utils/MoneySourceTracker";
@@ -28,6 +28,7 @@ import { CONSTANTS } from "../../Constants";
import { Person } from "../Person";
import { isMember } from "../../utils/EnumHelper";
import { PartialRecord } from "../../Types/Record";
import { getGoPlayerStartingState } from "../../Go/boardState/goConstants";
export class PlayerObject extends Person implements IPlayer {
// Player-specific properties
@@ -36,6 +37,7 @@ export class PlayerObject extends Person implements IPlayer {
gang: Gang | null = null;
bladeburner: Bladeburner | null = null;
currentServer = "";
go = getGoPlayerStartingState();
factions: FactionName[] = [];
factionInvitations: FactionName[] = [];
factionRumors = new JSONSet<FactionName>();
@@ -1,6 +1,7 @@
/** Augmentation-related methods for the Player class (PlayerObject) */
import { calculateEntropy } from "../Grafting/EntropyAccumulation";
import { staneksGift } from "../../CotMG/Helper";
import { updateGoMults } from "../../Go/effects/effect";
import type { PlayerObject } from "./PlayerObject";
@@ -11,4 +12,5 @@ export function applyEntropy(this: PlayerObject, stacks = 1): void {
this.mults = calculateEntropy(stacks);
staneksGift.updateMults();
updateGoMults();
}
@@ -51,6 +51,8 @@ import { achievements } from "../../Achievements/Achievements";
import { isCompanyWork } from "../../Work/CompanyWork";
import { isMember } from "../../utils/EnumHelper";
import { getGoPlayerStartingState } from "../../Go/boardState/goConstants";
import { resetGoNodePower } from "../../Go/effects/effect";
export function init(this: PlayerObject): void {
/* Initialize Player's home computer */
@@ -112,6 +114,8 @@ export function prestigeAugmentation(this: PlayerObject): void {
this.sleeves.forEach((sleeve) => (sleeve.shock <= 0 ? sleeve.synchronize() : sleeve.shockRecovery()));
resetGoNodePower(this);
this.lastUpdate = new Date().getTime();
// Statistics Trackers
@@ -148,6 +152,7 @@ export function prestigeSourceFile(this: PlayerObject): void {
resetGangs();
this.corporation = null;
this.bladeburner = null;
this.go = getGoPlayerStartingState();
// Reset Stock market
this.hasWseAccount = false;