コード例 #1
0
        /// <summary>
        /// Attempts to give the killer their appropriate excitement (or disappointment). Aborts if there is no killer.
        /// </summary>
        /// <param name="recipient"></param>
        private void TryProcessKillerHigh(Pawn recipient)
        {
            // Killer != null => DamageInfo != null
            if (Killer != null)
            {
                // Currently you can't really kill yourself.
                // That would be something interesting, but we don't do that here.
                if (recipient == Killer)
                {
                    // IDK, is this something we can consider checking?
                    if (KillingBlowDamageDef.ExternalViolenceFor(Victim))
                    {
                        // Why this check tho
                        if (recipient.story != null)
                        {
                            // Bloodlust thoughts for Bloodlust guys, currently only for human victims
                            // We can expand upon this, and add in witnessed death (animals) with bloodlust
                            if (Victim.RaceProps.Humanlike)
                            {
                                // Try to add Bloodlust thoughts; will be auto-rejected if recipient does not have Bloodlust
                                new IndividualThoughtToAdd(ThoughtDefOf.KilledHumanlikeBloodlust, recipient).Add();

                                // Try to add Defeated Hostile Leader thoughts
                                if (Victim.HostileTo(Killer) && Victim.Faction != null && PawnUtility.IsFactionLeader(Victim) && Victim.Faction.HostileTo(Killer.Faction))
                                {
                                    new IndividualThoughtToAdd(ThoughtDefOf.DefeatedHostileFactionLeader, Killer, Victim).Add();
                                }
                            }
                        }
                    }
                }
            }
        }
コード例 #2
0
        private void HandleExcitementOfKiller(Pawn recipient)
        {
            // Killer != null => DamageInfo != null
            // The obligatory .Value is extremely triggering.
            if (Killer != null)
            {
                if (Killer == PrimaryVictim)
                {
                    // We don't handle suicide cases.
                    return;
                }

                if (recipient == Killer && KillingBlowDamageDef.ExternalViolenceFor(Victim))
                {
                    // Confirmed NewsReceipient is Killer

                    // IsCapableOfThought has already been called.
                    // NewsReceipient is definitely capable of thought.

                    // Why this check tho
                    if (recipient.story != null)
                    {
                        // Bloodlust thoughts for Bloodlust guys, currently only for human victims
                        // We can expand upon this, and add in witnessed death (animals) with bloodlust
                        if (Victim.RaceProps.Humanlike)
                        {
                            // Try to add Bloodlust thoughts; will be auto-rejected if recipient does not have Bloodlust
                            new IndividualThoughtToAdd(ThoughtDefOf.KilledHumanlikeBloodlust, recipient).Add();

                            // Try to add Defeated Hostile Leader thoughts
                            if (Victim.HostileTo(Killer) && Victim.Faction != null && PawnUtility.IsFactionLeader(Victim) && Victim.Faction.HostileTo(Killer.Faction))
                            {
                                new IndividualThoughtToAdd(ThoughtDefOf.DefeatedHostileFactionLeader, Killer, Victim).Add();
                            }
                        }
                    }
                }
            }
        }