Exemple #1
0
        public override void Notify_Starting()
        {
            base.Notify_Starting();
            ThingCount thingCount = LoadPitJobUtility.FindThingToLoad(this.pawn, base.Container.TryGetComp <CompPit>());

            this.job.targetA  = thingCount.Thing;
            this.job.count    = thingCount.Count;
            this.initialCount = thingCount.Count;
            this.pawn.Reserve(thingCount.Thing, this.job, 1, -1, null, true);
            foreach (Pawn p in this.Map.mapPawns.SpawnedPawnsInFaction(Faction.OfPlayer))
            {
                bool flag3 = p.needs != null && p.needs.mood != null && p.needs.mood.thoughts != null;
                if (flag3)
                {
                    p.needs.mood.thoughts.memories.TryGainMemory(ThoughtDef.Named("PD_ThrownPrisonerIntoPit"), null);
                    p.needs.mood.thoughts.memories.TryGainMemory(ThoughtDef.Named("PD_ThrownPrisonerIntoPitImLovinIt"), null);
                }
            }
        }
 public static bool HasJobOnTransporter(Pawn pawn, CompPit transporter)
 {
     return(transporter.AnythingLeftToLoad && pawn.health.capacities.CapableOf(PawnCapacityDefOf.Manipulation) && pawn.CanReach(transporter.parent, PathEndMode.Touch, pawn.NormalMaxDanger(), false, TraverseMode.ByPawn) && LoadPitJobUtility.FindThingToLoad(pawn, transporter).Thing != null);
 }