public MatchesBase(IInternalService internalService, IWebsiteService website, IMatchesTabService matchesTab, GameMode matchGameMode, MatchesTab currentTab) : base(internalService) { Website = website; MatchesTabService = matchesTab; MatchGameMode = matchGameMode; CurrentTab = currentTab; ShowMatchSummaryButtonEnabled = true; SeasonList.Add("Lifetime"); SeasonList.AddRange(HeroesHelpers.Seasons.GetSeasonList()); SelectedSeasonOption = SeasonList[0]; GameTimeList = HeroesHelpers.GameDates.GameTimeList; SelectedGameTimeOption = GameTimeList[0]; GameDateList = HeroesHelpers.GameDates.GameDateList; SelectedGameDateOption = GameDateList[0]; MapsList.Add("Any"); MapsList.AddRange(HeroesIcons.MapBackgrounds().GetMapsList()); SelectedMapOption = MapsList[0]; ReplayBuildsList.Add("Any"); ReplayBuildsList.AddRange(HeroesHelpers.Builds.GetBuildsList(HeroesIcons)); SelectedBuildOption = ReplayBuildsList[0]; HeroesList.Add("Any"); HeroesList.AddRange(HeroesIcons.Heroes().GetListOfHeroes(HeroesIcons.GetLatestHeroesBuild())); SelectedCharacter = HeroesList[0]; Messenger.Default.Register <MatchesDataMessage>(this, (message) => ReceivedMatchSearchData(message)); Messenger.Default.Register <NotificationMessage>(this, async(message) => await ReceivedMessageAsync(message)); }
public override void NextFrame() { if (!HasNextFrame()) { throw new Exception("There is no next frame possible."); } if (_turn == 0) { _currentRound++; } // get current combatant var combatant = _initiativeOrder[_turn]; // increase turn to next initiatives turn _turn = ++_turn % _initiativeOrder.Count; // dead targets can't attack any more if (!combatant.CanAct) { return; } var target = combatant.EngagedEnemies.FirstOrDefault(p => p.IsAlive); var exCombatActions = combatant.CombatActions.Select(p => p.Executable(target)).Where(p => p != null); // choose just one action here no AI .... var combatActionExec = exCombatActions.FirstOrDefault(p => p is UnarmedAttack || p is MeleeAttack || p is RangedAttack); if (combatActionExec == null) { return; } // attack combatant.TakeAction(combatActionExec); if (target != null && target.IsDead && target is Monster killedMonster) { var expReward = killedMonster.Experience / HeroesList.Count; HeroesList.ForEach(p => p.AddExp(expReward, killedMonster)); } if (!combatant.EngagedEnemies.Exists(p => p.IsAlive)) { _winner = combatant; } }
public StatsPartiesViewModel(IInternalService internalService, ILoadingOverlayWindowService loadingOverlayWindow) : base(internalService) { LoadingOverlayWindow = loadingOverlayWindow; SeasonList.Add(InitialSeasonListOption); SeasonList.AddRange(HeroesHelpers.Seasons.GetSeasonList()); SelectedSeason = SeasonList[0]; HeroesList.Add(InitialHeroListOption); HeroesList.AddRange(HeroesIcons.HeroesData().HeroNames().OrderBy(x => x).ToList()); SelectedCharacter = Enumerable.Repeat(InitialHeroListOption, SelectedCharacter.Length).ToArray(); ClearOptions(); }
public override void EvaluateAdventureState() { UpdateAdventureStats(); if (HeroesList.All(p => p.IsDead)) { AdventureState = AdventureState.Failed; } else if (AdventureStats[Generator.AdventureStats.Explore] >= 1) { AdventureState = AdventureState.Completed; } else if (CurrentBlockRound >= MaxRoundsPerBlock && _roundMode != Mode.Combat) { AdventureState = AdventureState.Extended; } }
public MatchesBase(IInternalService internalService, IWebsiteService website, IMatchesTabService matchesTab, GameMode matchGameMode, MatchesTab currentTab) : base(internalService) { Website = website; MatchesTabService = matchesTab; MatchGameMode = matchGameMode; CurrentTab = currentTab; ShowMatchSummaryButtonEnabled = true; SeasonList.AddRange(HeroesHelpers.Seasons.GetSeasonList()); SelectedSeasonOption = SeasonList[0]; GameTimeList = HeroesHelpers.GameDateFilters.GameTimeList; SelectedGameTimeOption = FilterGameTimeOption.Any.GetFriendlyName(); GameDateList = HeroesHelpers.GameDateFilters.GameDateList; SelectedGameDateOption = FilterGameDateOption.Any.GetFriendlyName(); MapsList.Add("Any"); MapsList.AddRange(HeroesIcons.Battlegrounds().Battlegrounds(true).Select(x => x.Name).ToList()); SelectedMapOption = MapsList[0]; ReplayBuildsList.Add("Any"); ReplayBuildsList.AddRange(HeroesIcons.HeroBuilds().Builds); SelectedBuildOption = ReplayBuildsList[0]; HeroesList.Add("Any"); HeroesList.AddRange(HeroesIcons.HeroesData().HeroNames().OrderBy(x => x).ToList()); SelectedCharacter = HeroesList[0]; PartyCountList.Add("Any"); PartyCountList.AddRange(HeroesHelpers.Parties.GetPartyList()); SelectedParty = PartyCountList[0]; SelectedAccountLevel = 0; Messenger.Default.Register <MatchesDataMessage>(this, (message) => ReceivedMatchSearchData(message)); Messenger.Default.Register <NotificationMessage>(this, async(message) => await ReceivedMessageAsync(message)); }
public StatsHeroesViewModel(IInternalService internalService, ILoadingOverlayWindowService loadingOverlayWindow) : base(internalService) { LoadingOverlayWindow = loadingOverlayWindow; IsTotalsAveragesChecked = true; IsTalentsChecked = true; IsAwardsChecked = true; SeasonList.Add(InitialSeasonListOption); SeasonList.AddRange(HeroesHelpers.Seasons.GetSeasonList()); SelectedSeason = SeasonList[0]; HeroesList.Add(InitialHeroListOption); HeroesList.AddRange(HeroesIcons.HeroesData().HeroNames().OrderBy(x => x).ToList()); SelectedHero = HeroesList[0]; GameModeList.AddRange(HeroesHelpers.GameModes.GetAllGameModesList()); MapList.AddRange(HeroesIcons.Battlegrounds().Battlegrounds(true).Select(x => x.Name).ToList()); StatsHeroesDataViewModel = new StatsHeroesDataViewModel(internalService, MapList); }
public StatsHeroesViewModel(IInternalService internalService, ILoadingOverlayWindowService loadingOverlayWindow) : base(internalService) { LoadingOverlayWindow = loadingOverlayWindow; IsTotalsAveragesChecked = true; IsTalentsChecked = true; IsAwardsChecked = true; SeasonList.Add(InitialSeasonListOption); SeasonList.Add("Lifetime"); SeasonList.AddRange(HeroesHelpers.Seasons.GetSeasonList()); SelectedSeason = SeasonList[0]; HeroesList.Add(InitialHeroListOption); HeroesList.AddRange(HeroesIcons.Heroes().GetListOfHeroes(HeroesIcons.GetLatestHeroesBuild())); SelectedHero = HeroesList[0]; GameModeList.AddRange(HeroesHelpers.GameModes.GetAllGameModeList()); MapList.AddRange(HeroesIcons.MapBackgrounds().GetMapsList()); StatsHeroesDataViewModel = new StatsHeroesDataViewModel(internalService, MapList); }