Add AI parent meetings after a class last lesson.

Class teachers rarely keep the homeroom; invited parents walk onto the map, opinions nudge, then parents leave OffCampus. No player schedule API.
This commit is contained in:
Leonid Pershin
2026-08-21 13:33:40 +03:00
parent a57e581f83
commit 3288287da9
22 changed files with 1138 additions and 18 deletions
+26 -2
View File
@@ -331,7 +331,8 @@ internal static class PresenceSystem
var bound = Duty.IsOtherStaff(person)
? slot.Kind != DaySlotKind.Outside
: slot.Kind == DaySlotKind.Lesson && lessons.Any(lesson => lesson.Period == slot.Index);
if (DirectorSummonSystem.IsSummoned(school, person.Id))
if (DirectorSummonSystem.IsSummoned(school, person.Id)
|| ParentMeetingSystem.IsInMeeting(school, person.Id))
{
bound = true;
}
@@ -352,9 +353,24 @@ internal static class PresenceSystem
return null;
}
if (activity.IsActive && ActivitySystem.IsParentMeeting(activity.ActionId))
{
return null;
}
if (!presence.IsOnCampus)
{
intent = Intent.None;
if (ParentMeetingSystem.TryDutyRoom(school, person.Id, out var meetingArrive))
{
presence = PresenceStepper.StartWalk(
Presence.OffCampus,
walks,
meetingArrive,
headingHome: false);
return null;
}
if (plan.AppearAt is { } appear && now >= appear && (plan.WalkHomeAt is null || now < plan.WalkHomeAt))
{
var dest = plan.FirstRoom ?? Duty.RoomAt(
@@ -379,7 +395,10 @@ internal static class PresenceSystem
return null;
}
if (plan.WalkHomeAt is { } leave && now >= leave && !DirectorSummonSystem.IsSummoned(school, person.Id))
if (plan.WalkHomeAt is { } leave
&& now >= leave
&& !DirectorSummonSystem.IsSummoned(school, person.Id)
&& !ParentMeetingSystem.IsInMeeting(school, person.Id))
{
activity = PersonActivity.Idle;
intent = Intent.None;
@@ -399,6 +418,11 @@ internal static class PresenceSystem
duty = summonRoom;
bound = true;
}
else if (ParentMeetingSystem.TryDutyRoom(school, person.Id, out var meetingRoom))
{
duty = meetingRoom;
bound = true;
}
if (duty is null)
{