Beispiel #1
0
        //重新计算怪物最大等级
        private void ResetMonsterLevel()
        {
            var totles2 = 0;
            var maxNow  = 0;
            var players = mPlayerDict.Values;

            foreach (var player in players)
            {
                var l = player.GetLevel();
                totles2 += l * l;
            }
            maxNow = (int)Math.Sqrt(totles2 / mPlayerDict.Count);

            if (maxLevel != maxNow)
            {
                maxLevel = maxNow;
                leftTower.SetToLevel(maxLevel);
                middleTower.SetToLevel(maxLevel);
                rightTower.SetToLevel(maxLevel);
                mainTower.SetToLevel(maxLevel);
            }
        }