示例#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);
        }
示例#2
0
 public bool AssignLaborerFirst(NPCBase follower, Vector3Int position)
 {
     if (follower.NPCType.IsLaborer)
     {
         var militiaJob = new MilitiaJob();
         militiaJob.InitializeJob(player, position, follower.ID);
         militiaJob.OnAssignedNPC(follower);
         follower.TakeJob(militiaJob);
         ColonyManager.AddJobs(militiaJob);
         return(true);
     }
     return(false);
 }