internal SortieNodeInfo(MapInfo rpMap, RawMapExploration rpData) { ID = rpData.Node; var rDifficulty = rpMap.Difficulty; if (!rDifficulty.HasValue) { InternalID = ID; } else { var rDifficultyCount = Enum.GetNames(typeof(EventMapDifficulty)).Length - 1; InternalID = ID * rDifficultyCount + (int)rDifficulty.Value - 3; } WikiID = MapService.Instance.GetNodeWikiID(rpMap.ID, ID); EventType = rpData.NodeEventType; EventSubType = rpData.NodeEventSubType; switch (EventType) { case SortieEventType.Reward: Event = new RewardEvent(rpData); break; case SortieEventType.Whirlpool: Event = new WhirlpoolEvent(rpData); break; case SortieEventType.NormalBattle: case SortieEventType.BossBattle: Event = new BattleEvent(rpMap, rpData, WikiID); break; case SortieEventType.NothingHappened: Event = new NothingHappenedEvent(rpMap, rpData); break; case SortieEventType.AviationReconnaissance: Event = new AviationReconnaissanceEvent(rpData); break; case SortieEventType.EscortSuccess: Event = new EscortSuccessEvent(rpData); break; case SortieEventType.Landing: Event = new LandingEvent(rpData); break; } IsDeadEnd = rpData.NextRouteCount == 0; }
internal SortieNodeInfo(SortieInfo rpOwner, long rpTimestamp, RawMapExploration rpData) { r_Owner = rpOwner; ID = rpData.Node; var rMap = r_Owner.Map; WikiID = MapService.Instance.GetNodeWikiID(rMap.ID, ID); EventType = rpData.NodeEventType; EventSubType = rpData.NodeEventSubType; switch (EventType) { case SortieEventType.Reward: Event = new RewardEvent(rpData); break; case SortieEventType.Whirlpool: Event = new WhirlpoolEvent(r_Owner.Fleet.Ships, r_Owner.EscortFleet, rpData); break; case SortieEventType.NormalBattle: case SortieEventType.BossBattle: Event = new BattleEvent(rpTimestamp, rMap, rpData, WikiID); break; case SortieEventType.NothingHappened: Event = new NothingHappenedEvent(rMap, rpData); break; case SortieEventType.AviationReconnaissance: Event = new AviationReconnaissanceEvent(rpData); break; case SortieEventType.EscortSuccess: Event = new EscortSuccessEvent(rpData); break; case SortieEventType.Landing: Event = new LandingEvent(rpData); break; } IsDeadEnd = rpData.NextRouteCount == 0; }
static async Task Main(string[] args) { NothingHappenedEvent.GetWeightedRandomMessage(); LootEvent.GetWeightedRandomItem(); Encounter.GetWeightedRandomMessage(); WriteLine("Hunger Games"); var telegramGameHost = new TelegramGameHost(); telegramGameHost.Start(); Thread.Sleep(int.MaxValue); Game game = new Game(new ConsoleNotificator()); while (true) { game.Players.Add(new ConsolePlayer(game)); await game.StartGame(); } }
internal SortieNodeInfo(SortieInfo rpOwner, long rpTimestamp, RawMapExploration rpData) { r_Owner = rpOwner; ID = rpData.Node; var rMap = r_Owner.Map; WikiID = MapService.Instance.GetNodeWikiID(rMap.ID, ID); EventType = rpData.NodeEventType; EventSubType = rpData.NodeEventSubType; switch (EventType) { case SortieEventType.Reward: Event = new RewardEvent(rpData); break; case SortieEventType.Whirlpool: Event = new WhirlpoolEvent(r_Owner.Fleet.Ships, r_Owner.EscortFleet, rpData); break; case SortieEventType.NormalBattle: case SortieEventType.BossBattle: Event = new BattleEvent(rpTimestamp, rMap, rpData, WikiID); break; case SortieEventType.NothingHappened: Event = new NothingHappenedEvent(rMap, rpData); break; case SortieEventType.AviationReconnaissance: Event = new AviationReconnaissanceEvent(rpData); break; case SortieEventType.EscortSuccess: Event = new EscortSuccessEvent(rpData); break; case SortieEventType.Landing: Event = new LandingEvent(rpData); break; } IsDeadEnd = rpData.NextRouteCount == 0; if (rpData.EnemyAerialRaid != null) { try { EnemyAerialRaid = new EnemyAerialRaid(rpData.EnemyAerialRaid); var rBattleEvent = Event as BattleEvent; if (rBattleEvent != null) { rBattleEvent.EnemyAerialRaid = EnemyAerialRaid; EnemyAerialRaid = null; } } catch (Exception e) { Logger.Write(LoggingLevel.Error, string.Format(StringResources.Instance.Main.Log_Exception_API_ParseException, e.Message)); } } }