版本比较
多功能游戏机(内含转载)
正文
增加 196 行删除 196 行
25 行未改动262728293031323334353637383940414243444546474849505152535455565 行未改动62636465666768697028 行未改动9910010110210310410510610710810911011111211311411511611711811912012112212312432 行未改动15715815916016116216316416516616716816917017117217317417517617746 行未改动22422522622722822923023123223323 行未改动2572582592602612622632642652662672682692702712722735 行未改动27928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131229 行未改动3423433443453463473483493504 行未改动3553563573583593603613623634 行未改动3683693703713723733743753765 行未改动38238338438538638738838939013 行未改动404405406407408409410411412413414415392 行未改动全部展开8088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518525 行未改动8588598608618628638648658667 行未改动87487587687787887988088188288388488588688788888989089189225 行未改动9189199209219229239249259262 行未改动92993093193293393493593693717 行未改动95595695795895996096196296311 行未改动975976977978979980981982983104 行未改动全部展开10881089109010911092109310941095109633 行未改动11301131113211331134113511361137113845 行未改动118411851186118711881189119011911192210 行未改动全部展开1403140414051406140714081409141014117 行未改动1419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144727 行未改动14751476147714781479148014811482148365 行未改动154915501551155215531554155515561557155815596 行未改动15661567156815691570157115721573157413 行未改动1588158915901591159215931594159515964 行未改动160116021603160416051606160716081609161016111612161316141615647 行未改动全部展开226322642265226622672268226922702271306 行未改动全部展开257825792580258125822583258425852586529 行未改动全部展开311631173118311931203121312231233124267 行未改动全部展开3392339333943395339633973398339934003 行未改动34043405340634073408340934103411341230 行未改动3443344434453446344734483449345034512 行未改动3454345534563457345834593460346134623 行未改动34663467346834693470347134723473347424 行未改动349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035217 行未改动3529353035313532353335343535353635378 行未改动35463547354835493550355135523553355415 行未改动35703571357235733574357535763577357811 行未改动35903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362254 行未改动36773678367936803681368236833684368579 行未改动37653766376737683769377037713772377364 行未改动38383839384038413842384338443845384611 行未改动385838593860386138623863386438653866386738683869387038713872387338743875387638779 行未改动388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392348 行未改动39723973397439753976397739783979398039813982398339843985398639873988398939905 行未改动39963997399839994000400140024003400415 行未改动402040214022402340244025402640274028136 行未改动全部展开416541664167416841694170417141724173417441754176417741784179418041814182418341844185418668 行未改动42554256425742584259426042614262426342644265418 行未改动全部展开4684468546864687468846894690469146922 行未改动4695469646974698469947004701470247034 行未改动47084709471047114712471347144715471623 行未改动47404741474247434744474547464747474847494750475147524753475447552 行未改动47584759476047614762476347644765476628 行未改动479547964797479847994800480148024803128 行未改动全部展开49324933493449354936493749384939494074 行未改动501550165017501850195020502150225023286 行未改动全部展开53105311531253135314531553165317531840 行未改动5359536053615362536353645365536653677 行未改动537553765377537853795380538153825383257 行未改动全部展开56415642564356445645564656475648564998 行未改动574857495750575157525753575457555756463 行未改动全部展开622062216222622362246225622662276228151 行未改动全部展开638063816382638363846385638663876388320 行未改动全部展开67096710671167126713671467156716671731 行未改动674967506751675267536754675567566757290 行未改动全部展开70487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708034 行未改动71157116711771187119712071217122712313 行未改动713771387139714071417142714371447145714611 行未改动715871597160716171627163716471657166716771687169717071716 行未改动71787179718071817182718371847185718671877188718940 行未改动723072317232723372347235723672377238271 行未改动全部展开751075117512751375147515751675177518190 行未改动全部展开77097710771177127713771477157716771724 行未改动774277437744774577467747774877497750285 行未改动全部展开80368037803880398040804180428043804413 行未改动80588059806080618062806380648065806637 行未改动81048105810681078108810981108111811276 行未改动81898190819181928193819481958196819712 行未改动8210821182128213821482158216821782187 行未改动82268227822882298230823182328233823428 行未改动8263826482658266826782688269827082712 行未改动82748275827682778278827982808281828244 行未改动83278328832983308331833283338334833583368337833883398340834110 行未改动83528353835483558356835783588359836055 行未改动8416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443161 行未改动全部展开860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862925 行未改动8655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867722 行未改动87008701870287038704870587068707870826 行未改动87358736873787388739874087418742874365 行未改动88098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883231 行未改动88648865886688678868886988708871887288738874887542 行未改动891889198920892189228923892489258926892789288929893089318932893389348935893689378938893925 行未改动void Color(int a){if(dark) return;//白if(a==0) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);//绿if(a==1) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN);//红if(a==2) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED);//蓝if(a==3) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_BLUE);//粉if(a==4) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_BLUE);//黄if(a==5) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN);//灰if(a==6) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);//棕if(a==7) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_RED|FOREGROUND_GREEN);//紫if(a==8) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_BLUE);//随机if(a == -1) Color(rand() % 8);}void SetPos(COORD a)// set cursor{HANDLE out=GetStdHandle(STD_OUTPUT_HANDLE);SetConsoleCursorPosition(out, a);}5 行未改动}void HideCursor(){CONSOLE_CURSOR_INFO cursor_info = {1, 0};SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &cursor_info);}char input()28 行未改动int id;string txt;int color;int hard;int level; //挖掘等级(0=徒手 1=木 2=石 3=铁 4=钻石 5=合金)string name;bool fluid; //是否为流体(可以穿越 能够替换成方块)};BLOCK block[] = //方块{{0, "□", 0, 2000000000, 100, "基岩", false},{1, "■", 6, 200, 1, "石头", false},{2, "▓ ", 7, 45, 0, "泥土", false},{3, "▓ ", 6, 45, 0, "砂砾", false},{4, "■", 5, 55, 0, "木头", false},{5, "※", 0, 300, 2, "铁矿石", false},{6, "∷", 0, 500, 2, "铁块", false},{7, "※", 5, 340, 3, "金矿石", false},{8, "∷", 5, 600, 3, "金块", false},{9, "※", 3, 480, 3, "钻石矿石", false},{10, "∷", 3, 900, 3, "钻石块", false},{11, "▓ ", 1, 10, 0, "树叶", false},{12, "■", 3, 2000000000, 100, "水", true},{13, "□", 2, 2000000000, 100, "岩浆", true},{14, "□", 0, 5000, 4, "真正的基岩", false},32 行未改动struct ITEM{int id;int hurt;int speed; //每个短刻的挖掘进度int level;string name;int rare; //稀有度 白0<绿1<蓝2<紫3<幻4};ITEM item[] = //物品{{0, 0, 0, 0, "空气", 0},{1, 2, 25, 1, "木镐", 0},{2, 5, 0, 1, "木剑", 0},{3, 3, 50, 2, "石镐", 0},{4, 6, 0, 2, "石剑", 0},{5, 0, 0, 0, "铁锭", 0},{6, 5, 90, 3, "铁镐", 0},{7, 9, 0, 3, "铁剑", 0},{8, 0, 0, 0, "金锭", 1},46 行未改动struct BUFF{int id;string name;int level; //等级 默认为0 1级以上显示在玩家属性页面中int time; //单位: short_tick 降至0后等级降至0级};BUFF buff[] = //效果{23 行未改动int color;int hp;int ap;bool power; //能否摧毁沿路方块bool boss;int xp;int x;int y;};ENTITY entity[] ={{0, "普通小怪", "[]", 2, 50, 5, false, false, 3, 0, 0},{1, "精英小怪", "[]", 5, 100, 10, false, false, 6, 0, 0},{2, "王者小怪", "<>", 5, 200, 20, true, false, 12, 0, 0},5 行未改动};const int entity_max = 7;int gamemode = 0; //0=生存 1=创造 2=极限int short_tick = 0, tick = 0; //短刻(每秒10次)和构造刻(每秒1次)BLOCK world[2400][1200]; //地图 x0~2399 y0~1199BLOCK fkl[5]; //方块栏ITEM wpl[5]; //物品栏int box_fk_num[block_max]; //箱子方块栏int box_wp_num[item_max]; //箱子物品栏ARMOR kjl = armor[0]; //盔甲栏 做出盔甲立即替换const int xgmax = 5; //可获得的效果总数BUFF xgl[xgmax]; //效果栏int xgnum; //已拥有BUFFint fknum[5], wpnum[5]; //数量(max:64)int now = 0; //目前手持方块/物品 0~4方块 5~9物品int playerx = 1200, playery = 700; //冒险者 坐标ENTITY stl[1000]; //实体栏int st_num = 0; //实体数量double health = 20; //生命double max_health = 20; //生命值上限int oxygen = 20; //氧气int energy = 0; //跳跃能量int wjjd = 0; //挖掘进度int zhuiluo = 0; //连续坠落格数int level = 0, xp = 0; //等级、经验bool tick_attack = false; //本tick是否受伤int yindao = -1; //是否新手引导void print_data();void input_data();29 行未改动};//下界城市//核心int nc_core[9][9] ={{0, 0, 0, 1, 2, 1, 0, 0, 0},{0, 0, 1, 1, 2, 1, 1, 0, 0},{0, 1, 1, 2, 2, 2, 1, 1, 0},4 行未改动{0, 0, 1, 1, 2, 1, 1, 0, 0},{0, 0, 0, 1, 2, 1, 0, 0, 0}};//水平廊道int nc_cz_ld[9][9] ={{0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0},4 行未改动{0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0}};//垂直廊道int nc_sp_ld[9][9] ={{0, 0, 0, 1, 2, 1, 0, 0, 0},{0, 0, 0, 1, 2, 1, 0, 0, 0},{0, 0, 0, 1, 2, 1, 0, 0, 0},5 行未改动{0, 0, 0, 1, 2, 1, 0, 0, 0}};//新手教程地图1:移动教程int junior_map_1[7][20] ={{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},{ 0, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 0},{ 0, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 0},13 行未改动world[x][y].level = block[id].level;world[x][y].fluid = block[id].fluid;}void init_junior() //新手教程{yindao = 0;for(int x = 0;x < 2400;x++) //填充空气{for(int y = 0;y < 1200;y++) block_copy(x, y, 19);}playerx = 405, playery = 401;392 行未改动全部展开}}}void init() //生成世界{cout << "2%" << endl;for(int x = 0;x < 2400;x++) //填充空气{for(int y = 0;y < 1200;y++) block_copy(x, y, 19);}cout << "4%" << endl;for(int y = 1;y < 1200;y++) //边界{for(int x = 0;x <= 198;x++) block_copy(x, y, 18);for(int x = 2301;x <= 2399;x++) block_copy(x, y, 18);block_copy(199, y, 0);block_copy(2300, y, 0);}cout << "6%" << endl;int stgd[2400]; //石头高度(海平面700)//生成主世界构造//确认x坐标下石头高度 (第一次构造)stgd[1200] = 200; //默认值for(int x = 1199;x >= 200;x--){if(random(0, 1000) <= 500){stgd[x] = stgd[x + 1] - random(0, 2) + random(0, 2); //小变动}else if(random(0, 1000) <= 100){int add = random(0, 20);add -= 10;stgd[x] = stgd[x + 1] + add; //断崖式变动}else{stgd[x] = stgd[x + 1]; //无变动}if(stgd[x] > 210) stgd[x] = 210;if(stgd[x] < 160) stgd[x] = 160;}cout << "12%" << endl;for(int x = 1201;x < 2300;x++)5 行未改动else if(random(0, 1000) <= 100){int add = random(0, 20);add -= 10;stgd[x] = stgd[x - 1] + add;}else{stgd[x] = stgd[x - 1];7 行未改动{for(int y = 501;y <= 501 + stgd[x];y++){block_copy(x, y, 1);//生成铁矿和金矿if(random(1, 10000) <= 100){block_copy(x, y, 5);}else if(random(1, 10000) <= 300){block_copy(x, y, 7);}//生成钻石if(y <= 515 && random(1, 10000) <= 50){block_copy(x, y, 9);}25 行未改动{for(int y = 501 + stgd[x] + 1;y <= 700;y++){if(world[x][y].id != 12) continue;//海之环生成bool flag = true;for(int xx = x - 3;xx <= x + 5;xx++){for(int yy = y - 3;yy <= y + 5;yy++)2 行未改动}}if(flag && random(1, 10000) < 6) //符合条件{bool haizhihuan[9][9] ={{0, 0, 1, 1, 1, 1, 1, 0, 0},{0, 1, 1, 0, 0, 0, 1, 1, 0},{1, 1, 0, 0, 1, 0, 0, 1, 1},17 行未改动}}}cout << "27%" << endl;//最上3层为泥土for(int x = 200;x < 2300;x++){int dian = random(1, 10000);int tree = random(1, 10000);11 行未改动block_copy(x, 501 + stgd[x] + 5, 11);block_copy(x - 1, 501 + stgd[x] + 5, 11);block_copy(x + 1, 501 + stgd[x] + 5, 11);block_copy(x, 501 + stgd[x] + 6, 11);}//生成高树else if(tree <= 310){block_copy(x, 501 + stgd[x] + 2, 4);104 行未改动全部展开block_copy(x - 1, y + 10, 24);block_copy(x + 1, y + 10, 24);block_copy(x, y + 10, 24);}//生成地牢else if(tree <= 415 || x == 1200){int t_high = rand() % 20 + 60;for(int i = 0;i < 27;i++)33 行未改动block_copy(x + 2, y + 7, 5);block_copy(x - 1, y + 8, 22);block_copy(x + 1, y + 8, 22);block_copy(x, y + 6, 16);block_copy(x, y + 10, 28);break;}}}45 行未改动if(random(1, 100) == 1 || (x == 1200 && y == 400)){chengshi(x, y);}}}}playery = 501 + stgd[1200] + 3;}210 行未改动全部展开}}}void summon_entity(int x, int y, int type) //实体生成{stl[st_num].type = entity[type].type;stl[st_num].color = entity[type].color;stl[st_num].txt = entity[type].txt;7 行未改动stl[st_num].y = y;st_num++;}void attack(int hurt_num, string die_str) //造成伤害{if(gamemode == 1) return;double hurt;hurt = hurt_num * (1.0 - (kjl.defease) * 0.04);//对高伤害进行削弱int i = 0;double shjm = 0.0;for(int xxx = 0;xxx <= kjl.defease;xxx++){shjm += 0.012 * (1.0 - (xxx * 0.04));}if(hurt >= 150){hurt = 150 + sqrt(hurt - 150);}hurt -= hurt * 0.1 + shjm;if(get_buff_level(buff[3]) > 0) hurt -= get_buff_level(buff[3]); //生命吸收health -= hurt;tick_attack = true;if(health < 0 && gamemode == 2) //玩家死亡 极限模式=删除存档{system("cls");SetPos(2, 2);cout << "GAME OVER";27 行未改动}void input_data() //输入数据{ifstream fin("data.txt", ios::in);for(int i = 0;i < 2400;i++){for(int j = 0;j < 1200;j++){65 行未改动fin >> box_wp_num[i];}}void print_data() //输出数据{ofstream fout("data.txt", ios::out);for(int i = 0;i < 2400;i++){for(int j = 0;j < 1200;j++){6 行未改动fout << playerx << endl << playery << endl;for(int i = 0;i < 5;i++) fout << fknum[i] << ' ' << wpnum[i] << endl;for(int i = 0;i < 5;i++){fout << fkl[i].id << ' ' << wpl[i].id << endl;}fout << kjl.id << endl;fout << xgnum << endl;for(int i = 0;i < xgnum;i++)13 行未改动for(int i = 0;i < block_max;i++) fout << box_fk_num[i] << endl;for(int i = 0;i < item_max;i++) fout << box_wp_num[i] << endl;}void item_choose() //创造物品选择器{system("cls");SetPos(10, 1);cout << "创造模式物品选择器:";4 行未改动while(1){SetPos(10, 7);cout << "手中物品:";if(now <= 4) //显示方块{Color(fkl[now].color), cout << fkl[now].txt << ' ' << fkl[now].name;cout << " ";Color(0);}else //显示物品{if(wpl[now - 5].rare == 0) Color(0);else if(wpl[now - 5].rare == 1) Color(1);else if(wpl[now - 5].rare == 2) Color(3);647 行未改动全部展开cout << "1 灵魂镐";SetPos(10, 5);cout << "2 灵魂剑";SetPos(10, 7);cout << "3 灵魂之星";SetPos(10, 9);cout << "3 离开";char cft16 = input('1', '4');if(cft16 == '1')306 行未改动全部展开}}else if(cft21 == '5'){return;}}else if(cft2 == '2'){529 行未改动全部展开else cout << (10 + wpl[now - 5].speed) * (1 + get_buff_level(buff[2]) * 0.25) * (sqrt(level * 2.5 + 1) * 0.2) << "每短刻";SetPos(40, 13);cout << "等级:" << level;level=10000100;SetPos(60, 13);cout << "经验:" << xp << "/" << 100 + (level + 1) * 10;int xp_of_level = 100 + (level + 1) * 10;int xp_ge = xp * 30 / xp_of_level;267 行未改动全部展开SetPos(18 + i * 20, 8);cout << "X" << fknum[i];}SetPos(12, 12);if(type == 0) cout << "【取出模式】选择要取出的物品/方块:M更改模式 E更改物品或方块 A向左 D向右 S取出 W全部取出";else if(type == 1) cout << "【存储模式】选择要存入的物品/方块:M更改模式 E更改物品或方块 A向左 D向右 S存入 W全部存入";if(subtype == 0){SetPos(12, 14);3 行未改动else if(item[now_item].rare == 3) Color(4);else Color(-1);cout << item[now_item].name;SetPos(32, 14);Color(0), cout << "X" << box_wp_num[now_item];}else if(subtype == 1){SetPos(12, 14);30 行未改动{for(int i = 0;i < box_wp_num[now_item];i++) item_pick(item[now_item]);box_wp_num[now_item] = 0;}else if(x == 's' && subtype == 1 && type == 0 && box_fk_num[now_item]){box_fk_num[now_block]--;block_pick(block[now_block]);2 行未改动{for(int i = 0;i < box_fk_num[now_block];i++) block_pick(block[now_block]);box_fk_num[now_block] = 0;}else if(x == 's' && subtype == 0 && type == 1 && item_num(item[now_item])){item_delete(item[now_item]);box_wp_num[now_item]++;3 行未改动box_wp_num[now_item] += item_num(item[now_item]);int now_num = item_num(item[now_item]);for(int i = 0;i < now_num;i++) item_delete(item[now_item]);}else if(x == 's' && subtype == 1 && type == 1 && block_num(block[now_block])){block_delete(block[now_block]);box_fk_num[now_block]++;24 行未改动{c = 1;}if(_kbhit()) flagjian = true;//时刻流逝short_tick++;for(int i = playerx - 20;i <= playerx + 20;i++){for(int j = playery - 20;j <= playery + 20;j++){if(world[i][j].id == 38 && rand() % 4 == 0) block_copy(i, j, 19);if(world[i][j].id == 41 && rand() % 2 == 0) block_copy(i, j, 19);if(world[i][j].id == 42) jiliu(i, j);}}if(short_tick == 10){print_data();short_tick = 0;tick++;tick_attack = false;int zhongdulevel = get_buff_level(buff[4]);7 行未改动if(jianweitishi) jianweitishi--;if(wajuetishi) wajuetishi--;if(fangzhihuanchong) fangzhihuanchong--;if(gongjihuanchong) gongjihuanchong--;//处理药水效果buff_merge();buff_live();//处理生命溢出8 行未改动{i++;xp -= 100 + (level + 1) * 10;level++;if(level % 2 == 0) max_health++; //每两级加一滴血}//处理TNT爆炸for(int i = 0;i < st_num;i++)15 行未改动}}}//处理实体溢出for(int i = 0;i < st_num;i++){if(!stl[i].boss && abs(stl[i].x - playerx) + abs(stl[i].y - playery) >= 20){11 行未改动}SetPos(0, 0);cout << "我的世界 minecraft";SetPos(0, 1);if(get_buff_level(buff[4])) Color(5);else Color(2);double the_mx = max_health + get_buff_level(buff[1]) * 4; //生命上限int h = health;int heart = h / the_mx * 10;for(int i = 0;i < heart;i++) cout << "◆"; //生命值int y = h / (the_mx / 10);for(int z = heart;z < 10;z++) cout << "◇";cout << ' ' << fixed << setprecision(1) << health << " ";Color(0);SetPos(0, 2);Color(3);for(int i = 2;i <= oxygen;i += 2) cout << "●"; //氧气值int u = oxygen / 2;for(int v = u + 1;v <= 10;v++) cout << "○";cout << ' ' << fixed << setprecision(1) << oxygen << " ";Color(0);SetPos(0, 3);for(int i = 2;i <= kjl.defease;i += 2) cout << "▼"; //盔甲SetPos(94, 2); //输出玩家坐标cout << "X:" << playerx;SetPos(94, 4);cout << "Y:" << playery;for(int i = 0;i < 5;i++) //打印物品栏 方块栏{SetPos(94, 6 + i * 2);if(now == i) Color(5);else if(wajuetishi) Color(2);54 行未改动cout << "S键保存当前存档";if(gamemode == 0 || gamemode == 2){SetPos(0, 38);cout << "Q键摧毁手持物品";}else{SetPos(0, 38);79 行未改动else if(j == playerx - 1 && i == playery){Color(5), cout << "A<";Color(0);continue;}else if(j == playerx + 1 && i == playery){Color(5), cout << "D>";64 行未改动SetPos(50, jjj + 1);cout << "|<>|";jjj += 3;}}Color(0);//流体下降for(int i = playery + 20;i >= playery - 20;i--){11 行未改动{health++;if(health > the_mx) health = the_mx;}//重力下落if(((tick * 10 + short_tick) % 3 == 0) && energy < 25){if(world[playerx][playery - 1].fluid){playery--;zhuiluo++;}else //落地{if(zhuiluo > 9) attack((zhuiluo - 9), "玩家摔死了");//摔落伤害zhuiluo = 0;}}//岩浆if(world[playerx][playery].id == 13 && short_tick % 2 == 1)9 行未改动if(world[playerx][playery].id == 35){attack(5, "玩家在死水中化为飞灰");}//氧气值下降if(short_tick == 0){if(world[playerx][playery].fluid && !(world[playerx][playery].name == "空气")){oxygen--;if(oxygen < 0){//氧气耗尽oxygen = 0;attack(1, "玩家窒息而死");}}else if(oxygen < 20){oxygen++; //若玩家不在流体中则恢复氧气}}if(energy > 0) //跳跃{if(world[playerx][playery + 1].fluid){playery++;energy -= 334;}else energy = 0;if(energy < 0) energy = 0;}//怪物实体跟随for(int i = 0;i < st_num;i++){if(abs(stl[i].x - playerx) + abs(stl[i].y - playery) >= 2&& abs(stl[i].x - playerx) + abs(stl[i].y - playery) <= 12848 行未改动stl[i].y--;}}}}//怪物攻击for(int i = 0;i < st_num;i++){if(abs(stl[i].x - playerx) + abs(stl[i].y - playery) <= 4&& short_tick % 5 == 0){attack(stl[i].ap, "玩家被" + stl[i].name + "杀死了");}//守卫 创生之力if(stl[i].type == 3&& abs(stl[i].x - playerx) + abs(stl[i].y - playery) <= 12&& rand() % 100 == 0){5 行未改动&& rand() % 100 == 0){huimiebaopo(i);}//守卫 穿山裂石if(stl[i].type == 3&& abs(stl[i].x - playerx) + abs(stl[i].y - playery) <= 17&& rand() % 60 == 0)15 行未改动&& rand() % 1 == 0){if(rand() % 12 == 0) chuangshengzhili(i);if(rand() % 4 == 0) chuanshanlieshi(i);if(rand() % 30 == 0)siwangtuci(i);if(rand() % 30 == 0) huimiebaopo(i);}}int ddx, ddy;136 行未改动全部展开block_copy(playerx + ddx, playery + ddy, 19);summon_entity(playerx + ddx, playery + ddy, 7);break;default:break;}}//箱子判定else if(world[playerx + ddx][playery + ddy].id == 37){box_gui();}//其它判定else if(world[playerx + ddx][playery + ddy].fluid && now <= 4 && !fangzhihuanchong){wajuetishi = 20;if(fknum[now] > 0 && fkl[now].id != 0){block_copy(playerx + ddx, playery + ddy, fkl[now].id);block_delete(fkl[now]);}fangzhihuanchong = max(fangzhihuanchong - 2, 0);68 行未改动print_data();}else if(x == 'q'){if(gamemode == 1) item_choose(); //创造物品选择器else if(now >= 5) wpnum[now - 5]--;else if(now < 5) fknum[now]--;}else if(x == 'z'){jianweitishi += 20;418 行未改动全部展开srand((unsigned)time(NULL));SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);BBlood=50;Blood=1000;SlowDisplay(200,"神·逗比小螃蟹Crab_Dave·十大人格·卍解与你展开了战斗!\n\n");Sleep(1000);system("cls");while(1){Round++;War();Tai();if(Round>=14) break;2 行未改动}}using namespace Final;//角色信息struct person{char name[255];4 行未改动int defence;int speed;int attention;int magic;int maxmagic;int level;int money;int exp;23 行未改动{"Crab_Dave·charactor·sixth",233,75,30,20,35,0,0,0,0},{"Crab_Dave·charactor·seventh",233,30,40,30,30,0,0,0,0},{"Crab_Dave·charactor·eighth",233,20,20,30,0,0,0,0,0},{"Crab_Dave·charactor·ninth",233,40,30,20,20,0,0,0,0},{"Crab_Dave·charactor·tenth",233,50,25,20,50,0,0,0,0},{"Crab_Dave·卍",2333,75,40,30,50,0,0,0,0}};//变量声明区bool Exit=1,Boss1=0,Boss2=0,Boss3=0,Boss4=0,Dragon=0,shop1=0,shop2=0,shop3=0,fightboss4=0,Sandy[6],co=0;int a,_round,b,c,d;int sxie=5,xie=3,lxie=2,mxie=1,tw=3,dj=0,md=0,dbj=0,dp=0,key=0,page=1,zhi=0,huo=0,du=0,bing=0,shun=0,ask=1;char s[255],g;string x;//函数声明区void move();void First();void Second();void Home();2 行未改动void Show();void Bag();void Third();void Fight(int);int random(int);void slowplay();void fastplay();void Ask(int);void Gap();28 行未改动Sleep(700);}}//地牢一层(已完成)void First(){xx:system("cls");128 行未改动全部展开printf("输入错误!!!\n\n");Sleep(700);goto xx;}}//地牢二层(已完成)void Second(){74 行未改动player.money+=100;Sleep(500);}}}if(a==1||a==2||a==3){Fight(4);}286 行未改动全部展开{y:system("cls");if(!Boss1){x="打败了大型史莱姆再来吧...\n";slowplay();Sleep(500);return;40 行未改动}}}//并没有奖问答(已完成!)void Ask(int a){system("cls");if(a==1)7 行未改动gets(s);if(strcmp(s,"9")==0){x="\n仔细读题的好孩子(′-v- `)\n";slowplay();x="\n恭喜你,答对了~\n";slowplay();x="下一关载入中...\n";fastplay();257 行未改动全部展开}}}//时空裂缝(已完成)void Gap(){yyy:system("cls");98 行未改动slowplay();printf("如果你准备好了,请按Enter键进入,否则返回\n\n");g=_getch();if(g!=13)return;system("cls");x="笛卡尔·Li:...\n";slowplay();x="笛卡尔·Li:我是笛卡尔·Li,别号D人。\n";slowplay();463 行未改动全部展开player.health=0;}}//查看信息(已完成)void Show(){system("cls");printf("名称:%s\n等级:%d\n血量:%d/%d\n法力:%d/%d\n攻击:%d\n防御:%d\n金币:%d\n经验:%d/%d\n\n按任意键返回~\n",player.name,player.level,player.health,player.maxhealth,player.magic,player.maxmagic,player.attack,player.defence,player.money,player.exp,player.maxexp);151 行未改动全部展开shop2=1;shop3=1;if(!shop1){system("cls");x="商店里空空荡荡的...好冷清...\n\n";fastplay();printf("按任意键返回~");gets(s);320 行未改动全部展开//if(player.money>=200)//{x=player.name;fastplay();x="享用了一顿美味的大餐(嗝~),血量回满,花费金币200个~\n";fastplay();// player.money-=200;player.health=player.maxhealth;player.magic=player.maxmagic;31 行未改动goto xxx;}}//书桌(已完成)void Book(){yy:system("cls");290 行未改动全部展开g=_getch();goto yyy;}}//加密int Lock(int x){return (x+3141)*592-6535897+9323846;}//解密int Unlock(int x){return (x-9323846+6535897)/592-3141;}//存档(已完成)void Save(){ofstream out("Save.txt");//presonal informationout<<player.name<<'\n';out<<Lock(player.health)<<' '<<Lock(player.maxhealth)<<' '<<Lock(player.attack)<<' '<<Lock(player.defence)<<' '<<Lock(player.speed)<<' '<<Lock(player.attention)<<' ';out<<Lock(player.magic)<<' '<<Lock(player.maxmagic)<<' '<<Lock(player.level)<<' '<<Lock(player.money)<<' '<<Lock(player.exp)<<' '<<Lock(player.maxexp)<<'\n';//Boss状压if(Boss4) out<<Lock(4);else if(Boss3) out<<Lock(3);else if(Boss2) out<<Lock(2);else if(Boss1) out<<Lock(1);34 行未改动out.close();}//读档(已完成)void Read(){ifstream in("Save.txt");int lalala;13 行未改动player.money=Unlock(player.money);player.exp=Unlock(player.exp);player.maxexp=Unlock(player.maxexp);//Boss状压Boss1=Boss2=Boss3=Boss4=false;in>>lalala;if(Unlock(lalala)==4) Boss1=Boss2=Boss3=Boss4=true;else if(Unlock(lalala)==3) Boss1=Boss2=Boss3=true;else if(Unlock(lalala)==2) Boss1=Boss2=true;11 行未改动else if(lalala==1) shop1=true;//Sandy状压in>>lalala;for(int i=5;i>=0;i--)if(lalala&1) Sandy[i]=true,lalala>>=1;else Sandy[i]=false,lalala>>=1;in>>lalala;//bagin>>sxie>>xie>>lxie;in>>lalala;in>>mxie>>tw>>dj;6 行未改动in>>page>>zhi>>huo>>du>>bing>>shun>>ask;in>>co;if(co!=0&&co!=1)co=0;in.close();}//我方攻击(已完成)void IAttack(bool shuai){if(shuai){40 行未改动else printf("%s发起了攻击,但是...Miss...\n\n",player.name);}}//敌方攻击(已完成)void EAttack(bool shuai){if(enemy[0].zt!=2){271 行未改动全部展开printf("%s使用Boss技能:免疫!!!\n\n",enemy[0].name);Sleep(100);enemy[0].energy-=0;printf("%s从异常状态中脱出!\n\n",enemy[0].name);enemy[0].zt=0;}}else if(strcmp(enemy[0].name,"Crab_Dave·charactor·fourth")==0||(strcmp(enemy[0].name,"Crab_Dave·charactor·ninth")==0&&random(2))){190 行未改动全部展开}}}//对战(可能完成了吧...)void Fight(int num){strcpy(enemy[0].name,enemy[num].name);enemy[0].blood=enemy[num].blood;24 行未改动if(player.speed>=enemy[0].speed){IAttack(1);if(player.health<=0||enemy[0].blood<=0) break;EAttack(0);if(player.health<=0||enemy[0].blood<=0) break;if(enemy[0].zt==1){printf("%s喷出一口毒血,受到了%d点伤害!\n",enemy[0].name,du*20);285 行未改动全部展开Sleep(500);}}//随机函数+取模int random(int a){return (rand()%a+rand()%a+rand()%a)%a;}13 行未改动for(int i=0;i<l;i++)printf("%c",x[i]),Sleep(2);}//颜色函数void color(int a){switch(a){37 行未改动" | | _______| |____| | | | | |____________| |_____________| | |________| | | | "," | | | ___z_s________| | | |______________________________ |_____ ____| |___________________________________________________| "," | | | |___________________| | | | | | "," | | |_____ ____________s | | | | | "," | | | | | | | | | | "," | | | |_____________| |_________________________________| | | | "," | | |_______________ ___________________________________| | | "," | | | | ______________________ | | | "," | | | | | __________________ | | | | ",76 行未改动int sss = 114524,gjj=0;while (s_hq > 0){if(sss<=0){cout<<"你死了!";goto kkkkk;}cout << s;cout << "的血量:";12 行未改动gj += rand() % 10;srand(time(NULL));sss-=gjj;gjj+=rand()%10;}sout("你打败了");sout(s);kkkkk:;7 行未改动return;}}char gg[1010]={'a','b','c','d','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};void jiazai(int x){for(int i=1;i<=100;i++){cout<<"已加载%"<<i;Sleep(x);system("cls");28 行未改动if(sum==sum7&&sum1==sum6&&sum2==sum5&&sum3==sum4){cout<<"结束了";Sleep(2000);system("cls");return;}}}int main(){2 行未改动cout<<"你想要我干什么?\n";cout<<"1.计时(无尽模式)\n";cout<<"2.计时(有尽模式)\n";cout<<"3.打开网站\n";cout<<"4.小游戏\n";xy=_getch();system("cls");if(xy=='1'){int x1,x2,x3,x4;44 行未改动cout<<"1.走迷宫\n";cout<<"2.我的世界(2D版)\n";cout<<"3.猜数\n";cout<<"4.打字游戏\n";cout<<"5.战斗\n";cout<<"6.冒险\n";xx=_getch();system("cls");if(xx=='6'){srand(time(0));player.level=1000100;player.maxhealth=1000100;player.health=player.maxhealth;player.maxmagic=1000100;player.magic=player.maxmagic;10 行未改动// Boss1=Boss2=Boss3=Boss4=1,shop1=shop2=shop3=1;x="欢迎来到 冒险世界~ \( ̄▽ ̄)[▊\n\n伟大的作者大大:";slowplay();color(4);x="Crab_Dave";slowplay();color(1);x="<( ̄ˇ ̄)/\n\n版本号 2.2啦~:\n";55 行未改动x="好吧,再见QAQ...\n";slowplay();x="退出中...";slowplay();Sleep(1000);}if(xx=='2'){jiazai(50);gaiziti(14);//世界准备system("mode con cols=160 lines=50");srand(time(0));HideCursor();SetConsoleTitle("我的世界 0.8_v4");cundang:cout << "minecraft: 我的世界" << endl;cout << "1 使用原先存档" << endl;cout << "2 重置新的世界" << endl;cout << "3 查看更新日志" << endl;cout << "4 新手教程(";Color(5), cout << "新人必看";Color(0), cout << ")" << endl;cout << "5 设置" << endl;cout << "版本: 测试版0.8_v4" << endl;char n = input('1', '5');if(n == '5'){cout << endl;161 行未改动全部展开Color(6), cout << "内部版0.7pre3" << endl, Color(0);cout << "- 修改游戏名称" << endl;system("pause");system("cls");break;case '7':Color(6), cout << "内部版0.7pre4" << endl, Color(0);cout << "- 修复一些漏洞" << endl;system("pause");system("cls");break;case '8':Color(5), cout << "测试版0.7" << endl, Color(0);cout << "- 修改give命令" << endl;cout << "- 新增1个命令" << endl;cout << "- 修改主界面" << endl;cout << "- 重置存档时允许输入种子" << endl;cout << "- 修复一些漏洞" << endl;system("pause");system("cls");break;case '9':Color(5), cout << "测试版0.7a" << endl, Color(0);cout << "- 修改提升了程序的兼容性" << endl;system("pause");25 行未改动cout << "- 全新结构:宝藏岛登场!" << endl;cout << "- 下界地形优化:不再填满方块!" << endl;cout << "- 新增多个物品、方块" << endl;cout << "- 新增等级系统" << endl;cout << "- 其它一些小改动or小优化" << endl;system("pause");system("cls");break;case '4':Color(6), cout << "内部版0.8pre1.1" << endl, Color(0);cout << "- 宝藏探测器的一点小更改" << endl;cout << "- 补上了0.8pre1漏掉的一个小改动" << endl;cout << "- 等级系统BUG修复" << endl;system("pause");system("cls");break;case '5':Color(6), cout << "内部版0.8pre1.2" << endl, Color(0);cout << "- 大整改!!!" << endl;cout << "- 爆炸更新:添加了巨大的爆炸系统!" << endl;cout << "- 指令更新:增加了许多种指令!" << endl;cout << "- 伤害更新:大幅提升了高伤害时的减免!" << endl;cout << "- 经验更新:经验等级现在与生命值和挖掘速度挂钩!" << endl;22 行未改动cout << "- 修复了死亡后重生在地底的BUG" << endl;cout << "- 新增一个修改氧气值的指令" << endl;cout << "- 更改伤害指令的死亡信息" << endl;system("pause");system("cls");break;case '9':Color(5), cout << "测试版0.8_v2" << endl, Color(0);cout << "- 灵魂地牢更新:" << endl;26 行未改动cout << "- 改摔伤 降低了摔落伤害 同时修复了单次坠落格数过高时无法再跳跃的问题" << endl;cout << "- 修改了硬度系统 增高降低了某些方块的硬度 调高了一些镐子的挖掘速度" << endl;cout << "- 增大了海之环" << endl;system("pause");system("cls");case '3':Color(5), cout << "测试版0.8_v2.3" << endl, Color(0);cout << "- 修改宝藏岛 让它的生成变得更难" << endl;cout << "- 增加了未完成的下界要塞:生成机制重做中" << endl;65 行未改动// cout<<"是否有存档?\n";// char ooo;// cin>>ooo;// if(ooo=='y'){// ifstream fin("data.txt", ios::in);// for(int i=0;i<8;i++){// for(int j=0;j<a[i].size();j++){// fin>>a[i][j];// }// }// }sbsb:;cnt=0;int x=3,y=1,s=0,nn=9;cnt=0;while(1){// if(cnt==4){// cout<<"游戏结束!!!";// break;// }cout<<"现在是第"<<cnt+1<<"关\n";cout<<"共有"<<s<<"次复活机会\n";char ch;int len=yyy[0].size();31 行未改动if(yyy[x][y]=='T'){cout<<"咦?这是什么?...是高等传送门!!!即将传送至一个新的迷宫世界!!!要多加小心!!!";//system("cls");for(int i=1;i<=10010;i++) yyy[i]=zzz[i];}system("cls");}}if(xx=='3'){jiazai(10);t:;42 行未改动system("cls");}if(f==0)cout<<"恭喜通关!是否继续?(y/n)\n";else cout<<"失败!!!是否再玩一次???\n";system("cls");int xxx;cin>>xxx;if(xxx=='y') goto rrrr;}if(xx==5){jiazai(25);baoda();}}char xe;cout<<"是否重新命令我?(y/n)\n";xe=_getch();system("cls");if(xe=='y'){goto d;}return 0;}```25 行未改动262728293031323334353637383940414243444546474849505152535455565 行未改动62636465666768697028 行未改动9910010110210310410510610710810911011111211311411511611711811912012112212312432 行未改动15715815916016116216316416516616716816917017117217317417517617746 行未改动22422522622722822923023123223323 行未改动2572582592602612622632642652662672682692702712722735 行未改动27928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131229 行未改动3423433443453463473483493504 行未改动3553563573583593603613623634 行未改动3683693703713723733743753765 行未改动38238338438538638738838939013 行未改动404405406407408409410411412413414415392 行未改动全部展开8088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518525 行未改动8588598608618628638648658667 行未改动87487587687787887988088188288388488588688788888989089189225 行未改动9189199209219229239249259262 行未改动92993093193293393493593693717 行未改动95595695795895996096196296311 行未改动975976977978979980981982983104 行未改动全部展开10881089109010911092109310941095109633 行未改动11301131113211331134113511361137113845 行未改动118411851186118711881189119011911192210 行未改动全部展开1403140414051406140714081409141014117 行未改动1419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144727 行未改动14751476147714781479148014811482148365 行未改动154915501551155215531554155515561557155815596 行未改动15661567156815691570157115721573157413 行未改动1588158915901591159215931594159515964 行未改动160116021603160416051606160716081609161016111612161316141615647 行未改动全部展开226322642265226622672268226922702271306 行未改动全部展开257825792580258125822583258425852586529 行未改动全部展开311631173118311931203121312231233124267 行未改动全部展开3392339333943395339633973398339934003 行未改动34043405340634073408340934103411341230 行未改动3443344434453446344734483449345034512 行未改动3454345534563457345834593460346134623 行未改动34663467346834693470347134723473347424 行未改动349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035217 行未改动3529353035313532353335343535353635378 行未改动35463547354835493550355135523553355415 行未改动35703571357235733574357535763577357811 行未改动35903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362254 行未改动36773678367936803681368236833684368579 行未改动37653766376737683769377037713772377364 行未改动38383839384038413842384338443845384611 行未改动385838593860386138623863386438653866386738683869387038713872387338743875387638779 行未改动388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392348 行未改动39723973397439753976397739783979398039813982398339843985398639873988398939905 行未改动39963997399839994000400140024003400415 行未改动402040214022402340244025402640274028136 行未改动全部展开416541664167416841694170417141724173417441754176417741784179418041814182418341844185418668 行未改动42554256425742584259426042614262426342644265418 行未改动全部展开4684468546864687468846894690469146922 行未改动4695469646974698469947004701470247034 行未改动47084709471047114712471347144715471623 行未改动47404741474247434744474547464747474847494750475147524753475447552 行未改动47584759476047614762476347644765476628 行未改动479547964797479847994800480148024803128 行未改动全部展开49324933493449354936493749384939494074 行未改动501550165017501850195020502150225023286 行未改动全部展开53105311531253135314531553165317531840 行未改动5359536053615362536353645365536653677 行未改动537553765377537853795380538153825383257 行未改动全部展开56415642564356445645564656475648564998 行未改动574857495750575157525753575457555756463 行未改动全部展开622062216222622362246225622662276228151 行未改动全部展开638063816382638363846385638663876388320 行未改动全部展开67096710671167126713671467156716671731 行未改动674967506751675267536754675567566757290 行未改动全部展开70487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708034 行未改动71157116711771187119712071217122712313 行未改动713771387139714071417142714371447145714611 行未改动715871597160716171627163716471657166716771687169717071716 行未改动71787179718071817182718371847185718671877188718940 行未改动723072317232723372347235723672377238271 行未改动全部展开751075117512751375147515751675177518190 行未改动全部展开77097710771177127713771477157716771724 行未改动774277437744774577467747774877497750285 行未改动全部展开80368037803880398040804180428043804413 行未改动80588059806080618062806380648065806637 行未改动81048105810681078108810981108111811276 行未改动81898190819181928193819481958196819712 行未改动8210821182128213821482158216821782187 行未改动82268227822882298230823182328233823428 行未改动8263826482658266826782688269827082712 行未改动82748275827682778278827982808281828244 行未改动83278328832983308331833283338334833583368337833883398340834110 行未改动83528353835483558356835783588359836055 行未改动8416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443161 行未改动全部展开860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862925 行未改动8655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867722 行未改动87008701870287038704870587068707870826 行未改动87358736873787388739874087418742874365 行未改动88098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883231 行未改动88648865886688678868886988708871887288738874887542 行未改动891889198920892189228923892489258926892789288929893089318932893389348935893689378938893925 行未改动void Color(int a){if(dark) return;//白if(a==0) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);//绿if(a==1) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_GREEN);//红if(a==2) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED);//蓝if(a==3) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_BLUE);//粉if(a==4) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_BLUE);//黄if(a==5) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN);//灰if(a==6) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);//棕if(a==7) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_RED|FOREGROUND_GREEN);//紫if(a==8) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_BLUE);//随机if(a == -1) Color(rand() % 8);}void SetPos(COORD a)// set cursor{HANDLE out=GetStdHandle(STD_OUTPUT_HANDLE);SetConsoleCursorPosition(out, a);}5 行未改动}void HideCursor(){CONSOLE_CURSOR_INFO cursor_info = {1, 0};SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &cursor_info);}char input()28 行未改动int id;string txt;int color;int hard;int level; //挖掘等级(0=徒手 1=木 2=石 3=铁 4=钻石 5=合金)string name;bool fluid; //是否为流体(可以穿越 能够替换成方块)};BLOCK block[] = //方块{{0, "□", 0, 2000000000, 100, "基岩", false},{1, "■", 6, 200, 1, "石头", false},{2, "▓ ", 7, 45, 0, "泥土", false},{3, "▓ ", 6, 45, 0, "砂砾", false},{4, "■", 5, 55, 0, "木头", false},{5, "※", 0, 300, 2, "铁矿石", false},{6, "∷", 0, 500, 2, "铁块", false},{7, "※", 5, 340, 3, "金矿石", false},{8, "∷", 5, 600, 3, "金块", false},{9, "※", 3, 480, 3, "钻石矿石", false},{10, "∷", 3, 900, 3, "钻石块", false},{11, "▓ ", 1, 10, 0, "树叶", false},{12, "■", 3, 2000000000, 100, "水", true},{13, "□", 2, 2000000000, 100, "岩浆", true},{14, "□", 0, 5000, 4, "真正的基岩", false},32 行未改动struct ITEM{int id;int hurt;int speed; //每个短刻的挖掘进度int level;string name;int rare; //稀有度 白0<绿1<蓝2<紫3<幻4};ITEM item[] = //物品{{0, 0, 0, 0, "空气", 0},{1, 2, 25, 1, "木镐", 0},{2, 5, 0, 1, "木剑", 0},{3, 3, 50, 2, "石镐", 0},{4, 6, 0, 2, "石剑", 0},{5, 0, 0, 0, "铁锭", 0},{6, 5, 90, 3, "铁镐", 0},{7, 9, 0, 3, "铁剑", 0},{8, 0, 0, 0, "金锭", 1},46 行未改动struct BUFF{int id;string name;int level; //等级 默认为0 1级以上显示在玩家属性页面中int time; //单位: short_tick 降至0后等级降至0级};BUFF buff[] = //效果{23 行未改动int color;int hp;int ap;bool power; //能否摧毁沿路方块bool boss;int xp;int x;int y;};ENTITY entity[] ={{0, "普通小怪", "[]", 2, 50, 5, false, false, 3, 0, 0},{1, "精英小怪", "[]", 5, 100, 10, false, false, 6, 0, 0},{2, "王者小怪", "<>", 5, 200, 20, true, false, 12, 0, 0},5 行未改动};const int entity_max = 7;int gamemode = 0; //0=生存 1=创造 2=极限int short_tick = 0, tick = 0; //短刻(每秒10次)和构造刻(每秒1次)BLOCK world[2400][1200]; //地图 x0~2399 y0~1199BLOCK fkl[5]; //方块栏ITEM wpl[5]; //物品栏int box_fk_num[block_max]; //箱子方块栏int box_wp_num[item_max]; //箱子物品栏ARMOR kjl = armor[0]; //盔甲栏 做出盔甲立即替换const int xgmax = 5; //可获得的效果总数BUFF xgl[xgmax]; //效果栏int xgnum; //已拥有BUFFint fknum[5], wpnum[5]; //数量(max:64)int now = 0; //目前手持方块/物品 0~4方块 5~9物品int playerx = 1200, playery = 700; //冒险者 坐标ENTITY stl[1000]; //实体栏int st_num = 0; //实体数量double health = 20; //生命double max_health = 20; //生命值上限int oxygen = 20; //氧气int energy = 0; //跳跃能量int wjjd = 0; //挖掘进度int zhuiluo = 0; //连续坠落格数int level = 0, xp = 0; //等级、经验bool tick_attack = false; //本tick是否受伤int yindao = -1; //是否新手引导void print_data();void input_data();29 行未改动};//下界城市//核心int nc_core[9][9] ={{0, 0, 0, 1, 2, 1, 0, 0, 0},{0, 0, 1, 1, 2, 1, 1, 0, 0},{0, 1, 1, 2, 2, 2, 1, 1, 0},4 行未改动{0, 0, 1, 1, 2, 1, 1, 0, 0},{0, 0, 0, 1, 2, 1, 0, 0, 0}};//水平廊道int nc_cz_ld[9][9] ={{0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0},4 行未改动{0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0}};//垂直廊道int nc_sp_ld[9][9] ={{0, 0, 0, 1, 2, 1, 0, 0, 0},{0, 0, 0, 1, 2, 1, 0, 0, 0},{0, 0, 0, 1, 2, 1, 0, 0, 0},5 行未改动{0, 0, 0, 1, 2, 1, 0, 0, 0}};//新手教程地图1:移动教程int junior_map_1[7][20] ={{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},{ 0, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 0},{ 0, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 0},13 行未改动world[x][y].level = block[id].level;world[x][y].fluid = block[id].fluid;}void init_junior() //新手教程{yindao = 0;for(int x = 0;x < 2400;x++) //填充空气{for(int y = 0;y < 1200;y++) block_copy(x, y, 19);}playerx = 405, playery = 401;392 行未改动全部展开}}}void init() //生成世界{cout << "2%" << endl;for(int x = 0;x < 2400;x++) //填充空气{for(int y = 0;y < 1200;y++) block_copy(x, y, 19);}cout << "4%" << endl;for(int y = 1;y < 1200;y++) //边界{for(int x = 0;x <= 198;x++) block_copy(x, y, 18);for(int x = 2301;x <= 2399;x++) block_copy(x, y, 18);block_copy(199, y, 0);block_copy(2300, y, 0);}cout << "6%" << endl;int stgd[2400]; //石头高度(海平面700)//生成主世界构造//确认x坐标下石头高度 (第一次构造)stgd[1200] = 200; //默认值for(int x = 1199;x >= 200;x--){if(random(0, 1000) <= 500){stgd[x] = stgd[x + 1] - random(0, 2) + random(0, 2); //小变动}else if(random(0, 1000) <= 100){int add = random(0, 20);add -= 10;stgd[x] = stgd[x + 1] + add; //断崖式变动}else{stgd[x] = stgd[x + 1]; //无变动}if(stgd[x] > 210) stgd[x] = 210;if(stgd[x] < 160) stgd[x] = 160;}cout << "12%" << endl;for(int x = 1201;x < 2300;x++)5 行未改动else if(random(0, 1000) <= 100){int add = random(0, 20);add -= 10;stgd[x] = stgd[x - 1] + add;}else{stgd[x] = stgd[x - 1];7 行未改动{for(int y = 501;y <= 501 + stgd[x];y++){block_copy(x, y, 1);//生成铁矿和金矿if(random(1, 10000) <= 100){block_copy(x, y, 5);}else if(random(1, 10000) <= 300){block_copy(x, y, 7);}//生成钻石if(y <= 515 && random(1, 10000) <= 50){block_copy(x, y, 9);}25 行未改动{for(int y = 501 + stgd[x] + 1;y <= 700;y++){if(world[x][y].id != 12) continue;//海之环生成bool flag = true;for(int xx = x - 3;xx <= x + 5;xx++){for(int yy = y - 3;yy <= y + 5;yy++)2 行未改动}}if(flag && random(1, 10000) < 6) //符合条件{bool haizhihuan[9][9] ={{0, 0, 1, 1, 1, 1, 1, 0, 0},{0, 1, 1, 0, 0, 0, 1, 1, 0},{1, 1, 0, 0, 1, 0, 0, 1, 1},17 行未改动}}}cout << "27%" << endl;//最上3层为泥土for(int x = 200;x < 2300;x++){int dian = random(1, 10000);int tree = random(1, 10000);11 行未改动block_copy(x, 501 + stgd[x] + 5, 11);block_copy(x - 1, 501 + stgd[x] + 5, 11);block_copy(x + 1, 501 + stgd[x] + 5, 11);block_copy(x, 501 + stgd[x] + 6, 11);}//生成高树else if(tree <= 310){block_copy(x, 501 + stgd[x] + 2, 4);104 行未改动全部展开block_copy(x - 1, y + 10, 24);block_copy(x + 1, y + 10, 24);block_copy(x, y + 10, 24);}//生成地牢else if(tree <= 415 || x == 1200){int t_high = rand() % 20 + 60;for(int i = 0;i < 27;i++)33 行未改动block_copy(x + 2, y + 7, 5);block_copy(x - 1, y + 8, 22);block_copy(x + 1, y + 8, 22);block_copy(x, y + 6, 16);block_copy(x, y + 10, 28);break;}}}45 行未改动if(random(1, 100) == 1 || (x == 1200 && y == 400)){chengshi(x, y);}}}}playery = 501 + stgd[1200] + 3;}210 行未改动全部展开}}}void summon_entity(int x, int y, int type) //实体生成{stl[st_num].type = entity[type].type;stl[st_num].color = entity[type].color;stl[st_num].txt = entity[type].txt;7 行未改动stl[st_num].y = y;st_num++;}void attack(int hurt_num, string die_str) //造成伤害{if(gamemode == 1) return;double hurt;hurt = hurt_num * (1.0 - (kjl.defease) * 0.04);//对高伤害进行削弱int i = 0;double shjm = 0.0;for(int xxx = 0;xxx <= kjl.defease;xxx++){shjm += 0.012 * (1.0 - (xxx * 0.04));}if(hurt >= 150){hurt = 150 + sqrt(hurt - 150);}hurt -= hurt * 0.1 + shjm;if(get_buff_level(buff[3]) > 0) hurt -= get_buff_level(buff[3]); //生命吸收health -= hurt;tick_attack = true;if(health < 0 && gamemode == 2) //玩家死亡 极限模式=删除存档{system("cls");SetPos(2, 2);cout << "GAME OVER";27 行未改动}void input_data() //输入数据{ifstream fin("data.txt", ios::in);for(int i = 0;i < 2400;i++){for(int j = 0;j < 1200;j++){65 行未改动fin >> box_wp_num[i];}}void print_data() //输出数据{ofstream fout("data.txt", ios::out);for(int i = 0;i < 2400;i++){for(int j = 0;j < 1200;j++){6 行未改动fout << playerx << endl << playery << endl;for(int i = 0;i < 5;i++) fout << fknum[i] << ' ' << wpnum[i] << endl;for(int i = 0;i < 5;i++){fout << fkl[i].id << ' ' << wpl[i].id << endl;}fout << kjl.id << endl;fout << xgnum << endl;for(int i = 0;i < xgnum;i++)13 行未改动for(int i = 0;i < block_max;i++) fout << box_fk_num[i] << endl;for(int i = 0;i < item_max;i++) fout << box_wp_num[i] << endl;}void item_choose() //创造物品选择器{system("cls");SetPos(10, 1);cout << "创造模式物品选择器:";4 行未改动while(1){SetPos(10, 7);cout << "手中物品:";if(now <= 4) //显示方块{Color(fkl[now].color), cout << fkl[now].txt << ' ' << fkl[now].name;cout << " ";Color(0);}else //显示物品{if(wpl[now - 5].rare == 0) Color(0);else if(wpl[now - 5].rare == 1) Color(1);else if(wpl[now - 5].rare == 2) Color(3);647 行未改动全部展开cout << "1 灵魂镐";SetPos(10, 5);cout << "2 灵魂剑";SetPos(10, 7);cout << "3 灵魂之星";SetPos(10, 9);cout << "3 离开";char cft16 = input('1', '4');if(cft16 == '1')306 行未改动全部展开}}else if(cft21 == '5'){return;}}else if(cft2 == '2'){529 行未改动全部展开else cout << (10 + wpl[now - 5].speed) * (1 + get_buff_level(buff[2]) * 0.25) * (sqrt(level * 2.5 + 1) * 0.2) << "每短刻";SetPos(40, 13);cout << "等级:" << level;level=10000100;SetPos(60, 13);cout << "经验:" << xp << "/" << 100 + (level + 1) * 10;int xp_of_level = 100 + (level + 1) * 10;int xp_ge = xp * 30 / xp_of_level;267 行未改动全部展开SetPos(18 + i * 20, 8);cout << "X" << fknum[i];}SetPos(12, 12);if(type == 0) cout << "【取出模式】选择要取出的物品/方块:M更改模式 E更改物品或方块 A向左 D向右 S取出 W全部取出";else if(type == 1) cout << "【存储模式】选择要存入的物品/方块:M更改模式 E更改物品或方块 A向左 D向右 S存入 W全部存入";if(subtype == 0){SetPos(12, 14);3 行未改动else if(item[now_item].rare == 3) Color(4);else Color(-1);cout << item[now_item].name;SetPos(32, 14);Color(0), cout << "X" << box_wp_num[now_item];}else if(subtype == 1){SetPos(12, 14);30 行未改动{for(int i = 0;i < box_wp_num[now_item];i++) item_pick(item[now_item]);box_wp_num[now_item] = 0;}else if(x == 's' && subtype == 1 && type == 0 && box_fk_num[now_item]){box_fk_num[now_block]--;block_pick(block[now_block]);2 行未改动{for(int i = 0;i < box_fk_num[now_block];i++) block_pick(block[now_block]);box_fk_num[now_block] = 0;}else if(x == 's' && subtype == 0 && type == 1 && item_num(item[now_item])){item_delete(item[now_item]);box_wp_num[now_item]++;3 行未改动box_wp_num[now_item] += item_num(item[now_item]);int now_num = item_num(item[now_item]);for(int i = 0;i < now_num;i++) item_delete(item[now_item]);}else if(x == 's' && subtype == 1 && type == 1 && block_num(block[now_block])){block_delete(block[now_block]);box_fk_num[now_block]++;24 行未改动{c = 1;}if(_kbhit()) flagjian = true;//时刻流逝short_tick++;for(int i = playerx - 20;i <= playerx + 20;i++){for(int j = playery - 20;j <= playery + 20;j++){if(world[i][j].id == 38 && rand() % 4 == 0) block_copy(i, j, 19);if(world[i][j].id == 41 && rand() % 2 == 0) block_copy(i, j, 19);if(world[i][j].id == 42) jiliu(i, j);}}if(short_tick == 10){print_data();short_tick = 0;tick++;tick_attack = false;int zhongdulevel = get_buff_level(buff[4]);7 行未改动if(jianweitishi) jianweitishi--;if(wajuetishi) wajuetishi--;if(fangzhihuanchong) fangzhihuanchong--;if(gongjihuanchong) gongjihuanchong--;//处理药水效果buff_merge();buff_live();//处理生命溢出8 行未改动{i++;xp -= 100 + (level + 1) * 10;level++;if(level % 2 == 0) max_health++; //每两级加一滴血}//处理TNT爆炸for(int i = 0;i < st_num;i++)15 行未改动}}}//处理实体溢出for(int i = 0;i < st_num;i++){if(!stl[i].boss && abs(stl[i].x - playerx) + abs(stl[i].y - playery) >= 20){11 行未改动}SetPos(0, 0);cout << "我的世界 minecraft";SetPos(0, 1);if(get_buff_level(buff[4])) Color(5);else Color(2);double the_mx = max_health + get_buff_level(buff[1]) * 4; //生命上限int h = health;int heart = h / the_mx * 10;for(int i = 0;i < heart;i++) cout << "◆"; //生命值int y = h / (the_mx / 10);for(int z = heart;z < 10;z++) cout << "◇";cout << ' ' << fixed << setprecision(1) << health << " ";Color(0);SetPos(0, 2);Color(3);for(int i = 2;i <= oxygen;i += 2) cout << "●"; //氧气值int u = oxygen / 2;for(int v = u + 1;v <= 10;v++) cout << "○";cout << ' ' << fixed << setprecision(1) << oxygen << " ";Color(0);SetPos(0, 3);for(int i = 2;i <= kjl.defease;i += 2) cout << "▼"; //盔甲SetPos(94, 2); //输出玩家坐标cout << "X:" << playerx;SetPos(94, 4);cout << "Y:" << playery;for(int i = 0;i < 5;i++) //打印物品栏 方块栏{SetPos(94, 6 + i * 2);if(now == i) Color(5);else if(wajuetishi) Color(2);54 行未改动cout << "S键保存当前存档";if(gamemode == 0 || gamemode == 2){SetPos(0, 38);cout << "Q键摧毁手持物品";}else{SetPos(0, 38);79 行未改动else if(j == playerx - 1 && i == playery){Color(5), cout << "A<";Color(0);continue;}else if(j == playerx + 1 && i == playery){Color(5), cout << "D>";64 行未改动SetPos(50, jjj + 1);cout << "|<>|";jjj += 3;}}Color(0);//流体下降for(int i = playery + 20;i >= playery - 20;i--){11 行未改动{health++;if(health > the_mx) health = the_mx;}//重力下落if(((tick * 10 + short_tick) % 3 == 0) && energy < 25){if(world[playerx][playery - 1].fluid){playery--;zhuiluo++;}else //落地{if(zhuiluo > 9) attack((zhuiluo - 9), "玩家摔死了");//摔落伤害zhuiluo = 0;}}//岩浆if(world[playerx][playery].id == 13 && short_tick % 2 == 1)9 行未改动if(world[playerx][playery].id == 35){attack(5, "玩家在死水中化为飞灰");}//氧气值下降if(short_tick == 0){if(world[playerx][playery].fluid && !(world[playerx][playery].name == "空气")){oxygen--;if(oxygen < 0){//氧气耗尽oxygen = 0;attack(1, "玩家窒息而死");}}else if(oxygen < 20){oxygen++; //若玩家不在流体中则恢复氧气}}if(energy > 0) //跳跃{if(world[playerx][playery + 1].fluid){playery++;energy -= 334;}else energy = 0;if(energy < 0) energy = 0;}//怪物实体跟随for(int i = 0;i < st_num;i++){if(abs(stl[i].x - playerx) + abs(stl[i].y - playery) >= 2&& abs(stl[i].x - playerx) + abs(stl[i].y - playery) <= 12848 行未改动stl[i].y--;}}}}//怪物攻击for(int i = 0;i < st_num;i++){if(abs(stl[i].x - playerx) + abs(stl[i].y - playery) <= 4&& short_tick % 5 == 0){attack(stl[i].ap, "玩家被" + stl[i].name + "杀死了");}//守卫 创生之力if(stl[i].type == 3&& abs(stl[i].x - playerx) + abs(stl[i].y - playery) <= 12&& rand() % 100 == 0){5 行未改动&& rand() % 100 == 0){huimiebaopo(i);}//守卫 穿山裂石if(stl[i].type == 3&& abs(stl[i].x - playerx) + abs(stl[i].y - playery) <= 17&& rand() % 60 == 0)15 行未改动&& rand() % 1 == 0){if(rand() % 12 == 0) chuangshengzhili(i);if(rand() % 4 == 0) chuanshanlieshi(i);if(rand() % 30 == 0)siwangtuci(i);if(rand() % 30 == 0) huimiebaopo(i);}}int ddx, ddy;136 行未改动全部展开block_copy(playerx + ddx, playery + ddy, 19);summon_entity(playerx + ddx, playery + ddy, 7);break;default:break;}}//箱子判定else if(world[playerx + ddx][playery + ddy].id == 37){box_gui();}//其它判定else if(world[playerx + ddx][playery + ddy].fluid && now <= 4 && !fangzhihuanchong){wajuetishi = 20;if(fknum[now] > 0 && fkl[now].id != 0){block_copy(playerx + ddx, playery + ddy, fkl[now].id);block_delete(fkl[now]);}fangzhihuanchong = max(fangzhihuanchong - 2, 0);68 行未改动print_data();}else if(x == 'q'){if(gamemode == 1) item_choose(); //创造物品选择器else if(now >= 5) wpnum[now - 5]--;else if(now < 5) fknum[now]--;}else if(x == 'z'){jianweitishi += 20;418 行未改动全部展开srand((unsigned)time(NULL));SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE);BBlood=50;Blood=1000;SlowDisplay(200,"神·逗比小螃蟹Crab_Dave·十大人格·卍解与你展开了战斗!\n\n");Sleep(1000);system("cls");while(1){Round++;War();Tai();if(Round>=14) break;2 行未改动}}using namespace Final;//角色信息struct person{char name[255];4 行未改动int defence;int speed;int attention;int magic;int maxmagic;int level;int money;int exp;23 行未改动{"Crab_Dave·charactor·sixth",233,75,30,20,35,0,0,0,0},{"Crab_Dave·charactor·seventh",233,30,40,30,30,0,0,0,0},{"Crab_Dave·charactor·eighth",233,20,20,30,0,0,0,0,0},{"Crab_Dave·charactor·ninth",233,40,30,20,20,0,0,0,0},{"Crab_Dave·charactor·tenth",233,50,25,20,50,0,0,0,0},{"Crab_Dave·卍",2333,75,40,30,50,0,0,0,0}};//变量声明区bool Exit=1,Boss1=0,Boss2=0,Boss3=0,Boss4=0,Dragon=0,shop1=0,shop2=0,shop3=0,fightboss4=0,Sandy[6],co=0;int a,_round,b,c,d;int sxie=5,xie=3,lxie=2,mxie=1,tw=3,dj=0,md=0,dbj=0,dp=0,key=0,page=1,zhi=0,huo=0,du=0,bing=0,shun=0,ask=1;char s[255],g;string x;//函数声明区void move();void First();void Second();void Home();2 行未改动void Show();void Bag();void Third();void Fight(int);int random(int);void slowplay();void fastplay();void Ask(int);void Gap();28 行未改动Sleep(700);}}//地牢一层(已完成)void First(){xx:system("cls");128 行未改动全部展开printf("输入错误!!!\n\n");Sleep(700);goto xx;}}//地牢二层(已完成)void Second(){74 行未改动player.money+=100;Sleep(500);}}}if(a==1||a==2||a==3){Fight(4);}286 行未改动全部展开{y:system("cls");if(!Boss1){x="打败了大型史莱姆再来吧...\n";slowplay();Sleep(500);return;40 行未改动}}}//并没有奖问答(已完成!)void Ask(int a){system("cls");if(a==1)7 行未改动gets(s);if(strcmp(s,"9")==0){x="\n仔细读题的好孩子(′-v- `)\n";slowplay();x="\n恭喜你,答对了~\n";slowplay();x="下一关载入中...\n";fastplay();257 行未改动全部展开}}}//时空裂缝(已完成)void Gap(){yyy:system("cls");98 行未改动slowplay();printf("如果你准备好了,请按Enter键进入,否则返回\n\n");g=_getch();if(g!=13)return;system("cls");x="笛卡尔·Li:...\n";slowplay();x="笛卡尔·Li:我是笛卡尔·Li,别号D人。\n";slowplay();463 行未改动全部展开player.health=0;}}//查看信息(已完成)void Show(){system("cls");printf("名称:%s\n等级:%d\n血量:%d/%d\n法力:%d/%d\n攻击:%d\n防御:%d\n金币:%d\n经验:%d/%d\n\n按任意键返回~\n",player.name,player.level,player.health,player.maxhealth,player.magic,player.maxmagic,player.attack,player.defence,player.money,player.exp,player.maxexp);151 行未改动全部展开shop2=1;shop3=1;if(!shop1){system("cls");x="商店里空空荡荡的...好冷清...\n\n";fastplay();printf("按任意键返回~");gets(s);320 行未改动全部展开//if(player.money>=200)//{x=player.name;fastplay();x="享用了一顿美味的大餐(嗝~),血量回满,花费金币200个~\n";fastplay();// player.money-=200;player.health=player.maxhealth;player.magic=player.maxmagic;31 行未改动goto xxx;}}//书桌(已完成)void Book(){yy:system("cls");290 行未改动全部展开g=_getch();goto yyy;}}//加密int Lock(int x){return (x+3141)*592-6535897+9323846;}//解密int Unlock(int x){return (x-9323846+6535897)/592-3141;}//存档(已完成)void Save(){ofstream out("Save.txt");//presonal informationout<<player.name<<'\n';out<<Lock(player.health)<<' '<<Lock(player.maxhealth)<<' '<<Lock(player.attack)<<' '<<Lock(player.defence)<<' '<<Lock(player.speed)<<' '<<Lock(player.attention)<<' ';out<<Lock(player.magic)<<' '<<Lock(player.maxmagic)<<' '<<Lock(player.level)<<' '<<Lock(player.money)<<' '<<Lock(player.exp)<<' '<<Lock(player.maxexp)<<'\n';//Boss状压if(Boss4) out<<Lock(4);else if(Boss3) out<<Lock(3);else if(Boss2) out<<Lock(2);else if(Boss1) out<<Lock(1);34 行未改动out.close();}//读档(已完成)void Read(){ifstream in("Save.txt");int lalala;13 行未改动player.money=Unlock(player.money);player.exp=Unlock(player.exp);player.maxexp=Unlock(player.maxexp);//Boss状压Boss1=Boss2=Boss3=Boss4=false;in>>lalala;if(Unlock(lalala)==4) Boss1=Boss2=Boss3=Boss4=true;else if(Unlock(lalala)==3) Boss1=Boss2=Boss3=true;else if(Unlock(lalala)==2) Boss1=Boss2=true;11 行未改动else if(lalala==1) shop1=true;//Sandy状压in>>lalala;for(int i=5;i>=0;i--)if(lalala&1) Sandy[i]=true,lalala>>=1;else Sandy[i]=false,lalala>>=1;in>>lalala;//bagin>>sxie>>xie>>lxie;in>>lalala;in>>mxie>>tw>>dj;6 行未改动in>>page>>zhi>>huo>>du>>bing>>shun>>ask;in>>co;if(co!=0&&co!=1)co=0;in.close();}//我方攻击(已完成)void IAttack(bool shuai){if(shuai){40 行未改动else printf("%s发起了攻击,但是...Miss...\n\n",player.name);}}//敌方攻击(已完成)void EAttack(bool shuai){if(enemy[0].zt!=2){271 行未改动全部展开printf("%s使用Boss技能:免疫!!!\n\n",enemy[0].name);Sleep(100);enemy[0].energy-=0;printf("%s从异常状态中脱出!\n\n",enemy[0].name);enemy[0].zt=0;}}else if(strcmp(enemy[0].name,"Crab_Dave·charactor·fourth")==0||(strcmp(enemy[0].name,"Crab_Dave·charactor·ninth")==0&&random(2))){190 行未改动全部展开}}}//对战(可能完成了吧...)void Fight(int num){strcpy(enemy[0].name,enemy[num].name);enemy[0].blood=enemy[num].blood;24 行未改动if(player.speed>=enemy[0].speed){IAttack(1);if(player.health<=0||enemy[0].blood<=0) break;EAttack(0);if(player.health<=0||enemy[0].blood<=0) break;if(enemy[0].zt==1){printf("%s喷出一口毒血,受到了%d点伤害!\n",enemy[0].name,du*20);285 行未改动全部展开Sleep(500);}}//随机函数+取模int random(int a){return (rand()%a+rand()%a+rand()%a)%a;}13 行未改动for(int i=0;i<l;i++)printf("%c",x[i]),Sleep(2);}//颜色函数void color(int a){switch(a){37 行未改动" | | _______| |____| | | | | |____________| |_____________| | |________| | | | "," | | | ___z_s________| | | |______________________________ |_____ ____| |___________________________________________________| "," | | | |___________________| | | | | | "," | | |_____ ____________s | | | | | "," | | | | | | | | | | "," | | | |_____________| |_________________________________| | | | "," | | |_______________ ___________________________________| | | "," | | | | ______________________ | | | "," | | | | | __________________ | | | | ",76 行未改动int sss = 114524,gjj=0;while (s_hq > 0){if(sss<=0){cout<<"你死了!";goto kkkkk;}cout << s;cout << "的血量:";12 行未改动gj += rand() % 10;srand(time(NULL));sss-=gjj;gjj+=rand()%10;}sout("你打败了");sout(s);kkkkk:;7 行未改动return;}}char gg[1010]={'a','b','c','d','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};void jiazai(int x){for(int i=1;i<=100;i++){cout<<"已加载%"<<i;Sleep(x);system("cls");28 行未改动if(sum==sum7&&sum1==sum6&&sum2==sum5&&sum3==sum4){cout<<"结束了";Sleep(2000);system("cls");return;}}}int main(){2 行未改动cout<<"你想要我干什么?\n";cout<<"1.计时(无尽模式)\n";cout<<"2.计时(有尽模式)\n";cout<<"3.打开网站\n";cout<<"4.小游戏\n";xy=_getch();system("cls");if(xy=='1'){int x1,x2,x3,x4;44 行未改动cout<<"1.走迷宫\n";cout<<"2.我的世界(2D版)\n";cout<<"3.猜数\n";cout<<"4.打字游戏\n";cout<<"5.战斗\n";cout<<"6.冒险\n";xx=_getch();system("cls");if(xx=='6'){srand(time(0));player.level=1000100;player.maxhealth=1000100;player.health=player.maxhealth;player.maxmagic=1000100;player.magic=player.maxmagic;10 行未改动// Boss1=Boss2=Boss3=Boss4=1,shop1=shop2=shop3=1;x="欢迎来到 冒险世界~ \( ̄▽ ̄)[▊\n\n伟大的作者大大:";slowplay();color(4);x="Crab_Dave";slowplay();color(1);x="<( ̄ˇ ̄)/\n\n版本号 2.2啦~:\n";55 行未改动x="好吧,再见QAQ...\n";slowplay();x="退出中...";slowplay();Sleep(1000);}if(xx=='2'){jiazai(50);gaiziti(14);//世界准备system("mode con cols=160 lines=50");srand(time(0));HideCursor();SetConsoleTitle("我的世界 0.8_v4");cundang:cout << "minecraft: 我的世界" << endl;cout << "1 使用原先存档" << endl;cout << "2 重置新的世界" << endl;cout << "3 查看更新日志" << endl;cout << "4 新手教程(";Color(5), cout << "新人必看";Color(0), cout << ")" << endl;cout << "5 设置" << endl;cout << "版本: 测试版0.8_v4" << endl;char n = input('1', '5');if(n == '5'){cout << endl;161 行未改动全部展开Color(6), cout << "内部版0.7pre3" << endl, Color(0);cout << "- 修改游戏名称" << endl;system("pause");system("cls");break;case '7':Color(6), cout << "内部版0.7pre4" << endl, Color(0);cout << "- 修复一些漏洞" << endl;system("pause");system("cls");break;case '8':Color(5), cout << "测试版0.7" << endl, Color(0);cout << "- 修改give命令" << endl;cout << "- 新增1个命令" << endl;cout << "- 修改主界面" << endl;cout << "- 重置存档时允许输入种子" << endl;cout << "- 修复一些漏洞" << endl;system("pause");system("cls");break;case '9':Color(5), cout << "测试版0.7a" << endl, Color(0);cout << "- 修改提升了程序的兼容性" << endl;system("pause");25 行未改动cout << "- 全新结构:宝藏岛登场!" << endl;cout << "- 下界地形优化:不再填满方块!" << endl;cout << "- 新增多个物品、方块" << endl;cout << "- 新增等级系统" << endl;cout << "- 其它一些小改动or小优化" << endl;system("pause");system("cls");break;case '4':Color(6), cout << "内部版0.8pre1.1" << endl, Color(0);cout << "- 宝藏探测器的一点小更改" << endl;cout << "- 补上了0.8pre1漏掉的一个小改动" << endl;cout << "- 等级系统BUG修复" << endl;system("pause");system("cls");break;case '5':Color(6), cout << "内部版0.8pre1.2" << endl, Color(0);cout << "- 大整改!!!" << endl;cout << "- 爆炸更新:添加了巨大的爆炸系统!" << endl;cout << "- 指令更新:增加了许多种指令!" << endl;cout << "- 伤害更新:大幅提升了高伤害时的减免!" << endl;cout << "- 经验更新:经验等级现在与生命值和挖掘速度挂钩!" << endl;22 行未改动cout << "- 修复了死亡后重生在地底的BUG" << endl;cout << "- 新增一个修改氧气值的指令" << endl;cout << "- 更改伤害指令的死亡信息" << endl;system("pause");system("cls");break;case '9':Color(5), cout << "测试版0.8_v2" << endl, Color(0);cout << "- 灵魂地牢更新:" << endl;26 行未改动cout << "- 改摔伤 降低了摔落伤害 同时修复了单次坠落格数过高时无法再跳跃的问题" << endl;cout << "- 修改了硬度系统 增高降低了某些方块的硬度 调高了一些镐子的挖掘速度" << endl;cout << "- 增大了海之环" << endl;system("pause");system("cls");case '3':Color(5), cout << "测试版0.8_v2.3" << endl, Color(0);cout << "- 修改宝藏岛 让它的生成变得更难" << endl;cout << "- 增加了未完成的下界要塞:生成机制重做中" << endl;65 行未改动// cout<<"是否有存档?\n";// char ooo;// cin>>ooo;// if(ooo=='y'){// ifstream fin("data.txt", ios::in);// for(int i=0;i<8;i++){// for(int j=0;j<a[i].size();j++){// fin>>a[i][j];// }// }// }sbsb:;cnt=0;int x=3,y=1,s=0,nn=9;cnt=0;while(1){// if(cnt==4){// cout<<"游戏结束!!!";// break;// }cout<<"现在是第"<<cnt+1<<"关\n";cout<<"共有"<<s<<"次复活机会\n";char ch;int len=yyy[0].size();31 行未改动if(yyy[x][y]=='T'){cout<<"咦?这是什么?...是高等传送门!!!即将传送至一个新的迷宫世界!!!要多加小心!!!";//system("cls");for(int i=1;i<=10010;i++) yyy[i]=zzz[i];}system("cls");}}if(xx=='3'){jiazai(10);t:;42 行未改动system("cls");}if(f==0)cout<<"恭喜通关!是否继续?(y/n)\n";else cout<<"失败!!!是否再玩一次???\n";system("cls");int xxx;cin>>xxx;if(xxx=='y') goto rrrr;}if(xx==5){jiazai(25);baoda();}}char xe;cout<<"是否重新命令我?(y/n)\n";xe=_getch();system("cls");if(xe=='y'){goto d;}return 0;}```