Class BaseTrainerEffect

java.lang.Object
com.pixelmonmod.tcg.duel.trainer.BaseTrainerEffect
Direct Known Subclasses:
Bill, ClefairyDoll, ComputerSearch, Defender, DevolutionSpray, EnergyRemoval, EnergyRetrieval, EnergySearch, FullHeal, Gambler, GustOfWind, ImposterProfOak, ItemFinder, Lass, Maintenance, MrFuji, MysteriousFossil, PlusPower, PokeBall, Pokedex, PokeFlute, PokemonBreeder, PokemonCenter, PokemonTrader, Potion, ProfOak, Recycle, Revive, ScoopUp, SuperEnergyRemoval, SuperPotion, Switch

public class BaseTrainerEffect extends Object
Created by Hy on 5/15/2016.
  • Constructor Details

    • BaseTrainerEffect

      public BaseTrainerEffect(String id)
  • Method Details

    • canApply

      public boolean canApply(TrainerCardState trainer, GameServerState server)
      This function makes sure all selector result are ready.
      Parameters:
      trainer -
      server -
      Returns:
    • apply

      public void apply(TrainerCardState trainer, GameServerState server)
      This function applies the effect of the Trainer card.
      Parameters:
      trainer -
      server -
    • canSkipSelector

      public boolean canSkipSelector()
      This function is to tell if this trainer can skip the selector stage.
    • applySkipSelector

      public void applySkipSelector(TrainerCardState trainer, PokemonCardState pokemon, GameServerState server, BoardLocation b, int p)
      This function skips the selector, taking what it was placed on as the parameter.
      Parameters:
      trainer -
      pokemon -
      server -
    • canPlay

      public boolean canPlay(GameClientState client)
      This is check on client to make sure the condition on trainer card are met.
      Parameters:
      client -
      Returns:
    • canPlay

      public final boolean canPlay(GameServerState server)
      This is a utility function, so that server can re-use the same logic in canPlay(GameClientState).
      Parameters:
      server -
      Returns:
    • canPlaceOn

      public boolean canPlaceOn(CardWithLocation card)
      Parameters:
      card -
      Returns:
    • getSelectorState

      public CardSelectorState getSelectorState(TrainerCardState trainer, GameServerState server)
      Parameters:
      trainer -
      server -
      Returns:
    • getOpponentRevealingSelectorState

      public CardSelectorState getOpponentRevealingSelectorState(TrainerCardState trainer, GameServerState server)
    • flipCoin

      public List<CoinSide> flipCoin()
      This function returns all necessary coin flip results.
      Returns:
      List of CoinSide
    • modifyDamage

      public int modifyDamage(int damage, TrainerCardState trainer, GameServerState server)
    • preventDiscard

      public boolean preventDiscard()
      Prevent the battle controller from automatically discard the trainer
      Returns:
    • handleEndTurn

      public void handleEndTurn(TrainerCardState trainer, PokemonCardState card, PlayerServerState player, GameServerState server)
    • showDiscardButton

      public boolean showDiscardButton()
      For cards that allow manual discard such as Clefari Doll
      Returns:
    • getId

      public String getId()