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 {
|
export class PostFaintContactDamageAbAttr extends PostFaintAbAttr {
|
||||||
private damageRatio: integer;
|
private damageRatio: integer;
|
||||||
|
|
||||||
constructor(damageRatio: integer) {
|
constructor(damageRatio: integer) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.damageRatio = damageRatio;
|
this.damageRatio = damageRatio;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1576,11 +1578,12 @@ export class PostFaintContactDamageAbAttr extends PostFaintAbAttr {
|
|||||||
attacker.damageAndUpdate(Math.ceil(attacker.getMaxHp() * (1 / this.damageRatio)), HitResult.OTHER);
|
attacker.damageAndUpdate(Math.ceil(attacker.getMaxHp() * (1 / this.damageRatio)), HitResult.OTHER);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
getTriggerMessage(pokemon: Pokemon, ...args: any[]): string {
|
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.getAbility().hasAttr(PostFaintAbAttr)) {
|
||||||
if (pokemon.turnData?.attacksReceived?.length) {
|
if (pokemon.turnData?.attacksReceived?.length) {
|
||||||
const defeatSource = this.scene.getPokemonById(pokemon.turnData.attacksReceived[0].sourceId);
|
const lastAttack = pokemon.turnData.attacksReceived[0];
|
||||||
const defeatMove = new PokemonMove(pokemon.turnData.attacksReceived[0].move);
|
applyPostFaintAbAttrs(PostFaintAbAttr,pokemon, this.scene.getPokemonById(lastAttack.sourceId), new PokemonMove(lastAttack.move), lastAttack.result);
|
||||||
const defeatResult = pokemon.turnData.attacksReceived[0].result;
|
|
||||||
applyPostFaintAbAttrs(PostFaintAbAttr,pokemon,defeatSource,defeatMove,defeatResult);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user