Lower luck cap

This commit is contained in:
Flashfyre 2024-04-26 11:39:54 -04:00
parent 5e7356636e
commit c1f53f00b1
2 changed files with 4 additions and 4 deletions

View File

@ -1242,7 +1242,7 @@ export default class BattleScene extends SceneBase {
}) })
const luckValue = getPartyLuckValue(this.getParty()); const luckValue = getPartyLuckValue(this.getParty());
this.luckText.setText(getLuckString(luckValue)); this.luckText.setText(getLuckString(luckValue));
if (luckValue < 16) if (luckValue < 14)
this.luckText.setTint(getLuckTextTint(luckValue)); this.luckText.setTint(getLuckTextTint(luckValue));
else else
this.luckText.setTint(0x83a55a, 0xee384a, 0x5271cd, 0x7b487b); this.luckText.setTint(0x83a55a, 0xee384a, 0x5271cd, 0x7b487b);

View File

@ -1519,14 +1519,14 @@ export class ModifierTypeOption {
export function getPartyLuckValue(party: Pokemon[]): integer { export function getPartyLuckValue(party: Pokemon[]): integer {
return Phaser.Math.Clamp(party.map(p => p.isFainted() || !p.isShiny() ? 0 : !p.isFusion() || !p.shiny || !p.fusionShiny ? p.variant + 1 : (p.variant + 1) + (p.fusionVariant + 1)) return Phaser.Math.Clamp(party.map(p => p.isFainted() || !p.isShiny() ? 0 : !p.isFusion() || !p.shiny || !p.fusionShiny ? p.variant + 1 : (p.variant + 1) + (p.fusionVariant + 1))
.reduce((total: integer, value: integer) => total += value, 0), 0, 16); .reduce((total: integer, value: integer) => total += value, 0), 0, 14);
} }
export function getLuckString(luckValue: integer): string { export function getLuckString(luckValue: integer): string {
return [ 'D', 'C', 'C+', 'B-', 'B', 'B+', 'A-', 'A', 'A+', 'A++', 'S', 'S+', 'S++', 'SS', 'SS+', 'SS++', 'SSS' ][luckValue]; return [ 'D', 'C', 'C+', 'B-', 'B', 'B+', 'A-', 'A', 'A+', 'A++', 'S', 'S+', 'SS', 'SS+', 'SSS' ][luckValue];
} }
export function getLuckTextTint(luckValue: integer): integer { export function getLuckTextTint(luckValue: integer): integer {
const modifierTier = luckValue ? luckValue > 2 ? luckValue > 5 ? luckValue > 9 ? luckValue > 12 ? ModifierTier.LUXURY : ModifierTier.MASTER : ModifierTier.ROGUE : ModifierTier.ULTRA : ModifierTier.GREAT : ModifierTier.COMMON; const modifierTier = luckValue ? luckValue > 2 ? luckValue > 5 ? luckValue > 9 ? luckValue > 11 ? ModifierTier.LUXURY : ModifierTier.MASTER : ModifierTier.ROGUE : ModifierTier.ULTRA : ModifierTier.GREAT : ModifierTier.COMMON;
return getModifierTierTextTint(modifierTier); return getModifierTierTextTint(modifierTier);
} }