|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmechanics.BattleMechanics
public abstract class BattleMechanics
This class represents the mechanics for a battle in a particular generation of pokemon. Derive classes from this class to implement a desired generation.
Constructor Summary | |
---|---|
BattleMechanics(int bytes)
Initialise an instance of the mechanics. |
Method Summary | |
---|---|
abstract boolean |
attemptHit(PokemonMove move,
Pokemon user,
Pokemon target)
Randomly decide whether a move hits. |
int |
calculateDamage(PokemonMove move,
Pokemon attacker,
Pokemon defender)
Calculate the damage done by a move. |
abstract int |
calculateDamage(PokemonMove move,
Pokemon attacker,
Pokemon defender,
boolean silent)
Calculate the damage done by a move. |
abstract int |
calculateStat(Pokemon p,
int i)
Calculate the initial value of a stat from a pokemon's base stats and hidden stats. |
java.util.Random |
getRandom()
Get an instance of the Random class. |
static byte[] |
getRandomBytes(int number)
Get random bytes using the Crypto API on Windows. |
static java.util.Random |
getRandomSource(int bytes)
Initialise the battle mechanics. |
abstract boolean |
isMoveSpecial(PokemonMove move)
Return whether a given move deals special damage. |
abstract void |
validateHiddenStats(Pokemon p)
Validate the hidden stats of a pokemon. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BattleMechanics(int bytes)
Method Detail |
---|
public abstract int calculateStat(Pokemon p, int i) throws StatException
p
- the pokemon whose stats to calculatei
- the stat to calculate (use the constants Pokemon.S_HP, etc.)
StatException
public abstract void validateHiddenStats(Pokemon p) throws ValidationException
ValidationException
public abstract boolean attemptHit(PokemonMove move, Pokemon user, Pokemon target)
public abstract int calculateDamage(PokemonMove move, Pokemon attacker, Pokemon defender, boolean silent)
public int calculateDamage(PokemonMove move, Pokemon attacker, Pokemon defender)
public abstract boolean isMoveSpecial(PokemonMove move)
public final java.util.Random getRandom()
public static byte[] getRandomBytes(int number)
public static java.util.Random getRandomSource(int bytes)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |