mechanics.moves
Class PokemonMove

java.lang.Object
  extended by mechanics.moves.PokemonMove
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
AbsorbMove, HealthBasedMove, HiddenPowerMove, MoveList.PerfectAccuracyMove, MoveList.StockpileMove, MultipleHitMove, RecoilMove, StatusMove, WeatherMove

public class PokemonMove
extends java.lang.Object
implements java.lang.Cloneable

This class represents a move that a pokemon can use on its turn.


Field Summary
protected  double m_accuracy
           
protected  MoveListEntry m_entry
           
protected  int m_power
           
protected  int m_pp
           
protected  PokemonType m_type
           
 
Constructor Summary
PokemonMove(PokemonType type, int power, double accuracy, int pp)
          Initialise a typical attacking move.
 
Method Summary
 boolean attemptHit(BattleMechanics mech, Pokemon user, Pokemon target)
          Attempt to hit an enemy.
 void beginTurn(BattleTurn[] turn, int index, Pokemon source)
          This function is called at the beginning on a turn on which this move is about to be used.
 boolean canCriticalHit()
          Return whether this move can strike critical.
 java.lang.Object clone()
          Clone this move.
 double getAccuracy()
          Get accuracy.
 double getEffectiveness(Pokemon user, Pokemon defender)
          Get the effectiveness of this move against a denfending pokemon.
static double getEffectiveness(PokemonType type, Pokemon user, Pokemon defender)
          Get the effectiveness of one type of move against an arbitrary pokemon.
 MoveListEntry getMoveListEntry()
          Return this move's entry in the move list.
 int getPower()
          Get the power of this move.
 int getPp()
          Get PP.
 int getPriority()
          Get the priority of this move.
 java.lang.Class getStatusException()
          Some moves can be used even if a status effect (e.g.
 PokemonType getType()
          Get the type of this move.
 boolean hasHighCriticalHitRate()
          Determine whether this move has a high chance of striking a critical hit.
 boolean isAttack()
          Returns whether this move is an attack.
 boolean isBuggy()
          Return whether this move is buggy.
 boolean isDamaging()
          Return whether this move deals damage.
 boolean isSpecial(BattleMechanics mech)
          Return whether this move should use special attack and defence.
 void setAccuracy(double accuracy)
          Set the accuracy of this move.
 void setPower(int power)
          Set the power of this move.
 void setType(PokemonType type)
          Set the type of this move.
 void switchIn(Pokemon p)
          This method is called when a pokemon who has this move is switched into the field.
 int use(BattleMechanics mech, Pokemon user, Pokemon target)
          Cause a pokemon to use this move on another pokemon.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_type

protected PokemonType m_type

m_power

protected int m_power

m_accuracy

protected double m_accuracy

m_pp

protected int m_pp

m_entry

protected MoveListEntry m_entry
Constructor Detail

PokemonMove

public PokemonMove(PokemonType type,
                   int power,
                   double accuracy,
                   int pp)
Initialise a typical attacking move.

Method Detail

getMoveListEntry

public MoveListEntry getMoveListEntry()
Return this move's entry in the move list.


isSpecial

public boolean isSpecial(BattleMechanics mech)
Return whether this move should use special attack and defence.


clone

public java.lang.Object clone()
Clone this move.

Overrides:
clone in class java.lang.Object

attemptHit

public boolean attemptHit(BattleMechanics mech,
                          Pokemon user,
                          Pokemon target)
Attempt to hit an enemy.


use

public int use(BattleMechanics mech,
               Pokemon user,
               Pokemon target)
Cause a pokemon to use this move on another pokemon.


getPp

public int getPp()
Get PP.


isDamaging

public boolean isDamaging()
Return whether this move deals damage.


getAccuracy

public double getAccuracy()
Get accuracy.


setAccuracy

public void setAccuracy(double accuracy)
Set the accuracy of this move.


getType

public PokemonType getType()
Get the type of this move.


getStatusException

public java.lang.Class getStatusException()
Some moves can be used even if a status effect (e.g. sleep) would normally prevent it. If this move can be used a such, the class of the status effect is returned by this method. Otherwise, the method returns null.


getEffectiveness

public double getEffectiveness(Pokemon user,
                               Pokemon defender)
Get the effectiveness of this move against a denfending pokemon.


getEffectiveness

public static double getEffectiveness(PokemonType type,
                                      Pokemon user,
                                      Pokemon defender)
Get the effectiveness of one type of move against an arbitrary pokemon.


switchIn

public void switchIn(Pokemon p)
This method is called when a pokemon who has this move is switched into the field.


canCriticalHit

public boolean canCriticalHit()
Return whether this move can strike critical.


setType

public void setType(PokemonType type)
Set the type of this move.


getPower

public int getPower()
Get the power of this move.


setPower

public void setPower(int power)
Set the power of this move.


getPriority

public int getPriority()
Get the priority of this move. Priority determines when this move will be used during the turn.


hasHighCriticalHitRate

public boolean hasHighCriticalHitRate()
Determine whether this move has a high chance of striking a critical hit.


isAttack

public boolean isAttack()
Returns whether this move is an attack. This method is shoddy and should be overridden by any exceptions.


beginTurn

public void beginTurn(BattleTurn[] turn,
                      int index,
                      Pokemon source)
This function is called at the beginning on a turn on which this move is about to be used.

Parameters:
turn - the moves about to be used on this turn
index - the position of the source pokemon in the turn array
source - the pokemon who is using the move

isBuggy

public boolean isBuggy()
Return whether this move is buggy.