// Timer starts as soon as player encounter aggressive enemy on location private void aggroTimer_Tick(object sender, EventArgs e) { gameSession.CurrentEnemy.HasAdvantage = true; BattleWindow battle = new BattleWindow(gameSession); battle.ShowDialog(); BattleResult(battle); gameSession.CurrentEnemy = null; aggroTimer.Stop(); }
private void AttackEnemy(object sender, MouseButtonEventArgs e) { if (aggroTimer != null) { if (aggroTimer.IsEnabled) { aggroTimer.Stop(); } } if (gameSession.CurrentEnemy == null) { return; } BattleWindow battle = new BattleWindow(gameSession); battle.ShowDialog(); BattleResult(battle); gameSession.CurrentEnemy = null; }