Branch Sync.

This commit is contained in:
patrick_pluto 2024-09-01 21:35:29 +02:00
parent 785bbd8f05
commit 3c0be2d800
7 changed files with 64 additions and 15 deletions

11
scripts/ability_select.gd Normal file
View file

@ -0,0 +1,11 @@
extends VBoxContainer
func _on_opt_0_pressed():
get_parent().get_parent().speed += 1
get_parent().get_parent().mouse_locked = true
get_parent().queue_free()
func _on_opt_1_pressed():
get_parent().get_parent().jump_debuff -= 2
get_parent().get_parent().mouse_locked = true
get_parent().queue_free()

View file

@ -17,13 +17,12 @@
extends Node
const PORT = 35000
const MAX_CONNECTIONS = 256
const MAX_CONNECTIONS = 1024
var game_rooms = {}
var player_associations = {}
var name_associations = {}
func _ready():
multiplayer.peer_disconnected.connect(_on_player_disconnected)
multiplayer.peer_connected.connect(_on_player_connected)

View file

@ -32,6 +32,8 @@ var beast = false
var mouse_locked = true
var is_frozen = false
var hp = 100
var jump_debuff = 5
var jump_debuff_used = 5
var menu = preload("res://menus/game_menu.tscn")
@ -56,7 +58,8 @@ func _physics_process(delta):
if Input.is_action_just_pressed("jump") and is_on_floor() and $jump_timeout.is_stopped():
if beast:
speed -= 5
jump_debuff_used = jump_debuff
speed -= jump_debuff_used
$jump_timeout.start()
velocity.y = jump_velocity
@ -114,7 +117,7 @@ func _physics_process(delta):
func _input(event):
if !npc:
if event is InputEventMouseMotion and !has_node("./game_menu"):
if event is InputEventMouseMotion and mouse_locked:
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)
@ -130,14 +133,16 @@ func _input(event):
func beast_init():
if !npc:
Game.is_beast = true
add_child(load("res://menus/ability_select.tscn").instantiate())
mouse_locked = false
beast = true
speed += 2
position = get_parent().find_child("beast_spawns").find_child("0").position
speed += 1
$hammer/CSGBox3D/detect_hit.monitoring = true
$hammer/CSGBox3D/detect_hit.monitorable = true
$hammer/CSGBox3D/detect_hit/CollisionShape3D.disabled = false
$hammer.show()
$bag.show()
func _on_detect_hit_body_entered(body):
if enabled and body is CharacterBody3D and !got_person:
@ -190,11 +195,10 @@ func _on_time_in_bag_timeout():
position = position_pre
$in_bag.visible = false
func _on_show_fps_timeout():
$fps_counter.text = "FPS: "+str(Engine.get_frames_per_second())
$health.text = "HP: "+str(hp)
func _on_jump_timeout_timeout():
speed += 5
speed += jump_debuff_used