Exemplo n.º 1
0
        public uint GetPenGain(ExperienceRates ExpRates, out uint bonusPen)
        {
            var exp = GetExpGain(ExpRates, out var bonusExp);

            exp -= bonusExp;

            var pen = exp;

            bonusPen = (uint)(pen * Player.GetPenRate());

            return(pen + bonusPen);
        }
Exemplo n.º 2
0
        public uint GetExpGain(ExperienceRates ExpRates, out uint bonusExp)
        {
            var place = 1;
            var plrs  = Player.Room.TeamManager.Players
                        .Where(plr => plr.RoomInfo.State == PlayerState.Waiting &&
                               plr.RoomInfo.Mode == PlayerGameMode.Normal)
                        .ToArray();

            foreach (var plr in plrs.OrderByDescending(plr => plr.RoomInfo.Stats.TotalScore))
            {
                if (plr == Player)
                {
                    break;
                }

                place++;
                if (place > 3)
                {
                    break;
                }
            }

            var rankingBonus = 1.0f;

            switch (place)
            {
            case 1:
                rankingBonus += ExpRates.FirstPlaceBonus / 100.0f;
                break;

            case 2:
                rankingBonus += ExpRates.SecondPlaceBonus / 100.0f;
                break;

            case 3:
                rankingBonus += ExpRates.ThirdPlaceBonus / 100.0f;
                break;
            }

            var TimeExp    = ExpRates.ExpPerMin * Player.RoomInfo.PlayTime.Minutes;
            var PlayersExp = plrs.Length * ExpRates.PlayerCountFactor;
            var ScoreExp   = ExpRates.ExpPerMin * TotalScore;

            var ExpGained = (TimeExp + PlayersExp + ScoreExp) * rankingBonus;

            bonusExp = (uint)(ExpGained * Player.GetExpRate());

            return((uint)ExpGained + bonusExp);
        }
Exemplo n.º 3
0
        public virtual int GetExpGain(out int bonusExp)
        {
            var             place    = 1;
            ExperienceRates ExpRates = null;
            var             game     = Config.Instance.Game;

            bonusExp = 0;

            switch (Player.Room.GameRuleManager.GameRule.GameRule)
            {
            case GameRule.Arcade:
                break;

            case GameRule.Arena:
                break;

            case GameRule.BattleRoyal:
                ExpRates = game.BRExpRates;
                break;

            case GameRule.Captain:
                ExpRates = game.CaptainExpRates;
                break;

            case GameRule.Challenge:
                break;

            case GameRule.Chaser:
                ExpRates = game.ChaserExpRates;
                break;

            case GameRule.CombatTrainingDM:
                break;

            case GameRule.CombatTrainingTD:
                break;

            case GameRule.Deathmatch:
                ExpRates = game.DeathmatchExpRates;
                break;

            case GameRule.Horde:
                break;

            case GameRule.PassTouchdown:
                break;

            case GameRule.Practice:
                break;

            case GameRule.SemiTouchdown:
                break;

            case GameRule.Siege:
                break;

            case GameRule.SnowballFight:
                break;

            case GameRule.Survival:
                break;

            case GameRule.Touchdown:
                ExpRates = game.TouchdownExpRates;
                break;

            case GameRule.Tutorial:
                break;

            case GameRule.Warfare:
                break;
            }

            if (ExpRates == null)
            {
                return(0);
            }

            var plrs = Player.Room.TeamManager.Players
                       .Where(plr => plr.RoomInfo.State == PlayerState.Waiting &&
                              plr.RoomInfo.Mode == PlayerGameMode.Normal)
                       .ToArray();

            foreach (var plr in plrs.OrderByDescending(plr => plr.RoomInfo.Stats.TotalScore))
            {
                if (plr == Player)
                {
                    break;
                }

                place++;
                if (place > 3)
                {
                    break;
                }
            }

            var rankingBonus = 1.0f;

            switch (place)
            {
            case 1:
                rankingBonus += ExpRates.FirstPlaceBonus / 100.0f;
                break;

            case 2:
                rankingBonus += ExpRates.SecondPlaceBonus / 100.0f;
                break;

            case 3:
                rankingBonus += ExpRates.ThirdPlaceBonus / 100.0f;
                break;
            }

            var TimeExp    = ExpRates.ExpPerMin * Player.RoomInfo.PlayTime.Minutes;
            var PlayersExp = plrs.Length * ExpRates.PlayerCountFactor;
            var ScoreExp   = ExpRates.ExpPerMin * TotalScore;

            var ExpGained = (TimeExp + PlayersExp + ScoreExp) * rankingBonus;

            bonusExp = (int)(ExpGained /* * Player.GetExpRate()*/);

            return((int)ExpGained + bonusExp);
        }