예제 #1
0
        public void PaintTopInGame(ClipState clipState)
        {
            if (Hud.Render.UiHidden) return;
            if (clipState != ClipState.BeforeClip) return;

            RuleCalculator.CalculatePaintInfo(Hud.Game.Me);
            if (RuleCalculator.PaintInfoList.Count == 0) return;

            var x = Hud.Window.Size.Width * 0.5f + Hud.Window.Size.Height * PositionOffsetX - RuleCalculator.StandardIconSize / 2;
            var h = Hud.Window.Size.Height * PositionOffsetH;
            BuffPainter.PaintVerticalCenter(RuleCalculator.PaintInfoList, x, 0, h, RuleCalculator.StandardIconSize, RuleCalculator.StandardIconSpacing);
        }
        public void PaintTopInGame(ClipState clipState)
        {
            if (Hud.Render.UiHidden)
            {
                return;
            }
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }

            RuleCalculator.CalculatePaintInfo(Hud.Game.Me);
            if (RuleCalculator.PaintInfoList.Count == 0)
            {
                return;
            }

            var y = Hud.Window.Size.Height * 0.5f + Hud.Window.Size.Height * PositionOffset;

            BuffPainter.PaintHorizontalCenter(RuleCalculator.PaintInfoList, 0, y, Hud.Window.Size.Width, RuleCalculator.StandardIconSize, RuleCalculator.StandardIconSpacing);
        }
        public void PaintTopInGame(ClipState clipState)
        {
            if (clipState != ClipState.BeforeClip)
            {
                return;
            }
            if (HideWhenUiIsHidden && Hud.Render.UiHidden)
            {
                return;
            }

            try
            {
                if (Hud.Game.IsInTown || Hud.Game.Me.IsDead || IsGuardianDead)
                {
                    if (TimerStarted)
                    {
                        aTimer.Enabled     = false;
                        bTimer.Enabled     = false;
                        CountTimer.Enabled = false;
                        TimerStarted       = false;
                        Alarm = true;
                    }
                    return;
                }

                var player = Hud.Game.Me;
                var buff   = player.Powers.GetBuff(430674); //CoE Buff
                if ((buff == null) || (buff.IconCounts[0] <= 0))
                {
                    return;
                }

                var classSpecificRules = GetCurrentRules(player.HeroClassDefinition.HeroClass);

                RuleCalculator.CalculatePaintInfo(player, classSpecificRules);

                if (RuleCalculator.PaintInfoList.Count == 0)
                {
                    return;
                }
                if (!RuleCalculator.PaintInfoList.Any(info => info.TimeLeft > 0))
                {
                    return;
                }

                var highestElementalBonus = player.Offense.HighestElementalDamageBonus;

                for (var i = 0; i < RuleCalculator.PaintInfoList.Count; i++)    // RuleCalculator.PaintInfoList.Count = 4
                {
                    var info = RuleCalculator.PaintInfoList[0];
                    if (info.TimeLeft <= 0)
                    {
                        RuleCalculator.PaintInfoList.RemoveAt(0);
                        RuleCalculator.PaintInfoList.Add(info);
                    }
                    else
                    {
                        break;
                    }
                }

                for (var orderIndex = 0; orderIndex < RuleCalculator.PaintInfoList.Count; orderIndex++)
                {
                    var info = RuleCalculator.PaintInfoList[orderIndex];
                    var best = false;
                    switch (info.Rule.IconIndex)
                    {
                    case 1:
                        best = player.Offense.BonusToArcane == highestElementalBonus;
                        break;

                    case 2:
                        best = player.Offense.BonusToCold == highestElementalBonus;
                        break;

                    case 3:
                        best = player.Offense.BonusToFire == highestElementalBonus;
                        break;

                    case 4:
                        best = player.Offense.BonusToHoly == highestElementalBonus;
                        break;

                    case 5:
                        best = player.Offense.BonusToLightning == highestElementalBonus;
                        break;

                    case 6:
                        best = player.Offense.BonusToPhysical == highestElementalBonus;
                        break;

                    case 7:
                        best = player.Offense.BonusToPoison == highestElementalBonus;
                        break;
                    }

                    if (best && orderIndex > 0)
                    {
                        info.TimeLeft = (orderIndex - 1) * 4 + RuleCalculator.PaintInfoList[0].TimeLeft;
                    }
                    else
                    {
                        info.TimeLeftNumbersOverride = false;
                    }

                    if ((info.TimeLeft == TimeLeftBeforeAttack) && Alarm && best)
                    {
                        TimerStarted = true;

                        if (orderIndex == 0)
                        {
                            AlarmCount = 0;
                            CoEAttack_Action();
                        }
                        else if (orderIndex == 1)
                        {
                            // Timer Start
                            aTimer           = new System.Timers.Timer();
                            aTimer.Elapsed  += CoEReady;
                            aTimer.AutoReset = true;
                            aTimer.Enabled   = true;
                            switch (Hud.Game.Me.HeroClassDefinition.HeroClass)
                            {
                            case HeroClass.Monk:
                                aTimer.Interval = 20000;            // 5 elements *4 secs
                                break;

                            case HeroClass.Necromancer:
                                aTimer.Interval = 12000;            // 3 elements
                                break;

                            case HeroClass.WitchDoctor:
                            case HeroClass.Wizard:
                            case HeroClass.Crusader:
                            case HeroClass.Barbarian:
                            case HeroClass.DemonHunter:
                                aTimer.Interval = 16000;            // 4 elements
                                break;
                            }
                            // timer End

                            CoEReady_Action();
                            Alarm = false;
                        }
                    }
                }
            }
            catch { }
        }