Exemple #1
0
        public Buff(PlayerDamageDealt playerDamageDealt, PlayerAbnormals buffs, EntityInformation entityInformation)
        {
            InitializeComponent();
            _header = new EnduranceDebuffHeader();
            ContentWidth = 1020;

            EnduranceAbnormality.Items.Clear();
            EnduranceAbnormality.Items.Add(_header);
            var counter = 0;
            foreach (var abnormality in buffs.Times.Where(x => x.Value.Duration(playerDamageDealt.BeginTime, playerDamageDealt.EndTime) > 0))
            {
                EnduranceDebuff abnormalityUi;
                if (_enduranceDebuffsList.Count > counter)
                {
                    abnormalityUi = _enduranceDebuffsList[counter];
                }
                else
                {
                    abnormalityUi = new EnduranceDebuff();
                    _enduranceDebuffsList.Add(abnormalityUi);
                }
                abnormalityUi.Update(abnormality.Key, abnormality.Value, playerDamageDealt.BeginTime, playerDamageDealt.EndTime);
                EnduranceAbnormality.Items.Add(abnormalityUi);

                counter++;
            }
        }
Exemple #2
0
 public Skills(PlayerStats parent, PlayerDamageDealt playerDamageDealt, EntityInformation entityInformation,
     Database.Structures.Skills skills, PlayerAbnormals buffs, bool timedEncounter)
 {
     InitializeComponent();
     _parent = parent;
     CloseWindow.Source = BasicTeraData.Instance.ImageDatabase.Close.Source;
     BackgroundColor.Opacity = BasicTeraData.Instance.WindowData.SkillWindowOpacity;
     Update(playerDamageDealt, entityInformation, skills, buffs, timedEncounter);
 }
 public SkillAggregate(Skill skill, Skills skillsData, Entity source, Entity target, PlayerDamageDealt playerDamageDealt,
     bool timed, Database.Database.Type type)
 {
     _playerDamageDealt = playerDamageDealt;
     _timed = timed;
     _target = target;
     Type = type;
     Skills = new Dictionary<Skill, List<Entity>>();
     Name = skill.ShortName;
     SkillsData = skillsData;
     Skills.Add(skill, new List<Entity>{ source });
 }
 public PlayerStats(PlayerDamageDealt playerDamageDealt, PlayerHealDealt playeHealDealt, EntityInformation entityInformation,
     Database.Structures.Skills skills, PlayerAbnormals buffs)
 {
     InitializeComponent();
     PlayerDamageDealt = playerDamageDealt;
     PlayerHealDealt = playeHealDealt;
     EntityInformation = entityInformation;
     Skills = skills;
     _buffs = buffs;
     Image = ClassIcons.Instance.GetImage(PlayerDamageDealt.Source.Class).Source;
     Class.Source = Image;
     LabelName.Content = PlayerName;
     LabelName.ToolTip = PlayerDamageDealt.Source.FullName;
 }
        public static IEnumerable<SkillAggregate> GetAggregate(PlayerDamageDealt playerDamageDealt, Entity entity,
         Skills skillsData, bool timedEncounter, Database.Database.Type type)
        {
            if(skillsData==null)return new List<SkillAggregate>();
            if (type != Database.Database.Type.Damage)
            {
                timedEncounter = false;
            }

            if (!playerDamageDealt.Source.IsHealer && type != Database.Database.Type.Damage)
            {
                var skills = skillsData.SkillsIdByTarget(playerDamageDealt.Source.User);
                var skillsAggregate = new Dictionary<string, SkillAggregate>();
                foreach (var skill in skills)
                {
                    if (skill.Value == null) continue;
                    if (!skillsData.Type(skill.Key, playerDamageDealt.Source.User, skill.Value.Id, skill.Value.NpcInfo, false, type) )
                    {
                        continue;
                    }

                    if (!skillsAggregate.ContainsKey(skill.Value.ShortName))
                    {
                        skillsAggregate.Add(skill.Value.ShortName,
                            new SkillAggregate(skill.Value, skillsData, skill.Key, playerDamageDealt.Source.User, playerDamageDealt, false, type));
                        continue;
                    }
                    skillsAggregate[skill.Value.ShortName].Add(skill.Value, skill.Key);
                }
                return skillsAggregate.Values;
            }
            if (playerDamageDealt.Source.IsHealer && type != Database.Database.Type.Damage)
            {
                var skills = skillsData.SkillsIdBySource(playerDamageDealt.Source.User, null, true);
                var skillsAggregate = new Dictionary<string, SkillAggregate>();
                foreach (var skill in skills)
                {
                    if (skill == null) continue;
                    if (!skillsData.Type(playerDamageDealt.Source.User, null, skill.Id, skill.NpcInfo, true, type))
                    {
                        continue;
                    }

                    if (!skillsAggregate.ContainsKey(skill.ShortName))
                    {
                        skillsAggregate.Add(skill.ShortName,
                            new SkillAggregate(skill, skillsData, playerDamageDealt.Source.User, null, playerDamageDealt,
                                true, type));
                        continue;
                    }
                    skillsAggregate[skill.ShortName].Add(skill, playerDamageDealt.Source.User);
                }
                return skillsAggregate.Values;
            }
            else
            {

                var skills = skillsData.SkillsIdBySource(playerDamageDealt.Source.User, entity, timedEncounter);
                var skillsAggregate = new Dictionary<string, SkillAggregate>();
                foreach (var skill in skills)
                {
                    if (skill == null) continue;
                    if (!skillsData.Type(playerDamageDealt.Source.User, entity, skill.Id, skill.NpcInfo , timedEncounter, type))
                    {
                        continue;
                    }
                    if (!skillsAggregate.ContainsKey(skill.ShortName))
                    {
                        skillsAggregate.Add(skill.ShortName,
                            new SkillAggregate(skill, skillsData, playerDamageDealt.Source.User, entity, playerDamageDealt,
                                timedEncounter, type));
                        continue;
                    }
                    skillsAggregate[skill.ShortName].Add(skill, playerDamageDealt.Source.User);
                }
                return skillsAggregate.Values;
            }
        }
Exemple #6
0
        public void Update(PlayerDamageDealt playerDamageDealt, EntityInformation entityInformation,
            Database.Structures.Skills skills, PlayerAbnormals buffs, bool timedEncounter)
        {
            if (_skills == null || skills != null)
            {
                _skills = skills;
                var death = buffs.Death;
                if (death == null)
                {
                    DeathCounter.Content = 0;
                    DeathDuration.Content = "0" + LP.Seconds;
                }
                else
                {
                    DeathCounter.Content = death.Count(entityInformation.BeginTime, entityInformation.EndTime);
                    var duration = death.Duration(entityInformation.BeginTime, entityInformation.EndTime);
                    var interval = TimeSpan.FromTicks(duration);
                    DeathDuration.Content = interval.ToString(@"mm\:ss");
                }
                var aggro = buffs.Aggro(entityInformation.Entity);
                if (aggro == null)
                {
                    AggroCounter.Content = 0;
                    AggroDuration.Content = "0" + LP.Seconds;
                }
                else
                {
                    AggroCounter.Content = aggro.Count(entityInformation.BeginTime, entityInformation.EndTime);
                    var duration = aggro.Duration(entityInformation.BeginTime, entityInformation.EndTime);
                    var interval = TimeSpan.FromTicks(duration);
                    AggroDuration.Content = interval.ToString(@"mm\:ss");
                }

                //return;

                //var tabItem = (TabItem) TabControl.SelectedItem;
                //if (tabItem == null)
                //{
                //    TabControl.SelectedIndex = 0;
                //    tabItem = (TabItem) TabControl.SelectedItem;
                //}
                //switch (tabItem.Name)
                //{
                //    case "DpsPanel":
                //        if (_skillDps == null)
                //        {
                _skillDps =
                    new SkillsDetail(
                        SkillAggregate.GetAggregate(playerDamageDealt, entityInformation.Entity, _skills,
                            timedEncounter,
                            Database.Database.Type.Damage), Database.Database.Type.Damage);
                //}
                DpsPanel.Content = _skillDps;
                //    return;
                //case "HealPanel":
                //    if (_skillHeal == null)
                //    {
                _skillHeal =
                    new SkillsDetail(
                        SkillAggregate.GetAggregate(playerDamageDealt, entityInformation.Entity, _skills,
                            timedEncounter,
                            Database.Database.Type.Heal), Database.Database.Type.Heal);
                //    }
                HealPanel.Content = _skillHeal;
                //    return;
                //case "ManaPanel":
                //    if (_skillMana == null)
                //    {
                _skillMana =
                    new SkillsDetail(
                        SkillAggregate.GetAggregate(playerDamageDealt, entityInformation.Entity, _skills,
                            timedEncounter,
                            Database.Database.Type.Mana), Database.Database.Type.Mana);
                //    }
                ManaPanel.Content = _skillMana;
                //    return;
                //case "BuffPanel":
                //    if (_buff == null)
                //    {
                _buff = new Buff(playerDamageDealt, buffs, entityInformation);
                //    }
                BuffPanel.Content = _buff;
                //    return;
                //case "SkillsDealtPanel":
                //    if (_skillDealtLog == null)
                //    {
                _skillDealtLog =
                    new SkillsLog(
                        _skills?.GetSkillsDealt(playerDamageDealt.Source.User, entityInformation.Entity,
                            timedEncounter), false);
                //    }
                SkillsDealtPanel.Content = _skillDealtLog;
                //    return;
                //case "SkillsReceivedPanel":
                //    if (_skillReceivedLog == null)
                //    {
                _skillReceivedLog =
                    new SkillsLog(
                        _skills?.GetSkillsReceived(playerDamageDealt.Source.User, timedEncounter), true);
                //    }
                SkillsReceivedPanel.Content = _skillReceivedLog;
                //return;
            }
        }
        public void Repaint(PlayerDamageDealt playerDamageDealt, PlayerHealDealt playerHealDealt, EntityInformation entityInformation,
            Database.Structures.Skills skills,
            PlayerAbnormals buffs, bool timedEncounter)
        {
            PlayerHealDealt = playerHealDealt;
            EntityInformation = entityInformation;
            PlayerDamageDealt = playerDamageDealt;
            _buffs = buffs;
            _timedEncounter = timedEncounter;
            Skills = skills;
            LabelDps.Content = GlobalDps;
            LabelDps.ToolTip = $"{LP.Individual_dps}: {Dps}";
            LabelCritRate.Content = PlayerDamageDealt.Source.IsHealer && BasicTeraData.Instance.WindowData.ShowHealCrit
                ? CritRateHeal
                : CritRate;
            var intervalTimespan = TimeSpan.FromSeconds(PlayerDamageDealt.Interval/TimeSpan.TicksPerSecond);
            LabelCritRate.ToolTip = $"{LP.Fight_Duration}: {intervalTimespan.ToString(@"mm\:ss")}";
            LabelCritRate.Foreground = PlayerDamageDealt.Source.IsHealer && BasicTeraData.Instance.WindowData.ShowHealCrit
                ? Brushes.LawnGreen
                : Brushes.LightCoral;
            LabelDamagePart.Content = DamagePart;
            LabelDamagePart.ToolTip = $"{LP.Damage_done}: {Damage}";

            _windowSkill?.Update(PlayerDamageDealt, EntityInformation, Skills, _buffs, _timedEncounter);
            Spacer.Width = 0;
            GridStats.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
            var SGrid =
                ((DamageMeter.UI.MainWindow)((System.Windows.FrameworkElement)
                    ((System.Windows.FrameworkElement) ((System.Windows.FrameworkElement) this.Parent).Parent).Parent).Parent)
                    .SGrid;
            var EGrid =
                ((DamageMeter.UI.MainWindow)((System.Windows.FrameworkElement)
                    ((System.Windows.FrameworkElement)((System.Windows.FrameworkElement)this.Parent).Parent).Parent).Parent)
                    .EGrid;
            SGrid.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
            var mainWidth = SGrid.DesiredSize.Width;
            Spacer.Width = mainWidth > GridStats.DesiredSize.Width ? mainWidth - GridStats.DesiredSize.Width : 0;
            DpsIndicator.Width = EntityInformation.TotalDamage == 0
                ? mainWidth
                : mainWidth * PlayerDamageDealt.Amount/EntityInformation.TotalDamage;
            EGrid.MaxWidth = Math.Max(mainWidth, GridStats.DesiredSize.Width);
        }