乞丐模拟器V0.11(接上篇文章很优质 很劣质)
#include #include<windows.h> #include<stdlib.h> #include<time.h> #include using namespace std; int gold = 20;//金币 int Full = 35;//饱食度 int mood = 35; int tz =50; int iq = 25; void ed(int a){ for(int i=0;i<a;i++){ cout<<endl; } } void pbt_1(int t){ cout<<“体质减少了”<<t<<endl; tz-=t; } void pbg_2(int o){ gold-=o; cout<<“金币减少了”<<o<<endl; } void pbm_3(int d){ mood-=d; cout<<“心情减少了”<<d<<endl; } void pbi_4(int s){ iq+=s; cout<<“智商增加了”<<s<<endl; } int main(){ //准备 bool nd = true;//next day简称“nd”
int mr = 45;
int a = 25;
string name;
int days = 1;
//开始
ed(15);
cout<<"你的名字?";
cout<<endl;
cin>>name;
cout<<"------------------"<<endl;
cout<<"----乞丐模拟器----"<<endl;
cout<<"-------V0.11------"<<endl;
cout<<"----1开始 关闭0---"<<endl;
cout<<"---请开全屏游玩---"<<endl;
cout<<"------------------"<<endl;
int choose;
cin>>choose;
system("cls");
MessageBox(NULL,(LPCTSTR)TEXT("作者hanruize_2021"), (LPCTSTR)TEXT("声明"), MB_OK);
MessageBox(NULL,(LPCTSTR)TEXT("版权归作者"), (LPCTSTR)TEXT("声明"), MB_OK);
MessageBox(NULL,(LPCTSTR)TEXT("转载请声明"), (LPCTSTR)TEXT("声明"), MB_OK);
MessageBox(NULL,(LPCTSTR)TEXT("本次更新:"), (LPCTSTR)TEXT("声明"), MB_OK);
MessageBox(NULL,(LPCTSTR)TEXT("体质、心情、智商,两种事件及死法"), (LPCTSTR)TEXT("声明"), MB_OK);
MessageBox(NULL,(LPCTSTR)TEXT("优化了许多地方。"), (LPCTSTR)TEXT("声明"), MB_OK);
MessageBox(NULL,(LPCTSTR)TEXT("体质:饱食度或保水度小于25减2(后面依次递增)可以通过药来增加"), (LPCTSTR)TEXT("声明"), MB_OK);
MessageBox(NULL,(LPCTSTR)TEXT("心情:等于零时失败,可以通过药来增加"), (LPCTSTR)TEXT("声明"), MB_OK);
MessageBox(NULL,(LPCTSTR)TEXT("智商:可以增加乞讨的收益,可以通上学来增加"), (LPCTSTR)TEXT("声明"), MB_OK);
MessageBox(NULL,(LPCTSTR)TEXT("开始游戏吧!"), (LPCTSTR)TEXT("开始!!"), MB_OK);
days =1;
switch(choose){
while(true){
case 1:{
if(tz==0||tz<0){//石了
ed(15);
cout<<"--------------------------------------------------"<<endl;
MessageBox(NULL,(LPCTSTR)TEXT("你死了"), (LPCTSTR)TEXT("声明"), MB_OK);
MessageBox(NULL,(LPCTSTR)TEXT("原因:体质不足"), (LPCTSTR)TEXT("声明"), MB_OK);
cout<<name<<"死了"<<endl;
cout<<"你存活了"<<days<<"天"<<endl;
return 0;
}
else if(mood==0||mood<0){
system("cls");
cout<<"--------------------------------------------------"<<endl;
MessageBox(NULL,(LPCTSTR)TEXT("你自杀了"), (LPCTSTR)TEXT("声明"), MB_OK);
MessageBox(NULL,(LPCTSTR)TEXT("原因:心情不足"), (LPCTSTR)TEXT("声明"), MB_OK);
cout<<name<<"想不开自杀了" <<endl;
cout<<"你存活了"<<days<<"天"<<endl;
return 0;
}
else if(days%10 == 0){
cout<<"你被人欺负了";
pbt_1(5);
pbg_2(10);
pbm_3(10);
}
ed(15);
cout<<"--------------------------------------------------"<<endl;
cout<<"名字:"<<name<<endl;
cout<<"天数: ";
for(int i=0;i<days;i++){
cout<<"■";
}
cout<<days;
cout<<endl;
cout<<"饱食度:";
for(int i=0;i<Full;i++){
cout<<"■";
}cout<<Full<<endl;
cout<<"保水度: ";
for(int i=0;i<mr;i++){
cout<<"■";
}
cout<<mr<<endl;
cout<<"金币数:";
for(int i=0;i<gold;i++){
cout<<"■";
}
cout<<gold<<endl;
cout<<"体制: ";
for(int i=0;i<tz;i++){
cout<<"■";
}
cout<<tz<<endl;
cout<<"心情: ";
for(int i=0;i<mood;i++){
cout<<"■";
}
cout<<mood<<endl;
cout<<"智商: ";
for(int i=0;i<iq;i++){
cout<<"■";
}
cout<<iq<<endl;
cout<<"--------------------------------------------------"<<endl;
cout<<"选择你要干的事:"<<endl;
cout<<"输入1进行自杀"<<endl;
cout<<"输入2进行乞讨"<<endl;
cout<<"输入3睡觉来跳过这一天"<<endl;
cout<<"输入4进入↓↓"<<endl;
cout<<"--------商店----"<<endl;
cout<<"输入6上学(需要40金币)"<<endl;
if(gold==60||gold>60){
cout<<"输入7进入KTV"<<endl;
}
int choose_2;
cin>>choose_2;
switch(choose_2){
case 1:{
system("cls");
ed(15);
cout<<"--------------------------------------------------"<<endl;
cout<<"你自杀了"<<endl;
cout<<"名字:"<<name<<"|"<<"天数:"<<days<<endl;
MessageBox(NULL,(LPCTSTR)TEXT("你自杀了"), (LPCTSTR)TEXT("声明"), MB_OK);
MessageBox(NULL,(LPCTSTR)TEXT("原因:自愿"), (LPCTSTR)TEXT("声明"), MB_OK);
return 0;
}
case 2:{
system("cls");
cout<<"金币++!"<<endl;
cout<<"原有金币:"<<gold<<"枚"<<endl;
srand((unsigned)time(NULL));
gold+=rand()%iq;
cout<<"现有金币:"<<gold<<"枚"<<endl;
nd = true;
break;
}
case 3:{
system("cls");
nd = true;
break;
}
case 4:{
system("cls");
ed(15);
cout<<"--------------------------------------------------"<<endl;
cout<<"商店:"<<endl;
cout<<"现有金币:"<<gold<<endl;
cout<<"包子按1 6gold(回复4饱食度)"<<endl;
cout<<"面条按2 5gold(回复5饱食度)"<<endl;
cout<<"凉水按3 3gold(回复5保水度)"<<endl;
cout<<"药按 4 8gold(回复5体质,将饱食度、保水度、体制增、心情加10)"<<endl;
cout<<"返回"<<endl;
int choose_3;
cin>>choose_3;
switch(choose_3){
case 1:{//商店
if(gold>6||gold==6){//韩睿泽
system("cls");
ed(15);
cout<<"--------------------------------------------------"<<endl;
cout<<"成功!";
cout<<"饱食度回复4!"<<endl ;
gold = gold-6;
Full+=4;
mr--;
nd = false;
break;
}
else{
system("cls");
ed(15);
cout<<"--------------------------------------------------"<<endl;
cout<<"金币不足!"<<endl;
pbm_3(a);
nd = false;
break;
}
}
case 2:{
if(gold>6||gold==6){//韩睿嘉
system("cls");
ed(15);
cout<<"--------------------------------------------------"<<endl;
cout<<"成功!"<<endl;
cout<<"饱食度回复5!"<<endl ;
gold = gold-6;
Full+=5;
mr--;
nd = false;
break;
}
else{
system("cls");
ed(15);
cout<<"--------------------------------------------------"<<endl;
cout<<"金币不足!"<<endl;
pbm_3(a);
nd = false;
break;
}
break;
}
case 3:{
if(gold>3||gold==3){//水
system("cls");
ed(15);
cout<<"--------------------------------------------------"<<endl;
cout<<"饱水度回复5!" <<endl;
cout<<"成功!"<<endl;
gold = gold-3;
mr+=5;
nd = false;
break;
}
else{
system("cls");
ed(15);
cout<<"--------------------------------------------------"<<endl;
pbm_3(a);
nd = false;
break;
}
case 4:{
if(gold>8||gold==8){//药
system("cls");
ed(15);
cout<<"--------------------------------------------------"<<endl;
cout<<"饱食度、保水度、体制增、心情加10!" <<endl;
cout<<"成功!"<<endl;
gold = gold-8;
mr+=10;
Full+=10;
tz+=10;
mood+=10;
nd = false;
break;
}
else{
system("cls");
ed(15);
cout<<"--------------------------------------------------"<<endl;
cout<<"金币不足!"<<endl;
pbm_3(a);
nd = false;
break;
}
}
case 5:{
nd = false;
break;
}
break;
}
}
break;
nd =false;
}//商店
case 6:{
system("cls");
gold-=40;
cout<<"虽然你的样子不招人待见,"<<endl;
cout<<"但老师们都很认真的教你。"<<endl;
cout<<"一天过去了。你的智商增加了!"<<endl;
iq++;
nd = true;
cout<<"--------------------------------------------------"<<endl;
break;
}
case 7:{
system("cls");
nd =true;
cout<<"你一天都放声歌唱"<<endl;
cout<<"心情加10"<<endl;
mood+=10;
cout<<"--------------------------------------------------"<<endl;
break;
}
}//大
}
if(nd == true){
days++;
Full--;
mr--;
//生病
if(Full==25||Full<25||mr==25||mr<25){
bool flag =true;
if(flag == true){
cout<<"你生病了"<<endl;
flag = false;
}
a++;
mood-=a;
tz-=a;
cout<<"体质减少"<<a<<endl;
cout<<"心情减少"<<a<<endl;
cout<<"请及时治疗"<<endl;
}
}
}
case 2:{
return 0;
break;
}
}
return 0;
}
|