Command seam: the stance press resolves its target at the step, after the step's target verbs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
2f15c79176
commit
8692cf8600
2 changed files with 11 additions and 11 deletions
|
|
@ -406,14 +406,9 @@ public class ActionGameManager : MonoBehaviour
|
|||
|
||||
// Flips the player's own stance on the current target between hostile and neutral. Going
|
||||
// neutral mid-fight safes weapons (Weapon.StanceAllowsFire); an unmarked/undetected target
|
||||
// reads as non-hostile, so the first press declares hostile. The flip reads the stance when applied, so two
|
||||
// presses in a step cancel.
|
||||
Input.Player.ToggleStance.performed += context =>
|
||||
{
|
||||
var target = CurrentEntity.Target.Value.Entity;
|
||||
if (target == null) return;
|
||||
CurrentEntity.Command.ToggleStance(target);
|
||||
};
|
||||
// reads as non-hostile, so the first press declares hostile. The flip reads the target and its stance when applied,
|
||||
// after the step's target presses, so two presses in a step cancel.
|
||||
Input.Player.ToggleStance.performed += context => CurrentEntity.Command.ToggleStance();
|
||||
|
||||
#region Targeting
|
||||
|
||||
|
|
|
|||
|
|
@ -69,8 +69,9 @@ public sealed class PilotCommand
|
|||
public void Verb(TargetVerb verb) => TargetVerb = verb;
|
||||
public void CycleAim() => AimCycles++;
|
||||
public void Iff(Entity other, bool? hostile) => Iffs.Add((other, hostile, false));
|
||||
// A press that flips the stance on `other` as it stands when applied, in order with Iff, so two in a step cancel.
|
||||
public void ToggleStance(Entity other) => Iffs.Add((other, null, true));
|
||||
// A press that flips the stance on the entity's target as both stand when applied, after the step's target verbs and in
|
||||
// order with Iff, so two in a step cancel. With no target then, it does nothing.
|
||||
public void ToggleStance() => Iffs.Add((null, null, true));
|
||||
// The entity's own switches, pressed: each press flips its switch when applied, so two in a step cancel.
|
||||
public void ToggleOverrideShutdown() => ShutdownOverrideToggles++;
|
||||
public void ToggleHeatsinks() => HeatsinkToggles++;
|
||||
|
|
@ -121,7 +122,11 @@ public static class PilotApplier
|
|||
}
|
||||
foreach (var item in command.Selections) entity.TrySelectTargetItem(item);
|
||||
for (var i = 0; i < command.AimCycles; i++) entity.CycleAim();
|
||||
foreach (var (other, hostile, toggle) in command.Iffs) entity.SetIff(other, toggle ? !entity.IsHostileTo(other) : hostile);
|
||||
foreach (var (other, hostile, toggle) in command.Iffs)
|
||||
{
|
||||
if (!toggle) entity.SetIff(other, hostile);
|
||||
else if (entity.Target.Value.Entity is Entity target) entity.SetIff(target, !entity.IsHostileTo(target));
|
||||
}
|
||||
for (var i = 0; i < command.ShutdownOverrideToggles; i++) entity.OverrideShutdown = !entity.OverrideShutdown;
|
||||
for (var i = 0; i < command.HeatsinkToggles; i++) entity.HeatsinksEnabled = !entity.HeatsinksEnabled;
|
||||
if (entity.Shield != null)
|
||||
|
|
|
|||
Loading…
Reference in a new issue