Пример #1
0
 private void setLocationWarningMessage(GameSessionViewModel gsm, GameSessionView gsv)
 {
     if (gsm.GameMap.CurrentLocation.MultiAttackLocation == true)
     {
         gsv.mapWindow.WarningDisplay.Text = "Dangerous area!";
     }
     else if (gsm.GameMap.CurrentLocation.BossFightRoom)
     {
         gsv.mapWindow.WarningDisplay.Text = "[BOSS] Location-Freeze!";
     }
     else if (gsm.GameMap.CurrentLocation.MultiAttackLocation == false)
     {
         gsv.mapWindow.WarningDisplay.Text = "Moderate Area!";
     }
 }
Пример #2
0
 public void SelectedEnemySetter(int selected, GameSessionView gsv)
 {
     EnemySelected = true;
     foreach (Enemy E in CurrentEnemies)
     {
         E.refreshAllEnemiesPositions();
         if (E.listPlacement == selected)
         {
             CurrentFightingEnemyID            = E.ID;
             CurrentFightingEnemyListPlacement = E.listPlacement;
             Player.currentlyAttacking         = E;
             SelectingEnemy = E;
             if (E.SelectedToFight == false)
             {
                 E.AttackingPlayer = true;
                 E.startAttackingPlayer();
                 gsv.EnemyPicture.Source = E.PictureSource;
                 E.SelectedToFight       = true;
                 EnemyDamage             = E.BaseAttack;
                 EnemyName   = E.Name;
                 EnemyHealth = E.Health;
                 EnemyLevel  = E.Level;
                 gsv.EnemyHealthDisplay.Visibility = System.Windows.Visibility.Visible;
                 gsv.EnemyHealthDisplay.Maximum    = E.MaxHealth;
                 gsv.EnemyHealthDisplay.Value      = E.Health;
                 gsv.EnemyHealthDisplay.Minimum    = 0;
             }
             else
             {
                 E.SelectedToFight = true;
             }
         }
         else if (E.listPlacement != selected)
         {
             if (E.listPlacement != selected && E.SelectedToFight == true)
             {
                 E.SelectedToFight = false;
                 E.AttackingPlayer = false;
                 E.stopAttackingPlayer();
             }
             else
             {
                 E.SelectedToFight = false;
             }
         }
     }
 }
        public void SelectedEnemySetter(int selected, GameSessionView gsv)
        {
            /*
             * for (int i = 0; i < CurrentEnemies.Count; i++)
             *          {
             *  if (CurrentLocation.MultiAttackLocation == false)
             *  {
             *      if (CurrentEnemies[i].SelectedToFight == false)
             *      {
             *          CurrentEnemies[i].stopAttackingPlayer();
             *          gsv.DialogueBox.Text = "Stopped attacking player";
             *      }
             *  }
             *  else if (CurrentLocation.MultiAttackLocation == true)
             *  {
             *      if (CurrentEnemies[i].SelectedToFight == false)
             *      {
             *          CurrentEnemies[i].stopAttackingPlayer();
             *         CurrentEnemies[i].startAttackingPlayer();
             *      }
             *  }
             * }*/
            EnemySelected = true;
            //
            // Most likely where the stacked damage problem is occuring
            //
            for (int i = 0; i < CurrentEnemies.Count; i++)
            {
                CurrentEnemies[i].refreshAllEnemiesPositions();
                if (CurrentEnemies[i].listPlacement == selected)
                {
                    CurrentFightingEnemyID            = CurrentEnemies[i].ID;
                    CurrentFightingEnemyListPlacement = CurrentEnemies[i].listPlacement;

                    Player.currentlyAttacking = CurrentEnemies[i];

                    SelectingEnemy = CurrentEnemies[i];
                    if (CurrentEnemies[i].SelectedToFight == false)
                    {
                        CurrentEnemies[i].AttackingPlayer = true;

                        CurrentEnemies[i].startAttackingPlayer();

                        gsv.EnemyPicture.Source = CurrentEnemies[i].PictureSource;
                        gsv.enemyStatsWindow.EnemyStatsPicture.Source = CurrentEnemies[i].PictureSource;
                        CurrentEnemies[i].SelectedToFight             = true;
                        EnemyDamage = CurrentEnemies[i].BaseAttack;
                        EnemyName   = CurrentEnemies[i].Name;
                        EnemyHealth = CurrentEnemies[i].Health;
                        EnemyLevel  = CurrentEnemies[i].Level;
                        gsv.EnemyHealthDisplay.Visibility = System.Windows.Visibility.Visible;
                        gsv.enemyStatsWindow.EnemyStatsPicture.Visibility = System.Windows.Visibility.Visible;
                        gsv.EnemyHealthDisplay.Maximum = CurrentEnemies[i].MaxHealth;
                        gsv.EnemyHealthDisplay.Value   = CurrentEnemies[i].Health;
                        gsv.EnemyHealthDisplay.Minimum = 0;
                    }
                    else
                    {
                        CurrentEnemies[i].SelectedToFight = true;
                    }
                }
                else if (CurrentEnemies[i].listPlacement != selected)
                {
                    if (CurrentEnemies[i].listPlacement != selected && CurrentEnemies[i].SelectedToFight == true)
                    {
                        CurrentEnemies[i].SelectedToFight = false;
                        CurrentEnemies[i].AttackingPlayer = false;
                        CurrentEnemies[i].stopAttackingPlayer();
                    }
                    else
                    {
                        CurrentEnemies[i].SelectedToFight = false;
                    }
                }
            }
        }