Cut 6b: Brokkr drop_pod.glb, petal blow-off, retro VFX/audio/juice, drop HUD/camera, and GL3 Sion captures
This commit is contained in:
parent
c2f1e5bf90
commit
5af5d87e06
15 changed files with 1847 additions and 94 deletions
|
|
@ -485,6 +485,10 @@ public partial class ArenaAudioSystem : Node3D
|
|||
case ContenderLoadoutEvent loadout:
|
||||
HandleLoadoutChanged(session, state, loadout, localId, listenerPos);
|
||||
break;
|
||||
|
||||
case DropPodEvent dpe:
|
||||
HandleDropPodEvent(dpe, localId, listenerPos);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -708,14 +712,98 @@ public partial class ArenaAudioSystem : Node3D
|
|||
}
|
||||
}
|
||||
|
||||
private void HandleDropPodEvent(DropPodEvent dpe, int localId, Vector3 listenerPos)
|
||||
{
|
||||
var kind = (DropPodEventKind)dpe.Kind;
|
||||
Vector3 pos = new(dpe.X, dpe.Y, dpe.Z);
|
||||
bool isLocal = dpe.ContenderId == localId;
|
||||
|
||||
switch (kind)
|
||||
{
|
||||
case DropPodEventKind.WaveAnnounced:
|
||||
if (dpe.WaveIndex > 0 || dpe.RespawnsClosed)
|
||||
{
|
||||
PlayUi("ui_drop_wave", volumeDb: -3.5f, pitchScale: dpe.RespawnsClosed ? 0.85f : 1.0f);
|
||||
}
|
||||
break;
|
||||
|
||||
case DropPodEventKind.PodLaunched:
|
||||
if (isLocal)
|
||||
{
|
||||
PlayUi("pod_petal_pop", volumeDb: -7.5f, pitchScale: 0.72f);
|
||||
}
|
||||
break;
|
||||
|
||||
case DropPodEventKind.PodRetroBurnStart:
|
||||
PlayOneShot3D(
|
||||
"impact_explosion",
|
||||
pos,
|
||||
listenerPos,
|
||||
isLocal ? PriorityLocalAction : PriorityNearCombat,
|
||||
volumeDb: isLocal ? -3.0f : -6.5f,
|
||||
pitchScale: 0.68f,
|
||||
isLocalSource: isLocal,
|
||||
sourceEntityId: dpe.PodId);
|
||||
break;
|
||||
|
||||
case DropPodEventKind.PodTouchdownBlowPetals:
|
||||
RecordExplosionPoint(dpe.X, dpe.Z);
|
||||
int prio = isLocal ? PriorityLocalAction : PriorityLocalImpactOrKill;
|
||||
PlayOneShot3D(
|
||||
"pod_slam",
|
||||
pos,
|
||||
listenerPos,
|
||||
prio,
|
||||
volumeDb: isLocal ? -0.5f : -4.0f,
|
||||
pitchScale: NextPitchJitter(0.94f, 1.06f),
|
||||
isLocalSource: isLocal,
|
||||
sourceEntityId: dpe.PodId);
|
||||
PlayOneShot3D(
|
||||
"pod_petal_pop",
|
||||
pos,
|
||||
listenerPos,
|
||||
prio,
|
||||
volumeDb: isLocal ? -1.5f : -5.5f,
|
||||
pitchScale: NextPitchJitter(0.95f, 1.05f),
|
||||
isLocalSource: isLocal,
|
||||
sourceEntityId: dpe.PodId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateLoopSlots(IClientArenaSession session, Vector3 listenerPos, float alpha)
|
||||
{
|
||||
var state = session.ViewState;
|
||||
int localId = session.LocalContenderId;
|
||||
|
||||
// Slot 0: Local player continuous engine / rotor / mech servo loop
|
||||
// Slot 0: Local player continuous engine / rotor / mech servo / drop-pod retro loop
|
||||
var local = session.LocalContender;
|
||||
if (local.Alive)
|
||||
if (local.IsInDropPod)
|
||||
{
|
||||
var (pPos, _, _) = session.GetInterpolatedContenderPose(localId, alpha);
|
||||
Vector3 pos = new(pPos.X, pPos.Y, pPos.Z);
|
||||
OrbitalPod? localPod = null;
|
||||
var pods = session.ActivePods;
|
||||
for (int i = 0; i < pods.Count; i++)
|
||||
{
|
||||
if (pods[i].PodKind == OrbitalPodKind.Contender && pods[i].ContenderId == localId)
|
||||
{
|
||||
localPod = pods[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
bool burning = localPod?.Phase == OrbitalPodPhase.RetroBurn;
|
||||
AssignLoopSlot(
|
||||
0,
|
||||
isContender: true,
|
||||
localId,
|
||||
"pod_retro_burn",
|
||||
pos,
|
||||
distSq: 0f,
|
||||
volumeDb: burning ? -1.5f : -13.5f,
|
||||
pitchScale: burning ? 0.96f : 1.42f);
|
||||
}
|
||||
else if (local.IsGroundedActive)
|
||||
{
|
||||
var (pPos, _, pVel) = session.GetInterpolatedContenderPose(localId, alpha);
|
||||
Vector3 pos = new(pPos.X, pPos.Y, pPos.Z);
|
||||
|
|
@ -728,7 +816,7 @@ public partial class ArenaAudioSystem : Node3D
|
|||
SilenceLoopSlot(0);
|
||||
}
|
||||
|
||||
// Slots 1..4: nearest 4 live rivals/spectators within 160m (with 12m hysteresis)
|
||||
// Slots 1..4: nearest 4 live rivals/spectators/burning-pods within 160m (with 12m hysteresis)
|
||||
_loopCandidates.Clear();
|
||||
float maxDistSq = MaxLoopDistance * MaxLoopDistance;
|
||||
|
||||
|
|
@ -736,7 +824,7 @@ public partial class ArenaAudioSystem : Node3D
|
|||
for (int i = 0; i < contenders.Count; i++)
|
||||
{
|
||||
var c = contenders[i];
|
||||
if (c.Id == localId || !c.Alive || !session.IsContenderVisible(c.Id)) continue;
|
||||
if (c.Id == localId || !c.IsGroundedActive || !session.IsContenderVisible(c.Id)) continue;
|
||||
var (cPos, _, cVel) = session.GetInterpolatedContenderPose(c.Id, alpha);
|
||||
Vector3 pos = new(cPos.X, cPos.Y, cPos.Z);
|
||||
float distSq = pos.DistanceSquaredTo(listenerPos);
|
||||
|
|
@ -773,6 +861,24 @@ public partial class ArenaAudioSystem : Node3D
|
|||
_loopCandidates.Add(new LoopCandidate(false, s.Id, clipKey, pos, scoreDistSq, volDb - 4.0f, pitch));
|
||||
}
|
||||
|
||||
var activePods = session.ActivePods;
|
||||
for (int i = 0; i < activePods.Count; i++)
|
||||
{
|
||||
var pod = activePods[i];
|
||||
if (pod.Phase != OrbitalPodPhase.RetroBurn || (pod.PodKind == OrbitalPodKind.Contender && pod.ContenderId == localId))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
Vector3 pos = new(pod.X, pod.Y, pod.Z);
|
||||
float distSq = pos.DistanceSquaredTo(listenerPos);
|
||||
if (distSq > maxDistSq) continue;
|
||||
int candId = 100000 + pod.PodId;
|
||||
float scoreDistSq = IsHeldInRemoteLoopSlots(false, candId)
|
||||
? MathF.Max(0f, distSq - LoopHysteresisMeters * LoopHysteresisMeters)
|
||||
: distSq;
|
||||
_loopCandidates.Add(new LoopCandidate(false, candId, "pod_retro_burn", pos, scoreDistSq, -4.5f, 1.0f));
|
||||
}
|
||||
|
||||
_loopCandidates.Sort((a, b) => a.DistSq.CompareTo(b.DistSq));
|
||||
int assigned = Math.Min(LoopVoiceCount - 1, _loopCandidates.Count);
|
||||
for (int i = 0; i < assigned; i++)
|
||||
|
|
|
|||
Loading…
Reference in a new issue