Project 3.3 Pokemon Battle


Intro to Programming Languages.

[ ← 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) .


Module Content


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

  1. The Makefile will be updated to handle the pokeMUD code (take a look) the code is located in the pokemud folder
  2. Integrate Pokémon Battle into MUD
    • Your MUD code from the last level (~/cse240/06-mudshop/07) should be coopied to this level's work area (~/cse240/33-proj-pokemud/01)
    • When the user types in 'p' or "pokemon" into the MUD it will open a pokemon management system
    • Entry point into the Pokémon manager will be by pokemonMenu()
    • pokemonMenu() is found in "pokemud/ui.h"
    • When it's working the Pokemon Management system will look like this, but none of the functionality will be working for this level.
      
          ---------
          MAIN MENU
          ---------
          1. Show Pokemon
          2. Choose Pokemon
          3. Remove Pokemon
          4. Battle Random
          6. Exit
          Enter your choice: 
          
  3. Finish the Pokemon Class
    • Complete the getter and setter methods in Pokemon
  4. 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
  5. Return an instance of the derrived classes in pokemonFactory in pokemon.cpp
    • Depending on the pmType instaniate the Pokemon using the proper derrived class
    • Use make_shared<> to create a shared pointer
    • Return the shared pointer to the newly created object
    • Use the NormalPokemon process as a template

      For the AIV reward, you need to add a printf to pokemonFactory in pokemon.cpp that prints "Pokemud is too much pokefun"

  6. 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

This challenge is locked

This challenge is locked

This challenge is locked

This challenge is locked


30-Day Scoreboard:

This scoreboard reflects solves for challenges in this module after the module launched in this dojo.

Rank Hacker Badges Score