repl.it
C++

a little game for the game jam.

fork
loading
Files
  • main.cpp
main.cpp
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
#include <iostream>
#include <string>
#include <unistd.h>
using namespace std;
//items
////////////////////
int timber = 5;
int coal = 5;
int iron = 0;
////////////////////
//upgrade checkers
////////////////////
bool isironactive = false;
////////////////////
//shop and upgrade checkers
////////////////////
int currentoption;
int currentshopoption;
////////////////////
//level ints
////////////////////
int level = 0;
int exp = 0;
////////////////////
//menu stuff
////////////////////
string name;
int option;
////////////////////
//money
////////////////////
unsigned int mmoney = 1;
long double M$ = mmoney * 10000;
////////////////////
char LG[50][70]
{
  "    _________        ________            ________        ________    ",
  "   /         L      /        L          /        L      /        L   ",
  "  /   ____    L    /   ____   L        /   ____   L    /   ____   L  ",
  " /   /    L    L__/   /    L   L      /   /    L   L  /   /    L   L ",
  "/___/      L_________/      L___L    /___/      L________/      L___L",
  "                      Money              Monopoly                    "
  
};
int main() {
  cout << "Hello Sir... Hm, I can't seem to remember your name, do you mind telling me? ";
  cin >> name;
  cout << "Thank you Sir. " << name << ", the monopoly recently has been booming in natural resources, and would you know it, we have all of them. Your job is to sell the correct resources and level up, unlocking more items and upgrades. Also don't go bankrupt, well that's all you have to know, GO TO WORK... Sir." << endl;
  sleep(10);
  //display logo
  ////////////////////////////
  for (int i = 0; i < 7; i++){
    cout << LG[i] << endl;
    usleep(100000);
  }
  ////////////////////////////
  while(1){
    //menu
    ////////////////////////////////////////////////////
    cout << "         Money Monopoly         \nMMC:" << mmoney << " ($" << M$ <<")\nTimber:" << timber << "\nCoal:" << coal << "\nIron:" << iron << "\nLevel:" << level << "\nEXP:" << exp << "\n1)Go to market\n2)Upgrades\n3)coming soon\n4)leave :'( (please enter number to go to selection)\n";
    cin >> option;
    ////////////////////////////////////////////////////
    if (option == 1){
      cout << "\n         Money Monopoly         \nWelcome to the market please pick an option\n1)timber\n2)coal\n3)iron\n";
      cin >> currentshopoption;
      if (currentshopoption == 1){
        cout << "   timber   \n1)buy (MMC:1)\n2)sell (+MMC:1)\n";
        cin >> currentshopoption;
        if (currentshopoption == 1 && mmoney > 1){
          cout << "Thankyou for your purchase.\n";
          mmoney--;
          M$ = mmoney * 10000;
          timber++;
          exp = exp + 2;
          if (exp >= 6){
            cout << "LEVEL UP!\n";
            level++;
            exp = 0;
          }
        }
        else if (currentshopoption == 1 && mmoney <= 1){
          cout << "Sorry, not enough money...\n";
        }
        else if (currentshopoption == 2 && timber > 0){
          cout << "Thankyou for the supplies.\n";
          mmoney++;
          M$ = mmoney * 10000;
          timber--;
          currentshopoption = 0;
          exp = exp + 2;
          if (exp >= 6){
            cout << "LEVEL UP!\n";
            level++;
            exp = 0;
          }
        }
        else if (currentshopoption == 2 && timber <= 0){
          cout << "Sorry, not enough timber...\n";
          currentshopoption = 0;
        }
        else{
          cout << "Please enter an available option.\n";
          currentshopoption = 0;
        }
      }
      if (currentshopoption == 2){
        cout << "   coal   \n1)buy (MMC:1)\n2)sell (+MMC:1)\n";
        cin >> currentshopoption;
        if (currentshopoption == 1 && mmoney > 1){
          cout << "Thankyou for your purchase.\n";
          mmoney--;
          M$ = mmoney * 10000;
          coal++;
          exp = exp + 3;
          if (exp >= 6){
            cout << "LEVEL UP!\n";
            level++;
            exp = 0;
          }
        }
        else if (currentshopoption == 1 && mmoney <= 1){
          cout << "Sorry, not enough money...\n";
        }
        else if (currentshopoption == 2 && coal > 0){
          cout << "Thankyou for the supplies.\n";
          mmoney++;
          M$ = mmoney * 10000;
          coal--;
          exp = exp + 3;
          if (exp >= 6){
            cout << "LEVEL UP!\n";
            level++;
            exp = 0;
          }
        }
        else if (currentshopoption == 2 && coal <= 0){
          cout << "Sorry, not enough coal...\n";
        }
        else{
          cout << "Please enter an available option.\n";
          currentshopoption = 0;
        }
      }
      if (currentshopoption == 3 && isironactive == true){
        cout << "   iron   \n1)buy (MMC:2)\n2)sell (+MMC:2)\n";
        cin >> currentshopoption;
        if (currentshopoption == 1 && mmoney > 2){
          cout << "Thankyou for your purchase.\n";
          mmoney=mmoney-2;
          M$ = mmoney * 10000;
          iron++;
          exp = exp + 4;
          if (exp >= 8){
            cout << "LEVEL UP!\n";
            level++;
            exp = 0;
          }
        }
        else if (currentshopoption == 1 && mmoney <= 2){
          cout << "Sorry, not enough money...\n";
        }
        else if (currentshopoption == 2 && iron > 0){
          cout << "Thankyou for the supplies.\n";
          mmoney=mmoney+2;
          M$ = mmoney * 10000;
          iron--;
          exp = exp + 4;
          if (exp >= 8){
            cout << "LEVEL UP!\n";
            level++;
            exp = 0;
          }
        }
        else if (currentshopoption == 2 && iron <= 0){
          cout << "Sorry, not enough iron...\n";
        }
        else{
          cout << "Please enter an available option.\n";
          currentshopoption = 0;
        }
      }
      else if (currentshopoption == 3 && isironactive == false){
        cout << "Please purchase the iron upgrade from the upgrade shop.\n";
      }
      else{
        cout << "Please enter an available option.\n";
      }
    }
    else if (option == 2){
      if (level >= 5 && level <10){
        cout << "Welcome to the Upgrades Store, how may I help you\n1)Iron (MMC:1) (please enter number to go to selection)\n";
        cin >> currentoption;
        if (currentoption == 1 && mmoney > 1){
          cout << "Thankyou for your purchase.\n";
          mmoney--;
          M$ = mmoney * 10000;
          isironactive = true;
          iron = iron + 5;
        }
        else if (currentoption == 1 && mmoney <= 1){
          cout << "Sorry, but you don't have enough money to do that action.\n";
        }
        else {
          cout << "Please pick an available option.\n";
        }
      }
      else if(level >=10 && level <20){
        cout << "Welcome to the Upgrades Store, how may i help you\n1)Coal mine (MMC:5, iron:1, wood:3)\n2)Gold (MMC:5)\n";
        cin >> currentoption;
      }
      else{
        cout << "Sorry, Sir., but come back when you meet a shop's requirements.\n";
      }
    }
    else if (option == 3){
      cout << "Coming soon!\n";
    }
    else if (option == 4){
      usleep(1000000);
      cout << "Please come back again Sir. bye...";
      break;
    }
    else{
      cout << "Please enter a correct option Sir.\n";
    }
    exp = exp + 1;
    if (exp >= 6){
      cout << "LEVEL UP!";
      level++;
      exp = 0;
    }
  }

  return 0;
}
Fetching token
?