Beispiel #1
0
        public void ThenTheSkillStaysAtLevel0()
        {
            Skill testSkill = new Skill(0);

            testSkill.AddExperience(999);

            Assert.That(testSkill.CurrentLevel, Is.EqualTo(0));
        }
Beispiel #2
0
        public void ThenTheSkillMovesToLevel3()
        {
            Skill testSkill = new Skill(0);

            testSkill.AddExperience(7999);

            Assert.That(testSkill.CurrentLevel, Is.EqualTo(3));
        }
Beispiel #3
0
        public void ThenTheSkillMovesToLevel10()
        {
            Skill testSkill = new Skill(0);

            testSkill.AddExperience(31623);

            Assert.That(testSkill.CurrentLevel, Is.EqualTo(10));
        }
Beispiel #4
0
 // Adapted from ItemAction.AddSkillExp()
 public void AddSkillExp(EntityPlayer _player, int _itemType, int _exp)
 {
     if (_player == null || destroyXPFactor == 0)
     {
         return;
     }
     if (entityVehicle.player.Skills != null)
     {
         Skill     skill = _player.Skills.GetSkill(_itemType, false);
         ItemClass forId = ItemClass.GetForId(_itemType);
         if (skill != null && forId != null)
         {
             skill.AddExperience(Mathf.RoundToInt((float)_exp * destroyXPFactor), _player is EntityPlayerLocal, _player.entityId, true);
         }
     }
 }