Skip to content
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

[Move] Fully implement Rage #3667

Open
wants to merge 23 commits into
base: beta
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions src/data/battler-tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,49 @@ export class ShellTrapTag extends BattlerTag {
}
}

/**
* BattlerTag implementing Rage
* Pokémon with this tag will recieve an attack boost when successfully damaged by an attacking move
* This tag will be lost if a target reaches the `MOVE_EFFECT` lapse condition with a move other than Rage
* @see {@link https://bulbapedia.bulbagarden.net/wiki/Rage_(move) | Rage}
*/
export class RageTag extends BattlerTag {
ElizaAlex marked this conversation as resolved.
Show resolved Hide resolved
constructor() {
super(BattlerTagType.RAGE, [BattlerTagLapseType.MOVE_EFFECT], 1, Moves.RAGE);
}

/**
* Displays a message to show that the user has started Raging.
* This is message isn't displayed on cartridge, and was included for clarity during gameplay and while testing.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* This is message isn't displayed on cartridge, and was included for clarity during gameplay and while testing.
* This message isn't displayed on cartridge, and was included for clarity during gameplay and while testing.

* @param pokemon {@linkcode Pokemon} the Pokémon this tag is being added to.
*/
onAdd(pokemon: Pokemon) {
super.onAdd(pokemon);
/* This message might not exist on cartridge */
pokemon.scene.queueMessage(i18next.t("battlerTags:rageOnAdd", {
pokemonNameWithAffix: getPokemonNameWithAffix(pokemon)}));
}

/**
* Checks if a Pokémon should maintain their rage, and provides an attack boost when hit.
* @param pokemon {@linkcode Pokemon} The owner of this tag
* @param lapseType {@linkcode BattlerTagLapseType} the type of functionality invoked in battle
* @returns `true` if invoked with the `MOVE_EFFECT` lapse type and {@linkcode pokemon} most recently used Rage,
* or if invoked with the `CUSTOM` lapse type; `false` otherwise.
*/
lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
if (lapseType === BattlerTagLapseType.MOVE_EFFECT) {
return (pokemon.scene.getCurrentPhase() as MovePhase).move.getMove().id === Moves.RAGE;
} else if (lapseType === BattlerTagLapseType.CUSTOM) {
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [Stat.ATK], 1, false));
pokemon.scene.queueMessage(i18next.t("battlerTags:rageOnHit", {
pokemonNameWithAffix: getPokemonNameWithAffix(pokemon)}));
return true;
}
return false;
}
}

export class TrappedTag extends BattlerTag {
constructor(tagType: BattlerTagType, lapseType: BattlerTagLapseType, turnCount: number, sourceMove: Moves, sourceId: number) {
super(tagType, lapseType, turnCount, sourceMove, sourceId, true);
Expand Down Expand Up @@ -2125,6 +2168,8 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: number, source
case BattlerTagType.GULP_MISSILE_ARROKUDA:
case BattlerTagType.GULP_MISSILE_PIKACHU:
return new GulpMissileTag(tagType, sourceMove);
case BattlerTagType.RAGE:
return new RageTag();
case BattlerTagType.NONE:
default:
return new BattlerTag(tagType, BattlerTagLapseType.CUSTOM, turnCount, sourceMove, sourceId);
Expand Down
2 changes: 1 addition & 1 deletion src/data/move.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6744,7 +6744,7 @@ export function initMoves() {
.attr(StatStageChangeAttr, [ Stat.SPD ], 2, true),
new AttackMove(Moves.QUICK_ATTACK, Type.NORMAL, MoveCategory.PHYSICAL, 40, 100, 30, -1, 1, 1),
new AttackMove(Moves.RAGE, Type.NORMAL, MoveCategory.PHYSICAL, 20, 100, 20, -1, 0, 1)
.partial(),
.attr(AddBattlerTagAttr, BattlerTagType.RAGE, true, false, 0, 0, false, true),
new SelfStatusMove(Moves.TELEPORT, Type.PSYCHIC, -1, 20, -1, -6, 1)
.attr(ForceSwitchOutAttr, true)
.hidesUser(),
Expand Down
3 changes: 2 additions & 1 deletion src/enums/battler-tag-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export enum BattlerTagType {
GULP_MISSILE_PIKACHU = "GULP_MISSILE_PIKACHU",
BEAK_BLAST_CHARGING = "BEAK_BLAST_CHARGING",
SHELL_TRAP = "SHELL_TRAP",
RAGE = "RAGE",
DRAGON_CHEER = "DRAGON_CHEER",
NO_RETREAT = "NO_RETREAT",
NO_RETREAT = "NO_RETREAT"
}
2 changes: 2 additions & 0 deletions src/locales/en/battler-tags.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
"cursedOnAdd": "{{pokemonNameWithAffix}} cut its own HP and put a curse on the {{pokemonName}}!",
"cursedLapse": "{{pokemonNameWithAffix}} is afflicted by the Curse!",
"stockpilingOnAdd": "{{pokemonNameWithAffix}} stockpiled {{stockpiledCount}}!",
"rageOnAdd": "{{pokemonNameWithAffix}}'s rage is starting to build.",
"rageOnHit": "{{pokemonNameWithAffix}}'s rage is building.",
"disabledOnAdd": "{{pokemonNameWithAffix}}'s {{moveName}}\nwas disabled!",
"disabledLapse": "{{pokemonNameWithAffix}}'s {{moveName}}\nis no longer disabled."
}
5 changes: 4 additions & 1 deletion src/locales/es/battler-tags.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,8 @@
"saltCuredLapse": "¡{{moveName}} ha herido a {{pokemonNameWithAffix}}!",
"cursedOnAdd": "¡{{pokemonNameWithAffix}} sacrifica algunos PS y maldice a {{pokemonName}}!",
"cursedLapse": "¡{{pokemonNameWithAffix}} es víctima de una maldición!",
"stockpilingOnAdd": "¡{{pokemonNameWithAffix}} ha reservado energía por {{stockpiledCount}}ª vez!"
"stockpilingOnAdd": "¡{{pokemonNameWithAffix}} ha reservado energía por {{stockpiledCount}}ª vez!",
"rageOnAdd": "¡La furia de {{pokemonNameWithAffix}} comienza a crecer!",
"rageOnHit": "¡La furia de {{pokemonNameWithAffix}} está aumentando!"
}

4 changes: 3 additions & 1 deletion src/locales/fr/battler-tags.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,7 @@
"saltCuredLapse": "{{pokemonNameWithAffix}} est blessé\npar la capacité {{moveName}} !",
"cursedOnAdd": "{{pokemonNameWithAffix}} sacrifie des PV\net lance une malédiction sur {{pokemonName}} !",
"cursedLapse": "{{pokemonNameWithAffix}} est touché par la malédiction !",
"stockpilingOnAdd": "{{pokemonNameWithAffix}} utilise\nla capacité Stockage {{stockpiledCount}} fois !"
"stockpilingOnAdd": "{{pokemonNameWithAffix}} utilise\nla capacité Stockage {{stockpiledCount}} fois !",
"rageOnAdd": "La Frénésie s’empare\nde {{pokemonNameWithAffix}} !",
"rageOnHit": "La Frénésie de {{pokemonNameWithAffix}}\naugmente !"
}
6 changes: 4 additions & 2 deletions src/locales/it/battler-tags.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,7 @@
"saltCuredLapse": "{{pokemonNameWithAffix}} viene colpito da {{moveName}}!",
"cursedOnAdd": "{{pokemonNameWithAffix}} ha sacrificato metà dei suoi PS per\nlanciare una maledizione su {{pokemonName}}!",
"cursedLapse": "{{pokemonNameWithAffix}} subisce la maledizione!",
"stockpilingOnAdd": "{{pokemonNameWithAffix}} ha usato Accumulo per la\n{{stockpiledCount}}ª volta!"
}
"stockpilingOnAdd": "{{pokemonNameWithAffix}} ha usato Accumulo per la\n{{stockpiledCount}}ª volta!",
"rageOnAdd": "{{pokemonNameWithAffix}} comincia ad accumulare ira!",
"rageOnHit": "L’ira di {{pokemonNameWithAffix}} aumenta!"
}
6 changes: 4 additions & 2 deletions src/locales/ko/battler-tags.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,7 @@
"saltCuredLapse": "{{pokemonNameWithAffix}}[[는]] 소금절이의\n데미지를 입고 있다.",
"cursedOnAdd": "{{pokemonNameWithAffix}}[[는]] 자신의 체력을 깎아서\n{{pokemonName}}에게 저주를 걸었다!",
"cursedLapse": "{{pokemonNameWithAffix}}[[는]]\n저주받고 있다!",
"stockpilingOnAdd": "{{pokemonNameWithAffix}}[[는]]\n{{stockpiledCount}}개 비축했다!"
}
"stockpilingOnAdd": "{{pokemonNameWithAffix}}[[는]]\n{{stockpiledCount}}개 비축했다!",
"rageOnAdd": "{{pokemonNameWithAffix}}[[는]]\n분노 볼티지를 쌓기 시작했다.",
"rageOnHit": "{{pokemonNameWithAffix}}의\n분노 볼티지가 올라가고 있다!"
}
6 changes: 4 additions & 2 deletions src/locales/pt_BR/battler-tags.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,7 @@
"saltCuredLapse": "{{pokemonNameWithAffix}} foi ferido pelo {{moveName}}!",
"cursedOnAdd": "{{pokemonNameWithAffix}} cortou seus PS pela metade e amaldiçoou {{pokemonName}}!",
"cursedLapse": "{{pokemonNameWithAffix}} foi ferido pelo Curse!",
"stockpilingOnAdd": "{{pokemonNameWithAffix}} estocou {{stockpiledCount}}!"
}
"stockpilingOnAdd": "{{pokemonNameWithAffix}} estocou {{stockpiledCount}}!",
"rageOnAdd": "A raiva de {{pokemonNameWithAffix}} está começando a aumentar.",
"rageOnHit": "A raiva de {{pokemonNameWithAffix}} está aumentando."
}
6 changes: 4 additions & 2 deletions src/locales/zh_CN/battler-tags.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,7 @@
"saltCuredLapse": "{{pokemonNameWithAffix}}\n受到了{{moveName}}的伤害!",
"cursedOnAdd": "{{pokemonNameWithAffix}}削减了自己的体力,\n并诅咒了{{pokemonName}}!",
"cursedLapse": "{{pokemonNameWithAffix}}\n正受到诅咒!",
"stockpilingOnAdd": "{{pokemonNameWithAffix}}蓄力了{{stockpiledCount}}次!"
}
"stockpilingOnAdd": "{{pokemonNameWithAffix}}蓄力了{{stockpiledCount}}次!",
"rageOnAdd": "{{pokemonNameWithAffix}}的\n怒气开始上升了。",
"rageOnHit": "{{pokemonNameWithAffix}}的\n怒气正在上升!."
}
6 changes: 4 additions & 2 deletions src/locales/zh_TW/battler-tags.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,7 @@
"saltCuredOnAdd": "{{pokemonNameWithAffix}} 陷入了鹽腌狀態!",
"saltCuredLapse": "{{pokemonNameWithAffix}} 受到了{{moveName}}的傷害!",
"cursedOnAdd": "{{pokemonNameWithAffix}}削減了自己的體力,並詛咒了{{pokemonName}}!",
"cursedLapse": "{{pokemonNameWithAffix}}正受到詛咒!"
}
"cursedLapse": "{{pokemonNameWithAffix}}正受到詛咒!",
"rageOnAdd": "{{pokemonNameWithAffix}}的\n怒氣開始上升了。",
"rageOnHit": "{{pokemonNameWithAffix}}的\n怒氣正在上升!"
}
3 changes: 3 additions & 0 deletions src/phases/move-effect-phase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ export class MoveEffectPhase extends PokemonPhase {
if (move.category === MoveCategory.PHYSICAL && user.isPlayer() !== target.isPlayer()) {
target.lapseTag(BattlerTagType.SHELL_TRAP);
}
if (hitResult < HitResult.NO_EFFECT && move.category !== MoveCategory.STATUS) {
target.lapseTag(BattlerTagType.RAGE);
}
if (!user.isPlayer() && this.move.getMove() instanceof AttackMove) {
user.scene.applyShuffledModifiers(this.scene, EnemyAttackStatusEffectChanceModifier, false, target);
}
Expand Down
Loading