示例#1
0
        public void EvolvePokemon(PokemonCard basePokemon, PokemonCard evolution, bool ignoreAllChecks = false)
        {
            if (!ignoreAllChecks && !ActivePlayer.Id.Equals(basePokemon.Owner.Id) || !ActivePlayer.Id.Equals(evolution.Owner.Id))
            {
                GameLog.AddMessage("Evolution stopped by epic 1337 anti-cheat");
                return;
            }

            if (!ignoreAllChecks && GetAllPassiveAbilities().Any(ability => ability.ModifierType == PassiveModifierType.StopEvolutions))
            {
                GameLog.AddMessage("Evolution stopped by ability");
                return;
            }

            if (!ignoreAllChecks && (!basePokemon.CanEvolve() || !basePokemon.CanEvolveTo(evolution)))
            {
                return;
            }

            GameLog.AddMessage($"Evolving {basePokemon.GetName()} to {evolution.GetName()}");

            if (ActivePlayer.ActivePokemonCard.Id.Equals(basePokemon.Id))
            {
                basePokemon.Evolve(evolution);
                ActivePlayer.ActivePokemonCard = evolution;
                evolution.EvolvedThisTurn      = true;
            }
            else
            {
                basePokemon.Evolve(evolution);
                evolution.EvolvedThisTurn = true;
                ActivePlayer.BenchedPokemon.ReplaceWith(basePokemon, evolution);
            }

            bool triggerEnterPlay = false;

            if (ActivePlayer.Hand.Contains(evolution))
            {
                ActivePlayer.Hand.Remove(evolution);
                triggerEnterPlay = true;
            }

            evolution.RevealToAll();

            SendEventToPlayers(new PokemonEvolvedEvent
            {
                TargetPokemonId = basePokemon.Id,
                NewPokemonCard  = evolution
            });

            if (triggerEnterPlay)
            {
                TriggerAbilityOfType(TriggerType.EnterPlay, evolution);
            }

            PushGameLogUpdatesToPlayers();
        }
示例#2
0
        public void SetBenchedPokemon(PokemonCard pokemon)
        {
            if (Hand.Contains(pokemon))
            {
                pokemon.PlayedThisTurn = true;
                Hand.Remove(pokemon);
            }

            BenchedPokemon.Add(pokemon);
            pokemon.RevealToAll();
        }
示例#3
0
        public void SwapActivePokemon(PokemonCard pokemon, GameField game)
        {
            BenchedPokemon.ReplaceWith(pokemon, ActivePokemonCard);

            game?.SendEventToPlayers(new PokemonBecameActiveEvent
            {
                NewActivePokemonId = pokemon.Id,
                ReplacedPokemonId  = ActivePokemonCard.Id
            });

            ActivePokemonCard = pokemon;
            pokemon.RevealToAll();
        }
示例#4
0
        public void PlayCard(PokemonCard pokemon)
        {
            if (ActivePokemonCard == null)
            {
                ActivePokemonCard = pokemon;
            }
            else
            {
                BenchedPokemon.Add(pokemon);
            }

            pokemon.RevealToAll();
        }
示例#5
0
        public void SetActivePokemon(PokemonCard pokemon)
        {
            if (ActivePokemonCard != null)
            {
                return;
            }

            if (Hand.Contains(pokemon))
            {
                pokemon.PlayedThisTurn = true;
                Hand.Remove(pokemon);
            }

            BenchedPokemon.Remove(pokemon);

            ActivePokemonCard = pokemon;
            pokemon.RevealToAll();
        }