mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-10 18:32:16 +02:00
Implement innards out
This commit is contained in:
parent
582330df33
commit
426f6daccf
@ -2275,6 +2275,24 @@ export class PostFaintContactDamageAbAttr extends PostFaintAbAttr {
|
||||
}
|
||||
}
|
||||
|
||||
export class PostFaintHPDamageAbAttr extends PostFaintAbAttr {
|
||||
constructor() {
|
||||
super ();
|
||||
}
|
||||
|
||||
applyPostFaint(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean {
|
||||
console.log(args);
|
||||
let damage = args[0];
|
||||
attacker.damageAndUpdate((damage), HitResult.OTHER);
|
||||
attacker.turnData.damageTaken += damage;
|
||||
return true;
|
||||
}
|
||||
|
||||
getTriggerMessage(pokemon: Pokemon, abilityName: string, ...args: any[]): string {
|
||||
return getPokemonMessage(pokemon, `'s ${abilityName} hurt\nits attacker!`);
|
||||
}
|
||||
}
|
||||
|
||||
export class RedirectMoveAbAttr extends AbAttr {
|
||||
apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean {
|
||||
if (this.canRedirect(args[0] as Moves)) {
|
||||
@ -3316,7 +3334,8 @@ export function initAbilities() {
|
||||
.attr(FieldPriorityMoveImmunityAbAttr)
|
||||
.ignorable(),
|
||||
new Ability(Abilities.INNARDS_OUT, 7)
|
||||
.unimplemented(),
|
||||
.attr(PostFaintHPDamageAbAttr)
|
||||
.bypassFaint(),
|
||||
new Ability(Abilities.DANCER, 7)
|
||||
.unimplemented(),
|
||||
new Ability(Abilities.BATTERY, 7)
|
||||
|
@ -3135,7 +3135,7 @@ export class FaintPhase extends PokemonPhase {
|
||||
|
||||
if (pokemon.turnData?.attacksReceived?.length) {
|
||||
const lastAttack = pokemon.turnData.attacksReceived[0];
|
||||
applyPostFaintAbAttrs(PostFaintAbAttr, pokemon, this.scene.getPokemonById(lastAttack.sourceId), new PokemonMove(lastAttack.move), lastAttack.result);
|
||||
applyPostFaintAbAttrs(PostFaintAbAttr, pokemon, this.scene.getPokemonById(lastAttack.sourceId), new PokemonMove(lastAttack.move), lastAttack.result, lastAttack.damage);
|
||||
}
|
||||
|
||||
const alivePlayField = this.scene.getField(true);
|
||||
|
Loading…
Reference in New Issue
Block a user