Example #1
0
        private static void GenerateAndProcessNews(Pawn victim)
        {
            // Definitely has potential here.
            if (!victim.RaceProps.Humanlike)
            {
                return;
            }

            // There is no certainty to say that the victim is dead;
            // Removing one of the two lungs will still trigger this.
            // Had better also check for its corpse.
            Map mapOfOccurence = victim.Map ?? victim.Corpse.Map;

            if (mapOfOccurence == null)
            {
                return;
            }

            TaleNewsPawnHarvested harvestNews = new TaleNewsPawnHarvested(victim);

            foreach (Pawn other in PawnsFinder.AllMapsCaravansAndTravelingTransportPods_Alive_FreeColonistsAndPrisoners)
            {
                if (other.Map == mapOfOccurence)
                {
                    other.GetNewsKnowledgeTracker().KnowNews(harvestNews, WitnessShockGrade.UNDEFINED);
                }
            }
        }
        private static void GenerateAndProcessNews(Pawn victim)
        {
            // Definitely has potential here.
            if (!victim.RaceProps.Humanlike)
            {
                return;
            }

            TaleNewsPawnHarvested harvestNews = new TaleNewsPawnHarvested(victim);

            foreach (Pawn other in PawnsFinder.AllMapsCaravansAndTravelingTransportPods_Alive_FreeColonistsAndPrisoners)
            {
                if (other.IsInSameMapOrCaravan(victim))
                {
                    other.GetNewsKnowledgeTracker().KnowNews(harvestNews);
                }
            }
        }
Example #3
0
        public static void ApplyPsychologyThoughts(TaleNewsPawnHarvested __instance, Pawn recipient)
        {
            Pawn primaryVictim = __instance.PrimaryVictim;

            if (recipient != primaryVictim)
            {
                // Not the same guy
                // Determine the correct Bleeding Heart thought to be given out
                if (primaryVictim.IsColonist)
                {
                    recipient.needs.mood.thoughts.memories.TryGainMemory(Psycho_ThoughtDefOf.KnowColonistOrganHarvestedBleedingHeart);
                }
                else if (primaryVictim.HostFaction == Faction.OfPlayer)
                {
                    recipient.needs.mood.thoughts.memories.TryGainMemory(Psycho_ThoughtDefOf.KnowGuestOrganHarvestedBleedingHeart);
                }
            }
        }