Add starter RV progression and fishing feedback
This commit is contained in:
parent
eed361681a
commit
d8bf59bca0
47 changed files with 2268 additions and 467 deletions
|
|
@ -90,6 +90,7 @@ const CATCH_SHOWCASE_INPUT_OWNER: StringName = &"catch_showcase"
|
|||
# safe IDs so newer clients can extend it, but Player only presents actions
|
||||
# explicitly approved by this catalog.
|
||||
const NETWORK_ANIMATION_ACTION_IDS: Array[StringName] = [
|
||||
CHARACTER_WALKING_ANIMATION,
|
||||
CHARACTER_CASTING_ANIMATION,
|
||||
CHARACTER_NET_DRAW_ANIMATION,
|
||||
CHARACTER_NET_STRIKE_ANIMATION,
|
||||
|
|
@ -436,6 +437,11 @@ var _rv_previous_camera_environment: Environment
|
|||
@export var maximum_zoom: float = 8.0
|
||||
@export var zoom_step: float = 0.75
|
||||
@export var zoom_smoothing: float = 12.0
|
||||
@export_range(0.0, 1.0, 0.01) var fishing_reel_zoom_amount: float = 0.22
|
||||
@export_range(0.0, 1.5, 0.01) var fishing_barrier_break_zoom: float = 0.38
|
||||
@export_range(0.05, 1.0, 0.01) var fishing_break_zoom_decay: float = 0.34
|
||||
@export_range(0.0, 0.2, 0.005) var fishing_barrier_hit_shake: float = 0.018
|
||||
@export_range(0.0, 0.3, 0.005) var fishing_barrier_break_shake: float = 0.045
|
||||
@export_range(0.1, 12.0, 0.1) var controller_zoom_speed: float = 4.0
|
||||
@export_range(0.0, 1.0, 0.01) var controller_trigger_threshold: float = 0.55
|
||||
@export_range(1.0, 40.0, 0.5) var free_camera_speed: float = 10.0
|
||||
|
|
@ -497,6 +503,12 @@ var _remote_recovery_presentation_active: bool = false
|
|||
var _remote_recovery_visual_origin: Vector3
|
||||
var _remote_recovery_elapsed: float = 0.0
|
||||
var _target_zoom: float = 5.0
|
||||
var _fishing_reel_camera_active: bool = false
|
||||
var _fishing_break_zoom_offset: float = 0.0
|
||||
var _fishing_camera_shake_remaining: float = 0.0
|
||||
var _fishing_camera_shake_duration: float = 0.0
|
||||
var _fishing_camera_shake_strength: float = 0.0
|
||||
var _fishing_camera_shake_phase: float = 0.0
|
||||
var _showcase_rod_visibility: bool = true
|
||||
var _showcase_net_visibility: bool = false
|
||||
var _showcase_shovel_visibility: bool = false
|
||||
|
|
@ -1162,6 +1174,7 @@ func _process(delta: float) -> void:
|
|||
)
|
||||
if not local_control_enabled:
|
||||
return
|
||||
_update_fishing_camera_effects(delta)
|
||||
if _free_camera_active:
|
||||
if _is_camera_input_enabled():
|
||||
_rotate_free_camera(
|
||||
|
|
@ -1190,13 +1203,68 @@ func _process(delta: float) -> void:
|
|||
)
|
||||
|
||||
var zoom_weight: float = 1.0 - exp(-zoom_smoothing * delta)
|
||||
var fishing_zoom_offset: float = (
|
||||
fishing_reel_zoom_amount
|
||||
if _fishing_reel_camera_active
|
||||
else 0.0
|
||||
) + _fishing_break_zoom_offset
|
||||
var effective_target_zoom: float = clampf(
|
||||
_target_zoom - fishing_zoom_offset,
|
||||
1.25 if _rv_interior_camera_mode else minimum_zoom,
|
||||
16.0 if _rv_interior_camera_mode else maximum_zoom,
|
||||
)
|
||||
_spring_arm.spring_length = lerpf(
|
||||
_spring_arm.spring_length,
|
||||
_target_zoom,
|
||||
effective_target_zoom,
|
||||
zoom_weight
|
||||
)
|
||||
|
||||
|
||||
func set_fishing_reel_camera_active(active: bool) -> void:
|
||||
_fishing_reel_camera_active = active
|
||||
|
||||
|
||||
func play_fishing_barrier_camera_feedback(barrier_broken: bool) -> void:
|
||||
if not local_control_enabled or _free_camera_active:
|
||||
return
|
||||
_fishing_camera_shake_strength = (
|
||||
fishing_barrier_break_shake
|
||||
if barrier_broken
|
||||
else fishing_barrier_hit_shake
|
||||
)
|
||||
_fishing_camera_shake_duration = 0.20 if barrier_broken else 0.10
|
||||
_fishing_camera_shake_remaining = _fishing_camera_shake_duration
|
||||
if barrier_broken:
|
||||
_fishing_break_zoom_offset = fishing_barrier_break_zoom
|
||||
|
||||
|
||||
func _update_fishing_camera_effects(delta: float) -> void:
|
||||
_fishing_break_zoom_offset = move_toward(
|
||||
_fishing_break_zoom_offset,
|
||||
0.0,
|
||||
(
|
||||
fishing_barrier_break_zoom
|
||||
/ maxf(fishing_break_zoom_decay, 0.05)
|
||||
) * delta,
|
||||
)
|
||||
if _fishing_camera_shake_remaining <= 0.0:
|
||||
_camera.h_offset = 0.0
|
||||
_camera.v_offset = 0.0
|
||||
return
|
||||
_fishing_camera_shake_remaining = maxf(
|
||||
_fishing_camera_shake_remaining - delta,
|
||||
0.0,
|
||||
)
|
||||
_fishing_camera_shake_phase += delta * 92.0
|
||||
var decay: float = (
|
||||
_fishing_camera_shake_remaining
|
||||
/ maxf(_fishing_camera_shake_duration, 0.001)
|
||||
)
|
||||
var strength: float = _fishing_camera_shake_strength * decay
|
||||
_camera.h_offset = sin(_fishing_camera_shake_phase) * strength
|
||||
_camera.v_offset = cos(_fishing_camera_shake_phase * 1.31) * strength * 0.7
|
||||
|
||||
|
||||
func _update_blink(delta: float) -> void:
|
||||
if _fighting_visual_active:
|
||||
return
|
||||
|
|
@ -3052,6 +3120,19 @@ func set_camera_active(active: bool) -> void:
|
|||
_camera.current = active
|
||||
|
||||
|
||||
func face_world_direction(direction: Vector3) -> void:
|
||||
var horizontal_direction := Vector3(direction.x, 0.0, direction.z)
|
||||
if horizontal_direction.is_zero_approx() or _visuals == null:
|
||||
return
|
||||
horizontal_direction = horizontal_direction.normalized()
|
||||
var target_world_yaw: float = atan2(
|
||||
-horizontal_direction.x,
|
||||
-horizontal_direction.z,
|
||||
)
|
||||
_visuals.rotation.y = target_world_yaw - global_rotation.y
|
||||
_network_target_visual_yaw = _visuals.rotation.y
|
||||
|
||||
|
||||
func apply_camera_settings(
|
||||
new_mouse_sensitivity: float,
|
||||
new_controller_sensitivity: float,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue