P4 hazards: food spoilage with rot speed setting, smoking rack and salt, food poisoning, harsher blizzards, hard winters with lake ice, lightning on trees, snow on roofs (protocol 11)

This commit is contained in:
Paul Bailey
2026-11-05 11:49:13 +00:00
parent 657c3140fe
commit 3389ec9a21
27 changed files with 1541 additions and 56 deletions

View File

@@ -365,6 +365,21 @@ func _s2c_node(uid: String, hp: float, point: Vector3, from: Vector3) -> void:
n.apply_remote(hp, point, from)
received += 1
## Lightning struck a tree (hazards.gd, P4): everyone sees it burn. (It
## falls later through _s2c_node, like any felled tree.)
func struck(n: Node3D) -> void:
_all("_s2c_strike", [String(n.uid)])
@rpc("authority", "call_remote", "reliable")
func _s2c_strike(uid: String) -> void:
if not is_client():
return
var n: Node3D = world.props.resource_nodes.get(uid)
var hz: Node = world.get_node_or_null("Hazards")
if n != null and is_instance_valid(n) and hz != null:
hz.show_strike(n)
received += 1
@rpc("authority", "call_remote", "reliable")
func _s2c_regrown(uid: String) -> void:
if not is_client():