Example #1
0
        public short CalculateEarnedHonor(CharacterFighter character)
        {
            if (Draw)
            {
                return(0);
            }

            if (character.OpposedTeam.AlignmentSide == AlignmentSideEnum.ALIGNMENT_NEUTRAL)
            {
                return(0);
            }

            var winnersLevel   = (double)Winners.GetAllFightersWithLeavers <CharacterFighter>().Sum(entry => entry.Level);
            var losersLevel    = (double)Losers.GetAllFightersWithLeavers <CharacterFighter>().Sum(entry => entry.Level);
            var maxLosersLevel = winnersLevel + 15;

            var delta = Math.Floor(Math.Sqrt(character.Level) * 10 * ((losersLevel > maxLosersLevel ? maxLosersLevel : losersLevel) / winnersLevel));

            if (Losers == character.Team)
            {
                delta = -delta;
            }

            return((short)delta);
        }