Add walkable housing interiors and cross-hub visitors

This commit is contained in:
dingo
2026-09-10 10:48:26 -04:00
parent b2dd2cb3ba
commit 1bd5d487e2
28 changed files with 721 additions and 52 deletions
+1 -1
View File
@@ -262,4 +262,4 @@ building:
- {"id": "camp_platform", "name": "Camp platform", "description": "A persistent, destructible camp platform.", "model": "camp", "width": 4, "depth": 4, "height": 0.75, "hp": 300, "profession": "builder", "level": 1}
- {"id": "fort_block", "name": "Fort block", "description": "A persistent, destructible fort block.", "model": "fort", "width": 6, "depth": 3, "height": 3, "hp": 800, "profession": "builder", "level": 5}
housing: { roomSize: 12, maxFurniture: 64, maxItems: 256, maxGuests: 64, keySeconds: 3 }
housing: { walkSpeed: 4, playerRadius: 0.35, jumpSpeed: 6, gravity: 18, tableHeight: 0.8, storageHeight: 0.9, roomSize: 12, maxFurniture: 64, maxItems: 256, maxGuests: 64, keySeconds: 3 }
+14 -5
View File
@@ -16,14 +16,23 @@ func (f FurnitureProfile) Validate() error {
}
type HousingRules struct {
RoomSize float64 `yaml:"roomSize"`
MaxFurniture int `yaml:"maxFurniture"`
MaxItems int `yaml:"maxItems"`
MaxGuests int `yaml:"maxGuests"`
KeySeconds float64 `yaml:"keySeconds"`
WalkSpeed float64 `yaml:"walkSpeed"`
PlayerRadius float64 `yaml:"playerRadius"`
JumpSpeed float64 `yaml:"jumpSpeed"`
Gravity float64 `yaml:"gravity"`
TableHeight float64 `yaml:"tableHeight"`
StorageHeight float64 `yaml:"storageHeight"`
RoomSize float64 `yaml:"roomSize"`
MaxFurniture int `yaml:"maxFurniture"`
MaxItems int `yaml:"maxItems"`
MaxGuests int `yaml:"maxGuests"`
KeySeconds float64 `yaml:"keySeconds"`
}
func (r HousingRules) Validate() error {
if r.WalkSpeed != 0 && (!finiteRange(r.WalkSpeed, 1, 8) || !finiteRange(r.PlayerRadius, .2, .6) || !finiteRange(r.JumpSpeed, 1, 8) || !finiteRange(r.Gravity, 10, 30) || !finiteRange(r.TableHeight, .5, 2) || !finiteRange(r.StorageHeight, .5, 2)) {
return fmt.Errorf("invalid indoor movement tuning")
}
if !finiteRange(r.RoomSize, 8, 32) || r.MaxFurniture < 1 || r.MaxFurniture > 128 || r.MaxItems < 1 || r.MaxItems > 512 || r.MaxGuests < 1 || r.MaxGuests > 128 || r.KeySeconds != 3 {
return fmt.Errorf("invalid housing rules")
}