From 1f0dfe56f6d2f9530d20d7b25ac0b3a189521a3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=81=93=E6=A0=87=20=C2=B7=20=E8=90=BD=E5=BD=A1?= <2076220350@qq.com> Date: Wed, 17 Nov 2021 18:59:55 +0800 Subject: [PATCH] Update game.cpp --- game.cpp | 1724 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 1693 insertions(+), 31 deletions(-) diff --git a/game.cpp b/game.cpp index fb4b812..675a231 100644 --- a/game.cpp +++ b/game.cpp @@ -1,34 +1,1696 @@ +/* +关于所有函数的解释 +main12:主界面 +main: 一开始进入的主界面 +board: 一些选项 +其它的可以百度一下,都是英文(有些是拼音) +有重要的变量 +option:通用选择 +游戏说明: +此游戏包含很多玩法 +有迷宫,技能,等级制,战斗等等 +可以自由去探索 +*/ + +#include #include -#include +#include +#include +#include +#include +#include +#include +#include using namespace std; -const int N=2e5+1; -struct t{ - long long end; - long long len; - long long zend; -}work[N]; -int n; -bool cmp(t a,t b){ - if(a.zend==b.zend){ - return a.end>b.end; - } - return a.zend>b.zend; -} -int main(){ - scanf("%d",&n); - for(int i=1;i<=n;i++){ - scanf("%d%d",&work[i].end,&work[i].len); - work[i].zend=work[i].end+work[i].len; - } - sort(work+1,work+1+n,cmp); - long long xend=work[1].end; - for(int i=2;i<=n;i++){ - if(xend> shengfen; + if(!fang(shengfen)) + { + cout << "未成年人, 禁止进入" << endl; + return 0; +} + start(); + pretreatment(); + cout<>attributes; + attribute[attributes]=1; + board(); + cin>>option; + if(option==1) + { + maps(); + if(exits==1) + { + return 0; + } + main12(); + } + else if(option==2) + { + bag(); + main12(); + } + else if(option==3) + { + cout<<"已删除" <>name; +} + +void pretreatment() +{ + int num=1; + for(int i=100; i<=10000; i+=100) + { + blood[num]=i; + experience[num]=i; + attack[num]=5+(i/100)*2; + defense[num]+=i/100; + num++; + } + for(int i=1; i<=100; i++) + { + bags[i-1].cnn=i; + } +} + +void board() +{ + cout<>option; + if(option==1) + { + lingdong(); + main12(); + } + else if(option==2) + { + zhanchang(); + main12(); + } + else if(option==3) + { + shenming(); + main12(); + } + else if(option==4) + { + huo(); + main12(); + } + else if(option==5) + { + bin(); + main12(); + } + else if(option==6) + { + jin(); + main12(); + } + else if(option==7) + { + shu(); + main12(); + } + else if(option==8) + { + lu(); + main12(); + } + else + { + exits=1; + } +} + +void bag() //bug +{ + int sum=0; + for(int i=0; i<=20; i++) + { + for(int j=0; j<5; j++) + { + if(!flag_bag[i]) + cout<>option; + if(option==1) + { + cout<<"请输入丢弃的序号"; + cin>>option; + for(int i=0; i<100; i++) + { + if(option==bags[i].cnn) + { + flag_bag[i]=1; + for(int j=i+1; j<100; j++) + { + bags[j].cnn--; + } + cout<<"丢弃成功"; + return; + } + } + } +} + +void box() +{ + int sum=0; + for(int i=0; i<20; i++) + { + for(int j=0; j<5; j++) + { + if(!flag_box[i]) + cout<>option; + if(option==1) + { + Sleep(500); + cout<<"请输入丢弃的序号"; + cin>>option; + for(int i=0; i<100; i++) + { + if(option==bags[i].cnn) + { + flag_box[i]=1; + for(int j=i+1; j<100; j++) + { + bags[j].cnn--; + } + cout<<"丢弃成功"; + return; + } + } + } +} + +int main12() +{ + if(grade==0) + { + grade++; + } + if(jinyan>=experience[grade]) + { + grade++; + jinyan-=experience[grade-1]; + } + if(exits==1) + { + return 0; + } + board(); + cin>>option; + if(option==1) + { + maps(); + system("cls"); + if(exits==1) + { + return 0; + } + main12(); + } + else if(option==2) + { + bag(); + system("cls"); + main12(); + } + else if(option==3) + { + box(); + system("cls"); + main12(); + } + else if(option==4) + { + equips(); + system("cls"); + main12(); + } + else if(option==5) + { + skill_board(); + system("cls"); + main12(); + } +} + +void lingdong() +{ + cout<<"欢迎来到灵洞"<>option; + if(option==1) + { + cout<<"你遇见了——"<>times; + for(int i=1; i<=times; i++) + { + cout<>option; + int exits1=0; + if(option==1) + { + while(!exits1) + { + cout<<"挖矿中..."<>option; + if(option==2) + { + exits1=1; + } + } + } + else + { + cout<<"你遇到了---"<3) + { + grade-=3; + } + else + { + grade=1; + } + shushen=0; + } + cout<<"1.撸树 2.闲逛(与恶魔干架)"; + cin>>option; + int exits1=0; + if(option==1) + { + while(!exits1) + { + cout<<"撸树中..."<>option; + if(option==1) + { + cout<<"你成功逃跑"<>option; + if(option==2) + { + exits1=1; + } + } + } + else + { + cout<<"你遇到了---"<> n; + if(n == 1) + { + ten(); + } + else if(n == 2) + { + eleven(); + } + else if(n == 3) + { + twelve(); + } + else if(n == 4) + { + thirteen(); + } + else if(n == 5) + { + forteen(); + } } + -- GitLab