Exemplo n.º 1
0
        // Token: 0x0600000F RID: 15 RVA: 0x00002B40 File Offset: 0x00000D40
        internal static bool GetEffectsOutsider(Thing thing, Pawn pawn)
        {
            if (ProximityGet.GetProxOutsider(thing.def))
            {
                return(true);
            }

            if (thing.Faction == null || pawn.Faction == null)
            {
                return(false);
            }

            if (pawn.Faction.RelationKindWith(thing.Faction) == FactionRelationKind.Ally)
            {
                if (ProximityGet.GetProxAlly(thing.def))
                {
                    return(true);
                }
            }
            else if (pawn.Faction.RelationKindWith(thing.Faction) == FactionRelationKind.Neutral)
            {
                if (ProximityGet.GetProxNeutral(thing.def))
                {
                    return(true);
                }
            }
            else if (pawn.Faction.RelationKindWith(thing.Faction) == FactionRelationKind.Hostile &&
                     ProximityGet.GetProxHostile(thing.def))
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
        // Token: 0x0600000E RID: 14 RVA: 0x00002AA8 File Offset: 0x00000CA8
        internal static bool GetTerrainPawnHasEquipment(TerrainDef terrain, Pawn pawn)
        {
            var tproxEquipped = ProximityGet.GetTProxEquipped(terrain);

            if (tproxEquipped.Count <= 0)
            {
                return(false);
            }

            foreach (var defName in tproxEquipped)
            {
                var named = DefDatabase <ThingDef> .GetNamed(defName, false);

                if (named == null || !pawn.equipment.HasAnything())
                {
                    continue;
                }

                var allEquipmentListForReading = pawn.equipment.AllEquipmentListForReading;
                if (allEquipmentListForReading.Count <= 0)
                {
                    continue;
                }

                foreach (var thingWithComps in allEquipmentListForReading)
                {
                    if (thingWithComps.def.defName == named.defName)
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Exemplo n.º 3
0
        // Token: 0x0600000B RID: 11 RVA: 0x0000278C File Offset: 0x0000098C
        internal static bool NearThingEffects(Thing thing, Pawn pawn)
        {
            var def = thing.def;

            if (ProximityGet.GetProxRoomOnly(def))
            {
                // Func def changed, this used to be GetRoom
                var room  = thing.Position.GetRoomOrAdjacent(thing.Map);
                var room2 = pawn?.Position.GetRoomOrAdjacent(thing.Map);
                if (room != null && room2 != null && room != room2)
                {
                    return(false);
                }
            }

            if (pawn != null && pawn.IsColonist && !ProximityGet.GetProxColonist(def))
            {
                return(false);
            }

            if (pawn != null && pawn.Drafted && !ProximityGet.GetProxDrafted(def))
            {
                return(false);
            }

            if (!ProximityGet.GetProxComposMentis(def))
            {
                return(pawn != null && (!pawn.RaceProps.IsMechanoid || ProximityGet.GetProxMechanoid(def)) &&
                       (pawn.RaceProps.FleshType.defName != "Insectoid" || ProximityGet.GetProxInsectoid(def)) &&
                       (!pawn.AnimalOrWildMan() || ProximityGet.GetProxAnimal(def)) &&
                       (!pawn.IsPrisoner || ProximityGet.GetProxPrisoner(def)) &&
                       (pawn.Faction == thing.Faction || GetEffectsOutsider(thing, pawn)) &&
                       (ProximityGet.GetProxEquipped(def) == null || GetPawnHasEquipment(thing, pawn)));
            }

            if (pawn != null && (pawn.Downed || pawn.InMentalState || pawn.IsBurning() ||
                                 HealthAIUtility.ShouldSeekMedicalRest(pawn)))
            {
                return(false);
            }

            if (!pawn.Awake())
            {
                return(false);
            }

            return(pawn != null && (!pawn.RaceProps.IsMechanoid || ProximityGet.GetProxMechanoid(def)) &&
                   (pawn.RaceProps.FleshType.defName != "Insectoid" || ProximityGet.GetProxInsectoid(def)) &&
                   (!pawn.AnimalOrWildMan() || ProximityGet.GetProxAnimal(def)) &&
                   (!pawn.IsPrisoner || ProximityGet.GetProxPrisoner(def)) &&
                   (pawn.Faction == thing.Faction || GetEffectsOutsider(thing, pawn)) &&
                   (ProximityGet.GetProxEquipped(def) == null || GetPawnHasEquipment(thing, pawn)));
        }
Exemplo n.º 4
0
        // Token: 0x06000005 RID: 5 RVA: 0x00002544 File Offset: 0x00000744
        internal static void ProximityTerrainHediffEffect(TerrainDef terrain, IntVec3 terrainPosition, Pawn pawn)
        {
            if (pawn.RaceProps.IsMechanoid)
            {
                return;
            }

            var text           = ProximityGet.GetTProxHediff(terrain) ?? "";
            var tproxHediffSev = ProximityGet.GetTProxHediffSev(terrain);
            var tproxRange     = ProximityGet.GetTProxRange(terrain);

            if (tproxHediffSev == 0f || text == "" || !TerrainInRange(terrain, terrainPosition, pawn, tproxRange))
            {
                return;
            }

            var named = DefDatabase <HediffDef> .GetNamed(text, false);

            if (named == null || ProxImmuneTo(pawn, named))
            {
                return;
            }

            var    health = pawn.health;
            Hediff hediff;

            if (health == null)
            {
                hediff = null;
            }
            else
            {
                var hediffSet = health.hediffSet;
                hediff = hediffSet?.GetFirstHediffOfDef(named);
            }

            var hediff2 = hediff;

            if (hediff2 != null)
            {
                hediff2.Severity += tproxHediffSev;
                return;
            }

            var hediff3 = HediffMaker.MakeHediff(named, pawn);

            hediff3.Severity = tproxHediffSev;
            pawn.health.AddHediff(hediff3);
        }
Exemplo n.º 5
0
        // Token: 0x06000004 RID: 4 RVA: 0x00002458 File Offset: 0x00000658
        internal static void ProximityHediffEffect(Thing thing, Pawn pawn)
        {
            if (pawn.RaceProps.IsMechanoid)
            {
                return;
            }

            var text          = ProximityGet.GetProxHediff(thing.def) ?? "";
            var proxHediffSev = ProximityGet.GetProxHediffSev(thing.def);
            var proxRange     = ProximityGet.GetProxRange(thing.def);

            if (proxHediffSev == 0f || text == "" || !NearThingInRange(thing, pawn, proxRange))
            {
                return;
            }

            var named = DefDatabase <HediffDef> .GetNamed(text, false);

            if (named == null || ProxImmuneTo(pawn, named))
            {
                return;
            }

            var    health = pawn.health;
            Hediff hediff;

            if (health == null)
            {
                hediff = null;
            }
            else
            {
                var hediffSet = health.hediffSet;
                hediff = hediffSet?.GetFirstHediffOfDef(named);
            }

            var hediff2 = hediff;

            if (hediff2 != null)
            {
                hediff2.Severity += proxHediffSev;
                return;
            }

            var hediff3 = HediffMaker.MakeHediff(named, pawn);

            hediff3.Severity = proxHediffSev;
            pawn.health.AddHediff(hediff3);
        }
Exemplo n.º 6
0
        // Token: 0x06000011 RID: 17 RVA: 0x00002C40 File Offset: 0x00000E40
        internal static float GetProxQualFactor(Thing thing)
        {
            var result = 1f;

            if (!ProximityGet.GetProxQuality(thing.def) || !thing.TryGetQuality(out var qualityCategory))
            {
                return(result);
            }

            switch (qualityCategory)
            {
            case QualityCategory.Awful:
                result = 0.8f;
                break;

            case QualityCategory.Poor:
                result = 0.9f;
                break;

            case QualityCategory.Normal:
                result = 1f;
                break;

            case QualityCategory.Good:
                result = 1.1f;
                break;

            case QualityCategory.Excellent:
                result = 1.2f;
                break;

            case QualityCategory.Masterwork:
                result = 1.4f;
                break;

            case QualityCategory.Legendary:
                result = 1.65f;
                break;

            default:
                result = 1f;
                break;
            }

            return(result);
        }
Exemplo n.º 7
0
        // Token: 0x06000009 RID: 9 RVA: 0x000026FC File Offset: 0x000008FC
        internal static bool IsNearThingValid(Thing NearThing, Pawn pawn)
        {
            if (!(NearThing is Building))
            {
                return(false);
            }

            if (!NearThing.def.HasModExtension <ProximityDefs>())
            {
                return(false);
            }

            if (!ProximityGet.GetProxDisabled(NearThing.def))
            {
                return(true);
            }

            if (NearThing.IsBrokenDown() || NearThing.IsForbidden(pawn))
            {
                return(false);
            }

            var compFlickable = NearThing.TryGetComp <CompFlickable>();

            if (compFlickable != null && !compFlickable.SwitchIsOn)
            {
                return(false);
            }

            var compRefuelable = NearThing.TryGetComp <CompRefuelable>();

            if (compRefuelable != null && !compRefuelable.HasFuel)
            {
                return(false);
            }

            var compPowerTrader = NearThing.TryGetComp <CompPowerTrader>();

            if (compPowerTrader != null && !compPowerTrader.PowerOn)
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 8
0
        // Token: 0x06000010 RID: 16 RVA: 0x00002BC8 File Offset: 0x00000DC8
        internal static bool GetTerrainEffectsOutsider(TerrainDef terrain, Pawn pawn)
        {
            if (ProximityGet.GetTProxOutsider(terrain))
            {
                return(true);
            }

            var map     = pawn.Map;
            var faction = map?.ParentFaction;

            if (faction == null || pawn.Faction == null)
            {
                return(false);
            }

            if (pawn.Faction.RelationKindWith(faction) == FactionRelationKind.Ally)
            {
                if (ProximityGet.GetTProxAlly(terrain))
                {
                    return(true);
                }
            }
            else if (pawn.Faction.RelationKindWith(faction) == FactionRelationKind.Neutral)
            {
                if (ProximityGet.GetTProxNeutral(terrain))
                {
                    return(true);
                }
            }
            else if (pawn.Faction.RelationKindWith(faction) == FactionRelationKind.Hostile &&
                     ProximityGet.GetTProxHostile(terrain))
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 9
0
        // Token: 0x0600001A RID: 26 RVA: 0x00003CE8 File Offset: 0x00001EE8
        internal static void ProximityTStatSet(TerrainDef terrain, IntVec3 terrainPosition, Pawn pawn)
        {
            ThingComp thingComp = pawn?.TryGetComp <ProximityData>();

            if (thingComp == null)
            {
                return;
            }

            var proximityData = (ProximityData)thingComp;

            var num = 1f;

            if (ProximityGet.GetTProxMoveSpeedOffSet(terrain) != 0f)
            {
                proximityData.MoveSpeedOffSet += num * ProximityGet.GetTProxMoveSpeedOffSet(terrain);
            }

            if (ProximityGet.GetTProxGlobalLearningFactorOffSet(terrain) != 0f)
            {
                proximityData.GlobalLearningFactorOffSet +=
                    num * ProximityGet.GetTProxGlobalLearningFactorOffSet(terrain);
            }

            if (ProximityGet.GetTProxNegotiationAbilityOffSet(terrain) != 0f)
            {
                proximityData.NegotiationAbilityOffSet +=
                    num * ProximityGet.GetTProxNegotiationAbilityOffSet(terrain);
            }

            if (ProximityGet.GetTProxPsychicSensitivityOffSet(terrain) != 0f)
            {
                proximityData.PsychicSensitivityOffSet +=
                    num * ProximityGet.GetTProxPsychicSensitivityOffSet(terrain);
            }

            if (ProximityGet.GetTProxSocialImpactOffSet(terrain) != 0f)
            {
                proximityData.SocialImpactOffSet += num * ProximityGet.GetTProxSocialImpactOffSet(terrain);
            }

            if (ProximityGet.GetTProxToxicSensitivityOffSet(terrain) != 0f)
            {
                proximityData.ToxicSensitivityOffSet +=
                    num * ProximityGet.GetTProxToxicSensitivityOffSet(terrain);
            }

            if (ProximityGet.GetTProxComfyTemperatureMinOffSet(terrain) != 0f)
            {
                proximityData.ComfyTemperatureMinOffSet +=
                    num * ProximityGet.GetTProxComfyTemperatureMinOffSet(terrain);
            }

            if (ProximityGet.GetTProxComfyTemperatureMaxOffSet(terrain) != 0f)
            {
                proximityData.ComfyTemperatureMaxOffSet +=
                    num * ProximityGet.GetTProxComfyTemperatureMaxOffSet(terrain);
            }

            if (ProximityGet.GetTProxAimingDelayFactorOffSet(terrain) != 0f)
            {
                proximityData.AimingDelayFactorOffSet +=
                    num * ProximityGet.GetTProxAimingDelayFactorOffSet(terrain);
            }

            if (ProximityGet.GetTProxShootingAccuracyPawnOffSet(terrain) != 0f)
            {
                proximityData.ShootingAccuracyPawnOffSet +=
                    num * ProximityGet.GetTProxShootingAccuracyPawnOffSet(terrain);
            }

            if (ProximityGet.GetTProxMeleeDodgeChanceOffSet(terrain) != 0f)
            {
                proximityData.MeleeDodgeChanceOffSet +=
                    num * ProximityGet.GetTProxMeleeDodgeChanceOffSet(terrain);
            }

            if (ProximityGet.GetTProxMeleeHitChanceOffSet(terrain) != 0f)
            {
                proximityData.MeleeHitChanceOffSet += num * ProximityGet.GetTProxMeleeHitChanceOffSet(terrain);
            }

            if (ProximityGet.GetTProxImmunityGainSpeedOffSet(terrain) != 0f)
            {
                proximityData.ImmunityGainSpeedOffSet +=
                    num * ProximityGet.GetTProxImmunityGainSpeedOffSet(terrain);
            }

            if (ProximityGet.GetTProxMedicalTendSpeedOffSet(terrain) != 0f)
            {
                proximityData.MedicalTendSpeedOffSet +=
                    num * ProximityGet.GetTProxMedicalTendSpeedOffSet(terrain);
            }

            if (ProximityGet.GetTProxMedicalTendQualityOffSet(terrain) != 0f)
            {
                proximityData.MedicalTendQualityOffSet +=
                    num * ProximityGet.GetTProxMedicalTendQualityOffSet(terrain);
            }

            if (ProximityGet.GetTProxMedicalOperationSpeedOffSet(terrain) != 0f)
            {
                proximityData.MedicalOperationSpeedOffSet +=
                    num * ProximityGet.GetTProxMedicalOperationSpeedOffSet(terrain);
            }

            if (ProximityGet.GetTProxMedicalSurgerySuccessChanceOffSet(terrain) != 0f)
            {
                proximityData.MedicalSurgerySuccessChanceOffSet +=
                    num * ProximityGet.GetTProxMedicalSurgerySuccessChanceOffSet(terrain);
            }

            if (ProximityGet.GetTProxAnimalGatherSpeedOffSet(terrain) != 0f)
            {
                proximityData.AnimalGatherSpeedOffSet +=
                    num * ProximityGet.GetTProxAnimalGatherSpeedOffSet(terrain);
            }

            if (ProximityGet.GetTProxAnimalGatherYieldOffSet(terrain) != 0f)
            {
                proximityData.AnimalGatherYieldOffSet +=
                    num * ProximityGet.GetTProxAnimalGatherYieldOffSet(terrain);
            }

            if (ProximityGet.GetTProxConstructionSpeedOffSet(terrain) != 0f)
            {
                proximityData.ConstructionSpeedOffSet +=
                    num * ProximityGet.GetTProxConstructionSpeedOffSet(terrain);
            }

            if (ProximityGet.GetTProxConstructSuccessChanceOffSet(terrain) != 0f)
            {
                proximityData.ConstructSuccessChanceOffSet +=
                    num * ProximityGet.GetTProxConstructSuccessChanceOffSet(terrain);
            }

            if (ProximityGet.GetTProxEatingSpeedOffSet(terrain) != 0f)
            {
                proximityData.EatingSpeedOffSet += num * ProximityGet.GetTProxEatingSpeedOffSet(terrain);
            }

            if (ProximityGet.GetTProxHuntingStealthOffSet(terrain) != 0f)
            {
                proximityData.HuntingStealthOffSet += num * ProximityGet.GetTProxHuntingStealthOffSet(terrain);
            }

            if (ProximityGet.GetTProxMiningSpeedOffSet(terrain) != 0f)
            {
                proximityData.MiningSpeedOffSet += num * ProximityGet.GetTProxMiningSpeedOffSet(terrain);
            }

            if (ProximityGet.GetTProxPlantHarvestYieldOffSet(terrain) != 0f)
            {
                proximityData.PlantHarvestYieldOffSet +=
                    num * ProximityGet.GetTProxPlantHarvestYieldOffSet(terrain);
            }

            if (ProximityGet.GetTProxPlantWorkSpeedOffSet(terrain) != 0f)
            {
                proximityData.PlantWorkSpeedOffSet += num * ProximityGet.GetTProxPlantWorkSpeedOffSet(terrain);
            }

            if (ProximityGet.GetTProxResearchSpeedOffSet(terrain) != 0f)
            {
                proximityData.ResearchSpeedOffSet += num * ProximityGet.GetTProxResearchSpeedOffSet(terrain);
            }

            if (ProximityGet.GetTProxSmoothingSpeedOffSet(terrain) != 0f)
            {
                proximityData.SmoothingSpeedOffSet += num * ProximityGet.GetTProxSmoothingSpeedOffSet(terrain);
            }

            if (ProximityGet.GetTProxTameAnimalChanceOffSet(terrain) != 0f)
            {
                proximityData.TameAnimalChanceOffSet +=
                    num * ProximityGet.GetTProxTameAnimalChanceOffSet(terrain);
            }

            if (ProximityGet.GetTProxTrainAnimalChanceOffSet(terrain) != 0f)
            {
                proximityData.TrainAnimalChanceOffSet +=
                    num * ProximityGet.GetTProxTrainAnimalChanceOffSet(terrain);
            }

            if (ProximityGet.GetTProxWorkSpeedGlobalOffSet(terrain) != 0f)
            {
                proximityData.WorkSpeedGlobalOffSet +=
                    num * ProximityGet.GetTProxWorkSpeedGlobalOffSet(terrain);
            }

            if (ProximityGet.GetTProxButcheryFleshSpeedOffSet(terrain) != 0f)
            {
                proximityData.ButcheryFleshSpeedOffSet +=
                    num * ProximityGet.GetTProxButcheryFleshSpeedOffSet(terrain);
            }

            if (ProximityGet.GetTProxButcheryMechanoidSpeedOffSet(terrain) != 0f)
            {
                proximityData.ButcheryMechanoidSpeedOffSet +=
                    num * ProximityGet.GetTProxButcheryMechanoidSpeedOffSet(terrain);
            }

            if (ProximityGet.GetTProxButcheryFleshEfficiencyOffSet(terrain) != 0f)
            {
                proximityData.ButcheryFleshEfficiencyOffSet +=
                    num * ProximityGet.GetTProxButcheryFleshEfficiencyOffSet(terrain);
            }

            if (ProximityGet.GetTProxButcheryMechanoidEfficiencyOffSet(terrain) != 0f)
            {
                proximityData.ButcheryMechanoidEfficiencyOffSet +=
                    num * ProximityGet.GetTProxButcheryMechanoidEfficiencyOffSet(terrain);
            }

            if (ProximityGet.GetTProxCookSpeedOffSet(terrain) != 0f)
            {
                proximityData.CookSpeedOffSet += num * ProximityGet.GetTProxCookSpeedOffSet(terrain);
            }

            if (ProximityGet.GetTProxDrugCookingSpeedOffSet(terrain) != 0f)
            {
                proximityData.DrugCookingSpeedOffSet +=
                    num * ProximityGet.GetTProxDrugCookingSpeedOffSet(terrain);
            }

            if (ProximityGet.GetTProxDrugSynthesisSpeedOffSet(terrain) != 0f)
            {
                proximityData.DrugSynthesisSpeedOffSet +=
                    num * ProximityGet.GetTProxDrugSynthesisSpeedOffSet(terrain);
            }

            if (ProximityGet.GetTProxFixBrokenDownBuildingSuccessChanceOffSet(terrain) != 0f)
            {
                proximityData.FixBrokenDownBuildingSuccessChanceOffSet +=
                    num * ProximityGet.GetTProxFixBrokenDownBuildingSuccessChanceOffSet(terrain);
            }

            if (ProximityGet.GetTProxSmeltingSpeedOffSet(terrain) != 0f)
            {
                proximityData.SmeltingSpeedOffSet += num * ProximityGet.GetTProxSmeltingSpeedOffSet(terrain);
            }

            if (ProximityGet.GetTProxGeneralLaborSpeedOffSet(terrain) != 0f)
            {
                proximityData.GeneralLaborSpeedOffSet +=
                    num * ProximityGet.GetTProxGeneralLaborSpeedOffSet(terrain);
            }
        }
Exemplo n.º 10
0
        // Token: 0x06000017 RID: 23 RVA: 0x000030FC File Offset: 0x000012FC
        public override void CompTick()
        {
            if (Find.TickManager.TicksGame <= ProxTick)
            {
                return;
            }

            ProximityStatReset(Pawn);
            if (Pawn.Map != null)
            {
                var list = GenRadial
                           .RadialDistinctThingsAround(Pawn.Position, Pawn.Map, ProxGlobals.closeRange, true).ToList();
                if (list.Count > 0)
                {
                    foreach (var thing in list)
                    {
                        if (!ProxGlobals.IsNearThingValid(thing, Pawn) || !ProxGlobals.NearThingEffects(thing, Pawn))
                        {
                            continue;
                        }

                        var proxRange = ProximityGet.GetProxRange(thing.def);
                        if (!ProxGlobals.NearThingInRange(thing, Pawn, proxRange))
                        {
                            continue;
                        }

                        ProxGlobals.ProximityHediffEffect(thing, Pawn);
                        ProximityStatSet(thing, Pawn);
                    }
                }

                if (ProxGlobals.UseTerrain)
                {
                    var list2 = GenRadial.RadialCellsAround(Pawn.Position, ProxGlobals.closeRange, true).ToList();
                    if (list2.Count > 0)
                    {
                        for (var j = 0; j < list2.Count; j++)
                        {
                            var terrainDef = list2[j].InBounds(Pawn.Map) ? list2[j].GetTerrain(Pawn.Map) : null;
                            if (terrainDef == null || !list2[j].InBounds(Pawn.Map) ||
                                !ProxGlobals.IsTerrainValid(terrainDef, Pawn) ||
                                !ProxGlobals.TerrainEffects(terrainDef, list2[j], Pawn))
                            {
                                continue;
                            }

                            var tproxRange = ProximityGet.GetTProxRange(terrainDef);
                            if (!ProxGlobals.TerrainInRange(terrainDef, list2[j], Pawn, tproxRange))
                            {
                                continue;
                            }

                            ProxGlobals.ProximityTerrainHediffEffect(terrainDef, list2[j], Pawn);
                            ProximityTStatSet(terrainDef, list2[j], Pawn);
                        }
                    }
                }
            }

            ProxTick = Find.TickManager.TicksGame + ProxGlobals.ExtendTicks();
        }
Exemplo n.º 11
0
        // Token: 0x0600000C RID: 12 RVA: 0x000028CC File Offset: 0x00000ACC
        internal static bool TerrainEffects(TerrainDef terrain, IntVec3 terrainPosition, Pawn pawn)
        {
            if (ProximityGet.GetTProxRoomOnly(terrain))
            {
                var room  = terrainPosition.GetRoomOrAdjacent(pawn.Map);
                var room2 = pawn.Position.GetRoomOrAdjacent(pawn.Map);
                if (room != null && room2 != null && room != room2)
                {
                    return(false);
                }
            }

            if (pawn.IsColonist && !ProximityGet.GetTProxColonist(terrain))
            {
                return(false);
            }

            if (pawn.Drafted && !ProximityGet.GetTProxDrafted(terrain))
            {
                return(false);
            }

            if (ProximityGet.GetTProxComposMentis(terrain))
            {
                if (pawn.Downed || pawn.InMentalState || pawn.IsBurning() ||
                    HealthAIUtility.ShouldSeekMedicalRest(pawn))
                {
                    return(false);
                }

                if (!pawn.Awake())
                {
                    return(false);
                }
            }

            if (pawn.RaceProps.IsMechanoid && !ProximityGet.GetTProxMechanoid(terrain))
            {
                return(false);
            }

            if (pawn.RaceProps.FleshType.defName == "Insectoid" && !ProximityGet.GetTProxInsectoid(terrain))
            {
                return(false);
            }

            if (pawn.AnimalOrWildMan() && !ProximityGet.GetTProxAnimal(terrain))
            {
                return(false);
            }

            if (pawn.IsPrisoner && !ProximityGet.GetTProxPrisoner(terrain))
            {
                return(false);
            }

            var faction = pawn.Faction;
            var map     = pawn.Map;

            return((faction == map?.ParentFaction || GetTerrainEffectsOutsider(terrain, pawn)) &&
                   (ProximityGet.GetTProxEquipped(terrain) == null || GetTerrainPawnHasEquipment(terrain, pawn)));
        }