Example #1
0
        public bool AssignNonExcludedFollower(NPCBase follower, Vector3Int position)
        {
            var job = follower.Job;

            if (!IsJobExcluded(job))
            {
                try
                {
                    if (follower.Job != null)
                    {
                        follower.Job.NPC = null;
                        follower.ClearJob();
                    }
                }
                catch (Exception ex)
                {
                    Logger.Log("ActivateMilitia Error has occurred: {0}", ex.Message);
                }

                var militiaJob = new MilitiaJob();
                militiaJob.InitializeJob(player, position, follower.ID);
                militiaJob.OnAssignedNPC(follower);
                follower.TakeJob(militiaJob);
                ColonyManager.AddJobs(militiaJob);
                return(true);
            }

            return(false);
        }
Example #2
0
 public virtual void OnRemove()
 {
     isValid = false;
     if (usedNPC != null)
     {
         usedNPC.ClearJob();
         usedNPC = null;
     }
     JobTracker.Remove(owner, KeyLocation);
 }