bitburner-src/src/PersonObjects/IPlayer.ts

295 lines
10 KiB
TypeScript
Raw Normal View History

/**
* Interface for an object that represents the player (PlayerObject)
* Used because at the time of implementation, the PlayerObject
* cant be converted to TypeScript.
*/
import { Resleeve } from "./Resleeving/Resleeve";
import { Sleeve } from "./Sleeve/Sleeve";
import { IMap } from "../types";
2021-09-05 01:09:30 +02:00
import { IPlayerOwnedAugmentation } from "../Augmentation/PlayerOwnedAugmentation";
2021-09-13 00:03:07 +02:00
import { Augmentation } from "../Augmentation/Augmentation";
2021-09-05 01:09:30 +02:00
import { Company } from "../Company/Company";
import { CompanyPosition } from "../Company/CompanyPosition";
import { CityName } from "../Locations/data/CityNames";
import { Faction } from "../Faction/Faction";
import { HashManager } from "../Hacknet/HashManager";
import { HacknetNode } from "../Hacknet/HacknetNode";
import { LocationName } from "../Locations/data/LocationNames";
import { Server } from "../Server/Server";
2021-10-07 22:04:04 +02:00
import { BaseServer } from "../Server/BaseServer";
2021-09-05 01:09:30 +02:00
import { IPlayerOwnedSourceFile } from "../SourceFile/PlayerOwnedSourceFile";
import { MoneySourceTracker } from "../utils/MoneySourceTracker";
import { Exploit } from "../Exploits/Exploit";
import { ICorporation } from "../Corporation/ICorporation";
2021-09-10 22:57:05 +02:00
import { IGang } from "../Gang/IGang";
import { IBladeburner } from "../Bladeburner/IBladeburner";
2021-09-16 01:50:44 +02:00
import { ICodingContractReward } from "../CodingContracts";
2021-09-20 07:45:32 +02:00
import { IRouter } from "../ui/Router";
2021-09-24 00:47:43 +02:00
import { WorkerScript } from "../Netscript/WorkerScript";
import { HacknetServer } from "../Hacknet/HacknetServer";
import { ISkillProgress } from "./formulas/skill";
import { PlayerAchievement } from "../Achievements/Achievements";
export interface IPlayer {
2021-09-05 01:09:30 +02:00
// Class members
augmentations: IPlayerOwnedAugmentation[];
bitNodeN: number;
city: CityName;
companyName: string;
2021-09-24 00:47:43 +02:00
corporation: ICorporation | null;
gang: IGang | null;
bladeburner: IBladeburner | null;
2021-09-05 01:09:30 +02:00
currentServer: string;
factions: string[];
factionInvitations: string[];
hacknetNodes: (HacknetNode | string)[]; // HacknetNode object or IP of Hacknet Server
has4SData: boolean;
has4SDataTixApi: boolean;
hashManager: HashManager;
hasTixApiAccess: boolean;
hasWseAccount: boolean;
hp: number;
jobs: IMap<string>;
init: () => void;
isWorking: boolean;
karma: number;
numPeopleKilled: number;
location: LocationName;
max_hp: number;
2021-11-12 03:35:26 +01:00
readonly money: number;
2021-09-05 01:09:30 +02:00
moneySourceA: MoneySourceTracker;
moneySourceB: MoneySourceTracker;
playtimeSinceLastAug: number;
playtimeSinceLastBitnode: number;
purchasedServers: any[];
queuedAugmentations: IPlayerOwnedAugmentation[];
resleeves: Resleeve[];
scriptProdSinceLastAug: number;
sleeves: Sleeve[];
sleevesFromCovenant: number;
sourceFiles: IPlayerOwnedSourceFile[];
exploits: Exploit[];
achievements: PlayerAchievement[];
terminalCommandHistory: string[];
2021-09-10 22:57:05 +02:00
lastUpdate: number;
2021-09-05 01:09:30 +02:00
totalPlaytime: number;
2021-09-05 01:09:30 +02:00
// Stats
2021-11-05 22:12:52 +01:00
hacking: number;
2021-09-05 01:09:30 +02:00
strength: number;
defense: number;
dexterity: number;
agility: number;
charisma: number;
intelligence: number;
2021-09-05 01:09:30 +02:00
// Experience
hacking_exp: number;
strength_exp: number;
defense_exp: number;
dexterity_exp: number;
agility_exp: number;
charisma_exp: number;
2021-09-10 22:57:05 +02:00
intelligence_exp: number;
2021-09-05 01:09:30 +02:00
// Multipliers
hacking_chance_mult: number;
hacking_speed_mult: number;
hacking_money_mult: number;
hacking_grow_mult: number;
hacking_mult: number;
hacking_exp_mult: number;
strength_mult: number;
strength_exp_mult: number;
defense_mult: number;
defense_exp_mult: number;
dexterity_mult: number;
dexterity_exp_mult: number;
agility_mult: number;
agility_exp_mult: number;
charisma_mult: number;
charisma_exp_mult: number;
hacknet_node_money_mult: number;
hacknet_node_purchase_cost_mult: number;
hacknet_node_ram_cost_mult: number;
hacknet_node_core_cost_mult: number;
hacknet_node_level_cost_mult: number;
company_rep_mult: number;
faction_rep_mult: number;
work_money_mult: number;
crime_success_mult: number;
crime_money_mult: number;
bladeburner_max_stamina_mult: number;
bladeburner_stamina_gain_mult: number;
bladeburner_analysis_mult: number;
bladeburner_success_chance_mult: number;
2021-09-24 00:47:43 +02:00
createProgramReqLvl: number;
factionWorkType: string;
2021-09-18 01:43:08 +02:00
createProgramName: string;
timeWorkedCreateProgram: number;
2022-03-19 15:31:48 +01:00
craftAugmentationName: string;
timeWorkedCraftAugmentation: number;
2021-09-18 01:43:08 +02:00
crimeType: string;
2021-09-24 00:47:43 +02:00
committingCrimeThruSingFn: boolean;
singFnCrimeWorkerScript: WorkerScript | null;
2021-09-18 01:43:08 +02:00
timeNeededToCompleteWork: number;
2021-09-13 00:03:07 +02:00
focus: boolean;
2021-09-18 01:43:08 +02:00
className: string;
currentWorkFactionName: string;
workType: string;
2021-11-12 05:40:48 +01:00
workCostMult: number;
workExpMult: number;
2021-09-18 01:43:08 +02:00
currentWorkFactionDescription: string;
timeWorked: number;
workMoneyGained: number;
workMoneyGainRate: number;
workRepGained: number;
workRepGainRate: number;
workHackExpGained: number;
workHackExpGainRate: number;
workStrExpGained: number;
workStrExpGainRate: number;
workDefExpGained: number;
workDefExpGainRate: number;
workDexExpGained: number;
workDexExpGainRate: number;
workAgiExpGained: number;
workAgiExpGainRate: number;
workChaExpGained: number;
workChaExpGainRate: number;
workMoneyLossRate: number;
2021-09-13 00:03:07 +02:00
2021-09-05 01:09:30 +02:00
// Methods
2021-09-24 00:47:43 +02:00
work(numCycles: number): boolean;
workPartTime(numCycles: number): boolean;
workForFaction(numCycles: number): boolean;
applyForAgentJob(sing?: boolean): boolean;
applyForBusinessConsultantJob(sing?: boolean): boolean;
applyForBusinessJob(sing?: boolean): boolean;
applyForEmployeeJob(sing?: boolean): boolean;
applyForItJob(sing?: boolean): boolean;
applyForJob(entryPosType: CompanyPosition, sing?: boolean): boolean;
applyForNetworkEngineerJob(sing?: boolean): boolean;
applyForPartTimeEmployeeJob(sing?: boolean): boolean;
applyForPartTimeWaiterJob(sing?: boolean): boolean;
applyForSecurityEngineerJob(sing?: boolean): boolean;
applyForSecurityJob(sing?: boolean): boolean;
applyForSoftwareConsultantJob(sing?: boolean): boolean;
applyForSoftwareJob(sing?: boolean): boolean;
applyForWaiterJob(sing?: boolean): boolean;
2021-09-05 01:09:30 +02:00
canAccessBladeburner(): boolean;
canAccessCorporation(): boolean;
canAccessGang(): boolean;
2022-03-19 05:22:21 +01:00
canAccessGrafting(): boolean;
2021-09-05 01:09:30 +02:00
canAfford(cost: number): boolean;
gainHackingExp(exp: number): void;
gainStrengthExp(exp: number): void;
gainDefenseExp(exp: number): void;
gainDexterityExp(exp: number): void;
gainAgilityExp(exp: number): void;
gainCharismaExp(exp: number): void;
gainIntelligenceExp(exp: number): void;
2021-10-27 20:18:33 +02:00
gainMoney(money: number, source: string): void;
2021-10-07 22:04:04 +02:00
getCurrentServer(): BaseServer;
2021-09-05 01:09:30 +02:00
getGangFaction(): Faction;
getGangName(): string;
getHomeComputer(): Server;
2021-09-24 00:47:43 +02:00
getNextCompanyPosition(company: Company, entryPosType: CompanyPosition): CompanyPosition | null;
2021-09-05 01:09:30 +02:00
getUpgradeHomeRamCost(): number;
getUpgradeHomeCoresCost(): number;
2021-09-05 01:09:30 +02:00
gotoLocation(to: LocationName): boolean;
2021-10-27 03:22:40 +02:00
hasAugmentation(aug: string | Augmentation, installed?: boolean): boolean;
2021-09-05 01:09:30 +02:00
hasCorporation(): boolean;
hasGangWith(facName: string): boolean;
hasTorRouter(): boolean;
hasProgram(program: string): boolean;
inBladeburner(): boolean;
inGang(): boolean;
isQualified(company: Company, position: CompanyPosition): boolean;
2021-10-27 20:18:33 +02:00
loseMoney(money: number, source: string): void;
process(router: IRouter, numCycles?: number): void;
2021-09-24 22:02:38 +02:00
reapplyAllAugmentations(resetMultipliers?: boolean): void;
2021-09-05 01:09:30 +02:00
reapplyAllSourceFiles(): void;
regenerateHp(amt: number): void;
setMoney(amt: number): void;
2021-09-25 03:49:49 +02:00
singularityStopWork(): string;
2021-09-05 01:09:30 +02:00
startBladeburner(p: any): void;
startFactionWork(faction: Faction): void;
2022-01-18 15:49:06 +01:00
startClass(costMult: number, expMult: number, className: string): void;
2021-09-05 01:09:30 +02:00
startCorporation(corpName: string, additionalShares?: number): void;
startCrime(
2021-09-20 07:45:32 +02:00
router: IRouter,
2021-09-05 01:09:30 +02:00
crimeType: string,
hackExp: number,
strExp: number,
defExp: number,
dexExp: number,
agiExp: number,
chaExp: number,
money: number,
time: number,
singParams: any,
): void;
startFactionFieldWork(faction: Faction): void;
startFactionHackWork(faction: Faction): void;
startFactionSecurityWork(faction: Faction): void;
2021-09-13 00:03:07 +02:00
startFocusing(): void;
2021-09-05 01:09:30 +02:00
startGang(facName: string, isHacking: boolean): void;
startWork(companyName: string): void;
startWorkPartTime(companyName: string): void;
2021-09-05 01:09:30 +02:00
takeDamage(amt: number): boolean;
travel(to: CityName): boolean;
giveExploit(exploit: Exploit): void;
giveAchievement(achievementId: string): void;
2021-09-05 01:09:30 +02:00
queryStatFromString(str: string): number;
getIntelligenceBonus(weight: number): number;
getCasinoWinnings(): number;
quitJob(company: string): void;
hasJob(): boolean;
2021-09-24 23:07:53 +02:00
createHacknetServer(): HacknetServer;
2022-01-18 15:49:06 +01:00
startCreateProgramWork(programName: string, time: number, reqLevel: number): void;
2021-09-10 22:57:05 +02:00
queueAugmentation(augmentationName: string): void;
receiveInvite(factionName: string): void;
updateSkillLevels(): void;
2021-09-16 01:50:44 +02:00
gainCodingContractReward(reward: ICodingContractReward, difficulty?: number): string;
2021-09-18 01:43:08 +02:00
stopFocusing(): void;
2021-09-24 00:47:43 +02:00
finishFactionWork(cancelled: boolean, sing?: boolean): string;
finishClass(sing?: boolean): string;
finishWork(cancelled: boolean, sing?: boolean): string;
2021-09-18 01:43:08 +02:00
cancelationPenalty(): number;
2021-09-24 00:47:43 +02:00
finishWorkPartTime(sing?: boolean): string;
finishCrime(cancelled: boolean): string;
finishCreateProgramWork(cancelled: boolean): string;
resetMultipliers(): void;
prestigeAugmentation(): void;
prestigeSourceFile(): void;
calculateSkill(exp: number, mult?: number): number;
calculateSkillProgress(exp: number, mult?: number): ISkillProgress;
2021-09-24 00:47:43 +02:00
resetWorkStatus(generalType?: string, group?: string, workType?: string): void;
getWorkHackExpGain(): number;
getWorkStrExpGain(): number;
getWorkDefExpGain(): number;
getWorkDexExpGain(): number;
getWorkAgiExpGain(): number;
getWorkChaExpGain(): number;
getWorkRepGain(): number;
getWorkMoneyGain(): number;
processWorkEarnings(cycles: number): void;
hospitalize(): void;
createProgramWork(numCycles: number): boolean;
takeClass(numCycles: number): boolean;
commitCrime(numCycles: number): boolean;
2021-09-25 00:29:25 +02:00
checkForFactionInvitations(): Faction[];
2021-09-24 00:47:43 +02:00
setBitNodeNumber(n: number): void;
2021-09-24 22:02:38 +02:00
getMult(name: string): number;
setMult(name: string, mult: number): void;
2021-09-25 23:21:50 +02:00
canAccessCotMG(): boolean;
2021-10-08 09:16:51 +02:00
sourceFileLvl(n: number): number;
2022-03-19 15:31:48 +01:00
startCraftAugmentationWork(augmentationName: string, time: number): void;
craftAugmentationWork(numCycles: number): boolean;
finishCraftAugmentationWork(cancelled: boolean): string;
}