Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <iostream>
- #include <stdlib.h>
- #include <windows.h>
- #include <cstdlib>
- #include <fstream>
- #include <string>
- #include <MMSystem.h>
- using namespace std;
- int main()
- {
- string name, respond, zero, one, two, three, four, five, six, seven;
- int hp, hpmax, atk1, atk2, shiphp, shiphpmax, shipatk1, shipatk2, cb1, cb2, sloopcb1, sloopcb2, sloophp, sloopatk1, sloopatk2, sloophpmax, tshp, tshpmax, tscb1, tscb2, tsatk1, tsatk2, carvelhp, carvelhpmax, carvelcb1, carvelcb2, carvelatk1, carvelatk2;
- int sloop, galleon;
- int holder1, holder2, holder3, holder4, holder5, holder6, holder7, random, doubloons;
- int bucatk1, bucatk2, buchp, buchpmax, cutatk1, cutatk2, cuthp, cuthpmax;
- int eng, fren, dut, span, pr, nev;
- zero = "0";
- one = "1";
- two = "2";
- three = "3";
- four = "4";
- five = "5";
- six = "6";
- seven = "7";
- doubloons = 1000;
- eng = 0;
- fren = 0;
- dut = 0;
- span = 0;
- nev = 0;
- pr = 0;
- galleon = 0;
- sloop = 1;
- atk1 = 10;
- atk2 = 20;
- hp = 100;
- hpmax = 100;
- shiphp = 550;
- shiphpmax = 550;
- cb1 = 0;
- cb2 = 12;
- shipatk1 = 6;
- shipatk2 = 25;
- sloophp = 500;
- sloophpmax = 500;
- sloopcb1 = 0;
- sloopcb2 = 12;
- sloopatk1 = 6;
- sloopatk2 = 15;
- tshp = 2875;
- tshpmax = 2875;
- tscb1 = 0;
- tscb2 = 56;
- tsatk1 = 6;
- tsatk2 = 37;
- carvelhp = 900;
- carvelhpmax = 900;
- carvelcb1 = 0;
- carvelcb2 = 20;
- carvelatk1 = 9;
- carvelatk2 = 27;
- bucatk1 = 10;
- bucatk2 = 20;
- buchp = 100;
- buchpmax = 100;
- cutatk1 = 10;
- cutatk2 = 20;
- cuthp = 100;
- cuthpmax = 100;
- cout << "\n\n Welcome swashbuckler!\n\n ";
- cout << "(1) Start New Game\n\n (2) Load Game\n\n ";
- cin >> respond;
- if (respond.compare(one) == 0)
- {
- goto game;
- }
- if (respond.compare(two) == 0)
- {
- goto load;
- }
- game:
- {
- system("cls");
- cout << "\n\n To Start Off, Give Me Your Name and Head to Port Royal Over There\n\n ";
- cout << "Name: "; cin >> name;
- }
- portroyal:
- {
- system("cls");
- pr += 1;
- cout << "\n\n Welcome to Port Royal\n\n (1) Ship Wright\n\n (2) Explore By Sea\n\n (3) Explore By Land\n\n (4) Locations\n\n (5) Stats\n\n (6) Rest\n\n (7) Save\n\n\n Doubloons: " << doubloons <<"\n\n ";
- cin >> respond;
- if (respond.compare(one) == 0)
- {
- goto shipwright;
- }
- if (respond.compare(two) == 0)
- {
- goto exploresea;
- }
- if (respond.compare(three) == 0)
- {
- goto exploreland;
- }
- if (respond.compare(four) == 0)
- {
- goto locations;
- }
- if (respond.compare(five) == 0)
- {
- goto stats;
- }
- if (respond.compare(six) == 0)
- {
- goto rest;
- }
- if (respond.compare(seven) == 0)
- {
- goto save;
- }
- else;
- goto portroyal;
- }
- shipwright:
- {
- system("cls");
- holder1 = shiphpmax - shiphp;
- holder2 = 2;
- holder3 = holder1 * holder2;
- cout << "\n\n We fix your ships and upgrade 'em too.\n\n Ship Health: " << shiphp << "/" << shiphpmax << "\n\n (1) Repair Your Ship. Price: " << holder3 << "\n\n (2) Buy New Ship\n\n (3) Sell Your Ship\n\n (0) Go Back To Town\n\n ";
- cin >> respond;
- if (respond.compare(zero) == 0)
- {
- goto portroyal;
- }
- if (respond.compare(one) == 0 && doubloons < holder3)
- {
- system("cls");
- cout << "\n\n You Don't Have Enough Doubloons!\n\n ";
- system("pause");
- goto shipwright;
- }
- if (respond.compare(one) == 0 && doubloons >= holder3)
- {
- doubloons -= holder3;
- shiphp = shiphpmax;
- goto shipwright;
- }
- if (respond.compare(two) == 0)
- {
- goto buyship;
- }
- if (respond.compare(three) == 0)
- {
- goto sellship;
- }
- else;
- goto shipwright;
- }
- buyship:
- {
- system ("cls");
- cout << "\n\n Buy A New Ship!\n\n (1) Sloop: 5,000 Doubloons\n\n (2) Galleon: 10,000 Doubloons\n\n (0) Go Back To Town\n\n ";
- cin >> respond;
- if (respond.compare(one) == 0 && sloop == 1 || galleon == 1)
- {
- system("cls");
- cout << "\n\n You Must Sell Your Ship In Order To Get A New Ship!\n\n ";
- system("pause");
- goto shipwright;
- }
- if (respond.compare(one) == 0 && sloop == 0 && galleon == 0 && doubloons <= 4999)
- {
- system("cls");
- cout << "\n\n You Do Not Have Enough Doubloons For A Sloop!\n\n ";
- system("pause");
- goto shipwright;
- }
- if (respond.compare(one) == 0 && sloop == 0 && galleon == 0 && doubloons >= 5000)
- {
- system("cls");
- cout << "\n\n You Have Bought A Sloop!\n\n ";
- doubloons -= 5000;
- sloop = 1;
- shiphp = 500;
- shiphpmax = 550;
- cb1 = 0;
- cb2 = 12;
- shipatk1 = 6;
- shipatk2 = 25;
- system("pause");
- goto shipwright;
- }
- if (respond.compare(two) == 0 && sloop == 1 || galleon == 1)
- {
- system("cls");
- cout << "\n\n You Must Sell Your Ship In Order To Get A New Ship!\n\n ";
- system("pause");
- goto shipwright;
- }
- if (respond.compare(two) == 0 && sloop == 0 && galleon == 0 && doubloons <= 9999)
- {
- system("cls");
- cout << "\n\n You Do Not Have Enough Doubloons For A Galleon!\n\n ";
- system("pause");
- goto shipwright;
- }
- if (respond.compare(two) == 0 && sloop == 0 && galleon == 0 && doubloons >= 10000)
- {
- system("cls");
- cout << "\n\n You Have Bought A Galleon!\n\n ";
- doubloons -= 10000;
- galleon = 1;
- shiphp = 1500;
- shiphpmax = 1500;
- cb1 = 0;
- cb2 = 37;
- shipatk1 = 12;
- shipatk2 = 34;
- system("pause");
- goto shipwright;
- }
- if (respond.compare(zero) == 0)
- {
- goto locations;
- }
- else;
- goto shipwright;
- }
- sellship:
- {
- system("cls");
- cout << "\n\n Sell Your Current Ship For Doubloons!\n\n (1) Sloop For 1000 Doubloons\n\n (2) Galleon For 3000 Doubloons\n\n ";
- cin >> respond;
- if (respond.compare(one) == 0 && sloop == 0)
- {
- system("cls");
- cout << "\n\n You Dont Have A Ship To Sell!\n\n ";
- system("pause");
- goto shipwright;
- }
- if (respond.compare(one) == 0 && sloop == 1)
- {
- system("cls");
- cout << "\n\n You Have Sold Your Sloop And Gained 1,000 Doubloons\n\n ";
- sloop = 0;
- doubloons += 1000;
- shiphp = 0;
- shiphpmax = 0;
- cb1 = 0;
- cb2 = 0;
- shipatk1 = 0;
- shipatk2 = 0;
- system("pause");
- goto shipwright;
- }
- if (respond.compare(two) == 0 && galleon == 0)
- {
- system("cls");
- cout << "\n\n You Dont Have A Ship To Sell!\n\n ";
- system("pause");
- goto shipwright;
- }
- if (respond.compare(one) == 0 && galleon == 1)
- {
- system("cls");
- cout << "\n\n You Have Sold Your Galleon And Gained 10,000 Doubloons\n\n ";
- galleon = 0;
- doubloons += 10000;
- shiphp = 0;
- shiphpmax = 0;
- cb1 = 0;
- cb2 = 0;
- shipatk1 = 0;
- shipatk2 = 0;
- system("pause");
- goto shipwright;
- }
- else;
- goto sellship;
- }
- exploresea:
- {
- random = rand()% 50+1;
- if (random <= 10)
- {
- goto sloop;
- }
- if (random <= 20 && random >= 10)
- {
- goto ts;
- }
- if (random <= 23 && random >= 20)
- {
- system("cls");
- cout << "\n\n " << name << " Finds A Wrecked Ship And Explores It\n\n ";
- system("pause");
- goto wreckedship;
- }
- if (random <= 33 && random >= 23)
- {
- goto carvel;
- }
- if (random <= 35 && random >= 33)
- {
- goto town;
- }
- if (random >= 35)
- {
- system("cls");
- cout << "\n\n You Found Nothing!\n\n (1) Go Head To Port\n\n (2) Keep Exploring\n\n ";
- cin >> respond;
- if (respond.compare(one) == 0)
- {
- goto locations;
- }
- if (respond.compare(two) == 0)
- {
- goto exploresea;
- }
- }
- else;
- goto exploresea;
- }
- exploreland:
- {
- random = rand()% 50+1;
- if (random <= 10)
- {
- system("cls");
- cout << "\n\n You Have Encountered A Cut Throat!\n\n (1) Draw Your Sword!\n\n (2) Run Like Hell!\n\n ";
- cin >> respond;
- if (respond.compare(one) == 0)
- {
- goto cutthroat;
- }
- if (respond.compare(two) == 0)
- {
- goto locations;
- }
- }
- if (random <= 20 && random >= 10)
- {
- system("cls");
- cout << "\n\n You Have Encountered A Buccaneer!\n\n (1) Draw Your Sword!\n\n (2) Run Like Hell!\n\n ";
- cin >> respond;
- if (respond.compare(one) == 0)
- {
- goto buccaneer;
- }
- if (respond.compare(two) == 0)
- {
- goto locations;
- }
- }
- if (random <= 23 && random >= 20)
- {
- holder1 = 500;
- holder2 = 3500;
- holder3 = rand()% (holder2-holder1)+holder1;
- cout << "\n\n You Found Buried Treasure!\n\n In It Is " << holder3 << " Doubloons\n\n ";
- doubloons += holder3;
- }
- if (random >= 23)
- {
- system("cls");
- cout << "\n\n You Found Nothing!\n\n (1) Go Head To Town\n\n (2) Keep Exploring\n\n ";
- cin >> respond;
- if (respond.compare(one) == 0)
- {
- goto locations;
- }
- }
- if (respond.compare(two) == 0)
- {
- goto exploreland;
- }
- else;
- goto exploreland;
- }
- locations:
- {
- system("cls");
- cout << "\n\n Known locations ";
- cout << "\n\n (1) Port Royal\n\n";
- if (nev == 1)
- {
- cout << " (2) Nevis\n\n";
- }
- cin >> respond;
- if (respond.compare(two) == 0 && nev == 1)
- {
- goto nevis;
- }
- if (respond.compare(one) == 0)
- {
- goto portroyal;
- }
- else
- goto portroyal;
- }
- town:
- {
- system("cls");
- cout << "\n\n " << name << "'s Crew Spots A Distant Town\n\n (1) Explore\n\n (2) Sail Away\n\n ";
- cin >> respond;
- if (respond.compare(two) == 0)
- {
- goto locations;
- }
- if (respond.compare(one) == 0)
- {
- goto nevis;
- }
- }
- nevis:
- {
- system("cls");
- cout << "\n\n Welcome to Nevis!\n\n (1) Ship Wright\n\n (2) Explore By Sea\n\n (3) Explore By Land\n\n (4) Locations\n\n (5) Stats\n\n (6) Rest\n\n\n Doubloons: " << doubloons <<"\n\n ";
- if (nev == 0)
- {
- nev = 1;
- }
- cin >> respond;
- if (respond.compare(one) == 0)
- {
- goto shipwright;
- }
- if (respond.compare(two) == 0)
- {
- goto exploresea;
- }
- if (respond.compare(three) == 0)
- {
- goto exploreland;
- }
- if (respond.compare(four) == 0)
- {
- goto locations;
- }
- if (respond.compare(five) == 0)
- {
- goto stats;
- }
- if (respond.compare(six) == 0)
- {
- goto rest;
- }
- else;
- goto portroyal;
- }
- stats:
- {
- system("cls");
- cout << "\n\n " << name << "'s Stats:\n\n Health: " << hp << "/" << hpmax<< "\n\n Damage: " << atk1 << "-" << atk2 << "\n\n\n " << name << "'s Ship Stats:\n\n Cannons: " << cb2 << "\n\n Damage: " << shipatk1 << "-" << shipatk2 << "\n\n ";
- system("pause");
- goto portroyal;
- }
- rest:
- {
- system("cls");
- cout << "\n\n " << name << " Goes To Sleep And Their Health Is Restored\n\n ";
- hp = hpmax;
- system("pause");
- goto locations;
- }
- save:
- {
- system("cls");
- ofstream dataFile;
- dataFile.open("data.txt");
- dataFile << name << endl;
- dataFile.close();
- cout << "\n" << name << "'s Game Saved\n\n";
- system("pause");
- goto portroyal;
- }
- load:
- {
- system("cls");
- ifstream dataFile;
- dataFile.open("data.txt");
- dataFile >> name;
- dataFile.close();
- cout << "\n" << name << "'s Game Loaded\n\n";
- system("pause");
- goto portroyal;
- }
- sloop:
- {
- system("cls");
- cout << "\n\n Sloop's Current State: Attack: " << sloopatk1 << "-" << sloopatk2 << ", HP: " << sloophp << "/" << sloophpmax << "!\n Your Current State: Attack: " << shipatk1 << "-" << shipatk2 << ", HP: " << shiphp << "/" << shiphpmax << "!\n\n\n";
- cout << " (1) Attack\n\n (2) Run!\n\n ";
- if (shiphp <= 0)
- {
- goto sink;
- }
- if (sloophp <= 0)
- {
- goto sloopwin;
- }
- cin >> respond;
- if (respond.compare(one) == 0)
- {
- system("cls");
- holder1 = rand()% (cb2-cb1)+cb1;
- holder2 = rand()% (shipatk1-shipatk2)+shipatk1;
- holder3 = rand()% (sloopcb2-sloopcb1)+sloopcb1;
- holder4 = rand()% (sloopatk2-sloopatk1)+sloopatk1;
- holder6 = holder4 * holder3;
- holder5 = holder2 * holder1;
- sloophp -= holder5;
- shiphp -= holder6;
- cout << "\n\n You hit " << holder1 << " times at " << holder2 << " damage each for a total of " << holder5 << "\n\n";
- cout << " The sloop hit " << holder3 << " times at " << holder4 << " damage each for a total of " << holder6 << "\n\n\n\n ";
- cout << " "; system("pause");
- goto sloop;
- }
- if (respond.compare(two) == 0)
- {
- goto portroyal;
- }
- else;
- goto sloop;
- }
- sloopwin:
- {
- system("cls");
- sloophp = sloophpmax;
- holder1 = 1000;
- holder2 = 3000;
- holder3 = rand()% (holder2-holder1)+holder1;
- doubloons += holder3;
- cout << "\n\n you won!\n\n doubloons Scavanged: " << holder3 << "\n\n ";
- system("pause");
- goto portroyal;
- }
- carvel:
- {
- system("cls");
- cout << "\n\n Carvel's Current State: Attack: " << carvelatk1 << "-" << carvelatk2 << ", HP: " << carvelhp << "/" << carvelhpmax << "!\n Your Current State: Attack: " << shipatk1 << "-" << shipatk2 << ", HP: " << shiphp << "/" << shiphpmax << "!\n\n\n";
- cout << " (1) Attack\n\n (2) Run!\n\n ";
- if (shiphp <= 0)
- {
- goto sink;
- }
- if (carvelhp <= 0)
- {
- goto carvelwin;
- }
- cin >> respond;
- if (respond.compare(one) == 0)
- {
- system("cls");
- holder1 = rand()% (cb2-cb1)+cb1;
- holder2 = rand()% (shipatk1-shipatk2)+shipatk1;
- holder3 = rand()% (carvelcb2-carvelcb1)+carvelcb1;
- holder4 = rand()% (carvelatk2-carvelatk1)+carvelatk1;
- holder6 = holder4 * holder3;
- holder5 = holder2 * holder1;
- carvelhp -= holder5;
- shiphp -= holder6;
- cout << "\n\n You hit " << holder1 << " times at " << holder2 << " damage each for a total of " << holder5 << "\n\n";
- cout << " The Carvel hit " << holder3 << " times at " << holder4 << " damage each for a total of " << holder6 << "\n\n\n\n ";
- cout << " "; system("pause");
- goto carvel;
- }
- if (respond.compare(two) == 0)
- {
- goto portroyal;
- }
- else;
- goto carvel;
- }
- carvelwin:
- {
- system("cls");
- carvelhp = carvelhpmax;
- holder1 = 2000;
- holder2 = 4000;
- holder3 = rand()% (holder2-holder1)+holder1;
- doubloons += holder3;
- cout << "\n\n you won!\n\n doubloons Scavanged: " << holder3 << "\n\n ";
- system("pause");
- goto locations;
- }
- ts:
- {
- system("cls");
- cout << "\n\n Treasure Ship's Current State: Attack: " << tsatk1 << "-" << tsatk2 << ", HP: " << tshp << "/" << tshpmax << "!\n Your Current State: Attack: " << shipatk1 << "-" << shipatk2 << ", HP: " << shiphp << "/" << shiphpmax << "!\n\n\n";
- cout << " (1) Attack\n\n (2) Run!\n\n ";
- if (shiphp <= 0)
- {
- goto sink;
- }
- if (tshp <= 0)
- {
- goto tswin;
- }
- cin >> respond;
- if (respond.compare(one) == 0)
- {
- system("cls");
- holder1 = rand()% (cb2-cb1)+cb1;
- holder2 = rand()% (shipatk1-shipatk2)+shipatk1;
- holder3 = rand()% (tscb2-tscb1)+tscb1;
- holder4 = rand()% (tsatk2-tsatk1)+tsatk1;
- holder6 = holder4 * holder3;
- holder5 = holder2 * holder1;
- tshp -= holder5;
- shiphp -= holder6;
- cout << "\n\n You hit " << holder1 << " times at " << holder2 << " damage each for a total of " << holder5 << "\n\n";
- cout << " The Treasure Ship hit " << holder3 << " times at " << holder4 << " damage each for a total of " << holder6 << "\n\n\n\n ";
- cout << " "; system("pause");
- goto ts;
- }
- if (respond.compare(two) == 0)
- {
- goto portroyal;
- }
- else;
- goto sloop;
- }
- tswin:
- {
- system("cls");
- tshp = tshpmax;
- cout << "\n\n you won!\n\n ";
- system("pause");
- goto portroyal;
- }
- buccaneer:
- {
- system("cls");
- cout << "\n\n Buccaneer's Current State: Attack: " << bucatk1 << "-" << bucatk2 << ", HP: " << buchp << "/" << buchpmax << "!\n\n Your Current State: Attack: " << atk1 << "-" << atk2 << ", HP: " << hp << "/" << hpmax << "!\n\n\n";
- cout << " (1) Attack!\n\n (2) Run!\n\n ";
- if (buchp <= 0)
- {
- goto buccaneerwin;
- }
- if (hp <= 0)
- {
- goto death;
- }
- cin >> respond;
- if (respond.compare(one) == 0)
- {
- holder1 = rand()% (atk2-atk1)+atk1;
- holder2 = rand()% (bucatk2-bucatk1)+bucatk1;
- buchp -= holder1;
- hp -= holder2;
- goto buccaneer;
- }
- if (respond.compare(two) == 0)
- {
- goto locations;
- }
- }
- buccaneerwin:
- {
- system("cls");
- cout << "\n\n You Killed A Buccaneer!\n\n You loot 73 doubloons off his body\n\n (1) Go Back To Town\n\n (2) Keep Exploring\n\n ";
- doubloons += 73;
- cin >> respond;
- if (respond.compare(one) == 0)
- {
- goto locations;
- }
- if (respond.compare(two) == 0)
- {
- goto exploreland;
- }
- }
- cutthroat:
- {
- system("cls");
- cout << "\n\n Cut Throat's Current State: Attack: " << cutatk1 << "-" << cutatk2 << ", HP: " << cuthp << "/" << cuthpmax << "!\n\n Your Current State: Attack: " << atk1 << "-" << atk2 << ", HP: " << hp << "/" << hpmax << "!\n\n\n";
- cout << " (1) Attack!\n\n (2) Run!\n\n ";
- if (cuthp <= 0)
- {
- goto cutthroatwin;
- }
- if (hp <= 0)
- {
- goto death;
- }
- cin >> respond;
- if (respond.compare(one) == 0)
- {
- holder1 = rand()% (atk2-atk1)+atk1;
- holder2 = rand()% (cutatk2-cutatk1)+cutatk1;
- cuthp -= holder1;
- hp -= holder2;
- goto cutthroat;
- }
- if (respond.compare(two) == 0)
- {
- goto locations;
- }
- }
- cutthroatwin:
- {
- system("cls");
- cout << "\n\n You Killed A Cut Throat!\n\n You loot 95 doubloons off his body\n\n (1) Go Back To Town\n\n (2) Keep Exploring\n\n ";
- doubloons += 95;
- cin >> respond;
- if (respond.compare(one) == 0)
- {
- goto locations;
- }
- if (respond.compare(two) == 0)
- {
- goto exploreland;
- }
- }
- wreckedship:
- {
- system("cls");
- random = rand()% 19+1;
- if (random <= 5)
- {
- holder1 = 500;
- holder2 = 3000;
- holder3 = rand()% (holder2-holder1)+holder1;
- cout << "\n\n " << name << " Finds A Map To Buried Treasure\n\n " << name << " Follows The Map And Finds " << holder3 << "\n\n ";
- doubloons += holder3;
- system("pause");
- goto portroyal;
- }
- if (random >= 5)
- {
- cout << "\n\n The Ship Was Empty And " << name << " Sails Back To Town\n\n ";
- system("pause");
- goto locations;
- }
- }
- death:
- {
- system("cls");
- cout << "\n\n You Have Died!\n\n ";
- buchp = buchpmax;
- cuthp = cuthpmax;
- system("pause");
- goto locations;
- }
- sink:
- {
- system("cls");
- sloophp = sloophpmax;
- tshp = tshpmax;
- cout << "\n\n You sunk.\n\n ";
- shiphp = 0;
- system("pause");
- goto portroyal;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement