diff --git a/S1API/Entities/NPCPrefabBuilder.cs b/S1API/Entities/NPCPrefabBuilder.cs index 64d2003..e344177 100644 --- a/S1API/Entities/NPCPrefabBuilder.cs +++ b/S1API/Entities/NPCPrefabBuilder.cs @@ -867,7 +867,7 @@ private void PrecreateActionsForSpecs(List specs) var mgr = EnsureScheduleManager(); - int walkTo = 0, stayInBuilding = 0, locationDialogue = 0, locationBasedAction = 0, useVending = 0, driveToCarPark = 0, dealSignal = 0, useATM = 0; + int walkTo = 0, stayInBuilding = 0, locationDialogue = 0, locationBasedAction = 0, useVending = 0, driveToCarPark = 0, dealSignal = 0, useATM = 0, sit = 0; bool requiresSmokeBreak = false, requiresGraffiti = false, requiresDrinking = false, requiresHoldItem = false; for (int i = 0; i < specs.Count; i++) { @@ -898,6 +898,7 @@ private void PrecreateActionsForSpecs(List specs) else if (s is DriveToCarParkSpec) driveToCarPark++; else if (s is EnsureDealSignalSpec) dealSignal = Math.Max(dealSignal, 1); else if (s is UseATMSpec) useATM++; + else if (s is SitSpec) sit++; } if (requiresSmokeBreak) @@ -937,6 +938,7 @@ private void PrecreateActionsForSpecs(List specs) EnsurePrefabAction(useVending, "UseVending"); EnsurePrefabAction(driveToCarPark, "DriveToCarPark"); EnsurePrefabAction(useATM, "UseATM"); + EnsurePrefabAction(sit, "Sit"); } private void EnsurePrefabAction(int count, string namePrefix) where T : S1NPCsSchedules.NPCAction diff --git a/S1API/Entities/Schedule/ActionSpecs/SitSpec.cs b/S1API/Entities/Schedule/ActionSpecs/SitSpec.cs index ae7897c..b1ae871 100644 --- a/S1API/Entities/Schedule/ActionSpecs/SitSpec.cs +++ b/S1API/Entities/Schedule/ActionSpecs/SitSpec.cs @@ -26,10 +26,16 @@ namespace S1API.Entities.Schedule public sealed class SitSpec : IScheduleActionSpec { /// - /// Gets or sets the start time for this action, in minutes from midnight. + /// Gets or sets the start time for this action, in 24-hour time (e.g. 830 for 8:30 AM). /// public int StartTime { get; set; } + /// + /// Gets or sets the duration of the sit action in minutes. + /// If not set (0 or negative), defaults to the time remaining until the next scheduled action. + /// + public int DurationMinutes { get; set; } + /// /// Gets or sets the optional display name for this action. Defaults to "Sit". /// @@ -98,6 +104,7 @@ void IScheduleActionSpec.ApplyTo(NPCSchedule schedule) } action.WarpIfSkipped = WarpIfSkipped; + action.Duration = DurationMinutes > 0 ? DurationMinutes : 60; } private S1AvatarAnimation.AvatarSeatSet ResolveSeatSet(NPCSchedule schedule) diff --git a/S1API/Entities/Schedule/NPCScheduleBuilder.cs b/S1API/Entities/Schedule/NPCScheduleBuilder.cs index ac4f2b6..952c21b 100644 --- a/S1API/Entities/Schedule/NPCScheduleBuilder.cs +++ b/S1API/Entities/Schedule/NPCScheduleBuilder.cs @@ -64,7 +64,8 @@ public PrefabScheduleBuilder WalkTo(UnityEngine.Vector3 destination, int startTi /// Adds a seating action that moves the NPC to an available seat within the specified seat set. /// /// The GameObject name of the AvatarSeatSet to use. - /// The time when this action should start, in minutes from midnight (0-1439). + /// The time when this action should start, in 24-hour time (e.g. 830 for 8:30 AM). + /// Duration of the sit action in minutes. Defaults to 60. /// Whether the NPC should be warped to the seat if the action is skipped. Default is false. /// Optional custom name for this action; defaults to "Sit". /// This builder instance for method chaining. @@ -73,7 +74,7 @@ public PrefabScheduleBuilder WalkTo(UnityEngine.Vector3 destination, int startTi /// lookup scenarios (GUIDs, transform paths, direct references) instantiate manually and /// add it via . /// - public PrefabScheduleBuilder SitAtSeatSet(string seatSetName, int startTime, bool warpIfSkipped = false, string name = null) + public PrefabScheduleBuilder SitAtSeatSet(string seatSetName, int startTime, int durationMinutes = 60, bool warpIfSkipped = false, string name = null) { if (!string.IsNullOrEmpty(seatSetName)) { @@ -81,6 +82,7 @@ public PrefabScheduleBuilder SitAtSeatSet(string seatSetName, int startTime, boo { SeatSetName = seatSetName, StartTime = startTime, + DurationMinutes = durationMinutes, WarpIfSkipped = warpIfSkipped, Name = name });