32 lines
1 KiB
GDScript
32 lines
1 KiB
GDScript
extends Node
|
|
|
|
var stamina: float = 100.0
|
|
var flashlight_power: float = 100.0
|
|
var stamina_recharge: bool = true
|
|
|
|
func stamina_recharge_off():
|
|
stamina_recharge = false
|
|
|
|
func _on_stamina_reset_timeout() -> void:
|
|
stamina_recharge = true
|
|
|
|
#func _physics_process(_delta: float) -> void:
|
|
##handle equipped object
|
|
#if selected_item_object != null:
|
|
#var target_pos = selected_item_position.global_position
|
|
#var current_pos = selected_item_object.global_position
|
|
#var direction = target_pos - current_pos
|
|
#
|
|
#selected_item_object.linear_velocity = direction * PlayerConsts.GRAB_POWER
|
|
#
|
|
#var current_quat = selected_item_object.global_transform.basis.get_rotation_quaternion()
|
|
#var target_quat = selected_item_position.global_transform.basis.get_rotation_quaternion()
|
|
#
|
|
#var delta_quat = target_quat * current_quat.inverse()
|
|
#var angle = delta_quat.get_angle()
|
|
#var axis = delta_quat.get_axis()
|
|
#
|
|
#if angle > PI:
|
|
#angle -= TAU
|
|
#
|
|
#selected_item_object.angular_velocity = axis * angle * PlayerConsts.GRAB_ROTATION_POWER
|