Exemple #1
0
        protected override void Activate(Player owner, Player opponent, int damageTaken, GameField game)
        {
            NetworkId selectedId = null;

            do
            {
                var response = owner.NetworkPlayer.SendAndWaitForResponse <CardListMessage>(new SelectFromYourPokemonMessage("Select one of your other pokemon to attach Electrode to").ToNetworkMessage(NetworkId.Generate()));
                selectedId = response.Cards.FirstOrDefault();
            } while (selectedId == null || selectedId.Equals(PokemonOwner.Id));

            var colorResponse = owner.NetworkPlayer.SendAndWaitForResponse <SelectColorMessage>(new SelectColorMessage("Select energy type to become").ToNetworkMessage(NetworkId.Generate()));

            var buzzardEnergy = new BuzzardEnergy(PokemonOwner, colorResponse.Color)
            {
                ImageUrl = PokemonOwner.ImageUrl,
                SetCode  = PokemonOwner.SetCode
            };

            game.SendEventToPlayers(new PokemonDiedEvent()
            {
                Pokemon = PokemonOwner
            });

            game.Cards.Add(buzzardEnergy.Id, buzzardEnergy);
            PokemonCard selectedPokemon = (PokemonCard)game.Cards[selectedId];

            selectedPokemon.AttachEnergy(buzzardEnergy, game);

            PokemonOwner.ClearStatusEffects();
            PokemonOwner.DamageCounters = 0;
            PokemonOwner.Owner.DiscardPile.AddRange(PokemonOwner.AttachedEnergy);
            PokemonOwner.AttachedEnergy.Clear();

            if (PokemonOwner.EvolvedFrom != null)
            {
                PokemonOwner.Owner.DiscardPile.Add(PokemonOwner.EvolvedFrom);
                PokemonOwner.EvolvedFrom = null;
            }

            if (owner.ActivePokemonCard == PokemonOwner)
            {
                owner.ActivePokemonCard = null;
                owner.SelectActiveFromBench(game);
            }
            else
            {
                owner.BenchedPokemon.Remove(PokemonOwner);
            }

            game.GameState = GameFieldState.AbilitySpecial;
            game.SendEventToPlayers(new GameInfoEvent());

            game.PushInfoToPlayer("Opponent is selecting a prize card", owner);
            opponent.SelectPrizeCard(1, game);

            game.GameState = GameFieldState.InTurn;
            game.SendEventToPlayers(new GameInfoEvent());
        }