Milestone 9 Development

This commit is contained in:
patrick_pluto 2024-08-31 14:58:41 +02:00
commit 785bbd8f05
83 changed files with 1089 additions and 4525 deletions

View file

@ -1,11 +1,18 @@
## freeftf
## Copyright (C) 2024 Patrick_Pluto
## FreeFTF
## Copyright (C) 2024 Interstellar Development
##
## This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <https://www.gnu.org/licenses/>.
extends CharacterBody3D
@ -90,7 +97,7 @@ func _physics_process(delta):
if !npc:
for id in Game.player_list:
Client.rpc_id(id,"sync_player",get_path(), position, rotation)
Client.rpc_id(id,"sync_player",get_path(), position, rotation, $collision.rotation)
if mouse_locked and !has_node("./game_menu"):
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
else:
@ -103,15 +110,12 @@ func _physics_process(delta):
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
var instance = menu.instantiate()
add_child(instance)
if Input.is_action_just_pressed("mouse_lock"):
mouse_locked = !mouse_locked
func _input(event):
if !npc:
if event is InputEventMouseMotion and (Input.is_action_pressed("cam_look") or $cam_y/Camera3D.position.z == 0) and !has_node("./game_menu"):
var camera_rotation = event.relative * 0.01
if event is InputEventMouseMotion and !has_node("./game_menu"):
var camera_rotation = event.relative * 0.01 * Game.settings["sensitivity"]
if $cam_y.rotation.x <= 1.6 && camera_rotation.y <= 0:
$cam_y.rotate(Vector3.RIGHT, -camera_rotation.y)
elif $cam_y.rotation.x >= -1.6 && camera_rotation.y >= 0:
@ -128,7 +132,7 @@ func beast_init():
Game.is_beast = true
beast = true
speed += 2
position.y += 10
position = get_parent().find_child("beast_spawns").find_child("0").position
$hammer/CSGBox3D/detect_hit.monitoring = true
$hammer/CSGBox3D/detect_hit.monitorable = true
$hammer/CSGBox3D/detect_hit/CollisionShape3D.disabled = false