more improvements on journey and sentinel

This commit is contained in:
Nilton Constantino 2026-06-23 09:52:17 +01:00
parent 1926420695
commit 3eece75820
No known key found for this signature in database
16 changed files with 35095 additions and 14761 deletions

View File

@ -78,6 +78,7 @@ MonoBehaviour:
m_EditorClassIdentifier: Assembly-CSharp::Intrepid.Gameplay.Journey.JourneyManager
subscriptionId: 5df34d67e6e44f3999042072ea652750
curtainType: {fileID: 11400000, guid: bc9a28f3d7c64606a8b88c91b94e8805, type: 2}
actionBeltManager: {fileID: 11400000, guid: 24d31645b4d544dd69b6ada8858ba50e, type: 2}
journeyService: {fileID: 11400000, guid: 53f1211059b4847a49bde1be4b8d166c, type: 2}
backStageService: {fileID: 11400000, guid: c58e40006278948db8d8b1f3477f83ea, type: 2}
isRunningTest: 0

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -69,7 +69,7 @@ namespace Intrepid.Core.Entities
return !ShouldBeTriggered(entities, physicsTags);
}
public abstract void DeployEntity(Vector3 position);
public abstract void DeployEntity(Vector3 position, Vector2 direction);
public abstract void RetreatEntity();
}
}

View File

@ -65,15 +65,18 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel
if (CurrentState == SentinelStateType.Fall) return;
StateMachine.ChangeState(SentinelStateType.Fall);
});
Subscribe<ChangeStageStartEvent>(e =>
Subscribe<ChangeStageStartEvent>(_ =>
{
Entity.RetreatEntity();
IsEnabled = false;
});
Subscribe<ChangeStageTouchedEvent>(_ =>
{
ChangeState(SentinelStateType.Nop);
});
Subscribe<StageDispatchDeploymentPointEvent>(e =>
{
Entity.DeployEntity(e.DeploymentPoint);
Entity.DeployEntity(e.DeploymentPoint, e.DeploymentDirection);
CameraSystem.Instance.ForceFocusOn(e.DeploymentPoint);
IsEnabled = true;
Proxy.Instance.EventBus.Raise(new EmitFloorDetectionEvent

View File

@ -38,9 +38,10 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel
public GroundProfiles CurrentGroundProfiles => MotorTopDown.CurrentGroundProfiles;
public FloorDetection FloorDetection => floorDetection;
public override void DeployEntity(Vector3 position)
public override void DeployEntity(Vector3 position, Vector2 direction)
{
UnityRigidbody.position = position;
ChangeOrientation(direction);
UnityRigidbody.isKinematic = false;
CapsuleCollider.enabled = true;

View File

@ -16,12 +16,16 @@ namespace Intrepid.Gameplay.Entities.Player.Sentinel.StateMachine.States
protected override void RunOnEnter(ParameterStore ps)
{
EndCadence();
Brain.Controls.ResetDash();
Brain.InputResolver.Sentinel.Clear();
Brain.Entity.ModelAnimation.Pause();
Brain.Entity.DesiredVelocity = Vector2.zero;
}
protected override void RunOnExit()
{
Brain.Entity.ModelAnimation.Unpause();
}
public override void RunOnUpdate()

View File

@ -3,6 +3,8 @@ using System.Collections;
using Intrepid.Core.Camera;
using Intrepid.Diagnostics;
using Intrepid.GameManagers;
using Intrepid.Gameplay.Entities.Player.ActionBelt.Events;
using Intrepid.Gameplay.Entities.Player.Tags;
using Intrepid.Gameplay.Journey.Messages;
using Intrepid.Gameplay.Journey.Messages.Events;
using Intrepid.Integration.Input;
@ -20,6 +22,7 @@ namespace Intrepid.Gameplay.Journey
private const string Id = "JourneyManager";
[GroupConfigurations, SerializeField] private CurtainTypeTag curtainType;
[GroupInjections, SerializeField] private ActionBeltManagerTag actionBeltManager;
[GroupInjections, SerializeField] private JourneyService journeyService;
[GroupInjections, SerializeField] private BackStageService backStageService;
#if UNITY_EDITOR
@ -39,6 +42,7 @@ namespace Intrepid.Gameplay.Journey
private IBackStageWindowExecution CallbackProcessors { get; set; }
private string DestinyEndpoint { get; set; }
private InputSchema LastInputSchema { get; set; } = InputSchema.None;
public ICurtainProgress OpenCurtainProgress { get; set; }
public bool IsProcessFinished => StageStateMachine.IsLoadingFinished && !CameraSystem.Instance.IsCameraBlending;
@ -68,6 +72,11 @@ namespace Intrepid.Gameplay.Journey
private void Update()
{
BackStageService.UpdateCurtains();
if (OpenCurtainProgress?.IsFinished() ?? false)
{
OpenCurtainProgress = null;
AfterOpened();
}
}
protected override void OnTearDown()
@ -108,8 +117,7 @@ namespace Intrepid.Gameplay.Journey
{
DeploymentPoint = landing.position,
});
Proxy.Instance.CurtainStateMachine.RaiseCommand(CurtainCommandType.Open);
InputService.Instance.ChangeInputSchema(InputSchema.Sentinel);
OpenCurtainProgress = Proxy.Instance.CurtainStateMachine.RaiseCommand(CurtainCommandType.Open);
}
[GroupDebug, Button(ButtonSizes.Large, ButtonStyle.FoldoutButton)]
@ -148,7 +156,14 @@ namespace Intrepid.Gameplay.Journey
DestinyEndpoint = null;
CallbackProcessors?.AfterOpened();
Proxy.Instance.EventBus.Raise(new ChangeStageEndEvent());
InputService.Instance.ChangeInputSchema(LastInputSchema);
var lastInputSchema = LastInputSchema == InputSchema.None
? InputSchema.Sentinel
: LastInputSchema;
InputService.Instance.ChangeInputSchema(lastInputSchema);
Proxy.Instance.EventBus.Raise(new ActionBeltEnableEvent
{
ActionBeltManger = actionBeltManager,
});
LastInputSchema = InputSchema.None;
}
@ -173,6 +188,11 @@ namespace Intrepid.Gameplay.Journey
LastInputSchema = InputService.Instance.CurrentInputSchema;
InputService.Instance.ChangeInputSchema(InputSchema.None);
CallbackProcessors?.BeforeClosing();
Proxy.Instance.EventBus.Raise(new ChangeStageTouchedEvent());
Proxy.Instance.EventBus.Raise(new ActionBeltDisableEvent
{
ActionBeltManger = actionBeltManager,
});
}
}
}

View File

@ -1,4 +1,5 @@
using System;
using UnityEngine;
namespace Intrepid.Gameplay.Journey
{
@ -17,6 +18,25 @@ namespace Intrepid.Gameplay.Journey
West = 3
}
public static class JSocketFaceUtils
{
private static readonly Vector2 North = new(0, -1);
private static readonly Vector2 South = new(0, 1);
private static readonly Vector2 East = new(-1, 0);
private static readonly Vector2 West = new(1, 0);
public static Vector2 DeploymentDirection(JSocketFace socketFace) => socketFace switch
{
JSocketFace.North => North,
JSocketFace.South => South,
JSocketFace.East => East,
JSocketFace.West => West,
_ => throw new ArgumentOutOfRangeException()
};
}
public enum JConnectionDirectionality
{
Bidirectional = 0,

View File

@ -0,0 +1,8 @@
using Intrepid.SimpleEvents;
namespace Intrepid.Gameplay.Journey.Messages.Events
{
public class ChangeStageTouchedEvent : IEventBase
{
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: d2914d429ed54d52bb3cfcf0e7d9b847
timeCreated: 1782204481

View File

@ -6,5 +6,6 @@ namespace Intrepid.Gameplay.Journey.Messages.Events
public class StageDispatchDeploymentPointEvent : IEventBase
{
public Vector3 DeploymentPoint { get; set; }
public Vector2 DeploymentDirection { get; set; }
}
}

View File

@ -9,6 +9,7 @@ namespace Intrepid.Gameplay.Journey.Stages.Sockets
[GroupInjections, SerializeField] private Transform deploymentPoint;
[GroupInjections, SerializeField] private StageSocketChangeTrigger changeTrigger;
[GroupConfigurations, SerializeField] private string endpointId;
[GroupConfigurations, SerializeField] private JSocketFace socketFace;
public string StageId
{
@ -21,6 +22,7 @@ namespace Intrepid.Gameplay.Journey.Stages.Sockets
set => endpointId = value;
}
public Vector3 DeploymentPoint => deploymentPoint.position;
public Vector2 DeploymentDirection => JSocketFaceUtils.DeploymentDirection(socketFace);
private void OnValidate()
{

View File

@ -35,6 +35,7 @@ namespace Intrepid.Gameplay.Journey.Stages
Proxy.Instance.EventBus.Raise(new StageDispatchDeploymentPointEvent
{
DeploymentPoint = stageSocket.DeploymentPoint,
DeploymentDirection = stageSocket.DeploymentDirection,
});
return;
}

View File

@ -1,10 +1,7 @@
using Intrepid.Core.Camera.Events;
using Intrepid.GameManagers;
using Intrepid.Gameplay.Entities.Player.ActionBelt.Events;
using Intrepid.Gameplay.Entities.Player.Sentinel;
using Intrepid.Gameplay.Entities.Player.Tags;
using Intrepid.Utilities;
using Sirenix.OdinInspector;
using UnityEngine;
namespace Temporary
@ -12,33 +9,13 @@ namespace Temporary
public class TempBoot : MonoBehaviour
{
[GroupInjections, SerializeField] private SentinelCameraManager sentinelCameraManager;
[GroupConfigurations, SerializeField] private ActionBeltManagerTag _amTag;
private void Start()
{
EnableActionManager(_amTag);
Proxy.Instance.EventBus.Raise(new CameraStreamChangeEvent
{
CameraStreamStack = sentinelCameraManager.CameraStreamStack,
});
}
[GroupDebug, Button(ButtonSizes.Medium, ButtonStyle.FoldoutButton)]
private void EnableActionManager(ActionBeltManagerTag amTag)
{
Proxy.Instance.EventBus.Raise(new ActionBeltEnableEvent
{
ActionBeltManger = amTag ?? _amTag,
});
}
[GroupDebug, Button(ButtonSizes.Medium, ButtonStyle.FoldoutButton)]
private void DisableActionManager(ActionBeltManagerTag amTag)
{
Proxy.Instance.EventBus.Raise(new ActionBeltDisableEvent
{
ActionBeltManger = amTag ?? _amTag,
});
}
}
}