public static Hero Build(int index, PlayerController player = null) { Hero hero = new Hero(); switch (index) { case 0: hero.SetStats(new HeroStats(500, 100, 30, 5f)); hero.AddAbility(new HAAttackMelee()); hero.AddAbility(new HAFireball()); hero.AddAbility(new HAWound()); break; } hero.SetPlayer(player); return(hero); }
void UpdateHero() { if (Hero == null) { return; } try { Hero.ClearAbilities(); foreach (KeyValuePair <string, string> item in maList.CheckedItems) { Hero.AddAbility(item.Key, 2); } foreach (KeyValuePair <string, string> item in gaList.CheckedItems) { Hero.AddAbility(item.Key, 2); } } catch (Exception ex) { throw; } }
private void AddAbilities() { _hero.AddAbility(new Ability() { AbilityTalentId = new AbilityTalentId("Abil1", "abil1"), Tier = AbilityTiers.Basic, ParentLink = null, }); _hero.AddAbility(new Ability() { AbilityTalentId = new AbilityTalentId("Abil1", "abil1") { AbilityType = AbilityTypes.W, }, Tier = AbilityTiers.Basic, }); _hero.AddAbility(new Ability() { AbilityTalentId = new AbilityTalentId("Abil1", "abil1") { AbilityType = AbilityTypes.Q, }, Tier = AbilityTiers.Basic, }); _hero.AddAbility(new Ability() { AbilityTalentId = new AbilityTalentId("Abil2", "abil2"), Tier = AbilityTiers.Basic, }); _hero.AddAbility(new Ability() { AbilityTalentId = new AbilityTalentId("Abil3", "abil3"), Tier = AbilityTiers.Basic, }); _hero.AddAbility(new Ability() { AbilityTalentId = new AbilityTalentId("Abil4", "abil4"), Tier = AbilityTiers.Heroic, ParentLink = null, }); _hero.AddAbility(new Ability() { AbilityTalentId = new AbilityTalentId("Abil5", "abil5"), Tier = AbilityTiers.Heroic, }); _hero.AddAbility(new Ability() { AbilityTalentId = new AbilityTalentId("Abil6", "abil6"), Tier = AbilityTiers.Trait, }); _hero.AddAbility(new Ability() { AbilityTalentId = new AbilityTalentId("Abil7", "abil7"), Tier = AbilityTiers.Activable, }); _hero.AddAbility(new Ability() { AbilityTalentId = new AbilityTalentId("SubAbil1", "subAbil1"), Tier = AbilityTiers.Basic, ParentLink = new AbilityTalentId("Abil7", "abil7"), }); _hero.AddAbility(new Ability() { AbilityTalentId = new AbilityTalentId("SubAbil2", "subAbil2"), Tier = AbilityTiers.Basic, ParentLink = new AbilityTalentId("Abil7", "abil7"), }); }