Endure Tokens only endure one hit

This commit is contained in:
innerthunder 2024-11-15 00:25:23 -08:00
parent 6dec84e39c
commit 779075a3dc
4 changed files with 9 additions and 4 deletions

View File

@ -1503,8 +1503,8 @@ export class ContactBurnProtectedTag extends DamageProtectedTag {
}
export class EnduringTag extends BattlerTag {
constructor(sourceMove: Moves) {
super(BattlerTagType.ENDURING, BattlerTagLapseType.TURN_END, 0, sourceMove);
constructor(tagType: BattlerTagType, lapseType: BattlerTagLapseType, sourceMove: Moves) {
super(tagType, lapseType, 0, sourceMove);
}
onAdd(pokemon: Pokemon): void {
@ -3004,7 +3004,9 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: number, source
case BattlerTagType.BURNING_BULWARK:
return new ContactBurnProtectedTag(sourceMove);
case BattlerTagType.ENDURING:
return new EnduringTag(sourceMove);
return new EnduringTag(tagType, BattlerTagLapseType.TURN_END, sourceMove);
case BattlerTagType.ENDURE_TOKEN:
return new EnduringTag(tagType, BattlerTagLapseType.AFTER_HIT, sourceMove);
case BattlerTagType.STURDY:
return new SturdyTag(sourceMove);
case BattlerTagType.PERISH_SONG:

View File

@ -92,4 +92,5 @@ export enum BattlerTagType {
COMMANDED = "COMMANDED",
GRUDGE = "GRUDGE",
PSYCHO_SHIFT = "PSYCHO_SHIFT",
ENDURE_TOKEN = "ENDURE_TOKEN",
}

View File

@ -2955,6 +2955,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
surviveDamage.value = this.lapseTag(BattlerTagType.ENDURING);
} else if (this.hp > 1 && this.getTag(BattlerTagType.STURDY)) {
surviveDamage.value = this.lapseTag(BattlerTagType.STURDY);
} else if (this.hp >= 1 && this.getTag(BattlerTagType.ENDURE_TOKEN)) {
surviveDamage.value = this.lapseTag(BattlerTagType.ENDURE_TOKEN);
}
if (!surviveDamage.value) {
this.scene.applyModifiers(SurviveDamageModifier, this.isPlayer(), this, surviveDamage);

View File

@ -3656,7 +3656,7 @@ export class EnemyEndureChanceModifier extends EnemyPersistentModifier {
return false;
}
target.addTag(BattlerTagType.ENDURING, 1);
target.addTag(BattlerTagType.ENDURE_TOKEN, 1);
target.battleData.endured = true;