This class represents a Pokémon's skill.
-
Attributes:
skillName
: Name of the skill.skillType
: Type of the skill (e.g., Water, Fire, Electric).damage
: The damage dealt by the skill.maxTry
: Maximum number of times the skill can be used.currentTry
: Current number of times the skill can be used.
-
Methods:
- Constructors to initialize skills.
- Getters for skill attributes.
calculateDamage
: Calculates the damage based on the defender's type.useSkill
: Decreases the current try count when the skill is used.
This is the parent class for all Pokémon.
-
Attributes:
name
: Name of the Pokémon.type
: Type of the Pokémon.HP
: Health points of the Pokémon.skills
: Array of skills the Pokémon can use.isTurn
: Boolean to check if it's the Pokémon's turn.
-
Methods:
- Constructor to initialize a Pokémon.
- Setters and getters for attributes and skills.
receiveDamage
: Decreases the Pokémon's HP when attacked.setTurn
: Sets the turn of the Pokémon.isCurrentTurn
: Checks if it's the Pokémon's turn.
These classes inherit from the Pokemon
class and represent specific Pokémon with predefined skills.
- Pikachu
- Dratini
- Eevee
- Charmander
- Palkia
Each class initializes its Pokémon with specific skills.
This class handles the battle logic between two Pokémon.
- Methods:
initializeBattle
: Sets the initial state of the battle.displayCurrent
: Displays the current state of the battle.nextTurn
: Handles the logic for each turn.performAttack
: Executes an attack by the current Pokémon on the opponent.
This class manages the game, including Pokémon selection and the battle loop.
-
Attributes:
availablePokemon
: Array of available Pokémon to choose from.currentBattle
: Instance of theBattle
class to manage the battle.p1
,p2
: Pointers to the selected Pokémon for the battle.
-
Methods:
- Constructor and destructor to manage Pokémon instances.
choosePokemon
: Allows the player to choose Pokémon for the battle.startBattle
: Starts and manages the battle until a Pokémon wins.
- Clone the repository:
git clone https://github.com/yourusername/OOP_Final_Assignments.git cd OOP_Final_Assignments
- g++ -o pokemon_battle main.cpp
- ./pokemon_battle