MISC: Cancel infiltration when player is hospitalized (#1579)

This commit is contained in:
catloversg
2024-08-15 12:20:17 +07:00
committed by GitHub
parent 440c074606
commit 9db1084b16
3 changed files with 24 additions and 2 deletions
@@ -52,6 +52,7 @@ import { isMember } from "../../utils/EnumHelper";
import { canAccessBitNodeFeature } from "../../BitNode/BitNodeUtils";
import { AlertEvents } from "../../ui/React/AlertManager";
import { Augmentations } from "../../Augmentation/Augmentations";
import { PlayerEventType, PlayerEvents } from "./PlayerEvents";
export function init(this: PlayerObject): void {
/* Initialize Player's home computer */
@@ -269,8 +270,9 @@ export function hospitalize(this: PlayerObject, suppressNotification: boolean):
this.loseMoney(cost, "hospitalization");
this.hp.current = this.hp.max;
if (!suppressNotification) {
SnackbarEvents.emit(`You've been Hospitalized for ${formatMoney(cost)}`, ToastVariant.SUCCESS, 2000);
SnackbarEvents.emit(`You've been hospitalized for ${formatMoney(cost)}`, ToastVariant.SUCCESS, 2000);
}
PlayerEvents.emit(PlayerEventType.Hospitalized);
return cost;
}