- Introduce new narrative probes for episode grammar, ensemble balance, and prose redundancy - Implement narrative presentation coverage tracking for better event visibility - Update harness scenarios to include new narrative ingestion and persistence tests - Refactor event emission to include narrative development IDs and presentations - Expand InterestCandidate to support narrative presentation models and roles
80 lines
2.3 KiB
C#
80 lines
2.3 KiB
C#
using HarmonyLib;
|
|
|
|
namespace IdleSpectator;
|
|
|
|
/// <summary>
|
|
/// Feeds character History from kills, deaths, lovers, and best friends.
|
|
/// </summary>
|
|
[HarmonyPatch]
|
|
public static class ActorChroniclePatches
|
|
{
|
|
[HarmonyPatch(typeof(Actor), "newKillAction")]
|
|
[HarmonyPostfix]
|
|
public static void PostfixNewKill(Actor __instance, Actor pDeadUnit)
|
|
{
|
|
LifeSagaMemory.RecordKill(__instance, pDeadUnit);
|
|
Chronicle.NoteKill(__instance, pDeadUnit);
|
|
}
|
|
|
|
[HarmonyPatch(typeof(Actor), "die")]
|
|
[HarmonyPrefix]
|
|
public static void PrefixDie(Actor __instance, out Actor __state)
|
|
{
|
|
__state = null;
|
|
try
|
|
{
|
|
if (__instance == null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
// Capture living dossier before die() clears state - used by Fallen archive.
|
|
Chronicle.CaptureFinalDossier(__instance);
|
|
|
|
BaseSimObject attacker = __instance.attackedBy;
|
|
if (attacker != null && !attacker.isRekt() && attacker.isActor() && attacker != __instance)
|
|
{
|
|
__state = attacker.a;
|
|
}
|
|
}
|
|
catch
|
|
{
|
|
__state = null;
|
|
}
|
|
}
|
|
|
|
[HarmonyPatch(typeof(Actor), "die")]
|
|
[HarmonyPostfix]
|
|
public static void PostfixDie(Actor __instance, AttackType pType, bool pCountDeath, Actor __state)
|
|
{
|
|
if (!pCountDeath || __instance == null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
LifeSagaMemory.RecordDeath(__instance, __state, pType.ToString());
|
|
Chronicle.NoteDeath(__instance, pType, __state);
|
|
GraveMarkers.AddDeath(__instance);
|
|
}
|
|
|
|
[HarmonyPatch(typeof(Actor), nameof(Actor.becomeLoversWith))]
|
|
[HarmonyPostfix]
|
|
public static void PostfixLovers(Actor __instance, Actor pTarget)
|
|
{
|
|
LifeSagaMemory.RecordBondFormed(__instance, pTarget, "becomeLoversWith");
|
|
Chronicle.NoteLovers(__instance, pTarget);
|
|
}
|
|
|
|
[HarmonyPatch(typeof(Actor), nameof(Actor.setBestFriend))]
|
|
[HarmonyPostfix]
|
|
public static void PostfixBestFriend(Actor __instance, Actor pActor, bool pNew)
|
|
{
|
|
if (!pNew)
|
|
{
|
|
return;
|
|
}
|
|
|
|
LifeSagaMemory.RecordFriendFormed(__instance, pActor);
|
|
Chronicle.NoteBestFriends(__instance, pActor);
|
|
}
|
|
}
|