public static void HandlePawnSold_ByTrade(Pawn victim, Pawn negotiator) { TaleNewsPawnSold news = new TaleNewsPawnSold(victim, (InstigationInfo)negotiator); SendOutNotificationLetter(victim); DistributeNews(victim, news, negotiator.Map); }
public static void HandlePawnSold_ByGiftingViaPods(Pawn victim, Map mapOfSender) { TaleNewsPawnSold news = new TaleNewsPawnSold(victim); SendOutNotificationLetter(victim); DistributeNews(victim, news, mapOfSender); }
/// <summary> /// A change in code structure results in this slight variation from the usual. /// </summary> /// <param name="salesNews">The TaleNews object for this sales.</param> /// <param name="mapOfOccurence">The Map where the sales occured/was initiated.</param> private static void DistributeNews(Pawn victim, TaleNewsPawnSold salesNews, Map mapOfOccurence) { foreach (Pawn other in PawnsFinder.AllMapsCaravansAndTravelingTransportPods_Alive_FreeColonistsAndPrisoners) { if (other.IsInSameMapOrCaravan(victim)) { other.GetNewsKnowledgeTracker().KnowNews(salesNews); } } }
/// <summary> /// A change in code structure results in this slight variation from the usual. /// </summary> /// <param name="victim"></param> /// <param name="salesNews">The TaleNews object for this sales.</param> private static void DistributeNews(Pawn victim, TaleNewsPawnSold salesNews) { foreach (var other in PawnsFinder.AllMapsCaravansAndTravelingTransportPods_Alive_FreeColonistsAndPrisoners) { if (other.IsNearEnough(victim)) { other.GetNewsKnowledgeTracker()?.KnowNews(salesNews); } } }
public static void ApplyPsychologyThoughts(TaleNewsPawnSold __instance, Pawn recipient) { if (recipient.IsCapableOfThought()) { Pawn primaryVictim = __instance.PrimaryVictim; if (primaryVictim.RaceProps.Humanlike) { // Some prisoner was sold if (primaryVictim.IsPrisonerOfColony) { recipient.needs.mood.thoughts.memories.TryGainMemory(Psycho_ThoughtDefOf.KnowPrisonerSoldBleedingHeart, __instance.Instigator); } } } }
/// <summary> /// A change in code structure results in this slight variation from the usual. /// </summary> /// <param name="salesNews">The TaleNews object for this sales.</param> /// <param name="mapOfOccurence">The Map where the sales occured/was initiated.</param> private static void DistributeNews(TaleNewsPawnSold salesNews, Map mapOfOccurence) { if (mapOfOccurence == null) { return; } foreach (Pawn other in PawnsFinder.AllMapsCaravansAndTravelingTransportPods_Alive_FreeColonistsAndPrisoners) { if (other.Map == mapOfOccurence) { other.GetNewsKnowledgeTracker().KnowNews(salesNews, WitnessShockGrade.UNDEFINED); } } }