public Monster(int monsterID, string monsterName, AbilityFactors abilityFactors, int exp, List <int> skills, Dictionary <int, int> skillProbabilityDictionary) { MonsterID = monsterID; MonsterName = monsterName; AbilityFactors = abilityFactors; EXP = exp; this.skills = skills; this.skillProbabilityDictionary = skillProbabilityDictionary; }
public Player() { Inventory = new Inventory(); AbilityFactors = new AbilityFactors { Level = 1, MaxHP = 50, HP = 50, MaxSP = 25, SP = 25, Power = 1, Magic = 1, Agile = 1, Sensibility = 1 }; LevelUpEXP = LevelEXPTable.GetLevelUpEXP(1); EXP = 0; AbilityPoint = 6; skills = new List <int>(); locatedSceneID = 1; Action learnSkillAction = () => { var remaindedSkills = SkillFactory.Instance.Skills.Where(x => !HasSkill(x.SkillID)); foreach (var skill in remaindedSkills) { if (skill.CanLearn(this)) { LearnSkill(skill.SkillID); } } }; AbilityFactors.OnLevelChange += (value1, value2) => learnSkillAction(); AbilityFactors.OnPowerChange += (value) => learnSkillAction(); AbilityFactors.OnMagicChange += (value) => learnSkillAction(); AbilityFactors.OnAgileChange += (value) => learnSkillAction(); AbilityFactors.OnSensibilityChange += (value) => learnSkillAction(); }