コード例 #1
0
        void PaintOnce(DamageVSRageGraphControlAbilitySettings abs, System.Drawing.Graphics g)
        {
            var   ab                  = Activator.CreateInstance(abs.Ability) as Game.Map.Ability;
            int   nUnits              = ab.CalculateApproxStatsMaxNEnemies;
            float nRageLevels         = Settings.NRageLevels;
            float xPixelsPerRage      = Width / nRageLevels;
            float yPixelsPerDPS       = Height / 15000f;
            float yPixelsPerCPS       = Height / 5f;
            float yPixelsPerAPS       = Height / 5f;
            float yPixelsPerAvgDamage = Height / 1000f;
            float yPixelsPerRPS       = Height / 20f;

            g.DrawLine(Pens.DarkGray, (3) * xPixelsPerRage, 0, (3) * xPixelsPerRage, Height);
            g.DrawLine(Pens.DarkGray, (5) * xPixelsPerRage, 0, (5) * xPixelsPerRage, Height);
            g.DrawLine(Pens.DarkGray, (8) * xPixelsPerRage, 0, (8) * xPixelsPerRage, Height);


            //for (float y = Height; y > 0 ; y -= yPixelsPerDPS * 100)
            //    e.Graphics.DrawLine(new Pen(Color.FromArgb(50, 0, 0)), 0, y, Width, y);

            //for (float y = Height; y > 0 ; y -= yPixelsPerCPS * 100)
            //    e.Graphics.DrawLine(new Pen(Color.FromArgb(0, 50, 0)), 0, y, Width, y);

            Game.Map.AbilityStats last = new Client.Game.Map.AbilityStats();
            float lastRPS = 0;

            for (int rageLevel = 0; rageLevel < nRageLevels; rageLevel++)
            {
                float lastx      = rageLevel * xPixelsPerRage;
                float x          = (rageLevel + 1) * xPixelsPerRage;
                var   stats      = ab.CalculateApproxStats(rageLevel);
                float ragePerSec = Game.Map.Units.MainCharacter.RageLevelProcessGain(stats.DPS);
                ragePerSec = Game.Map.Units.MainCharacter.AdjustedRageInc(rageLevel, ragePerSec);
                ragePerSec = 1 / ragePerSec;
                g.DrawLine(new Pen(abs.AbilityDPS), lastx, Height - last.DPS * yPixelsPerDPS, x, Height - stats.DPS * yPixelsPerDPS);
                g.DrawLine(new Pen(abs.AbilityCritsPerSec), lastx, Height - last.CritsPerSecond * yPixelsPerCPS, x, Height - stats.CritsPerSecond * yPixelsPerCPS);
                g.DrawLine(new Pen(abs.AbilityAttacksPerSec), lastx, Height - last.AttacksPerSecond * yPixelsPerAPS, x, Height - stats.AttacksPerSecond * yPixelsPerAPS);
                g.DrawLine(new Pen(abs.AbilityDamagePerHit), lastx, Height - last.AvgDamagePerHit * yPixelsPerAvgDamage, x, Height - stats.AvgDamagePerHit * yPixelsPerAvgDamage);
                g.DrawLine(new Pen(abs.AbilityRageTimeToNextLevel), lastx, Height - lastRPS * yPixelsPerRPS, x, Height - ragePerSec * yPixelsPerRPS);
                g.DrawString(stats.DPS.ToString(), new Font("Arial", 8), new SolidBrush(abs.AbilityDPS),
                             x, Height - stats.DPS * yPixelsPerDPS - 10);
                g.DrawString((int)(100 * stats.CritsPerSecond / stats.AttacksPerSecond) + "%",
                             new Font("Arial", 8), new SolidBrush(abs.AbilityCritsPerSec),
                             x, Height - stats.CritsPerSecond * yPixelsPerCPS - 10);
                g.DrawString(stats.AttacksPerSecond.ToString(), new Font("Arial", 8), new SolidBrush(abs.AbilityAttacksPerSec),
                             x, Height - stats.AttacksPerSecond * yPixelsPerAPS - 10);
                g.DrawString(stats.AvgDamagePerHit.ToString(), new Font("Arial", 8), new SolidBrush(abs.AbilityDamagePerHit),
                             x, Height - stats.AvgDamagePerHit * yPixelsPerAvgDamage - 10);
                g.DrawString(ragePerSec + "s", new Font("Arial", 8), new SolidBrush(abs.AbilityRageTimeToNextLevel),
                             x, Height - ragePerSec * yPixelsPerRPS - 10);
                last    = stats;
                lastRPS = ragePerSec;
            }
        }
コード例 #2
0
        void PaintOnce(DamageVSRageGraphControlAbilitySettings abs, System.Drawing.Graphics g)
        {
            var ab = Activator.CreateInstance(abs.Ability) as Game.Map.Ability;
            int nUnits = ab.CalculateApproxStatsMaxNEnemies;
            float nRageLevels = Settings.NRageLevels;
            float xPixelsPerRage = Width / nRageLevels;
            float yPixelsPerDPS = Height / 15000f;
            float yPixelsPerCPS = Height / 5f;
            float yPixelsPerAPS = Height / 5f;
            float yPixelsPerAvgDamage = Height / 1000f;
            float yPixelsPerRPS = Height / 20f;

            g.DrawLine(Pens.DarkGray, (3) * xPixelsPerRage, 0, (3) * xPixelsPerRage, Height);
            g.DrawLine(Pens.DarkGray, (5) * xPixelsPerRage, 0, (5) * xPixelsPerRage, Height);
            g.DrawLine(Pens.DarkGray, (8) * xPixelsPerRage, 0, (8) * xPixelsPerRage, Height);

            //for (float y = Height; y > 0 ; y -= yPixelsPerDPS * 100)
            //    e.Graphics.DrawLine(new Pen(Color.FromArgb(50, 0, 0)), 0, y, Width, y);

            //for (float y = Height; y > 0 ; y -= yPixelsPerCPS * 100)
            //    e.Graphics.DrawLine(new Pen(Color.FromArgb(0, 50, 0)), 0, y, Width, y);

            Game.Map.AbilityStats last = new Client.Game.Map.AbilityStats();
            float lastRPS = 0;
            for (int rageLevel = 0; rageLevel < nRageLevels; rageLevel++)
            {
                float lastx = rageLevel * xPixelsPerRage;
                float x = (rageLevel + 1) * xPixelsPerRage;
                var stats = ab.CalculateApproxStats(rageLevel);
                float ragePerSec = Game.Map.Units.MainCharacter.RageLevelProcessGain(stats.DPS);
                ragePerSec = Game.Map.Units.MainCharacter.AdjustedRageInc(rageLevel, ragePerSec);
                ragePerSec = 1 / ragePerSec;
                g.DrawLine(new Pen(abs.AbilityDPS), lastx, Height - last.DPS * yPixelsPerDPS, x, Height - stats.DPS * yPixelsPerDPS);
                g.DrawLine(new Pen(abs.AbilityCritsPerSec), lastx, Height - last.CritsPerSecond * yPixelsPerCPS, x, Height - stats.CritsPerSecond * yPixelsPerCPS);
                g.DrawLine(new Pen(abs.AbilityAttacksPerSec), lastx, Height - last.AttacksPerSecond * yPixelsPerAPS, x, Height - stats.AttacksPerSecond * yPixelsPerAPS);
                g.DrawLine(new Pen(abs.AbilityDamagePerHit), lastx, Height - last.AvgDamagePerHit * yPixelsPerAvgDamage, x, Height - stats.AvgDamagePerHit * yPixelsPerAvgDamage);
                g.DrawLine(new Pen(abs.AbilityRageTimeToNextLevel), lastx, Height - lastRPS * yPixelsPerRPS, x, Height - ragePerSec * yPixelsPerRPS);
                g.DrawString(stats.DPS.ToString(), new Font("Arial", 8), new SolidBrush(abs.AbilityDPS),
                    x, Height - stats.DPS * yPixelsPerDPS - 10);
                g.DrawString((int)(100 * stats.CritsPerSecond / stats.AttacksPerSecond) + "%",
                    new Font("Arial", 8), new SolidBrush(abs.AbilityCritsPerSec),
                    x, Height - stats.CritsPerSecond * yPixelsPerCPS - 10);
                g.DrawString(stats.AttacksPerSecond.ToString(), new Font("Arial", 8), new SolidBrush(abs.AbilityAttacksPerSec),
                    x, Height - stats.AttacksPerSecond * yPixelsPerAPS - 10);
                g.DrawString(stats.AvgDamagePerHit.ToString(), new Font("Arial", 8), new SolidBrush(abs.AbilityDamagePerHit),
                    x, Height - stats.AvgDamagePerHit * yPixelsPerAvgDamage - 10);
                g.DrawString(ragePerSec + "s", new Font("Arial", 8), new SolidBrush(abs.AbilityRageTimeToNextLevel),
                    x, Height - ragePerSec * yPixelsPerRPS - 10);
                last = stats;
                lastRPS = ragePerSec;
            }
        }