Compare commits

..

No commits in common. "7ae09a31a50501049e2d39190b97c6529830be59" and "25a792f08027ccf9a14bce7cfeda01d5149c4f5d" have entirely different histories.

5 changed files with 12 additions and 30 deletions

View File

@ -1199,7 +1199,7 @@ export default class BattleScene extends SceneBase {
}
updateMoneyText(): void {
this.moneyText.setText(`${Utils.formatLargeNumber(this.money, 1000)}`);
this.moneyText.setText(`${this.money.toLocaleString('en-US')}`);
this.moneyText.setVisible(true);
}

View File

@ -63413,8 +63413,6 @@ export const tmSpecies: TmSpecies = {
Species.LEAVANNY,
Species.PETILIL,
Species.LILLIGANT,
Species.SCRAGGY,
Species.SCRAFTY,
Species.DUCKLETT,
Species.SWANNA,
Species.DEERLING,

View File

@ -1640,21 +1640,18 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
console.log('damage', damage.value, move.name, power.value, sourceAtk, targetDef);
const oneHitKo = result === HitResult.ONE_HIT_KO;
if (damage.value) {
if (this.getHpRatio() === 1)
applyPreDefendAbAttrs(PreDefendFullHpEndureAbAttr, this, source, battlerMove, cancelled, damage);
else if (!this.isPlayer() && damage.value >= this.hp)
this.scene.applyModifiers(EnemyEndureChanceModifier, false, this);
/**
* We explicitly require to ignore the faint phase here, as we want to show the messages
* about the critical hit and the super effective/not very effective messages before the faint phase.
*/
damage.value = this.damageAndUpdate(damage.value, result as DamageResult, isCritical, oneHitKo, oneHitKo, true);
const oneHitKo = result === HitResult.ONE_HIT_KO;
damage.value = this.damageAndUpdate(damage.value, result as DamageResult, isCritical, oneHitKo, oneHitKo);
this.turnData.damageTaken += damage.value;
if (isCritical)
this.scene.queueMessage(i18next.t('battle:hitResultCriticalHit'));
this.scene.setPhaseQueueSplice();
if (source.isPlayer()) {
this.scene.validateAchvs(DamageAchv, damage);
if (damage.value > this.scene.gameData.gameStats.highestDamage)
@ -1683,17 +1680,12 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
case HitResult.IMMUNE:
this.scene.queueMessage(`${this.name} is unaffected!`);
break;
case HitResult.ONE_HIT_KO:
case HitResult.ONE_HIT_KO:
this.scene.queueMessage(i18next.t('battle:hitResultOneHitKO'));
break;
}
}
if (this.isFainted()) {
this.scene.unshiftPhase(new FaintPhase(this.scene, this.getBattlerIndex(), oneHitKo));
this.resetSummonData();
}
if (damage)
this.scene.clearPhaseQueueSplice();
}
@ -1714,7 +1706,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return result;
}
damage(damage: integer, ignoreSegments: boolean = false, preventEndure: boolean = false, ignoreFaintPhase: boolean = false): integer {
damage(damage: integer, ignoreSegments: boolean = false, preventEndure: boolean = false): integer {
if (this.isFainted())
return 0;
const surviveDamage = new Utils.BooleanHolder(false);
@ -1733,7 +1725,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
damage = Math.min(damage, this.hp);
this.hp = this.hp - damage;
if (this.isFainted() && !ignoreFaintPhase) {
if (this.isFainted()) {
this.scene.unshiftPhase(new FaintPhase(this.scene, this.getBattlerIndex(), preventEndure));
this.resetSummonData();
}
@ -1741,10 +1733,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return damage;
}
damageAndUpdate(damage: integer, result?: DamageResult, critical: boolean = false, ignoreSegments: boolean = false, preventEndure: boolean = false, ignoreFaintPhase: boolean = false): integer {
damageAndUpdate(damage: integer, result?: DamageResult, critical: boolean = false, ignoreSegments: boolean = false, preventEndure: boolean = false): integer {
const damagePhase = new DamagePhase(this.scene, this.getBattlerIndex(), damage, result as DamageResult, critical);
this.scene.unshiftPhase(damagePhase);
damage = this.damage(damage, ignoreSegments, preventEndure, ignoreFaintPhase);
damage = this.damage(damage, ignoreSegments, preventEndure);
// Damage amount may have changed, but needed to be queued before calling damage function
damagePhase.updateAmount(damage);
return damage;
@ -3084,7 +3076,7 @@ export class EnemyPokemon extends Pokemon {
const target = this.scene.getField()[mt];
let targetScore = move.getUserBenefitScore(this, target, move) + move.getTargetBenefitScore(this, target, move) * (mt < BattlerIndex.ENEMY === this.isPlayer() ? 1 : -1);
if ((move.name.endsWith(' (N)') || !move.applyConditions(this, target, move)) && ![Moves.SUCKER_PUNCH, Moves.UPPER_HAND].includes(move.id))
if (move.name.endsWith(' (N)') || !move.applyConditions(this, target, move))
targetScore = -20;
else if (move instanceof AttackMove) {
const effectiveness = target.getAttackMoveEffectiveness(this, pokemonMove);
@ -3221,7 +3213,7 @@ export class EnemyPokemon extends Pokemon {
return 0;
}
damage(damage: integer, ignoreSegments: boolean = false, preventEndure: boolean = false, ignoreFaintPhase: boolean = false): integer {
damage(damage: integer, ignoreSegments: boolean = false, preventEndure: boolean = false): integer {
if (this.isFainted())
return 0;
@ -3257,7 +3249,7 @@ export class EnemyPokemon extends Pokemon {
damage = Math.min(damage, this.hp - 1);
}
let ret = super.damage(damage, ignoreSegments, preventEndure, ignoreFaintPhase);
let ret = super.damage(damage, ignoreSegments, preventEndure);
if (this.isBoss()) {
if (ignoreSegments) {

View File

@ -109,8 +109,6 @@ function getTextStyleOptions(style: TextStyle, uiTheme: UiTheme, extraStyleOptio
case TextStyle.SUMMARY_GREEN:
case TextStyle.WINDOW:
case TextStyle.WINDOW_ALT:
shadowXpos = 3;
shadowYpos = 3;
case TextStyle.MESSAGE:
case TextStyle.SETTINGS_LABEL:
case TextStyle.SETTINGS_SELECTED:

View File

@ -188,12 +188,6 @@ export function formatLargeNumber(count: integer, threshold: integer): string {
case 3:
suffix = 'B';
break;
case 4:
suffix = 'T';
break;
case 5:
suffix = 'q';
break;
default:
return '?';
}