Ejemplo n.º 1
0
        //Train a crew member
        public void Train(CrewMember aCrewMember, int skill, int numTrainings)
        {
            int  oldLevel;
            int  learnedAmount;
            int  newLevel;
            int  raceLearningRate;
            int  maxLevel;
            Race theCrewMemberRace = null;

            oldLevel          = aCrewMember.GetAbilitySkillLevel(skill);
            theCrewMemberRace = OuterSpace.theRaceMgr.GetRace(aCrewMember.RacialClass);
            raceLearningRate  = theCrewMemberRace.LearningRate;

            if (numTrainings < 1)
            {
                numTrainings = 1;
            }
            learnedAmount = raceLearningRate * numTrainings;
            newLevel      = oldLevel + learnedAmount;
            maxLevel      = GetMaxTrainingLevel(theCrewMemberRace, skill);

            if (newLevel > maxLevel)
            {
                newLevel = maxLevel;
            }

            aCrewMember.SetAbilitySkillLevel(skill, newLevel);
        }
Ejemplo n.º 2
0
        //Get a CrewMember object by key ID
        public CrewMember GetCrewMember(int crewmanKey)
        {
            CrewMember crewman = null;

            if (crewmanKey <= crewMemberList.Count)
            {
                crewman = crewMemberList[crewmanKey];
            }

            return(crewman);
        }
Ejemplo n.º 3
0
        //Unassign a crew member from a job
        public void UnassignJob(CrewMember aCrewMember, int jobnumber)
        {
            int currentjobs = aCrewMember.Assignment;

            if ((jobnumber & currentjobs) == jobnumber)
            {
                aCrewMember.Assignment = currentjobs - jobnumber;
            }
            else
            {
                return;
            }
        }
Ejemplo n.º 4
0
        //Assign a job to a crew member object
        public void AssignJob(CrewMember aCrewMember, int jobnumber)
        {
            int currentjobs = aCrewMember.Assignment;

            if ((jobnumber & currentjobs) == jobnumber)
                return;  //Already assigned to job
            else
            {
                //Remove current crew assignment
                UnassignJob(GetCrewMemberKey(jobnumber), jobnumber);
                //Reassign to this crew member
                aCrewMember.Assignment = currentjobs + jobnumber;
            }
        }
Ejemplo n.º 5
0
        //Modify a crew member
        public void Modify(int oldCrewMemberKey, CrewMember newCrewMember)
        {
            if (oldCrewMemberKey < crewMemberList.Count)
            {
                FireCrewMember(oldCrewMemberKey);

                if (crewMemberList.Count > oldCrewMemberKey)
                {
                    crewMemberList.Add(newCrewMember);
                }
                else
                {
                    crewMemberList.Insert(oldCrewMemberKey, newCrewMember);
                }
            }
        }
Ejemplo n.º 6
0
        //Assign a job to a crew member object
        public void AssignJob(CrewMember aCrewMember, int jobnumber)
        {
            int currentjobs = aCrewMember.Assignment;

            if ((jobnumber & currentjobs) == jobnumber)
            {
                return;  //Already assigned to job
            }
            else
            {
                //Remove current crew assignment
                UnassignJob(GetCrewMemberKey(jobnumber), jobnumber);
                //Reassign to this crew member
                aCrewMember.Assignment = currentjobs + jobnumber;
            }
        }
Ejemplo n.º 7
0
        //Unassign a crew member from a job
        public void UnassignJob(CrewMember aCrewMember, int jobnumber)
        {
            int currentjobs = aCrewMember.Assignment;

            if ((jobnumber & currentjobs) == jobnumber)
                aCrewMember.Assignment = currentjobs - jobnumber;
            else
                return;
        }
Ejemplo n.º 8
0
        //Train a crew member
        public void Train(CrewMember aCrewMember, int skill, int numTrainings)
        {
            int oldLevel;
            int learnedAmount;
            int newLevel;
            int raceLearningRate;
            int maxLevel;
            Race theCrewMemberRace = null;

            oldLevel = aCrewMember.GetAbilitySkillLevel(skill);
            theCrewMemberRace = OuterSpace.theRaceMgr.GetRace(aCrewMember.RacialClass);
            raceLearningRate = theCrewMemberRace.LearningRate;

            if (numTrainings < 1)  numTrainings = 1;
            learnedAmount = raceLearningRate * numTrainings;
            newLevel = oldLevel + learnedAmount;
            maxLevel = GetMaxTrainingLevel(theCrewMemberRace, skill);

            if (newLevel > maxLevel)  newLevel = maxLevel;

            aCrewMember.SetAbilitySkillLevel(skill, newLevel);
        }
Ejemplo n.º 9
0
        //Modify a crew member
        public void Modify(int oldCrewMemberKey, CrewMember newCrewMember)
        {
            if (oldCrewMemberKey < crewMemberList.Count)
            {
                FireCrewMember(oldCrewMemberKey);

                if (crewMemberList.Count > oldCrewMemberKey)
                    crewMemberList.Add(newCrewMember);
                else
                    crewMemberList.Insert(oldCrewMemberKey, newCrewMember);
            }
        }
Ejemplo n.º 10
0
 //Add a person to your ship//s crew
 public void HireCrewMember(CrewMember newCrewman)
 {
     crewMemberList.Add(newCrewman);
 }
Ejemplo n.º 11
0
 //Add a person to your ship//s crew
 public void HireCrewMember(CrewMember newCrewman)
 {
     crewMemberList.Add(newCrewman);
 }