Skip to content
Permalink
Browse files
Add files via upload
  • Loading branch information
iheomac committed Mar 16, 2020
1 parent c8b0271 commit 66f6d2cef27668e1ec347649943f47856342f802
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 41 deletions.
@@ -9,7 +9,7 @@ void draw_UP_arrow()
{
string firstLast_line(1, '+'), second_line(3, '+'), third_line(9, '+'), fourth_line(15, '+');
char empty(' ');
int PosXfirst_bottomline = 15;
int PosXfirst_bottomline = 13;
int PosXsecondline = 12;
int PosXthirdline = 9;
int PosXfourthline = 6;
@@ -25,16 +25,16 @@ void draw_UP_arrow()
cout << second_PosXstr << second_line << endl;
cout << third_PosXstr << third_line << endl;
cout << fourth_PosXstr << fourth_line << endl;
cout << first_PosXstr << firstLast_line << endl;
cout << first_PosXstr << firstLast_line << endl;
cout << second_PosXstr << second_line << endl;
cout << second_PosXstr << second_line << endl;

}

void draw_DWN_arrow()
{
string firstLast_line(1, '+'), second_line(3, '+'), third_line(9, '+'), fourth_line(15,'+');
char empty(' ');
int PosXfirst_bottomline = 15;
int PosXfirst_bottomline = 13;
int PosXsecondline = 12;
int PosXthirdline = 9;
int PosXfourthline = 6;
@@ -47,8 +47,8 @@ void draw_DWN_arrow()
for (int row = 0; row < 3; ++row)
cout << endl;

cout << first_PosXstr << firstLast_line << endl;
cout << first_PosXstr << firstLast_line << endl;
cout << second_PosXstr << second_line << endl;
cout << second_PosXstr << second_line << endl;
cout << fourth_PosXstr << fourth_line << endl;
cout << third_PosXstr << third_line << endl;
cout << second_PosXstr << second_line << endl;
@@ -24,19 +24,19 @@ Item::Item(string Name, int HP, int AT, int DEF, int SP)
};
void Equip(Character* character, Item* item)
{
cout << "The enemy just dropped an item: " << item->itemName << "." << endl;
cout <<"The "<< item->itemName << " improves your stats with " << item->itemHealth << " health " << item->itemAttack << " attack ";
cout << item->itemDefence << " defence " << item->itemSpeed << " speed." << endl;
cout << "Do you want to equip it?" << endl;
std::cout << "The enemy just dropped an item: " << item->itemName << "." << endl;
std::cout <<"The "<< item->itemName << " improves your stats with " << item->itemHealth << " health " << item->itemAttack << " attack ";
std::cout << item->itemDefence << " defence " << item->itemSpeed << " speed." << endl;
std::cout << "Do you want to equip it?" << endl;


cout << "Yes<1> No<2>: ";
std::cout << "Yes<1> No<2>: ";
int answer; cin >> answer;
clear();
system("clr");
if (answer == 1)
{
character->inventory.push_back(item->itemName);
cout << "You improved your stats. " << endl;
std::cout << "You improved your stats. " << endl;
character->health += item->itemHealth;
character->attack += item->itemAttack;
character->defence += item->itemDefence;
@@ -47,10 +47,12 @@ void Equip(Character* character, Item* item)
}
if (answer == 2)
{
cout << "You thrown away the item." << endl;
std::cout << "You thrown away the item." << endl;
}
/*
if (answer!=1 && answer!=2)
{
throw throw std::runtime_error("Invalid choice!");
throw std::runtime_error("Invalid choice!");
}
*/
}
@@ -305,54 +305,58 @@ int main()
std::system("cls");
std::cout << "Fight" << endl;
Fight(pA, pZ);
Item Dagger("Dagger", 50, 50, 0, 30);
Item* pS = &Dagger;
if (pA->dead == false)
{
Equip(pA, pS);
Assassin.get_inventory();
Stats(pA);
Players_Fight.UpgradeStage();
Stage_Adjustment(pPF, pPL);
Stage_Descript(pPF, pPL);
}

}


if (GetAsyncKeyState(VK_RIGHT))
{
if (GetAsyncKeyState(VK_RIGHT))
{

direction_chosen = true;
std::system("cls");
direction_chosen = true;
std::system("cls");


}
}

if (GetAsyncKeyState(VK_LEFT))
{
if (GetAsyncKeyState(VK_LEFT))
{

direction_chosen = true;
std::system("cls");
direction_chosen = true;
std::system("cls");

}
}

if (GetAsyncKeyState(VK_ESCAPE))
{
map_running = false;
direction_chosen = true;
}
if (GetAsyncKeyState(VK_ESCAPE))
{
map_running = false;
direction_chosen = true;
}
}
Item Dagger("Dagger", 50, 50, 0, 30);
Item* pS = &Dagger;
if (pA->dead == false)
{
Equip(pA, pS);
Assassin.get_inventory();
Stats(pA);
Stage_Adjustment(pPF, pPL);
Stage_Descript(pPF, pPL);
}
}






}
if((Character_Choice!=1 && Character_choice!=2) && Character_Choice!=3)
/*
else if((Character_Choice!=1 && Character_Choice!=2) && Character_Choice!=3)
{
throw throw std::runtime_error("Invalid choice!");
}
*/
std::system("cls");
std::cout << "GAME OVER";
return 0;

0 comments on commit 66f6d2c

Please sign in to comment.