static void AddInteractionThoughts([NotNull] Pawn recipient, [NotNull] InteractionDef intDef, bool __result) { if (!__result) { return; } if ((recipient.IsFormerHuman() || recipient.GetSapienceState()?.StateDef == SapienceStateDefOf.Animalistic) && recipient.needs?.mood != null) { var memory = intDef.GetModExtension <InstinctEffector>()?.thought; //hacky, should come up with a better solution eventually if (memory == null) { return; } if (DebugLogUtils.ShouldLog(LogLevel.Messages)) { var msg = $"giving {recipient.Name} memory {memory.defName}"; Log.Message(msg); } //social thoughts to? recipient.TryGainMemory(memory); } }
static bool SubstituteInteraction(Pawn recipient, ref InteractionDef intDef, Pawn ___pawn) { var ext = intDef.GetModExtension <InteractionGroupExtension>(); InteractionDef alt = ext?.TryGetAlternativeFor(___pawn, recipient); if (alt != null) { intDef = alt; } return(true); }
static void AddInteractionThoughts([NotNull] Pawn recipient, [NotNull] InteractionDef intDef, bool __result) { if (!__result) { return; } if (recipient.IsSapientOrFeralFormerHuman()) { var memory = intDef.GetModExtension <InstinctEffector>()?.thought; //hacky, should come up with a better solution eventually if (memory == null) { return; } //social thoughts to? recipient.TryGainMemory(memory); } }
static void AddInteractionThoughts([NotNull] Pawn recipient, [NotNull] InteractionDef intDef, bool __result) { if (!__result) { return; } if ((recipient.IsFormerHuman() || recipient.GetSapienceState()?.StateDef == SapienceStateDefOf.Animalistic) && recipient.needs?.mood != null) { var memory = intDef.GetModExtension <InstinctEffector>()?.thought; //hacky, should come up with a better solution eventually if (memory == null) { return; } //social thoughts to? recipient.TryGainMemory(memory); } }
static bool SubstituteInteraction(Pawn recipient, ref InteractionDef intDef, Pawn ___pawn) { var ext = intDef.GetModExtension <InteractionGroupExtension>(); InteractionDef alt = ext?.TryGetAlternativeFor(___pawn, recipient); if (alt != null) { if (DebugLogUtils.ShouldLog(LogLevel.Messages)) { var msg = $"substituting {alt.defName} for {intDef.defName} on {___pawn.Name} -> {recipient.Name}"; Log.Message(msg); } intDef = alt; } return(true); }