Skip to content

Commit

Permalink
A couple of minor bug fixes - exit doesn't delay by a frame, introduc…
Browse files Browse the repository at this point in the history
…ion on start rooms are displayed
  • Loading branch information
ben_singer committed Nov 29, 2024
1 parent 385ab9c commit 2b962ae
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion NetAF.Examples/Assets/Player/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public PlayableCharacter Instantiate()
return new(InteractionResult.NoChange, null);

if (Knife.Name.EqualsExaminable(i))
return new(InteractionResult.TargetExpires, i, "You slash wildly at your own throat. You are dead.");
return new(InteractionResult.TargetExpires, i, "You slash wildly at your own throat. Your jugular opens spilling blood everywhere. As you loose consciousness you are filled with a deep sense of regret.");

if (CoffeeMug.Name.EqualsIdentifier(i.Identifier))
return new(InteractionResult.NoChange, i, "If there was some coffee in the mug you could drink it.");
Expand Down
17 changes: 11 additions & 6 deletions NetAF/Logic/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,18 @@ internal void Execute()

// check if the game has ended
if (CheckForGameEnd(EndConditions, out endMode))
{
// end the game
End();
}
while (state != GameState.Finishing);

// render the last mode
Mode.Render(this);
// render the last mode
Mode.Render(this);

// wait for acknowledge
GetInput();
// wait for acknowledge before exiting
GetInput();
}
}
while (state != GameState.Finishing);

// if an end mode specified
if (endMode != null)
Expand Down Expand Up @@ -208,6 +211,8 @@ private void HandleReaction(Reaction reaction)
ChangeMode(new ReactionMode(Overworld.CurrentRegion.CurrentRoom.Identifier.Name, regionEnterReaction));
else
ChangeMode(new SceneMode());

return;
}

// 3. check if command didn't change the mode and the current mode type is information, essentially the mode has expired
Expand Down

0 comments on commit 2b962ae

Please sign in to comment.