-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Taunt Implementation #2159
Taunt Implementation #2159
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3767,6 +3767,25 @@ | |
} | ||
} | ||
|
||
export class TauntAttr extends MoveEffectAttr { | ||
constructor() { | ||
super(false); | ||
} | ||
|
||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { | ||
if (!super.apply(user, target, move, args)) { | ||
return false; | ||
} | ||
|
||
target.summonData.isTaunted = true; | ||
target.summonData.tauntedTurns = 3; | ||
|
||
user.scene.queueMessage(getPokemonMessage(target, ` fell for the taunt!`)); | ||
Check failure on line 3783 in src/data/move.ts GitHub Actions / Run linters
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. needs to be localizable |
||
|
||
return true; | ||
} | ||
} | ||
|
||
export class FrenzyAttr extends MoveEffectAttr { | ||
constructor() { | ||
super(true, MoveEffectTrigger.HIT); | ||
|
@@ -6163,7 +6182,8 @@ | |
.attr(StatChangeAttr, BattleStat.SPDEF, 1, true) | ||
.attr(AddBattlerTagAttr, BattlerTagType.CHARGED, true, false), | ||
new StatusMove(Moves.TAUNT, Type.DARK, 100, 20, -1, 0, 3) | ||
.unimplemented(), | ||
.attr(TauntAttr) | ||
.condition((user, target, move) => !target.summonData.isTaunted), | ||
new StatusMove(Moves.HELPING_HAND, Type.NORMAL, -1, 20, -1, 5, 3) | ||
.attr(AddBattlerTagAttr, BattlerTagType.HELPING_HAND) | ||
.target(MoveTarget.NEAR_ALLY), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1939,10 +1939,11 @@ | |
const move = playerPokemon.getMoveset()[cursor]; | ||
this.scene.ui.setMode(Mode.MESSAGE); | ||
|
||
// Decides between a Disabled, Not Implemented, or No PP translation message | ||
// Decides between a Taunted, Disabled, Not Implemented, or No PP translation message | ||
const errorMessage = | ||
playerPokemon.summonData.isTaunted === true ? "battle:moveTaunted": | ||
playerPokemon.summonData.disabledMove === move.moveId ? "battle:moveDisabled" : | ||
move.getName().endsWith(" (N)") ? "battle:moveNotImplemented" : "battle:moveNoPP"; | ||
const moveName = move.getName().replace(" (N)", ""); // Trims off the indicator | ||
|
||
this.scene.ui.showText(i18next.t(errorMessage, { moveName: moveName }), null, () => { | ||
|
@@ -2385,6 +2386,11 @@ | |
pokemon.summonData.disabledMove = Moves.NONE; | ||
} | ||
|
||
if (pokemon.summonData.isTaunted && !--pokemon.summonData.tauntedTurns) { | ||
this.scene.pushPhase(new MessagePhase(this.scene, i18next.t("battle:notTaunted", { pokemonName: getPokemonNameWithAffix(pokemon)}))); | ||
pokemon.summonData.isTaunted = false; | ||
} | ||
|
||
this.scene.applyModifiers(TurnHealModifier, pokemon.isPlayer(), pokemon); | ||
|
||
if (this.scene.arena.terrain?.terrainType === TerrainType.GRASSY && pokemon.isGrounded()) { | ||
|
@@ -2548,7 +2554,10 @@ | |
if (!this.canMove()) { | ||
if (this.move.moveId && this.pokemon.summonData?.disabledMove === this.move.moveId) { | ||
this.scene.queueMessage(`${this.move.getName()} is disabled!`); | ||
} | ||
else if (this.move.moveId && this.pokemon.summonData?.isTaunted) { | ||
this.scene.queueMessage(`${this.pokemon.name} can't use\n${this.move.getName()} after the taunt!`); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. localizable please |
||
} | ||
return this.end(); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,6 +120,8 @@ export default class PokemonData { | |
this.summonData.moveQueue = source.summonData.moveQueue; | ||
this.summonData.disabledMove = source.summonData.disabledMove; | ||
this.summonData.disabledTurns = source.summonData.disabledTurns; | ||
this.summonData.isTaunted = source.summonData.isTaunted; | ||
this.summonData.tauntedTurns = source.summonData.tauntedTurns; | ||
Comment on lines
+123
to
+124
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you're going to be keeping track of turns like this then Taunt might be better implemented as a BattleTag or StatusEffect There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ooooooh ok! I'll Iook into it right away :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had used Disable as a guideline since it was similar :) |
||
this.summonData.abilitySuppressed = source.summonData.abilitySuppressed; | ||
|
||
this.summonData.ability = source.summonData.ability; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use getPokemonWithAffix here please and make this localizable obviously