-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTale.cpp
More file actions
268 lines (255 loc) · 9.64 KB
/
Copy pathTale.cpp
File metadata and controls
268 lines (255 loc) · 9.64 KB
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
// ********************************************************************************
/// <summary>
///
/// </summary>
/// <created>ʆϒʅ,01.04.2019</created>
/// <changed>ʆϒʅ,13.10.2019</changed>
// ********************************************************************************
#include "Packers.h"
#include "Tale.h"
#include "Console.h"
Narrator::Narrator ()
{
//xx TODO add: funny story of the game! :)
title = u8"The Narrator";
colours [0] = F_YELLOW;
colours [1] = F_bWHITE;
scenes [0][0] = u8"It is not sure, what the giant sees up there!";
scenes [0][1] = u8"Supercomputer still dates on load process of stone age!";
scenes [0][2] = u8"Thus the next scene is foreseen to let us wait a little!";
scenes [1][0] = "The spot pointed by the giant is interesting.";
scenes [1][1] = "He lives at a planet full of little creatures.";
scenes [1][2] = "Their history written in stone script is full of hunger.";
scenes [2][0] = u8"Years after the first Packer presence on earth,";
scenes [2][1] = u8"yet at stone age, at the teeth of continuous evolution,";
scenes [2][2] = u8"the packing process is obvious above!";
currentScene = 1;
firstMenuSentences [0] = u8"I feel your enthusiasm to involve yourself,";
firstMenuSentences [1] = u8"jet are you sure, whether you survive in stone age?! :)";
firstMenuSentences [2] = u8"Well, undecorated involvement is still involvement...";
firstMenuSentences [3] = u8"Oh yeah, tools and decorations are always appreciated!";
secondMenuSentences [0] = u8"Stones and wands are available!";
secondMenuSentences [1] = u8"The last one tried to decorate too much,";
secondMenuSentences [2] = u8"it ended up nasty in stone age! :)";
secondMenuSentences [3] = u8"The age is still nasty,";
secondMenuSentences [4] = u8"decoration isn't jet above strength. :)";
secondMenuSentences [5] = u8"At least a little class after so many years!";
secondMenuSentences [6] = u8"Yeah, decoration empty handed is still decoration!";
secondMenuSentences [7] = u8"Pay attention to your nose, decoration isn't important!";
startPoints [0] = { SCREEN_W - 60, SCREEN_H - 10 };
startPoints [1] = { SCREEN_W - 60, SCREEN_H - 6 };
};
void Narrator::insertion ( const unsigned short& instance )
{
// guide of passed argument code:
// 1: clear four first line
// 2: clear two last line
// first digit: element
// second digit: sphere
// third digit: sentence
COORD pointOne { startPoints [0] };
COORD pointTwo { startPoints [1] };
if ( instance == 1 )
{
for ( unsigned char i = 0; i < 4; i++ )
{
colourInserter ( u8" ", pointOne );
pointOne.Y += 1;
}
} else
if ( instance == 2 )
{
pointOne.Y += 4;
for ( unsigned char i = 0; i < 2; i++ )
{
colourInserter ( u8" ", pointOne );
pointOne.Y += 1;
}
} else
{
unsigned char tempOne { 0 };
unsigned char tempTwo { 0 };
unsigned char tempThree { 0 };
tempOne = ( instance / 100 );
tempTwo = ( ( instance % 100 ) / 10 );
tempThree = ( ( instance % 100 ) % 10 );
int rnd { 0 };
switch ( tempOne )
{
case 1:
// scenes:
for ( unsigned char i = 0; i < 3; i++ )
{
colourInserter ( scenes [tempTwo][i], colours [0], pointOne );
pointOne.Y += 1;
}
currentScene = tempTwo;
break;
case 2:
// menus:
if ( tempTwo == 1 )
{
if ( tempThree == 0 )
{
rnd = ( rand () % 2 + 1 );
switch ( rnd )
{
case 1:
colourInserter ( firstMenuSentences [0], colours [1], pointTwo );
pointTwo.Y += 1;
colourInserter ( firstMenuSentences [1], colours [1], pointTwo );
break;
case 2:
colourInserter ( firstMenuSentences [2], colours [1], pointTwo );
break;
}
} else
colourInserter ( firstMenuSentences [3], colours [1], pointTwo );
} else
if ( tempTwo == 2 )
{
switch ( tempThree )
{
case 0:
rnd = ( rand () % 2 + 1 );
if ( rnd == 1 )
colourInserter ( secondMenuSentences [0], colours [1], pointTwo );
else
{
colourInserter ( secondMenuSentences [1], colours [1], pointTwo );
pointTwo.Y += 1;
colourInserter ( secondMenuSentences [2], colours [1], pointTwo );
}
break;
case 1:
colourInserter ( secondMenuSentences [3], colours [1], pointTwo );
pointTwo.Y += 1;
colourInserter ( secondMenuSentences [4], colours [1], pointTwo );
break;
case 2:
colourInserter ( secondMenuSentences [5], colours [1], pointTwo );
break;
case 3:
colourInserter ( secondMenuSentences [6], colours [1], pointTwo );
break;
case 4:
colourInserter ( secondMenuSentences [7], colours [1], pointTwo );
break;
}
}
break;
}
}
};
const unsigned char& Narrator::get ( void )
{
return currentScene;
};
Giant::Giant ()
{
title = u8"A giant:";
theGiant [0] = u8" ;;;;;;";
theGiant [1] = u8" ;;;;;;;;";
theGiant [2] = u8" ;;;;;;;;";
theGiant [3] = u8" ;;■;;■;;";
theGiant [4] = u8"■";
theGiant [5] = u8" ;;;▌▐;;;";
theGiant [6] = u8"▌▐";
theGiant [7] = u8" ;;▄▄▄▄;;";
theGiant [8] = u8"▄▄▄▄";
theGiant [9] = u8" ;;;;;;";
theGiant [10] = u8" ;;;;;;;;;;;;;;; ;;";
theGiant [11] = u8" ;;;;;;;;;;;;;;;; ;; ;;;;";
theGiant [12] = u8" ;;;;;;;;;;;;;;;;;; ;;;;;;;";
theGiant [13] = u8";; ;;;;;;;;;;;;♥;;;;;;; ;;;;";
theGiant [14] = u8"♥";
theGiant [15] = u8" ;; ;;;;;;;;;;;;;;;;;;;;;; ;;;;";
theGiant [16] = u8" ;; ;;;; ;;;;;;;;;;;;;; ;;;;; ;;;;";
theGiant [17] = u8" ;; ;;;; ;;;;;;;;;;;;;; ;;;;;;;";
theGiant [18] = u8" ;; ;;;; ;;;;;;;;;;;;;; ;;;";
theGiant [19] = u8" ;; ;;;; ;;;;;;;;;;;;;;";
theGiant [20] = u8" ;; ;;;; ;;;;;;;;;;;;;";
theGiant [21] = u8" ;; ;;;; ;;;;;;;;;;;;;";
theGiant [22] = u8" ;;; ;;;; ;;;;;;;;;;;;;";
theGiant [23] = u8" ;;;;;; ;;;;;;;;;;;;;";
theGiant [24] = u8" ;;;; ;;;;;;;;;;;;";
theGiant [25] = u8" ;; ;;;;;;;;;;;;";
theGiant [26] = u8" ;; ;;;;; ;;;;;;";
theGiant [27] = u8" ;; ;;;;; ;;;;;";
theGiant [28] = u8" ;; ;;;;; ;;;;;";
theGiant [29] = u8" ;; ;;;;;; ;;;;;";
theGiant [30] = u8" ;; ;;;;;;;;;;;";
theGiant [31] = u8" ;; ;;;;;;;;;;";
theGiant [32] = u8" ;; ;;;;;;;;";
theGiant [33] = u8" ;; ;;;;;;;;;;;";
theGiant [34] = u8" ;; ;;;;; ;;;;;;;";
theGiant [35] = u8" ;; ;;;; ;;;;;";
theGiant [36] = u8" ;; ;;;;; ;;;;";
theGiant [37] = u8" ;; ;;;;; ;;;;";
colourOne = F_bWHITE;
colourTwo = F_CYAN;
colourThree = F_bRED;
sentances [0] = u8"\"Look at these new puny two legs creatures!\"";
sentances [1] = u8"\"Look how they dance and chew away!\"";
startPoints [0] = { 3, SCREEN_H - 35 };
startPoints [1] = { 50, SCREEN_H - 40 };
COORD tempOne ( startPoints [0] );
COORD tempTwo ( tempOne );
for ( size_t i = 0; i < 38; i++ )
{
if ( i == 4 )
{
tempOne.Y -= 1;
tempTwo.Y = tempOne.Y;
tempTwo.X = tempOne.X + 23;
colourInserter ( theGiant [i], colourTwo, tempTwo );
tempTwo.X = tempOne.X + 26;
colourInserter ( theGiant [i], colourTwo, tempTwo );
} else
if ( i == 6 )
{
tempOne.Y -= 1;
tempTwo.Y = tempOne.Y;
tempTwo.X = tempOne.X + 24;
colourInserter ( theGiant [i], colourTwo, tempTwo );
} else
if ( i == 8 )
{
tempOne.Y -= 1;
tempTwo.Y = tempOne.Y;
tempTwo.X = tempOne.X + 23;
colourInserter ( theGiant [i], colourTwo, tempTwo );
} else
if ( i == 14 )
{
tempOne.Y -= 1;
tempTwo.Y = tempOne.Y;
tempTwo.X = tempOne.X + 27;
colourInserter ( theGiant [i], colourThree, tempTwo );
} else
colourInserter ( theGiant [i], colourOne, tempOne );
tempOne.Y += 1;
}
COORD tempThree ( startPoints [1] );
colourInserter ( title, colourTwo, tempThree );
tempThree.Y += 2;
colourInserter ( tempThree );
std::string str { "" };
for ( char element : sentances [0] )
{
str += element;
colourInserter ( str, colourOne );
str = "";
std::this_thread::sleep_for ( std::chrono::milliseconds ( 50 ) );
}
tempThree = startPoints [1];
tempThree.Y += 3;
colourInserter ( tempThree );
for ( char element : sentances [1] )
{
str += element;
colourInserter ( str, colourOne );
str = "";
std::this_thread::sleep_for ( std::chrono::milliseconds ( 50 ) );
}
};