This commit is contained in:
Nicholas Butzke
2026-08-09 01:31:44 -04:00
parent 922983429e
commit 9358746582
43 changed files with 4324 additions and 481 deletions
+18 -3
View File
@@ -88,7 +88,8 @@ var synced_is_crouching: bool = false
var synced_position: Vector3 = Vector3.ZERO
var synced_velocity: Vector3 = Vector3.ZERO
var synced_is_ads: bool = false
var synced_wall_side: float = 0.0 # -1 wall left, +1 wall right (wall-run lean)
var synced_wall_side: float = 0.0 # -1 wall left, +1 wall right (wall-glide bank)
var synced_helmet_closed: bool = false
var synced_is_dancing: bool = false # dance emote (B), shown on the model
## Which of the five routines in DanceRoutines is playing. Replicated, so other
## players see the emote that was actually chosen rather than always the first.
@@ -285,6 +286,7 @@ func _update_jet_vfx(state: String, move_dir: Vector2) -> void:
_jet_vfx.set_visual_model(get_visual_model())
_jet_vfx.set_render_enabled(not is_multiplayer_authority() or third_person)
_jet_vfx.set_dash(state == "dash", move_dir)
_jet_vfx.set_wall_glide(state == "wall_run", move_dir)
## Swap the visual model to match a skin id. GLB skins replace the procedural
## model entirely; color skins tint the procedural model.
@@ -305,7 +307,9 @@ func _apply_skin_model(skin_id: String) -> void:
if has_model:
var model := SkinnedPlayerModel.new()
model.name = "SkinnedModel"
model.skin_id = skin_id
model.model_path = skin.model_path
model.mecha_theme = str(skin.get("mecha_theme"))
# Owner gets the first-person body view (head hidden, fully animated);
# everyone else sees the full third-person model.
model.first_person_mode = is_multiplayer_authority()
@@ -937,6 +941,9 @@ func _physics_process(_delta: float) -> void:
if Input.is_action_just_pressed("toggle_camera_view"):
set_third_person(not third_person)
if Input.is_action_just_pressed("toggle_helmet"):
synced_helmet_closed = not synced_helmet_closed
# Emote (B): HOLD to open the radial dial and point at a dance,
# release to commit. A tap too short to have aimed anything just
# toggles the last one, which is exactly what the button did before
@@ -1064,8 +1071,12 @@ func _physics_process(_delta: float) -> void:
# otherwise the first movement frame still samples last frame's Idle.
if visual.has_method("set_wall_side"):
visual.set_wall_side(sm.wall_side)
if visual.has_method("set_wall_run_motion"):
if visual.has_method("set_wall_glide_motion"):
visual.set_wall_glide_motion(velocity)
elif visual.has_method("set_wall_run_motion"):
visual.set_wall_run_motion(velocity)
if visual.has_method("set_helmet_closed"):
visual.set_helmet_closed(synced_helmet_closed)
visual.update_state(sm.current_state, h_speed, sm.input_crouch)
if visual.has_method("set_dancing"):
visual.set_dancing(synced_is_dancing, synced_dance_index)
@@ -1156,8 +1167,12 @@ func _process(delta: float) -> void:
visual.set_locomotion(d.x, d.y, 1.0 if synced_is_ads else 0.0)
if visual.has_method("set_wall_side"):
visual.set_wall_side(synced_wall_side)
if visual.has_method("set_wall_run_motion"):
if visual.has_method("set_wall_glide_motion"):
visual.set_wall_glide_motion(synced_velocity)
elif visual.has_method("set_wall_run_motion"):
visual.set_wall_run_motion(synced_velocity)
if visual.has_method("set_helmet_closed"):
visual.set_helmet_closed(synced_helmet_closed)
visual.update_state(
synced_movement_state,
synced_movement_speed,