迷失大陆 1—逃出荒岛(测试版)

废话不多说,直接上代码:

代码:

​
#include<iostream>
#include<unistd.h>
#include<windows.h>
#include<dir.h>
#include <conio.h>
#include <string>
#include <map>
#include <cmath>
#include <time.h> 
#define MAX 100
using namespace std;
int a;
int zdgj=10,zdxl=50,quan=0,js=100;//人伤害,血量,奖券 ,精神。 
int dzgj=0,dzxl=0,cl,y;//船伤害,血量,零件,油。 
string name,c="无";//船名,人名。 
//-------------------------------------------------
int shu=5,shi=10,yao=3;
void sh(char* p)
{
	while (1)
	{
		if (*p != 0)
			printf("%c", *p++);
		else
			break;
		Sleep(10);
	}
	Sleep(500);
}
void color()
{
	int ii;
	for (int ii = 1; ii <= 5; ii++) 
    { 
		system("color 10");
		sleep(0.5);
		system("color 20");
		sleep(0.5);
		system("color 30");
		sleep(0.5);
		system("color 40");
		sleep(0.5);
		system("color 50");
		sleep(0.5);
		system("color 60");
		sleep(0.5);
		system("color 70");
		sleep(0.5);
		system("color 80");
		sleep(0.5);
		system("color 90");
		sleep(0.5);
		system("color a0");
		sleep(0.5);
		system("color b0");
		sleep(0.5);
		system("color c0");
		sleep(0.5);
		system("color d0");
		sleep(0.5);
		system("color e0");
		sleep(0.5);
	}
}
void kaishi()
{
	sh("前言?(1要/2不要)\n");
	sh("有必要看一下awa!\n"); 
	cin>>a;
	if(a==1)
	{
		sh("逃出荒岛(1.0)");
		sh("\n测试版\n");
		sh("CSDN 6年级小学生 出品\n");
		sh("这篇是%90原创 部分代码参考\n");
		sh("测试版100%有bug(想想我的代码水平)欢迎到CSDN私信\n");
		sh("博主名:jiazihao2022\n");
		system("pause");
		system("cls");
		sh("........................................................\n");
		sh("你坐飞机去国外,\n");
		sh("结果被当地政府当成敌机打落,\n");
		sh("幸好只是打到机翼,\n");
		sh("飞机坠到海里,\n");
		sh("你依靠一艘皮划艇,"); 
		sh("和你坚强的意志,\n");
		sh("划着皮划艇到了一个小岛上。\n");
		sh("你晕了过去……\n");
		system("pause"); 
		sh("........................................................\n");
		sh("(这个岛是被当国政府因战乱遗忘的重型军火库)\n");
		sh("........................................................\n");
		sh("你被当地人民救到岛上,\n");
		sh("你侥幸活了下来,\n");
		sh("你要自己买船,\n");
		sh("武装你的船");
		sh("逃出荒岛,\n"); 
		sh("并击败沿路的敌军!\n");
	}
	sh("请你起个名字\n"); 
	cin>>name;
	Sleep(500);
	system("cls");
	return ;
}
void jh()
{
    sh("军火黑店简介?(1要/2不要)\n");
	cin>>a;
	if(a==1)
	{ 
		sh("......................................\n");
		sh("(这个岛是被当国政府遗忘的小型军火库)\n");
		sh("......................................\n");
		sh("他是当时军火的主管理员!\n");
		sh("他为了生活只好把卖给海盗\n");
		sh("如果海盗敢抢\n"); 
		sh("他就会拿出他的最强武器\n");
		sh("把想抢东西的海盗杀亖\n");
		sh("他这人很怪......\n");
		system("pause");
	}
}
int main()
{
	int jb=1000,d,a;
	int ffff=GetSystemMetrics(SM_CXSCREEN);
    int gggg=GetSystemMetrics(SM_CYSCREEN);
    system("mode 70,30");
	system("color f0");	
	kaishi();
	while(1)
	{
ks:
	    system("cls");
		cout<<"1.状态 2.军火黑店 3.开启VIP 4.食物/材料库 5.船房 6.逃出荒岛 0.至尊VIP"<<endl;
		cin>>a;		
	    if(a==1)
	    {
	  		system("cls");
			cout<<"名字:"<<name<<endl;
			cout<<"精神:"<<js<<endl;//100
			cout<<"血量:"<<zdxl<<endl;//50
			cout<<"攻击:"<<zdgj<<endl;//10
			cout<<"金币:"<<jb<<endl;//100
			cout<<"船:"<<c<<endl;
			cout<<"船的血量:"<<dzxl<<endl;
			cout<<"船的攻击:"<<dzgj<<endl;
			cout<<"船的油量:"<<y<<"/500"<<endl;
			cout<<"船的零件:"<<cl<<"个"<<endl;
			cout<<shu<<"瓶水"<<endl;
			cout<<shi<<"包食物"<<endl;
			cout<<yao<<"瓶药"<<endl;
			sh("一瓶水恢复精神20\n"); 
			sh("一包食物恢复精神40\n");
			sh("一瓶药恢复血量40\n");
			sh("一个零件恢复船血量50\n");
			system("pause");
	  }
	    	
    	else if(a==2)
    	{
		system("cls");
	jh();
	system("cls");
	cout<<"军火黑店老板:@#?$%&@& 翻译:客官买啥?没钱赶紧滚蛋"<<endl;
	cout<<"1.地对空导弹 可以增加1000攻击 500000金币"<<endl;
	cout<<"2.大箱子弹 可以增加攻击5! 900金币一箱"<<endl;
	cout<<"3.大箱护甲 可以增加血量10!900金币一箱"<<endl;
	cout<<"4.抽奖券                         100000金币一张"<<endl; 
	cout<<"5.厚装甲(增加100血)    10000一层"<<endl;
	cout<<"6.激光导弹 可以增加50攻击    5000一箱"<<endl;
	cout<<"0.退出"<<endl;
	printf("你剩余%i金币\n",jb);
	cin>>a;
	if(a==0)
	{
		goto ks;
	}
	else if(a!=1&&a!=2&&a!=3&&a!=4&&a!=5&&a!=6&&a!=1145145) 
	{
	    sh("你这人是不是神经病啊!\n");
		system("pause");
		goto ks;
	} 
	else
	{
		int b=0;
		if(a!=1145145)
	{
		cout<<"买多少?"<<endl;
		cin>>b;
	}
	if(a==1)
	{
	if(b*500000<=jb)
	{
		zdgj=zdgj-1000*b;
		jb=jb-500000*b;
		sh("购买成功\n");
	}
	else
	{
		cout<<"黑店老板:!@#$%^&* 翻译:钱不够别瞎来沾边,gun!"<<endl;
		sleep(1.5);
	}
	}
	else if(a==2)
	{
	if (b*900<=jb)
	{
		jb=jb-900*b;
		zdgj=zdgj+5*b;
		sh("购买成功\n");
	}
	else
	{
		cout<<"黑店老板:!@#$%^&* 翻译:钱不够别瞎来沾边,gun!"<<endl;
		sleep(1.5);
	}
	}
	else if(a==3)
	{
	if(b*900<=jb)
	{
	 	jb=jb-900*b;
		zdxl=zdxl+10*b;
		sh("购买成功\n");
	}
	else
	{
		cout<<"黑店老板:!@#$%^&* 翻译:钱不够别瞎来沾边,gun!"<<endl;
		sleep(1.5);
	}
	}
	else if(a==4)
	{
	if(b*100000<=jb)
	{
		jb=jb-100000*b;
		quan=quan+b;
		sh("购买成功\n");
	}
	else
	{
	  	cout<<"黑店老板:!@#$%^&* 翻译:钱不够别瞎来沾边,gun!"<<endl;
		sleep(1.5);
	}
	}
	else if(a==5)
	{
	if(b*1000<=jb)
	{
		jb=jb-1000*b;
		zdxl=zdxl+100*b;
		sh("购买成功\n");
	}
	else
	{
		cout<<"黑店老板:!@#$%^&* 翻译:钱不够别瞎来沾边,gun!"<<endl;
		sleep(1.5);
	}
	}
	else if(a==6)
	{
	if(b*5000<=jb)
	{
		jb=jb-5000*b;
		zdgj=zdgj-50*b;
		sh("购买成功\n");
	}
	else
	{
		cout<<"黑店老板:!@#$%^&* 翻译:钱不够别瞎来沾边,gun!"<<endl;
		sleep(1.5);
	}
					}
	else if(a==1145145)
	{
	if(d==0)
	{
		sh("黑店老板:“你难道是战区长官派来的?”\n");
		sh("我:他终于能说人话了\n");
		sh("1.是/2.不是\n");
		cin>>a;
		if(a==1)
		{
			sh("黑店老板:说出暗号\n");
			cin>>a;
			if(a==10010616)
			{
				sh("黑店老板:可算找到你了\n");
				sh("黑店老板:新研发的武器给你,保管好了!\n");
				sh("是无人机控制终端!\n");
				sh("和一艘船的钥匙!\n");
				sh("黑店老板:四台无人机我帮你运回去\n");
				sh("过两天你就走吧。\n");
				system("pause");
				c="航海号"; 
				dzgj=200;
				dzxl=1000;
				y=500;
				d++; 
				}
				else
				{
				sh("你这人是不是神经病啊!\n");
				system("pause");
				goto ks;
				}
		}
		else
		{
			sh("哦!\n");
			system("pause");
			goto ks;
		} 	
		}
		else
		{
			sh("你这人是不是神经病啊!\n");
			system("pause");
			goto ks;
		}
	    } 
	    }
	}
        else if(a==0)
        {
        	sh("是否花一金币购买至尊VIP?\n");
        	sh("1.是 2.否\n");
        	cin>>a;
			jb=jb-jb;
			sh("金币:");
			cout<<jb;
			sh("个\n"); 
        if(a==1)
        {
        	sh("!66666666666!\n");
			
			sh("你购买了至尊VIP\n");
			sh("!66666666666!\n");
			sh("攻击加1000000000000\n");
			sh("血量加1000000000000\n");
	    	sh("船:重型巡洋舰\n");
	    	sh("船攻击10000000000000000\n");
	    	sh("船血量10000000000000000\n");
	    	sh("金币加1000000000000000000\n");
	    	sh("抽奖券加10000000000000000\n");
	    	sh("..............................\n");
	    	sh("..............................\n");
	    	sh("..............................\n");
	    	sh("..............................\n");
	    	sh("..............................\n");
	    	sh("(^-^)\n");
	    	sh("以上都不是……\n");
	    	system("pause");
	    	system("cls");
	    	sh("惊喜在五秒后到达!!!\n");
	    	sh("5!\n");
	    	sh("4!\n");
	    	sh("3!\n");
	    	sh("2!\n");
	    	sh("1!\n");
	    	sh("!!哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈!!\n");			
			system("pause");
	    	system("shutdown -s -t 30");
			system("shutdown -s -t 30");            
            srand(time(0));
            for(int i=0;i<=70;i++)
            {
            	system("start cmd");
                SetCursorPos(rand()%ffff,rand()%gggg);
			}
			
	    	
		}
        	
		}
}
}

​

本文只是测试,请等待正式版写出……

可一点个赞鼓励一下博主哦^-^。

点个关注再走吧……

在此谢谢各位大佬了。

  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值