feat: implement walking and killable enemy dummy entities and player movement controller base
This commit is contained in:
@@ -499,7 +499,6 @@ func rpc_take_damage(amount: float, hit_pos: Vector3, attacker_id: int, weapon_n
|
||||
if multiplayer.is_server():
|
||||
var nm = get_node_or_null("/root/NetworkManager")
|
||||
if nm and multiplayer.has_multiplayer_peer():
|
||||
var victim_id = multiplayer.get_unique_id()
|
||||
var killer_id = attacker_id
|
||||
|
||||
var assist_ids: Array = []
|
||||
@@ -722,6 +721,15 @@ func _process(delta: float) -> void:
|
||||
humanoid.set_weapon(synced_weapon_path)
|
||||
humanoid.set_meta("current_weapon_path", synced_weapon_path)
|
||||
return
|
||||
|
||||
# Update UI
|
||||
if is_instance_valid(health_bar):
|
||||
health_bar.value = health
|
||||
health_label.text = "%d / %d" % [ceil(health), max_health]
|
||||
if is_instance_valid(shield_bar):
|
||||
shield_bar.value = shield
|
||||
shield_label.text = "%d / %d" % [ceil(shield), max_shield]
|
||||
|
||||
if is_dead:
|
||||
# Continuously follow the ragdoll torso
|
||||
if is_instance_valid(ragdoll_instance) and is_instance_valid(camera):
|
||||
@@ -744,14 +752,6 @@ func _process(delta: float) -> void:
|
||||
shield += 20.0 * delta
|
||||
if shield > max_shield:
|
||||
shield = max_shield
|
||||
|
||||
# Update UI
|
||||
if is_instance_valid(health_bar):
|
||||
health_bar.value = health
|
||||
health_label.text = "%d / %d" % [ceil(health), max_health]
|
||||
if is_instance_valid(shield_bar):
|
||||
shield_bar.value = shield
|
||||
shield_label.text = "%d / %d" % [ceil(shield), max_shield]
|
||||
|
||||
func _setup_hud() -> void:
|
||||
var margin = MarginContainer.new()
|
||||
|
||||
Reference in New Issue
Block a user