Skip to content

Commit

Permalink
undo arena gameover when reviving player
Browse files Browse the repository at this point in the history
  • Loading branch information
woutkolkman committed Oct 15, 2023
1 parent 7b4426f commit 1e682b8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion MouseDrag/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public Options()
killReleasesMask = config.Bind("killReleasesMask", defaultValue: true, new ConfigurableInfo("Killing elite scavengers or vultures with this tool will release their masks.", null, "", "Kill releases mask"));

menuOpen = config.Bind("menuOpen", KeyCode.None, new ConfigurableInfo("KeyBind opens menu on object or background, as an alternative to right mouse button.", null, "", "Open menu"));
throwWeapon = config.Bind(nameof(throwWeapon), KeyCode.None, new ConfigurableInfo("KeyBind to throw the weapon which you're currently dragging. Aim is still determined by drag direction.", null, "", "Throw weapon"));
throwWeapon = config.Bind(nameof(throwWeapon), KeyCode.None, new ConfigurableInfo("KeyBind to throw the weapon which you're currently dragging. Aim is still determined by drag direction. Sandbox mouse might interfere.", null, "", "Throw weapon"));
pauseOneKey = config.Bind("pauseOneKey", KeyCode.None, new ConfigurableInfo("KeyBind to pause/unpause the object/creature which you're currently dragging.", null, "", "Pause"));
pauseRoomCreaturesKey = config.Bind("pauseRoomCreaturesKey", KeyCode.None, new ConfigurableInfo("KeyBind to pause all creatures except Player and SlugNPC, only currently in this room.\nAllows unpausing individual creatures.", null, "", "Pause creatures\nin room"));
unpauseAllKey = config.Bind("unpauseAllKey", KeyCode.None, new ConfigurableInfo("KeyBind to unpause all objects/creatures, including individually paused creatures.", null, "", "Unpause all"));
Expand Down
23 changes: 18 additions & 5 deletions MouseDrag/Tools/Health.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,24 @@ public static void ReviveCreature(PhysicalObject obj)

if (obj is Player) {
//try to exit game over mode
if (Options.exitGameOverMode?.Value != false &&
!(obj as Player).isNPC &&
obj?.room?.game?.cameras?.Length > 0 &&
obj.room.game.cameras[0]?.hud?.textPrompt != null)
obj.room.game.cameras[0].hud.textPrompt.gameOverMode = false;
if (Options.exitGameOverMode?.Value != false && !(obj as Player).isNPC) {
//campaign
if (obj.room?.game?.cameras?.Length > 0 &&
obj.room.game.cameras[0]?.hud?.textPrompt != null)
obj.room.game.cameras[0].hud.textPrompt.gameOverMode = false;

//sandbox & challenges
if (obj.room?.game?.arenaOverlay != null) {
obj.room.game.arenaOverlay.ShutDownProcess();
obj.room.game.manager?.sideProcesses?.Remove(obj.room.game.arenaOverlay);
obj.room.game.arenaOverlay = null;
if (obj.room.game.session is ArenaGameSession)
(obj.room.game.session as ArenaGameSession).sessionEnded = false;
(obj.room.game.session as ArenaGameSession).challengeCompleted = false;
(obj.room.game.session as ArenaGameSession).endSessionCounter = -1;
}
}
}

(obj as Player).exhausted = false;
(obj as Player).lungsExhausted = false;
Expand Down
Binary file modified MouseDrag/bin/mousedrag/plugins/MouseDrag.dll
Binary file not shown.

0 comments on commit 1e682b8

Please sign in to comment.