linter
This commit is contained in:
rderfler 2022-04-14 11:57:01 -04:00
parent d1388a62aa
commit 0406272942
8 changed files with 40 additions and 41 deletions

@ -38,7 +38,6 @@ import { WorkerScript } from "../Netscript/WorkerScript";
import { FactionNames } from "../Faction/data/FactionNames"; import { FactionNames } from "../Faction/data/FactionNames";
import { BlackOperationNames } from "./data/BlackOperationNames"; import { BlackOperationNames } from "./data/BlackOperationNames";
import { KEY } from "../utils/helpers/keyCodes"; import { KEY } from "../utils/helpers/keyCodes";
import { Player } from "src/Player";
interface BlackOpsAttempt { interface BlackOpsAttempt {
error?: string; error?: string;
@ -1136,7 +1135,7 @@ export class Bladeburner implements IBladeburner {
const losses = getRandomInt(0, max); const losses = getRandomInt(0, max);
this.teamSize -= losses; this.teamSize -= losses;
if(this.teamSize < this.sleeveSize) { if(this.teamSize < this.sleeveSize) {
let sup = player.sleeves.filter(x => x.bbAction == 'Support main sleeve'); const sup = player.sleeves.filter(x => x.bbAction == 'Support main sleeve');
for(let i = 0; i > (this.teamSize-this.sleeveSize); i--){ for(let i = 0; i > (this.teamSize-this.sleeveSize); i--){
const r = Math.floor(Math.random() * sup.length); const r = Math.floor(Math.random() * sup.length);
sup[r].takeDamage(sup[r].max_hp); sup[r].takeDamage(sup[r].max_hp);
@ -1440,7 +1439,7 @@ export class Bladeburner implements IBladeburner {
const losses = getRandomInt(1, teamLossMax); const losses = getRandomInt(1, teamLossMax);
this.teamSize -= losses; this.teamSize -= losses;
if(this.teamSize < this.sleeveSize) { if(this.teamSize < this.sleeveSize) {
let sup = player.sleeves.filter(x => x.bbAction == 'Support main sleeve'); const sup = player.sleeves.filter(x => x.bbAction == 'Support main sleeve');
for(let i = 0; i > (this.teamSize-this.sleeveSize); i--){ for(let i = 0; i > (this.teamSize-this.sleeveSize); i--){
const r = Math.floor(Math.random() * sup.length); const r = Math.floor(Math.random() * sup.length);
sup[r].takeDamage(sup[r].max_hp); sup[r].takeDamage(sup[r].max_hp);
@ -1655,7 +1654,7 @@ export class Bladeburner implements IBladeburner {
this.actionTimeOverflow = 0; this.actionTimeOverflow = 0;
if (this.actionTimeCurrent >= this.actionTimeToComplete) { if (this.actionTimeCurrent >= this.actionTimeToComplete) {
this.actionTimeOverflow = this.actionTimeCurrent - this.actionTimeToComplete; this.actionTimeOverflow = this.actionTimeCurrent - this.actionTimeToComplete;
let retValue = this.completeAction(player, player, this.action); const retValue = this.completeAction(player, player, this.action);
player.gainMoney(retValue.money, "bladeburner"); player.gainMoney(retValue.money, "bladeburner");
player.gainStats(retValue); player.gainStats(retValue);
// Operation Daedalus // Operation Daedalus

@ -137,7 +137,7 @@ export function NetscriptBladeburner(
const bladeburner = player.bladeburner; const bladeburner = player.bladeburner;
if (bladeburner === null) throw new Error("Should not be called without Bladeburner"); if (bladeburner === null) throw new Error("Should not be called without Bladeburner");
try { try {
let time = bladeburner.getActionTimeNetscriptFn(player, type, name); const time = bladeburner.getActionTimeNetscriptFn(player, type, name);
if(typeof time === 'string'){ if(typeof time === 'string'){
const errorLogText = `Invalid action: type='${type}' name='${name}'`; const errorLogText = `Invalid action: type='${type}' name='${name}'`;
workerScript.log("bladeburner.getActionTime", () => errorLogText); workerScript.log("bladeburner.getActionTime", () => errorLogText);
@ -157,7 +157,7 @@ export function NetscriptBladeburner(
const bladeburner = player.bladeburner; const bladeburner = player.bladeburner;
if (bladeburner === null) throw new Error("Should not be called without Bladeburner"); if (bladeburner === null) throw new Error("Should not be called without Bladeburner");
try { try {
let chance = bladeburner.getActionEstimatedSuccessChanceNetscriptFn(player, type, name); const chance = bladeburner.getActionEstimatedSuccessChanceNetscriptFn(player, type, name);
if(typeof chance === 'string'){ if(typeof chance === 'string'){
const errorLogText = `Invalid action: type='${type}' name='${name}'`; const errorLogText = `Invalid action: type='${type}' name='${name}'`;
workerScript.log("bladeburner.getActionTime", () => errorLogText); workerScript.log("bladeburner.getActionTime", () => errorLogText);

@ -89,6 +89,18 @@ export abstract class Person implements IPerson {
*/ */
city: CityName = CityName.Sector12; city: CityName = CityName.Sector12;
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;
gainStats: (retValue: ITaskTracker) => void;
calculateSkill: (exp: number, mult: number) => number;
regenerateHp: (amt: number) => void;
queryStatFromString: (str: string) => number;
/** /**
* Updates this object's multipliers for the given augmentation * Updates this object's multipliers for the given augmentation
*/ */
@ -226,17 +238,6 @@ export abstract class Person implements IPerson {
abstract whoAmI(): string; abstract whoAmI(): string;
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;
gainStats: (retValue: ITaskTracker) => void;
calculateSkill: (exp: number, mult: number) => number;
regenerateHp: (amt: number) => void;
queryStatFromString: (str: string) => number;
constructor() { constructor() {
this.gainHackingExp = generalMethods.gainHackingExp; this.gainHackingExp = generalMethods.gainHackingExp;
this.gainStrengthExp = generalMethods.gainStrengthExp; this.gainStrengthExp = generalMethods.gainStrengthExp;

@ -637,7 +637,7 @@ export class Sleeve extends Person {
p.bladeburner?.sleeveSupport(false); p.bladeburner?.sleeveSupport(false);
} }
if (this.currentTask == SleeveTaskType.Class) { if (this.currentTask == SleeveTaskType.Class) {
let retVal = createTaskTracker(); const retVal = createTaskTracker();
retVal.int = CONSTANTS.IntelligenceClassBaseExpGain * Math.round(this.currentTaskTime / 1000); retVal.int = CONSTANTS.IntelligenceClassBaseExpGain * Math.round(this.currentTaskTime / 1000);
this.gainExperience(p, retVal);//Wont be shared with other sleeves this.gainExperience(p, retVal);//Wont be shared with other sleeves
} }
@ -1091,7 +1091,7 @@ export class Sleeve extends Person {
break; break;
case "Recruitment": case "Recruitment":
time = this.getBladeburnerActionTime(p, 'General', action); time = this.getBladeburnerActionTime(p, 'General', action);
const recruitTime = p.bladeburner?.getRecruitmentTime(this) ?? 0 * 1000; const recruitTime = (p.bladeburner?.getRecruitmentTime(this) ?? 0) * 1000;
this.gainRatesForTask.cha = 2 * BladeburnerConstants.BaseStatGain * recruitTime; this.gainRatesForTask.cha = 2 * BladeburnerConstants.BaseStatGain * recruitTime;
this.currentTaskLocation = (p.bladeburner?.getRecruitmentSuccessChance(this) ?? 0).toString() + '%'; this.currentTaskLocation = (p.bladeburner?.getRecruitmentSuccessChance(this) ?? 0).toString() + '%';
break; break;
@ -1167,7 +1167,7 @@ export class Sleeve extends Person {
this.gainRatesForTask.agi = retValue.agi; this.gainRatesForTask.agi = retValue.agi;
this.gainRatesForTask.cha = retValue.cha; this.gainRatesForTask.cha = retValue.cha;
const rewardMultiplier = Math.pow(action.rewardFac, action.level - 1); const rewardMultiplier = Math.pow(action.rewardFac, action.level - 1);
this.gainRatesForTask.money = BladeburnerConstants.ContractBaseMoneyGain * rewardMultiplier * bb.skillMultipliers.money;; this.gainRatesForTask.money = BladeburnerConstants.ContractBaseMoneyGain * rewardMultiplier * bb.skillMultipliers.money;
} }
getBladeburnerActionTime(p: IPlayer, type: string, name: string): number{//Maybe find workerscript and use original getBladeburnerActionTime(p: IPlayer, type: string, name: string): number{//Maybe find workerscript and use original

@ -10,7 +10,6 @@ import { FactionWorkType } from "../../../Faction/FactionWorkTypeEnum";
import Select, { SelectChangeEvent } from "@mui/material/Select"; import Select, { SelectChangeEvent } from "@mui/material/Select";
import MenuItem from "@mui/material/MenuItem"; import MenuItem from "@mui/material/MenuItem";
import { FactionNames } from "../../../Faction/data/FactionNames"; import { FactionNames } from "../../../Faction/data/FactionNames";
import { Contract } from "../../../Bladeburner/Contract";
const universitySelectorOptions: string[] = [ const universitySelectorOptions: string[] = [
"Study Computer Science", "Study Computer Science",