diff --git a/Pokemon/Header/Battle/BattleManager.hpp b/Pokemon/Header/Battle/BattleManager.hpp index c9e5e9ca..a7e32b30 100644 --- a/Pokemon/Header/Battle/BattleManager.hpp +++ b/Pokemon/Header/Battle/BattleManager.hpp @@ -8,13 +8,11 @@ using namespace N_Player; namespace N_Battle { - - class BattleManager { public: - void startBattle(Player& player, N_Pokemon::Pokemon& wildPokemon); + void startBattle(Player* player, N_Pokemon::Pokemon* wildPokemon); private: - BattleState battleState; + BattleState* battleState; void battle(); void handleBattleOutcome(); diff --git a/Pokemon/Header/Battle/WildEncounterManager.hpp b/Pokemon/Header/Battle/WildEncounterManager.hpp index ccc1dae6..66c04a17 100644 --- a/Pokemon/Header/Battle/WildEncounterManager.hpp +++ b/Pokemon/Header/Battle/WildEncounterManager.hpp @@ -13,6 +13,6 @@ namespace N_Battle class WildEncounterManager { public: WildEncounterManager(); - Pokemon getRandomPokemonFromGrass(const Grass& grass); + Pokemon getRandomPokemonFromGrass(const Grass* grass); }; } \ No newline at end of file diff --git a/Pokemon/Header/Character/Player/Player.hpp b/Pokemon/Header/Character/Player/Player.hpp index 1be15730..53472610 100644 --- a/Pokemon/Header/Character/Player/Player.hpp +++ b/Pokemon/Header/Character/Player/Player.hpp @@ -14,13 +14,13 @@ namespace N_Character class Player { public: string name; - N_Pokemon::Pokemon chosenPokemon; + N_Pokemon::Pokemon* chosenPokemon; // Default constructor Player(); // Parameterized constructor - Player(string p_name, N_Pokemon::Pokemon p_chosenPokemon); + Player(string p_name, N_Pokemon::Pokemon* p_chosenPokemon); void choosePokemon(int choice); diff --git a/Pokemon/Header/Character/ProfessorOak.hpp b/Pokemon/Header/Character/ProfessorOak.hpp index 0ae53d30..cb97f1ca 100644 --- a/Pokemon/Header/Character/ProfessorOak.hpp +++ b/Pokemon/Header/Character/ProfessorOak.hpp @@ -17,11 +17,11 @@ namespace N_Character // Parameterized constructor ProfessorOak(string p_name); - void greetPlayer(Player& player); + void greetPlayer(Player* player); - void offerPokemonChoices(Player& player); + void offerPokemonChoices(Player* player); // New method for the main quest conversation - void explainMainQuest(Player& player); + void explainMainQuest(Player* player); }; } \ No newline at end of file diff --git a/Pokemon/Header/Main/Game.hpp b/Pokemon/Header/Main/Game.hpp index b6bb005e..b9502dfc 100644 --- a/Pokemon/Header/Main/Game.hpp +++ b/Pokemon/Header/Main/Game.hpp @@ -12,11 +12,11 @@ namespace N_Game public: Game(); - void gameLoop(Player& player); + void gameLoop(Player* player); private: - Grass forestGrass; - Grass caveGrass; - Grass shallowWater; + Grass* forestGrass; + Grass* caveGrass; + Grass* shallowWater; }; } \ No newline at end of file diff --git a/Pokemon/Header/Pokemon/Grass.hpp b/Pokemon/Header/Pokemon/Grass.hpp index a8f45181..b5532ceb 100644 --- a/Pokemon/Header/Pokemon/Grass.hpp +++ b/Pokemon/Header/Pokemon/Grass.hpp @@ -8,7 +8,7 @@ namespace N_Pokemon { struct Grass { string environmentType; - vector wildPokemonList; + vector wildPokemonList; int encounterRate; }; } \ No newline at end of file diff --git a/Pokemon/Header/Pokemon/Pokemon.hpp b/Pokemon/Header/Pokemon/Pokemon.hpp index c56d2144..406057f9 100644 --- a/Pokemon/Header/Pokemon/Pokemon.hpp +++ b/Pokemon/Header/Pokemon/Pokemon.hpp @@ -18,11 +18,11 @@ namespace N_Pokemon Pokemon(std::string p_name, PokemonType p_type, int p_health, int p_attackPower); // Copy constructor - Pokemon(const Pokemon& other); + Pokemon(const Pokemon* other); ~Pokemon(); - void attack(Pokemon& target); + void attack(Pokemon* target); void heal(); diff --git a/Pokemon/Header/Pokemon/Pokemons/Bulbasaur.hpp b/Pokemon/Header/Pokemon/Pokemons/Bulbasaur.hpp index bab0cdea..0bfeb20e 100644 --- a/Pokemon/Header/Pokemon/Pokemons/Bulbasaur.hpp +++ b/Pokemon/Header/Pokemon/Pokemons/Bulbasaur.hpp @@ -10,7 +10,7 @@ namespace N_Pokemon { private: int leafBlade_dmg; - void leafBlade(Pokemon& target); + void leafBlade(Pokemon* target); }; } diff --git a/Pokemon/Header/Pokemon/Pokemons/Caterpie.hpp b/Pokemon/Header/Pokemon/Pokemons/Caterpie.hpp index d5dd3946..59d4254e 100644 --- a/Pokemon/Header/Pokemon/Pokemons/Caterpie.hpp +++ b/Pokemon/Header/Pokemon/Pokemons/Caterpie.hpp @@ -10,7 +10,7 @@ namespace N_Pokemon { private: int bugBite_dmg; - void bugBite(Pokemon& target); + void bugBite(Pokemon* target); }; } diff --git a/Pokemon/Header/Pokemon/Pokemons/Charmander.hpp b/Pokemon/Header/Pokemon/Pokemons/Charmander.hpp index 8505ef7f..d7f7ea45 100644 --- a/Pokemon/Header/Pokemon/Pokemons/Charmander.hpp +++ b/Pokemon/Header/Pokemon/Pokemons/Charmander.hpp @@ -10,7 +10,7 @@ namespace N_Pokemon { private: int flameThrower_dmg; - void flameThrower(Pokemon& target); + void flameThrower(Pokemon* target); }; } diff --git a/Pokemon/Header/Pokemon/Pokemons/Pidgey.hpp b/Pokemon/Header/Pokemon/Pokemons/Pidgey.hpp index 1563de33..b19647ac 100644 --- a/Pokemon/Header/Pokemon/Pokemons/Pidgey.hpp +++ b/Pokemon/Header/Pokemon/Pokemons/Pidgey.hpp @@ -10,7 +10,7 @@ namespace N_Pokemon { private: int wingAttack_dmg; - void WingAttack(Pokemon& target); + void WingAttack(Pokemon* target); }; } } \ No newline at end of file diff --git a/Pokemon/Header/Pokemon/Pokemons/Pikachu.hpp b/Pokemon/Header/Pokemon/Pokemons/Pikachu.hpp index 2543edb1..98d73ccf 100644 --- a/Pokemon/Header/Pokemon/Pokemons/Pikachu.hpp +++ b/Pokemon/Header/Pokemon/Pokemons/Pikachu.hpp @@ -10,7 +10,7 @@ namespace N_Pokemon { private: int thunderShock_dmg; - void thunderShock(Pokemon& target); + void thunderShock(Pokemon* target); }; } diff --git a/Pokemon/Header/Pokemon/Pokemons/Squitle.hpp b/Pokemon/Header/Pokemon/Pokemons/Squitle.hpp index b053068a..d00fe6eb 100644 --- a/Pokemon/Header/Pokemon/Pokemons/Squitle.hpp +++ b/Pokemon/Header/Pokemon/Pokemons/Squitle.hpp @@ -10,7 +10,7 @@ namespace N_Pokemon { private: int waterGun_dmg; - void waterGun(Pokemon& target); + void waterGun(Pokemon* target); }; } diff --git a/Pokemon/Src/Battle/BattleManager.cpp b/Pokemon/Src/Battle/BattleManager.cpp index 84aa0cfa..58810502 100644 --- a/Pokemon/Src/Battle/BattleManager.cpp +++ b/Pokemon/Src/Battle/BattleManager.cpp @@ -8,31 +8,31 @@ using namespace N_Utility; namespace N_Battle { - void BattleManager::startBattle(Player& player, N_Pokemon::Pokemon& wildPokemon) { - battleState.playerPokemon = &player.chosenPokemon; - battleState.wildPokemon = &wildPokemon; - battleState.playerTurn = true; // Player starts first - battleState.battleOngoing = true; - std::cout << "A wild " << wildPokemon.getName() << " appeared!\n"; + void BattleManager::startBattle(Player* player, N_Pokemon::Pokemon* wildPokemon) { + battleState->playerPokemon = player->chosenPokemon; + battleState->wildPokemon = wildPokemon; + battleState->playerTurn = true; // Player starts first + battleState->battleOngoing = true; + std::cout << "A wild " << wildPokemon->getName() << " appeared!\n"; battle(); } void BattleManager::battle() { - while (battleState.battleOngoing) { - if (battleState.playerTurn) { + while (battleState->battleOngoing) { + if (battleState->playerTurn) { // Player's turn to attack - battleState.playerPokemon->attack(*battleState.wildPokemon); + battleState->playerPokemon->attack(battleState->wildPokemon); } else { // Wild Pokémon's turn to attack - battleState.wildPokemon->attack(*battleState.playerPokemon); + battleState->wildPokemon->attack(battleState->playerPokemon); } // Update the battle state after the turn updateBattleState(); // Switch turns - battleState.playerTurn = !battleState.playerTurn; + battleState->playerTurn = !battleState->playerTurn; Utility::waitForEnter(); } @@ -41,22 +41,22 @@ namespace N_Battle } void BattleManager::handleBattleOutcome() { - if (battleState.playerPokemon->isFainted()) { - std::cout << battleState.playerPokemon->getName() << " has fainted! You lose the battle.\n"; + if (battleState->playerPokemon->isFainted()) { + std::cout << battleState->playerPokemon->getName() << " has fainted! You lose the battle.\n"; } else { - std::cout << "You defeated the wild " << battleState.wildPokemon->getName() << "!\n"; + std::cout << "You defeated the wild " << battleState->wildPokemon->getName() << "!\n"; } } void BattleManager::updateBattleState() { - if (battleState.playerPokemon->isFainted()) { - battleState.battleOngoing = false; + if (battleState->playerPokemon->isFainted()) { + battleState->battleOngoing = false; } - else if (battleState.wildPokemon->isFainted()) { - battleState.battleOngoing = false; + else if (battleState->wildPokemon->isFainted()) { + battleState->battleOngoing = false; } } } diff --git a/Pokemon/Src/Battle/WildEncounterManager.cpp b/Pokemon/Src/Battle/WildEncounterManager.cpp index 4309aefe..5e8f7bda 100644 --- a/Pokemon/Src/Battle/WildEncounterManager.cpp +++ b/Pokemon/Src/Battle/WildEncounterManager.cpp @@ -10,10 +10,10 @@ namespace N_Battle srand(time(0)); } - Pokemon WildEncounterManager::getRandomPokemonFromGrass(const Grass& grass) + Pokemon WildEncounterManager::getRandomPokemonFromGrass(const Grass* grass) { - int randomIndex = rand() % grass.wildPokemonList.size(); - Pokemon WildPokemon = grass.wildPokemonList[randomIndex]; + int randomIndex = rand() % grass->wildPokemonList.size(); + Pokemon WildPokemon = grass->wildPokemonList[randomIndex]; return WildPokemon; } } \ No newline at end of file diff --git a/Pokemon/Src/Character/Player/Player.cpp b/Pokemon/Src/Character/Player/Player.cpp index bba80d45..e9d0df3d 100644 --- a/Pokemon/Src/Character/Player/Player.cpp +++ b/Pokemon/Src/Character/Player/Player.cpp @@ -6,6 +6,7 @@ using namespace std; using namespace N_Utility; +using namespace N_Pokemon; namespace N_Character { @@ -13,10 +14,10 @@ namespace N_Character { Player::Player() { name = "Trainer"; - chosenPokemon = N_Pokemon::Pokemon(); // Using the default Pokemon constructor + Pokemon* chosenPokemon = new Pokemon(); // Using the default Pokemon constructor } - Player::Player(string p_name, N_Pokemon::Pokemon p_chosenPokemon) { + Player::Player(string p_name, Pokemon* p_chosenPokemon) { name = p_name; chosenPokemon = p_chosenPokemon; } @@ -24,19 +25,19 @@ namespace N_Character void Player::choosePokemon(int choice) { switch ((N_Pokemon::PokemonChoice)choice) { case N_Pokemon::PokemonChoice::CHARMANDER: - chosenPokemon = N_Pokemon::Pokemon("Charmander", N_Pokemon::PokemonType::FIRE, 100, 10); + Pokemon* chosenPokemon = new Pokemon("Charmander", N_Pokemon::PokemonType::FIRE, 100, 10); break; case N_Pokemon::PokemonChoice::BULBASAUR: - chosenPokemon = N_Pokemon::Pokemon("Bulbasaur", N_Pokemon::PokemonType::GRASS, 100, 10); + Pokemon* chosenPokemon = new Pokemon("Bulbasaur", N_Pokemon::PokemonType::GRASS, 100, 10); break; case N_Pokemon::PokemonChoice::SQUIRTLE: - chosenPokemon = N_Pokemon::Pokemon("Squirtle", N_Pokemon::PokemonType::WATER, 100, 10); + Pokemon* chosenPokemon = new Pokemon("Squirtle", N_Pokemon::PokemonType::WATER, 100, 10); break; default: - chosenPokemon = N_Pokemon::Pokemon("Pikachu", N_Pokemon::PokemonType::ELECTRIC, 100, 10); + Pokemon* chosenPokemon = new Pokemon("Pikachu", N_Pokemon::PokemonType::ELECTRIC, 100, 10); break; } - cout << "Player " << name << " chose " << chosenPokemon.getName() << "!\n"; + cout << "Player " << name << " chose " << chosenPokemon->getName() << "!\n"; Utility::waitForEnter(); } } diff --git a/Pokemon/Src/Character/ProfessorOak.cpp b/Pokemon/Src/Character/ProfessorOak.cpp index 36bf7596..1357d4bd 100644 --- a/Pokemon/Src/Character/ProfessorOak.cpp +++ b/Pokemon/Src/Character/ProfessorOak.cpp @@ -12,7 +12,7 @@ namespace N_Character { ProfessorOak::ProfessorOak(string p_name) { name = p_name; } - void ProfessorOak::greetPlayer(Player& player) { + void ProfessorOak::greetPlayer(Player* player) { cout << name << ": Hello there! Welcome to the world of Pokemon!\n"; Utility::waitForEnter(); cout << name @@ -22,12 +22,12 @@ namespace N_Character Utility::waitForEnter(); } - void ProfessorOak::offerPokemonChoices(Player& player) { + void ProfessorOak::offerPokemonChoices(Player* player) { cout << name << ": First, tell me, what’s your name? \t [Please Enter Your Name]\n"; - getline(std::cin, player.name); - cout << name << ": Ah, " << player.name + getline(std::cin, player->name); + cout << name << ": Ah, " << player->name << "! What a fantastic name!\n"; Utility::waitForEnter(); cout << name @@ -50,14 +50,14 @@ namespace N_Character << ": So, which one will it be? Enter the number of your choice: "; cin >> choice; - player.choosePokemon(choice); + player->choosePokemon(choice); Utility::waitForEnter(); } - void ProfessorOak::explainMainQuest(Player& player) { + void ProfessorOak::explainMainQuest(Player* player) { Utility::clearConsole(); - cout << "Professor Oak: " << player.name + cout << "Professor Oak: " << player->name << "!, I am about to explain you about your upcoming grand " "adventure.\n"; Utility::waitForEnter(); @@ -71,12 +71,12 @@ namespace N_Character Utility::waitForEnter(); cout << "\n" - << player.name + << player->name << ": Wait... that sounds a lot like every other Pokémon game " "out there...\n"; Utility::waitForEnter(); cout << "Professor Oak: Shhh! Don't break the fourth wall, " - << player.name << "! This is serious business!\n"; + << player->name << "! This is serious business!\n"; Utility::waitForEnter(); cout << "\nProfessor Oak: To achieve this, you’ll need to battle wild " @@ -89,7 +89,7 @@ namespace N_Character Utility::waitForEnter(); cout << "\n" - << player.name << ": Sounds like a walk in the park... right?\n"; + << player->name << ": Sounds like a walk in the park... right?\n"; Utility::waitForEnter(); cout << "Professor Oak: Hah! That’s what they all say! But beware, " "young Trainer, the path to victory is fraught with " @@ -100,7 +100,7 @@ namespace N_Character cout << "\nProfessor Oak: So, what do you say? Are you ready to " "become the next Pokémon Champion?\n"; Utility::waitForEnter(); - cout << "\n" << player.name << ": Ready as I’ll ever be, Professor!\n"; + cout << "\n" << player->name << ": Ready as I’ll ever be, Professor!\n"; Utility::waitForEnter(); cout diff --git a/Pokemon/Src/Main/Game.cpp b/Pokemon/Src/Main/Game.cpp index 8aa7e424..1a8a03fd 100644 --- a/Pokemon/Src/Main/Game.cpp +++ b/Pokemon/Src/Main/Game.cpp @@ -16,14 +16,14 @@ using namespace N_Pokemon; namespace N_Game { Game::Game() { - forestGrass = {"Forest", {Pokemon {"Pidgey", PokemonType::NORMAL, 40, 10}, Pokemon {"Caterpie", PokemonType::BUG, 35, 10}}, 70 }; + Grass* forestGrass = new Grass({"Forest", {Pokemon {"Pidgey", PokemonType::NORMAL, 40, 10}, Pokemon {"Caterpie", PokemonType::BUG, 35, 10}}, 70 }); - caveGrass = {"Cave", {Pokemon {"Zubat", PokemonType::POISON, 30, 10}, Pokemon {"Geodude", PokemonType::ROCK, 50, 10}}, 80}; + Grass* caveGrass = new Grass({"Cave", {Pokemon {"Zubat", PokemonType::POISON, 30, 10}, Pokemon {"Geodude", PokemonType::ROCK, 50, 10}}, 80}); - shallowWater = {"water", {Pokemon {"Staryu", PokemonType::WATER, 40, 10}, Pokemon {"Tentacool", PokemonType::POISON, 40, 10}}, 80}; + Grass* shallowWater = new Grass({"water", {Pokemon {"Staryu", PokemonType::WATER, 40, 10}, Pokemon {"Tentacool", PokemonType::POISON, 40, 10}}, 80}); } - void Game::gameLoop(Player& player) { + void Game::gameLoop(Player* player) { BattleManager battleManager; bool keepPlaying = true; @@ -44,14 +44,14 @@ namespace N_Game switch (choice) { case 1: { WildEncounterManager encounterManager; - Pokemon wildPokemon = encounterManager.getRandomPokemonFromGrass(forestGrass); + Pokemon* wildPokemon = new Pokemon(encounterManager.getRandomPokemonFromGrass(forestGrass)); battleManager.startBattle(player, wildPokemon); break; } case 2: { std::cout << "You head to the PokeCenter.\n"; - player.chosenPokemon.heal(); - std::cout << player.chosenPokemon.getName() << "'s health is fully restored!\n"; + player->chosenPokemon->heal(); + std::cout << player->chosenPokemon->getName() << "'s health is fully restored!\n"; break; } case 5: { @@ -67,7 +67,7 @@ namespace N_Game Utility::waitForEnter(); } - std::cout << "Goodbye, " << player.name << "! Thanks for playing!\n"; + std::cout << "Goodbye, " << player->name << "! Thanks for playing!\n"; } } diff --git a/Pokemon/Src/Pokemon/Pokemon.cpp b/Pokemon/Src/Pokemon/Pokemon.cpp index 65d609f3..b090871e 100644 --- a/Pokemon/Src/Pokemon/Pokemon.cpp +++ b/Pokemon/Src/Pokemon/Pokemon.cpp @@ -23,20 +23,20 @@ namespace N_Pokemon maxHealth = 100; } - Pokemon::Pokemon(const Pokemon& other) { - name = other.name; - type = other.type; - health = other.health; - attackPower = other.attackPower; + Pokemon::Pokemon(const Pokemon* other) { + name = other->name; + type = other->type; + health = other->health; + attackPower = other->attackPower; maxHealth = 100; } Pokemon::~Pokemon() { } - void Pokemon::attack(Pokemon& target) { + void Pokemon::attack(Pokemon* target) { int damage = attackPower; // Use attack power for damage calculation - cout << name << " attacks " << target.name << " for " << damage << " damage!\n"; - target.takeDamage(damage); + cout << name << " attacks " << target->name << " for " << damage << " damage!\n"; + target->takeDamage(damage); } void Pokemon::takeDamage(int damage) diff --git a/Pokemon/Src/Pokemon/Pokemons/Bulbasaur.cpp b/Pokemon/Src/Pokemon/Pokemons/Bulbasaur.cpp index 76c9cde3..6b02986e 100644 --- a/Pokemon/Src/Pokemon/Pokemons/Bulbasaur.cpp +++ b/Pokemon/Src/Pokemon/Pokemons/Bulbasaur.cpp @@ -12,9 +12,9 @@ namespace N_Pokemon { leafBlade_dmg = 15; } - void Bulbasaur::leafBlade(Pokemon& target) { - cout << name << " uses Thunder Shock on " << target.getName() << "!\n"; - target.takeDamage(leafBlade_dmg); + void Bulbasaur::leafBlade(Pokemon* target) { + cout << name << " uses Thunder Shock on " << target->getName() << "!\n"; + target->takeDamage(leafBlade_dmg); } } } \ No newline at end of file diff --git a/Pokemon/Src/Pokemon/Pokemons/Caterpie.cpp b/Pokemon/Src/Pokemon/Pokemons/Caterpie.cpp index 68f70633..717c5539 100644 --- a/Pokemon/Src/Pokemon/Pokemons/Caterpie.cpp +++ b/Pokemon/Src/Pokemon/Pokemons/Caterpie.cpp @@ -12,9 +12,9 @@ namespace N_Pokemon { bugBite_dmg = 15; } - void Caterpie::bugBite(Pokemon& target) { - cout << name << " uses Wing Attack on " << target.getName() << "!\n"; - target.takeDamage(bugBite_dmg); + void Caterpie::bugBite(Pokemon* target) { + cout << name << " uses Wing Attack on " << target->getName() << "!\n"; + target->takeDamage(bugBite_dmg); } } } \ No newline at end of file diff --git a/Pokemon/Src/Pokemon/Pokemons/Charmander.cpp b/Pokemon/Src/Pokemon/Pokemons/Charmander.cpp index 9e996ad9..340a1b48 100644 --- a/Pokemon/Src/Pokemon/Pokemons/Charmander.cpp +++ b/Pokemon/Src/Pokemon/Pokemons/Charmander.cpp @@ -12,9 +12,9 @@ namespace N_Pokemon { flameThrower_dmg = 15; } - void Charmander::flameThrower(Pokemon& target) { - cout << name << " uses Thunder Shock on " << target.getName() << "!\n"; - target.takeDamage(flameThrower_dmg); + void Charmander::flameThrower(Pokemon* target) { + cout << name << " uses Thunder Shock on " << target->getName() << "!\n"; + target->takeDamage(flameThrower_dmg); } } } \ No newline at end of file diff --git a/Pokemon/Src/Pokemon/Pokemons/Pidgey.cpp b/Pokemon/Src/Pokemon/Pokemons/Pidgey.cpp index 3a7baf80..05e78691 100644 --- a/Pokemon/Src/Pokemon/Pokemons/Pidgey.cpp +++ b/Pokemon/Src/Pokemon/Pokemons/Pidgey.cpp @@ -12,9 +12,9 @@ namespace N_Pokemon { wingAttack_dmg = 15; } - void Pidgey::WingAttack(Pokemon& target) { - cout << name << " uses Wing Attack on " << target.getName() << "!\n"; - target.takeDamage(wingAttack_dmg); + void Pidgey::WingAttack(Pokemon* target) { + cout << name << " uses Wing Attack on " << target->getName() << "!\n"; + target->takeDamage(wingAttack_dmg); } } } \ No newline at end of file diff --git a/Pokemon/Src/Pokemon/Pokemons/Pikachu.cpp b/Pokemon/Src/Pokemon/Pokemons/Pikachu.cpp index 42476ffc..e4158b0a 100644 --- a/Pokemon/Src/Pokemon/Pokemons/Pikachu.cpp +++ b/Pokemon/Src/Pokemon/Pokemons/Pikachu.cpp @@ -12,9 +12,9 @@ namespace N_Pokemon { thunderShock_dmg = 15; } - void Pikachu::thunderShock(Pokemon& target) { - cout << name << " uses Thunder Shock on " << target.getName() << "!\n"; - target.takeDamage(thunderShock_dmg); + void Pikachu::thunderShock(Pokemon* target) { + cout << name << " uses Thunder Shock on " << target->getName() << "!\n"; + target->takeDamage(thunderShock_dmg); } } } \ No newline at end of file diff --git a/Pokemon/Src/Pokemon/Pokemons/Squirtle.cpp b/Pokemon/Src/Pokemon/Pokemons/Squirtle.cpp index 7b7de51c..e4ac9dff 100644 --- a/Pokemon/Src/Pokemon/Pokemons/Squirtle.cpp +++ b/Pokemon/Src/Pokemon/Pokemons/Squirtle.cpp @@ -12,9 +12,9 @@ namespace N_Pokemon { waterGun_dmg = 15; } - void Squitle::waterGun(Pokemon& target) { - cout << name << " uses Thunder Shock on " << target.getName() << "!\n"; - target.takeDamage(waterGun_dmg); + void Squitle::waterGun(Pokemon* target) { + cout << name << " uses Thunder Shock on " << target->getName() << "!\n"; + target->takeDamage(waterGun_dmg); } } } \ No newline at end of file diff --git a/Pokemon/main.cpp b/Pokemon/main.cpp index 8a4c9886..a59d719f 100644 --- a/Pokemon/main.cpp +++ b/Pokemon/main.cpp @@ -11,16 +11,16 @@ using namespace N_Player; int main() { - ProfessorOak professor("Professor Oak"); - Player player; + ProfessorOak* professor = new ProfessorOak("Professor Oak"); + Player* player = new Player(); - professor.greetPlayer(player); - professor.offerPokemonChoices(player); + professor->greetPlayer(player); + professor->offerPokemonChoices(player); - professor.explainMainQuest(player); + professor->explainMainQuest(player); - Game game; - game.gameLoop(player); + Game* game = new Game(); + game->gameLoop(player); return 0; } \ No newline at end of file