[ ← Module List ]
Hey everyone, welcome to Pokémon Joust: 240 Gym Edition! In this assignment, you'll make a Pokémon battle simulator, where you'll build your own team of Pokémon, pit different Pokémon against each other, and, for the thrilling finale, challenge us UGTAs and ultimately the professor to win badges. We aimed to make this the perfect assignment to introduce you to C++ by making it as engaging as possible. For the smoothest experience with this assignment, we recommend following the order outlined in the description below and reading everything carefully. Have fun!
What is a Pokémon?
Pokémon, short for "Pocket Monster" (ポケットモンスター, Poketto Monsutā), are creatures in a world where individuals, known as Pokémon trainers, catch and train them for companionship and battles. Each Pokémon falls into one or more of various types—like fire, water, or grass—defining their strengths, weaknesses, and the types of moves they can perform. These types play a crucial role in battles, influencing the effectiveness of a Pokémon's moves against others. Beyond their type, Pokémon possess stats such as Health Points (HP), Attack, Defense, and Speed, which are critical in determining the outcome of battles. Trainers aim to assemble a balanced team of Pokémon, strategically using their unique movesets and stats to outmaneuver opponents in battles.
Trainers engage in battles, using their team to compete for prestige and badges in various gyms. Battles are turn-based, a Pokémon "faints" and is unable to continue battling when its HP drops to zero. Winning battles against gym leaders awards trainers badges, symbolizing their skill and granting them access to tougher challenges.
Objective Overview
In this project , you will create a Pokémon Battle Simulator. Your task is to develop a system that simulates battles between Pokémon with varying types, leveraging Object-Oriented Programming (OOP) principles.
Many of the functions that you will code for this challenge have detailed information in the comments. DO NOT SKIP THE COMMENTS in the source files (.cpp, .h)
.
Challenges
Objective
Integrate a Pokémon game into the MUD and load the Pokémon data from pokemon.json using the JSON 11 library.
Much of the code for the game is already included, part of your job will be figuring out how it works, and modifying it appropriately.
The code is filled with comments to help you do this
Design details are available at https://cse240.com/pokemon
Steps to Complete
- The Makefile will be updated to handle the pokeMUD code (take a look) the code is located in the pokemud folder
- Integrate Pokémon Battle into MUD
- Finish the Pokemon Class
- Complete the getter and setter methods in Pokemon
- Create the Pokemon derived classes
- Create derrived classes FirePokemon, WaterPokemon, ElectricPokemon, GrassPokemon, RockPokemon in
pokemon.h
- Use the NormalPokemon that's provided as a template.
- Create the constructor for each derrived class
- Override the pure virtual method
- Return an instance of the derrived classes in
pokemonFactory
in pokemon.cpp
- Complete
loadPokemon
in load_pson.cpp
- Follow the instructions found in the comments of in the class
- To add values to a
vector
, you may use push_back
- Use the
pokemonFactory
to create a pokemon that's a shared_ptr then push it onto the pokemonList Vector
Objective
Load the team and the team's moves from the supplied
team.json
.
Design details are available at https://cse240.com/pokemon
Requirements
- Complete findPokemonByName method
shared_ptr Team::findPokemonByName(vector>& pokemonList, string name )
- Given the
name
of a Pokémon in the pokemonList
- Lookup the Pokémon and return a pointer to it.
- Complete Move class
- Complete the
create
method
- Compete the getter methods in
move.cpp
- Complete
Move::usePP()
- Implement the Team::getMove method in
team.cpp
- Implement the
Team::addPokemon
, Team::getSize
, Team::isFull
, Team::getPokemon
, and Team::loadTeam
method in team.cpp
- Follow the instructions in the methods.
Objective
To implement functionality that allows the user to remove and add team members
Steps to Complete
- Modify
team.cpp
- Implement
Team::removePokemon
- Modify
ui.cpp
- Implement the following functions
removePokemonFromTeam
- can be implemented after Team::removePokemon
is completed
selectPokemonType
- Allows user to select the type of Pokemon desired
selectPokemonFromType
- Lists Pokemon of the selected Type and allows their selection
selectMovesForPokemon
- Lists Moves available for Pokemon (moves of its type and normal moves)
addPokemonToTeam
Objective
Implement the battle functionality in
battle.cpp
.
Steps to Complete
- Modify
battle.cpp
- Implement the following functions:
- calculateDamage
- applyMoveDamage
- If the code has not implemented
Move::usePP()
in move.cpp
, then implement that now.
- Modify
pokemon.cpp
- Implement the following functions:
Objective
Make it possible to challenge the different trainers in the CSE240 Gym!
Requirements
Steps to Complete
- Implement the command as outlined above
- Use tester to get the flag
- Special Note: once this is working, try your hand at level 77 for extra credit. Each trainer that your team of pokemon beat will earn you extra credit.
30-Day Scoreboard:
This scoreboard reflects solves for challenges in this module after the module launched in this dojo.