Heal Block Implementation

pre-testing
This commit is contained in:
Adrienn Tindall 2024-04-24 16:18:56 -04:00
parent cf3a7dca35
commit 4beb8d47ef
4 changed files with 29 additions and 2 deletions

View File

@ -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 { export function getBattlerTag(tagType: BattlerTagType, turnCount: integer, sourceMove: Moves, sourceId: integer): BattlerTag {
switch (tagType) { switch (tagType) {
case BattlerTagType.RECHARGING: case BattlerTagType.RECHARGING:
@ -1174,6 +1192,8 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: integer, sourc
return new CursedTag(sourceId); return new CursedTag(sourceId);
case BattlerTagType.CHARGED: case BattlerTagType.CHARGED:
return new TypeBoostTag(tagType, sourceMove, Type.ELECTRIC, 2, true); return new TypeBoostTag(tagType, sourceMove, Type.ELECTRIC, 2, true);
case BattlerTagType.HEAL_BLOCKED:
return new HealBlockTag(turnCount, sourceMove);
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);

View File

@ -52,5 +52,6 @@ export enum BattlerTagType {
SALT_CURED = "SALT_CURED", SALT_CURED = "SALT_CURED",
CURSED = "CURSED", CURSED = "CURSED",
CHARGED = "CHARGED", CHARGED = "CHARGED",
HEAL_BLOCKED = "HEAL_BLOCKED",
GROUNDED = "GROUNDED" GROUNDED = "GROUNDED"
} }

View File

@ -4727,7 +4727,7 @@ export function initMoves() {
.unimplemented(), .unimplemented(),
new StatusMove(Moves.HEAL_BLOCK, Type.PSYCHIC, 100, 15, -1, 0, 4) new StatusMove(Moves.HEAL_BLOCK, Type.PSYCHIC, 100, 15, -1, 0, 4)
.target(MoveTarget.ALL_NEAR_ENEMIES) .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) new AttackMove(Moves.WRING_OUT, Type.NORMAL, MoveCategory.SPECIAL, -1, 100, 5, -1, 0, 4)
.attr(OpponentHighHpPowerAttr) .attr(OpponentHighHpPowerAttr)
.makesContact(), .makesContact(),
@ -6320,7 +6320,7 @@ export function initMoves() {
.attr(NoEffectAttr, crashDamageFunc), .attr(NoEffectAttr, crashDamageFunc),
new AttackMove(Moves.PSYCHIC_NOISE, Type.PSYCHIC, MoveCategory.SPECIAL, 75, 100, 10, -1, 0, 9) new AttackMove(Moves.PSYCHIC_NOISE, Type.PSYCHIC, MoveCategory.SPECIAL, 75, 100, 10, -1, 0, 9)
.soundBased() .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) new AttackMove(Moves.UPPER_HAND, Type.FIGHTING, MoveCategory.PHYSICAL, 65, 100, 15, -1, 3, 9)
.partial(), .partial(),
new AttackMove(Moves.MALIGNANT_CHAIN, Type.POISON, MoveCategory.SPECIAL, 100, 100, 5, 50, 0, 9) new AttackMove(Moves.MALIGNANT_CHAIN, Type.POISON, MoveCategory.SPECIAL, 100, 100, 5, 50, 0, 9)

View File

@ -3857,6 +3857,12 @@ export class PokemonHealPhase extends CommonAnimPhase {
return; return;
} }
if (pokemon.getTag(HealBlockTag)) {
this.scene.queueMessage(getPokemonMessage(pokemon, ' was prevented from healing!'));
super.end();
return;
}
const fullHp = pokemon.getHpRatio() >= 1; const fullHp = pokemon.getHpRatio() >= 1;
const hasMessage = !!this.message; const hasMessage = !!this.message;