Skip to content

Commit

Permalink
Fix max move detection
Browse files Browse the repository at this point in the history
  • Loading branch information
Mygod committed Nov 10, 2024
1 parent 3342b6f commit 6b95ecd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/classes/Move.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,24 @@ export default class Moves extends Masterfile {
data: { moveSettings },
} = object
try {
const regular = templateId.startsWith('COMBAT_V')
const proto = regular ? templateId.substring(11) : templateId
const isMax = templateId.startsWith('VN_BM_')
const proto = isMax ? templateId : templateId.substring(11)
const id = Rpc.HoloPokemonMove[proto as MoveProto]
if (id || id === 0) {
if (!this.parsedMoves[id]) {
this.parsedMoves[id] = {
moveId: id,
moveName: this.capitalize(
regular ? proto.replace('_FAST', '') : moveSettings.vfxName
isMax ? moveSettings.vfxName : proto.replace('_FAST', '')
),
proto,
fast: templateId.endsWith('_FAST'),
}
}
this.parsedMoves[id].type =
Rpc.HoloPokemonType[moveSettings.pokemonType as TypeProto]
this.parsedMoves[id].power = regular
? moveSettings.power : moveSettings.obMoveSettingsNumber18[2]
this.parsedMoves[id].power = isMax
? moveSettings.obMoveSettingsNumber18[2] : moveSettings.power
this.parsedMoves[id].durationMs = moveSettings.durationMs
this.parsedMoves[id].energyDelta = moveSettings.energyDelta
}
Expand Down

0 comments on commit 6b95ecd

Please sign in to comment.