From 18e55f717ae73466335c169743d3f42cb133759d Mon Sep 17 00:00:00 2001 From: VinPropane Date: Mon, 27 Apr 2026 20:48:47 -0400 Subject: [PATCH] NEO-31: wrap long lines for gdlint pre-push --- client/scripts/ability_cast_client.gd | 8 +++++--- client/scripts/hotbar_cast_slot_resolver.gd | 12 +++++++++--- client/scripts/main.gd | 16 +++++++++++----- client/test/ability_cast_client_test.gd | 9 +++++++-- 4 files changed, 32 insertions(+), 13 deletions(-) diff --git a/client/scripts/ability_cast_client.gd b/client/scripts/ability_cast_client.gd index b3b3350..de21fba 100644 --- a/client/scripts/ability_cast_client.gd +++ b/client/scripts/ability_cast_client.gd @@ -22,9 +22,11 @@ func _ready() -> void: ## [param target_id] server [code]lockedTargetId[/code] string, or [code]null[/code] if none. -## Returns [code]true[/code] when the HTTP POST was **queued** ([method HTTPRequest.request] returned [code]OK[/code]); -## [code]false[/code] if already [member _busy], request failed to start, or client invalid — use for -## [code]ability_cast_requested[/code] dev / future telemetry so hooks match actual submit attempts. +## Returns [code]true[/code] when the HTTP POST was **queued** +## ([method HTTPRequest.request] returned [code]OK[/code]); +## [code]false[/code] if already [member _busy], request failed to start, or client invalid — +## use for [code]ability_cast_requested[/code] dev / future telemetry so hooks match actual submit +## attempts. func request_cast(slot_index: int, ability_id: String, target_id: Variant) -> bool: if _busy: return false diff --git a/client/scripts/hotbar_cast_slot_resolver.gd b/client/scripts/hotbar_cast_slot_resolver.gd index 76ea168..7181c4f 100644 --- a/client/scripts/hotbar_cast_slot_resolver.gd +++ b/client/scripts/hotbar_cast_slot_resolver.gd @@ -1,7 +1,8 @@ extends Object ## Pure resolver for digit hotbar → cast intent (NEO-31). [code]main.gd[/code] delegates here so -## GdUnit can cover unbound slots and [code]lockedTargetId[/code] sourcing without booting the scene. +## GdUnit can cover unbound slots and [code]lockedTargetId[/code] sourcing without booting +## the scene. ## No [code]class_name[/code] — match [code]prototype_target_constants.gd[/code] preload pattern. const KEY_OK := "ok" @@ -16,14 +17,19 @@ const REASON_EMPTY_SLOT := "empty_slot" ## [param slots] snapshot from [code]HotbarState.slots_snapshot()[/code] (fixed length, entries ## [code]null[/code] or [String] ability ids). -## [param target_cached_state] from [code]TargetSelectionClient.cached_state()[/code] (may be empty). +## [param target_cached_state] from [code]TargetSelectionClient.cached_state()[/code] +## (may be empty). ## Returns [code]{ "ok": true, "slotIndex", "abilityId", "targetId" }[/code] or ## [code]{ "ok": false, "reason" }[/code]. static func resolve(slot_index: int, slots: Array, target_cached_state: Dictionary) -> Dictionary: if slot_index < 0 or slot_index >= slots.size(): return {KEY_OK: false, KEY_REASON: REASON_INVALID_SLOT} var ability_variant: Variant = slots[slot_index] - if ability_variant == null or not (ability_variant is String) or (ability_variant as String).strip_edges().is_empty(): + if ( + ability_variant == null + or not (ability_variant is String) + or (ability_variant as String).strip_edges().is_empty() + ): return {KEY_OK: false, KEY_REASON: REASON_EMPTY_SLOT} var ability_id: String = (ability_variant as String).strip_edges() var target_id: Variant = null diff --git a/client/scripts/main.gd b/client/scripts/main.gd index 76f9996..3ee0362 100644 --- a/client/scripts/main.gd +++ b/client/scripts/main.gd @@ -10,7 +10,8 @@ extends Node3D ## Prototype: two random short bumps (sibling StaticBody3D under NavigationRegion3D; see ## `random_floor_bumps.gd`) before nav bake. ## Prototype: `PhysicsRampTest*` (+X extension: west slab ends before the dip; -## `PhysicsRampTestFloorExtensionNorthFill` / `SouthFill` restore walkable floor past the dip in ±Z; +## `PhysicsRampTestFloorExtensionNorthFill` / `SouthFill` restore walkable floor past the dip +## in ±Z; ## block; gentle ramp on **+Z**; steep on **+X**), plus `PhysicsSmoothHillTest` / ## `PhysicsSmoothDipTest` (HeightMap collision). ## Steep ramp: **2 m / 1.5 m** rise/run (~53°) so slope exceeds `Player` `floor_max_angle` (~50°) @@ -208,7 +209,8 @@ func _on_authoritative_position(world: Vector3, apply_as_snap: bool) -> void: ## ## NEO-27 / NEO-31: `ability_cast_requested` is emitted as a dev [code]print[/code] from ## [method _request_hotbar_cast_slot] only after [code]request_cast[/code] on -## [code]AbilityCastClient[/code] returns [code]true[/code] (POST successfully queued on [code]HTTPRequest[/code]). +## [code]AbilityCastClient[/code] returns [code]true[/code] +## (POST successfully queued on [code]HTTPRequest[/code]). ## [code]ability_cast_denied[/code] is surfaced via [code]push_warning[/code] from ## `ability_cast_client.gd` on deny responses (TODO(E9.M1): telemetry schema + ingest). func _on_authoritative_ack_for_hud(world: Vector3) -> void: @@ -365,14 +367,18 @@ func _request_hotbar_cast_slot(slot_index: int) -> void: var target_id: Variant = outcome.get(HotbarCastSlotResolver.KEY_TARGET_ID, null) var started: bool = false if is_instance_valid(_ability_cast_client) and _ability_cast_client.has_method("request_cast"): - started = bool(_ability_cast_client.call("request_cast", resolved_slot, ability_id, target_id)) + started = bool( + _ability_cast_client.call("request_cast", resolved_slot, ability_id, target_id) + ) if started: var target_label: String = "null" if target_id != null: target_label = str(target_id) print( - "ability_cast_requested slot=%d ability_id=%s targetId=%s" - % [resolved_slot, ability_id, target_label] + ( + "ability_cast_requested slot=%d ability_id=%s targetId=%s" + % [resolved_slot, ability_id, target_label] + ) ) diff --git a/client/test/ability_cast_client_test.gd b/client/test/ability_cast_client_test.gd index a8efc2c..53dbdcc 100644 --- a/client/test/ability_cast_client_test.gd +++ b/client/test/ability_cast_client_test.gd @@ -1,6 +1,8 @@ extends GdUnitTestSuite -# main.gd sets base_url/dev_player_id on AbilityCastClient from the same authority block as HotbarLoadoutClient (NEO-31). +# main.gd sets base_url/dev_player_id on AbilityCastClient from the same authority block as +# HotbarLoadoutClient (NEO-31). + const CastClient := preload("res://scripts/ability_cast_client.gd") @@ -95,7 +97,10 @@ func test_request_cast_posts_target_id_string_when_set() -> void: var transport := MockHttpTransport.new() transport.enqueue(HTTPRequest.RESULT_SUCCESS, 200, '{"schemaVersion":1,"accepted":true}') var c := _make_client(transport) - assert_that(bool(c.call("request_cast", 0, "prototype_pulse", "prototype_target_alpha"))).is_true() + ( + assert_that(bool(c.call("request_cast", 0, "prototype_pulse", "prototype_target_alpha"))) + . is_true() + ) var parsed: Variant = JSON.parse_string(transport.last_body) var body: Dictionary = parsed assert_that(body.get("targetId")).is_equal("prototype_target_alpha")