Beispiel #1
0
        /// <summary>
        /// Adds experience to this Job.
        /// </summary>
        /// <param name="amount">Amount of experience.</param>
        /// <param name="source">Experience source it came from.</param>
        public virtual void AddExperience(double amount, ExperienceSource source)
        {
            double experienceModifier = 1d;

            if (def.preferredExperienceSource != ExperienceSource.General && source != def.preferredExperienceSource)
            {
                experienceModifier = 0.5d;
            }

            experience += amount * experienceModifier;

            if (!IsFullyLeveled && level < def.maxLevel && experience >= def.ExperienceRequiredForLevel(level + 1))
            {
                level++;
                jobsComp.RefreshCachedModifiers();
                Notify_Levelup();
            }
        }
Beispiel #2
0
        public void AddExperience(double amount, ExperienceSource source)
        {
            if (activeJob != null && experienceDistributionPolicy != ExperienceDistributionPolicy.ActiveRace)
            {
                float xpModifier = 1f;
                if (activeRaceJob != null && experienceDistributionPolicy == ExperienceDistributionPolicy.SplitBetweenRaceAndJob)
                {
                    xpModifier = 0.5f;
                }

                activeJob.AddExperience(amount * xpModifier, source);
            }
            if (activeRaceJob != null && experienceDistributionPolicy != ExperienceDistributionPolicy.ActiveJob)
            {
                float xpModifier = 1f;
                if (activeJob != null && experienceDistributionPolicy == ExperienceDistributionPolicy.SplitBetweenRaceAndJob)
                {
                    xpModifier = 0.5f;
                }

                activeRaceJob.AddExperience(amount * xpModifier, source);
            }
        }