worldbox-observer-mod/IdleSpectator/Narrative/WorldCriticalPolicy.cs
DazedAnon 12e2ba0d01 feat(narrative): refine camera and narrative handling for civilized terminology
- Implement checks for civilized terminology in camera focus events
- Update event handling to suppress inappropriate pack language for civilized characters
- Enhance narrative presentation to differentiate between family and pack language
- Introduce new scenarios to validate significance of beats and relationships
- Improve documentation to clarify narrative structure and event significance
2026-07-24 14:06:23 -05:00

68 lines
2 KiB
C#

using System;
using UnityEngine;
namespace IdleSpectator;
/// <summary>
/// Typed camera/interrupt gate for events important enough to leave the MC orbit.
/// A large numeric score is deliberately insufficient: grief, duels, and other personal
/// outcomes can be intense without becoming a world-scale cutaway.
/// </summary>
public static class WorldCriticalPolicy
{
public static bool IsWorldCritical(InterestCandidate candidate)
{
if (candidate == null)
{
return false;
}
if (candidate.Completion == InterestCompletionKind.EarthquakeActive
|| candidate.Completion == InterestCompletionKind.StatusOutbreak)
{
return true;
}
if (candidate.Completion == InterestCompletionKind.WarFront)
{
int sideA = Mathf.Max(0, candidate.CombatSideACount);
int sideB = Mathf.Max(0, candidate.CombatSideBCount);
int participants = Mathf.Max(
candidate.ParticipantCount,
sideA + sideB);
int minimum = Mathf.Max(2, InterestScoringConfig.Story.crisisWarParticipantMin);
return sideA > 0 && sideB > 0 && participants >= minimum;
}
if (!IsTypedDisaster(candidate))
{
return false;
}
float minimumStrength = Mathf.Max(
1f,
InterestScoringConfig.Story.crisisDisasterStrengthMin);
return candidate.EventStrength >= minimumStrength;
}
public static bool IsTypedDisaster(InterestCandidate candidate)
{
if (candidate == null)
{
return false;
}
if (string.Equals(
candidate.Category,
"Disaster",
StringComparison.OrdinalIgnoreCase))
{
return true;
}
string asset = (candidate.AssetId ?? "").Trim();
return !string.IsNullOrEmpty(asset)
&& (EventCatalog.Disaster.IsLiveOrAuthored(asset)
|| EventCatalog.WorldLog.IsDisasterCategory(asset));
}
}