示例#1
0
        public void SkillDatabaseTest()
        {
            SkillDatabase.MagicSkills  = new MagicSkill[] { passiveMagicSkill, offensiveMagicSkill };
            SkillDatabase.CombatSkills = new CombatSkill[] { meleeSkill, meleeMultiTargetsSkill, rangedSkill };

            Assert.IsNull(SkillDatabase.GetMagicSkillByName("DoesNotExist"));
            Assert.IsNull(SkillDatabase.GetCombatSkillByName("DoesNotExist"));
            Assert.AreSame(passiveMagicSkill, SkillDatabase.GetMagicSkillByName("ShadowStrength"));
            Assert.AreSame(offensiveMagicSkill, SkillDatabase.GetMagicSkillByName("Fireball"));
            Assert.AreSame(meleeSkill, SkillDatabase.GetCombatSkillByName("SwordFighting"));
        }
示例#2
0
 private void CreatePlayerCharacter()
 {
     MainController.CreatePlayer();
     MainController.Player.Name             = "John";
     MainController.Player.Stats.Body.Value = 20;
     MainController.Player.Stats.Mind.Value = 10;
     MainController.Player.Stats.Soul.Value = 5;
     MainController.Player.Stats.Life.Reset();
     MainController.Player.Stats.Magic.Reset();
     MainController.Player.LearnCombatSkill(SkillDatabase.GetCombatSkillByName("SwordFighting").Id);
     MainController.Player.LearnMagicSkill(SkillDatabase.GetMagicSkillByName("ShadowStrength").Id);
     LogToFile(MainController.Player.ToString());
 }