c++ text rpg

Hello everyone, this is my first time posting on these forums so if I am in the wrong place, please let me know.

Basically, I am trying to learn c++ and since I love games, i figured i would start learning by making a small text game.

I looked through a few tutorials and went to work. I am new at this so please be constructive and let me know where I can improve on any of my code. My first question is, Would it be better to have the game map in an array or keep it with switch statements like I have now? If so, would someone be willing to show me an example?

I thank you guys for your time and help.
:)

apparently my code is too long to put in here, any idea how to let you guys see it to get some advice?
Put it in multiple posts if it's too long.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#include <cstdlib>
#include <iostream>
#include <string>

using namespace std;


//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
////////////////////////////////////////////////////////////////////////////////
////////////////////////////// Variables ///////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//


//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
//Misc
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
char characterCreation;
char Selection;
int playerDirection;
string playerInput;

//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
//Character information
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
string playerName;
string playerClass;

int playerCon;
int playerStr;
int playerDex;
int playerIntel;
int playerWis;

long playerStartingHp = 10;
long playerStartingPhysicalDmg = 5;
long playerStartingInitiative = 5;
long playerStartingPhysicalDefense = 5;
long playerStartingMagicDefense = 5;
long playerStartingSpellPower = 5;
    
long playerCoins = 50;
long playerEXP = 0;
long playerLevelUp;

long playerCurrentHp = (playerCon + playerStartingHp);
long playerCurrentDmg = (playerStr + playerStartingPhysicalDmg);
long playerCurrentSpellPower = (playerIntel + playerStartingSpellPower);
long playerCurrentDefense = (playerCon + playerStartingPhysicalDefense);
long playerCurrentMagicDefense = (playerIntel + playerStartingMagicDefense);
long playerCurrentInitiative = (playerDex + playerStartingInitiative);
       
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
//Character Classes
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
string Fighter;
string Thief;
string Mage;
string Cleric;

//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
//Weapons
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
int dagger = 1;
int shortSword = 2;
int longSword = 3;

//Armor
int paddedArmor = 1;
int leatherArmor = 2;
int ringMailArmor = 3;

//Accessories

//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
//NPC's (Mobs)
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
int mobCon;
int mobStr;
int mobDex;
int mobIntel;
int mobWis;

long mobHp = 10;
long mobPhysicalDmg = 5;
long mobInitiative = 5;
long mobPhysicalDefense = 5;
long mobMagicDefense = 5;
long mobSpellPower = 5;

long mobCoins = 50;
long mobEXP = 0;

string mobName;
string mobClass;


//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
////////////////////////////////////////////////////////////////////////////////
////////////////////////////// Functions ///////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//

void battleFunc();
void playerAttackFunc();
void playerFlee();
void mobAttackFunc();
void playerDeathFunc();
void playerWinFunc();
void playerLevelUpFunc();
void playerHealInnFunc();
void playerShopPurchaseFunc();
void playerShopSellFunc();

void playerStatMenuFunc()
{
    cout << "Con - " << playerCon << "\n";
    cout << "Str - " << playerStr << "\n";
    cout << "Dex - " << playerDex << "\n";
    cout << "Int - " << playerIntel << "\n";
    cout << "Wis - " << playerWis << "\n\n";
    
    cout << "Hp - " << playerCurrentHp << "\t";
    cout << "Defense - " << playerCurrentDefense << "\t";
    cout << "Magic Defense - " << playerCurrentMagicDefense << "\n\n";
    cout << "Attack - " << playerCurrentDmg << "\t";
    cout << "Spell Power - " << playerCurrentSpellPower << "\t";
    cout << "Initiative - " << playerCurrentInitiative << "\n";
    cout << "Wealth - " << playerCoins << " Coins\n\n";
    
     }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
//                             Game Map Index                                 //
//                             --------------                                 //
//                                                                            //
//  To use the map index, hit 'ctrl + f' and enter the ind # to skip straight //
//  to the desired map location function.                                     //
//                                                                            //
//                                                                            //
//----------------------------------------------------------------------------//
// Ind#     Streets          |Pirantha|            Notes                      //
//----------------------------------------------------------------------------//
//  p01 - Center of Town         | Game starting location                     //
//                                                                            //
//  p02 - North Road 1           |                                            //
//  p03 - North Road 2           |                                            //
//  p04 - North Road 3           |                                            //
//  p05 - North Road 4           |                                            //
//  p06 - North Gate             | City Guard                                 //
//                                                                            //
//  p07 - South Road 1           |                                            //
//  p08 - South Road 2           |                                            //
//  p09 - South Road 3           |                                            //
//  p10 - South Road 4           |                                            //
//  p11 - South Gate             | City Guard                                 //
//                                                                            //
//  p12  - East Road 1           |                                            //
//  p13  - East Road 2           |                                            //
//  p14  - East Road 3           |                                            //
//  p15  - East Road 3           |                                            //
//  p16  - East Gate             | City Guard                                 //
//                                                                            //
//  p17  - West Road 1           |                                            //
//  p18  - West Road 2           |                                            //
//  p19  - West Road 3           |                                            //
//  p20  - West Road 4           |                                            //
//  p21  - West Gate             | City Guard                                 //
//                                                                            //
//  p22  - Weapon Shop           | NPC ran shop, buy, sell, view items        //
//  p23  - Armor Shop            | NPC ran shop, buy, sell, view items        //
//  p24  - Item Shop             | NPC ran shop, buy, sell, view items        //
//  p25  - Inn                   | NPC ran business, Pay to rest and heal     //
//                                                                            //
//  p26  - Fighter Guild         | Pick up class related quests               //
//  p27  - Thief Guild           | Pick up class related quests               //
//  p28  - Mage Guild            | Pick up class related quests               //
//  p29  - Cleric Guild          | Pick up class related quests               //
//                                                                            //
//----------------------------------------------------------------------------//
//                                                                            //
//                                                                            //
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
//City of Pirithia - Begin                                                    // 
//Notes: Main city in the game. Want to have an armor shop, weapon shop, inn  //
//for resting and healing lost hp for a fee, a class trainer.                 //
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//

void pirithaNorthRoad1Func();
     void pirithaNorthRoad2Func();
          void pirithaNorthRoad3Func();
               void pirithaNorthRoad4Func();
                    void pirithaNorthGateFunc();

void pirithaSouthRoad1Func();
     void pirithaSouthRoad2Func();
          void pirithaSouthRoad3Func();
               void pirithaSouthRoad4Func();
                    void pirithaSouthGateFunc();

void pirithaEastRoad1Func();
     void pirithaEastRoad2Func();
          void pirithaEastRoad3Func();
               void pirithaEastRoad4Func();
                    void pirithaEastGateFunc();

void pirithaWestRoad1Func();
     void pirithaWestRoad2Func();
          void pirithaWestRoad3Func();
               void pirithaWestRoad4Func();
                    void pirithaWestGateFunc();

void pirithaWeaponShopFunc();
     void pirithaArmorShopFunc();
          void pirithaItemShopFunc();
               void pirithaInnFunc();

void pirithaFighterGuildFunc();
     void pirithaThiefGuildFunc();
          void pirithaClericGuildFunc();
               void pirithaMageGuildFunc();


// p01 - Pirithia Center of Town
    void pirithaCOTFunc()
    {
    
    system ("cls");
    cout << "\n";
    cout << "                    ---------------\n";
    cout << "                    Center of Town\n";
    cout << "                    ---------------\n\n";
    cout << "  You are standing in the center of downtown Piritha. \n";
    cout << "  You notice that all the store and street lights are \n";
    cout << "  completly out. The only noticable light you see is coming from the well lit\n";
    cout << "  clock tower at City Hall. \n\n";
    cout << "  Obvious exits are:\n";
    cout << "  (N)orth --> \t North Raod (City of Piritha)\n";
    cout << "  (S)outh --> \t South Raod (City of Piritha)\n";
    cout << "  (E)ast  --> \t East Raod (City of Piritha)\n";
    cout << "  (W)est  --> \t West Raod (City of Piritha)\n\n";
    cout << "  Direction of travel: ";
    cin >> Selection;
    
    switch (Selection)
    {
        case 'N': 
        pirithaNorthRoad1Func();
        break;
        
        case 'S': 
        pirithaSouthRoad1Func();
        break;
        
        case 'E': 
        pirithaEastRoad1Func();
        break;
        
        case 'W': 
        pirithaWestRoad1Func();
        break;
        
        default:
        cout << "\n\n";        
        cout << "You can not go that way!\n";
        pirithaCOTFunc();
        break;
    }
    return;
}
Last edited on
You should really look into using OOP for this. Everything with "player" in front of it should basically be a member of a class called Player or something.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
// p02 - North Road 1.
void pirithaNorthRoad1Func()
{
     system ("cls");
     cout << "\n";
     cout << "                    ---------------\n";
     cout << "                     North Road 1:\n";
     cout << "                    ---------------\n\n";
     cout << "  This is a smoothly paved and well traveled road within the city \n";
     cout << "  walls of Pirithia. The street is lined with lamps, that light up\n";
     cout << "  the streets on even the darkest of nights. There are houses to the\n";
     cout << "  east and west, and the road to the south and north.\n\n";
     cout << "  Obvious exits are:\n";
     cout << "  (N)orth --> \t North Raod 2 (City of Piritha)\n";
     cout << "  (S)outh --> \t Center of Town (City of Piritha)\n\n";
     cout << "  Direction of travel: ";
     cin >> Selection;
     
     switch (Selection)
    {
        case 'N': 
        pirithaNorthRoad2Func();
        break;
        
        case 'S':
        pirithaCOTFunc();
        break;
        
        case 'E': 
        pirithaInnFunc();
        break;
        
        case 'W': 
        pirithaWeaponShopFunc();
        break;
        
        default: 
        cout << "\n\n";        
        cout << "You can not go that way!\n";
        pirithaNorthRoad1Func(); 
        break;
    }
        
     return;
 }

// p03 - North Road 2.
void pirithaNorthRoad2Func()
{
     system ("cls");
     cout << "\n";
     cout << "                    ---------------\n";
     cout << "                     North Road 2:\n";
     cout << "                    ---------------\n\n";
     cout << "  This is a smoothly paved and well traveled road within the city \n";
     cout << "  walls of Pirithia. The street is lined with lamps, that light up\n";
     cout << "  the streets on even the darkest of nights. There are houses to the\n";
     cout << "  east and west, and the road to the south and north.\n\n";
     cout << "  Obvious exits are:\n";
     cout << "  (N)orth --> \t North Road 3 (City of Piritha)\n";
     cout << "  (S)outh --> \t North Road 2 (City of Piritha)\n\n";
     cout << "  Direction of travel: ";
     cin >> Selection;
     
     switch (Selection)
    {
        case 'N':
        pirithaNorthRoad3Func();
        break;
        
        case 'S':
        pirithaNorthRoad1Func();
        break;
        
        default:
        cout << "\n\n";        
        cout << "You can not go that way!\n";
        pirithaNorthRoad2Func(); 
        break;
    }
        
     return;
 }

// p04 - North Road 3.
void pirithaNorthRoad3Func()
{
     system ("cls");
     cout << "\n";
     cout << "                    ---------------\n";
     cout << "                     North Road 3:\n";
     cout << "                    ---------------\n\n";
     cout << "  This is a smoothly paved and well traveled road within the city \n";
     cout << "  walls of Pirithia. The street is lined with lamps, that light up\n";
     cout << "  the streets on even the darkest of nights. There are houses to the\n";
     cout << "  east and west, and the road to the south and north.\n\n";
     cout << "  Obvious exits are:\n";
     cout << "  (N)orth --> \t North Road 4 (City of Piritha)\n";
     cout << "  (S)outh --> \t North Road 2 (City of Piritha)\n\n";
     cout << "  Direction of travel: ";
     cin >> Selection;
     
     switch (Selection)
    {
        case 'N':
        pirithaNorthRoad4Func();
        break;
        
        case 'S':
        pirithaNorthRoad2Func();
        break;
        
        default:
        cout << "\n\n";        
        cout << "You can not go that way!\n";
        pirithaNorthRoad3Func(); 
        break;
    }
        
     return;
 }

// p05 - North Road 4.
void pirithaNorthRoad4Func()
{
     system ("cls");
     cout << "\n";
     cout << "                    ---------------\n";
     cout << "                     North Road 4:\n";
     cout << "                    ---------------\n\n";
     cout << "  This is a smoothly paved and well traveled road within the city \n";
     cout << "  walls of Pirithia. The street is lined with lamps, that light up\n";
     cout << "  the streets on even the darkest of nights. There are houses to the\n";
     cout << "  east and west, and the road to the south and north.\n\n";
     cout << "  Obvious exits are:\n";
     cout << "  (N)orth --> \t North Gate (City of Piritha)\n";
     cout << "  (S)outh --> \t North Road 3 (City of Piritha)\n\n";
     cout << "  Direction of travel: ";
     cin >> Selection;
     
     switch (Selection)
    {
        case 'N':
        pirithaNorthGateFunc();
        break;
        
        case 'S':
        pirithaNorthRoad3Func();
        break;
        
        case 'E':
        pirithaThiefGuildFunc();
        break;
        
        default:
        cout << "\n\n";        
        cout << "You can not go that way!\n";
        pirithaNorthRoad4Func(); 
        break;
    }
        
     return;
 }

// p06 - North Gate.
void pirithaNorthGateFunc()
{
     system ("cls");
     cout << "\n";
     cout << "                    ---------------\n";
     cout << "                     North Gate:\n";
     cout << "                    ---------------\n\n";
     cout << "  This is a smoothly paved and well traveled road within the city \n";
     cout << "  walls of Pirithia. The street is lined with lamps, that light up\n";
     cout << "  the streets on even the darkest of nights. There are houses to the\n";
     cout << "  east and west, and the road to the south and north.\n\n";
     cout << "  Standing between you and the gates is a heavily armored City Guard.\n\n";
     cout << "  Obvious exits are:\n";
     cout << "  (N)orth --> \t North Forest 1 (North Woods)\n";
     cout << "  (S)outh --> \t North Road 3 (City of Piritha)\n\n";
     cout << "  Direction of travel: ";
     cin >> Selection;
     
     switch (Selection)
    {
        case 'N':
        cout << "\n\n";
        cout << "The City Guard prevents you from leaving and says - The gates are closed for the evening. Come back in the morning.\n\n";
        pirithaNorthGateFunc();
        break;
        
        case 'S':
        pirithaNorthRoad4Func();
        break;
        
        default:
        cout << "\n\n";        
        cout << "You can not go that way!\n";
        pirithaNorthGateFunc(); 
        break;
    }
        
     return;
 }
Last edited on
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
// p07 - South Road 1.
void pirithaSouthRoad1Func()
{
     system ("cls");
     cout << "\n";
     cout << "                    ---------------\n";
     cout << "                       South Road 1:\n";
     cout << "                    ---------------\n\n";
     cout << "  This is a smoothly paved and well traveled road within the city \n";
     cout << "  walls of Pirithia. The street is lined with lamps, that light up\n";
     cout << "  the streets on even the darkest of nights. There are houses to the\n";
     cout << "  east and west, and the road to the south and north.\n\n";
     cout << "  Obvious exits are:\n";
     cout << "  (N)orth --> \t Center of Town (City of Piritha)\n";
     cout << "  (S)outh --> \t South Road 2 (City of Piritha)\n\n";
     cout << "  Direction of travel: ";
     cin >> Selection;
     
     switch (Selection)
    {
        case 'N':
        pirithaCOTFunc();
        break;
        
        case 'S': 
        pirithaSouthRoad2Func();
        break;
        
        case 'E': 
        pirithaItemShopFunc();
        break;
        
        case 'W': 
        pirithaArmorShopFunc();
        break;
        
        default: 
        cout << "\n\n";        
        cout << "You can not go that way!\n";
        pirithaSouthRoad1Func(); 
        break;
    }    
     return;
 }

// p08 - South Road 2.
void pirithaSouthRoad2Func()
{
     system ("cls");
     cout << "\n";
     cout << "                    ---------------\n";
     cout << "                       South Road 2:\n";
     cout << "                    ---------------\n\n";
     cout << "  This is a smoothly paved and well traveled road within the city \n";
     cout << "  walls of Pirithia. The street is lined with lamps, that light up\n";
     cout << "  the streets on even the darkest of nights. There are houses to the\n";
     cout << "  east and west, and the road to the south and north.\n\n";
     cout << "  Obvious exits are:\n";
     cout << "  (N)orth --> \t South Road 1 (City of Piritha)\n";
     cout << "  (S)outh --> \t South Road 3 (City of Piritha)\n\n";
     cout << "  Direction of travel: ";
     cin >> Selection;
     
     switch (Selection)
    {
        case 'N': 
        pirithaSouthRoad1Func();
        break;
        
        case 'S': 
        pirithaSouthRoad3Func();
        break;
        
        default: 
        cout << "\n\n";        
        cout << "You can not go that way!\n";
        pirithaSouthRoad2Func(); 
        break;
    }    
     return;
 }

// p09 - South Road 3.
void pirithaSouthRoad3Func()
{
     system ("cls");
     cout << "\n";
     cout << "                    ---------------\n";
     cout << "                       South Road 3:\n";
     cout << "                    ---------------\n\n";
     cout << "  This is a smoothly paved and well traveled road within the city \n";
     cout << "  walls of Pirithia. The street is lined with lamps, that light up\n";
     cout << "  the streets on even the darkest of nights. There are houses to the\n";
     cout << "  east and west, and the road to the south and north.\n\n";
     cout << "  Obvious exits are:\n";
     cout << "  (N)orth --> \t South Road 2 (City of Piritha)\n";
     cout << "  (S)outh --> \t South Road 4 (City of Piritha)\n\n";
     cout << "  Direction of travel: ";
     cin >> Selection;
     
     switch (Selection)
    {
        case 'N': 
        pirithaSouthRoad2Func();
        break;
        
        case 'S':
        pirithaSouthRoad4Func();
        break;
        
        default: 
        cout << "\n\n";        
        cout << "You can not go that way!\n";
        pirithaSouthRoad3Func(); 
        break;
    }    
     return;
 }

// p10 - South Road 4.
void pirithaSouthRoad4Func()
{
     system ("cls");
     cout << "\n";
     cout << "                    ---------------\n";
     cout << "                       South Road 4:\n";
     cout << "                    ---------------\n\n";
     cout << "  This is a smoothly paved and well traveled road within the city \n";
     cout << "  walls of Pirithia. The street is lined with lamps, that light up\n";
     cout << "  the streets on even the darkest of nights. There are houses to the\n";
     cout << "  east and west, and the road to the south and north.\n\n";
     cout << "  Obvious exits are:\n";
     cout << "  (N)orth --> \t South Road 3 (City of Piritha)\n";
     cout << "  (S)outh --> \t South Gate (City of Piritha)\n\n";
     cout << "  Direction of travel: ";
     cin >> Selection;
     
     switch (Selection)
    {
        case 'N': 
        pirithaSouthRoad3Func();
        break;
        
        case 'S':
        pirithaSouthGateFunc();
        break;
        
        case 'W': 
        pirithaFighterGuildFunc();
        break;
        
        default: 
        cout << "\n\n";        
        cout << "You can not go that way!\n";
        pirithaSouthRoad4Func(); 
        break;
    }    
     return;
 }

// p11 - South Gate.
void pirithaSouthGateFunc()
{
     system ("cls");
     cout << "\n";
     cout << "                    ---------------\n";
     cout << "                       South Gate:\n";
     cout << "                    ---------------\n\n";
     cout << "  This is a smoothly paved and well traveled road within the city \n";
     cout << "  walls of Pirithia. The street is lined with lamps, that light up\n";
     cout << "  the streets on even the darkest of nights. There are houses to the\n";
     cout << "  east and west, and the road to the south and north.\n\n";
     cout << "  Obvious exits are:\n";
     cout << "  (N)orth --> \t South Road 4 (City of Piritha)\n";
     cout << "  (S)outh --> \t South Woods (City of Piritha)\n\n";
     cout << "  Direction of travel: ";
     cin >> Selection;
     
     switch (Selection)
    {
        case 'N':
        pirithaSouthRoad4Func();
        break;
        
        case 'S':
        cout << "\n\n";
        cout << "The City Guard prevents you from leaving and says - The gates are closed for the evening. Come back in the morning.\n\n";
        pirithaSouthGateFunc();
        break;
        
        default: 
        cout << "\n\n";        
        cout << "You can not go that way!\n";
        pirithaSouthGateFunc(); 
        break;
    }    
     return;
 }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
// p12 - East Road 1.
void pirithaEastRoad1Func()
{
     system ("cls");
     cout << "\n";
     cout << "                    ---------------\n";
     cout << "                      East Road 1:\n";
     cout << "                    ----------------\n\n";
     cout << "  This is a smoothly paved and well traveled road within the city \n";
     cout << "  walls of Pirithia. The street is lined with lamps, that light up\n";
     cout << "  the streets on even the darkest of nights. There are houses to the\n";
     cout << "  north and south, and the road to the east and west.\n\n";
     cout << "  Obvious exits are:\n";
     cout << "  (E)ast --> \t East Road 2 (City of Piritha)\n";
     cout << "  (W)est --> \t Center of Town (City of Piritha)\n\n";
     cout << "  Direction of travel: ";
     cin >> Selection;
     
     switch (Selection)
    {
        case 'E': 
        pirithaEastRoad2Func();
        break;
        
        case 'W': 
        pirithaCOTFunc();
        break;
        
        case 'N': 
        pirithaInnFunc();
        break;
        
        case 'S':
        pirithaItemShopFunc();
        break;
        
        default: 
        cout << "\n\n";        
        cout << "You can not go that way!\n";
        pirithaEastRoad1Func(); 
        break;
    }    
     return;
 }
 
// p13 - East Road 2.
void pirithaEastRoad2Func()
{
     system ("cls");
     cout << "\n";
     cout << "                    ---------------\n";
     cout << "                      East Road 2:\n";
     cout << "                    ----------------\n\n";
     cout << "  This is a smoothly paved and well traveled road within the city \n";
     cout << "  walls of Pirithia. The street is lined with lamps, that light up\n";
     cout << "  the streets on even the darkest of nights. There are houses to the\n";
     cout << "  north and south, and the road to the east and west.\n\n";
     cout << "  Obvious exits are:\n";
     cout << "  (E)ast --> \t East Road 3 (City of Piritha)\n";
     cout << "  (W)est --> \t East Road 1 (City of Piritha)\n\n";
     cout << "  Direction of travel: ";
     cin >> Selection;
     
     switch (Selection)
    {
        case 'W': 
        pirithaEastRoad3Func();
        break;
        
        case 'E':
        pirithaEastRoad1Func();
        break;
        
        default: 
        cout << "\n\n";        
        cout << "You can not go that way!\n";
        pirithaEastRoad2Func(); 
        break;
    }    
     return;
 }

// p14 - East Road 3.
void pirithaEastRoad3Func()
{
     system ("cls");
     cout << "\n";
     cout << "                    ---------------\n";
     cout << "                      East Road 3:\n";
     cout << "                    ----------------\n\n";
     cout << "  This is a smoothly paved and well traveled road within the city \n";
     cout << "  walls of Pirithia. The street is lined with lamps, that light up\n";
     cout << "  the streets on even the darkest of nights. There are houses to the\n";
     cout << "  north and south, and the road to the east and west.\n\n";
     cout << "  Obvious exits are:\n";
     cout << "  (E)ast --> \t East Road 3 (City of Piritha)\n";
     cout << "  (W)est --> \t East Road 1 (City of Piritha)\n\n";
     cout << "  Direction of travel: ";
     cin >> Selection;
     
     switch (Selection)
    {
        case 'E': 
        pirithaEastRoad4Func();
        break;
        
        case 'W':
        pirithaEastRoad2Func();
        break;
        
        default: 
        cout << "\n\n";        
        cout << "You can not go that way!\n";
        pirithaEastRoad3Func(); 
        break;
    }    
     return;
 }
 
// p15 - East Road 4.
void pirithaEastRoad4Func()
{
     system ("cls");
     cout << "\n";
     cout << "                    ---------------\n";
     cout << "                      East Road 4:\n";
     cout << "                    ----------------\n\n";
     cout << "  This is a smoothly paved and well traveled road within the city \n";
     cout << "  walls of Pirithia. The street is lined with lamps, that light up\n";
     cout << "  the streets on even the darkest of nights. There are houses to the\n";
     cout << "  north and south, and the road to the east and west.\n\n";
     cout << "  Obvious exits are:\n";
     cout << "  (E)ast --> \t East Road 3 (City of Piritha)\n";
     cout << "  (W)est --> \t East Road 1 (City of Piritha)\n\n";
     cout << "  Direction of travel: ";
     cin >> Selection;
     
     switch (Selection)
    {
        case 'E' | 'e':
        pirithaEastGateFunc();
        break;
        
        case 'W': 
        pirithaEastRoad3Func();
        break;
        
        case 'N':
        pirithaClericGuildFunc();
        break;
        
        default: 
        cout << "\n\n";        
        cout << "You can not go that way!\n";
        pirithaEastRoad4Func(); 
        break;
    }    
     return;
 }

// p16 - East Gate.
void pirithaEastGateFunc()
{
     system ("cls");
     cout << "\n";
     cout << "                    ---------------\n";
     cout << "                      East Gate:\n";
     cout << "                    ----------------\n\n";
     cout << "  This is a smoothly paved and well traveled road within the city \n";
     cout << "  walls of Pirithia. The street is lined with lamps, that light up\n";
     cout << "  the streets on even the darkest of nights. There are houses to the\n";
     cout << "  north and south, and the road to the east and west.\n\n";
     cout << "  Obvious exits are:\n";
     cout << "  (E)ast --> \t East Woods (City of Piritha)\n";
     cout << "  (W)est --> \t East Road 1 (City of Piritha)\n\n";
     cout << "  Direction of travel: ";
     cin >> Selection;
     
     switch (Selection)
    {
        case 'E':
        cout << "\n\n";
        cout << "The City Guard prevents you from leaving and says - The gates are closed for the evening. Come back in the morning.\n\n";
        pirithaEastGateFunc();
        break;
        
        case 'W': 
        pirithaEastRoad4Func();
        break;
        
        default: 
        cout << "\n\n";        
        cout << "You can not go that way!\n";
        pirithaEastGateFunc(); 
        break;
    }    
     return;
 }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
// p17 - West Road 1.
void pirithaWestRoad1Func()
{
     system ("cls");
     cout << "\n";
     cout << "                    ---------------\n";
     cout << "                      West Road 1:\n";
     cout << "                    ----------------\n\n";
     cout << "  This is a smoothly paved and well traveled road within the city \n";
     cout << "  walls of Pirithia. The street is lined with lamps, that light up\n";
     cout << "  the streets on even the darkest of nights. There are houses to the\n";
     cout << "  north and south, and the road to the east and west.\n\n";
     cout << "  Obvious exits are:\n";
     cout << "  (E)ast --> \t Center of Town (City of Piritha)\n";
     cout << "  (W)est --> \t West Road 2 (City of Piritha)\n\n";
     cout << "  Direction of travel: ";
     cin >> Selection;
     
     switch (Selection)
    {
        case 'E': 
        pirithaCOTFunc();
        break;
        
        case 'W':
        pirithaWestRoad2Func(); 
        break;
        
        case 'N': 
        pirithaWeaponShopFunc();
        break;
        
        case 'S': 
        pirithaArmorShopFunc();
        break;
        
        default: 
        cout << "\n\n";        
        cout << "You can not go that way!\n";
        pirithaWestRoad1Func(); 
        break;
    }    
     return;
 }
 
// p18 - West Road 2.
void pirithaWestRoad2Func()
{
     system ("cls");
     cout << "\n";
     cout << "                    ---------------\n";
     cout << "                      West Road 2:\n";
     cout << "                    ----------------\n\n";
     cout << "  This is a smoothly paved and well traveled road within the city \n";
     cout << "  walls of Pirithia. The street is lined with lamps, that light up\n";
     cout << "  the streets on even the darkest of nights. There are houses to the\n";
     cout << "  north and south, and the road to the east and west.\n\n";
     cout << "  Obvious exits are:\n";
     cout << "  (E)ast --> \t West Road 1 (City of Piritha)\n";
     cout << "  (W)est --> \t West Road 3 (City of Piritha)\n\n";
     cout << "  Direction of travel: ";
     cin >> Selection;
     
     switch (Selection)
    {
        case 'E': 
        pirithaWestRoad1Func();
        break;
        
        case 'W': 
        pirithaWestRoad3Func();
        break;
        
        default: 
        cout << "\n\n";        
        cout << "You can not go that way!\n";
        pirithaEastRoad2Func(); 
        break;
    }    
     return;
 }

// p19 - West Road 3.
void pirithaWestRoad3Func()
{
     system ("cls");
     cout << "\n";
     cout << "                    ---------------\n";
     cout << "                      West Road 3:\n";
     cout << "                    ----------------\n\n";
     cout << "  This is a smoothly paved and well traveled road within the city \n";
     cout << "  walls of Pirithia. The street is lined with lamps, that light up\n";
     cout << "  the streets on even the darkest of nights. There are houses to the\n";
     cout << "  north and south, and the road to the east and west.\n\n";
     cout << "  Obvious exits are:\n";
     cout << "  (E)ast --> \t West Road 2 (City of Piritha)\n";
     cout << "  (W)est --> \t West Road 4 (City of Piritha)\n\n";
     cout << "  Direction of travel: ";
     cin >> Selection;
     
     switch (Selection)
    {
        case 'E': 
        pirithaWestRoad2Func();
        break;
        
        case 'W': 
        pirithaWestRoad4Func();
        break;
        
        default: 
        cout << "\n\n";        
        cout << "You can not go that way!\n";
        pirithaWestRoad3Func(); 
        break;
    }    
     return;
 }
 
// p20 - West Road 4.
void pirithaWestRoad4Func()
{
     system ("cls");
     cout << "\n";
     cout << "                    ---------------\n";
     cout << "                      West Road 4:\n";
     cout << "                    ----------------\n\n";
     cout << "  This is a smoothly paved and well traveled road within the city \n";
     cout << "  walls of Pirithia. The street is lined with lamps, that light up\n";
     cout << "  the streets on even the darkest of nights. There are houses to the\n";
     cout << "  north and south, and the road to the east and west.\n\n";
     cout << "  Obvious exits are:\n";
     cout << "  (E)ast --> \t East Road 3 (City of Piritha)\n";
     cout << "  (W)est --> \t East Road 1 (City of Piritha)\n\n";
     cout << "  Direction of travel: ";
     cin >> Selection;
     
     switch (Selection)
    {
        case 'E': 
        pirithaWestRoad3Func();
        break;
        
        case 'W': 
        pirithaWestGateFunc();
        break;
        
        case 'N':
        pirithaMageGuildFunc();
        break;
        
        default: 
        cout << "\n\n";        
        cout << "You can not go that way!\n";
        pirithaWestRoad4Func(); 
        break;
    }    
     return;
 }

// p21 - West Gate.
void pirithaWestGateFunc()
{
     system ("cls");
     cout << "\n";
     cout << "                    ---------------\n";
     cout << "                      West Gate:\n";
     cout << "                    ----------------\n\n";
     cout << "  This is a smoothly paved and well traveled road within the city \n";
     cout << "  walls of Pirithia. The street is lined with lamps, that light up\n";
     cout << "  the streets on even the darkest of nights. There are houses to the\n";
     cout << "  north and south, and the road to the east and west.\n\n";
     cout << "  Obvious exits are:\n";
     cout << "  (E)ast --> \t West Road 4 (City of Piritha)\n";
     cout << "  (W)est --> \t West Woods (City of Piritha)\n\n";
     cout << "  Direction of travel: ";
     cin >> Selection;
     
     switch (Selection)
    {
        case 'W': 
        cout << "\n\n";
        cout << "The City Guard prevents you from leaving and says - The gates are closed for the evening. Come back in the morning.\n\n";
        pirithaWestGateFunc();
        break;
        
        case 'E': 
        pirithaWestRoad4Func();
        break;
        
        default: 
        cout << "\n\n";        
        cout << "You can not go that way!\n";
        pirithaWestGateFunc(); 
        break;
    }    
     return;
 }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
// p22 - Pirithia Weapon shop
    void pirithaWeaponShopFunc()
    {
    
    system ("cls");
    cout << "\n";
    cout << "                    --------------------\n";
    cout << "                    Piritha Weapon Shop\n";
    cout << "                    --------------------\n\n";
    cout << "  Welcome to the Piritha Weapon Shop!\n";
    cout << "  We sell weapons and stuff :) \n";
    cout << "  \n";
    cout << "  . \n\n";
    cout << "  Obvious exits are:\n";
    cout << "  (S)outh --> \t West Road 1  (City of Piritha)\n";
    cout << "  (E)ast  --> \t North Road 1 (City of Piritha)\n";
    cout << "  Direction of travel: ";
    cin >> Selection;
    
    switch (Selection)
    {
        case 'S': 
        pirithaWestRoad1Func();
        break;
        
        case 'E':
        pirithaNorthRoad1Func();
        break;
        
        default:
        cout << "\n\n";        
        cout << "You can not go that way!\n";
        pirithaWeaponShopFunc();
        break;
    }
    return;
}

// p23 - Pirithia Armor shop
    void pirithaArmorShopFunc()
    {
    
    system ("cls");
    cout << "\n";
    cout << "                    -------------------\n";
    cout << "                    Piritha Armor Shop\n";
    cout << "                    -------------------\n\n";
    cout << "  Welcome to the Piritha Armor Shop!\n";
    cout << "  We sell Armor and stuff :) \n";
    cout << "  \n";
    cout << "  . \n\n";
    cout << "  Obvious exits are:\n";
    cout << "  (N)orth --> \t West Road 1  (City of Piritha)\n";
    cout << "  (E)ast  --> \t South Road 1 (City of Piritha)\n";
    cout << "  Direction of travel: ";
    cin >> Selection;
    
    switch (Selection)
    {
        case 'N': 
        pirithaWestRoad1Func();
        break;
        
        case 'E': 
        pirithaSouthRoad1Func();
        break;
        
        default:
        cout << "\n\n";        
        cout << "You can not go that way!\n";
        pirithaArmorShopFunc();
        break;
    }
    return;
}

// p24 - Pirithia Item Shop
    void pirithaItemShopFunc()
    {
    
    system ("cls");
    cout << "\n";
    cout << "                    ------------------\n";
    cout << "                    Piritha Item Shop\n";
    cout << "                    ------------------\n\n";
    cout << "  Welcome to the Piritha Item Shop!\n";
    cout << "  We sell items and stuff :) \n";
    cout << "  \n";
    cout << "  . \n\n";
    cout << "  Obvious exits are:\n";
    cout << "  (N)orth --> \t East Road 1  (City of Piritha)\n";
    cout << "  (W)est  --> \t South Road 1 (City of Piritha)\n";
    cout << "  Direction of travel: ";
    cin >> Selection;
    
    switch (Selection)
    {
        case 'N': 
        pirithaEastRoad1Func();
        break;
        
        case 'W': 
        pirithaSouthRoad1Func();
        break;
        
        default:
        cout << "\n\n";        
        cout << "You can not go that way!\n";
        pirithaItemShopFunc();
        break;
    }
    return;
}
                

// p25 - Pirithia Inn
    void pirithaInnFunc()
    {
    
    system ("cls");
    cout << "\n";
    cout << "                    ------------\n";
    cout << "                    Piritha Inn\n";
    cout << "                    ------------\n\n";
    cout << "  Welcome to the Piritha Inn Shop!\n";
    cout << "  Come here to res and heal lost HP :) \n";
    cout << "  \n";
    cout << "  . \n\n";
    cout << "  Obvious exits are:\n";
    cout << "  (S)outh --> \t East Road 1  (City of Piritha)\n";
    cout << "  (W)est  --> \t North Road 1 (City of Piritha)\n";
    cout << "  Direction of travel: ";
    cin >> Selection;
    
    switch (Selection)
    {
        case 'S': 
        pirithaEastRoad1Func();
        break;
        
        case 'W': 
        pirithaNorthRoad1Func();
        break;
        
        default:
        cout << "\n\n";        
        cout << "You can not go that way!\n";
        pirithaInnFunc();
        break;
    }
    return;
}

// p26 - Pirithia Fighter Guild
    void pirithaFighterGuildFunc() 
    {
    
    system ("cls");
    cout << "\n";
    cout << "                    ----------------------\n";
    cout << "                    Piritha Fighter Guild\n";
    cout << "                    ----------------------\n\n";
    cout << "  Welcome to the Piritha Fighter Guild!\n";
    cout << "  Come here to pick up class specific quests. :) \n";
    cout << "  \n";
    cout << "  . \n\n";
    cout << "  Obvious exits are:\n";
    cout << "  (E)ast  --> \t South Road 4 (City of Piritha)\n";
    cout << "  Direction of travel: ";
    cin >> Selection;
    
    switch (Selection)
    {
        case 'E': 
        pirithaSouthRoad4Func();
        break;

        default:
        cout << "\n\n";        
        cout << "You can not go that way!\n";
        pirithaFighterGuildFunc();
        break;
    }
    return;
}

// p27 - Pirithia Thief Guild
    void pirithaThiefGuildFunc() 
    {
    
    system ("cls");
    cout << "\n";
    cout << "                    ----------------------\n";
    cout << "                    Piritha Thief Guild\n";
    cout << "                    ----------------------\n\n";
    cout << "  Welcome to the Piritha Thief Guild!\n";
    cout << "  Come here to pick up class specific quests. :) \n";
    cout << "  \n";
    cout << "  . \n\n";
    cout << "  Obvious exits are:\n";
    cout << "  (W)est --> \t North Road 4  (City of Piritha)\n";
    cout << "  Direction of travel: ";
    cin >> Selection;
    
    switch (Selection)
    {
        case 'W': 
        pirithaNorthRoad4Func();
        break;

        default:
        cout << "\n\n";        
        cout << "You can not go that way!\n";
        pirithaThiefGuildFunc();
        break;
    }
    return;
}

// p28 - Pirithia Mage Guild
    void pirithaMageGuildFunc() 
    {
    
    system ("cls");
    cout << "\n";
    cout << "                    ----------------------\n";
    cout << "                    Piritha Mage Guild\n";
    cout << "                    ----------------------\n\n";
    cout << "  Welcome to the Piritha Mage Guild!\n";
    cout << "  Come here to pick up class specific quests. :) \n";
    cout << "  \n";
    cout << "  . \n\n";
    cout << "  Obvious exits are:\n";
    cout << "  (S)outh --> \t West Road 4  (City of Piritha)\n";
    cout << "  Direction of travel: ";
    cin >> Selection;
    
    switch (Selection)
    {
        case 'S':
        pirithaWestRoad4Func();
        break;

        default:
        cout << "\n\n";        
        cout << "You can not go that way!\n";
        pirithaMageGuildFunc();
        break;
    }
    return;
}

// p29 - Pirithia Cleric Guild
    void pirithaClericGuildFunc() 
    {
    
    system ("cls");
    cout << "\n";
    cout << "                    ----------------------\n";
    cout << "                    Piritha Cleric Guild\n";
    cout << "                    ----------------------\n\n";
    cout << "  Welcome to the Piritha Cleric Guild!\n";
    cout << "  Come here to pick up class specific quests. :) \n";
    cout << "  \n";
    cout << "  . \n\n";
    cout << "  Obvious exits are:\n";
    cout << "  (S)outh --> \t South Road 4  (City of Piritha)\n";
    cout << "  Direction of travel: ";
    cin >> Selection;
    
    switch (Selection)
    {
        case 'S': 
        pirithaEastRoad4Func();
        break;

        default:
        cout << "\n\n";        
        cout << "You can not go that way!\n";
        pirithaClericGuildFunc();
        break;
    }
    return;
}

//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
//City of Pirithia - end                                                      //
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>//
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>// 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
// 1 - Title Screen ////////////////////////////////////////////////////////////
void titleScreenFunc ()
{
cout << "\n";
    cout << "\n";
    cout << "\n";
    cout << "\t\t\t\t<*><*><*><*><*><*><*>\n";
    cout << "\t\t\t\t<*><*><*><*><*><*><*>\n";
    cout << "\t\t\t\t<*><*><*><*><*><*><*>\n";
    cout << "\t\t\t\t<*><*> M       <*><*>\n";
    cout << "\t\t\t\t<*><*>	E      <*><*>\n";
    cout << "\t\t\t\t<*><*>	 R     <*><*>\n";
    cout << "\t\t\t\t<*><*>	  C    <*><*>\n";
    cout << "\t\t\t\t<*><*>	       <*><*>\n";
    cout << "\t\t\t\t<*><*>	C      <*><*>\n";
    cout << "\t\t\t\t<*><*>	 I     <*><*>\n";
    cout << "\t\t\t\t<*><*>	  T    <*><*>\n";
    cout << "\t\t\t\t<*><*>	   Y   <*><*>\n";
    cout << "\t\t\t\t<*><*><*><*><*><*><*>\n";
    cout << "\t\t\t\t<*><*><*><*><*><*><*>\n";
    cout << "\t\t\t\t<*><*><*><*><*><*><*>\n\n\n"; // Display the title
    cout << "\t\t\t        1: Create New Character\n"; // Display the options

    cin >> playerInput;

    return;
}

// 2 - Game Start //////////////////////////////////////////////////////////////
void gameStartFunc ()
{
     system("cls");
     
     }

// 1 - Character Creation //////////////////////////////////////////////////////   
void characterCreationFunc ()
{
system("cls");
    cout << "What's your name?: ";
    cin >> playerName;
    
    system("cls");
    cout << "So, " << playerName << " youve come to help us out huh?\n\n";
    cout << "And what is your profession?: \n\n";
    cout << "Available Classes:\n";
    cout << "(F)ighter \n";
    cout << "(M)age \n";
    cout << "(T)hief \n";
    cout << "(C)leric \n\n";
    
    cin >> Selection;

    switch (Selection)
    {
        case 'F': 
        playerClass = "Fighter";
        playerCon = 16; playerStr = 18; playerDex = 14; playerIntel = 8; playerWis = 8;
        break;
        
        case 'M': 
        playerClass = "Mage";
        playerCon = 8; playerStr = 8; playerDex = 14; playerIntel = 18; playerWis = 16;
        break;
        
        case 'T': 
        playerClass = "Thief";
        playerCon = 8; playerStr = 14; playerDex = 18; playerIntel = 16; playerWis = 8;
        break;
        
        case 'C': 
        playerClass = "Cleric";
        playerCon = 16; playerStr = 14; playerDex = 8; playerIntel = 8; playerWis = 18;
        break;
        
        default: 
        characterCreationFunc(); 
        break;
    }
    
    system ("cls");
    cout << "Okay, " << playerName << ", now as a " << playerClass;
    cout << " your starting stats are:\n\n";

    playerStatMenuFunc();
    
    
    cout << "Are you ready to proceed?\n(Y) / (N): ";
    cin >> Selection;

    switch (Selection)
    {
        case 'Y':
        gameStartFunc();
        break;

        default: 
        characterCreationFunc(); 
        break;
    }
        
    
}


int main(int argc, char *argv[])
{
    
    titleScreenFunc();   
    characterCreationFunc();
    
    gameStartFunc();

////////////////////////////////////////////////////////////////////////////////   
//////Downtown//////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

    //Center of Town
    pirithaCOTFunc();
           
    system("PAUSE");
    return EXIT_SUCCESS;
}


Now I feel like a douche for posting all that, im really sorry guys. looking back this was not a good idea.
Last edited on
Hey, sorry I just saw your post about using OOP. Like i said before, i saw a few tutorials and just figured I would give it a go at learning the language this way so im really new at this. How would you do what you suggested, sir?

and thank you guys very much for humoring me with this and helping me learn a bit more.
What you seem to be struggling with (which is expected of a beginner) is the concept of hardcoded vs a Data driven solution. This is where OOP comes in.

Long answer:
Hardcoded - One way of describing hardcodedness would be to say that code is hardcoded when it is written in such a way that it clearly is not taking advantage of classes and algorithms to do most of the work for you (when it's appropriate). This results in code which is not modular or expandable. Sometimes, it's perfectly reasonable to have a hardcoded look-up table or some other such thing, it just comes down to whether or not you know what you're doing.

For instance, you've written all these different functions, each of them dedicated to one location in your game world. Additionally, you haven't wrapped any of your player, mob, armor / weapon etc variables in any classes, which, like I said above, makes it unnecessarly difficult to modify your code at a later time. What if you decided to make this game turn based, with possibly two or more human players?

Short answer :
Read up on classes and other OOP concepts.
Hello and thank you for your suggestion. I am reading up on classes now, but I am still failing to see what I gain from then specifically. So, if I made a 'player' class, and added into this class all the player variables, character creations, stats, and future battle system to it, that would make things easier for me in the future?

Also, back to the original issue, is the way I have the map set up, a good way to do it, or should I do the map a different way?
closed account (N36fSL3A)
tsk tsk tsk

Lets look at things. Say you have a game server. It can hold an infinite number of players. Without using classes/structs, you'd have to hard code each individual value into your program (impossible)

Or, you could have classes that can make objects.

1
2
3
4
5
std::vector<Player> players; // A vector is basically a resizable array

Player tempPlayer("parameter");

players.push_back(tempPlayer); // Add it 


Something like this would greatly reduce the size of your program. Even if it was a set number of players, you wouldn't want to hardcode each variable in (Especially in graphical apps)

(It's something you get using into larger projects)
Last edited on
So something like this?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
class playerClass {
      public:
             string playerName;
string playerClass;

int playerCon;
int playerStr;
int playerDex;
int playerIntel;
int playerWis;

long playerStartingHp = 10;
long playerStartingPhysicalDmg = 5;
long playerStartingInitiative = 5;
long playerStartingPhysicalDefense = 5;
long playerStartingMagicDefense = 5;
long playerStartingSpellPower = 5;
    
long playerCoins = 50;
long playerEXP = 0;
long playerLevelUp;

long playerCurrentHp = (playerCon + playerStartingHp);
long playerCurrentDmg = (playerStr + playerStartingPhysicalDmg);
long playerCurrentSpellPower = (playerIntel + playerStartingSpellPower);
long playerCurrentDefense = (playerCon + playerStartingPhysicalDefense);
long playerCurrentMagicDefense = (playerIntel + playerStartingMagicDefense);
long playerCurrentInitiative = (playerDex + playerStartingInitiative);

      };

void playerStatMenuFunc()
{
    cout << "Con - " << playerCon << "\n";
    cout << "Str - " << playerStr << "\n";
    cout << "Dex - " << playerDex << "\n";
    cout << "Int - " << playerIntel << "\n";
    cout << "Wis - " << playerWis << "\n\n";
    
    cout << "Hp - " << playerCurrentHp << "\t";
    cout << "Defense - " << playerCurrentDefense << "\t";
    cout << "Magic Defense - " << playerCurrentMagicDefense << "\n\n";
    cout << "Attack - " << playerCurrentDmg << "\t";
    cout << "Spell Power - " << playerCurrentSpellPower << "\t";
    cout << "Initiative - " << playerCurrentInitiative << "\n";
    cout << "Wealth - " << playerCoins << " Coins\n\n";
    
     }
Topic archived. No new replies allowed.