mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-08 16:47:49 +02:00
Merge pull request #4229 from borisflagell/wxsQDSSQF
SLEEVE: Fix #4194 Bladeburner Contract in Sleeve were not giving proper reward.
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
// Interface that defines a generic object used to track experience/money
|
||||
// earnings for tasks
|
||||
export interface ITaskTracker {
|
||||
hack: number;
|
||||
str: number;
|
||||
def: number;
|
||||
dex: number;
|
||||
agi: number;
|
||||
cha: number;
|
||||
int: number;
|
||||
money: number;
|
||||
}
|
||||
|
||||
export function createTaskTracker(): ITaskTracker {
|
||||
return {
|
||||
hack: 0,
|
||||
str: 0,
|
||||
def: 0,
|
||||
dex: 0,
|
||||
agi: 0,
|
||||
cha: 0,
|
||||
int: 0,
|
||||
money: 0,
|
||||
};
|
||||
}
|
||||
@@ -2,7 +2,7 @@ import { Person } from "./Person";
|
||||
import { calculateSkill } from "./formulas/skill";
|
||||
import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers";
|
||||
import { Player } from "@player";
|
||||
import { ITaskTracker } from "./ITaskTracker";
|
||||
import { WorkStats } from "../ScriptEditor/NetscriptDefinitions";
|
||||
|
||||
export function gainHackingExp(this: Person, exp: number): void {
|
||||
if (isNaN(exp)) {
|
||||
@@ -113,14 +113,14 @@ export function gainIntelligenceExp(this: Person, exp: number): void {
|
||||
this.skills.intelligence = Math.floor(this.calculateSkill(this.exp.intelligence, 1));
|
||||
}
|
||||
}
|
||||
export function gainStats(this: Person, retValue: ITaskTracker): void {
|
||||
this.gainHackingExp(retValue.hack * this.mults.hacking_exp);
|
||||
this.gainStrengthExp(retValue.str * this.mults.strength_exp);
|
||||
this.gainDefenseExp(retValue.def * this.mults.defense_exp);
|
||||
this.gainDexterityExp(retValue.dex * this.mults.dexterity_exp);
|
||||
this.gainAgilityExp(retValue.agi * this.mults.agility_exp);
|
||||
this.gainCharismaExp(retValue.cha * this.mults.charisma_exp);
|
||||
this.gainIntelligenceExp(retValue.int);
|
||||
export function gainStats(this: Person, retValue: WorkStats): void {
|
||||
this.gainHackingExp(retValue.hackExp * this.mults.hacking_exp);
|
||||
this.gainStrengthExp(retValue.strExp * this.mults.strength_exp);
|
||||
this.gainDefenseExp(retValue.defExp * this.mults.defense_exp);
|
||||
this.gainDexterityExp(retValue.dexExp * this.mults.dexterity_exp);
|
||||
this.gainAgilityExp(retValue.agiExp * this.mults.agility_exp);
|
||||
this.gainCharismaExp(retValue.chaExp * this.mults.charisma_exp);
|
||||
this.gainIntelligenceExp(retValue.intExp);
|
||||
}
|
||||
|
||||
//Given a string expression like "str" or "strength", returns the given stat
|
||||
|
||||
@@ -61,8 +61,10 @@ export class SleeveBladeburnerWork extends Work {
|
||||
if (!exp) throw new Error(`Somehow there was no exp for action ${this.actionType} ${this.actionName}`);
|
||||
applySleeveGains(sleeve, exp, 1);
|
||||
}
|
||||
Player.gainMoney(retValue.money, "sleeves");
|
||||
Player.gainStats(retValue);
|
||||
|
||||
if (this.actionType === "Contracts") {
|
||||
applySleeveGains(sleeve, retValue, 1);
|
||||
}
|
||||
this.cyclesWorked -= this.cyclesNeeded(sleeve);
|
||||
}
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user