VERSION: Update game version to 2.2 (#240)

Includes some bug fixes:
* Fix sleeve shock internal/display discrepancy (0-100 vs 0-100)
* Special error message if ns function called without a this
* Change whitespace to pre-wrap for dialog box.
* Fix bug where idle sleeves do not consume cycles but still recover shock from those cycles. Now they do not recover during idle.
* attempted to tag commit as v2.2.0
This commit is contained in:
Snarling
2022-12-01 16:07:46 -05:00
committed by GitHub
parent 6034e1c3fa
commit 5ff2cd5357
14 changed files with 441 additions and 505 deletions
@@ -105,7 +105,7 @@ export function prestigeAugmentation(this: PlayerObject): void {
this.sleeves.push(new Sleeve());
}
this.sleeves.forEach((sleeve) => (sleeve.shock >= 100 ? sleeve.synchronize() : sleeve.shockRecovery()));
this.sleeves.forEach((sleeve) => (sleeve.shock <= 0 ? sleeve.synchronize() : sleeve.shockRecovery()));
this.lastUpdate = new Date().getTime();
+7 -10
View File
@@ -55,7 +55,7 @@ export class Sleeve extends Person implements SleevePerson {
*
* Reputation earned is also multiplied by shock%
*/
shock = 1;
shock = 100;
/** Stored number of game "loop" cycles */
storedCycles = 0;
@@ -76,7 +76,7 @@ export class Sleeve extends Person implements SleevePerson {
findPurchasableAugs = sleeveMethods.findPurchasableAugs;
shockBonus(): number {
return this.shock / 100;
return (100 - this.shock) / 100;
}
syncBonus(): number {
@@ -159,7 +159,7 @@ export class Sleeve extends Person implements SleevePerson {
this.city = CityName.Sector12;
// Reset sleeve-related stats
this.shock = 1;
this.shock = 100;
this.storedCycles = 0;
this.sync = Math.max(this.memory, 1);
}
@@ -173,12 +173,9 @@ export class Sleeve extends Person implements SleevePerson {
// Only process once every second (5 cycles)
const CyclesPerSecond = 1000 / CONSTANTS.MilliPerCycle;
this.storedCycles += numCycles;
if (this.storedCycles < CyclesPerSecond) return;
let cyclesUsed = this.storedCycles;
cyclesUsed = Math.min(cyclesUsed, 15);
this.shock = Math.min(100, this.shock + 0.0001 * cyclesUsed);
if (!this.currentWork) return;
if (this.storedCycles < CyclesPerSecond || !this.currentWork) return;
const cyclesUsed = Math.min(this.storedCycles, 15);
this.shock = Math.max(0, this.shock - 0.0001 * cyclesUsed);
this.currentWork.process(this, cyclesUsed);
this.storedCycles -= cyclesUsed;
}
@@ -457,7 +454,7 @@ export class Sleeve extends Person implements SleevePerson {
this.hp.current -= amt;
if (this.hp.current <= 0) {
this.shock = Math.max(0, this.shock - 0.5);
this.shock = Math.min(100, this.shock + 0.5);
this.hp.current = this.hp.max;
return true;
} else {
@@ -11,8 +11,8 @@ export class SleeveRecoveryWork extends Work {
}
process(sleeve: Sleeve, cycles: number) {
sleeve.shock = Math.min(100, sleeve.shock + 0.0002 * cycles);
if (sleeve.shock >= 100) sleeve.stopWork();
sleeve.shock = Math.max(0, sleeve.shock - 0.0002 * cycles);
if (sleeve.shock <= 0) sleeve.stopWork();
}
APICopy() {
+2 -2
View File
@@ -169,12 +169,12 @@ export function SleeveElem(props: IProps): React.ReactElement {
</span>
</Tooltip>
<Tooltip
title={props.sleeve.shock < 100 ? <Typography>Unlocked when sleeve has fully recovered</Typography> : ""}
title={props.sleeve.shock > 0 ? <Typography>Unlocked when sleeve has fully recovered</Typography> : ""}
>
<span>
<Button
onClick={() => setAugmentationsOpen(true)}
disabled={props.sleeve.shock < 100}
disabled={props.sleeve.shock > 0}
sx={{ width: "100%", height: "100%" }}
>
Manage Augmentations
+1 -1
View File
@@ -78,7 +78,7 @@ export function StatsElement(props: IProps): React.ReactElement {
<StatsRow
name="Shock"
color={Settings.theme.primary}
data={{ content: numeralWrapper.formatSleeveShock(100 - props.sleeve.shock) }}
data={{ content: numeralWrapper.formatSleeveShock(props.sleeve.shock) }}
/>
<StatsRow
name="Sync"
+1 -1
View File
@@ -245,7 +245,7 @@ const canDo: {
[CityName.Aevum, CityName.Sector12, CityName.Volhaven].includes(sleeve.city),
"Workout at Gym": (sleeve: Sleeve) => [CityName.Aevum, CityName.Sector12, CityName.Volhaven].includes(sleeve.city),
"Perform Bladeburner Actions": () => !!Player.bladeburner,
"Shock Recovery": (sleeve: Sleeve) => sleeve.shock < 100,
"Shock Recovery": (sleeve: Sleeve) => sleeve.shock > 0,
Synchronize: (sleeve: Sleeve) => sleeve.sync < 100,
};