Пример #1
0
        private void sellChar_click(object sender, MouseEventArgs e)
        {
            gameManager.TeamBlue.Remove(selectedCharacter);
            selectedCharacter.hideAllSpellUI();
            selectedCharacter.CurrentTile.CurrentCharacter = null;
            gameNetworkManager.enqueueMsg(NetworkMsgPrefix.SellCharacter,
                                          GameNetworkUtilities.serializeTile(selectedCharacter.CurrentTile));

            gameManager.Player.Gold += gameManager.CharShop.CharacterPrice;
            SoundManager.PlaySound("BuyCharacter.wav");
            gameManager.deselectSelectedTile();
        }
Пример #2
0
 private void levelUp_click(object sender, MouseEventArgs e)
 {
     if (gameManager.Player.Gold < selectedCharacter.CurrentLevel * 5 || gameManager.CurrentGameStage != StageManager.GameStage.Buy)
     {
         return;
     }
     SoundManager.PlaySound("Rise03.wav");
     gameManager.Player.Gold -= selectedCharacter.CurrentLevel * 5;
     selectedCharacter.levelUp();
     gameNetworkManager.enqueueMsg(NetworkMsgPrefix.LevelUpCharacter, GameNetworkUtilities.serializeTile(selectedCharacter.CurrentTile));
     viewCharStats();
     if (!(selectedCharacter.CurrentLevel < CharacterType.MAX_CHAR_LVL - 1))
     {
         btn_levelUp.Enabled = false;
         btn_levelUp.Text    = "Max level";
     }
     else
     {
         btn_levelUp.Text = "Level UP";
     }
     SelectedCharacterView.UpdateChanges();
 }