Implement Helping Hand move
parent
9350b380b2
commit
4f62dec998
|
@ -340,8 +340,8 @@ export class FrenzyTag extends BattlerTag {
|
||||||
export class EncoreTag extends BattlerTag {
|
export class EncoreTag extends BattlerTag {
|
||||||
public moveId: Moves;
|
public moveId: Moves;
|
||||||
|
|
||||||
constructor(sourceMove: Moves, sourceId: integer) {
|
constructor(sourceId: integer) {
|
||||||
super(BattlerTagType.ENCORE, BattlerTagLapseType.AFTER_MOVE, 3, sourceMove, sourceId);
|
super(BattlerTagType.ENCORE, BattlerTagLapseType.AFTER_MOVE, 3, Moves.ENCORE, sourceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
canAdd(pokemon: Pokemon): boolean {
|
canAdd(pokemon: Pokemon): boolean {
|
||||||
|
@ -396,6 +396,16 @@ export class EncoreTag extends BattlerTag {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class HelpingHandTag extends BattlerTag {
|
||||||
|
constructor(sourceId: integer) {
|
||||||
|
super(BattlerTagType.HELPING_HAND, BattlerTagLapseType.TURN_END, 1, Moves.HELPING_HAND, sourceId);
|
||||||
|
}
|
||||||
|
|
||||||
|
onAdd(pokemon: Pokemon): void {
|
||||||
|
pokemon.scene.queueMessage(getPokemonMessage(pokemon.scene.getPokemonById(this.sourceId), ` is ready to\nhelp ${pokemon.name}!`));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class IngrainTag extends TrappedTag {
|
export class IngrainTag extends TrappedTag {
|
||||||
constructor(sourceId: integer) {
|
constructor(sourceId: integer) {
|
||||||
super(BattlerTagType.INGRAIN, BattlerTagLapseType.TURN_END, 1, Moves.INGRAIN, sourceId);
|
super(BattlerTagType.INGRAIN, BattlerTagLapseType.TURN_END, 1, Moves.INGRAIN, sourceId);
|
||||||
|
@ -880,7 +890,9 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: integer, sourc
|
||||||
case BattlerTagType.FRENZY:
|
case BattlerTagType.FRENZY:
|
||||||
return new FrenzyTag(sourceMove, sourceId);
|
return new FrenzyTag(sourceMove, sourceId);
|
||||||
case BattlerTagType.ENCORE:
|
case BattlerTagType.ENCORE:
|
||||||
return new EncoreTag(sourceMove, sourceId);
|
return new EncoreTag(sourceId);
|
||||||
|
case BattlerTagType.HELPING_HAND:
|
||||||
|
return new HelpingHandTag(sourceId);
|
||||||
case BattlerTagType.INGRAIN:
|
case BattlerTagType.INGRAIN:
|
||||||
return new IngrainTag(sourceId);
|
return new IngrainTag(sourceId);
|
||||||
case BattlerTagType.AQUA_RING:
|
case BattlerTagType.AQUA_RING:
|
||||||
|
@ -939,6 +951,7 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: integer, sourc
|
||||||
return new BattlerTag(BattlerTagType.BYPASS_SLEEP, BattlerTagLapseType.TURN_END, turnCount, sourceMove);
|
return new BattlerTag(BattlerTagType.BYPASS_SLEEP, BattlerTagLapseType.TURN_END, turnCount, sourceMove);
|
||||||
case BattlerTagType.IGNORE_FLYING:
|
case BattlerTagType.IGNORE_FLYING:
|
||||||
return new BattlerTag(tagType, BattlerTagLapseType.TURN_END, turnCount, sourceMove);
|
return new BattlerTag(tagType, BattlerTagLapseType.TURN_END, turnCount, sourceMove);
|
||||||
|
case BattlerTagType.NONE:
|
||||||
default:
|
default:
|
||||||
return new BattlerTag(tagType, BattlerTagLapseType.CUSTOM, turnCount, sourceMove, sourceId);
|
return new BattlerTag(tagType, BattlerTagLapseType.CUSTOM, turnCount, sourceMove, sourceId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ export enum BattlerTagType {
|
||||||
NIGHTMARE = "NIGHTMARE",
|
NIGHTMARE = "NIGHTMARE",
|
||||||
FRENZY = "FRENZY",
|
FRENZY = "FRENZY",
|
||||||
ENCORE = "ENCORE",
|
ENCORE = "ENCORE",
|
||||||
|
HELPING_HAND = "HELPING_HAND",
|
||||||
INGRAIN = "INGRAIN",
|
INGRAIN = "INGRAIN",
|
||||||
AQUA_RING = "AQUA_RING",
|
AQUA_RING = "AQUA_RING",
|
||||||
DROWSY = "DROWSY",
|
DROWSY = "DROWSY",
|
||||||
|
|
|
@ -3205,7 +3205,7 @@ export function initMoves() {
|
||||||
.hidesUser(),
|
.hidesUser(),
|
||||||
new StatusMove(Moves.ENCORE, "Encore", Type.NORMAL, 100, 5, "The user compels the target to keep using the move it encored for three turns.", -1, 0, 2)
|
new StatusMove(Moves.ENCORE, "Encore", Type.NORMAL, 100, 5, "The user compels the target to keep using the move it encored for three turns.", -1, 0, 2)
|
||||||
.attr(AddBattlerTagAttr, BattlerTagType.ENCORE, false, true)
|
.attr(AddBattlerTagAttr, BattlerTagType.ENCORE, false, true)
|
||||||
.condition((user, target, move) => new EncoreTag(move.id, user.id).canAdd(target)),
|
.condition((user, target, move) => new EncoreTag(user.id).canAdd(target)),
|
||||||
new AttackMove(Moves.PURSUIT, "Pursuit (P)", Type.DARK, MoveCategory.PHYSICAL, 40, 100, 20, "The power of this attack move is doubled if it's used on a target that's switching out of battle.", -1, 0, 2),
|
new AttackMove(Moves.PURSUIT, "Pursuit (P)", Type.DARK, MoveCategory.PHYSICAL, 40, 100, 20, "The power of this attack move is doubled if it's used on a target that's switching out of battle.", -1, 0, 2),
|
||||||
new AttackMove(Moves.RAPID_SPIN, "Rapid Spin", Type.NORMAL, MoveCategory.PHYSICAL, 50, 100, 40, "A spin attack that can also eliminate such moves as Bind, Wrap, and Leech Seed. This also raises the user's Speed stat.", 100, 0, 2)
|
new AttackMove(Moves.RAPID_SPIN, "Rapid Spin", Type.NORMAL, MoveCategory.PHYSICAL, 50, 100, 40, "A spin attack that can also eliminate such moves as Bind, Wrap, and Leech Seed. This also raises the user's Speed stat.", 100, 0, 2)
|
||||||
.attr(StatChangeAttr, BattleStat.SPD, 1, true)
|
.attr(StatChangeAttr, BattleStat.SPD, 1, true)
|
||||||
|
@ -3300,7 +3300,8 @@ export function initMoves() {
|
||||||
new SelfStatusMove(Moves.CHARGE, "Charge (P)", Type.ELECTRIC, -1, 20, "The user boosts the power of the Electric move it uses on the next turn. This also raises the user's Sp. Def stat.", -1, 0, 3)
|
new SelfStatusMove(Moves.CHARGE, "Charge (P)", Type.ELECTRIC, -1, 20, "The user boosts the power of the Electric move it uses on the next turn. This also raises the user's Sp. Def stat.", -1, 0, 3)
|
||||||
.attr(StatChangeAttr, BattleStat.SPDEF, 1, true),
|
.attr(StatChangeAttr, BattleStat.SPDEF, 1, true),
|
||||||
new StatusMove(Moves.TAUNT, "Taunt (N)", Type.DARK, 100, 20, "The target is taunted into a rage that allows it to use only attack moves for three turns.", -1, 0, 3),
|
new StatusMove(Moves.TAUNT, "Taunt (N)", Type.DARK, 100, 20, "The target is taunted into a rage that allows it to use only attack moves for three turns.", -1, 0, 3),
|
||||||
new StatusMove(Moves.HELPING_HAND, "Helping Hand (N)", Type.NORMAL, -1, 20, "The user assists an ally by boosting the power of that ally's attack.", -1, 5, 3)
|
new StatusMove(Moves.HELPING_HAND, "Helping Hand", Type.NORMAL, -1, 20, "The user assists an ally by boosting the power of that ally's attack.", -1, 5, 3)
|
||||||
|
.attr(AddBattlerTagAttr, BattlerTagType.HELPING_HAND)
|
||||||
.target(MoveTarget.NEAR_ALLY),
|
.target(MoveTarget.NEAR_ALLY),
|
||||||
new StatusMove(Moves.TRICK, "Trick (N)", Type.PSYCHIC, 100, 10, "The user catches the target off guard and swaps its held item with its own.", -1, 0, 3),
|
new StatusMove(Moves.TRICK, "Trick (N)", Type.PSYCHIC, 100, 10, "The user catches the target off guard and swaps its held item with its own.", -1, 0, 3),
|
||||||
new StatusMove(Moves.ROLE_PLAY, "Role Play (N)", Type.PSYCHIC, -1, 10, "The user mimics the target completely, copying the target's Ability.", -1, 0, 3),
|
new StatusMove(Moves.ROLE_PLAY, "Role Play (N)", Type.PSYCHIC, -1, 10, "The user mimics the target completely, copying the target's Ability.", -1, 0, 3),
|
||||||
|
|
|
@ -17,7 +17,7 @@ import { pokemonEvolutions, pokemonPrevolutions, SpeciesFormEvolution, SpeciesEv
|
||||||
import { reverseCompatibleTms, tmSpecies } from '../data/tms';
|
import { reverseCompatibleTms, tmSpecies } from '../data/tms';
|
||||||
import { DamagePhase, FaintPhase, LearnMovePhase, ObtainStatusEffectPhase, StatChangePhase, SwitchSummonPhase } from '../phases';
|
import { DamagePhase, FaintPhase, LearnMovePhase, ObtainStatusEffectPhase, StatChangePhase, SwitchSummonPhase } from '../phases';
|
||||||
import { BattleStat } from '../data/battle-stat';
|
import { BattleStat } from '../data/battle-stat';
|
||||||
import { BattlerTag, BattlerTagLapseType, EncoreTag, TypeBoostTag, getBattlerTag } from '../data/battler-tags';
|
import { BattlerTag, BattlerTagLapseType, EncoreTag, HelpingHandTag, TypeBoostTag, getBattlerTag } from '../data/battler-tags';
|
||||||
import { BattlerTagType } from "../data/enums/battler-tag-type";
|
import { BattlerTagType } from "../data/enums/battler-tag-type";
|
||||||
import { Species } from '../data/enums/species';
|
import { Species } from '../data/enums/species';
|
||||||
import { WeatherType } from '../data/weather';
|
import { WeatherType } from '../data/weather';
|
||||||
|
@ -1076,6 +1076,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||||
this.scene.arena.applyTags(WeakenMoveTypeTag, move.type, power);
|
this.scene.arena.applyTags(WeakenMoveTypeTag, move.type, power);
|
||||||
this.scene.applyModifiers(AttackTypeBoosterModifier, source.isPlayer(), source, power);
|
this.scene.applyModifiers(AttackTypeBoosterModifier, source.isPlayer(), source, power);
|
||||||
}
|
}
|
||||||
|
if (source.getTag(HelpingHandTag))
|
||||||
|
power.value *= 1.5;
|
||||||
let isCritical: boolean;
|
let isCritical: boolean;
|
||||||
const critOnly = new Utils.BooleanHolder(false);
|
const critOnly = new Utils.BooleanHolder(false);
|
||||||
applyMoveAttrs(CritOnlyAttr, source, this, move, critOnly);
|
applyMoveAttrs(CritOnlyAttr, source, this, move, critOnly);
|
||||||
|
|
Loading…
Reference in New Issue