Implement Tailwind (#398)
Added a new ArenaTagType for Tailwind. Lasts 4 turns including the turn used.pull/399/head
parent
ddb4383b1f
commit
9d8f7ddcf0
|
@ -482,6 +482,20 @@ export class GravityTag extends ArenaTag {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class TailwindTag extends ArenaTag {
|
||||||
|
constructor(turnCount: integer, sourceId: integer, side: ArenaTagSide) {
|
||||||
|
super(ArenaTagType.TAILWIND, turnCount, Moves.TAILWIND, sourceId, side);
|
||||||
|
}
|
||||||
|
|
||||||
|
onAdd(arena: Arena): void {
|
||||||
|
arena.scene.queueMessage(`The Tailwind blew from behind${this.side === ArenaTagSide.PLAYER ? '\nyour' : this.side === ArenaTagSide.ENEMY ? '\nthe opposing' : ''} team!`);
|
||||||
|
}
|
||||||
|
|
||||||
|
onRemove(arena: Arena): void {
|
||||||
|
arena.scene.queueMessage(`${this.side === ArenaTagSide.PLAYER ? 'Your' : this.side === ArenaTagSide.ENEMY ? 'The opposing' : ''} team's Tailwind petered out!`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function getArenaTag(tagType: ArenaTagType, turnCount: integer, sourceMove: Moves, sourceId: integer, targetIndex?: BattlerIndex, side: ArenaTagSide = ArenaTagSide.BOTH): ArenaTag {
|
export function getArenaTag(tagType: ArenaTagType, turnCount: integer, sourceMove: Moves, sourceId: integer, targetIndex?: BattlerIndex, side: ArenaTagSide = ArenaTagSide.BOTH): ArenaTag {
|
||||||
switch (tagType) {
|
switch (tagType) {
|
||||||
case ArenaTagType.MIST:
|
case ArenaTagType.MIST:
|
||||||
|
@ -513,5 +527,7 @@ export function getArenaTag(tagType: ArenaTagType, turnCount: integer, sourceMov
|
||||||
return new LightScreenTag(turnCount, sourceId, side);
|
return new LightScreenTag(turnCount, sourceId, side);
|
||||||
case ArenaTagType.AURORA_VEIL:
|
case ArenaTagType.AURORA_VEIL:
|
||||||
return new AuroraVeilTag(turnCount, sourceId, side);
|
return new AuroraVeilTag(turnCount, sourceId, side);
|
||||||
|
case ArenaTagType.TAILWIND:
|
||||||
|
return new TailwindTag(turnCount, sourceId, side);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,5 +15,6 @@ export enum ArenaTagType {
|
||||||
GRAVITY = "GRAVITY",
|
GRAVITY = "GRAVITY",
|
||||||
REFLECT = "REFLECT",
|
REFLECT = "REFLECT",
|
||||||
LIGHT_SCREEN = "LIGHT_SCREEN",
|
LIGHT_SCREEN = "LIGHT_SCREEN",
|
||||||
AURORA_VEIL = "AURORA_VEIL"
|
AURORA_VEIL = "AURORA_VEIL",
|
||||||
|
TAILWIND = "TAILWIND"
|
||||||
}
|
}
|
||||||
|
|
|
@ -4805,8 +4805,8 @@ export function initMoves() {
|
||||||
.partial(),
|
.partial(),
|
||||||
new StatusMove(Moves.TAILWIND, Type.FLYING, -1, 15, -1, 0, 4)
|
new StatusMove(Moves.TAILWIND, Type.FLYING, -1, 15, -1, 0, 4)
|
||||||
.windMove()
|
.windMove()
|
||||||
.target(MoveTarget.USER_SIDE)
|
.attr(AddArenaTagAttr, ArenaTagType.TAILWIND, 4, true)
|
||||||
.unimplemented(),
|
.target(MoveTarget.USER_SIDE),
|
||||||
new StatusMove(Moves.ACUPRESSURE, Type.NORMAL, -1, 30, -1, 0, 4)
|
new StatusMove(Moves.ACUPRESSURE, Type.NORMAL, -1, 30, -1, 0, 4)
|
||||||
.attr(StatChangeAttr, BattleStat.RAND, 2)
|
.attr(StatChangeAttr, BattleStat.RAND, 2)
|
||||||
.target(MoveTarget.USER_OR_NEAR_ALLY),
|
.target(MoveTarget.USER_OR_NEAR_ALLY),
|
||||||
|
|
|
@ -589,6 +589,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||||
ret *= 1.5;
|
ret *= 1.5;
|
||||||
break;
|
break;
|
||||||
case Stat.SPD:
|
case Stat.SPD:
|
||||||
|
// Check both the player and enemy to see if Tailwind should be multiplying the speed of the Pokemon
|
||||||
|
if ((this.isPlayer() && this.scene.arena.getTagOnSide(ArenaTagType.TAILWIND, ArenaTagSide.PLAYER))
|
||||||
|
|| (!this.isPlayer() && this.scene.arena.getTagOnSide(ArenaTagType.TAILWIND, ArenaTagSide.ENEMY)))
|
||||||
|
ret *= 2;
|
||||||
|
|
||||||
if (this.getTag(BattlerTagType.SLOW_START))
|
if (this.getTag(BattlerTagType.SLOW_START))
|
||||||
ret >>= 1;
|
ret >>= 1;
|
||||||
if (this.status && this.status.effect === StatusEffect.PARALYSIS)
|
if (this.status && this.status.effect === StatusEffect.PARALYSIS)
|
||||||
|
|
Loading…
Reference in New Issue