private static void AppendThoughts_ForHumanlike(Pawn victim, DamageInfo?dinfo, PawnDiedOrDownedThoughtsKind thoughtsKind, List <IndividualThoughtToAdd> outIndividualThoughts, List <ThoughtDef> outAllColonistsThoughts) { bool flag = dinfo.HasValue && dinfo.Value.Def.execution; bool flag2 = victim.IsPrisonerOfColony && !victim.guilt.IsGuilty && !victim.InAggroMentalState; if (dinfo.HasValue && dinfo.Value.Def.externalViolence && dinfo.Value.Instigator != null && dinfo.Value.Instigator is Pawn) { Pawn pawn = (Pawn)dinfo.Value.Instigator; if (!pawn.Dead && pawn.needs.mood != null && pawn.story != null && pawn != victim) { if (thoughtsKind == PawnDiedOrDownedThoughtsKind.Died) { outIndividualThoughts.Add(new IndividualThoughtToAdd(ThoughtDefOf.KilledHumanlikeBloodlust, pawn, null, 1f, 1f)); } if (thoughtsKind == PawnDiedOrDownedThoughtsKind.Died && victim.HostileTo(pawn)) { if (victim.Faction != null && PawnUtility.IsFactionLeader(victim) && victim.Faction.HostileTo(pawn.Faction)) { outIndividualThoughts.Add(new IndividualThoughtToAdd(ThoughtDefOf.DefeatedHostileFactionLeader, pawn, victim, 1f, 1f)); } if (victim.kindDef.combatPower > 250.0) { outIndividualThoughts.Add(new IndividualThoughtToAdd(ThoughtDefOf.DefeatedMajorEnemy, pawn, victim, 1f, 1f)); } } } } if (thoughtsKind == PawnDiedOrDownedThoughtsKind.Died && !flag) { foreach (Pawn allMapsCaravansAndTravelingTransportPod in PawnsFinder.AllMapsCaravansAndTravelingTransportPods) { if (allMapsCaravansAndTravelingTransportPod != victim && allMapsCaravansAndTravelingTransportPod.needs.mood != null && (allMapsCaravansAndTravelingTransportPod.MentalStateDef != MentalStateDefOf.SocialFighting || ((MentalState_SocialFighting)allMapsCaravansAndTravelingTransportPod.MentalState).otherPawn != victim)) { if (PawnDiedOrDownedThoughtsUtility.Witnessed(allMapsCaravansAndTravelingTransportPod, victim)) { if (allMapsCaravansAndTravelingTransportPod.Faction == victim.Faction) { outIndividualThoughts.Add(new IndividualThoughtToAdd(ThoughtDefOf.WitnessedDeathAlly, allMapsCaravansAndTravelingTransportPod, null, 1f, 1f)); } else if (victim.Faction == null || !victim.Faction.HostileTo(allMapsCaravansAndTravelingTransportPod.Faction)) { outIndividualThoughts.Add(new IndividualThoughtToAdd(ThoughtDefOf.WitnessedDeathNonAlly, allMapsCaravansAndTravelingTransportPod, null, 1f, 1f)); } if (allMapsCaravansAndTravelingTransportPod.relations.FamilyByBlood.Contains(victim)) { outIndividualThoughts.Add(new IndividualThoughtToAdd(ThoughtDefOf.WitnessedDeathFamily, allMapsCaravansAndTravelingTransportPod, null, 1f, 1f)); } outIndividualThoughts.Add(new IndividualThoughtToAdd(ThoughtDefOf.WitnessedDeathBloodlust, allMapsCaravansAndTravelingTransportPod, null, 1f, 1f)); } else if (victim.Faction == Faction.OfPlayer && victim.Faction == allMapsCaravansAndTravelingTransportPod.Faction && victim.HostFaction != allMapsCaravansAndTravelingTransportPod.Faction) { outIndividualThoughts.Add(new IndividualThoughtToAdd(ThoughtDefOf.KnowColonistDied, allMapsCaravansAndTravelingTransportPod, null, 1f, 1f)); } if (flag2 && allMapsCaravansAndTravelingTransportPod.Faction == Faction.OfPlayer && !allMapsCaravansAndTravelingTransportPod.IsPrisoner) { outIndividualThoughts.Add(new IndividualThoughtToAdd(ThoughtDefOf.KnowPrisonerDiedInnocent, allMapsCaravansAndTravelingTransportPod, null, 1f, 1f)); } } } } if (thoughtsKind == PawnDiedOrDownedThoughtsKind.Banished && victim.IsColonist) { outAllColonistsThoughts.Add(ThoughtDefOf.ColonistBanished); } if (thoughtsKind == PawnDiedOrDownedThoughtsKind.BanishedToDie) { if (victim.IsColonist) { outAllColonistsThoughts.Add(ThoughtDefOf.ColonistBanishedToDie); } else if (victim.IsPrisonerOfColony) { outAllColonistsThoughts.Add(ThoughtDefOf.PrisonerBanishedToDie); } } }