Skip to content

Feature 3 main quest #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: Project_Setup
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@
*.exe
*.out
*.app
/Pokemon/.vs
Pokemon/.vs/Pokemon/v17/Browse.VC.db
Binary file not shown.
Binary file removed Pokemon/.vs/Pokemon/v17/Browse.VC.db
Binary file not shown.
393 changes: 0 additions & 393 deletions Pokemon/.vs/Pokemon/v17/DocumentLayout.backup.json

This file was deleted.

393 changes: 0 additions & 393 deletions Pokemon/.vs/Pokemon/v17/DocumentLayout.json

This file was deleted.

Binary file removed Pokemon/.vs/Pokemon/v17/Solution.VC.db
Binary file not shown.
Binary file not shown.
6 changes: 6 additions & 0 deletions Pokemon/Pokemon.vcxproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ShowAllFiles>true</ShowAllFiles>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion Pokemon/Pokemon/x64/Debug/Pokemon.exe.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\Users\aryan\Desktop\Current Project\Pokemon\Pokemon\x64\Debug\Pokemon.exe</FullPath>
<FullPath>C:\Users\wasis\Desktop\Project\Duck_Hunt\Pokemon\Pokemon\x64\Debug\Pokemon.exe</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
Expand Down
Binary file added Pokemon/Pokemon/x64/Debug/Pokemon.ilk
Binary file not shown.
2 changes: 2 additions & 0 deletions Pokemon/Pokemon/x64/Debug/Pokemon.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
 main.cpp
Pokemon.vcxproj -> C:\Users\wasis\Desktop\Project\Duck_Hunt\Pokemon\Pokemon\x64\Debug\Pokemon.exe
Binary file modified Pokemon/Pokemon/x64/Debug/Pokemon.tlog/CL.command.1.tlog
Binary file not shown.
Binary file modified Pokemon/Pokemon/x64/Debug/Pokemon.tlog/CL.read.1.tlog
Binary file not shown.
Binary file modified Pokemon/Pokemon/x64/Debug/Pokemon.tlog/CL.write.1.tlog
Binary file not shown.
2 changes: 1 addition & 1 deletion Pokemon/Pokemon/x64/Debug/Pokemon.tlog/Cl.items.tlog
Original file line number Diff line number Diff line change
@@ -1 +1 @@
C:\Users\aryan\Desktop\Current Project\Pokemon\Pokemon\main.cpp;C:\Users\aryan\Desktop\Current Project\Pokemon\Pokemon\Pokemon\x64\Debug\main.obj
C:\Users\wasis\Desktop\Project\Duck_Hunt\Pokemon\Pokemon\main.cpp;C:\Users\wasis\Desktop\Project\Duck_Hunt\Pokemon\Pokemon\Pokemon\x64\Debug\main.obj
4 changes: 2 additions & 2 deletions Pokemon/Pokemon/x64/Debug/Pokemon.tlog/Pokemon.lastbuildstate
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.41.34120:TargetPlatformVersion=10.0.22621.0:
Debug|x64|C:\Users\aryan\Desktop\Current Project\Pokemon\Pokemon\|
PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.40.33807:TargetPlatformVersion=10.0.22621.0:
Debug|x64|C:\Users\wasis\Desktop\Project\Duck_Hunt\Pokemon\Pokemon\|
Binary file modified Pokemon/Pokemon/x64/Debug/Pokemon.tlog/link.command.1.tlog
Binary file not shown.
Binary file modified Pokemon/Pokemon/x64/Debug/Pokemon.tlog/link.read.1.tlog
Binary file not shown.
4 changes: 2 additions & 2 deletions Pokemon/Pokemon/x64/Debug/Pokemon.tlog/link.secondary.1.tlog
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
^C:\USERS\ARYAN\DESKTOP\CURRENT PROJECT\POKEMON\POKEMON\POKEMON\X64\DEBUG\MAIN.OBJ
C:\Users\aryan\Desktop\Current Project\Pokemon\Pokemon\Pokemon\x64\Debug\Pokemon.ilk
^C:\USERS\WASIS\DESKTOP\PROJECT\DUCK_HUNT\POKEMON\POKEMON\POKEMON\X64\DEBUG\MAIN.OBJ
C:\Users\wasis\Desktop\Project\Duck_Hunt\Pokemon\Pokemon\Pokemon\x64\Debug\Pokemon.ilk
Binary file modified Pokemon/Pokemon/x64/Debug/Pokemon.tlog/link.write.1.tlog
Binary file not shown.
Binary file modified Pokemon/Pokemon/x64/Debug/vc143.idb
Binary file not shown.
Binary file added Pokemon/Pokemon/x64/Debug/vc143.pdb
Binary file not shown.
275 changes: 274 additions & 1 deletion Pokemon/main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,279 @@
#include <iostream>
#include <string>
using namespace std;

void clearConsole() {
#ifdef _WIN32
system("cls");
#else
(void)system("clear");
#endif
}

void waitForEnter() {
cin.get();
}

enum class PokemonChoice {
CHARMANDER = 1,
BULBASAUR,
SQUIRTLE,
PIKACHU
};

enum class PokemonType {
FIRE,
GRASS,
WATER,
ELECTRIC,
NORMAL
};

class Pokemon {
public:
string name;
PokemonType type;
int health;

Pokemon() {
name = "Unknown";
type = PokemonType::NORMAL;
health = 50;
}

Pokemon(std::string p_name, PokemonType p_type, int p_health) {
name = p_name;
type = p_type;
health = p_health;
}

Pokemon(const Pokemon& other) {
name = other.name;
type = other.type;
health = other.health;
}

~Pokemon() {

}

void attack() { std::cout << name << " attacks with a powerful move!\n"; }
};

class Player {
public:
string name;
Pokemon chosenPokemon;

Player() {
name = "Trainer";
chosenPokemon = Pokemon();
}

Player(std::string p_name, Pokemon p_chosenPokemon) {
name = p_name;
chosenPokemon = p_chosenPokemon;
}

void choosePokemon(int choice) {
switch ((PokemonChoice)choice) {
case PokemonChoice::CHARMANDER:
chosenPokemon = Pokemon("Charmander", PokemonType::FIRE, 100);
break;
case PokemonChoice::BULBASAUR:
chosenPokemon = Pokemon("Bulbasaur", PokemonType::GRASS, 100);
break;
case PokemonChoice::SQUIRTLE:
chosenPokemon = Pokemon("Squirtle", PokemonType::WATER, 100);
break;
default:
chosenPokemon = Pokemon("Pikachu", PokemonType::ELECTRIC, 100);
break;
}
cout << "Player " << name << " chose " << chosenPokemon.name << "!\n";
waitForEnter();
}
};

class ProfessorOak {
public:
string name;

ProfessorOak(string p_name) { name = p_name; }

void greetPlayer(Player& player) {
cout << name << ": Hello there! Welcome to the world of Pokemon!\n";
waitForEnter();
cout << name
<< ": My name is Oak. People call me the Pokemon Professor!\n";
waitForEnter();
cout << name << ": But enough about me. Let's talk about you!\n";
waitForEnter();
}

void 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
<< "! What a fantastic name!\n";
waitForEnter();
cout << name
<< ": You must be eager to start your adventure. But first, "
"you�ll need a Pokemon of your own!\n";
waitForEnter();

cout
<< name
<< ": I have three Pokemon here with me. They�re all quite feisty!\n";
waitForEnter();
cout << name << ": Choose wisely...\n";
cout << "1. Charmander - The fire type. A real hothead!\n";
cout << "2. Bulbasaur - The grass type. Calm and collected!\n";
cout << "3. Squirtle - The water type. Cool as a cucumber!\n";

int choice;
cout
<< name
<< ": So, which one will it be? Enter the number of your choice: ";
cin >> choice;

player.choosePokemon(choice);
waitForEnter();
}

void explainMainQuest(Player& player) {

clearConsole();

cout << "Professor Oak: " << player.name
<< "!, I am about to explain you about your upcoming grand "
"adventure.\n";
waitForEnter();
cout << "Professor Oak: You see, becoming a Pok�mon Master is no easy "
"feat. It takes courage, wisdom, and a bit of luck!\n";
waitForEnter();
cout
<< "Professor Oak: Your mission, should you choose to accept it�and "
"trust me, you really don�t have a choice�is to collect all the "
"Pok�mon Badges and conquer the Pok�mon League.\n";
waitForEnter();

cout << "\n"
<< player.name
<< ": Wait... that sounds a lot like every other Pok�mon game "
"out there...\n";
waitForEnter();
cout << "Professor Oak: Shhh! Don't break the fourth wall, "
<< player.name << "! This is serious business!\n";
waitForEnter();

cout << "\nProfessor Oak: To achieve this, you�ll need to battle wild "
"Pok�mon, challenge gym leaders, and of course, keep your "
"Pok�mon healthy at the PokeCenter.\n";
waitForEnter();
cout << "Professor Oak: Along the way, you'll capture new Pok�mon to "
"strengthen your team. Just remember�there�s a limit to how "
"many Pok�mon you can carry, so choose wisely!\n";
waitForEnter();

cout << "\n"
<< player.name << ": Sounds like a walk in the park... right?\n";
waitForEnter();
cout << "Professor Oak: Hah! That�s what they all say! But beware, "
"young Trainer, the path to victory is fraught with "
"challenges. And if you lose a battle... well, let�s just say "
"you'll be starting from square one.\n";
waitForEnter();

cout << "\nProfessor Oak: So, what do you say? Are you ready to "
"become the next Pok�mon Champion?\n";
waitForEnter();
cout << "\n" << player.name << ": Ready as I�ll ever be, Professor!\n";
waitForEnter();

cout
<< "\nProfessor Oak: That�s the spirit! Now, your journey begins...\n";
waitForEnter();
cout << "Professor Oak: But first... let's just pretend I didn't "
"forget to set up the actual game loop... Ahem, onwards!\n";
waitForEnter();
}
};

void gameLoop(Player& player) {
int choice;
bool keepPlaying = true;

while (keepPlaying) {
clearConsole();

cout << "\nWhat would you like to do next, " << player.name << "?\n";
cout << "1. Battle Wild Pok�mon\n";
cout << "2. Visit PokeCenter\n";
cout << "3. Challenge Gyms\n";
cout << "4. Enter Pok�mon League\n";
cout << "5. Quit\n";
cout << "Enter your choice: ";
cin >> choice;

cin.ignore(numeric_limits<streamsize>::max(), '\n');


switch (choice) {
case 1:
cout << "You look around... but all the wild Pok�mon are on "
"vacation. Maybe try again later?\n";
break;
case 2:
cout
<< "You head to the PokeCenter, but Nurse Joy is out on a coffee "
"break. Guess your Pok�mon will have to tough it out for now!\n";
break;
case 3:
cout << "You march up to the Gym, but it's closed for renovations. "
"Seems like even Gym Leaders need a break!\n";
break;
case 4:
cout << "You boldly step towards the Pok�mon League... but the "
"gatekeeper laughs and says, 'Maybe next time, champ!'\n";
break;
case 5:
cout << "You try to quit, but Professor Oak's voice echoes: "
"'There's no quitting in Pok�mon training!'\n";
cout << "Are you sure you want to quit? (y/n): ";
char quitChoice;
cin >> quitChoice;
if (quitChoice == 'y' || quitChoice == 'Y') {
keepPlaying = false;
}
break;
default:
cout << "That's not a valid choice. Try again!\n";
break;
}

waitForEnter();
}

cout << "Goodbye, " << player.name << "! Thanks for playing!\n";
}

int main() {
Pokemon charmander("Charmander", PokemonType::FIRE,
100);

ProfessorOak professor("Professor Oak");
Player player("Ash", charmander);

professor.greetPlayer(player);

professor.offerPokemonChoices(player);

professor.explainMainQuest(player);

gameLoop(player);

return 0;
}
}
Binary file added Pokemon/x64/Debug/Pokemon.pdb
Binary file not shown.