mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-04 07:22:19 +02:00
Minor changes
This commit is contained in:
parent
61161ae386
commit
9ef87f0929
@ -1566,8 +1566,10 @@ export class PostFaintAbAttr extends AbAttr {
|
||||
|
||||
export class PostFaintContactDamageAbAttr extends PostFaintAbAttr {
|
||||
private damageRatio: integer;
|
||||
|
||||
constructor(damageRatio: integer) {
|
||||
super();
|
||||
|
||||
this.damageRatio = damageRatio;
|
||||
}
|
||||
|
||||
@ -1576,11 +1578,12 @@ export class PostFaintContactDamageAbAttr extends PostFaintAbAttr {
|
||||
attacker.damageAndUpdate(Math.ceil(attacker.getMaxHp() * (1 / this.damageRatio)), HitResult.OTHER);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
getTriggerMessage(pokemon: Pokemon, ...args: any[]): string {
|
||||
return `${pokemon.name}${(pokemon.name.endsWith('s')?`'`:`'s`)} ${pokemon.getAbility().name} hurt\nits attacker!`
|
||||
return getPokemonMessage(pokemon, `'s ${pokemon.getAbility().name} hurt\nits attacker!`);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2878,10 +2878,8 @@ export class FaintPhase extends PokemonPhase {
|
||||
|
||||
if (pokemon.getAbility().hasAttr(PostFaintAbAttr)) {
|
||||
if (pokemon.turnData?.attacksReceived?.length) {
|
||||
const defeatSource = this.scene.getPokemonById(pokemon.turnData.attacksReceived[0].sourceId);
|
||||
const defeatMove = new PokemonMove(pokemon.turnData.attacksReceived[0].move);
|
||||
const defeatResult = pokemon.turnData.attacksReceived[0].result;
|
||||
applyPostFaintAbAttrs(PostFaintAbAttr,pokemon,defeatSource,defeatMove,defeatResult);
|
||||
const lastAttack = pokemon.turnData.attacksReceived[0];
|
||||
applyPostFaintAbAttrs(PostFaintAbAttr,pokemon, this.scene.getPokemonById(lastAttack.sourceId), new PokemonMove(lastAttack.move), lastAttack.result);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user