// ------------------------------------------------------------------------------- // loadTemplate // ------------------------------------------------------------------------------- public override void loadTemplate() { if (string.IsNullOrEmpty(name)) { return; } template = DictionarySkill.Get(name); }
// ------------------------------------------------------------------------------- // CanCastAbility // ------------------------------------------------------------------------------- public bool CanCastAbility(TemplateSkill tmpl, int level) { var success = false; foreach (CharacterBase character in characters) { success = character.CanCastAbility(tmpl, level); } return(success); }
// ------------------------------------------------------------------------------- // InstanceSkill (Constructor) // ------------------------------------------------------------------------------- public InstanceSkill(TemplateSkill tmpl, int lvl) { if (tmpl != null) { template = tmpl; name = tmpl.name; icon = tmpl.icon; level = lvl; } }
// =============================================================================== // ABILITIES // =============================================================================== // ------------------------------------------------------------------------------- // HasAbility // ------------------------------------------------------------------------------- public CharacterBase HasAbility(TemplateSkill tmpl, int level) { foreach (CharacterBase character in characters) { if (character.HasAbility(tmpl, level)) { return(character); } } return(null); }