- Update event catalog to include new decision intents for civilization founding - Implement soft duel yield mechanics in InterestDirector for combat interactions - Adjust scoring weights for soft duels and variety valve timings - Refactor event reasoning to improve spell casting labels and decision handling - Increment version to 0.28.33 in mod.json
50 lines
1.8 KiB
C#
50 lines
1.8 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)
|
|
{
|
|
string template = LabelTemplate ?? "";
|
|
if (template.IndexOf("casts {id}", System.StringComparison.OrdinalIgnoreCase) >= 0
|
|
|| template.IndexOf("casts {ID}", System.StringComparison.OrdinalIgnoreCase) >= 0)
|
|
{
|
|
string an = EventFeedUtil.SafeName(a);
|
|
string obj = EventReason.SpellCastObject(Id);
|
|
return (string.IsNullOrEmpty(an) ? "Someone" : an) + " casts " + obj;
|
|
}
|
|
|
|
return EventReason.Apply(LabelTemplate, a, b, Id);
|
|
}
|
|
|
|
public string MakeLabel(string a, string b)
|
|
{
|
|
string template = string.IsNullOrEmpty(LabelTemplate) ? "{id}" : LabelTemplate;
|
|
if (template.IndexOf("casts {id}", System.StringComparison.OrdinalIgnoreCase) >= 0)
|
|
{
|
|
string an = string.IsNullOrEmpty(a) ? "Someone" : a;
|
|
return an + " casts " + EventReason.SpellCastObject(Id);
|
|
}
|
|
|
|
string displayId = string.IsNullOrEmpty(Id) ? "" : EventReason.HumanizeId(Id);
|
|
return template
|
|
.Replace("{id}", displayId)
|
|
.Replace("{a}", a ?? "")
|
|
.Replace("{b}", b ?? "");
|
|
}
|
|
}
|