コード例 #1
0
        static void Main(string[] args)
        {
            Stopwatch stopWatch = new Stopwatch();

            stopWatch.Start();

            Console.WriteLine("Starting Ignite Simulation");
            TargetDummy target   = new TargetDummy();
            Mage        mages    = new Mage(4, 35, 95, 0, target);
            int         tickSize = mages.TimeBetweenFireballs();

            Console.WriteLine("Time Between Fireballs: " + tickSize);
            long numberOfFireballsVolleys = 30000000;
            long maxTicks = numberOfFireballsVolleys * 300;

            for (long tick = 0; tick < maxTicks; tick += tickSize)
            {
                mages.CastFireBall(tick);
            }

            Random   temp     = new Random();
            FireBall fireball = new FireBall(temp, 35, 95, 0, 0);

            fireball.critStatus = false;
            Console.WriteLine("Single Fireball Dmg (non crit):  " + fireball.damage);
            List <double> report = target.ReportDamage();

            Console.WriteLine("Reports:");
            //Console.WriteLine("Number of spells non-crit: " + report[3]);
            //Console.WriteLine("Number of spells resisted: " + report[4]);
            //Console.WriteLine("Number of spells crit: " + report[5]);
            //Console.WriteLine("Number of total fireballs: " + report[6]);
            Console.WriteLine("Fireball damage taken / 500: " + report[0] / 500);
            Console.WriteLine("Ignite damage taken / 500: " + report[1] / 500);
            Console.WriteLine("Total damage taken / 500: " + report[2] / 500);

            stopWatch.Stop();
            Console.WriteLine("Total Program Timer:       " + stopWatch.ElapsedMilliseconds + " ms");
        }
コード例 #2
0
        // private int resistCount = 0;
        //private int nonCritCount = 0;
        //private int critCount = 0;

        public void RecieveFireball(FireBall fireball)
        {
            ignite.CheckStatus(fireball.tick);
            if (fireball.hitStatus == false)
            {
                //resistCount++;
                //Console.WriteLine("Tick: " + fireball.tick + " Fireball resisted");
                return;
            }
            else if (fireball.critStatus == true)
            {
                //Console.WriteLine("Tick: " + fireball.tick + " Fireball crit for " + fireball.damage);
                //critCount++;
                ignite.newCrit(fireball.tick, fireball.damage);
                fireballDamageTaken += fireball.damage;
            }
            else
            {
                //Console.WriteLine("Tick: " + fireball.tick + " Fireball hit for " + fireball.damage);
                //nonCritCount++;
                fireballDamageTaken += fireball.damage;
            }
        }
コード例 #3
0
        public void CastFireBall(long tick)
        {
            FireBall fireball = new FireBall(rand, critChance, hitChance, spellPower, tick);

            target.RecieveFireball(fireball);
        }