public class CaptureValues
extends java.lang.Object
CaptureMethod
convenience.
Allows variables to be passed through to different steps of the CaptureMethod
, and also contains the end
result of the capture attempt such as how many shakes occurred and whether the capture was critical.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
A |
static java.lang.String |
B |
static java.lang.String |
C |
static java.lang.String |
D |
static java.lang.String |
E |
static java.lang.String |
F |
Constructor and Description |
---|
CaptureValues(int catchRate,
double ballBonus)
Constructs a new CaptureValues with initial values set for the modified catch rate and ball bonus.
|
Modifier and Type | Method and Description |
---|---|
void |
addShake()
Adds a shake that will occur for the capture attempt this object is associated with.
|
boolean |
canCritical()
Gets whether the capture attempt this object is associated with is allowed to be a critical capture or not.
|
void |
disableCritical()
Prevents the capture attempt this object is associated with from being a critical capture.
|
void |
enableCritical()
Allows the capture attempt this object is associated with to be a critical capture.
|
double |
getBallBonus()
Gets the ball bonus of the capture attempt this object is associated with.
|
int |
getCatchRate()
Gets the modified catch rate of the capture attempt this object is associated with.
|
int |
getShakes()
Gets the number of shakes that will occur for the capture attempt this object is associated with.
|
double |
getVariable(java.lang.String key)
Gets a variable for a specified key, or create a new variable with value 0 if not present.
|
boolean |
isCaught()
Gets whether the capture attempt this object is associated with will succeed or not.
|
boolean |
isCritical()
Gets whether the capture attempt this object is associated with is a critical capture or not.
|
void |
setBallBonus(double ballBonus)
Updates the ball bonus of the capture attempt this object is associated with, bound to 0 or greater.
|
void |
setCanCritical(boolean canCritical)
Sets whether the capture attempt this object is associated with can be a critical capture or not.
|
void |
setCatchRate(int catchRate)
Updates the modified catch rate of the capture attempt this object is associated with, bound between 1 and 255 inclusive.
|
void |
setCaught()
Sets the capture attempt this object is associated with to succeed.
|
void |
setCaught(boolean caught)
Sets whether the capture attempt this object is associated with will succeed or not.
|
void |
setCaught(int shakes)
Sets the capture attempt this object is associated with to succeed, with a specified number of shakes.
|
void |
setCritical()
Sets the capture attempt this object is associated with to be a critical capture.
|
void |
setCritical(boolean critical)
Sets whether the capture attempt this object is associated with is a critical capture or not.
|
void |
setShakes(int shakes)
Sets the number of shakes that will occur for the capture attempt this object is associated with.
|
void |
setVariable(java.lang.String key,
double value)
Sets a variable for a specified key.
|
boolean |
trySetCaught(int targetShakes)
Attempts to set the capture attempt this object is associated with to succeed, if the number of shakes equals or
is greater than the specified target number.
|
public static final java.lang.String A
public static final java.lang.String B
public static final java.lang.String C
public static final java.lang.String D
public static final java.lang.String E
public static final java.lang.String F
public CaptureValues(int catchRate, double ballBonus)
catchRate
- The modified catch rate of this capture attempt.ballBonus
- The ball bonus of this capture attempt.public int getCatchRate()
public void setCatchRate(int catchRate)
public double getBallBonus()
public void setBallBonus(double ballBonus)
public void disableCritical()
public void enableCritical()
public void setCanCritical(boolean canCritical)
canCritical
- Whether the capture attempt can be a critical capture or not.public boolean canCritical()
public boolean isCritical()
public void setCritical(boolean critical)
critical
- Whether the capture attempt is a critical capture or not.public void setCritical()
public int getShakes()
public void setShakes(int shakes)
shakes
- The number of shakes.public void addShake()
public boolean isCaught()
public void setCaught(boolean caught)
caught
- Whether the capture attempt will succeed.public void setCaught()
public void setCaught(int shakes)
shakes
- The number of shakes.public boolean trySetCaught(int targetShakes)
targetShakes
- The number of shakes to equal or beat.public double getVariable(java.lang.String key)
key
- The variable key.public void setVariable(java.lang.String key, double value)
key
- The variable key.value
- The new value for this variable.