示例#1
0
 internal static void GameEnd(List<C3Player> winningteamplayers, List<C3Player> losingteamplayers, string gametype, int winningteamscore, int losingteamscore)
 {
     GameEndArgs e = new GameEndArgs();
     e.WinningTeamPlayers = winningteamplayers;
     e.LosingTeamPlayers = losingteamplayers;
     e.GameType = gametype;
     e.WinningTeamScore = winningteamscore;
     e.LosingTeamScore = losingteamscore;
     if (OnGameEnd != null)
         OnGameEnd(e);
 }
示例#2
0
        internal static void GameEnd(List <C3Player> winningteamplayers, List <C3Player> losingteamplayers, string gametype, int winningteamscore, int losingteamscore)
        {
            GameEndArgs e = new GameEndArgs();

            e.WinningTeamPlayers = winningteamplayers;
            e.LosingTeamPlayers  = losingteamplayers;
            e.GameType           = gametype;
            e.WinningTeamScore   = winningteamscore;
            e.LosingTeamScore    = losingteamscore;
            if (OnGameEnd != null)
            {
                OnGameEnd(e);
            }
        }
示例#3
0
        public static void OnGameEnd(C3Mod.GameEndArgs e)
        {
            int winnings = 0;

            switch (e.GameType.ToLower())
            {
            case "tdm":
            {
                int multiplier = e.WinningTeamScore - e.LosingTeamScore;
                winnings = CEConfig.TDMReward * multiplier;
                break;
            }

            case "ctf":
            {
                winnings = CEConfig.CTFReward;
                break;
            }

            case "1v1":
            {
                winnings = GetCEPlayer(e.WinningTeamPlayers[0].TSPlayer.Index).DuelReward *2;
                break;
            }

            case "oneflag":
            {
                winnings = CEConfig.OFReward;
                break;
            }
            }
            foreach (C3Player player in e.WinningTeamPlayers)
            {
                if (player.TSPlayer.IsLoggedIn)
                {
                    EPREvents.PointOperate(ServerPointSystem.ServerPointSystem.GetEPRPlayerByIndex(player.Index),
                                           winnings, PointOperateReason.PVPEvent);
                    player.TSPlayer.SendMessage(
                        "You gained " + winnings.ToString() + " " + ServerPointSystem.ServerPointSystem.currname + "s!",
                        Color.Green);
                }
            }
        }