private int CalculateGuildMatchResult(List <Player> players, int winTeam) { int result; if (base.RoomType == eRoomType.Match && base.GameType == eGameType.Guild) { StringBuilder winStr = new StringBuilder(LanguageMgr.GetTranslation("Game.Server.SceneGames.OnStopping.Msg5", new object[0])); IGamePlayer winPlayer = null; IGamePlayer losePlayer = null; int teamTotalHurt = 0; foreach (Player p in players) { if (p.Team == winTeam) { winStr.Append(string.Format("[{0}]", p.PlayerDetail.PlayerCharacter.NickName)); winPlayer = p.PlayerDetail; int maxHurt = (int)((p.Team == 1) ? ((float)this.m_blueTeam.Count * this.m_blueAvgLevel * 300f) : (this.m_redAvgLevel * (float)this.m_redTeam.Count * 300f)); int totalHurt = (p.TotalHurt > maxHurt) ? maxHurt : p.TotalHurt; teamTotalHurt += totalHurt; } else { losePlayer = p.PlayerDetail; } } if (losePlayer != null) { winStr.Append(LanguageMgr.GetTranslation("Game.Server.SceneGames.OnStopping.Msg1", new object[0]) + losePlayer.PlayerCharacter.ConsortiaName + LanguageMgr.GetTranslation("Game.Server.SceneGames.OnStopping.Msg2", new object[0])); winPlayer.ConsortiaFight(winPlayer.PlayerCharacter.ConsortiaID, losePlayer.PlayerCharacter.ConsortiaID, base.RoomType, base.GameType, teamTotalHurt, players.Count); int riches = 0; int count = (winTeam == 1) ? this.m_blueTeam.Count : this.m_redTeam.Count; riches = (int)((float)(count + teamTotalHurt / 2000) * winPlayer.GMRichesRate * winPlayer.AuncherRichesRate); winPlayer.SendConsortiaFight(winPlayer.PlayerCharacter.ConsortiaID, riches, winStr.ToString()); if (riches > 100000) { PVPGame.log.Error(string.Format("pvpgame ======= riches : {0}, count : {1}, teamTotalHurt : {2}, GMRichesRate : {3}, AuncherRichesRate : {4}", new object[] { riches, count, teamTotalHurt, winPlayer.GMRichesRate, winPlayer.AuncherRichesRate })); } foreach (Player p in players) { if (p.Team == winTeam) { p.PlayerDetail.AddRobRiches(riches); } } result = riches; return(result); } } result = 0; return(result); }
private int CalculateGuildMatchResult(List <Player> players, int winTeam) { if (RoomType == eRoomType.Match) { StringBuilder winStr = new StringBuilder(LanguageMgr.GetTranslation("Game.Server.SceneGames.OnStopping.Msg5")); StringBuilder loseStr = new StringBuilder(LanguageMgr.GetTranslation("Game.Server.SceneGames.OnStopping.Msg5")); IGamePlayer winPlayer = null; IGamePlayer losePlayer = null; int count = 0; foreach (Player p in players) { if (p.Team == winTeam) { winStr.Append(string.Format("[{0}]", p.PlayerDetail.PlayerCharacter.NickName)); winPlayer = p.PlayerDetail; } else { loseStr.Append(string.Format("{0}", p.PlayerDetail.PlayerCharacter.NickName)); losePlayer = p.PlayerDetail; count++; } } if (losePlayer != null) { winStr.Append(LanguageMgr.GetTranslation("Game.Server.SceneGames.OnStopping.Msg1") + losePlayer.PlayerCharacter.ConsortiaName + LanguageMgr.GetTranslation("Game.Server.SceneGames.OnStopping.Msg2")); loseStr.Append(LanguageMgr.GetTranslation("Game.Server.SceneGames.OnStopping.Msg3") + winPlayer.PlayerCharacter.ConsortiaName + LanguageMgr.GetTranslation("Game.Server.SceneGames.OnStopping.Msg4")); int riches = 0; if (GameType == eGameType.Guild) { riches = count + TotalHurt / 2000; } winPlayer.ConsortiaFight(winPlayer.PlayerCharacter.ConsortiaID, losePlayer.PlayerCharacter.ConsortiaID, Players, RoomType, GameType, TotalHurt, players.Count); if (winPlayer.ServerID != losePlayer.ServerID) { losePlayer.ConsortiaFight(winPlayer.PlayerCharacter.ConsortiaID, losePlayer.PlayerCharacter.ConsortiaID, Players, RoomType, GameType, TotalHurt, players.Count); } if (GameType == eGameType.Guild) { winPlayer.SendConsortiaFight(winPlayer.PlayerCharacter.ConsortiaID, riches, winStr.ToString()); //losePlayer.SendConsortiaFight(losePlayer.PlayerCharacter.ConsortiaID, -riches, loseStr.ToString()); } return(riches); } } return(0); }
private int CalculateGuildMatchResult(List <Player> players, int winTeam) { if (base.RoomType == eRoomType.Match) { StringBuilder stringBuilder = new StringBuilder(LanguageMgr.GetTranslation("Game.Server.SceneGames.OnStopping.Msg5", new object[0])); StringBuilder stringBuilder2 = new StringBuilder(LanguageMgr.GetTranslation("Game.Server.SceneGames.OnStopping.Msg5", new object[0])); IGamePlayer gamePlayer = null; IGamePlayer gamePlayer2 = null; int num = 0; foreach (Player current in players) { if (current.Team == winTeam) { stringBuilder.Append(string.Format("[{0}]", current.PlayerDetail.PlayerCharacter.NickName)); gamePlayer = current.PlayerDetail; } else { stringBuilder2.Append(string.Format("{0}", current.PlayerDetail.PlayerCharacter.NickName)); gamePlayer2 = current.PlayerDetail; num++; } } if (gamePlayer2 != null) { stringBuilder.Append(LanguageMgr.GetTranslation("Game.Server.SceneGames.OnStopping.Msg1", new object[0]) + gamePlayer2.PlayerCharacter.ConsortiaName + LanguageMgr.GetTranslation("Game.Server.SceneGames.OnStopping.Msg2", new object[0])); stringBuilder2.Append(LanguageMgr.GetTranslation("Game.Server.SceneGames.OnStopping.Msg3", new object[0]) + gamePlayer.PlayerCharacter.ConsortiaName + LanguageMgr.GetTranslation("Game.Server.SceneGames.OnStopping.Msg4", new object[0])); int num2 = 0; if (base.GameType == eGameType.Guild) { num2 = num + this.TotalHurt / 2000; } gamePlayer.ConsortiaFight(gamePlayer.PlayerCharacter.ConsortiaID, gamePlayer2.PlayerCharacter.ConsortiaID, base.Players, base.RoomType, base.GameType, this.TotalHurt, players.Count); if (gamePlayer.ServerID != gamePlayer2.ServerID) { gamePlayer2.ConsortiaFight(gamePlayer.PlayerCharacter.ConsortiaID, gamePlayer2.PlayerCharacter.ConsortiaID, base.Players, base.RoomType, base.GameType, this.TotalHurt, players.Count); } if (base.GameType == eGameType.Guild) { gamePlayer.SendConsortiaFight(gamePlayer.PlayerCharacter.ConsortiaID, num2, stringBuilder.ToString()); } return(num2); } } return(0); }