荒岛求生1.1.2正式版来啦!

发布时间:2026/8/26 15:15:36
荒岛求生1.1.2正式版来啦! 知道大家在机房里上课很无聊于是……老规矩留下关注与点赞呗本次更新修复了部分已知bug即使不够完善但我仍会努力趋于完美求求了代码在这里……还不快去点赞#includebits/stdc.h #includecstdio #includecstdlib #includectime #includewindows.h #includeconio.h #include chrono using namespace std; int jiaoyi_cishu; int guaji; int dengji1,jingyan,jingyan_shangxian; int jinbi 1000; int cunhuo 0,shibai 0;//成功存活次数 int day 1; int yourenwaichuma; int beibao[110] {0, 3, 3, 3, 2}; int len 4; int renshu 4; int suiji; int tianqi; int nandu; int xunlian_jieshi, xunlian_jieshui, xunlian_zhixie, xunlian_naili; int jieshi, jieshui, zhixie, naili; int xuanze; string beibao_ming[110] {, 1.香蕉5点血量15饥饿值, 1.苹果10点血量10饥饿值, 3.矿泉水25水分, 4.尖叫水30水分30点体力}; string paishei; string shifoujieshu; char name[110]; bool jieshu(); void zhuye(); void youxi_kaishi(); void cundang(); void dudang(); void xingjian(); void jiaocheng(); void gerenxinxi(); void buxingl(); void jieshuyu(); void pairenwaichu(); void print_zhuangtai(); void kaitouyu(); void xiaohao(); void chifan(); void xunlian(); void guanyuciyouxi(); void shangdian(); void tiaozhan(); void shou(); void huodong(); struct p { string name; int ji100; int ke100; int xl100; int waichu0,jitian; //0在家1外出 int sw0,tc0; int pl100; //疲劳值30不能外出 } p[5]; void huodong(){ } void tiaozhan(){ system(cls); cout是否继续\n; cout1.是2.否\n; cinxuanze; system(cls); if(xuanze2) zhuye(); cout选择成功正在进入\n; Sleep(rand()%50003000); system(cls); cout加载成功\n; system(cls); // zhuye(); } void shangdian(){ system(cls); cout1.香蕉出售价300 买入价500 持有量beibao[1]\n; cout2.苹果出售价300 买入价500 持有量beibao[2]\n; cout3.矿泉水出售价200 买入价250 持有量beibao[3]\n; cout4.尖叫水出售价350 买入价600 持有量beibao[4]\n; xuanzegetch()-0; int mairu[4]{500,500,250,600}; int chushou[4]{300,300,200,350}; for(int i0;i4;i){ if(ixuanze){ system(cls); cout买1还是卖2\n; xuanzegetch()-0; if(xuanze1){ cout买多少\n; int a; cina; if(a*mairu[i1]jinbi) cout资金不足\n; else{ cout购买成功\n; jinbijinbi-a*mairu[i]; beibao[i1]a; } } else{ cout卖多少\n; int a; cina; if(abeibao[i]) cout物品不够\n; else{ cout购买成功\n; beibao[i]-a; jinbia*chushou[i]; } } break; } } Sleep(1000); system(cls); zhuye(); } void xunlian(){ system(cls); cout请问您想训练哪项训练一项消耗5000元v\n; cout1.节食 等级jieshi\n; cout2.节水 等级jieshui\n; cout3.止血 等级zhixie \n; cout4.耐力 等级naili\n; xuanzegetch()-0; system(cls); if(jinbi5000){ if(xuanze1) { if(jieshi10) { xunlian_jieshi1; cout正在训练中……\n; Sleep(10000); system(cls); cout训练完成\n; }else{ cout等级已达到上限\n; } }else if(xuanze2) { if(jieshui10){ xunlian_jieshui1; cout 正在训练中……\n; Sleep(10000); system(cls); cout训练完成\n; }else{ cout等级已达到上限\n; } }else if(xuanze3){ if(zhixie10){ xunlian_zhixie1; cout正在训练中……\n; Sleep(10000); system(cls); cout训练完成\n; }else{ cout等级已达到上限\n; } } else if(xuanze3) { if(naili10) { xunlian_naili 1; cout正在训练中……\n; Sleep(10000); system(cls); cout训练完成\n; }else{ cout 等级已达到上限\n; } } }else cout资金不足请参加游戏挣钱\n; Sleep(1000); system(cls); zhuye(); return; } void zhuye() { //主页 system(cls); cout 1.新建存档\n; cout 2.查看个人信息\n; cout 3.查看新手教程\n; cout 4.训练\n; cout 5.开始游戏\n; cout6.商店\n; cout7.活动\n; cout8.关于此游戏\n; cout9.退出游戏\n; xuanzegetch()-0; switch (xuanze) { case 1: xingjian(); break; case 2: gerenxinxi(); break; case 3: jiaocheng(); break; case 4: xunlian(); break; case 5: youxi_kaishi(); break; case 6: shangdian(); break; case 7: cout未完工\n; Sleep(1000); //huodong(); zhuye(); break; case 8: guanyuciyouxi(); } return; } void youxi_kaishi() {//主页-开始游戏 kaitouyu(); for (;; day) { if (yourenwaichuma ! 0) { if (p[yourenwaichuma].jitian 0) { p[yourenwaichuma].xl p[yourenwaichuma].xl - rand() % 11 - 10 xunlian_zhixie; p[yourenwaichuma].pl p[yourenwaichuma].pl - rand() % 31 - 50 xunlian_naili; yourenwaichuma 0; for (int i 1; i len; i) { beibao[i] rand() % 5; } if (nandu 2) { p[yourenwaichuma].xl - 10; p[yourenwaichuma].pl - 10; } else if (nandu 3) { p[yourenwaichuma].xl - 15; p[yourenwaichuma].pl - 15; } } else p[yourenwaichuma].jitian--; } cout 第 day 天\n; if (jieshu()) break; tianqi rand() % 3; if (tianqi 0) cout 天气晴\n; else if (tianqi 1) cout 天气雨\n; else if (tianqi 2) cout 天气多云\n; buxingl(); print_zhuangtai(); if (yourenwaichuma 0)pairenwaichu(); system(cls); chifan(); //85%啥也没有10%找到钱5%遇到野兽 suiji rand() % 100 1; if (suiji 1 suiji 10) {//找到钱 int q rand() % 100 1; cout p[yourenwaichuma].name 在外找到钱 q 枚\n; jinbi q; Sleep(2000); } else if (suiji 11 suiji 15){ shou(); } xiaohao(); system(cls); if (renshu 0 || p[1].sw 1) break; } if (renshu 0 || p[1].sw 1) { jieshuyu(); shibai; } else { cout 恭喜你成功完成荒岛求生的节目\n; cunhuo; } jingyanday*3; dengjidengjijingyan/jingyan_shangxian; jingyan%jingyan_shangxian; jingyan_shangxiandengji*100; cout setw(50) 按任意键重启\n; getch(); system(cls); cout 重启中; Sleep(1000); cout -; Sleep(1000); cout -; Sleep(1000); cout -; Sleep(1000); system(cls); renshu 4; for(int i1;i4;i){ p[i].sw0; } zhuye(); return; } void shou(){ int yeshou rand() % 2; if (yeshou 0) { //遇到猴子 cout 你遇到了一群猴子你要\n; cout 1.给它们3根香蕉\n; cout 2.驱赶\n; xuanzegetch()-0; if (xuanze 1 beibao[1] 3) { beibao[1] - 3; cout 你损失了三根香蕉\n; Sleep(1000); } else if (xuanze 2) { if (beibao[1] 3) cout 你们没食物了; while (int a rand() % 4 1) { if (p[a].waichu 0 p[a].sw 0) { if (a 1) cout name 出去驱赶猴子了\n; else cout p[a].name 出去驱赶猴子了\n; p[a].xl p[a].xl - rand() % 21 - 10 xunlian_zhixie; if (nandu 2) p[a].xl - 10; else if (nandu 3) p[a].xl - 20; Sleep(1000); break; } } } } if(yeshou1){//野人 coutp[yourenwaichuma].name发现了一群野人是否上前问好\n; cout1.问候他全家 2.问好 3.溜走\n; xuanzegetch()-0; system(cls); int haohuairand()%1; switch (xuanze) { case 1: cout正在打架中……\n; coutp[yourenwaichuma].name受伤了但收获颇丰\n; beibao[rand()%41]rand()%51; p[yourenwaichuma].xl-rand()%3010; break; case 2: if(haohuai0){ cout对方十分友好你收获了许多东西\n; beibao[rand()%41]rand()%51; } else{ cout对方十分的不友好你们打了起来\n; p[yourenwaichuma].xl-rand()%141; } break; default: cout在外要小心小心凉凉……\n; break; } } Sleep(3000); system(cls); return; } void cundang() { //存档 system(cls); Sleep(1000); FILE*line; line fopen(hdqs, w); fputs(name, line); fclose(line); FILE*lin; fprintf(lin, %d %d %d %d %d %d %d %d %d %d %d %d %d , jinbi, cunhuo, shibai, jieshi, jieshui, zhixie, naili,dengji,jingyan,beibao[1],beibao[2],beibao[3],beibao[4]); fclose(lin); system(cls); return; } void dudang() { //读档 FILE*line; line fopen(hdqs, r); fgets(name, 110, line); fclose(line); FILE*lin; lin fopen(荒岛求生, r); fscanf(lin, %d %d %d %d %d %d %d %d %d %d %d %d %d, jinbi, cunhuo, shibai, jieshi, jieshui, zhixie, naili,dengji,jingyan,beibao[1],beibao[2],beibao[3],beibao[4]); fclose(lin); xunlian_jieshi jieshi; xunlian_jieshui jieshui; xunlian_zhixie zhixie; xunlian_naili naili; jingyan_shangxiandengji*100; system(cls); return; } void xingjian() { //建档 system(cls); cout 新建存档会覆盖上一个存档且无法找回是1否2继续\n; xuanzegetch()-0; if (xuanze 1) { cout 请输入用户名\n; cin name; cout 建档成功\n; jinbi1000; jieshijieshuizhixienailijingyanshibai0; dengji1; } Sleep(2000); system(cls); zhuye(); return; } void jiaocheng() {//教程 system(cls); cout 荒岛求生玩过吧\n; Sleep(1000); cout 其实这个游戏十分简单\n; Sleep(1000); cout 规则如下\n; Sleep(1000); cout 1.如果你成功存活了30难度130天饥饿值、水分、血量、疲劳值下降速度较慢、60难度260天饥饿值、水分、血量、疲劳值下降速度中等、90难度3.90天饥饿值、水分、血量、疲劳值下降速度较快天即可输入1234567890结束游戏\n; Sleep(1000); cout 2.如果角色的血量为0那么该角色退出游戏\n; Sleep(1000); cout 3.如果角色的疲劳程度为“累趴了”时则该角色不能外出探索\n; Sleep(1000); cout 4.请注意大小写输入非正确输入容易出bug\n; cout 按任意键退出\n; getch(); system(cls); zhuye(); return; } void gerenxinxi() { //主页-个人信息 system(cls); cout 姓名 name endl; cout等级dengji升级还需jingyan_shangxian-jingyan点经验\n; cout 资金 jinbi endl; cout 参加次数 cunhuo shibai endl; cout 存活次数 cunhuo endl; cout 称号\n; if (jinbi 100000 jinbi 1000000) cout 十万富翁\n; else if (jinbi 1000000 jinbi 10000000) cout 百万富翁\n; else if (jinbi 100000000)cout 亿万富翁\n; if (100.0 * cunhuo / (cunhuo shibai) 50 100.0 * cunhuo / (cunhuo shibai) 60) cout 生存小能手\n; else if (100.0 * cunhuo / (cunhuo shibai) 60 100.0 * cunhuo / (cunhuo shibai) 80) cout 生存大师\n; else if (100.0 * cunhuo / (cunhuo shibai) 80)cout 贝爷级别\n; cout 按任意键退出 endl; getch(); system(cls); zhuye(); return; } void buxingl() {//主页-正式游戏-快不行了 for (int i 1; i 4; i) { if (p[i].sw 1 p[i].tc 0) { cout 检测到 p[i].name 快要不行了是1否2消耗1200元进行抢救 endl; xuanzegetch()-0; if (xuanze 1 jinbi 1200) { cout 抢救成功 endl; p[i].sw 0; p[i].ji 50; p[i].ke 50; p[i].xl 50; p[i].pl 70; jinbi - 1200; } else if (xuanze 1 jinbi 1200) { cout 金币不足无法抢救 endl; p[i].tc 1; } else p[i].tc 1; } } return; } void jieshuyu() { //主页-正式游戏-结束语 cout 最终你撑不住了被节目组接回去了游戏失败\n; Sleep(2000); zhuye(); return; } void pairenwaichu() { //主页-正式游戏-外派 cout 是否派人外出1.是2.不是 endl; xuanzegetch()-0; cout endl; if (xuanze 1) { cout 派谁 endl; cin paishei; for (int i 1; i 4; i) { if (paishei p[i].name p[i].sw 0 p[i].pl 30) { p[i].waichu 1; p[i].jitian rand() % 3 1; yourenwaichuma i; } } } return; } void print_zhuangtai() { //主页-正式游戏-输出四人状态 cout 4人的状态 endl; for (int i 1; i 4; i) { if (p[i].sw 0 yourenwaichuma ! i) { if (i 1) cout name ; else cout p[i].name ; if (p[i].ji 70) cout 饱腹感很饱; else if (p[i].ji 50) cout 饱腹感良好; else if (p[i].ji 30)cout 饱腹感有点饿; else cout 饱腹感快饿死了; cout ; if (p[i].ke 70) cout 水分很充足; else if (p[i].ke 50) cout 水分良好; else if (p[i].ke 30)cout 水分有点渴; else cout 水分快渴死了; cout ; if (p[i].xl 70) cout 血量很多; else if (p[i].xl 50) cout 血量良好; else if (p[i].xl 30)cout 血量有点晕; else cout 血量快死了; cout ; if (p[i].pl 70) cout 疲劳值精神充沛; else if (p[i].pl 50) cout 疲劳值良好; else if (p[i].pl 30) cout 疲劳值有点累; else cout 累趴了; } else if (p[i].sw 0) cout p[i].name 外出中; else cout p[i].name 已退出; cout endl; cout endl; } cout 背包 endl; for (int i 1; i len; i) { if (beibao[i] 0) cout beibao_ming[i] : beibao[i] ; } cout endl; cout endl; return; } bool jieshu() { //主页-正式游戏-是否结束这次游戏 if (nandu1day 30) { cout 是否结束 endl; cin shifoujieshu; if (shifoujieshu 1234567890) { jinbi 19999; system(cls); return true; } } else if(nandu2day60){ cout 是否结束 endl; cin shifoujieshu; if (shifoujieshu 1234567890) { jinbi 19999; system(cls); return true; } } else if(nandu3day90){ cout 是否结束 endl; cin shifoujieshu; if (shifoujieshu 1234567890) { jinbi 29999; system(cls); return true; } } return false; } void kaitouyu() { //主页-正式游戏-开头语 system(cls); /*cout是否进入挑战模式1/2\n; xuanzegetch()-0; if(xuanze1){ tiaozhan(); return; }*/ cout 请选择难度1-3; cin nandu; cout \n选择成功\n; Sleep(1000); system(cls); string s 欢迎来到荒岛求生; for (int i 0; i s.size(); i) { cout s[i]; Sleep(25); } Sleep(975); system(cls); s 你现在一共有4人看你能活几天; for (int i 0; i s.size(); i) { cout s[i]; Sleep(25); } Sleep(975); system(cls); s 现在开始吧; for (int i 0; i s.size(); i) { cout s[i]; Sleep(25); } Sleep(975); system(cls); cout 签约合同\n; cout 1、一但签约不得反悔\n; cout 2、如果你活到; switch (nandu) { case 1: cout 30; break; case 2: cout 60; break; default: cout 90; break; } cout 天可得; switch (nandu) { case 1: cout 9999; break; case 2: cout 19999; break; default: cout 29999; break; } cout 元按1234567890结束这次活动。\n ; cout 签约人输入另外3个人的名字\n; cin p[2].name p[3].name p[4].name; system(cls); cout 正在前往荒岛中; Sleep(1000); cout -; Sleep(1000); cout -; Sleep(1000); cout -; Sleep(1000); cout -; Sleep(1000); system(cls); return; } void xiaohao() { //主页-正式游戏-消耗 for (int i 1; i 4; i) { if (p[i].sw 0) { p[i].ji p[i].ji - rand() % 6 - 10 xunlian_jieshi; p[i].ke p[i].ji - rand() % 6 - 10 xunlian_jieshui; if (nandu 2) { p[i].ji - 10; p[i].ke - 10; } else if (nandu 3) { p[i].ji - 15; p[i].ke - 15; } if (p[i].waichu 0) { p[i].pl rand() % 16; } if (p[i].ji 0) { p[i].ji 0; p[i].xl p[i].xl - rand() % 11 - 10 xunlian_zhixie; } if (p[i].ke 0) { p[i].ke 0; p[i].xl p[i].xl - rand() % 11 - 10 xunlian_zhixie; } if (p[i].ke 100) { p[i].ke 100; } if (p[i].ji 100) { p[i].ji 100; } if (p[i].xl 0) { p[i].sw 1; renshu--; } if (p[i].xl 100) { p[i].xl 100; } if (p[i].pl 100) { p[i].pl 100; } if (p[i].pl 0) { p[i].pl 0; } } } return; } void chifan() { //主页-正式游戏-吃饭 cout第day天\n; if (tianqi 0) cout 天气晴\n; else if (tianqi 1) cout 天气雨\n; else if (tianqi 2) cout 天气多云\n; print_zhuangtai(); for (int i 1; i 4; i) { if (yourenwaichuma ! i p[i].sw 0) { if (i 1) cout 是1否2给 name 吃的\n; else cout 是1否2给 p[i].name 吃的\n; xuanzegetch()-0; if (xuanze 1) { cout 吃点什么选项\n; xuanzegetch()-0; beibao[xuanze]--; switch (xuanze) { case 1: p[i].ji 15; p[i].xl 5; break; case 2: p[i].ji 10; p[i].xl 10; break; case 3: p[i].ke 25; break; default: p[i].ke 30; p[i].pl 30; break; } } system(cls); print_zhuangtai(); } } return; } void guanyuciyouxi(){ system(cls); cout游戏名荒岛求生\n; cout作者凌空\n; cout版本号1.1.1正式版\n; cout作品介绍心领神会\n; cout其他按1\n; xuanzegetch()-0; if(xuanze1){ system(cls); cout游戏名荒岛求生\n; cout主编凌空\n; cout副编Dream_XuQing\n; cout版本号1.1.2正式版\n; cout作品介绍心领神会\n; cout其他1.漏洞问题\n; cout 有木有人能帮忙解决存档问题很急物品存档\n; cout 2.优化\n; cout 这个 https://www.luogu.com.cn/user/1372510主编 or这个 https://blog.csdn.net/chezhe20121108?typeblog主编 or https://www.luogu.com.cn/user/1499574副编\n; cout 要是都没有的话自己干着急吧\n; cout 3.更新\n; cout 挑战模式即将来袭虽然不知道时间……\n; getch(); } system(cls); zhuye(); return; } int main() { coutsetw(49)荒岛求生\n; coutsetw(50)主编凌空\n; coutsetw(60)----------按任意键开始----------\n; getch(); system(cls); dudang(); zhuye(); cundang(); return 0; }