Exemple #1
0
        // Token: 0x06000188 RID: 392 RVA: 0x0000ECA4 File Offset: 0x0000D0A4
        public static float GetPreyScoreFor(Pawn predator, Pawn prey, bool findhost)
        {
            float offset           = XenomorphUtil.TotalSpawnedXenomorphPawnCount(prey.Map);
            float num              = prey.kindDef.combatPower / predator.kindDef.combatPower;
            float num2             = prey.health.summaryHealth.SummaryHealthPercent;
            float bodySizeFactor   = prey.ageTracker.CurLifeStage.bodySizeFactor / predator.ageTracker.CurLifeStage.bodySizeFactor;
            float lengthHorizontal = (predator.Position - prey.Position).LengthHorizontal;

            if (prey.Downed)
            {
                num2 = Mathf.Min(num2, 0.2f);
            }
            float num3 = -lengthHorizontal - 56f * num2 * num2 * num * bodySizeFactor;
            float num4 = -56f * num2 * num2 * num * bodySizeFactor;

            if (prey.isHost())
            {
                if (prey.isXenoHost())
                {
                    num3 -= 350f;
                }
                if (prey.isNeoHost() && findhost)
                {
                    num3 -= 350f;
                }
            }
            if (prey.isNeomorph())
            {
                num3 -= 350f;
            }
            if (prey.isPotentialHost())
            {
                num3 += 20f;
            }
            if (prey.RaceProps.Humanlike)
            {
                num3 -= 35f;
            }
            num3 += offset * 3;
            bool selected = Find.Selector.SelectedObjects.Contains(predator) && Prefs.DevMode;

            if (selected)
            {
                Log.Message(string.Format("{0} found: {1} @: {2}\nPreyScore: {3}, BFPreyScore: {4}, isXenoHost: {5}, isNeoHost: {6}, isXenomorph: {7}, isNeomorph: {8}, isPotentialHost: {9}, Humanlike: {10}", predator.LabelShortCap, prey.LabelShortCap, prey.Position, num3, num4, prey.isXenoHost(), prey.isNeoHost(), prey.isXenomorph(), prey.isNeomorph(), prey.isPotentialHost(), prey.RaceProps.Humanlike));
            }
            return(num3);
        }