|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectshoddybattle.PokemonSpecies
shoddybattle.Pokemon
public class Pokemon
This class represents a pokemon in a battle. Its stats are automatically modified as it attacks and is attacked, so no method for directly modifying its stats are provided. Using this class requires a BattleMechanics object to initialise its stats.
Field Summary | |
---|---|
static int |
S_ACCURACY
|
static int |
S_ATTACK
|
static int |
S_DEFENCE
|
static int |
S_EVASION
|
static int |
S_HP
|
static int |
S_SPATTACK
|
static int |
S_SPDEFENCE
|
static int |
S_SPEED
|
Fields inherited from class shoddybattle.PokemonSpecies |
---|
GENDER_BOTH, GENDER_FEMALE, GENDER_MALE, GENDER_NONE, m_base, m_genders, m_name, m_species, m_type |
Constructor Summary | |
---|---|
Pokemon(BattleMechanics mech,
PokemonSpecies species,
PokemonNature nature,
java.lang.String ability,
java.lang.String item,
int gender,
int level,
int[] ivs,
int[] evs,
MoveListEntry[] moves,
int[] ppUps)
Create and validate a new pokemon. |
|
Pokemon(BattleMechanics mech,
PokemonSpecies species,
PokemonNature nature,
java.lang.String ability,
java.lang.String item,
int gender,
int level,
int[] ivs,
int[] evs,
MoveListEntry[] moves,
int[] ppUps,
boolean validate)
Creates a new instance of Pokemon |
Method Summary | |
---|---|
StatusEffect |
addStatus(Pokemon source,
StatusEffect eff)
Add a status effect to this pokemon. |
void |
attachToField(BattleField field,
int party,
int position)
Attach this pokemon to a battle field. |
void |
beginStatusTicks()
Begin ticking effects. |
void |
calculateStats(int[] base,
int[] ivs,
int[] evs)
Calculate stats from a given set of IVs and EVs. |
boolean |
canSwitch()
Return whether this pokemon can switch. |
void |
changeHealth(int hp)
Change the health of this pokemon, doing damage to a substitute if one is present. |
void |
changeHealth(int hp,
boolean throughSubstitute)
Change the health of this pokemon, optionally hitting through a substitute. |
boolean |
createSubstitute()
Create a substitute to take hits for this pokemon. |
void |
dispose()
Dispose of this object. |
void |
executeTurn(BattleTurn turn)
This method is called when the pokemon is just about to execute its turn. |
void |
faint()
Cause this pokemon to faint. |
IntrinsicAbility |
getAbility()
Return this pokemon's ability. |
java.lang.String |
getAbilityName()
Return the name of this pokemon's ability. |
StatMultiplier |
getAccuracy()
|
int |
getCriticalHitFactor()
Get the (additive) critical hit ability of this Pokemon. |
StatusEffect |
getEffect(java.lang.Class type)
Return the effect of a particular class applied to this pokemon, or null if there is no such effect. |
StatusEffect |
getEffect(int lock)
Return the effect applied to this pokemon of a particular lock or null if there is no such effect applied. |
static double |
getEffectiveness(java.util.List statuses,
PokemonType move,
PokemonType pokemon,
boolean enemy)
Get the effectiveness of this pokemon attacking a particular type. |
double |
getEffectiveness(PokemonType move,
PokemonType pokemon,
boolean enemy)
|
int |
getEv(int i)
|
StatMultiplier |
getEvasion()
|
BattleField |
getField()
Get the field to which this pokemon is attached. |
int |
getGender()
Return this Pokemon's gender. |
int |
getHealth()
Get the health of this pokemon. |
int |
getId()
Get this pokemon's position on the field to which it is attached. |
HoldItem |
getItem()
Get this pokemon's item. |
java.lang.String |
getItemName()
Return the name of this pokemon's item. |
int |
getIv(int i)
|
MoveListEntry |
getLastMove()
Get the last move used by this pokemon, or null if the pokemon has not used a move since it has been out. |
int |
getLevel()
|
int |
getMaxPp(int i)
Get a move's max pp. |
MoveListEntry |
getMove(int i)
Get one of this pokemon's moves. |
java.lang.String |
getMoveName(int i)
Get the name of this pokemon's moves. |
StatMultiplier |
getMultiplier(int i)
Get a stat multiplier, including the ones for accuracy and evasion. |
java.lang.String |
getName()
Get the display name of this pokemon (i.e. |
PokemonNature |
getNature()
|
java.util.List |
getNormalStatuses(int lock)
Get a list of statuses that are not special, weather, abilities, or items. |
Pokemon |
getOpponent()
Get the Pokemon that this Pokemon is fighting in a battle. |
IntrinsicAbility |
getOriginalAbility()
Return the original ability of this pokemon. |
int |
getParty()
Get this pokemon's party. |
int |
getPp(int i)
Get a move's pp. |
int |
getPpUpCount(int i)
Get the number of PP Ups that have been applied to the given move slot. |
static Pokemon |
getRandomPokemon(ModData data,
BattleMechanics mech)
Get a random Pokemon object. |
int |
getRawStat(int i)
|
java.lang.String |
getSpeciesName()
Get the name of this species. |
int |
getStat(int i)
|
int |
getStat(int i,
double multiplier)
|
static java.lang.String |
getStatName(int stat)
Get the name of a stat. |
static java.lang.String |
getStatShortName(int stat)
Get the shortened name of a stat. |
java.util.List |
getStatusesByTier(int tier)
Get all status effects of a certain tier. |
int |
getSubstitute()
Get the health of the substitute. |
Pokemon[] |
getTeammates()
Get this pokemon's teammates, including this pokemon. |
java.lang.String |
getTrainerName()
Get the name of this pokemon's trainer. |
protected MoveListEntry |
getTransformedMove(MoveListEntry move,
boolean enemy)
Transform a move based on the status effects applied to the pokemon. |
StatusEffect |
getVetoingEffect(int idx)
Return the effect that vetoes the use of a particular one of this pokemon's moves. |
boolean |
hasAbility(java.lang.String name)
Return whether this pokemon has a particular ability. |
boolean |
hasEffect(java.lang.Class type)
Return whether this Pokemon has a particular class of effect. |
boolean |
hasEffect(int lock)
Return whether this Pokemon has a particular class of effect. |
boolean |
hasEffect(StatusEffect eff)
Return whether this pokemon has a particular effect. |
boolean |
hasItem(java.lang.String name)
Return whether this pokemon has a particular item. |
boolean |
hasSubstitute()
Return whether this pokemon has a substitute. |
boolean |
isActive()
Return whether this pokemon is active (able to choose moves and switch). |
boolean |
isCriticalImmune()
Return whether this Pokemon is immune to critical hits. |
boolean |
isFainted()
Determine whether this pokemon has fainted. |
boolean |
isFirstTurn()
Return whether it is the pokemon's first turn out. |
boolean |
isImmobilised(java.lang.Class exception)
Is this pokemon immobilised? |
boolean |
isShiny()
Return whether this pokemon is shiny. |
boolean |
isType(PokemonType type)
Return whether a pokemon is a particular type. |
boolean |
mustStruggle()
Return whether this pokemon must struggle if it wants to use a move. |
void |
removeStatus(java.lang.Class type)
Remove statuses by class type. |
void |
removeStatus(int lock)
Remove a class of statuses from this pokemon. |
void |
removeStatus(StatusEffect eff)
Remove a status effect from this pokemon. |
void |
setAbility(IntrinsicAbility abl,
boolean ignoreTransferability)
Set this pokemon's ability. |
void |
setItem(HoldItem item)
Set this pokemon's item. |
void |
setName(java.lang.String name)
Set this pokemon's name. |
void |
setPp(int i,
int value)
Set a move's pp. |
void |
setRawStat(int i,
int newStat)
|
void |
setShiny(boolean shiny)
Set whether this pokemon is shiny. |
void |
setSubstitute(int hp)
Set the health of the substitute. |
void |
switchIn()
Switch in this pokemon. |
void |
switchOut()
Switch out this pokemon. |
void |
synchroniseStatuses()
Remove status effects that have ended. |
int |
useMove(int i,
Pokemon target)
Use one of this pokemon's intrinsic moves. |
int |
useMove(MoveListEntry move,
Pokemon target)
Use a a move from the move list (so its name is known and displayed). |
int |
useMove(PokemonMove move,
Pokemon target)
Check for accuracy and then use an arbitrary move. |
void |
validate(ModData data)
Validate this pokemon. |
Methods inherited from class shoddybattle.PokemonSpecies |
---|
canLearn, canUseAbility, getBase, getBaseStats, getDefaultData, getLearnableMoves, getMoveSet, getPossibleAbilities, getPossibleGenders, getTypes, readObject, setDefaultData, setPossibleGenders, setType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int S_HP
public static final int S_ATTACK
public static final int S_DEFENCE
public static final int S_SPEED
public static final int S_SPATTACK
public static final int S_SPDEFENCE
public static final int S_ACCURACY
public static final int S_EVASION
Constructor Detail |
---|
public Pokemon(BattleMechanics mech, PokemonSpecies species, PokemonNature nature, java.lang.String ability, java.lang.String item, int gender, int level, int[] ivs, int[] evs, MoveListEntry[] moves, int[] ppUps, boolean validate) throws StatException
StatException
public Pokemon(BattleMechanics mech, PokemonSpecies species, PokemonNature nature, java.lang.String ability, java.lang.String item, int gender, int level, int[] ivs, int[] evs, MoveListEntry[] moves, int[] ppUps) throws StatException
StatException
Method Detail |
---|
public boolean createSubstitute()
public void setSubstitute(int hp)
public int getSubstitute()
public boolean hasSubstitute()
public void dispose()
public static java.lang.String getStatName(int stat)
public static java.lang.String getStatShortName(int stat)
public static Pokemon getRandomPokemon(ModData data, BattleMechanics mech)
public void setShiny(boolean shiny)
public boolean isShiny()
public int getGender()
public java.lang.String getAbilityName()
public IntrinsicAbility getAbility()
public void setAbility(IntrinsicAbility abl, boolean ignoreTransferability)
public java.lang.String getItemName()
public HoldItem getItem()
public void setItem(HoldItem item)
public void validate(ModData data) throws ValidationException
ValidationException
public int getPpUpCount(int i)
public void calculateStats(int[] base, int[] ivs, int[] evs)
public Pokemon[] getTeammates()
public java.lang.String getTrainerName()
public Pokemon getOpponent()
public boolean isType(PokemonType type)
public int getCriticalHitFactor()
public boolean isCriticalImmune()
public void setPp(int i, int value)
public int getPp(int i)
public int getMaxPp(int i)
public MoveListEntry getMove(int i)
public void executeTurn(BattleTurn turn)
turn
- the turn that is about to be executedpublic boolean isFirstTurn()
public void switchIn()
public IntrinsicAbility getOriginalAbility()
public void switchOut()
public StatusEffect getVetoingEffect(int idx) throws MoveQueueException
MoveQueueException
public boolean hasEffect(StatusEffect eff)
public boolean hasEffect(int lock)
public StatusEffect getEffect(int lock)
public StatusEffect getEffect(java.lang.Class type)
public boolean hasEffect(java.lang.Class type)
public boolean hasAbility(java.lang.String name)
public boolean hasItem(java.lang.String name)
public boolean isActive()
public java.lang.String getSpeciesName()
public void setName(java.lang.String name)
setName
in class PokemonSpecies
public java.lang.String getName()
getName
in class PokemonSpecies
public java.util.List getStatusesByTier(int tier)
public java.util.List getNormalStatuses(int lock)
lock
- status lock to allowpublic boolean canSwitch()
public void beginStatusTicks()
public void synchroniseStatuses()
public void removeStatus(StatusEffect eff)
public void removeStatus(int lock)
public void removeStatus(java.lang.Class type)
public void attachToField(BattleField field, int party, int position)
public int getParty()
public int getId()
public BattleField getField()
public java.lang.String getMoveName(int i)
public boolean isFainted()
public static double getEffectiveness(java.util.List statuses, PokemonType move, PokemonType pokemon, boolean enemy)
public double getEffectiveness(PokemonType move, PokemonType pokemon, boolean enemy)
public boolean isImmobilised(java.lang.Class exception)
exception
- status not to check forprotected MoveListEntry getTransformedMove(MoveListEntry move, boolean enemy)
enemy
- whether this Pokemon is an enemypublic MoveListEntry getLastMove()
public int useMove(int i, Pokemon target)
public int useMove(MoveListEntry move, Pokemon target)
public int useMove(PokemonMove move, Pokemon target)
public void changeHealth(int hp)
public void changeHealth(int hp, boolean throughSubstitute)
public void faint()
public int getHealth()
public boolean mustStruggle()
public StatusEffect addStatus(Pokemon source, StatusEffect eff)
public PokemonNature getNature()
public StatMultiplier getAccuracy()
public StatMultiplier getEvasion()
public int getLevel()
public int getIv(int i) throws StatException
StatException
public int getEv(int i) throws StatException
StatException
public StatMultiplier getMultiplier(int i) throws StatException
StatException
public int getRawStat(int i)
public void setRawStat(int i, int newStat)
public int getStat(int i, double multiplier)
public int getStat(int i)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |