Package com.pixelmonmod.tcg.duel.trainer
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
Created by Hy on 5/15/2016.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(TrainerCardState trainer, GameServerState server) This function applies the effect of the Trainer card.voidapplySkipSelector(TrainerCardState trainer, PokemonCardState pokemon, GameServerState server, BoardLocation b, int p) This function skips the selector, taking what it was placed on as the parameter.booleancanApply(TrainerCardState trainer, GameServerState server) This function makes sure all selector result are ready.booleancanPlaceOn(CardWithLocation card) booleancanPlay(GameClientState client) This is check on client to make sure the condition on trainer card are met.final booleancanPlay(GameServerState server) This is a utility function, so that server can re-use the same logic in canPlay(GameClientState).booleanThis function is to tell if this trainer can skip the selector stage.flipCoin()This function returns all necessary coin flip results.getId()getOpponentRevealingSelectorState(TrainerCardState trainer, GameServerState server) getSelectorState(TrainerCardState trainer, GameServerState server) voidhandleEndTurn(TrainerCardState trainer, PokemonCardState card, PlayerServerState player, GameServerState server) intmodifyDamage(int damage, TrainerCardState trainer, GameServerState server) booleanPrevent the battle controller from automatically discard the trainerbooleanFor cards that allow manual discard such as Clefari Doll
-
Constructor Details
-
BaseTrainerEffect
-
-
Method Details
-
canApply
This function makes sure all selector result are ready.- Parameters:
trainer-server-- Returns:
-
apply
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
This is check on client to make sure the condition on trainer card are met.- Parameters:
client-- Returns:
-
canPlay
This is a utility function, so that server can re-use the same logic in canPlay(GameClientState).- Parameters:
server-- Returns:
-
canPlaceOn
- Parameters:
card-- Returns:
-
getSelectorState
- Parameters:
trainer-server-- Returns:
-
getOpponentRevealingSelectorState
public CardSelectorState getOpponentRevealingSelectorState(TrainerCardState trainer, GameServerState server) -
flipCoin
This function returns all necessary coin flip results.- Returns:
- List of CoinSide
-
modifyDamage
-
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
-