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 { updateMoneyText(): void {
this.moneyText.setText(`${Utils.formatLargeNumber(this.money, 1000)}`); this.moneyText.setText(`${this.money.toLocaleString('en-US')}`);
this.moneyText.setVisible(true); this.moneyText.setVisible(true);
} }

View File

@ -63413,8 +63413,6 @@ export const tmSpecies: TmSpecies = {
Species.LEAVANNY, Species.LEAVANNY,
Species.PETILIL, Species.PETILIL,
Species.LILLIGANT, Species.LILLIGANT,
Species.SCRAGGY,
Species.SCRAFTY,
Species.DUCKLETT, Species.DUCKLETT,
Species.SWANNA, Species.SWANNA,
Species.DEERLING, 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); console.log('damage', damage.value, move.name, power.value, sourceAtk, targetDef);
const oneHitKo = result === HitResult.ONE_HIT_KO;
if (damage.value) { if (damage.value) {
if (this.getHpRatio() === 1) if (this.getHpRatio() === 1)
applyPreDefendAbAttrs(PreDefendFullHpEndureAbAttr, this, source, battlerMove, cancelled, damage); applyPreDefendAbAttrs(PreDefendFullHpEndureAbAttr, this, source, battlerMove, cancelled, damage);
else if (!this.isPlayer() && damage.value >= this.hp) else if (!this.isPlayer() && damage.value >= this.hp)
this.scene.applyModifiers(EnemyEndureChanceModifier, false, this); this.scene.applyModifiers(EnemyEndureChanceModifier, false, this);
/** const oneHitKo = result === HitResult.ONE_HIT_KO;
* We explicitly require to ignore the faint phase here, as we want to show the messages damage.value = this.damageAndUpdate(damage.value, result as DamageResult, isCritical, oneHitKo, oneHitKo);
* 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);
this.turnData.damageTaken += damage.value; this.turnData.damageTaken += damage.value;
if (isCritical) if (isCritical)
this.scene.queueMessage(i18next.t('battle:hitResultCriticalHit')); this.scene.queueMessage(i18next.t('battle:hitResultCriticalHit'));
this.scene.setPhaseQueueSplice();
if (source.isPlayer()) { if (source.isPlayer()) {
this.scene.validateAchvs(DamageAchv, damage); this.scene.validateAchvs(DamageAchv, damage);
if (damage.value > this.scene.gameData.gameStats.highestDamage) if (damage.value > this.scene.gameData.gameStats.highestDamage)
@ -1683,17 +1680,12 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
case HitResult.IMMUNE: case HitResult.IMMUNE:
this.scene.queueMessage(`${this.name} is unaffected!`); this.scene.queueMessage(`${this.name} is unaffected!`);
break; break;
case HitResult.ONE_HIT_KO: case HitResult.ONE_HIT_KO:
this.scene.queueMessage(i18next.t('battle:hitResultOneHitKO')); this.scene.queueMessage(i18next.t('battle:hitResultOneHitKO'));
break; break;
} }
} }
if (this.isFainted()) {
this.scene.unshiftPhase(new FaintPhase(this.scene, this.getBattlerIndex(), oneHitKo));
this.resetSummonData();
}
if (damage) if (damage)
this.scene.clearPhaseQueueSplice(); this.scene.clearPhaseQueueSplice();
} }
@ -1714,7 +1706,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return result; 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()) if (this.isFainted())
return 0; return 0;
const surviveDamage = new Utils.BooleanHolder(false); 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); damage = Math.min(damage, this.hp);
this.hp = this.hp - damage; this.hp = this.hp - damage;
if (this.isFainted() && !ignoreFaintPhase) { if (this.isFainted()) {
this.scene.unshiftPhase(new FaintPhase(this.scene, this.getBattlerIndex(), preventEndure)); this.scene.unshiftPhase(new FaintPhase(this.scene, this.getBattlerIndex(), preventEndure));
this.resetSummonData(); this.resetSummonData();
} }
@ -1741,10 +1733,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return damage; 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); const damagePhase = new DamagePhase(this.scene, this.getBattlerIndex(), damage, result as DamageResult, critical);
this.scene.unshiftPhase(damagePhase); 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 // Damage amount may have changed, but needed to be queued before calling damage function
damagePhase.updateAmount(damage); damagePhase.updateAmount(damage);
return damage; return damage;
@ -3084,7 +3076,7 @@ export class EnemyPokemon extends Pokemon {
const target = this.scene.getField()[mt]; 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); 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; targetScore = -20;
else if (move instanceof AttackMove) { else if (move instanceof AttackMove) {
const effectiveness = target.getAttackMoveEffectiveness(this, pokemonMove); const effectiveness = target.getAttackMoveEffectiveness(this, pokemonMove);
@ -3221,7 +3213,7 @@ export class EnemyPokemon extends Pokemon {
return 0; 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()) if (this.isFainted())
return 0; return 0;
@ -3257,7 +3249,7 @@ export class EnemyPokemon extends Pokemon {
damage = Math.min(damage, this.hp - 1); 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 (this.isBoss()) {
if (ignoreSegments) { if (ignoreSegments) {

View File

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

View File

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