Esempio n. 1
0
 public static bool CanBeArrested(this Pawn pawn)
 {
     if (AncestorUtils.IsAncestor(pawn))
     {
         return(false);
     }
     // Below is the old code
     return(pawn.RaceProps.Humanlike && !pawn.InAggroMentalState && !pawn.HostileTo(Faction.OfPlayer) && (!pawn.IsPrisonerOfColony || !pawn.Position.IsInPrisonCell()));
 }
        public static bool ShouldHaveNeed(this Source _this, NeedDef nd)
        {
            Pawn pawn = (Pawn)typeof(RimWorld.Pawn_NeedsTracker).GetField("pawn", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(_this);

            // BASE
            if (pawn.RaceProps.intelligence < nd.minIntelligence)
            {
                return(false);
            }

            /* So I'm going to conflict with Hospitality, looks like?
             * if ((nd == NeedDefOf.Joy || nd == defComfort || nd == defBeauty || nd == defSpace) && pawn.IsGuest()) // ADDED
             * {
             *  return true;
             * }
             */
            if (nd == NeedDefOf.Rest && AncestorUtils.IsAncestor(pawn)) // ADDED
            {
                return(false);
            }
            if ((nd == NeedDefOf.Joy || nd == defBeauty || nd == defSpace) && AncestorUtils.IsAncestor(pawn)) // ADDED
            {
                return(true);
            }
            if (nd.colonistsOnly && (pawn.Faction == null || !pawn.Faction.IsPlayer))
            {
                return(false);
            }
            if (nd.colonistAndPrisonersOnly && (pawn.Faction == null || !pawn.Faction.IsPlayer) && (pawn.HostFaction == null || pawn.HostFaction != Faction.OfPlayer))
            {
                return(false);
            }
            if (nd.onlyIfCausedByHediff && !pawn.health.hediffSet.hediffs.Any((Hediff x) => x.def.causesNeed == nd))
            {
                return(false);
            }
            if (nd == NeedDefOf.Food)
            {
                return(pawn.RaceProps.EatsFood);
            }

            return(nd != NeedDefOf.Rest || pawn.RaceProps.needsRest);
        }
Esempio n. 3
0
        public static bool get_PsychologicallyNude(this Source _this)
        {
            if (AncestorUtils.IsAncestor(_this.pawn))
            {
                return(false);
            }                                                           // New Condition

            // Existing Decompiled
            if (_this.pawn.gender == Gender.None)
            {
                return(false);
            }
            bool flag;
            bool flag2;

            _this.HasBasicApparel(out flag, out flag2);
            if (_this.pawn.gender == Gender.Male)
            {
                return(!flag);
            }
            return(_this.pawn.gender == Gender.Female && (!flag || !flag2));
        }