contact-hud: the HUD reads the player's own ContactOf and book; TargetedBy and the spotted blink go
Selection is nothing the selected ship can sense: TargetedBy, TargetedByCount, their subscriptions and the music read of them are deleted. Indicator fills, the target panel, the compass, music and the enemy schematic rows now read CurrentEntity's ContactOf / RevealsOf / RevealedSubjects (new, the book's keys); the schematic rows are built by one builder from the book and rebuilt when the revealed set changes. Impact hull effect and projectile hit effects at another ship's position draw only through ActionGameManager.DrawsAt (the player's own ship or a Tracked contact). Builds untested in Unity at this commit; tests NothingReadsSelection and RevealedSubjectsListsTheBook. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
6292d82615
commit
4708a71a67
10 changed files with 149 additions and 57 deletions
|
|
@ -87,7 +87,7 @@ public class GuidedProjectile : MonoBehaviour
|
|||
// The resolution. A round that detonated (a hit, or a burst) bursts now, at the simulation's burst point when
|
||||
// it has one; a round the simulation resolved without a detonation (a contact or delayed round that missed,
|
||||
// one whose target is gone) just falls away, with no explosion to show.
|
||||
public void Resolve(bool detonated, Vector3? point)
|
||||
public void Resolve(bool detonated, Vector3? point, bool showHitEffect)
|
||||
{
|
||||
// A round that already faded out (overshot, out of flight) still shows the simulation's detonation: only a
|
||||
// round that has been killed is done. The fade is stopped so it cannot Kill the round a second time.
|
||||
|
|
@ -102,7 +102,7 @@ public class GuidedProjectile : MonoBehaviour
|
|||
// short of it), and is skipped when the round never knew where its target was.
|
||||
Vector3? effectAt = point ?? (TargetPosition != null ? TargetPosition() : Target ? Target.position : (Vector3?) null);
|
||||
if (point.HasValue) transform.position = point.Value;
|
||||
if (HitEffect != null && effectAt.HasValue)
|
||||
if (HitEffect != null && showHitEffect && effectAt.HasValue)
|
||||
{
|
||||
var ht = HitEffect.Instantiate<Transform>();
|
||||
ht.position = effectAt.Value;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,8 @@ public class GuidedProjectileManager : InstantWeaponEffectManager
|
|||
var bindings = new CompositeDisposable();
|
||||
zone.ShotCommitted.Where(o => o.ShotId == shotId && o.HasBurstPoint).Subscribe(o => p.BurstAt(At(o))).AddTo(bindings);
|
||||
zone.ShotResolved.Where(o => o.ShotId == shotId)
|
||||
.Subscribe(o => p.Resolve(o.Result == ShotResult.Hit || o.Result == ShotResult.Burst, o.HasBurstPoint ? At(o) : (Vector3?) null))
|
||||
.Subscribe(o => p.Resolve(o.Result == ShotResult.Hit || o.Result == ShotResult.Burst, o.HasBurstPoint ? At(o) : (Vector3?) null,
|
||||
ActionGameManager.DrawsAt(o.Target)))
|
||||
.AddTo(bindings);
|
||||
// The binding outlives a fade-out until the shot's own arrival (the moment the simulation resolves it), plus a
|
||||
// second of margin; a shot no longer pending has nothing left to resolve.
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public class Projectile : MonoBehaviour
|
|||
_known = outcome;
|
||||
if (outcome.Result == ShotResult.Miss) return;
|
||||
Draw();
|
||||
if (HitEffect != null) HitEffect.Instantiate<Transform>().position = transform.position;
|
||||
if (HitEffect != null && ActionGameManager.DrawsAt(outcome.Target)) HitEffect.Instantiate<Transform>().position = transform.position;
|
||||
Finish();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue