internal static bool _TryDoRandomMoodCausedMentalBreak(this MentalBreaker _this)
        {
            if (!_this.CanDoRandomMentalBreaks() || _this.GetPawn().Downed || !_this.GetPawn().Awake())
            {
                return(false);
            }
            if (_this.GetPawn().Faction != Faction.OfPlayer && _this.CurrentDesiredMoodBreakIntensity() != MentalBreakIntensity.Extreme)
            {
                return(false);
            }
            MentalBreakDef mentalBreakDef;

            if (!_this.CurrentPossibleMoodBreaks().TryRandomElementByWeight((MentalBreakDef d) => d.Worker.CommonalityFor(_this.GetPawn()), out mentalBreakDef))
            {
                return(false);
            }

            int    intensity = (int)_this.CurrentDesiredMoodBreakIntensity();
            Hediff hediff    = _this.GetPawn().health.hediffSet.GetFirstHediffOfDef(HediffDefOfPsychology.Anxiety);

            if (hediff != null)
            {
                hediff.Severity += 0.15f - (intensity * 0.5f);
            }
            else if (Rand.Value <= (0.6f - (0.25f * intensity)))
            {
                hediff          = HediffMaker.MakeHediff(HediffDefOfPsychology.Anxiety, _this.GetPawn(), null);
                hediff.Severity = 0.75f - (intensity * 0.25f);
                _this.GetPawn().health.AddHediff(hediff, null, null);
            }

            var     RandomMentalBreakReason = typeof(MentalBreaker).GetMethod("RandomMentalBreakReason", BindingFlags.Instance | BindingFlags.NonPublic);
            Thought thought = (Thought)RandomMentalBreakReason.Invoke(_this, null);
            string  reason  = (thought == null) ? null : thought.LabelCap;

            _this.GetPawn().mindState.mentalStateHandler.TryStartMentalState(mentalBreakDef.mentalState, reason, false, true, null);
            return(true);
        }