Layout-aim: an identified hull shows where its mounts are; a located mount can be aimed at
TrySelectTargetItem and ResolvedTargetItem gate on FireControl.IsLocated (an item seen to act, or one on a mount of the believed hull's layout) instead of IsRevealed; Combat keeps IsRevealed. Entity.LayoutOf derives the layout from the Contact profile; SchematicRows appends a mount row per unclaimed hardpoint. A mount aim centres on the mount's cells and is frozen per shot (PendingShot.AimAtMount). The cycle runs over located items, the schematic renders mount rows and marks through SchematicRow.Marks. Not yet built or tested. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
f8e7abf460
commit
095efacd79
5 changed files with 83 additions and 33 deletions
|
|
@ -441,21 +441,21 @@ public class ActionGameManager : MonoBehaviour
|
|||
Input.Player.TargetNext.performed += context => CurrentEntity.TargetNext();
|
||||
Input.Player.TargetPrevious.performed += context => CurrentEntity.TargetPrevious();
|
||||
|
||||
// Cut 2 (docs/fire-control-cut.md): cycles the aim point among the current target's revealed
|
||||
// subsystems -- decides nothing itself, only calls the one writer (TrySelectTargetItem), same
|
||||
// predicate (FireControl.IsRevealed) the AI path uses. Entity-only: a chunk has no subsystems.
|
||||
// Cut 2 (docs/fire-control-cut.md): cycles the aim point among the current target's located
|
||||
// subsystems -- decides nothing itself, only calls the one writer (TrySelectTargetItem), gated on the
|
||||
// same predicate (FireControl.IsLocated) the writer reads. Entity-only: a chunk has no subsystems.
|
||||
Input.Player.CycleTargetItem.performed += context =>
|
||||
{
|
||||
var target = CurrentEntity.Target.Value.Entity;
|
||||
if (target == null) return;
|
||||
var revealed = target.Equipment.Where(x => FireControl.IsRevealed(CurrentEntity, x)).ToArray();
|
||||
if (revealed.Length == 0)
|
||||
var located = target.Equipment.Where(x => FireControl.IsLocated(CurrentEntity, x)).ToArray();
|
||||
if (located.Length == 0)
|
||||
{
|
||||
CurrentEntity.TrySelectTargetItem(null);
|
||||
return;
|
||||
}
|
||||
var currentItemIndex = Array.IndexOf(revealed, CurrentEntity.ResolvedTargetItem);
|
||||
CurrentEntity.TrySelectTargetItem(revealed[(currentItemIndex + 1) % revealed.Length]);
|
||||
var currentItemIndex = Array.IndexOf(located, CurrentEntity.ResolvedTargetItem);
|
||||
CurrentEntity.TrySelectTargetItem(located[(currentItemIndex + 1) % located.Length]);
|
||||
};
|
||||
|
||||
#endregion
|
||||
|
|
|
|||
Loading…
Reference in a new issue