From 8773f25e66e8c3521df5e78a13f634fd49222beb Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Sat, 15 Apr 2023 22:12:59 -0400 Subject: [PATCH] Simplify EXP formula for gameplay reasons --- README.md | 3 --- src/battle-phases.ts | 2 +- src/pokemon.ts | 6 +++--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 97512f53a..446969724 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,6 @@ - Ability logic - Ability activation indicator (?) - Natures -- EXP logic - - Fix algorithm (currently inaccurate) - Pokemon summary screen - Move remembering (no cost?) - Capture logic @@ -25,7 +23,6 @@ - Modifiers - PP Up - Type enhancers - - Evolution items - Various mainline game items for various enhancements - Items that cause effects on hit (?) - Capture rate booster diff --git a/src/battle-phases.ts b/src/battle-phases.ts index f9b60cd43..1629112af 100644 --- a/src/battle-phases.ts +++ b/src/battle-phases.ts @@ -1131,7 +1131,7 @@ export class VictoryPhase extends PokemonPhase { const participantIds = this.scene.currentBattle.playerParticipantIds; const party = this.scene.getParty(); const expShareModifier = this.scene.getModifier(ExpShareModifier) as ExpShareModifier; - const expValue = this.scene.getEnemyPokemon().getExpValue(party[0]); + const expValue = this.scene.getEnemyPokemon().getExpValue(); for (let pm = 0; pm < party.length; pm++) { const pokemon = party[pm]; if (!pokemon.hp) diff --git a/src/pokemon.ts b/src/pokemon.ts index d237c21db..68de983bb 100644 --- a/src/pokemon.ts +++ b/src/pokemon.ts @@ -651,9 +651,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { this.turnData = new PokemonTurnData(); } - getExpValue(victor: Pokemon): integer { - return ((this.species.baseExp * this.level) / 5) * ((Math.round(Math.sqrt(2 * this.level + 10)) - * Math.pow(2 * this.level + 10, 2)) / (Math.round(Math.sqrt(this.level + victor.level + 10)) * Math.pow(this.level + victor.level + 10, 2))) + 1; + getExpValue(): integer { + // Logic to factor in victor level has been removed for balancing purposes, so the player doesn't have to focus on EXP maxxing + return (this.species.baseExp * this.level) / 5 + 1; } tint(color: number, alpha?: number, duration?: integer, ease?: string) {