Code:
#include <iostream>
using namespace std;
void inventory (int& healingpotionr, int& lightningbottler, int& lockpickr, int& halfhealingpotionr, int& inventorychoicer, int& healthstatr, int& spikedhorseshoesr)
{
cout << "You are carrying: (Select an item to use it, or type \"9\" or an integer not tied to an inventory object to exit.) \n \n";
if (healingpotionr == 1)
{
cout << "1. Healing Potion (Sets health to 8!) \n";
}
if (halfhealingpotionr == 1)
{
cout << "2. Half Healing Potion (Sets health to 5!) \n";
}
if (lightningbottler ==1)
{
cout << "3. Lightning Bottle \n";
}
if (lockpickr == 1)
{
cout << "4. Lock Pick \n";
}
if (spikedhorseshoesr == 1)
{
cout << "5. Spiked Horse Shoes\n";
}
cout << "Selection? ";
cin >> inventorychoicer;
if (inventorychoicer == 1 && healingpotionr ==1)
{
healthstatr = 8;
cout << "You feel a strong surge of energy and a distinctly itchy feeling as your wounds knit themselves together. You feel energized, you feel great! You look at your biggest wound, the one you're REALLY worried about... You sigh. Well, at least you're a healthy cripple.\n\n";
healingpotionr = 0;
cout<< "Within the inventory function: \n";
cout << "healthstatr: " << healthstatr<<"\n";
cout << "healingpotionr: " << healingpotionr<<"\n";
cout << "halfhealingpotionr: "<< halfhealingpotionr<<"\n";
}
if (inventorychoicer == 2 && halfhealingpotionr ==1)
{
healthstatr = 5;
cout << "You feel a weak surge run through you and a distincly itchy feeling as your wounds start to knit themselves together. Start being the operative word. You still feel like garbage, but you think you can move now.\n\n";
halfhealingpotionr = 0;
cout<< "Within the inventory function: \n";
cout << "healthstatr: " << healthstatr<<"\n";
cout << "healingpotionr: " << healingpotionr<<"\n";
cout << "halfhealingpotionr: "<< halfhealingpotionr<<"\n";
}
}
int location(int north, int east, int up, int room)
{
//okay, so the idea here is that the movement in each direction needs to modify the return value of the function such that each of the 12 rooms has a different value.
if (north==0 && east==0 && up==0)
{
room = 1; //this will be tunnels room 1
}
else if (north==1 && east==0 && up==0)
{
room = 2; //this will be tunnels room 2
}
else if (north==1 && east==1 && up==0)
{
room = 3; // this will be tunnels room 3
}
else if (north==0 && east==1 && up==0)
{
room = 4; // this will be tunnels room 4
}
else if (north==0 && east==0 && up==1)
{
room = 5; //this will be the clinic
}
else if (north==1 && east==0 && up==1)
{
room = 6; //this will be the meeting room/hard knock's training room
}
else if (north==1 && east==1 && up==1)
{
room = 7; //this will be Tiller's lab
}
else if (north==0 && east==1 && up==1)
{
room = 8; // this will be the bedrooms/Blueblood's office
}
else if (north==0 && east==0 && up==2)
{
room = 9; // this will be the mountain pass
}
else if (north==0 && east==0 && up==2)
{
room = 10; // this will be the bridge
}
else if (north==1 && east==1 && up==2)
{
room = 11; // this will be the Creek
}
else if (north==0 && east==1 && up==2)
{
room = 12; // this will be the hill side
}
return room;
}
void breathedeep (int weapon, int healthstat, int spiritstat, int strengthstat, int dexteritystat, int playerrace,int healingpotion, int lightningbottle, int lockpick, int inventorychoice, int halfhealingpotion, int north, int east, int up, int room, int spikedhorseshoes)
{
cout << "You take a deep breath, close your eyes and look inward. You have a brief moment of deep awareness. \n\n Health: "<< healthstat << "\n Spirit:" << spiritstat << "\n Strength: " << strengthstat << "\n Dexterity: " << dexteritystat << "\n\n";
if (playerrace == 1)
{
cout << "UNICORN\n.................~()~().../\.....\n..................(~0000/ /............\n..............(~0/ _ \............\n.............(~0/ Q \__.....\n............(~0/ _D\........\n...........(~0/ ___/.........\n..........(~0/ \__/...................\n____________/ /.........................\n |..........................\n |...........................\n |..........................\n |..........................\n |.........................\n \.......................\n \.......................\n________| |_____ \.......................\n........| |......\ \......................\n........| |.......\ \ .........................\n\n";
}
else if (playerrace == 2)
{
cout << "PEGASUS\n..................~()~()......\n..................(~000000............\n..............(~0/ _ \............\n.............(~0/ Q \__.....\n............(~0/ _D\........\n...........(~0/ ___/.........\n..........(~0/ \__/...................\n____________/ /.........................\n|||||||||>> |..........................\n|||||||||>> |...........................\n|||||||||> |..........................\n||||||||| |..........................\n||||||||| |.........................\n||||||||| \.......................\n||||||||| \.......................\n||||||||| |_____ \.......................\n--------| |......\ \......................\n........| |.......\ \ .........................\n\n";
}
else if (playerrace == 3)
{
cout << "EARTH PONY\n..................~()~()......\n..................(~000000............\n..............(~0/ _ \............\n.............(~0/ Q \__.....\n............(~0/ _D\........\n...........(~0/ ___/.........\n..........(~0/ \__/...................\n____________/ /.........................\n |..........................\n |...........................\n |..........................\n |..........................\n |.........................\n \.......................\n \.......................\n | |_____ \.......................\n--------| |......\ \......................\n........| |.......\ \ .........................\n\n";
}
//I'll need to fix the ascii art above, it's a great idea, but I have to figure out how to get the spacing right and make the \ character show up.
if (weapon == 0)
{
cout << "You're completely unshod, and unarmed.\n\n";
}
if (location( north, east, up, room) == 5)
{
cout << "You are in some sort of clinic. It is tidy and neat, but doesn't appear to have much in the way of medical supplies. Everything is worn down, but obvious efforts have been made to maintain what little is there. A mare in an orange vest resides here, looking watchful. There is also a heavy metal cabinet tucked away in a corner. It has a very sturdy chain lock.\n\n";
}
inventory (healingpotion, lightningbottle, lockpick, halfhealingpotion, inventorychoice, healthstat, spikedhorseshoes);
}
int main()
{
int healthstat;
int north, east, up;
north = 0;
east = 0;
up = 1;
int firstvisit;
int everyoneconversationchoiceone;
int hardknockconversationchoice;
int bluebloodconversationonechoice;
int spikedhorseshoes;
spikedhorseshoes = 0;
int windconversationonechoice;
int inventorychoice;
int halfhealingpotion;
int healingpotion;
int lightningbottle;
int lockpick;
//int *healingpotionptr, *lightningbottleptr, *lockpickptr, *halfhealingpotionptr, *inventorychoiceptr, *healthstatptr, *spikedhorseshoesptr;
//healingpotionptr = &healingpotion;
//lightningbottleptr = &lightningbottle;
//lockpickptr = &lockpick;
//halfhealingpotionptr = &halfhealingpotion;
//inventorychoiceptr = &inventorychoice;
//healthstatptr = &healthstat;
//spikedhorseshoesptr = &spikedhorseshoes;
int& healingpotionr =healingpotion;
int& lightningbottler =lightningbottle;
int& lockpickr = lockpick;
int& halfhealingpotionr = halfhealingpotion;
int& inventorychoicer = inventorychoice;
int& healthstatr = healthstat;
int& spikedhorseshoesr = spikedhorseshoes;
int enemyweapon;
int enemystrength;
int targethealth;
int weapon;
int battle;
int playername;
//char enteredfirstname[1000];
//char enteredlastname[1000];
char enteredplayername[256];
int spiritstat;
int strengthstat;
int dexteritystat;
int tutorialchoiceone;
int tutorialchoicetwo;
int tutorialchoicethree;
int tutorialchoicefour;
int tutorialchoicefive;
int tutorialchoicesix;
tutorialchoicethree = 2;
int playerrace;
int people; // Plan: 1 will be Wind, 2 will be Blueblood, 3 will be Tiller, and 4 will be Hard knock.
int room;
int chapterover;
chapterover = 1;
healthstat =2;
spiritstat=2;
strengthstat=2;
dexteritystat=2;
healingpotion=1;
halfhealingpotion=1;
while (healingpotion ==1 || halfhealingpotion ==1)
{
cout<< "\n 1. Breathe Deep. \n 2. Do the exercise, but keep an eye open to make sure she doesn't pull anything.\n";
cin >> tutorialchoicefive;
while (tutorialchoicefive > 2 || tutorialchoicefive < 1)
{
cout << "Choose an option: ";
cin >> tutorialchoicefive;
}
switch (tutorialchoicefive)
{
case 1:
breathedeep (weapon, healthstat, spiritstat, strengthstat, dexteritystat, playerrace, healingpotion, lightningbottle, lockpick, inventorychoice, halfhealingpotion, north, east, up, room, spikedhorseshoes);
break;
case 2:
breathedeep (weapon, healthstat, spiritstat, strengthstat, dexteritystat, playerrace, healingpotion, lightningbottle, lockpick, inventorychoice, halfhealingpotion, north, east, up, room, spikedhorseshoes);
cout << "Your cracked eyelid lets you catch a glimpse of the mare sitting next to you... who does absolutely nothing. She sticks her tounge out when she sees you peeking.\n\n";
break;
}
cout<< "Outside the inventory function: \n";
cout << "healthstatr: " << healthstatr<<"\n";
cout << "healingpotionr: " << healingpotionr<<"\n";
cout << "halfhealingpotionr: "<< halfhealingpotionr<<"\n";
cout << "healthstat: " << healthstat<<"\n";
cout << "healingpotion: " << healingpotion<<"\n";
cout << "halfhealingpotion: "<< halfhealingpotion<<"\n";
}
cout << "The mare looks you over. \"Okay, it looks like you've healed up enough to walk. C'mon, there's some ponies that want to meet you. \n\n";
}