Overview
ThePBMove class represents an individual move instance on a Pokémon. Each Pokémon can know up to 4 moves, and each move is stored as a PBMove object that tracks the move’s ID, current PP, and PP Ups applied.
Unlike PBMoveData which stores static move data, PBMove represents a move that a specific Pokémon knows, including its current PP state.
Source: Data/EditorScripts/016_PBMove.rb:65-90
Class Attributes
The move’s ID (National Move Dex number). This is read-only after initialization.Example:
1 for Pound, 15 for Cut, etc.The current amount of PP (Power Points) remaining for this move.Default: Set to the move’s total PP when initializedRange:
0 to totalppThe number of PP Ups used on this move.Default:
0Range: 0 to 3 (maximum 3 PP Ups per move)Methods
initialize
The ID of the move to create
- Loads move data using
PBMoveData - Sets
@ppto the move’s total PP - Sets
@idto the provided move ID - Sets
@ppupto0
016_PBMove.rb:84-89
type
PBTypes)
Behavior:
- Creates a new
PBMoveDataobject to look up the move’s type - Returns the type ID
016_PBMove.rb:71-74
totalpp
base_pp + (base_pp * ppup / 5).floor
Behavior:
- Loads move data to get base PP
- Calculates bonus PP from PP Ups (20% increase per PP Up)
- Returns total PP
016_PBMove.rb:77-81
Usage Examples
Creating a Move
Managing PP
Applying PP Ups
Adding Moves to Pokémon
Creating Empty Moves
Related Classes
- PBMoveData: Stores static data about moves (damage, accuracy, type, etc.)
- PokeBattle_Pokemon: Uses
PBMoveobjects in its@movesarray - PBMoves: Constant module containing move ID definitions
See Also
- PBMoveData - Static move data
- Pokémon Classes - PokeBattle_Pokemon and move management