worldbox-observer-mod/IdleSpectator/Events/DiscreteEventEntry.cs
DazedAnon 03729664be Implement building completion events and enhance earthquake handling.
- Update building event patches to include completion notifications
- Introduce earthquake event handling for ongoing seismic activity
- Modify event catalog to reflect changes in ambient interest settings
- Add new harness scenarios for library asset label validation
- Increment version to 0.28.17 in mod.json
2026-07-17 17:13:43 -05:00

35 lines
1.2 KiB
C#

namespace IdleSpectator;
/// <summary>
/// Shared catalog row for discrete / library-backed spectator events.
/// Lives in <c>Events/</c> with <see cref="EventReason"/> - catalogs own dials; director only ranks.
/// </summary>
public sealed class DiscreteEventEntry
{
public string Id = "";
public float EventStrength = 50f;
public string Category = "Event";
public bool CreatesInterest = true;
public string LabelTemplate = "{a}";
/// <summary>
/// Optional infinitive clause for decision-style reasons
/// (e.g. <c>change the kingdom's culture</c> → <c>{a} decides to …</c>).
/// </summary>
public string ActionPhrase = "";
public bool IsFallback;
public string MakeLabel(Actor a, Actor b = null)
{
return EventReason.Apply(LabelTemplate, a, b, Id);
}
public string MakeLabel(string a, string b)
{
string template = string.IsNullOrEmpty(LabelTemplate) ? "{id}" : LabelTemplate;
string displayId = string.IsNullOrEmpty(Id) ? "" : EventReason.HumanizeId(Id);
return template
.Replace("{id}", displayId)
.Replace("{a}", a ?? "")
.Replace("{b}", b ?? "");
}
}