new work towards M8

This commit is contained in:
patrick_pluto 2024-08-13 22:12:37 +02:00
commit bb7fd5cb3b
13 changed files with 194 additions and 75 deletions

View file

@ -71,11 +71,11 @@ func _physics_process(delta):
if Input.is_action_pressed("click") and $hammer.rotation_degrees.x > 0:
$hammer.rotation_degrees.x -= 10
for id in Game.player_list:
Client.rpc_id(id,"sync_hammer",name, $hammer.rotation)
Client.rpc_id(id,"sync_hammer",$hammer.get_path(), $hammer.rotation)
elif $hammer.rotation_degrees.x < 90 and !Input.is_action_pressed("click"):
$hammer.rotation_degrees.x += 10
for id in Game.player_list:
Client.rpc_id(id,"sync_hammer",name, $hammer.rotation)
Client.rpc_id(id,"sync_hammer",$hammer.get_path(), $hammer.rotation)
var input_dir = Input.get_vector("left", "right", "forwards", "backwards")
var direction = (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
@ -90,7 +90,7 @@ func _physics_process(delta):
if !npc:
for id in Game.player_list:
Client.rpc_id(id,"sync_player",name, position, rotation)
Client.rpc_id(id,"sync_player",get_path(), position, rotation)
if mouse_locked and !has_node("./game_menu"):
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
else:
@ -138,24 +138,26 @@ func beast_init():
func _on_detect_hit_body_entered(body):
if enabled and body is CharacterBody3D and !got_person:
for id in Game.player_list:
Client.rpc_id(id,"player_hit",body.name, name)
Client.rpc_id(id,"player_hit",body.get_path(), get_path())
func captured(beast2):
if !npc:
$in_bag.visible = true
$time_in_bag.start()
visible = false
enabled = false
caught = true
captured_by = beast2
position_pre = position
position = Vector3(10000, 10000, 10000)
if !beast:
if !npc:
$in_bag.visible = true
$time_in_bag.start()
visible = false
enabled = false
caught = true
captured_by = beast2
position_pre = position
position = Vector3(10000, 10000, 10000)
func got_one(target):
caught_body = target
got_person = true
$bag/CSGSphere3D.show()
if !target.beast:
caught_body = target
got_person = true
$bag/CSGSphere3D.show()
func lost_one():
got_person = false