mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-18 20:25:45 +01:00
BUGFIX: SleeveCrimeWork.ts works through all cyclesWorked if its greater than cyclesNeeded (#881)
This commit is contained in:
parent
5d266e01a6
commit
848fc9905a
@ -38,15 +38,17 @@ export class SleeveCrimeWork extends SleeveWorkClass {
|
||||
this.cyclesWorked += cycles;
|
||||
if (this.cyclesWorked < this.cyclesNeeded()) return;
|
||||
|
||||
const crime = this.getCrime();
|
||||
const gains = this.getExp(sleeve);
|
||||
const success = Math.random() < crime.successRate(sleeve);
|
||||
if (success) {
|
||||
Player.karma -= crime.karma * sleeve.syncBonus();
|
||||
Player.numPeopleKilled += crime.kills;
|
||||
} else gains.money = 0;
|
||||
applySleeveGains(sleeve, gains, success ? 1 : 0.25);
|
||||
this.cyclesWorked -= this.cyclesNeeded();
|
||||
while (this.cyclesWorked > this.cyclesNeeded()) {
|
||||
const crime = this.getCrime();
|
||||
const gains = this.getExp(sleeve);
|
||||
const success = Math.random() < crime.successRate(sleeve);
|
||||
if (success) {
|
||||
Player.karma -= crime.karma * sleeve.syncBonus();
|
||||
Player.numPeopleKilled += crime.kills;
|
||||
} else gains.money = 0;
|
||||
applySleeveGains(sleeve, gains, success ? 1 : 0.25);
|
||||
this.cyclesWorked -= this.cyclesNeeded();
|
||||
}
|
||||
}
|
||||
|
||||
APICopy() {
|
||||
|
Loading…
Reference in New Issue
Block a user