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(); }
public void SetBenchedPokemon(PokemonCard pokemon) { if (Hand.Contains(pokemon)) { pokemon.PlayedThisTurn = true; Hand.Remove(pokemon); } BenchedPokemon.Add(pokemon); pokemon.RevealToAll(); }
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(); }
public void PlayCard(PokemonCard pokemon) { if (ActivePokemonCard == null) { ActivePokemonCard = pokemon; } else { BenchedPokemon.Add(pokemon); } pokemon.RevealToAll(); }
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(); }