bitburner-src/src/Bladeburner/BlackOperation.ts

34 lines
916 B
TypeScript
Raw Normal View History

import { Operation, IOperationParams } from "./Operation";
2021-09-25 20:42:57 +02:00
import { Generic_fromJSON, Generic_toJSON, Reviver } from "../utils/JSONReviver";
export class BlackOperation extends Operation {
2021-09-05 01:09:30 +02:00
constructor(params: IOperationParams | null = null) {
super(params);
this.count = 1;
}
2021-09-05 01:09:30 +02:00
// To be implemented by subtypes
getActionTimePenalty(): number {
return 1.5;
}
2021-09-05 01:09:30 +02:00
getChaosCompetencePenalty(/*inst: IBladeburner, params: ISuccessChanceParams*/): number {
return 1;
}
2021-09-05 01:09:30 +02:00
getChaosDifficultyBonus(/*inst: IBladeburner, params: ISuccessChanceParams*/): number {
return 1;
}
2021-09-05 01:09:30 +02:00
toJSON(): any {
return Generic_toJSON("BlackOperation", this);
}
2021-05-01 09:17:31 +02:00
2021-09-05 01:09:30 +02:00
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
static fromJSON(value: any): Operation {
return Generic_fromJSON(BlackOperation, value.data);
}
}
2021-09-05 01:09:30 +02:00
Reviver.constructors.BlackOperation = BlackOperation;