Example #1
0
 public void resetNeeds()
 {
     foreach (Pawn merc in AllEquippedMercenaryPawns)
     {
         if (merc.health == null)
         {
             merc.health = new Pawn_HealthTracker(merc);
         }
         HealthUtility.HealNonPermanentInjuriesAndRestoreLegs(merc);
         if (merc.needs == null)
         {
             merc.needs = new Pawn_NeedsTracker(merc);
         }
         if (merc.needs.food == null)
         {
             merc.needs.food = new Need_Food(merc);
         }
         if (merc.needs.rest == null)
         {
             merc.needs.rest = new Need_Rest(merc);
         }
         if (!merc.AnimalOrWildMan() && merc.needs.joy == null)
         {
             merc.needs.joy = new Need_Joy(merc);
         }
         merc.needs.food.CurLevel = merc.needs.food.MaxLevel;
         merc.needs.rest.CurLevel = merc.needs.rest.MaxLevel;
         if (!merc.AnimalOrWildMan())
         {
             merc.needs.joy.CurLevel = merc.needs.joy.MaxLevel;
             merc.needs.mood.thoughts.memories.TryGainMemory(DefDatabase <ThoughtDef> .GetNamed("FC_Mercenary"));
         }
     }
 }
Example #2
0
 public FCPrisoner(Pawn pawn, SettlementFC settlement)
 {
     this.prisoner      = pawn;
     this.settlement    = settlement;
     this.unrest        = 0;
     this.health        = 100;
     this.isReturning   = false;
     this.loadID        = Find.World.GetComponent <FactionFC>().GetNextPrisonerID();
     this.workload      = FCWorkLoad.Light;
     this.healthTracker = new Pawn_HealthTracker(pawn);
     this.healthTracker = pawn.health;
     HealthUtility.HealNonPermanentInjuriesAndRestoreLegs(this.prisoner);
 }
Example #3
0
        public bool AdjustHealth(int value)
        {
            health += value;
            if (health >= 100)
            {
                health = 100;
                if (prisoner != null && prisoner.health != null)
                {
                    HealthUtility.HealNonPermanentInjuriesAndRestoreLegs(prisoner);
                }
            }

            return(checkDead());
        }
Example #4
0
 protected override void RemovePawnOnWorldObjectRemoved()
 {
     if (pawn.Any)
     {
         if (!pawn[0].Dead)
         {
             if (pawn[0].relations != null)
             {
                 pawn[0].relations.Notify_FailedRescueQuest();
             }
             HealthUtility.HealNonPermanentInjuriesAndRestoreLegs(pawn[0]);
         }
         pawn.ClearAndDestroyContentsOrPassToWorld();
     }
 }
        public override void PostDestroy(SitePart sitePart)
        {
            base.PostDestroy(sitePart);
            if (sitePart.things == null || !sitePart.things.Any)
            {
                return;
            }
            Pawn pawn = (Pawn)sitePart.things[0];

            if (!pawn.Dead)
            {
                if (pawn.relations != null)
                {
                    pawn.relations.Notify_FailedRescueQuest();
                }
                HealthUtility.HealNonPermanentInjuriesAndRestoreLegs(pawn);
            }
        }