Compare commits

..

6 Commits

Author SHA1 Message Date
Xavion3
7ae09a31a5
Hotfix Sucker Punch and Upper Hand AI (#1237) 2024-05-22 07:13:39 -05:00
Benjamin Odom
460e94725b
Fix Money Typo (#1234) 2024-05-22 01:50:14 -05:00
zaccie
b66a68a37b
Drop Shadow Fixes On Team Builder Screen (#1220)
* Drop Shadow Adjustments

Adding support for x,y axis on dropshadow and adjusting the values to be less bad

* Further Refined New Shadow Positons

- Reverted MOVE_INFO_CONTENT to the old default
- Slight adjustments to other values

* Fixed Broken Drop Shadows

Fixed a case where the dropshadow became worse

---------

Co-authored-by: Benjamin Odom <bennybroseph@gmail.com>
2024-05-22 01:23:40 -05:00
Franck TROUILLEZ
7ac4900a3e
Allow to explicitly ignore faint phase when damaging. (#1182)
This allows to skip the faint phase in the `#damage` method for physical and special moves, to ensure we first queue the messages for the effectiveness of the attack and the potential critical hit.
We then explicitly unshift the faint phase in this case.
2024-05-22 01:01:16 -05:00
Frederico Santos
ae03b9cb20
Money with abbreviated form (#1222) 2024-05-22 00:54:44 -05:00
Ethan
c1c464b07a
Fixes Issue #1225: Scrafty line does not have Trailblaze in their TM learnset (#1228) 2024-05-22 00:33:49 -05:00
5 changed files with 30 additions and 12 deletions

View File

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

View File

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

View File

@ -1640,18 +1640,21 @@ 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);
const oneHitKo = result === HitResult.ONE_HIT_KO;
damage.value = this.damageAndUpdate(damage.value, result as DamageResult, isCritical, oneHitKo, oneHitKo);
/**
* 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);
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)
@ -1680,12 +1683,17 @@ 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();
}
@ -1706,7 +1714,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return result;
}
damage(damage: integer, ignoreSegments: boolean = false, preventEndure: boolean = false): integer {
damage(damage: integer, ignoreSegments: boolean = false, preventEndure: boolean = false, ignoreFaintPhase: boolean = false): integer {
if (this.isFainted())
return 0;
const surviveDamage = new Utils.BooleanHolder(false);
@ -1725,7 +1733,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
damage = Math.min(damage, this.hp);
this.hp = this.hp - damage;
if (this.isFainted()) {
if (this.isFainted() && !ignoreFaintPhase) {
this.scene.unshiftPhase(new FaintPhase(this.scene, this.getBattlerIndex(), preventEndure));
this.resetSummonData();
}
@ -1733,10 +1741,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): integer {
damageAndUpdate(damage: integer, result?: DamageResult, critical: boolean = false, ignoreSegments: boolean = false, preventEndure: boolean = false, ignoreFaintPhase: 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);
damage = this.damage(damage, ignoreSegments, preventEndure, ignoreFaintPhase);
// Damage amount may have changed, but needed to be queued before calling damage function
damagePhase.updateAmount(damage);
return damage;
@ -3076,7 +3084,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))
if ((move.name.endsWith(' (N)') || !move.applyConditions(this, target, move)) && ![Moves.SUCKER_PUNCH, Moves.UPPER_HAND].includes(move.id))
targetScore = -20;
else if (move instanceof AttackMove) {
const effectiveness = target.getAttackMoveEffectiveness(this, pokemonMove);
@ -3213,7 +3221,7 @@ export class EnemyPokemon extends Pokemon {
return 0;
}
damage(damage: integer, ignoreSegments: boolean = false, preventEndure: boolean = false): integer {
damage(damage: integer, ignoreSegments: boolean = false, preventEndure: boolean = false, ignoreFaintPhase: boolean = false): integer {
if (this.isFainted())
return 0;
@ -3249,7 +3257,7 @@ export class EnemyPokemon extends Pokemon {
damage = Math.min(damage, this.hp - 1);
}
let ret = super.damage(damage, ignoreSegments, preventEndure);
let ret = super.damage(damage, ignoreSegments, preventEndure, ignoreFaintPhase);
if (this.isBoss()) {
if (ignoreSegments) {

View File

@ -109,6 +109,8 @@ 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,6 +188,12 @@ 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 '?';
}