feat(combat): enemy health bars, crosshair aiming + AutoAim world rule, ship-weapon enforcement - #695
Merged
Merged
Conversation
…e, ship-weapon enforcement Health bars (#692): pooled WorldBar primitive on ScreenLabelLayer + shared policy in EnemyHealthBars — every damageable entity (planet machines/bandits, creatures, space hostiles) shows a green→amber→red bar (companions cyan) while in combat (~6 s after a hull drop) or under the crosshair/fire lock. Lerped fill, distance fades matching the nameplate conventions, id cleanup on despawn. No protocol change (Hull/HullMax were already replicated). Client toggle ClientSettings.ShowEnemyHealthBars + ui.settings.show_enemy_health (en/de). Aiming (#693): on foot the crosshair entity (analytic ray-vs-sphere + voxel terrain march; entity meshes carry no colliders) always wins; auto-aim otherwise acquires only in a ~±35° forward cone (no more behind-the-back kills), melee sweeps ~±60°. New world rule GameRules.AutoAim (default ON; --auto-aim CLI, live admin row, SetWorldRulesIntent/ServerRules) — OFF means only a genuine crosshair hit (on foot) or boresight line (space, replacing the ±75° soft lock with ~±30°/ray) lands; misses trace into the terrain. Crosshair tints hostile-red, hit marker flashes on attributed hull drops. Intents carry the aim direction contractless-additively (zero = legacy client) and the server validates angle, ranged line-of-sight and the space firing arc with generous anti-cheat tolerances. Old saves keep AutoAim ON via the missing-field default — no rules lift needed. Ship weapons (#694): weapon_cooldown and weapon_energy are now enforced server-side (per-player cooldown committed only when the shot fires; lazily regenerating reactor-fed energy pool), and the client reads range/cooldown from the fitted module instead of hardcoding 45/0.45 — laser_cannon_2 finally gets its range 70. Tests: AimValidationTests (legacy zero-dir, cone reject, manual crosshair line, wall LOS block, space arc, server cooldown), CLI parse + live-edit coverage; fire-loop tests tick the cooldown. 1375+147 fast-tier green. closes #692 closes #693 closes #694 Co-Authored-By: Claude Fable 5 <[email protected]>
…aram not capturable in local function The dotnet test build didn't catch either (the shot-direction plumbing is Unity-client-only code): Vector3f was fully qualified with the wrong namespace in the two intent senders, and BestConeTarget's local Consider() captured the out parameter (CS1628) — now tracked in a local and assigned on return. Local Windows player build is green. Co-Authored-By: Claude Fable 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Combat gets real feedback and real aiming:
WorldBarprimitive onScreenLabelLayer, shared policy in the newEnemyHealthBarshelper, no protocol change. Client toggle under Settings → Comfort.GameRules.AutoAim(default ON; live admin row,--auto-aimCLI): OFF = only a genuine crosshair/boresight hit lands, misses trace into the terrain. Crosshair tints hostile-red, hit marker on attributed hits. Intents carry the aim direction contractless-additively (zero = legacy client); the server validates angle, ranged line-of-sight and the space firing arc. Existing saves keep AutoAim ON automatically.weapon_cooldownandweapon_energyare now enforced server-side (cooldown committed only when the shot fires; lazily regenerating reactor-fed energy pool), and the client reads range/cooldown from the fitted module instead of hardcoding 45/0.45 —laser_cannon_2finally uses its range 70.Testing
AimValidationTests(legacy zero-dir, cone reject, manual crosshair line, wall LOS block, space firing arc, server cooldown), CLI parse + world-rule live-edit coverage; fire-loop tests tick the cooldown.closes #692
closes #693
closes #694
🤖 Generated with Claude Code