Implement survival mode #214
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements survival mode. Resolves #40.
#213 is blocked on this as we are developing the design we will use to approach gamemodes, and moreover, how we will implement gameplay features with regard to component architecture. The current approach is heavily based on data-oriented design. Rather than checking a player's gamemode in systems, there are a number of marker components—e.g.
CanBreak,CanInstaBreak,CanTakeDamage,CanFly—which describe the capabilities of a player. These are inserted based on gamemode on player join, but the architecture allows for extensive customization of functionality through plugins.Ideally, we would have a
/gamemodecommand, but this is blocked on #209 being merged. I may merge it early, depending on how complete people deem it to be. Currently, the only way to affect a player's gamemode is through thedefault-gamemodesetting in the config or manual editing of the player data files.Inventory handling
Only basic survival mode inventory handling (i.e. single clicks) has been implemented. I will hold off on the rest until our inventory indexing situation has improved.
Block breaking
Survival mode digging has been implemented, for the most part. All which remains is to write down the harvest tools for all blocks (currently, only stone and dirt are in the list). This file is in
definitions/data/tool.ron.