#include <iostream>
#include <string>
#include <sstream>
#include <windows.h>
using namespace std;
stringstream ss;
string nu1,nu2;
string talk01 = "Hello!Dream. \nHello!Piggod. \nI want heni PPPPP. \nOK,coming coming! \nOh!yes.Oh yes!\nOh!I'm happy! Oh!I'm happy!"; //出场特效
string talk02 = "Please choose your language( 1 = English ; 2 = Chinese(beta) ): ||---|| Please cin your speed:"; //对话
string talk03 = "You can't choose this! Cin again!\n"; //错误
string talk04 = "Welcome to the ZOMBIES WORLD! You need run out this city! ||---|| You eat 0.25 food and water every day.";//介绍
string talk05 = "Day walk:/150000 \n";//信息
int main() {
int ans = 0,sp = 90,fo = 2,wa = 2,sl = 0,da = 1;//ans回答,sp速度,fo食物,wa水,sl路程,da天数
bool out = 0;
Sleep(1500);
for (int i = 0; i <= 110; i++) { //talk01
cout << talk01[i];
Sleep(sp);
}
Sleep(1500);
while (ans != 1) {
system("cls");
for (int i = 0; i <= 63; i++) { //talk02
cout << talk02[i];
Sleep(sp);
if (i == 63) {
cin >> ans;
if (ans != 1) {
for (int j = 0; j <= 33; j++) {
cout << talk03[j];
Sleep(sp);
}
}
}
}
}
while (true) {
sp = 90;
system("cls");
for (int i = 72; i <= 93; i++) {
cout << talk02[i];
Sleep(sp);
if (i == 93) {
cin >> sp;
if (sp <= 0) {
sp = 90;
for (int j = 0; j <= 33; j++) {
cout << talk03[j];
Sleep(sp);
}
} else {
out = true;
break;
}
}
}
if (out == true) break;
}
system("cls");
for (int i = 0; i <= 56; i++) { //talk04
cout << talk04[i];
Sleep(sp);
}
Sleep(1500);
system("cls");
for (int i = 67; i <= 105; i++) { //talk04
cout << talk04[i];
Sleep(sp);
}
Sleep(1500);
system("cls");
for (int i = 0; i <= 19; i++) { //talk05
cout << talk05[i];
Sleep(sp);
for (int j = 0; j <= da / 10; j++) {
ss.clear();
ss << da;
ss >> nu1;
}
for (int j = 0; j <= sl / 10; j++) {
ss.clear();
ss << sl;
ss >> nu2;
}
if (i == 3) {
for (int j = 0; j <= nu1.size(); j++) {
cout << nu1[j];
if (j >= 1) Sleep(sp);
}
}
if (i == 9) {
for (int j = 0; j <= nu2.size(); j++) {
cout << nu2[j];
if (j > 1) Sleep(sp);
}
}
}
return 0;
}
//v.0.1.1