Implement evidence-backed VR02 Rocketship flight and ownership
This commit is contained in:
1 parent
312efccb77
commit
e77add5fdf
50 files changed
+4326
-66
No files matched your search
@@ -77,15 +77,17 @@ public sealed class SceneInteractions
|
||||
&& id > 0 && id < itemStates.Length && itemStates[id] != 0) actor.Active = actor.Visible = false;
|
||||
}
|
||||
|
||||
public void Update(Vector3 activePlayerRoot, float playerRadius = 60)
|
||||
public void Update(Vector3 activePlayerRoot, float playerRadius = 60, DirectorActor? vehicle = null)
|
||||
{
|
||||
if (!float.IsFinite(activePlayerRoot.X + activePlayerRoot.Y + activePlayerRoot.Z)
|
||||
|| !float.IsFinite(playerRadius) || playerRadius < 0) throw new ArgumentOutOfRangeException(nameof(activePlayerRoot));
|
||||
if (!director.Controlled) return;
|
||||
bool VehicleControlled()=>vehicle is{Kind:"3ROC"}&&director.AuthoredControlledTag==vehicle.Tag;
|
||||
bool Controlled()=>director.Controlled||VehicleControlled();
|
||||
if (!Controlled()) return;
|
||||
HideCollected();
|
||||
foreach (var actor in director.Actors)
|
||||
{
|
||||
if (!director.Controlled) break;
|
||||
if (!Controlled()) break;
|
||||
if (actor.SourceGam is not { } source || source.Kind is not ("3PIC" or "3TRO" or "LOAD" or "3CAR")) continue;
|
||||
// C3DFriend update41B972..988 calls the talk dispatcher every update
|
||||
// in state0, even when a prior contact found no matching TalkTrigger.
|
||||
@@ -95,7 +97,10 @@ public sealed class SceneInteractions
|
||||
if (!director.Controlled) break;
|
||||
}
|
||||
// Carl InitObject413E2F..45 sets radius100 and support factor0.75.
|
||||
var radius = playerRadius + (source.Kind == "3TRO" ? 20 : source.Kind == "3CAR" ? 100 : source.Number("Radius"));
|
||||
//435D08 pickups require the raw controlled ship.457EE6 LOAD requires
|
||||
//the real Jimmy passenger; the coincident actors keep distinct radii.
|
||||
var contactRadius=source.Kind=="3PIC"&&VehicleControlled()?50:playerRadius;
|
||||
var radius = contactRadius + (source.Kind == "3TRO" ? 20 : source.Kind == "3CAR" ? 100 : source.Number("Radius"));
|
||||
var overlaps = actor.Active && (source.Kind!="3TRO" || actor.BodyEnabled)
|
||||
&& OriginalBodySupport.QuickMagnitude(activePlayerRoot - actor.Position) < radius;
|
||||
if (!overlaps) { contacts.Remove(source.Offset); continue; }
|
||||
|
||||
Reference in new issue
Block a user