Beispiel #1
0
            private void UpdateSkills(bool reset = false)
            {
                // We may have loaded settings for all skills from any class.
                // Active skill is just the subset currently in use by the hero.
                // But we still need to persist settings for all skills used to-date.
                // Also need to populate with reference skill info for the pretty UI Icons etc.

                if (!Player.IsInGame && !ModuleManager.IsEnabled || !ZetaDia.IsInGame)
                {
                    return;
                }

                var activeSettings = SkillUtils.Active.Select(s => new SkillSettings(s)).ToList();

                if (Skills == null || !Skills.Any() || reset)
                {
                    Skills = new List <SkillSettings>(activeSettings);
                }
                else
                {
                    Skills.ForEach(s => s.SetReferenceSkill(SkillUtils.GetSkillByPower(s.SNOPower)));
                    Skills.AddRange(activeSettings.Where(b => Skills.All(a => a.SNOPower != b.SNOPower)));
                }

                var availableSkills = Skills.Where(s => Core.Hotbar.ActivePowers.Any(p => s.SNOPower == p)).OrderBy(s => s.Order);

                ActiveSkills = new FullyObservableCollection <SkillSettings>(availableSkills);
            }
Beispiel #2
0
        public bool IsEquipped()
        {
            if (Passives != null && !Passives.All(passive => passive.IsActive))
            {
                return(false);
            }

            if (Items != null && !Items.All(item => item.IsEquipped))
            {
                return(false);
            }

            if (Sets != null && !Sets.All(set => set.Key.IsBonusActive(set.Value)))
            {
                return(false);
            }

            if (Skills != null && !Skills.All(keyValuePair => keyValuePair.Key.IsActive && (keyValuePair.Value == null || keyValuePair.Value.Index == 0 || keyValuePair.Value.IsActive)))
            {
                return(false);
            }

            return(true);
        }
 public bool IsComplete(Answer[] answers) =>
 answers != null &&
 Skills.All(s => answers.Any(a => s.Skill.EqualsIgnoreCase(a.TraitCode)));