mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-05 16:02:20 +02:00
Merge branch 'pr/116'
This commit is contained in:
commit
9ddb9920c3
@ -2716,9 +2716,8 @@ export function initAbilities() {
|
||||
.attr(DownloadAbAttr),
|
||||
new Ability(Abilities.IRON_FIST, 4)
|
||||
.attr(MovePowerBoostAbAttr, (user, target, move) => move.hasFlag(MoveFlags.PUNCHING_MOVE), 1.2),
|
||||
new Ability(Abilities.POISON_HEAL, 4)
|
||||
.unimplemented(),
|
||||
new Ability(Abilities.ADAPTABILITY, 4)
|
||||
new Ability(Abilities.POISON_HEAL, "Poison Heal (P)", "Restores HP if the Pokémon is poisoned instead of losing HP.", 4),
|
||||
new Ability(Abilities.ADAPTABILITY, "Adaptability", "Powers up moves of the same type as the Pokémon.", 4)
|
||||
.attr(StabBoostAbAttr),
|
||||
new Ability(Abilities.SKILL_LINK, 4)
|
||||
.attr(MaxMultiHitAbAttr),
|
||||
|
@ -2915,28 +2915,45 @@ export class PostTurnStatusEffectPhase extends PokemonPhase {
|
||||
|
||||
if (!cancelled.value) {
|
||||
this.scene.queueMessage(getPokemonMessage(pokemon, getStatusEffectActivationText(pokemon.status.effect)));
|
||||
let damage: integer = 0;
|
||||
|
||||
let netEffect = 0; // This variable now handles both healing and damage
|
||||
const isHealing = pokemon.hasAbility(Abilities.POISON_HEAL); // Added check for both Ability and the new Passives
|
||||
|
||||
switch (pokemon.status.effect) {
|
||||
case StatusEffect.POISON:
|
||||
damage = Math.max(pokemon.getMaxHp() >> 3, 1);
|
||||
break;
|
||||
case StatusEffect.TOXIC:
|
||||
damage = Math.max(Math.floor((pokemon.getMaxHp() / 16) * pokemon.status.turnCount), 1);
|
||||
if (isHealing) {
|
||||
netEffect = Math.max(pokemon.getMaxHp() >> 3, 1); // Healing logic
|
||||
} else {
|
||||
// Toxic damage increases over time, Poison does not
|
||||
netEffect = (pokemon.status.effect === StatusEffect.TOXIC) ?
|
||||
Math.max(Math.floor((pokemon.getMaxHp() / 16) * pokemon.status.turnCount), 1) : // Applies if Toxic
|
||||
Math.max(pokemon.getMaxHp() >> 3, 1); // Damage logic for Poison otherwise
|
||||
}
|
||||
break;
|
||||
case StatusEffect.BURN:
|
||||
damage = Math.max(pokemon.getMaxHp() >> 4, 1);
|
||||
netEffect = Math.max(pokemon.getMaxHp() >> 4, 1); // Burn always causes damage
|
||||
break;
|
||||
}
|
||||
if (damage) {
|
||||
this.scene.damageNumberHandler.add(this.getPokemon(), pokemon.damage(damage));
|
||||
pokemon.updateInfo();
|
||||
|
||||
if (netEffect > 0) {
|
||||
if (isHealing) {
|
||||
this.scene.damageNumberHandler.add(pokemon, pokemon.heal(netEffect), HitResult.HEAL);
|
||||
} else {
|
||||
this.scene.damageNumberHandler.add(pokemon, pokemon.damage(netEffect));
|
||||
}
|
||||
new CommonBattleAnim(CommonAnim.POISON + (pokemon.status.effect - 1), pokemon).play(this.scene, () => this.end());
|
||||
} else
|
||||
this.end();
|
||||
} else
|
||||
|
||||
const animType = CommonAnim.POISON + (pokemon.status.effect - 1);
|
||||
new CommonBattleAnim(animType, pokemon).play(this.scene, () => this.end());
|
||||
pokemon.updateInfo();
|
||||
} else {
|
||||
this.end(); // End the phase if no net effect to apply
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.end();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class MessagePhase extends Phase {
|
||||
|
Loading…
Reference in New Issue
Block a user