mirror of
https://port.numenaute.org/aleajactaest/bazar_alea.git
synced 2024-12-02 08:36:00 +00:00
reactivate animation
This commit is contained in:
parent
367eea75aa
commit
6b07896f39
9 changed files with 130 additions and 7240 deletions
|
@ -2,6 +2,7 @@ extends AnimationTree
|
||||||
class_name AnimBlend
|
class_name AnimBlend
|
||||||
@export var movement_script : CharacterMovementComponent
|
@export var movement_script : CharacterMovementComponent
|
||||||
|
|
||||||
|
|
||||||
func _physics_process(_delta):
|
func _physics_process(_delta):
|
||||||
if !movement_script:
|
if !movement_script:
|
||||||
return
|
return
|
||||||
|
@ -14,12 +15,9 @@ func _physics_process(_delta):
|
||||||
set("parameters/InAir/blend_amount" , 0.0)
|
set("parameters/InAir/blend_amount" , 0.0)
|
||||||
#set("parameters/TimeSeek/seek_request", 0.0)
|
#set("parameters/TimeSeek/seek_request", 0.0)
|
||||||
#set("parameters/Transition/transition_request","Idle")
|
#set("parameters/Transition/transition_request","Idle")
|
||||||
#print("Idle")
|
|
||||||
Global.MOVEMENT_STATE.in_air: # Air
|
Global.MOVEMENT_STATE.in_air: # Air
|
||||||
pass
|
|
||||||
set("parameters/InAir/blend_amount" , 1.0)
|
set("parameters/InAir/blend_amount" , 1.0)
|
||||||
#set("parameters/InAir/transition_request","Failling")
|
#set("parameters/InAir/transition_request","Failling")
|
||||||
#print("Falling")
|
|
||||||
Global.MOVEMENT_STATE.mantling: # couverture
|
Global.MOVEMENT_STATE.mantling: # couverture
|
||||||
pass
|
pass
|
||||||
Global.MOVEMENT_STATE.ragdoll:
|
Global.MOVEMENT_STATE.ragdoll:
|
||||||
|
|
|
@ -126,7 +126,6 @@ func reset_camera_transition(smooth_transition: bool = true):
|
||||||
tween.tween_property(Camera,"position",Vector3(0,0,SpringArm.spring_length),1.0)
|
tween.tween_property(Camera,"position",Vector3(0,0,SpringArm.spring_length),1.0)
|
||||||
tween.tween_property(Camera,"rotation",Vector3.ZERO,1.0)
|
tween.tween_property(Camera,"rotation",Vector3.ZERO,1.0)
|
||||||
tween.tween_callback(func(): reseting=false)
|
tween.tween_callback(func(): reseting=false)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
Camera.rotation = Vector3.ZERO
|
Camera.rotation = Vector3.ZERO
|
||||||
Camera.top_level = false
|
Camera.top_level = false
|
||||||
|
|
|
@ -324,7 +324,7 @@ func _physics_process(delta):
|
||||||
aim_rate_h = abs((camera_root.HObject.rotation.y - previous_aim_rate_h) / delta)
|
aim_rate_h = abs((camera_root.HObject.rotation.y - previous_aim_rate_h) / delta)
|
||||||
previous_aim_rate_h = camera_root.HObject.rotation.y
|
previous_aim_rate_h = camera_root.HObject.rotation.y
|
||||||
#
|
#
|
||||||
# animation_stride_warping()
|
#animation_stride_warping()
|
||||||
|
|
||||||
match movement_state:
|
match movement_state:
|
||||||
Global.MOVEMENT_STATE.none:
|
Global.MOVEMENT_STATE.none:
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
extends Node
|
extends Node
|
||||||
|
|
||||||
#------------------ Player Enums ------------------#
|
#------------------ Player Enums ------------------#
|
||||||
# Demarche (Attendre, Marcher, Courir, Pic de vitesse
|
# Demarche (Marcher, Courir, Pic de vitesse
|
||||||
enum GAIT {waiting, walking , running , sprinting}
|
enum GAIT {walking , running , sprinting}
|
||||||
# Sol, Air, Couverture, poupee de chiffon
|
# Sol, Air, Couverture, poupee de chiffon
|
||||||
enum MOVEMENT_STATE {none , grounded , in_air , mantling, ragdoll}
|
enum MOVEMENT_STATE {none , grounded , in_air , mantling, ragdoll}
|
||||||
#
|
#
|
||||||
|
|
|
@ -3,7 +3,7 @@ class_name PlayerGameplayComponent
|
||||||
|
|
||||||
@export_group("Stamina System", "stamina_")
|
@export_group("Stamina System", "stamina_")
|
||||||
@export var stamina_use: bool = false
|
@export var stamina_use: bool = false
|
||||||
@export var stamina_energy_consumption: float = 15.0#per second
|
@export var stamina_energy_consumption: float = 15.0 #per second
|
||||||
@export var stamina_attribute: GameAttribute
|
@export var stamina_attribute: GameAttribute
|
||||||
|
|
||||||
@export var networking : PlayerNetworkingComponent
|
@export var networking : PlayerNetworkingComponent
|
||||||
|
|
|
@ -36,7 +36,7 @@ func _ready():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
func set_id(value:int):
|
func set_id(value:int) -> void:
|
||||||
id = value
|
id = value
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -27,17 +27,28 @@ func set_otherplayer(value:bool):
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
$SpringArm3D/Camera3D.set_current(false)
|
$SpringArm3D/Camera3D.set_current(false)
|
||||||
$PlayerGameplayComponent.update_animations()
|
#$PlayerGameplayComponent.update_animations()
|
||||||
|
|
||||||
|
|
||||||
func set_current_camera():
|
func set_current_camera() -> void:
|
||||||
$SpringArm3D/Camera3D.set_current(true)
|
$SpringArm3D/Camera3D.set_current(true)
|
||||||
|
|
||||||
|
|
||||||
func set_id(value:int):
|
func set_id(value:int) -> void:
|
||||||
$PlayerNetworkingComponent.set_id(value)
|
$PlayerNetworkingComponent.set_id(value)
|
||||||
|
|
||||||
|
|
||||||
|
func set_activate() -> void:
|
||||||
|
#$AnimationTree.set_active(true)
|
||||||
|
#$AnimationTree.set("parameters/Transition/transition_request","Idle")
|
||||||
|
pass
|
||||||
|
|
||||||
|
#func set_animation_tree_blend_positions(input_vector: Vector2) -> void:
|
||||||
|
# #print("Blend Position: ", input_vector)
|
||||||
|
# $AnimationTree.set("parameters/Idle/blend_position", input_vector)
|
||||||
|
# $AnimationTree.set("parameters/Walk/blend_position", input_vector)
|
||||||
|
|
||||||
|
|
||||||
func get_animation() -> String:
|
func get_animation() -> String:
|
||||||
return $AnimationTree.get("parameters/Transition/current_state") + \
|
return $AnimationTree.get("parameters/Transition/current_state") + \
|
||||||
", " + str($AnimationTree.get("parameters/InAir/blend_amount")) + \
|
", " + str($AnimationTree.get("parameters/InAir/blend_amount")) + \
|
||||||
|
@ -51,16 +62,16 @@ func get_animation() -> String:
|
||||||
|
|
||||||
|
|
||||||
func get_gait() -> String:
|
func get_gait() -> String:
|
||||||
return Global.GAIT.keys()[$PlayerGameplayComponent.gait]
|
return Global.GAIT.keys()[$CharacterMovementComponent.gait]
|
||||||
|
|
||||||
|
|
||||||
func get_stance() -> String:
|
func get_stance() -> String:
|
||||||
return Global.STANCE.keys()[$PlayerGameplayComponent.stance]
|
return Global.STANCE.keys()[$CharacterMovementComponent.stance]
|
||||||
|
|
||||||
|
|
||||||
func get_rotation_mode() -> String:
|
func get_rotation_mode() -> String:
|
||||||
return Global.ROTATION_MODE.keys()[$PlayerGameplayComponent.rotation_mode]
|
return Global.ROTATION_MODE.keys()[$CharacterMovementComponent.rotation_mode]
|
||||||
|
|
||||||
|
|
||||||
func get_movement_state() -> String:
|
func get_movement_state() -> String:
|
||||||
return Global.MOVEMENT_STATE.keys()[$PlayerGameplayComponent.movement_state]
|
return Global.MOVEMENT_STATE.keys()[$CharacterMovementComponent.movement_state]
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -74,6 +74,7 @@ func _on_connexion_updated(new_state:Multi.Connexion):
|
||||||
$PlayerSpawnLocation.get_child(0).set_current_camera()
|
$PlayerSpawnLocation.get_child(0).set_current_camera()
|
||||||
$PlayerSpawnLocation.get_child(0).set_name(str(Multi.get_id()))
|
$PlayerSpawnLocation.get_child(0).set_name(str(Multi.get_id()))
|
||||||
$PlayerSpawnLocation.get_child(0).set_id(Multi.get_id())
|
$PlayerSpawnLocation.get_child(0).set_id(Multi.get_id())
|
||||||
|
$PlayerSpawnLocation.get_child(0).set_activate()
|
||||||
$PlayerSpawnLocation.set_visible(true)
|
$PlayerSpawnLocation.set_visible(true)
|
||||||
$CameraStarting.set_current(false)
|
$CameraStarting.set_current(false)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue