143 lines
9.7 KiB
GDScript
143 lines
9.7 KiB
GDScript
extends Resource
|
|
class_name MovementParams
|
|
|
|
# ── Ground ────────────────────────────────────────────────────────────────────
|
|
@export var walk_speed: float = 11.0
|
|
@export var crouch_speed: float = 4.5
|
|
@export var ground_friction: float = 10.0
|
|
@export var ground_acceleration: float = 60.0
|
|
# Releasing movement carries roughly one metre of momentum from full speed.
|
|
# The old 45/s response erased half the velocity in a single rendered frame,
|
|
# leaving no physical time for an authored stopping step to read.
|
|
@export var ground_deceleration: float = 9.0
|
|
|
|
# ── Jump / Air ────────────────────────────────────────────────────────────────
|
|
@export var jump_velocity: float = 8.5
|
|
@export var coyote_time: float = 0.15
|
|
@export var jump_buffer: float = 0.12
|
|
# Retuned to half its old 0.35 (2026-08-01). Air control is how much of the
|
|
# player's input authority survives leaving the ground; at 0.35 a jump could be
|
|
# steered almost like a run, which flattened the cost of committing to a leap.
|
|
@export var air_control: float = 0.175
|
|
@export var air_acceleration: float = 30.0
|
|
@export var max_air_speed: float = 18.0
|
|
@export var gravity: float = 22.0
|
|
@export var fall_multiplier: float = 2.0
|
|
@export var low_jump_multiplier: float = 1.6
|
|
|
|
# ── Air Strafe (Quake-style) ──────────────────────────────────────────────────
|
|
# Classic accelerate: only the velocity component along wish_dir is capped, so
|
|
# turning while strafing genuinely gains speed (up to max_air_speed overall).
|
|
@export var air_strafe_accel: float = 90.0
|
|
@export var air_wish_speed_cap: float = 2.5 # per-tick projection cap (m/s), quake-style
|
|
# Direct steering: bends existing horizontal velocity toward the input without
|
|
# changing its magnitude, so air direction changes feel light and responsive.
|
|
@export var air_steer_rate: float = 5.0
|
|
|
|
# ── Bunny Hop ─────────────────────────────────────────────────────────────────
|
|
@export var bunny_hop_impulse: float = 1.1
|
|
@export var bunny_hop_speed_gain: float = 0.7
|
|
@export var bunny_hop_speed_cap: float = 20.0
|
|
|
|
# ── Slide ─────────────────────────────────────────────────────────────────────
|
|
@export var slide_speed: float = 14.0
|
|
@export var slide_boost: float = 3.0 # flat entry boost when grounded and fast
|
|
@export var slide_friction_flat: float = 2.2 # m/s^2 decel on flat ground (low = long slides)
|
|
@export var slide_slope_accel: float = 16.0 # downhill acceleration from gravity projection
|
|
@export var slide_min_speed: float = 4.0
|
|
@export var slide_cooldown: float = 0.35 # prevents rapid slide re-entry
|
|
@export var slide_steer_rate: float = 2.5 # how fast slide direction bends toward input
|
|
# Retuned to a tenth of its old 1.5 (2026-08-01). Jumping out of a slide still
|
|
# PRESERVES the slide's speed — that is `out_speed` in state_slide, and it is
|
|
# untouched — this is only the bonus stacked on top of it, which at 1.5 m/s a
|
|
# chain could compound into the bunny-hop cap almost for free.
|
|
@export var slide_jump_speed_boost: float = 0.15 # extra m/s added when jumping out of slide
|
|
|
|
# ── Wall Run ──────────────────────────────────────────────────────────────────
|
|
@export var wall_run_speed: float = 13.0
|
|
@export var wall_run_accel: float = 18.0 # accelerate toward run speed (no hard set)
|
|
@export var wall_run_duration: float = 1.8
|
|
@export var wall_run_gravity: float = 5.0
|
|
@export var wall_run_entry_max_up: float = 3.5 # keep this much upward momentum on attach
|
|
@export var wall_run_auto_jump_speed: float = 10.0
|
|
@export var wall_run_jump_horizontal: float = 8.0
|
|
@export var wall_run_jump_off_normal: float = 6.0
|
|
@export var wall_angle_threshold: float = 70.0
|
|
@export var wall_detect_distance: float = 0.8
|
|
@export var wall_ray_up_height: float = 0.6
|
|
@export var wall_ray_down_height: float = 0.0
|
|
|
|
# ── Wall Climb ────────────────────────────────────────────────────────────────
|
|
@export var wall_climb_speed: float = 6.5
|
|
@export var wall_climb_duration: float = 2.2
|
|
@export var wall_climb_max_angle: float = 75.0
|
|
@export var wall_climb_vault_forward: float = 14.0
|
|
@export var wall_climb_vault_up: float = 12.0
|
|
@export var wall_climb_vault_height_check: float = 1.0
|
|
|
|
# ── Jumping ───────────────────────────────────────────────────────────────────
|
|
@export var jump_cooldown: float = 0.12
|
|
|
|
# ── Wall Cling ────────────────────────────────────────────────────────────────
|
|
@export var wall_cling_slide_speed: float = -1.5
|
|
@export var wall_cling_stamina_drain: float = 1.0
|
|
@export var wall_cling_max_stamina: float = 2.5
|
|
|
|
# ── Grapple ───────────────────────────────────────────────────────────────────
|
|
@export var grapple_range: float = 35.0
|
|
@export var grapple_pull_force: float = 18.0 # constant reel toward the hook
|
|
@export var grapple_reel_force: float = 22.0 # extra reel while holding forward
|
|
@export var grapple_jump_boost: float = 12.0
|
|
@export var grapple_spring_strength: float = 14.0
|
|
@export var grapple_air_control: float = 24.0
|
|
@export var grapple_shoot_speed: float = 70.0 # hook travel speed (m/s)
|
|
|
|
# ── Dash ──────────────────────────────────────────────────────────────────────
|
|
# Retuned to three quarters of its old 13.0 (2026-08-01). This is the speed a
|
|
# dash ADDS: state_dash projects the current velocity onto the dash direction
|
|
# and adds this on top, so a forward dash at full run used to gain a flat 13 m/s.
|
|
@export var dash_speed: float = 9.75
|
|
@export var dash_duration: float = 0.18
|
|
@export var dash_charges: int = 2 # dashes available before recharging
|
|
@export var dash_cooldown: float = 2.0 # seconds to regain ONE charge
|
|
@export var dash_invulnerability_time: float = 0.1
|
|
|
|
# ── Landing feel ──────────────────────────────────────────────────────────────
|
|
@export var land_soft_speed: float = 8.0 # fall speed where landing feedback starts
|
|
@export var land_heavy_speed: float = 18.0 # fall speed considered a heavy landing
|
|
|
|
# ── Crouch ────────────────────────────────────────────────────────────────────
|
|
@export var crouch_transition_speed: float = 12.0 # capsule/camera height lerp rate
|
|
|
|
# ── Rocket Jump ───────────────────────────────────────────────────────────────
|
|
@export var rocket_jump_self_damage: float = 15.0
|
|
@export var rocket_jump_up_impulse: float = 20.0
|
|
@export var rocket_jump_explosion_radius: float = 6.0
|
|
@export var rocket_jump_falloff: float = 1.5
|
|
|
|
# ── Shotgun Jump ──────────────────────────────────────────────────────────────
|
|
@export var shotgun_jump_impulse: float = 12.0
|
|
|
|
# ── Double Jump ───────────────────────────────────────────────────────────────
|
|
@export var double_jump_velocity: float = 8.0
|
|
@export var double_jump_max_count: int = 2 # 1 base jump + 1 double
|
|
|
|
# ── Chaining ──────────────────────────────────────────────────────────────────
|
|
@export var chain_bonus_per_success: float = 0.05
|
|
@export var chain_bonus_cap: float = 0.25
|
|
@export var chain_bonus_decay_rate: float = 0.5
|
|
@export var chain_window: float = 1.5
|
|
|
|
# ── Camera ────────────────────────────────────────────────────────────────────
|
|
@export var mouse_sensitivity: float = 0.002
|
|
@export var base_fov: float = 90.0
|
|
@export var dash_fov: float = 110.0
|
|
@export var fov_lerp_speed: float = 10.0
|
|
@export var head_bob_frequency: float = 12.0
|
|
@export var head_bob_amplitude: float = 0.04
|
|
@export var wall_run_tilt_angle: float = 12.0
|
|
@export var wall_run_tilt_speed: float = 8.0
|
|
@export var slide_tilt_angle: float = 4.0
|
|
@export var land_dip_scale: float = 0.012 # camera dip per m/s of landing speed
|
|
@export var land_dip_max: float = 0.25 # max camera dip on heavy landings
|