Commit Graph

16 Commits (master)

Author SHA1 Message Date
codefairy d3510645ca Add in basic groundwork for home amenities
Amenities are nodes that are placed within the home's area and offer
some kind of benefit to the area or the homeowner (while within the
area). An example would be one which expands the maximum area volume,
or one which provides healing while inside the home.
2019-09-02 14:12:16 -04:00
codefairy 49d318453e Break init.lua up into smaller files for better extensibility
All the cool mods are doing it, so why not us? We're about to add some
cool features that would be easier to maintain in separate files.
2019-09-02 10:57:33 -04:00
codefairy f52520bb91 Fix bug where all areas were considered orphaned 2019-09-01 16:46:55 -04:00
codefairy c3d22ea4d5 Add in orphaned-area protection 2019-09-01 16:01:47 -04:00
codefairy feefad51e2 Allow players to change the area that their home node covers 2019-09-01 15:40:34 -04:00
codefairy f6f45354ab Fix formatting (spaces to tabs) 2019-08-22 14:26:11 -04:00
codefairy bea79acf10 Give home-saving function a more accurate name 2019-08-22 14:18:09 -04:00
codefairy 014ad06d9c Actually protect home areas defined by the home node
We now check against the home node associated with the area's metadata
to determine whether or not the player is permitted to build/dig in the
area.

This updates the format of the AreaStore area's data to (probably) the
final version this should be considered the format to go with going
forward. Everything going in the home node's metadata just makes things
easier.
2019-08-21 22:52:58 -04:00
codefairy c6f46abc11 Use one AreaStore for all players' homes
I don't know what I was thinking.
2019-08-21 22:11:39 -04:00
codefairy 648cb421c0 Add long term storage of AreaStores for home nodes
This was a doozy to figure out: AreaStore's to_string method doesn't
return a valid UTF8 string, which apparently means that StorageRef's
set_string method won't save it properly.

To counteract this, the serialized AreaStore must be converted to a
valid UTF-8 string before saving. We do this by running it through
minetest.encode_base64 and minetest.decode_base64 to prevent
corruption.

This introduces a performance impact that we need to keep in mind;
thankfully, during normal gameplay it's unlikely that areas will be
updated often enough for this to be an issue.

Also, minor formatting and debugging changes.
2019-08-20 21:05:21 -04:00
codefairy 707db6419f Add in basic area storage and protection to home nodes
This is only a rough first step; later on, we will allow players to
customize the area that their home node covers (up to a point) as well
as what protections and effects are attached to this area.

For now, we only have basic protection of a 7x7x7 cube centered on the
home node.
2019-08-19 21:43:41 -04:00
Princess Pepperoni 6502ed4a86 Fix an incorrect check which resulted in names never changing 2019-08-17 17:38:09 -04:00
codefairy cd85cb149d Preserve home names when user hits escape on form 2019-08-13 21:44:52 -04:00
codefairy fcf0b18369 Fix bug where player's name is compared with player's object 2019-08-13 21:32:22 -04:00
codefairy a2c34f1223 Allow players to change the name of their home nodes
This is a quick prototype; expect this to be expanded on in a later
update.
2019-08-12 20:58:47 -04:00
codefairy 06d7b809ca Initial commit 2019-08-12 19:35:56 -04:00