Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <windows.h>
- using namespace std;
- //funktion för text på dialog
- void txtDia(){
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_RED | FOREGROUND_GREEN);
- }
- //funktion för att återställa färg på text
- void* txtNorm(){
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
- }
- //Function for Highligting choices in colour
- void txtChoice(){
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_RED | FOREGROUND_BLUE);
- }
- //Function for txt magic
- void txtMagic(){
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_RED);
- }
- //Funktion för UI input
- void uiInput(){
- cout << "--> ";
- }
- //Klass för att skapa en karaktär, hålla koll på stats och inventory.
- class Hero{
- public:
- string name;
- int str;
- int dex;
- int inte;
- int gold;
- int sword;
- int knife;
- int magic;
- int health;
- //Hero (string _name, int _str, int _dex, int _inte, int _gold, int _sword, int _knife, int _magic);
- void createHero(string _name, int _str, int _dex, int _inte, int _gold, int _sword, int _knife, int _magic, int _health);
- void statsScr(string _name, int _str, int _dex, int _inte, int _gold, int _sword, int _knife, int _magic, int _health);
- };
- //Konstruktor till klassen Hero
- /*Hero::Hero(string _name, int _str, int _dex, int _inte, int _gold, int _sword, int _knife, int _magic){
- name = _name;
- str = _str;
- dex = _dex;
- inte = _inte;
- gold = _gold;
- sword = _sword;
- knife = _knife;
- magic = _magic;
- } */
- void Hero::createHero(string _name, int _str, int _dex, int _inte, int _gold, int _sword, int _knife, int _magic, int _health){
- cout << "Your goal is to survive one day in this crazy and messed up world.\n"
- "In order to survive you must know that every action has a consequence. Choose\nwisely who you are,"
- " your life depends on it...\n\n\n";
- cout << "Your name: "; cin >> _name;
- string choice1;
- string choice2;
- do{
- cout << "\nYour parents died a long time ago, they left you with a small hut\nin the poorer districts of the city, but they also left you something else.\n\n"
- "A) Your father, whom was a soldier, left you his "; txtChoice(); cout << "sword.\n\n"; txtNorm();
- cout << "B) Your mother was a fierce rogue while alive, she left you her beloved "; txtChoice(); cout << "dagger"; txtNorm(); cout << ".\n\n";
- cout << "C) Your parents were always poor while alive, but they managed to save up a\nsmall pile of "; txtChoice(); cout << "gold"; txtNorm(); cout << " for you.\n\n";
- cout << "D) A dusty"; txtChoice(); cout << " book"; txtNorm(); cout << " that your mother always hid away from your father.\n\n";
- uiInput(); cin >> choice1;
- if (choice1 == "sword" || choice1 == "Sword"){
- _sword = 1;
- _knife = 0;
- _str = 1;
- _health = 12;
- _dex = 0;
- _magic = 0;
- _gold = 7;
- _inte = 0;
- cout << "\n\nYour fathers sword is still sharp, but your arms are not used to the weight.\nIt will come of good use to you in the future";
- break;
- }
- else if (choice1 == "Dagger" || choice1 == "dagger"){
- _knife = 1;
- _sword = 0;
- _dex = 1;
- _health = 10;
- _str = 0;
- _inte = 0;
- _gold = 10;
- cout << "\n\nHer dagger has saved you more times than you can remember.\nThe poor district is a harsh place.";
- break;
- }
- else if (choice1 == "gold" || choice1 == "Gold"){
- _gold = 100;
- _health = 10;
- _sword = 0;
- _knife = 0;
- _inte = 0;
- _str = 0;
- _dex = 0;
- _magic = 0;
- cout << "\n\nAll that remains of the hefty sum they left you is only a hundred gold pieces,\nstill enough money for a years living";
- break;
- }
- else if (choice1 == "book" || choice1 == "Book"){
- _inte = 1;
- _magic = 1;
- _health = 8;
- _sword = 0;
- _knife = 0;
- _gold = 5;
- _dex = 0;
- _str = 0;
- cout << "\n\nWhile reading the book for the first time, you realise it's a book \nexplaining the principles and basics of blood magic.\n"
- "You're able to do some basic magic from the book, but the cost is always in\nblood. You only use your magic if your life depends on it.";
- break;
- }
- else {
- system ("cls");
- continue;
- }
- cout << endl << endl;
- }
- while(true);
- if (_gold < 100){
- do{
- cout << "\n\nAfter your parents death you had to make a living. It's not\n"
- "easy for a teenage boy to find his way in a world that\n"
- "has abondoned him. But you knew you had to push on, to keep\n"
- "being alive no matter what, even if you had to do nasty things.\n\n"
- "A) You managed to become an apprentice to the neighbouring "; txtChoice(); cout << "blacksmith."; txtNorm();
- cout << "\n\nB) You couldn't find any decent job, neither did you want too\n"
- "The streets offer plenty of money, if you have quick\n"
- "fingers."; txtChoice(); cout << " Pickpocketing"; txtNorm(); cout << " may not be a glamorous job\n"
- "but it kept you alive.\n\n";
- cout << "C) You were always drawn to books. When you started to\n"
- "hang out in the local "; txtChoice(); cout << "bookstore"; txtNorm(); cout << " more often then your own house\n"
- "you kind of melted into the position of helping the shopkeeper\n"
- "around the store; one day you just started to get paid.\n\n";
- uiInput(); cin >> choice2;
- if (choice2 == "blacksmith" || choice2 == "Blacksmith"){
- _str = _str + 2;
- _inte = _inte + 1;
- _dex = _dex + 1;
- _gold = _gold + 5;
- cout << "\nAfter working with the blacksmith for several months,\n
- "he died and left you unemployed yet again.\n"
- "You had become stronger under your apprenticeship, and learned\n"
- "a lot. The knowledge would be of great benefit for you.\n";
- break;
- }
- else if (choice2 == "pickpocketing" || choice2 == "Pickpocketing"){
- _dex = _dex + 2;
- _inte = _inte + 1;
- _gold = _gold + 3;
- cout << "\nRunning on the streets had hardened you.\n"
- "You became fast and nimble and knew every corner and street \n"
- "of the town, an invaluable knowledge\n";
- break;
- }
- else if (choice2 == "bookstore" || choice2 == "Bookstore"){
- _inte = _inte + 3;
- _gold = _gold +2;
- cout << "\nWhile working in the store you had a lot of\n"
- "free time, you spent it with reading every single tome\n"
- "that interested you. Your mind expanded greatly. Sadly\n"
- "Your employer recently died, and yet again you found yourself\n"
- "unemployed\n";
- break;
- }
- else {
- system ("cls");
- continue;
- }
- cout << endl << endl;
- }
- while(true);
- }
- else if (_gold > 20){
- cout << "\n\nWith the money you inherited from your parents you\n"
- "never had to get a job. you were still worried about the future thou.\n"
- "Soon your money would run out, and what would you then do?\n";
- }
- system ("PAUSE");
- name = _name;
- str = _str;
- dex = _dex;
- inte = _inte;
- gold = _gold;
- sword = _sword;
- knife = _knife;
- magic = _magic;
- health = _health;
- }
- void Hero::statsScr(string _name, int _str, int _dex, int _inte, int _gold, int _sword, int _knife, int _magic, int _health){
- cout << "_____________________________________\n"
- " \n"
- "Name: " << name << " \n"
- " \n"
- "Weapon: ";
- //För att kontrollera vilket vapen man har
- if ( knife > 0){
- cout << "Dagger \n";
- }
- else if (sword > 0 ){
- cout << "Sword \n";
- }
- else {
- cout << "No weapon \n";
- }
- // Kontrollerar vilken magi typ man använder.
- cout << "Magic: ";
- if (magic == 1){
- cout << "Blood Magic \n";
- }
- else {
- cout << "No magic \n";
- }
- // guld och health
- cout << endl << "Gold: " << gold << endl;
- cout << endl << "Health: " << health << endl;
- cout << "_____________________________________\n";
- }
- //Funktion för titlescreeen
- void titleScr(){
- cout << "Please extend the console window until it reaches a congenial size\n"
- "Choices in this game will be highlighted in"; txtChoice(); cout << " purple"; txtNorm(); cout << ".\nEnjoy:\n";
- system ("PAUSE");
- system ("cls");
- cout <<"___________________¶¶¶¶ \n"
- "_______________¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶ \n"
- "___________¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_¶¶¶ \n"
- "_________¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n"
- "_______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n"
- "______¶¶¶¶¶¶¶¶_______¶¶¶¶¶¶¶¶¶___¶¶¶¶\n"
- "_____¶¶¶¶¶¶¶______________________¶¶\n"
- "_____¶¶¶¶¶¶___¶¶¶¶¶________________¶\n"
- "____¶¶¶¶¶¶___¶¶¶1¶¶¶\n"
- "____¶¶¶¶¶¶___¶¶111¶¶\n"
- "____¶¶¶¶¶¶___¶¶¶1¶¶¶\n"
- "____¶¶¶¶¶¶____¶¶1¶¶\n"
- "_____¶¶¶¶¶¶___¶¶1¶¶\n"
- "_____¶¶¶¶¶¶¶¶_¶¶¶¶¶\n"
- "______¶¶¶¶¶¶¶¶¶¶¶¶¶\n"
- "_______¶¶¶¶¶¶¶¶¶¶¶¶¶\n"
- "_________¶¶¶¶¶¶¶¶¶¶¶¶\n"
- "______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n"
- "__¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n"
- "____¶¶¶¶11111111111111111¶¶¶¶¶\n"
- "_______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n"
- "______________¶¶_1_¶¶¶¶¶¶¶¶¶\n"
- "______________¶¶_1_¶¶¶¶¶¶¶¶¶¶\n"
- "______________¶¶_1_¶¶__¶¶¶¶¶¶\n"
- "______________¶¶_1_¶¶___¶¶¶¶¶¶\n"
- "______________¶¶_1_¶¶___¶¶¶¶¶¶\n"
- "______________¶¶_1_¶¶___¶¶¶¶¶¶\n"
- "______________¶¶_1_¶¶___¶¶¶¶¶\n"
- "______________¶¶_1_¶¶__¶¶¶¶¶¶\n"
- "______________¶¶_1_¶¶¶¶¶¶¶¶¶\n"
- "______________¶¶¶¶¶¶¶¶¶¶¶¶¶\n"
- "______________¶¶¶¶¶¶¶¶¶¶¶\n"
- "_____________¶¶¶¶¶¶¶¶¶¶\n"
- "____________¶¶¶¶¶¶¶¶¶\n"
- "___________¶¶¶¶¶¶¶_¶¶\n"
- "__________¶¶¶¶¶¶_1_¶¶\n"
- "__________¶¶¶¶¶¶_1_¶¶\n"
- "__________¶¶¶¶¶¶_1_¶¶\n"
- "__________¶¶¶¶¶¶_1_¶¶\n"
- "__________¶¶¶¶¶¶_1_¶¶\n"
- "___________¶¶¶¶¶_1_¶¶\n"
- "____________¶¶¶¶_1_¶¶\n"
- "______________¶¶_1_¶¶¶¶¶¶\n"
- "______________¶¶_1_¶¶¶¶¶¶¶¶\n"
- "______________¶¶_1_¶¶¶¶¶¶¶¶¶\n"
- "______________¶¶_1_¶¶¶_¶¶¶¶¶\n"
- "______________¶¶_1_¶¶__¶¶¶¶¶\n"
- "______________¶¶___¶¶¶¶¶¶¶¶¶\n"
- "______________¶¶___¶¶¶¶¶¶¶¶\n"
- "______________¶¶¶¶¶¶¶¶¶¶¶\n"
- "______________¶¶¶¶¶¶¶¶¶\n"
- "_____________¶¶¶¶¶¶¶¶¶\n"
- "____________¶¶¶¶¶¶¶¶¶\n"
- "___________¶¶¶¶¶___¶¶\n"
- "___________¶¶¶¶¶___¶¶\n"
- "___________¶¶¶¶¶___¶¶\n"
- "____________¶¶¶¶___¶¶\n"
- "____________¶¶¶¶___¶¶\n"
- "______________¶¶___¶¶¶¶¶¶\n"
- "______________¶¶___¶¶¶¶¶¶¶\n"
- "______________¶¶___¶¶_¶¶¶¶¶\n"
- "______________¶¶___¶¶___¶¶¶¶\n"
- "_______________¶¶_¶¶_____¶¶¶\n"
- "________________¶¶¶______¶¶¶\n"
- "_________________¶_______¶¶\n"
- " _ \n "
- "___ _ _ _ __ __ __ (_) __ __ ___ \n"
- "/ __| | | | | | '__| \\ \\ / / | | \\ \\ / / / _ \\ \n"
- "\\__ \\ | |_| | | | \\ V / | | \\ V / | __/ \n"
- "|___/ \\__,_| |_| \\_/ |_| \\_/ \\___| \n";
- system ("PAUSE");
- system ("cls");
- }
- //Function for death
- void deathScr(){
- system("cls");
- cout <<
- "------------------------------¦¦¦--------\n"
- "---------------------------¦¦¦¦¦¦¦¦------\n"
- "--------------------------¦¦¦¦¦¦¦¦¦¦-----\n"
- "-------------------------¦¦¦¦¦¦¦¦¦¦¦¦----\n"
- "-------------------------¦¦¦¦¦¦¦¦¦¦¦¦----\n"
- "------------------------¦¦¦¦¦¦¦¦¦¦¦¦¦----\n"
- "------------------------¦¦¦¦¦¦¦¦¦¦¦¦¦¦---\n"
- "-----------------------¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦---\n"
- "-----------------------¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦---\n"
- "-----------------------¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦---\n"
- "-----------------------¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
- "----------------------¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
- "-----------------------¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
- "-----------------------¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
- "-----------------------¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
- "-----------------------¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
- "----------¦¦¦---¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
- "---------¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
- "----------¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
- "----------¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
- "--------¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
- "--------¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
- "--------¦¦¦¦¦¦¦¦¦¦¦----¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
- "--------¦¦¦¦¦¦¦¦¦¦¦-----¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
- "-------¦¦¦¦¦¦¦¦¦¦¦¦¦----¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
- "-------¦¦¦¦¦¦¦¦¦¦¦¦¦----¦¦¦¦¦¦¦¦¦¦¦¦¦¦---\n"
- "------¦¦¦¦¦¦¦¦¦¦¦¦¦-----¦¦¦¦¦¦¦¦¦¦¦¦¦¦---\n"
- "-----¦¦¦¦¦¦¦¦¦¦¦--------¦¦¦¦¦¦¦¦¦¦¦¦¦¦---\n"
- "----¦¦¦¦¦¦¦¦¦¦¦¦---------¦¦¦¦¦¦¦¦¦¦¦¦¦---\n"
- "---¦¦¦¦¦¦¦¦¦¦¦¦¦---------¦¦¦¦¦¦¦¦¦¦¦¦¦---\n"
- "---¦¦¦¦¦¦¦¦¦¦¦¦¦----------¦¦¦¦¦¦¦¦¦¦¦¦---\n"
- "--¦¦¦¦¦¦¦¦¦¦¦¦¦¦----------¦¦¦¦¦¦¦¦¦¦¦----\n"
- "-¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦----------¦¦¦¦¦¦¦¦¦¦¦----\n"
- "-¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦----------¦¦¦¦¦¦¦¦¦¦¦----\n"
- "¦¦¦¦¦¦¦¦--¦¦¦¦¦¦----------¦¦¦¦¦¦¦¦¦¦-----\n"
- "¦¦¦¦¦¦¦¦--¦¦¦¦¦¦---------¦¦¦¦¦¦¦¦¦¦¦-----\n"
- "¦¦¦¦¦¦¦¦-----------------¦¦¦¦¦¦¦¦¦¦¦-----\n"
- "¦¦¦¦¦¦¦¦----------------¦¦¦¦¦¦¦¦¦¦¦¦¦----\n"
- "¦¦¦¦¦¦¦¦---------¦¦¦--¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦----\n"
- "¦¦¦¦¦¦¦-----¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦---\n"
- "¦¦¦¦¦¦¦----¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦--\n"
- "¦¦¦¦¦¦¦----¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦\n"
- "¦¦¦¦¦¦¦----¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦\n"
- "¦¦¦¦¦¦-----¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦\n"
- "¦¦¦¦¦¦----¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦\n"
- "¦¦¦¦¦¦---¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦\n"
- "¦¦¦¦¦¦---¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦\n"
- "¦¦¦¦¦--¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦\n"
- "¦¦¦¦¦-¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦\n"
- "¦¦¦¦¦-¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦\n"
- "¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦\n"
- "¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦\n"
- "¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦\n";
- cout <<
- " ____ ___ \n"
- " / ___| __ _ _ __ ___ ___ / _ \\ __ __ ___ _ __ \n"
- "| | _ / _` | | '_ ` _ \\ / _ \\ | | | | \\ \\ / / / _ \\ | '__|\n"
- "| |_| | | (_| | | | | | | | | __/ | |_| | \\ V / | __/ | | \n"
- " \\____| \\__,_| |_| |_| |_| \\___| \\___/ \\_/ \\___| |_| \n\n\n";
- system("PAUSE");
- }
- //if you decide to attack the bandits in your hut.
- void attackBandit(Hero& myHero, bool &banditsDead){
- //if you want to kill the bandits or not.
- string choice2;
- //Om du attackerar utan vapen
- if (myHero.sword == 0 && myHero.knife == 0){
- cout << "As you rush forward to attack the bandits you realise you don't\n"
- "have any weapon to attack them with. The fight ends quickly with you\n"
- "lying in a pool of blood\n";
- system("PAUSE");
- deathScr();
- }
- //om du attackerar med svärd
- if (myHero.sword == 1){
- myHero.health = myHero.health - 2;
- cout << "\n\nYou always sleep with your fathers sword close by the bed\n"
- "A habit that has kept you alive through the years. You quickly pick it\n"
- "up and charge the bandits. You suprised them by acting so quickly and \n"
- "before they realise what's happened, you draw your bloody sword out of\n"
- "one of the bandits and slashes toward the second one. He blocks your slash\n"
- "and slashes back with his dagger, it scratches you in the arm.\n"
- "You begin circling eachother in the small hut, feeling the eachother out.\n"
- "You make a quick attack, and manages to disarm your oppenent.\n"
- "One of the bandits are lying on the floor, while bleeding a lot, he's not\n"
- "dead. The other bandit stands in front of you, disarmed, with his hands above\n"
- "his head asking for mercy.\n\n"
- "A) "; txtChoice(); cout <<"Kill"; txtNorm(); cout << " them both\n\n"
- "B) Show them "; txtChoice(); cout << "mercy\n\n"; txtNorm();
- uiInput(); cin >> choice2;
- if (choice2 == "Kill" || choice2 == "kill"){
- banditsDead = true;
- cout << "\n\nYou don't hesitate, with a tight grip on your sword you thrust it\n"
- "into the heart of the unarmed bandit. You stride over to the bandit lying\n"
- "on your floor, bleeding to death, and kill him.\n"
- "In this world there's only survival, it was either you or them.\n"
- "Or that is what you keep telling yourself...\n";
- }
- else if (choice2 == "mercy" || choice2 == "mercy"){
- cout << "\n\nYou tell the unarmed bandit to grab his friend and get lost.\n"
- "you're just hoping they won't seek revenge\n";
- }
- }
- //om du attackerar med kniv
- else if (myHero.knife == 1){
- myHero.health = myHero.health - 2;
- cout << "\n\nWith your mothers dagger stuffed in your pants behind\n"
- "your back, you slowly walks up towards the bandits with your hands\n"
- "above your head. They tell you to back off, but you don't listen.\n"
- "When in an arms length from a bandit your nimbled fingers quickly \n"
- "draws your dagger and slashes towards the closest bandit.\n"
- "You feel the warmth of the blood that get's sprayed in your face.\n"
- "You feel something slashing at your leg."
- "You rush over to the other bandit before he realise what has happened.\n"
- "You put your dagger to the bandits throat and tells him to drop his weapon\n\n"
- "One bandit is lying on the floor, slowly bleeding to death, the other one is\n"
- "standing on his knees with your dagger at his throat, asking for mercy\n\n"
- "A) "; txtChoice(); cout <<"Kill"; txtNorm(); cout << " them both\n\n"
- "B) Show them "; txtChoice(); cout << "mercy\n\n"; txtNorm();
- uiInput(); cin >> choice2;
- if (choice2 == "Kill" || choice2 == "kill"){
- banditsDead = true;
- cout << "\n\nYou slit the bandit's throat. His lifeless body falls to the floor.\n"
- "The bleeding bandit is struggling to stay conscious and you can see the fear\n"
- "that spreads ovr his face as you step closer. You thrust your dagger through his\n"
- "heart.\n"
- "This is a harsh world, you either kill or get killed. Or that's what you keep\n"
- "telling yourself.\n\n";
- }
- if (choice2 == "mercy" || choice2 == "Mercy"){
- cout << "You release your dagger and tell's the pleading bandit to\n"
- "get his friend out of here.\n"
- "You spared their life, but you keep wondering if they will come back\n";
- }
- }
- }
- //if you decide to give the bandits your gold
- void giveBandit(Hero &myHero, string &choice2){
- if (choice2 == "give" || choice2 == "Give"){
- cout << "You decide to give them all of your gold in hope of them to leave\n"
- "you alone.\n\n";
- if (myHero.gold > 50){
- cout << "\nAs you heave out all of you spare gold, you see how\n"
- "big the bandits eyes become.\n";
- txtDia(); cout << "\"Look Doug...Look at all that gold. HOLY GODS OF ABOVE! We're\n"
- "about to get rich!"; txtNorm(); cout << "They look at eachother for a short while, then they get an\n"
- "evil grim on their faces.\n";
- txtDia(); cout << "\"If words gets to the boss that you had this AMOUNT of gold, we won't\n"
- "be able to keep our rightfull part for our own.\" \n"; txtNorm();
- cout << "They quickly rush up towards you and grabs your arm and shoves you down on the\n"
- "floor. You feel coold steel against your throat, then everything turns black as\n"
- "your slowly bleeds to death.\n\n";
- system("PAUSE");
- deathScr();
- }
- if (myHero.gold < 50){
- cout << "\nThe poor amount of gold you give the bandits doesn't impress them.\n";
- txtDia(); cout << "\"Looks like we neeed to do another run before we can return to the boss.\" \n"; txtNorm();
- cout << "They grab your gold and leaves through your broken front door\n\n";
- myHero.gold = 0;
- }
- }
- if (choice2 == "half" || choice2 == "Half"){
- cout << "\nYou try too fool the bandits by giving them half of your gold.";
- if (myHero.dex > 2 && myHero.inte >= 1){
- cout << "\n\nyou manage too fool the bandits. They take your gold and leave through \n"
- "your broken front door.";
- myHero.gold = myHero.gold / 2;
- }
- else {
- cout << "\n\nYou try to fool the bandits, but they notice your trickery.\n"
- "They beat the shit out of you and grabs all of your money. Then they leave\n"
- "through your broken front door, laughing, leaving you in a\n"
- "pile of blood\n";
- myHero.gold = 0;
- myHero.health = myHero.health - 7;
- }
- }
- }
- //If tou decide to use magic against the invading Bandits
- void magicBandit (Hero& myHero, bool &banditsDead){
- string choice2;
- do{
- cout << "You see the drawn daggers and decide this is no time to joke around\n"
- "You know the danger of using magic, but the words from your mothers\n"
- "tome recites themselves in your head\n\n"
- "A) You aim for "; txtChoice(); cout << "killing"; txtNorm(); cout << " both of them.\n\n"
- "B) Even thou you could kill them easily, you decide to show them "; txtChoice(); cout << "mercy\n\n"; txtNorm();
- uiInput(); cin >> choice2;
- if (choice2 == "killing" || choice2 == "Killing"){
- cout << "\n\nAs you chant the words for the right spell you make a small\n"
- "cut in your wrist, the magic demands blood to work properly.\n";
- txtMagic(); cout << "\"DEVAR EL INSHAM!\" "; txtNorm(); cout << "The magic fills your body and mind, it's\n"
- "the best feeling you could ever imagine, but at the same time you\n"
- "feel your body get's weakend and hurt. It's an expensive trick.\n"
- "The bandit's drop their daggers and falls down to their knees. Blood is pouring\n"
- "from their ears, eyes, nose and mouth. Their expression tells you they want\n"
- "to scream. But you know it's impossible for them, they can't move, speak\n"
- "or do anything except to feel pain while they're dying in what they will\n"
- "experience as an eternity.\n\n";
- myHero.health = myHero.health - 2;
- banditsDead = true;
- break;
- }
- else if (choice2 == "mercy" || choice2 == "Mercy"){
- cout << "\n\nYou know how dangerous it is to show people magic and let them\n"
- "live to tell it. You had thought many times magic was the real reason\n"
- "to your parents death. Magic was all but common in this world. Before\n"
- "you found the tome of Blood magic, you didn't even know it existed\n"
- "and you suspected just a handfull of person knew about its existence.\n"
- "But these bandits, even thou they are bandits don't deserve to die such\n"
- "a cruel death. Blood magic is no joke.\n\n"
- "You make a small cut in your wrist while chanting the words.\n";
- txtMagic(); cout << "\"INOM ELS TEL.\" "; txtNorm(); cout << "You can feel the magic enter your mind and body\n"
- "It's the best feeling you can ever imagine, but at the same time you can feel\n"
- "your body and soul get torned by it. The magic almost works against you, it\n"
- "always does when you're not aiming for killing. But manage to controll it.\n"
- "And you force the bandits to move by themselves and leave your house,\n"
- "leaving the daggers behind ofcourse. You might have spared their life.\n"
- "But for which price...?\n";
- myHero.health = myHero.health - 3;
- break;
- }
- else{
- system ("cls");
- myHero.statsScr(myHero.name, myHero.str, myHero.dex, myHero.inte, myHero.gold, myHero.sword, myHero.knife, myHero.magic, myHero.health);
- continue;
- }
- }
- while (true);
- }
- //första delen i spelet.
- void chap1(Hero& myHero, bool &banditsDead){
- system ("cls");
- myHero.statsScr(myHero.name, myHero.str, myHero.dex, myHero.inte, myHero.gold, myHero.sword, myHero.knife, myHero.magic, myHero.health);
- string choice1;
- string choice2;
- //from flee option
- string choice3;
- cout << "\n\nYou're lying in your bed, dreaming of another life. A life without poverty\n"
- "Even before your parents died, life was harsh. As long as you could remember\n"
- "Temolia had always been a cruel city to live in, but when your parents where\n"
- "still alive they told you about how it used to be. What seemed like distant\n"
- "tales from now, tales about a prosperous small town, with an excellent harbor\n"
- "and economy, getting a work would be no problem for almost anyone. But as the \n"
- "war with the neighbouring countries went on, Temolia quickly became\n"
- "overpopulated. And when the capital was destroyed, rulers decided to make\n"
- "Temolia the new capital and move their basis of operation there, things just\n"
- "got worse. The city was being expanded in a quick rate, which resulted in\n"
- "sloppy work. Nowadays it wasn't unusual for buildings in the poorer district\n"
- "to fall in. The city were still being expanded. but only mansions and buildings\n"
- "for the rich was being manufactured. The war was over, but no one could really\n"
- "tell who won and who lost the war. Temolia was untouched by the battles of the\n"
- "war, but the whole as an empire was fundamentally shaken the the bones, the \n"
- "economy collapsed and the remaining politicians greedily tried to clutch on\n"
- "the last remaining resources for their own use.\n\n";
- do{
- txtDia(); cout << "\"There has to be at least something of value in here\"\n";
- txtNorm(); cout << "The voice followed by the sound of something breaking woke you\n"
- "up from your ill dreams. Your small hut consists of only one room,\n"
- "small and coozy as you liked to describe it. As two men enters through your\n"
- "front door, you quickly gets out of your bed. The men have daggers drawn.\n"
- "You decide too: \n\n"
- "A) "; txtChoice(); cout << "Attack"; txtNorm(); cout << " them.\n\n"
- "B) "; txtChoice(); cout << "Ask"; txtNorm(); cout << " them what they want.\n\n"
- "C) "; txtChoice(); cout << "Flee"; txtNorm(); cout << " through the backdoor\n\n";
- if (myHero.magic == 1){
- cout << "D) "; txtChoice(); cout << "Magic\n\n"; txtNorm();
- }
- uiInput(); cin >> choice1;
- if (choice1 == "Attack" || choice1 == "attack" || choice1 == "A" || choice1 == "a"){
- attackBandit(myHero, banditsDead);
- break;
- }
- else if (choice1 == "ask" || choice1 == "Ask" || choice1 == "B" || choice1 == "b"){
- txtDia(); cout << "\n\n \"Isn't that obvious? Are you stupid or something? We want your\n"
- "valuables!\" "; txtNorm(); cout << "One of the bandits said in a mocking voice.\n\n"
- "A) "; txtChoice(); cout << "Attack"; txtNorm(); cout << " them!\n\n"
- "B) "; txtChoice(); cout << "Flee"; txtNorm(); cout << " through the backdoor\n\n"
- "C) "; txtChoice(); cout << "Give"; txtNorm(); cout << " them all of your gold\n\n"
- "D) Give them "; txtChoice(); cout << "half"; txtNorm(); cout << " of your gold\n\n";
- if (myHero.magic == 1){
- cout << "E) "; txtChoice(); cout << "Magic\n"; txtNorm();
- }
- uiInput(); cin >> choice2;
- if (choice2 == "Attack" || choice2 == "attack" || choice2 == "A" || choice2 == "a"){
- attackBandit(myHero, banditsDead);
- break;
- }
- /*if (choice2 == "Flee" || choice2 == "flee" || choice2 == "B" || choice2 == "b"){
- fleeBandit();
- }*/
- if (choice2 == "Give" || choice2 == "give" || choice2 == "half" || choice2 == "Half" || choice2 == "C" || choice2 == "c" || choice2 == "D" || choice2 == "d"){
- giveBandit (myHero, choice2);
- break;
- }
- if (choice2 == "Magic" || choice2 == "magic" || choice2 == "E" || choice2 == "e"){
- magicBandit(myHero, banditDead);
- break;
- }
- else {
- system("cls");
- continue;
- }
- }
- if (choice1 == "flee" || choice1 == "Flee" || choice1 == "C" || choice1 == "c"){
- break;
- }
- if (choice1 == "magic" || choice1 == "Magic" || choice1 == "D" || choice1 == "d"){
- magicBandit(myHero, banditsDead);
- break;
- }
- else{
- system ("cls");
- myHero.statsScr(myHero.name, myHero.str, myHero.dex, myHero.inte, myHero.gold, myHero.sword, myHero.knife, myHero.magic, myHero.health);
- continue;
- }
- }
- while (true);
- }
- int main() {
- titleScr();
- //kontrollerar om man dödade banditerna i chap 1 eller inte.
- bool banditsDead = false;
- //Skapa ett objekt av klassen Hero
- Hero myHero;
- //Här skapar man sin karaktär.
- myHero.createHero(myHero.name, myHero.str, myHero.dex, myHero.inte, myHero.gold, myHero.sword, myHero.knife, myHero.magic, myHero.health);
- //Spelets egentliga början efter att man skapat sin karaktär.
- chap1(myHero, banditsDead);
- system ("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement