public void AddSkill(Skill skill, int level) { if (skill == null || !skill.CharacterHasRequirements(this)) { return; } Spell spell = skill as Spell; if (spell == null) { Skills.Add(new SkillInstance(skill, level)); } else { Spells.Add(new SpellInstance(spell, level)); } foreach (string subskill in skill.AdditionalSkillsGranted) { if (subskill != skill.Name) { Skill newSkill = SkillFactory.FindSkillByName(subskill); if (newSkill != null) { AddSkill(newSkill, 1); } else { AddSkill(SpellFeactory.FindSpellByName(subskill), 1); } } } }
public void CheckInits() { if (ActiveCharacters.Count != 0) { ActiveCharacters.Clear(); } if (PlayerObject != null) { PlayerObject = null; } if (InputMan != null && GUI != null) { SkillFactory.Setup(); ItemFactory.Setup(); SpellFeactory.Setup(); SetPlayer(GameObject.Find("Player") as GameObject); GUI.Load(); } }