M2.6: server rules (PvP, raiding, locks and friends, death penalty, difficulty, wolf grace), chat, admin commands, server console

This commit is contained in:
Paul Bailey
2026-11-04 22:54:40 +00:00
parent 47fc116839
commit 2ab79b68c6
26 changed files with 1195 additions and 57 deletions

View File

@@ -33,12 +33,24 @@ var has_bed_spawn := false
var bed_spawn := Vector3.ZERO
var anim := 0 ## last movement state reported (avatar.gd Anim)
var died_at := 0 ## ticks (ms) when they last died
var melee_ready_at := 0 ## ticks (ms): PvP swings wait for the weapon's cooldown
## Physics layer 5 (value 16): only arrows and thrown spears look for it,
## and only when PvP is on (projectile.gd). Nothing else collides with it.
const PLAYER_LAYER := 16
func setup(world: Node3D) -> void:
hands = self
collision_layer = 0
collision_layer = PLAYER_LAYER
collision_mask = 0
set_physics_process(false)
var cs := CollisionShape3D.new()
var cap := CapsuleShape3D.new()
cap.radius = 0.4
cap.height = 1.8
cs.shape = cap
cs.position = Vector3(0, 0.9, 0)
add_child(cs)
water_level = world.terrain.water_level
survival = preload("res://scripts/player/survival.gd").new()
survival.name = "Survival"