public string SelectMap(GameTypeAvailability gameTypeAvailability) { List <GameMapConfig> maps = gameTypeAvailability.SubTypes[0].GameMapConfigs; Random rand = new Random(); int index = rand.Next(0, maps.Count); return(maps[index].Map); }
public static GameTypeAvailability GetCustomGameTypeAvailability() { GameTypeAvailability type = new GameTypeAvailability(); type.IsActive = EvoSGameConfig.GameTypeAvailability_Custom; type.MaxWillFillPerTeam = 0; type.SubTypes = new List <GameSubType>(); return(type); }
private static GameTypeAvailability GetCustomGameTypeAvailability() { GameTypeAvailability type = new GameTypeAvailability(); type.IsActive = ConfigManager.GameTypeCustomAvailable; type.MaxWillFillPerTeam = 0; type.SubTypes = new List <GameSubType>(); return(type); }
private static GameTypeAvailability GetPvPGameTypeAvailability() { GameTypeAvailability type = new GameTypeAvailability(); type.IsActive = ConfigManager.GameTypePvPAvailable; type.MaxWillFillPerTeam = 0; type.SubTypes = new List <GameSubType>() { new GameSubType { LocalizedName = "GenericPvP@SubTypes", GameMapConfigs = new List <GameMapConfig> { new GameMapConfig(Maps.VR_Practice, true) }, RewardBucket = GameBalanceVars.GameRewardBucketType.NoRewards, PersistedStatBucket = PersistedStatBucket.DoNotPersist, TeamAPlayers = 1, TeamABots = 0, TeamBPlayers = 1, TeamBBots = 0, Mods = new List <GameSubType.SubTypeMods> { GameSubType.SubTypeMods.AllowPlayingLockedCharacters, GameSubType.SubTypeMods.HumansHaveFirstSlots }, TeamComposition = new TeamCompositionRules { Rules = new Dictionary <TeamCompositionRules.SlotTypes, FreelancerSet> { { TeamCompositionRules.SlotTypes.A1, new FreelancerSet { Roles = new List <CharacterRole> { CharacterRole.Tank, CharacterRole.Assassin, CharacterRole.Support } } }, { TeamCompositionRules.SlotTypes.B1, new FreelancerSet { Roles = new List <CharacterRole> { CharacterRole.Tank, CharacterRole.Assassin, CharacterRole.Support } } } } } } }; return(type); }
public static GameTypeAvailability GetCoopGameTypeAvailability() { GameTypeAvailability type = new GameTypeAvailability(); type.IsActive = EvoSGameConfig.GameTypeAvailability_Coop; type.MaxWillFillPerTeam = 0; type.SubTypes = new List <GameSubType>() { new GameSubType() { TeamAPlayers = 4, TeamABots = 0, TeamBPlayers = 0, TeamBBots = 4, DuplicationRule = FreelancerDuplicationRuleTypes.noneInTeam, GameMapConfigs = GameMapConfig.GetDeatmatchMaps(), InstructionsToDisplay = GameSubType.GameLoadScreenInstructions.Default, } }; return(type); }
public LobbyGameInfo CreateGameInfo() { GameTypeAvailability gameAvailability = Gamemode.GameModeManager.GetGameTypeAvailabilities()[GameType]; LobbyGameInfo gameInfo = new LobbyGameInfo { AcceptedPlayers = gameAvailability.TeamAPlayers + gameAvailability.TeamBPlayers, AcceptTimeout = GameType == GameType.Practice ? TimeSpan.FromSeconds(0) : TimeSpan.FromSeconds(5), ActiveHumanPlayers = 0, ActivePlayers = 0, ActiveSpectators = 0, CreateTimestamp = DateTime.Now.Ticks, GameConfig = new LobbyGameConfig { GameOptionFlags = GameOptionFlag.AllowDuplicateCharacters & GameOptionFlag.EnableTeamAIOutput & GameOptionFlag.NoInputIdleDisconnect, GameType = GameType, IsActive = true, RoomName = $"Evos-{GameType.ToString()}-{GameID++}", SubTypes = gameAvailability.SubTypes, TeamAPlayers = gameAvailability.TeamAPlayers, TeamABots = gameAvailability.TeamABots, TeamBPlayers = gameAvailability.TeamBPlayers, TeamBBots = gameAvailability.TeamBBots, Map = SelectMap(gameAvailability), ResolveTimeoutLimit = 1600, Spectators = 0 }, GameResult = GameResult.NoResult, GameServerAddress = "", GameStatus = GameStatus.Assembling, GameServerHost = "", IsActive = true, LoadoutSelectTimeout = GameType == GameType.Practice ? TimeSpan.FromSeconds(0) : TimeSpan.FromSeconds(5), SelectTimeout = GameType == GameType.Practice ? TimeSpan.FromSeconds(0) : TimeSpan.FromSeconds(5), // TODO: there are more options that may be usefull }; return(gameInfo); }
public static GameTypeAvailability GetPracticeGameTypeAvailability() { GameTypeAvailability type = new GameTypeAvailability(); type.MaxWillFillPerTeam = 4; type.IsActive = EvoSGameConfig.GameTypeAvailability_Practice; type.QueueableGroupSizes = new Dictionary <int, RequirementCollection> { { 1, null } }; type.TeamAPlayers = 1; type.TeamBBots = 2; type.SubTypes = new List <GameSubType>() { new GameSubType { LocalizedName = "GenericPractice@SubTypes", GameMapConfigs = new List <GameMapConfig> { new GameMapConfig(Maps.Skyway_Deathmatch, true) }, RewardBucket = GameBalanceVars.GameRewardBucketType.NoRewards, PersistedStatBucket = PersistedStatBucket.DoNotPersist, TeamBBots = 2, Mods = new List <GameSubType.SubTypeMods> { GameSubType.SubTypeMods.AllowPlayingLockedCharacters, GameSubType.SubTypeMods.HumansHaveFirstSlots }, TeamComposition = new TeamCompositionRules { Rules = new Dictionary <TeamCompositionRules.SlotTypes, FreelancerSet> { { TeamCompositionRules.SlotTypes.A1, new FreelancerSet { Roles = new List <CharacterRole> { CharacterRole.Tank, CharacterRole.Assassin, CharacterRole.Support } } }, { TeamCompositionRules.SlotTypes.A2, new FreelancerSet { Types = new List <CharacterType> { CharacterType.PunchingDummy } } }, { TeamCompositionRules.SlotTypes.A4, new FreelancerSet { Types = new List <CharacterType> { CharacterType.PunchingDummy } } }, { TeamCompositionRules.SlotTypes.A3, new FreelancerSet { Types = new List <CharacterType> { CharacterType.PunchingDummy } } }, { TeamCompositionRules.SlotTypes.TeamB, new FreelancerSet { Types = new List <CharacterType> { CharacterType.PunchingDummy } } } } } } }; return(type); }