示例#1
0
        public static int CalcDealtDamage(IDamageHitter damage,
                                          int armorValue, int randomSeed, int hitRandomSeed)
        {
            randomSeed += hitRandomSeed;

            int    dealt = 0;
            Random rand;

            rand = new Random(randomSeed + 19042);
            if (rand.Next(100) < damage.PureChance.Read())
            {
                dealt += damage.Subtract.Read();
            }
            else
            {
                dealt += Math.Max(1, damage.Subtract.Read() - armorValue);
            }

            rand = new Random(randomSeed + 642);
            if (rand.Next(100) < damage.CriticalChance.Read())
            {
                dealt *= 2;
            }

            return(dealt);
        }
示例#2
0
        public static int CalcDealtDot(int ticks,
                                       IStickHitItem stick, IDamageHitter damage,
                                       int armorValue, int randomSeed, int hitRandomSeed)
        {
            int dealt  = 0;
            int repeat = (stick.Elapsed.Read() % damage.DotSpeed.Read()) + ticks / damage.DotSpeed.Read();

            if (stick.Elapsed.Read() == 0 || repeat > 0)
            {
                dealt += CalcDealtDamage(damage, armorValue, randomSeed, hitRandomSeed) * Math.Max(1, repeat);
            }
            return(dealt);
        }