抽卡生存小游戏C++

 小游戏抽卡生存c++~~~

#include<iostream>
#include<ctime>
#include<cstdlib>
#include<windows.h>
#include<stdio.h>
#include<string.h>
#include<string>
using namespace std;
int cxpd=0;//0继续1停止 
int main()
{
	/*********************/
	int /*仓库*/ck[9]={0,0,0,0,0,0,4,1,1};//C级卡 B级卡 A级卡 R级卡 SR级卡 SSR级卡 萝卜罐头 能量棒 军用压缩饼干
	long long int /*金钱*/jq=100;
	long long int /*命运之沙*/myzs=0;
	long long int je=0;//饥饿值
	long long int sm=100;//生命值 
	int fh=0;//返回  
	system("color 9f");
	char name[40];
	system("title 抽卡生存"); 
	cout<<"你的名字是:"; 
	cin>>name;
	cout<<"\n\n\n";
	cout<<"@"<<name<<endl;
	cout<<"仔细阅读下面的内容:\n";
    cout<<"这是一场抽卡的生存游戏,抽到100张SSR卡,才能通关~\n";
    cout<<"命运之沙——积累可永久提高获得SSR卡的几率~\n"<<endl;
    cout<<"你愿意加入这场【抽卡】的生存游戏吗?\n" <<endl;
    cout<<"我愿意【Y】   我不愿意【N】:";
yym:
    char yymm;
	cin>>yymm;
	if (yymm=='Y'){
		cout<<"抽卡之旅现在开始~~~~~\n\n\n\n"; 
	} 
	else if (yymm=='N'){
		cout<<"好吧~~下次见~~~~";
		return 0;
	}
	else {
		cout<<"可以输入【Y】or【N】欧~~~~"<<endl;
		goto yym; 
	}
zt/*我的状态*/:
cout<<"       目前状况:"; 
cout<<"    饥饿值:"<<je;
if (je!=0){
	cout<<"!!!!!!!!!!!!!!!\n"; 
}
cout<<"    生命值:"<<sm;
if (sm!=100){
	cout<<"!!!!!!!!!!!!!!!\n"; 
	cxpd=1;
}
cout<<"    金钱:"<<jq<<endl;
cout<<"    命运之沙:"<<myzs<<endl;
cout<<"    仓库:"<<endl;
cout<<"    C级卡×"<<ck[0]<<" B级卡×"<<ck[1]<<" A级卡×"<<ck[2]<<endl; 
cout<<"    R级卡×"<<ck[3]<<" SR级卡×"<<ck[4]<<" SSR级卡×"<<ck[5]<<endl;
cout<<"    萝卜罐头×"<<ck[6]<<" 能量棒×"<<ck[7]<<" 军用压缩饼干×"<<ck[8]<<endl;
if (fh==3){
	goto hc2;
}
start:
	if (sm==0){
		cout<<"你失败了,下次再来吧~~~~~~~\n"; 
		cout<<"尊敬的冒险者,敬请期待下一个游戏,关注Brizza-Quzin"<<endl; 
		return 0;
	}
	if (je==100&&cxpd==0){
		sm-=1;
		fh=0;
		cxpd=0;
		goto zt;
	}
	if (sm!=100&&cxpd==1){
		cxpd=0;
	}
	if (ck[5]==100){
		cout<<"太棒了,你成功了~~~\n";
		cout<<"尊敬的冒险者,敬请期待下一个游戏,关注Brizza-Quzin"<<endl; 
		return 0; 
	}
	cout<<"\n"<<endl;
	cout<<"---------------------------------------------------\n";
	if (je!=100){
	je+=10; 	
	}
	cout<<"1.开始抽卡吧!  2.查看状态!   3.合成工坊!    4.商店!      5.寻宝!       6.赚钱小游戏!      7.吃饭了!"<<endl;	
	char kai;
	cout<<"你要做什么:";
	cin>>kai;
	if (kai=='1'){
		goto ksck;
	}
	else if (kai=='2'){
		fh=0;
		goto zt;
	}
	else if (kai=='3'){
		goto hc1;
	}
	else if (kai=='4'){
		goto sd1;
	} 
	else if (kai=='5'){
		goto xb;
	} 
	else if (kai=='6'){
		goto zq1;
	} 
	else if (kai=='7'){
		goto cf;
	} 
	else {
		cout<<"可以输入【1】【2】【3】【4】【5】【6】【7】欧~~~~"<<endl;
		goto start; 
	}
ksck:
	cout<<"开始抽卡吧!\n\n"<<endl;
	cout&l
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值