Rework boss HP logic to allow unlimited bypasses for large damage

This commit is contained in:
Flashfyre 2024-02-29 12:23:49 -05:00
parent b698a8ffae
commit ed5921eb10
3 changed files with 13 additions and 7 deletions

View File

@ -2913,7 +2913,7 @@ export function initMoves() {
new AttackMove(Moves.ERUPTION, "Eruption", Type.FIRE, MoveCategory.SPECIAL, 150, 100, 5, -1, "The user attacks opposing Pokémon with explosive fury. The lower the user's HP, the lower the move's power.", -1, 0, 3) new AttackMove(Moves.ERUPTION, "Eruption", Type.FIRE, MoveCategory.SPECIAL, 150, 100, 5, -1, "The user attacks opposing Pokémon with explosive fury. The lower the user's HP, the lower the move's power.", -1, 0, 3)
.attr(HpPowerAttr) .attr(HpPowerAttr)
.target(MoveTarget.ALL_NEAR_ENEMIES), .target(MoveTarget.ALL_NEAR_ENEMIES),
new StatusMove(Moves.SKILL_SWAP, "Skill Swap (N)", Type.PSYCHIC, -1, 1, 98, "The user employs its psychic power to exchange Abilities with the target.", -1, 0, 3), new StatusMove(Moves.SKILL_SWAP, "Skill Swap (N)", Type.PSYCHIC, -1, 10, 98, "The user employs its psychic power to exchange Abilities with the target.", -1, 0, 3),
new SelfStatusMove(Moves.IMPRISON, "Imprison (N)", Type.PSYCHIC, -1, 10, 92, "If opposing Pokémon know any move also known by the user, they are prevented from using it.", -1, 0, 3), new SelfStatusMove(Moves.IMPRISON, "Imprison (N)", Type.PSYCHIC, -1, 10, 92, "If opposing Pokémon know any move also known by the user, they are prevented from using it.", -1, 0, 3),
new SelfStatusMove(Moves.REFRESH, "Refresh", Type.NORMAL, -1, 20, -1, "The user rests to cure itself of poisoning, a burn, or paralysis.", -1, 0, 3) new SelfStatusMove(Moves.REFRESH, "Refresh", Type.NORMAL, -1, 20, -1, "The user rests to cure itself of poisoning, a burn, or paralysis.", -1, 0, 3)
.attr(HealStatusEffectAttr, true, StatusEffect.PARALYSIS, StatusEffect.POISON, StatusEffect.TOXIC, StatusEffect.BURN) .attr(HealStatusEffectAttr, true, StatusEffect.PARALYSIS, StatusEffect.POISON, StatusEffect.TOXIC, StatusEffect.BURN)

View File

@ -2346,7 +2346,7 @@ export const speciesStarters = {
[Species.MANKEY]: 4, [Species.MANKEY]: 4,
[Species.GROWLITHE]: 4, [Species.GROWLITHE]: 4,
[Species.POLIWAG]: 3, [Species.POLIWAG]: 3,
[Species.ABRA]: 4, [Species.ABRA]: 3,
[Species.MACHOP]: 3, [Species.MACHOP]: 3,
[Species.BELLSPROUT]: 3, [Species.BELLSPROUT]: 3,
[Species.TENTACOOL]: 3, [Species.TENTACOOL]: 3,

View File

@ -2343,9 +2343,15 @@ export class EnemyPokemon extends Pokemon {
const roundedHpThreshold = Math.round(hpThreshold); const roundedHpThreshold = Math.round(hpThreshold);
if (this.hp >= roundedHpThreshold) { if (this.hp >= roundedHpThreshold) {
if (this.hp - damage < roundedHpThreshold) { if (this.hp - damage < roundedHpThreshold) {
const bypassSegment = this.canBypassBossSegments() && (this.hp - roundedHpThreshold) / damage < 0.1; const hpRemainder = this.hp - roundedHpThreshold;
damage = this.hp - (bypassSegment ? Math.round(hpThreshold - segmentSize) : roundedHpThreshold); let segmentsBypassed = 0;
this.handleBossSegmentCleared(s); while (this.canBypassBossSegments(segmentsBypassed + 1) && (damage - hpRemainder) >= Math.round(segmentSize * Math.pow(2, segmentsBypassed + 1))) {
segmentsBypassed++;
//console.log('damage', damage, 'segment', segmentsBypassed + 1, 'segment size', segmentSize, 'damage needed', Math.round(segmentSize * Math.pow(2, segmentsBypassed + 1)));
}
damage = hpRemainder + Math.round(segmentSize * segmentsBypassed);
this.handleBossSegmentCleared(s - segmentsBypassed);
} }
break; break;
} }
@ -2357,9 +2363,9 @@ export class EnemyPokemon extends Pokemon {
return super.damage(damage, ignoreSegments, preventEndure); return super.damage(damage, ignoreSegments, preventEndure);
} }
canBypassBossSegments(): boolean { canBypassBossSegments(segmentCount: integer = 1): boolean {
if (this.scene.currentBattle.battleSpec === BattleSpec.FINAL_BOSS) { if (this.scene.currentBattle.battleSpec === BattleSpec.FINAL_BOSS) {
if (!this.formIndex && (this.bossSegmentIndex - 1) <= 1) if (!this.formIndex && (this.bossSegmentIndex - segmentCount) < 1)
return false; return false;
} }