Implement innards out

This commit is contained in:
Temps Ray 2024-05-06 17:06:24 -04:00
parent 582330df33
commit 426f6daccf
2 changed files with 21 additions and 2 deletions

View File

@ -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)

View File

@ -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);