自己凹的(简称闲的)
  • 板块灌水区
  • 楼主Herosword
  • 当前回复2
  • 已保存回复2
  • 发布时间2025/1/19 19:57
  • 上次更新2025/1/19 23:21:10
查看原帖
自己凹的(简称闲的)
1011215
Herosword楼主2025/1/19 19:57
#include<bits/stdc++.h>

using namespace std;

int sjs(int n)
{
	srand(time(0));
	return rand()%n;
}

int main()
{
	int xl=1000,dfxl=0,exb=0,fr=0,hxjqd=0,sr=0,xyz=0;
	string df="";
	system("color 04");
	cout<<"游戏背景:"<<endl;
	cout<<"    由于罗辑面壁者的身份,遭到了ETO(Earth Three-Body Organization,地球三体组织)的绑架,这回,他被绑到了ETO一处戒备森严的基地里,你需要与各种三体人物对战,战胜对方,得到随机装备或物品,深入敌营拯救罗辑。"<<endl;
	_sleep(500);
	cout<<endl<<endl<<"--------------------------------------------------------"<<endl<<endl; 
	cout<<"大刘:年轻人,告诉我你的名字。(提示:为了测试游戏方便,在此处输入“L-S-S”可开挂,若想体验正常难度游戏可以随意输入)"<<endl;
	string name;
	cin>>name;
	if(name=="L-S-S")
	{
		cout<<"大刘:你总算来了,幕后读者,去干掉那群倔骨头吧!"<<endl;
		xl=1000000;
		exb=1000000;
		fr=1000000;
		hxjqd=1000000;
	}
	else
	{
		cout<<"大刘:去干掉那群倔骨头吧!"<<endl;
	}
	while(1)
	{
		cout<<"5秒后继续"<<endl;
		_sleep(5000);
		system("cls");
        _sleep(1000);
		cout<<endl<<endl<<"--------------------------------------------------------"<<endl<<endl;
	    cout<<"你要去哪里?(备注:可重复前往,输入数字序号即可,下同)"<<endl<<endl<<"你的血量:"<<xl<<endl<<endl<<"1.归零者森林(敌方血量:500,敌方伤害:100)"<<endl<<"2.歌者悬崖(敌方血量:1000,敌方伤害:200)"<<endl<<"3.水滴山洞(敌方血量:1500,敌方伤害:400)"<<endl<<"4.ETO基地(敌方血量:2000,敌方伤害:800,得到1011号宇宙后才能进入)"<<endl;
		cout<<endl<<endl<<endl<<"神秘男人:年轻人,拿着1011号宇宙来ETO基地找我。"<<endl;
	    cin>>sr;
    	cout<<endl<<endl<<"--------------------------------------------------------"<<endl<<endl;
    	_sleep(1000);
		system("cls");
    	if(sr==1)
    	{
    		dfxl=500;
    		df="归零者";
    		cout<<"归零者";
    	}
    	else if(sr==2)
    	{
    		dfxl=1000;
    		df="歌者"; 
    		cout<<"歌者"; 
    	}
    	else if(sr==3)
    	{
    		dfxl=1500;
    		df="水滴"; 
    		cout<<"水滴"; 
    	}
    	else if(sr==4)
    	{
    		if(xyz==0)
    		{
    			cout<<"未达到条件,无法进入"<<endl;
    			continue;
    		}
    		else
    		{
    			dfxl=2000;
    			df="伊文斯";
    			cout<<"神秘男人:哈哈中招了,我就是伊文斯,1011号宇宙我收下了,你也得死了。"<<endl<<endl<<"伊文斯"; 
				xyz=0;
			}
    	}
    	else
    	{
    		cout<<"输入错误"<<endl;
    		continue;
		}
    	int sr1; 
    	cout<<"来了。"<<endl<<endl<<"1.跑 2.攻击(敌方血量-100) 3.二向箔(敌方血量-200) 4.飞刃(敌方血量-400) 5.恒星级氢弹(敌方血量-500)"<<endl<<"备注:若输入以上选项之外的数字,视为弃权。"<<endl;
        cout<<"你的血量:"<<xl<<endl<<endl;
		cout<<"你的装备:"<<endl<<"二向箔*"<<exb<<endl<<"飞刃*"<<fr<<endl<<"恒星级氢弹*"<<hxjqd<<endl<<"1011号宇宙*"<<xyz<<endl<<endl;
		cin>>sr1;
		system("cls");
        cout<<endl;
        if(sr1==1)
        {
        	continue;
		}
		else if(sr1==2)
		{
			dfxl-=100;
		}
		else if(sr1==3)
		{
			if(exb==0)
			{
				cout<<"你没有。"<<endl;
			}
			else
			{
				exb--;
				dfxl-=200;
			}
		}
		else if(sr1==4)
		{
			if(fr==0)
			{
				cout<<"你没有。"<<endl;
			}
			else
			{
				fr--;
				dfxl-=400;
			}
		}
		else if(sr1==5)
		{
			if(hxjqd==0)
			{
				cout<<"你没有。"<<endl;
			}
			else
			{
				hxjqd--;
				dfxl-=500;
			}
		}
		else
		{
			cout<<"视为弃权。"<<endl;
		}
        cout<<endl;
		while(dfxl>0&&xl>0)
		{
			if(df=="归零者")
			{
				xl-=100;
			}
			else if(df=="歌者")
			{
				xl-=200;
			}
			else if(df=="水滴")
			{
				xl-=400;
			}
			else if(df=="伊文斯")
			{
				xl-=800;
			}
			if(xl<=0)
			{
				break;
			}
			cout<<"敌方所剩血量"<<dfxl<<endl<<df<<"攻击了你,所剩血量:"<<xl<<endl;
			cout<<df<<"再次攻击"<<endl;
        	cout<<endl<<endl<<"1.跑 2.攻击(敌方血量-100) 3.二向箔(敌方血量-200) 4.飞刃(敌方血量-400) 5.恒星级氢弹(敌方血量-500)"<<endl<<"备注:若输入以上选项之外的数字,视为弃权。"<<endl<<endl;
			cout<<"你的装备:"<<endl<<"二向箔*"<<exb<<endl<<"飞刃*"<<fr<<endl<<"恒星级氢弹*"<<hxjqd<<endl<<"1011号宇宙*"<<xyz<<endl<<endl;
            cin>>sr1;
			system("cls");
            cout<<endl;
            if(sr1==1)
            {
            	break;
		    }
		    else if(sr1==2)
		    {
			    dfxl-=100;
		    }
		    else if(sr1==3)
		    {
			    if(exb==0)
			    {
				    cout<<"你没有。"<<endl;
			    }
			    else
			    {
					exb--;
				    dfxl-=200;
			    }
		    }
		    else if(sr1==4)
		    {
			    if(fr==0)
			    {
				    cout<<"你没有。"<<endl;
			    }
			    else
			    {
					fr--;
				    dfxl-=400;
			    }
		    }
		    else if(sr1==5)
		    {
			    if(hxjqd==0)
			    {
				    cout<<"你没有。"<<endl;
			    }
			    else
			    {
					hxjqd--;
				    dfxl-=500;
			    }
		    }
		    else
		    {
		    	cout<<"视为弃权。"<<endl;
		    }
		    cout<<endl;
		}
		if(xl<=0)
		{
			cout<<"你输了,任务失败"<<endl;
			_sleep(1000);
			return 0;
		}
		else if(dfxl<=0)
		{
		    if(df=="归零者")
			{
				xl+=700;
			}
			else if(df=="歌者")
			{
				xl+=900;
			}
			else if(df=="水滴")
			{
				xl+=1200;
			}
			else if(df=="伊文斯")
			{
				cout<<"伊文斯倒下了,你成功拯救了罗辑。"<<endl;
				_sleep(1000);
				return 0;
			}
			cout<<df<<"倒下,血量加";
			if(df=="归零者")
			{
				cout<<"700,";
			}
			else if(df=="歌者")
			{
				cout<<"900,";
			}
			else if(df=="水滴")
			{
				cout<<"1200,";
			}
			cout<<"剩余血量:"<<xl<<",";
			int sj=sjs(4);
			cout<<"获得:";
			switch(sj)
			{
				case 0:
					cout<<"二向箔"<<endl;
					exb++;
					break;
				case 1:
					cout<<"飞刃"<<endl;
					fr++;
					break;
				case 2:
					cout<<"恒星级氢弹"<<endl;
					hxjqd++;
					break;
				case 3:
				    cout<<"1011号宇宙"<<endl;
					xyz++;
					break; 
				defult:
				    cout<<"什么也没有"<<endl;
			}
		}
	}
	return 0;
}

2025/1/19 19:57
加载中...