Implement Bubble controller, sprite and VR01 body behavior
This commit is contained in:
1 parent
9ea578492d
commit
1ae5f4251c
51 files changed
+2811
-54
No files matched your search
@@ -20,6 +20,7 @@ public sealed class PlayerSceneBinding : IDisposable
|
||||
director.GadgetReleaseRequested += Release;
|
||||
inventory.GadgetSelected += Selected;
|
||||
player.Invisible.EquippedChanged += InvisibleEquipped;
|
||||
player.DefaultGadgetRequested += DefaultGadget;
|
||||
Selected(inventory.SelectedGadget);
|
||||
}
|
||||
|
||||
@@ -27,8 +28,10 @@ public sealed class PlayerSceneBinding : IDisposable
|
||||
{
|
||||
var acceptsInput = director.Controlled || player.Noclip;
|
||||
player.Step(input, acceptsInput, director.ControlledTag != null);
|
||||
var rotation = director.FindActor(tag)?.Rotation ?? Vector3.Zero;
|
||||
director.SyncActor(tag, player.ActorRoot, rotation with { Y = player.Yaw });
|
||||
if (player.GadgetMode==0 && player.Grounded && director.FindActor(tag) is{} actor) actor.Animation="STOP";
|
||||
var rotation=director.FindActor(tag)?.Rotation ?? Vector3.Zero;
|
||||
director.SyncActor(tag,player.ActorRoot,player.TracksBubbleOrientation
|
||||
? new(player.Pitch,player.Yaw,player.Roll) : rotation with{Y=player.Yaw});
|
||||
return acceptsInput;
|
||||
}
|
||||
|
||||
@@ -36,6 +39,7 @@ public sealed class PlayerSceneBinding : IDisposable
|
||||
{
|
||||
if (!string.Equals(actor.Tag, tag, StringComparison.OrdinalIgnoreCase)) return;
|
||||
if (action == ScriptPreparation.StopMotion) player.PrepareForScript();
|
||||
else if (action == ScriptPreparation.FlattenOrientation) player.FlattenOrientation();
|
||||
else if (action == ScriptPreparation.ReleaseGadget)
|
||||
Release(actor);
|
||||
}
|
||||
@@ -45,12 +49,17 @@ public sealed class PlayerSceneBinding : IDisposable
|
||||
if (!string.Equals(actor.Tag, tag, StringComparison.OrdinalIgnoreCase)) return;
|
||||
//427FF0 switches raw mode, not display selection. A rejected Invisible
|
||||
//equip can leave display2 with raw mode-1; cleanup does not equip it.
|
||||
if (player.GadgetMode == 2 || inventory.SelectedGadget is -1 or 3)
|
||||
if (player.GadgetMode is 0 or 2 || inventory.SelectedGadget is -1 or 3)
|
||||
{ inventory.SelectGadget(-1); player.GadgetMode = -1; }
|
||||
else if (player.GadgetMode != -1) UnsupportedGadgetCleanups++;
|
||||
}
|
||||
|
||||
private void Selected(int item) => player.GadgetMode = GadgetScreen.EquippedMode(item);
|
||||
private void Selected(int item)
|
||||
{
|
||||
if (item==0 && director.FindActor(tag) is{} actor) player.SeedBubbleTilt(actor.Rotation);
|
||||
player.GadgetMode=GadgetScreen.EquippedMode(item);
|
||||
}
|
||||
private void DefaultGadget() => inventory.SelectGadget(-1);
|
||||
|
||||
private void InvisibleEquipped(bool equipped)
|
||||
{
|
||||
@@ -74,5 +83,6 @@ public sealed class PlayerSceneBinding : IDisposable
|
||||
director.GadgetReleaseRequested -= Release;
|
||||
inventory.GadgetSelected -= Selected;
|
||||
player.Invisible.EquippedChanged -= InvisibleEquipped;
|
||||
player.DefaultGadgetRequested -= DefaultGadget;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user