/** * * Gnerate Actions Points based on agility */ protected BaseCharacter(CharacterStatisticDataModel statistic) { Name = statistic.Name; Strength = statistic.Strength; Inteligence = statistic.Inteligence; Agility = statistic.Agility; Charisma = statistic.Charisma; Endurance = statistic.Endurance; Perception = statistic.Perception; isEnemy = statistic.IsEnemy; HealthPoint = Endurance * 10; MaxHealthPoint = HealthPoint; Level = 1; CurrentExperience = 0; Debug.Log(Name + ":" + ClassName); }
public void IsAttackWork() { var basicstatistic = new CharacterStatisticDataModel { Name = "Test", Agility = 1, Charisma = 1, Endurance = 1, Inteligence = 1, Strength = 1 }; var player = CharacterFactory.GetPlayerClass("ITGuyClass", basicstatistic); var enemy = CharacterFactory.GetPlayerClass("ITGuyClass", basicstatistic); Assert.IsFalse(player.ChanceToAttack(enemy)); Assert.IsFalse(player.CriticalChance()); Assert.IsNotNullOrEmpty(player.Attack(enemy)); }
public string GenerateCharacter(string className) { try { var statistic = new CharacterStatisticDataModel() { Agility = 1, Charisma = 1, Endurance = 1, Inteligence = 1, Strength = 1, CurrentExperience = 0, Level = 0, Name = className }; return(CharacterFactory.GetPlayerClass(className, statistic).Name); } catch (Exception) { return(null); } }