mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-07 08:52:17 +02:00
implement taunt
This commit is contained in:
parent
fa2d257144
commit
f8549f4264
@ -544,6 +544,25 @@ export class DrowsyTag extends BattlerTag {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class TauntedTag extends BattlerTag {
|
||||||
|
|
||||||
|
constructor(sourceId: integer, turnCount: integer) {
|
||||||
|
super(BattlerTagType.TAUNTED, BattlerTagLapseType.PRE_MOVE, turnCount, Moves.TAUNT, sourceId);
|
||||||
|
}
|
||||||
|
|
||||||
|
onAdd(pokemon: Pokemon): void {
|
||||||
|
super.onAdd(pokemon);
|
||||||
|
|
||||||
|
pokemon.scene.queueMessage(getPokemonMessage(pokemon, ' fell for\nthe taunt!'));
|
||||||
|
}
|
||||||
|
|
||||||
|
onRemove(pokemon: Pokemon): void {
|
||||||
|
super.onAdd(pokemon);
|
||||||
|
|
||||||
|
pokemon.scene.queueMessage(getPokemonMessage(pokemon, ' shook off\nthe taunt!'),null, null, null, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export abstract class DamagingTrapTag extends TrappedTag {
|
export abstract class DamagingTrapTag extends TrappedTag {
|
||||||
private commonAnim: CommonAnim;
|
private commonAnim: CommonAnim;
|
||||||
|
|
||||||
@ -1226,6 +1245,8 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: integer, sourc
|
|||||||
return new TypeBoostTag(tagType, sourceMove, Type.ELECTRIC, 2, true);
|
return new TypeBoostTag(tagType, sourceMove, Type.ELECTRIC, 2, true);
|
||||||
case BattlerTagType.MAGNET_RISEN:
|
case BattlerTagType.MAGNET_RISEN:
|
||||||
return new MagnetRisenTag(tagType, sourceMove);
|
return new MagnetRisenTag(tagType, sourceMove);
|
||||||
|
case BattlerTagType.TAUNTED:
|
||||||
|
return new TauntedTag(sourceId, turnCount);
|
||||||
case BattlerTagType.NONE:
|
case BattlerTagType.NONE:
|
||||||
default:
|
default:
|
||||||
return new BattlerTag(tagType, BattlerTagLapseType.CUSTOM, turnCount, sourceMove, sourceId);
|
return new BattlerTag(tagType, BattlerTagLapseType.CUSTOM, turnCount, sourceMove, sourceId);
|
||||||
|
@ -55,5 +55,6 @@ export enum BattlerTagType {
|
|||||||
CURSED = "CURSED",
|
CURSED = "CURSED",
|
||||||
CHARGED = "CHARGED",
|
CHARGED = "CHARGED",
|
||||||
GROUNDED = "GROUNDED",
|
GROUNDED = "GROUNDED",
|
||||||
MAGNET_RISEN = "MAGNET_RISEN"
|
MAGNET_RISEN = "MAGNET_RISEN",
|
||||||
|
TAUNTED = "TAUNTED"
|
||||||
}
|
}
|
||||||
|
@ -4677,7 +4677,7 @@ export function initMoves() {
|
|||||||
.attr(StatChangeAttr, BattleStat.SPDEF, 1, true)
|
.attr(StatChangeAttr, BattleStat.SPDEF, 1, true)
|
||||||
.attr(AddBattlerTagAttr, BattlerTagType.CHARGED, true, true),
|
.attr(AddBattlerTagAttr, BattlerTagType.CHARGED, true, true),
|
||||||
new StatusMove(Moves.TAUNT, Type.DARK, 100, 20, -1, 0, 3)
|
new StatusMove(Moves.TAUNT, Type.DARK, 100, 20, -1, 0, 3)
|
||||||
.unimplemented(),
|
.attr(AddBattlerTagAttr, BattlerTagType.TAUNTED, false, true, 4),
|
||||||
new StatusMove(Moves.HELPING_HAND, Type.NORMAL, -1, 20, -1, 5, 3)
|
new StatusMove(Moves.HELPING_HAND, Type.NORMAL, -1, 20, -1, 5, 3)
|
||||||
.attr(AddBattlerTagAttr, BattlerTagType.HELPING_HAND)
|
.attr(AddBattlerTagAttr, BattlerTagType.HELPING_HAND)
|
||||||
.target(MoveTarget.NEAR_ALLY),
|
.target(MoveTarget.NEAR_ALLY),
|
||||||
|
@ -19,7 +19,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, HelpingHandTag, TypeBoostTag, getBattlerTag } from '../data/battler-tags';
|
import { BattlerTag, BattlerTagLapseType, EncoreTag, HelpingHandTag, TypeBoostTag, getBattlerTag, TauntedTag } 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';
|
||||||
@ -3168,6 +3168,8 @@ export class PokemonMove {
|
|||||||
isUsable(pokemon: Pokemon, ignorePp?: boolean): boolean {
|
isUsable(pokemon: Pokemon, ignorePp?: boolean): boolean {
|
||||||
if (this.moveId && pokemon.summonData?.disabledMove === this.moveId)
|
if (this.moveId && pokemon.summonData?.disabledMove === this.moveId)
|
||||||
return false;
|
return false;
|
||||||
|
if (this.moveId && pokemon.getTag(TauntedTag) && this.getMove().category === MoveCategory.STATUS)
|
||||||
|
return false;
|
||||||
return ignorePp || this.ppUsed < this.getMovePp() || this.getMove().pp === -1;
|
return ignorePp || this.ppUsed < this.getMovePp() || this.getMove().pp === -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import BattleScene, { bypassLogin, startingWave } from "./battle-scene";
|
|||||||
import { default as Pokemon, PlayerPokemon, EnemyPokemon, PokemonMove, MoveResult, DamageResult, FieldPosition, HitResult, TurnMove } from "./field/pokemon";
|
import { default as Pokemon, PlayerPokemon, EnemyPokemon, PokemonMove, MoveResult, DamageResult, FieldPosition, HitResult, TurnMove } from "./field/pokemon";
|
||||||
import * as Utils from './utils';
|
import * as Utils from './utils';
|
||||||
import { Moves } from "./data/enums/moves";
|
import { Moves } from "./data/enums/moves";
|
||||||
import { allMoves, applyMoveAttrs, BypassSleepAttr, ChargeAttr, applyFilteredMoveAttrs, HitsTagAttr, MissEffectAttr, MoveAttr, MoveEffectAttr, MoveFlags, MultiHitAttr, OverrideMoveEffectAttr, VariableAccuracyAttr, MoveTarget, OneHitKOAttr, getMoveTargets, MoveTargetSet, MoveEffectTrigger, CopyMoveAttr, AttackMove, SelfStatusMove, DelayedAttackAttr, RechargeAttr, PreMoveMessageAttr, HealStatusEffectAttr, IgnoreOpponentStatChangesAttr, NoEffectAttr, FixedDamageAttr, OneHitKOAccuracyAttr, ForceSwitchOutAttr, VariableTargetAttr } from "./data/move";
|
import { allMoves, applyMoveAttrs, BypassSleepAttr, ChargeAttr, applyFilteredMoveAttrs, HitsTagAttr, MissEffectAttr, MoveAttr, MoveEffectAttr, MoveFlags, MultiHitAttr, OverrideMoveEffectAttr, VariableAccuracyAttr, MoveTarget, OneHitKOAttr, getMoveTargets, MoveTargetSet, MoveEffectTrigger, CopyMoveAttr, AttackMove, SelfStatusMove, DelayedAttackAttr, RechargeAttr, PreMoveMessageAttr, HealStatusEffectAttr, IgnoreOpponentStatChangesAttr, NoEffectAttr, FixedDamageAttr, OneHitKOAccuracyAttr, ForceSwitchOutAttr, VariableTargetAttr, MoveCategory } from "./data/move";
|
||||||
import { Mode } from './ui/ui';
|
import { Mode } from './ui/ui';
|
||||||
import { Command } from "./ui/command-ui-handler";
|
import { Command } from "./ui/command-ui-handler";
|
||||||
import { Stat } from "./data/pokemon-stat";
|
import { Stat } from "./data/pokemon-stat";
|
||||||
@ -21,7 +21,7 @@ import { Biome } from "./data/enums/biome";
|
|||||||
import { ModifierTier } from "./modifier/modifier-tier";
|
import { ModifierTier } from "./modifier/modifier-tier";
|
||||||
import { FusePokemonModifierType, ModifierPoolType, ModifierType, ModifierTypeFunc, ModifierTypeOption, PokemonModifierType, PokemonMoveModifierType, PokemonPpRestoreModifierType, PokemonPpUpModifierType, RememberMoveModifierType, TmModifierType, getDailyRunStarterModifiers, getEnemyBuffModifierForWave, getModifierType, getPlayerModifierTypeOptions, getPlayerShopModifierTypeOptionsForWave, modifierTypes, regenerateModifierPoolThresholds } from "./modifier/modifier-type";
|
import { FusePokemonModifierType, ModifierPoolType, ModifierType, ModifierTypeFunc, ModifierTypeOption, PokemonModifierType, PokemonMoveModifierType, PokemonPpRestoreModifierType, PokemonPpUpModifierType, RememberMoveModifierType, TmModifierType, getDailyRunStarterModifiers, getEnemyBuffModifierForWave, getModifierType, getPlayerModifierTypeOptions, getPlayerShopModifierTypeOptionsForWave, modifierTypes, regenerateModifierPoolThresholds } from "./modifier/modifier-type";
|
||||||
import SoundFade from "phaser3-rex-plugins/plugins/soundfade";
|
import SoundFade from "phaser3-rex-plugins/plugins/soundfade";
|
||||||
import { BattlerTagLapseType, EncoreTag, HideSpriteTag as HiddenTag, ProtectedTag, TrappedTag } from "./data/battler-tags";
|
import { BattlerTagLapseType, EncoreTag, HideSpriteTag as HiddenTag, ProtectedTag, TauntedTag, TrappedTag } from "./data/battler-tags";
|
||||||
import { BattlerTagType } from "./data/enums/battler-tag-type";
|
import { BattlerTagType } from "./data/enums/battler-tag-type";
|
||||||
import { getPokemonMessage } from "./messages";
|
import { getPokemonMessage } from "./messages";
|
||||||
import { Starter } from "./ui/starter-select-ui-handler";
|
import { Starter } from "./ui/starter-select-ui-handler";
|
||||||
@ -2189,6 +2189,8 @@ export class MovePhase extends BattlePhase {
|
|||||||
if (!this.canMove()) {
|
if (!this.canMove()) {
|
||||||
if (this.move.moveId && this.pokemon.summonData.disabledMove === this.move.moveId)
|
if (this.move.moveId && this.pokemon.summonData.disabledMove === this.move.moveId)
|
||||||
this.scene.queueMessage(`${this.move.getName()} is disabled!`);
|
this.scene.queueMessage(`${this.move.getName()} is disabled!`);
|
||||||
|
if (this.move.moveId && this.pokemon.getTag(TauntedTag) && this.move.getMove().category === MoveCategory.STATUS)
|
||||||
|
this.scene.queueMessage(`${this.pokemon.name} is taunted!`);
|
||||||
return this.end();
|
return this.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user