private static void Postfix(MentalState_SocialFighting __instance)
 {
     if (Rand.Chance(0.1f))
     {
         TaleRecorder.RecordTale(VSIE_DefOf.VSIE_WeHadSocialFight, __instance.pawn, __instance.otherPawn);
         TaleRecorder.RecordTale(VSIE_DefOf.VSIE_WeHadSocialFight, __instance.otherPawn, __instance.pawn);
     }
 }
コード例 #2
0
        public static void WhoWon(MentalState_SocialFighting __instance, Pawn ___pawn, Pawn ___otherPawn)
        {
            float damage = ___pawn.health.summaryHealth.SummaryHealthPercent - ___otherPawn.health.summaryHealth.SummaryHealthPercent;

            if (damage > 0.05f)
            {
                ___pawn.needs.mood.thoughts.memories.TryGainMemory(ThoughtDefOfPsychology.WonFight, ___otherPawn);
            }
            else if (damage < -0.05f)
            {
                ___otherPawn.needs.mood.thoughts.memories.TryGainMemory(ThoughtDefOfPsychology.WonFight, ___pawn);
            }
        }
コード例 #3
0
        public static void PostEnd(MentalState_SocialFighting __instance)
        {
            if (!Settings.SocialFightEnabled)
            {
                return;
            }

            if (__instance?.pawn?.Spawned != true)
            {
                return;
            }

            if (!Mpe.Cache.SocialFight.Contains(__instance.pawn.GetUniqueLoadID()))
            {
                return;
            }

            Mpe.Cache.SocialFight.Remove(__instance.pawn.GetUniqueLoadID());
        }