Simple Rest

Provides a small recovery buff when in an enclosed room

Updated for 1.0 Release

Added the Max Windows & Buff Strength options. With this I am considering the mod complete for now unless any requests come in on the comments.

Features

With the Simple Rest mod players will gain a small recovery buff when they are in an inclosed space that has a bed and a light source. 

Any block containing "Bed" as part of their asset name counts as a bed and any blocks cointaining Brazier, Torch, or Lantern as part of their asset name count as a light source. 

Many of the settings are configurable. After you've loaded your game/server once with this mod you'll find a configuration file where you can alter the rules for the mod.

For configuration purposes a "window" is basically an empty single hole in your room, not window blocks (probably should have named it different). Holes that are two blocks are larger will always cause the rest check to fail. 

{
"MaxBlockSearch": 20, -- Max search distance Lower means rooms must be smaller to count but can improve performance
"BuffDuration": 10.0, -- Duration of the rest buff gained
"RequireLight": true, -- When false the system doesn't require light sources
"RequireBed": true, -- When false the system doesn't require beds
"RestCheckFrequency": 5.0 -- Time between system checks, increase to improve performance
"MaxWindows": 2, -- Max number of 1 block holes before a room fails the rest check
"BuffLevel": "T1" -- Strength of the healing buff T1 = 1HP, T2 = 2HP, T3 = 5HP
}

General Notes

The system considers an area as inclosed if it cannot find path of unoccupied block locations longer than the MaxBlockSearch away from the player. Large rooms, or combined rooms (such as two floors with open stairs) may fail when MaxBlockSearch is set to a lower value. Rooms with holes such as blockless windows (aka empty blocks to simulate a window) will also fail. I plan on adding some sort of gap tolerance to allow for these types of builds in the next version. 

Currently the system considers any block as valid for purposes of enclosing a person so you can build a room out of anything. I'm likely going to add some kind of check in the future for proper building materials but I am going to wait to see what tools get added to make that easier. 

The Simple Rest Team

profile avatar
  • 1
    Followers
  • 1
    Projects
  • 232
    Downloads