Esempio n. 1
0
        public override void Render()
        {
            base.Render();
            var hoverUi = GameController.Game.IngameState.UIHoverTooltip.Tooltip;

            var skills = SkillBar.CurrentSkills();

            foreach (var skill in skills)
            {
                var box    = skill.SkillElement.GetClientRect();
                var newBox = new RectangleF(box.X, box.Y - 2, box.Width, -15);

                decimal value;

                if (hoverUi.GetClientRect().Intersects(newBox) && hoverUi.IsVisibleLocal)
                {
                    continue;
                }

                if (skill.Skill.Stats.TryGetValue(GameStat.HundredTimesDamagePerSecond, out var val0))
                {
                    value = val0 / (decimal)100d;
                }
                else if (skill.Skill.Stats.TryGetValue(GameStat.HundredTimesAttacksPerSecond, out var val1))
                {
                    value = val1 / (decimal)100d;
                }
                else if (skill.Skill.Stats.TryGetValue(GameStat.HundredTimesAverageDamagePerSkillUse, out var val2))
                {
                    value = val2 / (decimal)100d;
                }
                else if (skill.Skill.Stats.TryGetValue(GameStat.IntermediaryFireSkillDotDamageToDealPerMinute, out var val3))
                {
                    value = val3 / (decimal)60;
                }
                else if (skill.Skill.Stats.TryGetValue(GameStat.BaseSkillShowAverageDamageInsteadOfDps, out var val4))
                {
                    value = val4 / (decimal)100d;
                }
                else
                {
                    continue;
                }

                //
                // if (value <= 0) continue;

                var pos = new Vector2(newBox.Center.X, newBox.Center.Y - Settings.FontSize / 2f);
                Graphics.DrawText(ToKmb(Convert.ToDecimal(value)), pos, Settings.FontColor, Settings.FontSize, FontAlign.Center);

                Graphics.DrawBox(newBox, Settings.BackgroundColor);
                Graphics.DrawFrame(newBox, Settings.BorderColor, 1);
            }
        }
Esempio n. 2
0
        private void ShowDps()
        {
            try
            {
                if (UpdateTick.ElapsedMilliseconds > Settings.UpdateInterval)
                {
                    if (!CanTick())
                    {
                        return;
                    }
                    SkillCache = SkillBar.CurrentSkills();
                    UpdateTick.Restart();
                }

                Element HoverUI = GameController.Game.IngameState.UIHoverTooltip.Tooltip;
                if (HoverUI == null)
                {
                    return;
                }
                foreach (SkillBar.Data skill in SkillCache)
                {
                    if (skill == null)
                    {
                        continue;
                    }

                    RectangleF box         = skill.SkillElement.GetClientRect();
                    RectangleF newBox      = new RectangleF(box.X, box.Y - 2, box.Width, -15);
                    int        value       = -1;
                    int        Projectiles = 1;

                    if (HoverUI.GetClientRect().Intersects(newBox) && HoverUI.IsVisibleLocal)
                    {
                        continue;
                    }

                    if (skill.SkillStats != null)
                    {
                        if (TryGetStat(GameStat.HundredTimesDamagePerSecond, skill.SkillStats) > 0)
                        {
                            value = TryGetStat(GameStat.HundredTimesDamagePerSecond, skill.SkillStats);
                        }

                        else if (TryGetStat(GameStat.HundredTimesAverageDamagePerHit, skill.SkillStats) > 0)
                        {
                            value = TryGetStat(GameStat.HundredTimesAverageDamagePerHit, skill.SkillStats);
                        }
                    }

                    //if (Settings.XProjectileCount)
                    //{
                    //    if (Stats != null && Stats.TryGetValue(GameStat.NumberOfAdditionalProjectiles, out int NOAP))
                    //    {
                    //        Projectiles = NOAP;
                    //    }
                    //}

                    //LogMessage($"Skill: {skill.Skill.Id}, value: {Value}, stat: {TryGetStat(GameStat.HundredTimesAverageDamagePerHit, skill.SkillStats)}", 1);
                    //Graphics.DrawFrame(box, 1, Color.Red);

                    if (value <= 0)
                    {
                        continue;
                    }

                    int    textValue = value / 100;
                    string text      = ToKMB(textValue);
                    //string text = ToKMB(Convert.ToDecimal(Value / (decimal) 100 * Projectiles));
                    Vector2 position = new Vector2(newBox.Center.X, newBox.Center.Y - Settings.FontSize / 2);
                    Graphics.DrawText(text, Settings.FontSize, position, Settings.FontColor, FontDrawFlags.Center);
                    Graphics.DrawBox(newBox, Settings.BackgroundColor);
                    Graphics.DrawFrame(newBox, 1, Settings.BorderColor);
                }
            }
            catch (Exception e)
            {
                LogError(e, 10);
            }
        }