From 4beb8d47ef00c414612e58ed57f38fff9718d612 Mon Sep 17 00:00:00 2001 From: Adrienn Tindall <33725376+adrienntindall@users.noreply.github.com> Date: Wed, 24 Apr 2024 16:18:56 -0400 Subject: [PATCH 1/3] Heal Block Implementation pre-testing --- src/data/battler-tags.ts | 20 ++++++++++++++++++++ src/data/enums/battler-tag-type.ts | 1 + src/data/move.ts | 4 ++-- src/phases.ts | 6 ++++++ 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index b12d15968..6c8badad7 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -1071,6 +1071,24 @@ export class CursedTag extends BattlerTag { } } +export class HealBlockTag extends BattlerTag { + constructor(turnCount : integer, sourceMove : Moves) { + super(BattlerTagType.HEAL_BLOCKED, BattlerTagLapseType.TURN_END, turnCount, sourceMove); + } + + onAdd(pokemon: Pokemon) { + super.onAdd(pokemon); + + pokemon.scene.queueMessage(getPokemonMessage(pokemon, ' was prevented from healing!')); + } + + onRemove(pokemon: Pokemon): void { + super.onRemove(pokemon); + + pokemon.scene.queueMessage(getPokemonMessage(pokemon, '\'s ' + super.getMoveName() + ' wore off!')); + } +} + export function getBattlerTag(tagType: BattlerTagType, turnCount: integer, sourceMove: Moves, sourceId: integer): BattlerTag { switch (tagType) { case BattlerTagType.RECHARGING: @@ -1174,6 +1192,8 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: integer, sourc return new CursedTag(sourceId); case BattlerTagType.CHARGED: return new TypeBoostTag(tagType, sourceMove, Type.ELECTRIC, 2, true); + case BattlerTagType.HEAL_BLOCKED: + return new HealBlockTag(turnCount, sourceMove); case BattlerTagType.NONE: default: return new BattlerTag(tagType, BattlerTagLapseType.CUSTOM, turnCount, sourceMove, sourceId); diff --git a/src/data/enums/battler-tag-type.ts b/src/data/enums/battler-tag-type.ts index 4d810b737..2a0ff61f2 100644 --- a/src/data/enums/battler-tag-type.ts +++ b/src/data/enums/battler-tag-type.ts @@ -52,5 +52,6 @@ export enum BattlerTagType { SALT_CURED = "SALT_CURED", CURSED = "CURSED", CHARGED = "CHARGED", + HEAL_BLOCKED = "HEAL_BLOCKED", GROUNDED = "GROUNDED" } diff --git a/src/data/move.ts b/src/data/move.ts index 53244082b..cf76f3726 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -4727,7 +4727,7 @@ export function initMoves() { .unimplemented(), new StatusMove(Moves.HEAL_BLOCK, Type.PSYCHIC, 100, 15, -1, 0, 4) .target(MoveTarget.ALL_NEAR_ENEMIES) - .unimplemented(), + .attr(AddBattlerTagAttr, BattlerTagType.HEAL_BLOCKED, false, true, 5), new AttackMove(Moves.WRING_OUT, Type.NORMAL, MoveCategory.SPECIAL, -1, 100, 5, -1, 0, 4) .attr(OpponentHighHpPowerAttr) .makesContact(), @@ -6320,7 +6320,7 @@ export function initMoves() { .attr(NoEffectAttr, crashDamageFunc), new AttackMove(Moves.PSYCHIC_NOISE, Type.PSYCHIC, MoveCategory.SPECIAL, 75, 100, 10, -1, 0, 9) .soundBased() - .partial(), + .attr(AddBattlerTagAttr, BattlerTagType.HEAL_BLOCKED, false, true, 2), new AttackMove(Moves.UPPER_HAND, Type.FIGHTING, MoveCategory.PHYSICAL, 65, 100, 15, -1, 3, 9) .partial(), new AttackMove(Moves.MALIGNANT_CHAIN, Type.POISON, MoveCategory.SPECIAL, 100, 100, 5, 50, 0, 9) diff --git a/src/phases.ts b/src/phases.ts index e6e72b355..07fa63e85 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -3857,6 +3857,12 @@ export class PokemonHealPhase extends CommonAnimPhase { return; } + if (pokemon.getTag(HealBlockTag)) { + this.scene.queueMessage(getPokemonMessage(pokemon, ' was prevented from healing!')); + super.end(); + return; + } + const fullHp = pokemon.getHpRatio() >= 1; const hasMessage = !!this.message; From 263aae7eecfd1caca73143819a34b36a664011e2 Mon Sep 17 00:00:00 2001 From: adrienntindall Date: Wed, 24 Apr 2024 16:28:45 -0400 Subject: [PATCH 2/3] Fix freeze --- package-lock.json | 4 ++-- src/phases.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5521dcc86..b07ba2f32 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pokemon-rogue-battle", - "version": "1.0.1", + "version": "1.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "pokemon-rogue-battle", - "version": "1.0.1", + "version": "1.0.2", "dependencies": { "@material/material-color-utilities": "^0.2.7", "crypto-js": "^4.2.0", diff --git a/src/phases.ts b/src/phases.ts index 5003c340a..ff75a4272 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -21,7 +21,7 @@ import { Biome } from "./data/enums/biome"; import { ModifierTier } from "./modifier/modifier-tier"; import { FusePokemonModifierType, ModifierPoolType, ModifierType, ModifierTypeFunc, ModifierTypeOption, PokemonModifierType, PokemonMoveModifierType, RememberMoveModifierType, TmModifierType, getDailyRunStarterModifiers, getEnemyBuffModifierForWave, getModifierType, getPlayerModifierTypeOptions, getPlayerShopModifierTypeOptionsForWave, modifierTypes, regenerateModifierPoolThresholds } from "./modifier/modifier-type"; import SoundFade from "phaser3-rex-plugins/plugins/soundfade"; -import { BattlerTagLapseType, EncoreTag, HideSpriteTag as HiddenTag, ProtectedTag, TrappedTag } from "./data/battler-tags"; +import { BattlerTagLapseType, EncoreTag, HealBlockTag, HideSpriteTag as HiddenTag, ProtectedTag, TrappedTag } from "./data/battler-tags"; import { BattlerTagType } from "./data/enums/battler-tag-type"; import { getPokemonMessage } from "./messages"; import { Starter } from "./ui/starter-select-ui-handler"; From 28cdc10ff384cdc858087742e6d0315fe8dbbfe1 Mon Sep 17 00:00:00 2001 From: Adrienn Tindall <33725376+adrienntindall@users.noreply.github.com> Date: Wed, 24 Apr 2024 17:15:01 -0400 Subject: [PATCH 3/3] Update learnsets Since the move was removed post gen 8, I used the levels from gen 7 learnsets. Also marked as partial complete because it's supposed to fully disable moves that can heal like drain punch, etc but that's too much work for now --- package-lock.json | 4 ++-- src/data/move.ts | 6 ++++-- src/data/pokemon-level-moves.ts | 21 +++++++++++++++++++++ 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index b07ba2f32..5521dcc86 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pokemon-rogue-battle", - "version": "1.0.2", + "version": "1.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "pokemon-rogue-battle", - "version": "1.0.2", + "version": "1.0.1", "dependencies": { "@material/material-color-utilities": "^0.2.7", "crypto-js": "^4.2.0", diff --git a/src/data/move.ts b/src/data/move.ts index cf76f3726..cd621ee91 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -4727,7 +4727,8 @@ export function initMoves() { .unimplemented(), new StatusMove(Moves.HEAL_BLOCK, Type.PSYCHIC, 100, 15, -1, 0, 4) .target(MoveTarget.ALL_NEAR_ENEMIES) - .attr(AddBattlerTagAttr, BattlerTagType.HEAL_BLOCKED, false, true, 5), + .attr(AddBattlerTagAttr, BattlerTagType.HEAL_BLOCKED, false, true, 5) + .partial(), new AttackMove(Moves.WRING_OUT, Type.NORMAL, MoveCategory.SPECIAL, -1, 100, 5, -1, 0, 4) .attr(OpponentHighHpPowerAttr) .makesContact(), @@ -6320,7 +6321,8 @@ export function initMoves() { .attr(NoEffectAttr, crashDamageFunc), new AttackMove(Moves.PSYCHIC_NOISE, Type.PSYCHIC, MoveCategory.SPECIAL, 75, 100, 10, -1, 0, 9) .soundBased() - .attr(AddBattlerTagAttr, BattlerTagType.HEAL_BLOCKED, false, true, 2), + .attr(AddBattlerTagAttr, BattlerTagType.HEAL_BLOCKED, false, true, 2) + .partial(), new AttackMove(Moves.UPPER_HAND, Type.FIGHTING, MoveCategory.PHYSICAL, 65, 100, 15, -1, 3, 9) .partial(), new AttackMove(Moves.MALIGNANT_CHAIN, Type.POISON, MoveCategory.SPECIAL, 100, 100, 5, 50, 0, 9) diff --git a/src/data/pokemon-level-moves.ts b/src/data/pokemon-level-moves.ts index 10e57fcdd..9dc0d196b 100644 --- a/src/data/pokemon-level-moves.ts +++ b/src/data/pokemon-level-moves.ts @@ -4269,6 +4269,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [ 30, Moves.ANCIENT_POWER ], [ 40, Moves.LIFE_DEW ], [ 50, Moves.LEECH_SEED ], + [ 55, Moves.HEAL_BLOCK ], [ 60, Moves.RECOVER ], [ 70, Moves.FUTURE_SIGHT ], [ 80, Moves.HEALING_WISH ], @@ -4967,6 +4968,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [ 23, Moves.ABSORB ], [ 29, Moves.SHADOW_SNEAK ], [ 36, Moves.FURY_SWIPES ], + [ 41, Moves.HEAL_BLOCK ], [ 43, Moves.MIND_READER ], [ 50, Moves.SHADOW_BALL ], [ 57, Moves.SPITE ], @@ -5787,6 +5789,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [ 20, Moves.PSYSHOCK ], [ 25, Moves.COSMIC_POWER ], [ 30, Moves.PSYCHIC ], + [ 33, Moves.HEAL_BLOCK ], [ 35, Moves.STONE_EDGE ], [ 40, Moves.FUTURE_SIGHT ], [ 45, Moves.MAGIC_ROOM ], @@ -5805,6 +5808,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [ 20, Moves.ZEN_HEADBUTT ], [ 25, Moves.COSMIC_POWER ], [ 30, Moves.PSYCHIC ], + [ 33, Moves.HEAL_BLOCK ], [ 35, Moves.STONE_EDGE ], [ 40, Moves.SOLAR_BEAM ], [ 45, Moves.WONDER_ROOM ], @@ -5881,6 +5885,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [ 3, Moves.RAPID_SPIN ], [ 6, Moves.CONFUSION ], [ 9, Moves.ROCK_TOMB ], + [ 10, Moves.HEAL_BLOCK ], [ 12, Moves.POWER_TRICK ], [ 15, Moves.PSYBEAM ], [ 18, Moves.ANCIENT_POWER ], @@ -5902,6 +5907,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [ 1, Moves.MUD_SLAP ], [ 1, Moves.RAPID_SPIN ], [ 9, Moves.ROCK_TOMB ], + [ 10, Moves.HEAL_BLOCK ], [ 12, Moves.POWER_TRICK ], [ 15, Moves.PSYBEAM ], [ 18, Moves.ANCIENT_POWER ], @@ -6497,6 +6503,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [Species.LATIOS]: [ [ 1, Moves.DRAGON_DANCE ], [ 1, Moves.STORED_POWER ], + [ 1, Moves.HEAL_BLOCK ], [ 5, Moves.HELPING_HAND ], [ 10, Moves.RECOVER ], [ 15, Moves.CONFUSION ], @@ -7355,6 +7362,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [ 36, Moves.IRON_DEFENSE ], [ 40, Moves.METAL_SOUND ], [ 44, Moves.FUTURE_SIGHT ], + [ 45, Moves.HEAL_BLOCK ], ], [Species.BRONZONG]: [ [ 0, Moves.BLOCK ], @@ -7373,6 +7381,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [ 38, Moves.IRON_DEFENSE ], [ 44, Moves.METAL_SOUND ], [ 50, Moves.FUTURE_SIGHT ], + [ 52, Moves.HEAL_BLOCK ], [ 56, Moves.RAIN_DANCE ], ], [Species.BONSLY]: [ @@ -9709,6 +9718,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [ 24, Moves.HYPNOSIS ], [ 28, Moves.FAKE_TEARS ], [ 33, Moves.PSYCH_UP ], + [ 33, Moves.HEAL_BLOCK ], [ 36, Moves.PSYCHIC ], [ 40, Moves.FLATTER ], [ 44, Moves.FUTURE_SIGHT ], @@ -9724,6 +9734,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [ 20, Moves.PSYSHOCK ], [ 24, Moves.HYPNOSIS ], [ 28, Moves.FAKE_TEARS ], + [ 34, Moves.HEAL_BLOCK ], [ 35, Moves.PSYCH_UP ], [ 46, Moves.FLATTER ], [ 52, Moves.FUTURE_SIGHT ], @@ -9739,6 +9750,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [ 20, Moves.PSYSHOCK ], [ 24, Moves.HYPNOSIS ], [ 28, Moves.FAKE_TEARS ], + [ 34, Moves.HEAL_BLOCK ], [ 35, Moves.PSYCH_UP ], [ 40, Moves.PSYCHIC ], [ 48, Moves.FLATTER ], @@ -9760,6 +9772,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [ 36, Moves.PSYCHIC ], [ 40, Moves.SKILL_SWAP ], [ 44, Moves.FUTURE_SIGHT ], + [ 46, Moves.HEAL_BLOCK ], [ 48, Moves.WONDER_ROOM ], ], [Species.DUOSION]: [ @@ -9776,6 +9789,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [ 35, Moves.PAIN_SPLIT ], [ 40, Moves.PSYCHIC ], [ 46, Moves.SKILL_SWAP ], + [ 50, Moves.HEAL_BLOCK ], [ 52, Moves.FUTURE_SIGHT ], [ 58, Moves.WONDER_ROOM ], ], @@ -9794,6 +9808,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [ 35, Moves.PAIN_SPLIT ], [ 40, Moves.PSYCHIC ], [ 48, Moves.SKILL_SWAP ], + [ 54, Moves.HEAL_BLOCK ], [ 56, Moves.FUTURE_SIGHT ], [ 64, Moves.WONDER_ROOM ], ], @@ -10198,6 +10213,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [ 1, Moves.GROWL ], [ 1, Moves.CONFUSION ], [ 6, Moves.IMPRISON ], + [ 8, Moves.HEAL_BLOCK ], [ 12, Moves.TELEPORT ], [ 18, Moves.PSYBEAM ], [ 24, Moves.GUARD_SPLIT ], @@ -10215,6 +10231,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [ 1, Moves.TELEPORT ], [ 1, Moves.IMPRISON ], [ 1, Moves.PSYCHIC_TERRAIN ], + [ 8, Moves.HEAL_BLOCK ], [ 18, Moves.PSYBEAM ], [ 24, Moves.GUARD_SPLIT ], [ 24, Moves.POWER_SPLIT ], @@ -10872,6 +10889,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [ 15, Moves.BITE ], [ 20, Moves.SHOCK_WAVE ], [ 25, Moves.AGILITY ], + [ 25, Moves.HEAL_BLOCK ], [ 30, Moves.CHARGE ], [ 35, Moves.VOLT_SWITCH ], [ 40, Moves.CRUNCH ], @@ -11960,6 +11978,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [ 40, Moves.PLAY_ROUGH ], [ 44, Moves.MAGIC_ROOM ], [ 48, Moves.FOUL_PLAY ], + [ 50, Moves.HEAL_BLOCK ], [ 52, Moves.LAST_RESORT ], ], [Species.PHANTUMP]: [ @@ -13033,6 +13052,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [ 45, Moves.IRON_HEAD ], [ 50, Moves.TAKE_DOWN ], [ 55, Moves.DOUBLE_EDGE ], + [ 85, Moves.HEAL_BLOCK ], ], [Species.SILVALLY]: [ [ 0, Moves.MULTI_ATTACK ], @@ -13041,6 +13061,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [ 1, Moves.EXPLOSION ], [ 1, Moves.SCARY_FACE ], [ 1, Moves.IMPRISON ], + [ 1, Moves.HEAL_BLOCK ], [ 1, Moves.POISON_FANG ], [ 1, Moves.AERIAL_ACE ], [ 1, Moves.THUNDER_FANG ],