added tsdoc
parent
dd76667e2a
commit
1b7f4f5449
|
@ -2275,13 +2275,18 @@ export class WeatherBallTypeAttr extends VariableMoveTypeAttr {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Changes the move's type to match the current terrain.
|
||||||
|
* Has no effect if the user is not grounded.
|
||||||
|
* @returns whether the type change was successful
|
||||||
|
*/
|
||||||
export class TerrainPulseTypeAttr extends VariableMoveTypeAttr {
|
export class TerrainPulseTypeAttr extends VariableMoveTypeAttr {
|
||||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||||
if(!user.isGrounded)
|
if(!user.isGrounded)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const currentTerrain = user.scene.arena.getTerrainType();
|
const currentTerrain = user.scene.arena.getTerrainType();
|
||||||
const type = (args[0] as Utils.IntegerHolder);
|
const type = (args[0] as Utils.IntegerHolder); // the move's type
|
||||||
|
|
||||||
switch (currentTerrain) {
|
switch (currentTerrain) {
|
||||||
case TerrainType.MISTY:
|
case TerrainType.MISTY:
|
||||||
|
|
Loading…
Reference in New Issue