mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-05 07:52:17 +02:00
Heal Block Implementation
pre-testing
This commit is contained in:
parent
cf3a7dca35
commit
4beb8d47ef
@ -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);
|
||||
|
@ -52,5 +52,6 @@ export enum BattlerTagType {
|
||||
SALT_CURED = "SALT_CURED",
|
||||
CURSED = "CURSED",
|
||||
CHARGED = "CHARGED",
|
||||
HEAL_BLOCKED = "HEAL_BLOCKED",
|
||||
GROUNDED = "GROUNDED"
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user