public static bool SignalRelevantHandlersAndPreventVanillaThoughts(Pawn victim, PawnExecutionKind kind) { if (victim.RaceProps.Humanlike) { DeathBrutality brutality = DeathBrutality.HUMANE; if (!victim.guilt.IsGuilty) { switch (kind) { case PawnExecutionKind.GenericHumane: brutality = DeathBrutality.HUMANE; break; case PawnExecutionKind.GenericBrutal: brutality = DeathBrutality.BRUTAL; break; case PawnExecutionKind.OrganHarvesting: brutality = DeathBrutality.UNETHICAL; break; } } else { brutality = DeathBrutality.JUSTIFIED; } Handler_PawnExecuted.HandlePawnExecuted(victim, brutality); } // It's not like we have anything more to process or anything, baka. return(false); }
private static void GenerateAndProcessNews(Pawn victim, DeathBrutality brutality) { /* * Note: * Due to Allow Tools giving out thoughts before the kill, * we have to add in an additional statement to account for the cases * as generated by Allow Tools. * Map mapOfOccurence = [Allow Tool Cases] ?? [Vanilla Cases]; * Even though vanilla cases are more common, placing them at the front * will result in rather clumsy code. See for yourself. */ Map mapOfOccurence = victim.Map ?? victim.Corpse.Map; if (mapOfOccurence == null) { return; } TaleNewsPawnDied executionNews = TaleNewsPawnDied.GenerateAsExecution(victim, brutality); foreach (Pawn other in PawnsFinder.AllMapsCaravansAndTravelingTransportPods_Alive_FreeColonistsAndPrisoners) { if (other.Map == mapOfOccurence) { other.GetNewsKnowledgeTracker().KnowNews(executionNews, WitnessShockGrade.UNDEFINED); } } }
private static void GenerateAndProcessNews(Pawn victim, DeathBrutality brutality) { //TaleNewsPawnDied executionNews = TaleNewsPawnDied.GenerateAsExecution(victim, brutality); TaleNewsPawnDied executionNews = new TaleNewsPawnDied(victim, brutality); foreach (Pawn other in PawnsFinder.AllMapsCaravansAndTravelingTransportPods_Alive_FreeColonistsAndPrisoners) { if (other.IsInSameMapOrCaravan(victim)) { other.GetNewsKnowledgeTracker().KnowNews(executionNews); } } }
public static TaleNewsPawnDied GenerateAsExecution(Pawn victim, DeathBrutality brutality) { return(new TaleNewsPawnDied(victim, brutality)); }
public TaleNewsPawnDied(Pawn victim, DeathBrutality brutality) : base(victim, InstigationInfo.NoInstigator) { methodOfDeath = DeathMethod.EXECUTION; }
/// <summary> /// Handles a pawn execution event. /// </summary> /// <param name="victim"></param> /// <param name="brutality"></param> public static void HandlePawnExecuted(Pawn victim, DeathBrutality brutality) { SendOutNotificationLetter(victim); GenerateAndProcessNews(victim, brutality); }