版本比较
小游戏
正文
增加 300 行删除 300 行
28 行未改动2930313233333435353637373839394041424243444544454647484849505051525253545555565758595 行未改动6566676869697071727328 行未改动10210310410510610610710810810911011111111211311411511611311411511611711811912011811912012112212312312412512612732 行未改动16016116216316416416516616716716816917017017117217317417517617617717817918046 行未改动22722822923023123223123223323423523623 行未改动2602612622632642642652662672682692702712722722732742752765 行未改动28228328428528628628728828929029129229329429529629729229329429529629729829930030130230330430530630730830930130230330430530630730830931031131131231331431529 行未改动3453463473483493493503513523534 行未改动3583593603613623623633643653664 行未改动3713723733743753753763773783795 行未改动38538638738838938939039139239313 行未改动407408409410411411412413414414415416417418392 行未改动全部展开8118128138148158158168178188188198208218228238238248258268278288298308318318328338348348358368378388398398408418428438448458458468478488498498508518518528538548555 行未改动8618628638648658658668678688697 行未改动87787887988088188188288388488588688788888989089189189289389489525 行未改动9219229239249259259269279289292 行未改动93293393493593693693793893994017 行未改动95895996096196296296396496596611 行未改动978979980981982982983984985986104 行未改动全部展开109110921093109410951095109610971098109933 行未改动113311341135113611371137113811391140114145 行未改动1187118811891190119111911192119311941195210 行未改动全部展开14061407140814091410141014111412141314147 行未改动142214231424142514261426142714281429143014311431143214331434143514361437143814391439144014411442144314431444144514461446144714481449145027 行未改动147814791480148114821482148314841485148665 行未改动15521553155415551556155615571558155815591560156115626 行未改动156915701571157215731573157415751576157713 行未改动15911592159315941595159515961597159815994 行未改动16041605160616071608160816091610161116121613161416141615161616171618647 行未改动全部展开2266226722682269227022702271227222732274306 行未改动全部展开2581258225832584258525852586258725882589803 行未改动全部展开33933394339533963397339733983399340034013 行未改动340534063407340834093409341034113412341330 行未改动34443445344634473448344834493450345134522 行未改动34553456345734583459345934603461346234633 行未改动346734683469347034713471347234733474347524 行未改动3500350135023503350435043505350635073508350935103511351235133514351335143515351635173518351835193520352135227 行未改动35303531353235333534353435353536353735388 行未改动354735483549355035513551355235533554355515 行未改动357135723573357435753575357635773578357911 行未改动35913592359335943595359535963597359835993600360136013602360336043605360636073608360836093610361136123613361436153614361536163617361836193619362036213622362354 行未改动367836793680368136823682368336843685368679 行未改动376637673768376937703770377137723773377464 行未改动383938403841384238433843384438453846384711 行未改动385938603861386238633863386438653866386738683869387038713871387238733874387438753876387738789 行未改动38883889389038913892389238933894389538963897389838993900390039013902390339043905390639073907390839093910391039113912391339143915391639173918391939203920392139223923392448 行未改动3973397439753976397739773978397939803981398239833984398539863987398739883989399039915 行未改动399739983999400040014001400240034004400515 行未改动4021402240234024402540254026402740284029136 行未改动全部展开4166416741684169417041704171417241734174417541764177417841774178417941804181418241834183418441854186418768 行未改动4256425742584259426042604261426242624263426442654266284 行未改动全部展开45514552455345544555455545564557455845594559456045614562456345644565456645674568456945694570457145724573161 行未改动全部展开473547364737473847394739474047414742474347444745474547464747474847494750475147524753475447554755475647574758475925 行未改动47854786478747884789478947904791479147924793479447954796479747984799479948004801480248034803480448054806480722 行未改动483048314832483348344834483548364837483826 行未改动486548664867486848694869487048714872487358 行未改动493249334934493549364936493749384939494019 行未改动49604961496249634964496449654966496749684969496949704971497249735 行未改动497949804981498249834983498449854986498774 行未改动506250635064506550665066506750685069507099 行未改动5170517151725173517451745175517651775178517951795180518151825183518251835184518551865187518851885189519051915191519251935194519551965197519851995200520152025203520052015202520352045205520652075205520652075208520952105211521252135214521452155216521652175218521952209 行未改动52305231523252335234523452355236523752385238523952405240524152425242524352445245524612 行未改动52595260526152625263526352645265526552665267526852693 行未改动5273527452755276527752775278527952795280528152825283102 行未改动全部展开538653875388538953905390539153925393539427 行未改动542254235424542554265426542754285429543020 行未改动54515452545354545455545554565457545854594 行未改动5464546554665467546854695468546954705471547254735473547454755476547727 行未改动550555065507550855095509551055115512551255135514551555165517551755185519552055214 行未改动55265527552855295530553055315532553355344 行未改动553955405541554255435543554455455546554713 行未改动5561556255635564556555655566556755685569557055705571557255735574557555765577557855785579558055815582558355845584558555865586558755885589559016 行未改动560756085609561056115611561256135614561526 行未改动564256435644564556465646564756485648564956505651565224 行未改动567756785679568056815681568256835683568456855686568728 行未改动57165717571857195720572057215722572357245725572657275727572857295730573112 行未改动5744574557465747574857485749575057505751575257535754575557565757575857595759576057615761576257635764576516 行未改动57825783578457855786578657875788578957908 行未改动579958005801580258035803580458055806580770 行未改动587858795880588158825882588358845885588623 行未改动5910591159125913591459155914591559165917591859199 行未改动5929593059315932593359335934593559365937593759385939594059415942594359445944594559465947594859495950595159515952595359535954595559565955595659575958595859595960596159625962596359645965596659675968596959705971597159725973597459752 行未改动59785979598059815982598259835984598559867 行未改动59945995599659975998599959985999600060016002600318 行未改动602260236024602560266026602760286029602960306031603260335 行未改动60396040604160426043604360446045604660473 行未改动60516052605360546055605560566057605860593 行未改动60636064606560666067606760686069607060716071607260736074607560766077607860786079608060816082608360846085608560866087608760886089609060896090609160926092609360946095609660966097609860996100610161026103610461056105610661076108610961106110611161126113611430 行未改动614561466147614861496149615061516152615318 行未改动617261736174617561766176617761786179618011 行未改动619261936194619561966196619761986199620022 行未改动62236224622562266227622862276228622962306231623264 行未改动6297629862996300630163016302630363046305630663076308630963106311631163126313631463152 行未改动6318631963206321632263226323632463256325632663276328632933 行未改动6363636463656366636763676368636963706371637163726373637463756376637763776378637963806381638263836383638463856386638779 行未改动646764686469647064716471647264736474647516 行未改动649264936494649564966496649764986499650059 行未改动656065616562656365646564656565666567656819 行未改动658865896590659165926592659365946595659616 行未改动661366146615661666176617661866196620662139 行未改动6661666266636664666566656666666766686669115 行未改动全部展开6785678667876788678967896790679167926793101 行未改动全部展开689568966897689868996899690069016902690314 行未改动691869196920692169226922692369246925692625 行未改动695269536954695569566956695769586959696045 行未改动7006700770087009701070107011701270137014112 行未改动全部展开712771287129713071317131713271337134713574 行未改动7210721172127213721472147215721672177218166 行未改动全部展开73857386738773887389738973907391739273937394739573967396739773987399740087 行未改动7488748974907491749274927493749474957496144 行未改动全部展开764176427643764476457645764676477648764939 行未改动768976907691769276937693769476957696769725 行未改动77237724772577267727772777287729773077319 行未改动774177427743774477457745774677477748774924 行未改动777477757776777777787778777977807781778277837784200 行未改动全部展开7985798679877988798979897990799179927993100 行未改动809480958096809780988098809981008101810225 行未改动812881298130813181328132813381348135813610 行未改动814781488149815081518151815281538154815527 行未改动81838184818581868187818781888189819081911,058 行未改动全部展开9250925192529253925492549255925692579258925992609261926192629263926492659266926792689268926992709271927292739274927592769276927792789279927992809281928292839284928492859286928792889289928992909291929292939294929592969296929792989298929993009301930293029303930493059306930793089309930993109311931293139314931493159316931693179318931993209321932293239324932493259326932793289329932993309331933193329333933493356 行未改动934293439344934593469346934793489349935093519352935393549354935593569357935893599359936093619362936393649364936593669367936893699369937093719372937393749375937693779377937893799380938193829383938493849385938693869387938893899390939193919392939393939394939593969397939893999400940194029403940494059403940494059406940794089409941094119412941394149415941594169417941794189419942094212 行未改动9424942594269427942894289429943094319432943394349434943594369437943894399440944194429442944394449445944642 行未改动28 行未改动
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==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==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==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==8) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY|FOREGROUND_RED|FOREGROUND_BLUE); //随机 if(a == -1) Color(rand() % 8); if(a == -1) Color(rand() % 8);}
void SetPos(COORD a)// set cursor 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}; 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=合金) int level; //挖掘等级(0=徒手 1=木 2=石 3=铁 4=钻石 5=合金) string name; bool fluid; //是否为流体(可以穿越 能够替换成方块) bool fluid; //是否为流体(可以穿越 能够替换成方块)};
BLOCK block[] = //方块 BLOCK block[] = //方块{{0, "□", 0, 2000000000, 100, "基岩", false}, {1, "■", 6, 200, 1, "石头", false}, {2, "▓ ", 7, 45, 0, "泥土", false}, {3, "▓ ", 6, 45, 0, "砂砾", false}, {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}, {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}, {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 speed; //每个短刻的挖掘进度 int level; string name; int rare; //稀有度 白0<绿1<蓝2<紫3<幻4 int rare; //稀有度 白0<绿1<蓝2<紫3<幻4};
ITEM item[] = //物品 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}, {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级 int level; //等级 默认为0 1级以上显示在玩家属性页面中 int time; //单位: short_tick 降至0后等级降至0级};
BUFF buff[] = //效果{23 行未改动 int color;
int hp; int ap; bool power; //能否摧毁沿路方块 bool power; //能否摧毁沿路方块 bool boss; int xp;
int x; int y;};
ENTITY entity[] = 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 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; //已拥有BUFF int fknum[5], wpnum[5]; //数量(max:64) 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 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; //是否新手引导 int yindao = -1; //是否新手引导
void print_data();void input_data();
29 行未改动};
//下界城市//核心int nc_core[9][9] = 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] = 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] = 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] = 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() //新手教程 void init_junior() //新手教程{ yindao = 0; for(int x = 0;x < 2400;x++) //填充空气 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() //生成世界 void init() //生成世界{ cout << "2%" << endl; for(int x = 0;x < 2400;x++) //填充空气 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 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) int stgd[2400]; //石头高度(海平面700) //生成主世界构造 //确认x坐标下石头高度 (第一次构造) stgd[1200] = 200; //默认值 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); //小变动 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; //断崖式变动 stgd[x] = stgd[x + 1] + add; //断崖式变动 } else { stgd[x] = stgd[x + 1]; //无变动 stgd[x] = stgd[x + 1]; //无变动 } if(stgd[x] > 210) stgd[x] = 210; 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; 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] = 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层为泥土 //最上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); 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) //实体生成 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) //造成伤害 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]); //生命吸收 if(get_buff_level(buff[3]) > 0) hurt -= get_buff_level(buff[3]); //生命吸收 health -= hurt; tick_attack = true; if(health < 0 && gamemode == 2) //玩家死亡 极限模式=删除存档 if(health < 0 && gamemode == 2) //玩家死亡 极限模式=删除存档 { system("cls"); SetPos(2, 2); cout << "GAME OVER";27 行未改动}
void input_data() //输入数据{ ifstream fin("data.txt", ios::in); 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() //输出数据 void print_data() //输出数据{ ofstream fout("data.txt", ios::out); 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 << 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() //创造物品选择器 void item_choose() //创造物品选择器{ system("cls"); SetPos(10, 1); cout << "创造模式物品选择器:";4 行未改动 while(1) { SetPos(10, 7); cout << "手中物品:"; if(now <= 4) //显示方块 if(now <= 4) //显示方块 { Color(fkl[now].color), cout << fkl[now].txt << ' ' << fkl[now].name; cout << " "; Color(0); } else //显示物品 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 灵魂之星"; cout << "3 灵魂之星"; SetPos(10, 9); cout << "3 离开"; char cft16 = input('1', '4'); if(cft16 == '1')306 行未改动全部展开 } } else if(cft21 == '5') { return; return; } } else if(cft2 == '2') {803 行未改动全部展开 SetPos(18 + i * 20, 8); cout << "X" << fknum[i]; } SetPos(12, 12); if(type == 0) cout << "【取出模式】选择要取出的物品/方块:M更改模式 E更改物品或方块 A向左 D向右 S取出 W全部取出"; 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]; 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(world[i][j].id == 42) jiliu(i, j); } } if(short_tick == 10) { print_data(); 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++; //每两级加一滴血 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 << "世界与我 Craft And My"; SetPos(0, 1); 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 << "◆"; //生命值 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 << "●"; //氧气值 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); //输出玩家坐标 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++) //打印物品栏 方块栏 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键摧毁手持物品"; cout << "Q键摧毁手持物品"; } else { SetPos(0, 38);79 行未改动 else if(j == playerx - 1 && i == playery) { Color(5), cout << "A<"; Color(0); continue; 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 //落地 else //落地 { if(zhuiluo > 9) attack((zhuiluo - 9), "玩家摔死了");//摔落伤害 zhuiluo = 0; 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++; //若玩家不在流体中则恢复氧气 oxygen++; //若玩家不在流体中则恢复氧气 } } if(energy > 0) //跳跃 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)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; 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(); //创造物品选择器 if(gamemode == 1) item_choose(); //创造物品选择器 else if(now >= 5) wpnum[now - 5]--; else if(now < 5) fknum[now]--; else if(now < 5) fknum[now]--; } else if(x == 'z') { jianweitishi += 20;284 行未改动全部展开
int main(){ gaiziti(14); //世界准备 //世界准备 system("mode con cols=160 lines=50"); srand(time(0)); HideCursor(); SetConsoleTitle("世界与我 0.8_v4"); SetConsoleTitle("世界与我 0.8_v4");cundang: cout << "Craft and My: 世界与我" << 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; 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; break; case '7': Color(6), cout << "内部版0.7pre4" << endl, Color(0); cout << "- 修复一些漏洞" << endl; system("pause"); system("cls"); break; 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; 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; cout << "- 其它一些小改动or小优化" << endl; system("pause"); system("cls"); 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"); system("cls"); break; case '5': Color(6), cout << "内部版0.8pre1.2" << endl, Color(0); cout << "- 大整改!!!" << endl; cout << "- 大整改!!!" << endl; cout << "- 爆炸更新:添加了巨大的爆炸系统!" << endl; cout << "- 指令更新:增加了许多种指令!" << endl; cout << "- 伤害更新:大幅提升了高伤害时的减免!" << endl; cout << "- 经验更新:经验等级现在与生命值和挖掘速度挂钩!" << endl;22 行未改动 cout << "- 修复了死亡后重生在地底的BUG" << endl; cout << "- 新增一个修改氧气值的指令" << endl; cout << "- 更改伤害指令的死亡信息" << endl; system("pause"); system("cls"); 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"); system("cls"); case '3': Color(5), cout << "测试版0.8_v2.3" << endl, Color(0); cout << "- 修改宝藏岛 让它的生成变得更难" << endl; cout << "- 增加了未完成的下界要塞:生成机制重做中" << endl;58 行未改动 system("cls"); jiaocheng(); } minecraft(); return 0; return 0;}```
19 行未改动 Sleep(1);//等待时间:1毫秒 i++; if(i%30==0) system("cls"); }
/*if (result != 0) { std::cerr << "Error closing application" << std::endl; return 1; }*/
return 0;}```
5 行未改动#include <cstdlib>int main() { system("color 0b"); SetConsoleTitle("关机阻止卫士"); std::cout<<"正在阻止关机\n"; std::cout<<"正在阻止关机\n"; Sleep(700);//等待时间:1毫秒 while(true){ system("shutdown -a"); Sleep(1);//等待时间:1毫秒74 行未改动 Color(true,true,true,true);}void drawline(int j,int h,char c,WORD color){ h/=2; int up=he/2+h,down=he/2-h; int up=he/2+h,down=he/2-h; for(int i=he/2;i<up; i++){dis[i][j]=c;discolor[i][j]=color;} for(int i=he/2;i>down;i--){dis[i][j]=c;discolor[i][j]=color;}}float scan(float px,float py,int dir,float pdir,char &c,WORD &color){99 行未改动#define sblue FOREGROUND_BLUE#define set set1(set2 | sred | sgreen | sblue)using namespace std;using namespace __gnu_pbds;//宗教,民众,军队,财富! //宗教,民众,军队,财富!struct data{ string a;//事件过程 int a1,a2,a3,a4;//Y int b1,b2,b3,b4;//N string b,c;//b为Y得到技能名称,c为N得到技能名称 string b,c;//b为Y得到技能名称,c为N得到技能名称}x[1005];struct data2{ int a,b;//起始年,驾崩年 string s;//名字 int a,b;//起始年,驾崩年 string s;//名字};struct data3{ int a,b;//起始年,结束年 string s;//我方名字 int w;//是否胜利 int w;//是否胜利};struct data_email{ string a,b;//发送者、内容 string a,b;//发送者、内容};#define SIZe 17int ra[SIZe*2+1];int year=1,year2=1,qaq=0,qaq2=0,textspeed=3,Flag=0;int auto_read=0,auto_file=0;string version="V1.1.18";data2 gq[1005];data3 gq2[1005];vector<string> banben;//可读版本列表 vector<string> ach;//普通模式成就列表 vector<string> skills_2nd;//普通模式技能列表 vector<string> emails;//收到的邮件 vector<string> banben;//可读版本列表vector<string> ach;//普通模式成就列表vector<string> skills_2nd;//普通模式技能列表vector<string> emails;//收到的邮件gp_hash_table<string,string> skills;//普通模式技能效果gp_hash_table<string,bool> ach_judge;//成就完成判断 gp_hash_table<string,string> ach_introduce;//成就介绍 gp_hash_table<string,vector<string> > achs;//成就分类 gp_hash_table<string,bool> ach_judge;//成就完成判断gp_hash_table<string,string> ach_introduce;//成就介绍gp_hash_table<string,vector<string> > achs;//成就分类gp_hash_table<string,data_email> email_text;//根据标题为key储存发送者与内容gp_hash_table<string,bool> email_judge;//根据标题为key储存是否已读template <typename T>inline string change(T a){stringstream ss;string s;ss.clear();ss.str("");ss<<a;ss>>s;return s;}iv init(){ //可读版本 //可读版本 banben.push_back("V1.1.18"); //普通&AI模式事件 //普通&AI模式事件 x[1]=data{"大臣:国王,敌国的军队来攻打我们了。(Y:出军;N:没有动静)",0,-5,-10,-10,0,-15,0,0,"",""}; x[2]=data{"传信人:我们的内部出现了内奸,散布虚假消息。(Y:解决;N:没有动静)",10,0,-5,0,-20,-10,0,0,"",""}; x[3]=data{"大臣:在山下发现金矿。(Y:挖掘;N:没听见)",10,-10,-10,20,0,-10,0,0,"",""}; x[4]=data{"大臣:我们可以下发民众调查,加善百姓生活。(Y:接受;N:不接受)",5,10,0,-10,0,-10,-5,5,"",""};9 行未改动 x[14]=data{"大臣:我认为我们可以加进人才。(Y:同意;N:拒绝)",0,20,0,-10,0,-10,0,0,"",""}; x[15]=data{"传信人:民间的传染病越加严重。(Y:解决;N:没有动静)",10,10,-10,-20,0,-20,-10,0,"",""}; x[16]=data{"天文学家:我预测这几日天气状况不佳。(Y:认同;N:不认同)",0,10,-10,0,0,0,0,0,"",""}; x[17]=data{"传信人:鼠疫导致民间人心惶惶。(Y:解决;N:没有动静)",0,20,0,-10,0,-15,-5,0,"",""}; //普通&AI模式技能列表 //普通&AI模式技能列表 skills_2nd.push_back("逃避"); skills_2nd.push_back("平安"); skills_2nd.push_back("倒置"); //普通&AI模式技能介绍 //普通&AI模式技能介绍 skills["逃避"]="躲过这次选择,不接受也不拒绝"; skills["平安"]="使任一属性回到50 (可选择)"; skills["平安"]="使任一属性回到50 (可选择)"; skills["倒置"]="使做出选择后获得的增益倒置 (不包括获得、使用技能),直到下一次使用倒置为止"; //成就列表 //成就列表 ach.push_back("初登王位"); ach.push_back("多重加害"); ach.push_back("百寿"); ach.push_back("竞争者");12 行未改动 ach_introduce["常年争执"]="一个人物与A.I.连续对战30年"; ach_introduce["殊途同归"]="在若干回合后双方的数据重回一样"; ach_introduce["保持同步"]="连续5回合与A.I.选择一样"; ach_introduce["名字问题"]="......你真的以为我会让你使用它?"; ach_introduce["隐藏地域"]="你是怎么发现这儿的?"; ach_introduce["隐藏地域"]="你是怎么发现这儿的?"; //......然而成就的展示是按获取方式分。 achs["普通模式"].push_back("初登王位"); achs["普通模式"].push_back("初登王位"); achs["普通模式"].push_back("多重加害"); achs["普通模式"].push_back("百寿"); achs["A.I.对战"].push_back("竞争者"); achs["A.I.对战"].push_back("两败俱伤");3 行未改动 achs["隐藏成就"].push_back("名字问题"); achs["隐藏成就"].push_back("隐藏地域"); //邮件内容 email_text["游戏介绍-普通模式"]=data_email{"紫陰花", "在这个游戏中,你需要控制一名君王来应对每一年所发生的事件,作出相应的对答。\n每一次相应的对答可以选择Y或N,你的国家拥有四种属性,不同的对答会造成每个属性的相应加减。\n四种属性分别是:宗教,民众,军队,财富。\n每个属性的初始状态都为50点。通过选择会加减属性,当一个属性<=0或>=100时,游戏结束,愤怒的臣民会杀掉你。\n你还拥有一项技能,这需要你在游戏中获得。技能是一次性的,得到新的技能会覆盖原技能。有技能时可以按S(Skill)触发效果。\n你的游戏目标是,活得尽量久。\n"}; "在这个游戏中,你需要控制一名君王来应对每一年所发生的事件,作出相应的对答。\n每一次相应的对答可以选择Y或N,你的国家拥有四种属性,不同的对答会造成每个属性的相应加减。\n四种属性分别是:宗教,民众,军队,财富。\n每个属性的初始状态都为50点。通过选择会加减属性,当一个属性<=0或>=100时,游戏结束,愤怒的臣民会杀掉你。\n你还拥有一项技能,这需要你在游戏中获得。技能是一次性的,得到新的技能会覆盖原技能。有技能时可以按S(Skill)触发效果。\n你的游戏目标是,活得尽量久。\n"}; email_text["游戏介绍-A.I.对战"]=data_email{"紫陰花", "在普通模式的基础上,你需要与一个A.I.对战,你与其面对相同的问题而做出选择,最后活下的人胜利。"}; "在普通模式的基础上,你需要与一个A.I.对战,你与其面对相同的问题而做出选择,最后活下的人胜利。"}; email_text["欢迎来到王权"]=data_email{"紫陰花", "感谢您游玩王权!\n游戏制作者:紫陰花\n游戏团队:https://www.luogu.com.cn/team/23723"}; email_text["hide1"]=data_email{"???","你为什么会到这儿?"}; email_text["hide2"]=data_email{"???","你不应该来到这儿。离开。"};102 行未改动全部展开 if(s1.size()!=0) { print("|"); cyan(s1); print(":"+string(kkk-1-s1.size(),' ')+"|\n"); print(":"+string(kkk-1-s1.size(),' ')+"|\n"); } int s2u=0,summ=0; for(int i=0;i<s2.size();i++) {27 行未改动 print(change(a));set;}inline int div_int(int a,int b){return b==0?0:a/b;}iv cho(int a){if(a>0) green("增加");if(a<0) red("减少");if(a==0) print("无");}iv email() //邮件 iv email() //邮件{ cls; for(int i=emails.size()-1;i>=0;i--) {20 行未改动 while(c<0 or c>emails.size()) cin>>c; if(c==0) { cls; start(); start(); } else { cls;4 行未改动 while(c!='1') c=getch(); cls; email(); }} iv file(int hi) //存档 }iv file(int hi) //存档{ /* version year year2 qaq qaq2 textspeed auto_read auto_file year year2 qaq qaq2 textspeed auto_read auto_file gq[1].a gq[1].b gq[1].s ... gq[qaq].a gq[qaq].b gq[qaq].s gq2[1].a gq2[1].b gq2[1].s gq2[1].w27 行未改动 for(int i=0;i<emails.size();i++) fout<<emails[i]<<' '; fout<<endl; for(int i=0;i<emails.size();i++) fout<<email_judge[emails[i]]<<' '; fout<<email_judge[emails[i]]<<' '; fout<<endl; fout.close();
ofstream fout2("reignsach.txt"); for(int i=0;i<ach.size();i++) fout2<<ach_judge[ach[i]]<<' '; fout2.close();
if(hi==0) { green("存档成功!"); Sleep(2000);4 行未改动 cls; start(); }}iv readfile(int hi) //读档 iv readfile(int hi) //读档{ char c='N'; if(hi==0) {4 行未改动 if(c=='Y' or hi==1) { string guyutxdy; ifstream fin("reignsfile.txt"); fin>>guyutxdy;//版本占位符 fin>>guyutxdy;//版本占位符 fin>>year>>year2>>qaq>>qaq2>>textspeed>>auto_read>>auto_file; for(int i=1;i<=qaq;i++) fin>>gq[i].a>>gq[i].b>>gq[i].s; for(int i=1;i<=qaq2;i++)13 行未改动 fin>>sr1; email_judge[emails[i]]=sr1; } fin.close();
ifstream fin2("reignsach.txt"); for(int i=0;i<ach.size();i++) fin2>>ach_judge[ach[i]]; fin2.close();
if(hi==0) { green("读档成功!"); Sleep(2000); } } if(hi==1) Flag=1; else else { cls; start(); }}iv statistics() //统计 iv statistics() //统计{ yellow("普通模式:\n"); yellow("普通模式:\n"); if(qaq==0) cyan("尚未有人坐上王座\n\n"); else { cyan("到目前为止,有 ");16 行未改动 cyan(" ,统治了 "); print(change(maxn)); cyan(" 年\n\n"); } yellow("A.I.对战:\n"); yellow("A.I.对战:\n"); if(qaq2==0) cyan("尚未有人开始争夺\n\n"); else { cyan("到目前为止,有 ");26 行未改动 cyan("按1退出\n"); char c=getch(); while(c!='1') c=getch(); cls; start(); start();}iv journal() //更新日志 iv journal() //更新日志{ yellow("V1.0.0:");pink("基础游戏设施 (2019.11.29)\n"); yellow("V1.0.1:");pink("增加更新日志 设置 存档 读档 (2019.11.30)\n"); yellow("V1.0.2:");pink("增加2条新的事件 (2019.12.2)\n");24 行未改动 cyan("\n按1退出\n"); char c=getch(); while(c!='1') c=getch(); cls; start(); start();}iv setting() //设置 iv setting() //设置{ cyan("1.文本速度\n"); cyan("2.自动读档(打开exe文件时)\n"); cyan("3.自动存档(游戏结束后)\n");28 行未改动 if(auto_file!=0 and auto_file!=1) auto_file=0; cls; setting(); } if(c=='4'){cls;start();} if(c=='4'){cls;start();}}iv achievement_name_judge(string &qwq){ if(ach_judge[qwq]==0) red(string(qwq.size(),'?')); else green(qwq);}iv achievement() //成就 iv achievement() //成就{ cyan("成就名是全为?的,表示未完成;绿色表示已完成\n\n"); int usize=achs["普通模式"].size(); yellow("普通模式:\n");12 行未改动 cyan("\n按1退出\n"); char c=getch(); while(c!='1') c=getch(); cls; start(); start();}iv reigns_data() //游戏机制资料 iv reigns_data() //游戏机制资料{ cyan("技能:\n\n"); for(int i=0;i<skills_2nd.size();i++) pink(skills_2nd[i]+":"+skills[skills_2nd[i]]+"\n"); cyan("\n按1退出\n"); char c=getch(); while(c!='1') c=getch(); cls; start(); start();}iv choose_game() //选择游戏 iv choose_game() //选择游戏{ green("1.普通模式\n"); green("2.A.I.对战\n"); green("3.返回\n");16 行未改动 cls; start(); }}iv save_or_read() //选择存读档: iv save_or_read() //选择存读档:{ green("1.存档\n"); green("2.读档\n"); green("3.返回\n");8 行未改动 cls; start(); }}iv start() //主界面 iv start() //主界面{ pink("The Game:");yellow("Reigns");pink(" (王权)\n"); pink("Version:");yellow(version);pink("\n"); pink("The Author:");yellow("紫陰花");pink(" (洛谷用户名)\n\n");70 行未改动{ if(judge==0) return number; else return 0-number;}iv game() //普通模式 iv game() //普通模式{ string name; string skill="无"; int q=50,w=50,e=50,r=50;23 行未改动 print("财富:");num(r);putchar('\n'); print("技能:");cyan(skill);putchar('\n'); if(inver==1) red("处于倒置状态\n"); putchar('\n'); if(q<=0 or q>=100 or w<=0 or w>=100 or e<=0 or e>=100 or r<=0 or r>=100) //死亡
if(q<=0 or q>=100 or w<=0 or w>=100 or e<=0 or e>=100 or r<=0 or r>=100) //死亡 { red("对你感到不满的臣民们一拥而上,杀死了你\n"); gq[qaq+1]={k,year,name}; qaq++;9 行未改动 cls; start(); return; }
print("事件:\n"); int v=ra[j]; print(x[v].a);putchar('\n');
print("Y:\n宗教:");cho(inversion(inver,x[v].a1)); print("\n民众:");cho(inversion(inver,x[v].a2)); print("\n军队:");cho(inversion(inver,x[v].a3)); print("\n财富:");cho(inversion(inver,x[v].a4)); putchar('\n'); if(x[v].b!="") print("可得技能:"),cyan(x[v].b),putchar('\n');
print("N:\n宗教:");cho(inversion(inver,x[v].b1)); print("\n民众:");cho(inversion(inver,x[v].b2)); print("\n军队:");cho(inversion(inver,x[v].b3)); print("\n财富:");cho(inversion(inver,x[v].b4)); putchar('\n'); if(x[v].c!="") print("可得技能:"),cyan(x[v].c),putchar('\n');
if(skill!="无") print("S:\n技能效果:\n"),cyan(skills[skill]);
putchar('\n'); c=getch();
c=getch(); while(c!='Y' and c!='N' and ((c=='S' and skill=="无") or c!='S')) c=getch(); if(c=='Y'){q+=inversion(inver,x[v].a1);w+=inversion(inver,x[v].a2);e+=inversion(inver,x[v].a3);r+=inversion(inver,x[v].a4);if(x[v].b!="") skill=x[v].b;} if(c=='Y'){q+=inversion(inver,x[v].a1);w+=inversion(inver,x[v].a2);e+=inversion(inver,x[v].a3);r+=inversion(inver,x[v].a4);if(x[v].b!="") skill=x[v].b;} if(c=='N'){q+=inversion(inver,x[v].b1);w+=inversion(inver,x[v].b2);e+=inversion(inver,x[v].b3);r+=inversion(inver,x[v].b4);if(x[v].c!="") skill=x[v].c;} if(c=='S') { if(skill=="平安") if(skill=="平安") { cyan("选择宗教按1、民众按2、军队按3、财富按4\n"); c=getch(); while(c<'1' or c>'4') c=getch(); if(c=='1') q=50; if(c=='2') w=50; if(c=='3') e=50; if(c=='4') r=50; year--,j--; year--,j--; } if(skill=="倒置") inver=1-inver,year--,j--; skill="无"; }2 行未改动 if(j==SIZe*2+1) rs(),j=1; }}iv ai_game() //A.I.对战 iv ai_game() //A.I.对战{ string name; string skill="无",skill2="无"; int q=50,w=50,e=50,r=50;7 行未改动 return; } cls; int k=year2,j=1,inver1=0,inver2=0; bool sttg=0;//殊途同归 成就判断 int bctb=0;//保持同步 成就判断 bool sttg=0;//殊途同归 成就判断 int bctb=0;//保持同步 成就判断 char c; rs(); if(k==1) achieve("竞争者");18 行未改动 red("敌方技能:");cyan(skill2);putchar('\n'); if(inver1==1) red("我方处于倒置状态\n"); if(inver2==1) red("敌方处于倒置状态\n"); putchar('\n');
bool die_1=(q<=0 or q>=100 or w<=0 or w>=100 or e<=0 or e>=100 or r<=0 or r>=100); bool die_2=(q2<=0 or q2>=100 or w2<=0 or w2>=100 or e2<=0 or e2>=100 or r2<=0 or r2>=100);
if(die_1 and die_2) { red("双方君王同时被杀\n"); red("同时死亡,游戏平局\n");5 行未改动 cls; start(); return; } if(die_1) //我方死亡 if(die_1) //我方死亡 { red("对你感到不满的臣民们一拥而上,杀死了你\n"); red("您先死亡,游戏失败\n"); gq2[qaq2+1]={k,year2,name,0};3 行未改动 cls; start(); return; } if(die_2) //敌方死亡 if(die_2) //敌方死亡 { red("敌方的统治失败,君王被杀\n"); red("敌方死亡,游戏胜利\n"); gq2[qaq2+1]={k,year2,name,1};3 行未改动 cls; start(); return; }
print("事件:\n"); int v=ra[j]; print(x[v].a);putchar('\n');
print("Y:\n宗教:");cho(inversion(inver1,x[v].a1)); print("\n民众:");cho(inversion(inver1,x[v].a2)); print("\n军队:");cho(inversion(inver1,x[v].a3)); print("\n财富:");cho(inversion(inver1,x[v].a4)); putchar('\n'); if(x[v].b!="") print("可得技能:"),cyan(x[v].b),putchar('\n');
print("N:\n宗教:");cho(inversion(inver1,x[v].b1)); print("\n民众:");cho(inversion(inver1,x[v].b2)); print("\n军队:");cho(inversion(inver1,x[v].b3)); print("\n财富:");cho(inversion(inver1,x[v].b4)); putchar('\n'); if(x[v].c!="") print("可得技能:"),cyan(x[v].c),putchar('\n');
if(skill!="无") print("S:\n技能效果:\n"),cyan(skills[skill]);
putchar('\n'); c=getch();
c=getch(); while(c!='Y' and c!='N' and ((c=='S' and skill=="无") or c!='S')) c=getch(); if(c=='Y'){tb_i_choose=1,q+=inversion(inver1,x[v].a1);w+=inversion(inver1,x[v].a2);e+=inversion(inver1,x[v].a3);r+=inversion(inver1,x[v].a4);if(x[v].b!="") skill=x[v].b;} if(c=='Y'){tb_i_choose=1,q+=inversion(inver1,x[v].a1);w+=inversion(inver1,x[v].a2);e+=inversion(inver1,x[v].a3);r+=inversion(inver1,x[v].a4);if(x[v].b!="") skill=x[v].b;} if(c=='N'){tb_i_choose=2,q+=inversion(inver1,x[v].b1);w+=inversion(inver1,x[v].b2);e+=inversion(inver1,x[v].b3);r+=inversion(inver1,x[v].b4);if(x[v].c!="") skill=x[v].c;} if(c=='S') { if(skill=="平安") if(skill=="平安") { cyan("选择宗教按1、民众按2、军队按3、财富按4\n"); c=getch(); while(c<'1' or c>'4') c=getch(); if(c=='1') q=50; if(c=='2') w=50; if(c=='3') e=50; if(c=='4') r=50; year2--,j--,ai_back=1; year2--,j--,ai_back=1; } if(skill=="倒置") inver1=1-inver1,year2--,j--,ai_back=1; skill="无"; }
if(ai_back==0) { //A.I.判断部分 int ai_a1=q2+inversion(inver2,x[v].a1),ai_b1=w2+inversion(inver2,x[v].a2),ai_c1=e2+inversion(inver2,x[v].a3),ai_d1=r2+inversion(inver2,x[v].a4);30 行未改动 { if(abs(ai_o1-200)>abs(ai_o2-200)) choose=2; if(abs(ai_o1-200)<abs(ai_o2-200)) choose=1; if(abs(ai_o1-200)==abs(ai_o2-200)) choose=rand()%2+1; } } } } if(ai_s1 and not(ai_s2)) choose=1; if(not(ai_s1) and ai_s2) choose=2;18 行未改动 { if(abs(ai_o1-200)>abs(ai_o2-200)) choose=2; if(abs(ai_o1-200)<abs(ai_o2-200)) choose=1; if(abs(ai_o1-200)==abs(ai_o2-200)) choose=rand()%2+1; } } } if(ai_s1 and not(ai_s2)) choose=1; if(not(ai_s1) and ai_s2) choose=2; else choose=rand()%2+1;11 行未改动 if(ai_b2<=0 or ai_b2>=100) ai_flag++,ai_ch2=2; if(ai_c2<=0 or ai_c2>=100) ai_flag++,ai_ch2=3; if(ai_d2<=0 or ai_d2>=100) ai_flag++,ai_ch2=4; if(ai_flag>1) ai_now2=0; if(ai_now1 and ai_now2) if(ai_now1 and ai_now2) { if(ai_max1>ai_max2) choose=2; if(ai_max1<ai_max2) choose=1; if(ai_max1==ai_max2)22 行未改动 else choose=rand()%2+1; } else choose=rand()%2+1; } //A.I.选择生效部分 if(choose==1){q2+=inversion(inver2,x[v].a1);w2+=inversion(inver2,x[v].a2);e2+=inversion(inver2,x[v].a3);r2+=inversion(inver2,x[v].a4);if(x[v].b!="") skill2=x[v].b;} //A.I.选择生效部分 if(choose==1){q2+=inversion(inver2,x[v].a1);w2+=inversion(inver2,x[v].a2);e2+=inversion(inver2,x[v].a3);r2+=inversion(inver2,x[v].a4);if(x[v].b!="") skill2=x[v].b;} if(choose==2){q2+=inversion(inver2,x[v].b1);w2+=inversion(inver2,x[v].b2);e2+=inversion(inver2,x[v].b3);r2+=inversion(inver2,x[v].b4);if(x[v].c!="") skill2=x[v].c;} if(choose==tb_i_choose) bctb++; else bctb=0; }64 行未改动struct Place{int bar,hotel,forest1,forest2,forest3,grass1,grass2,grass3;} place= {1,2,3,4,5,6,7,8};
int max_exp=0;int choose_number=0,s=0,strongman_arm=0,battle=0,money=500,place_sign=9;int cao=3,jijiubao=2,baiyao=2,superbaiyao=1,boom=3,dubiao=2,atom_boom=1;int fang=0,fang1=10,fang1n=0,fang2=20,fang2n=0,fang3=40,fang3n=0,fang4=100,fang4n=0,fang5=2500,fang5n=0,fang6=500,fang6n=0,fang7=3000,fang7n=0;int gong=0,gong1=8,gong1n=0,gong2=15,gong2n=0,gong3=25,gong3n=0,gong4=60,gong4n=0,gong5=300,gong5n=0,gong6=1500,gong6n=0,gong7=3000,gong7n=0;int st=0,bingshuanglongxue=0,longxia=0,pangxie=0,jingrou=0,yuchi=0;int jingyancao=0,jingyanbao=0,jingyanshi=0;char gongname[100]="无",fangname[100]="无";char proof;
void AddWupin(int);int AttackResult();void BattleAct();void ChooseWupin();2 行未改动int SuiJi();int SuiJi100();void WhetherLevelUp();void SlowDisplay(char *);
int main(){
int i=0,j=0,k=0;char player_name[21];Sleep(1000);printf("--------------------------欢迎来到 [苍穹世界] 3.1 测试版-----------------------\n\n\n");33 行未改动player.attack=99;player.defense=99;}getchar();
OrdinaryAct();return 0;}
int SuiJi(){srand((unsigned)time(NULL));return rand()%10;}
int SuiJi100(){srand((unsigned)time(NULL));return rand()%100;}
void ChooseWupin() //选择物品 并使用{printf("物品: 1,止血草%d个 2,急救包%d个 3,云南白药%d个 4,超级云南白药%d个 5,手雷%d个 6,毒标%d个 7,手抛式原子弹%d个 8,经验草%d个 9,经验包%d个 10,经验石%d个 11,巨人晶石%d个 0,返回\n\n\n",cao,jijiubao,baiyao,superbaiyao,boom,dubiao,atom_boom,jingyancao,jingyanbao,jingyanshi,strongman_arm);switch(scanf("%d",&choose_number),choose_number)79 行未改动break;case 8:if(jingyancao>0 && player.level<1000){
printf("使用经验草,等级增加10级\n\n\n");jingyancao--;player.level+=10;printf("等级:%d\n",player.level);16 行未改动printf("等级:%d\n",player.level);}else{
printf("使用经验包,等级增加2级\n\n\n");jingyanbao--;player.level+=2;printf("等级:%d\n",player.level);59 行未改动default:printf("ChooseWupin error!\n\n\n");}}
int AttackResult() //攻击结果:判断是否获胜 是否获得物品 和 是否升级{if(guai.health<=0){19 行未改动}else{int s=SuiJi();
if((guai.attack+s-player.defense/3)<0){player.health-=1;printf("%s反击,你的HP减少了 1\n\n",guai.name);16 行未改动return 0;}void AddWupin(int wupin_sign){
switch(wupin_sign){case 1:fang4n++;39 行未改动player.defense+=999;bingshuanglongxue+=3;}bingshuanglongxue++;} }if(wupin_sign==14)longxia++;if(wupin_sign==15)pangxie++;115 行未改动全部展开}}void OrdinaryAct() //正常行为菜单(移动,物品,对话,查看状态,装备,退出游戏){
while(1){// \(1000);// system("cls");101 行未改动全部展开}default:printf("对不起,我们只会打造以上武器。");break;
}break;case 2:int fang;14 行未改动{printf("钱不够!\n");printf("金币:%d\n",money);}
break;case 2:if(money>=500){25 行未改动}default:printf("对不起,我们只会打造以上防具。");break;
}printf("金币:%d\n",money);break;case 3:45 行未改动{printf("钱不够!\n\n\n");printf("金币:%d\n",money);}
break;}}break;112 行未改动全部展开{printf("装备数不够,无法出售!\n");break;}} }if(pai==7){printf("请问您要出售几件?\n");scanf("%d",&shu);74 行未改动printf("没有该装备,无法出售!\n");break;}}
break;case 5:int yewai;while(1)166 行未改动全部展开case 7:if(st==0){printf("击败使徒解锁通道\n\n");break; break;}puts("=============================================================================");printf("要去哪冒险呢?");printf("\n\n 1,极霜之地 危险程度:★★★★★\n\n 2,蛟龙之海 危险程度:★★★★★\n\n");printf("0,离开\n");puts("=============================================================================");int sy; int sy;scanf("%d",&sy);switch(sy){case 1:87 行未改动}}}break;
case 2:ChooseWupin();break; //显示道具,并可以使用.case 3: //对话选项144 行未改动全部展开{superbaiyao++;money=money-400;printf ("超级云南白药+1\n");
}else{printf("钱不够!\n");39 行未改动case 0:printf("金币:%d\n",money);printf("再见,欢迎下次再来!\n");break;
}if(mai==2){printf("药品商人:去去去,老子没时间陪你聊。\n");25 行未改动}else{printf("你离开了");} }break;case 6:printf("龙虾:%d个\n",longxia);printf("螃蟹:%d个\n",pangxie);9 行未改动printf("3.鱼翅刺身(+20攻击)\n");printf("4.鲸肉刺身(+20防御)\n");int y;scanf("%d",&y);if(y==1 && longxia>=1) if(y==1 && longxia>=1){printf("烹饪成功\n");longxia-=1;if(player.attack<=999)24 行未改动}else{printf("你离开了");} }}}else if(place_sign==place.hotel)printf("“老板娘!我...”\n\n\n“我忙着呢,没空理你~”\n\n\n");else printf("这里好像没人可以聊天\n\n\n");break;200 行未改动全部展开}}void printf(char *p){while(1) while(1){if(*p!=0)printf("%c",*p++);else100 行未改动 { if (A[i][j] == -1) { cout << "※";
} else { if (IfSafety(A, i, j))25 行未改动 P p = que.front(); que.pop(); if(!IfSafety(A, p.first, p.second)) continue; //如果周围有炸弹,继续遍历队列
for (int i = 0; i < 8; i++) { int nx = p.first + Sign[i][0]; int ny = p.second + Sign[i][1]; if (0 <= nx && nx < M && 0 <= ny && ny < N && Static[nx][ny] == 0) {10 行未改动 for (int j = 0; j < N; j++) cout << A[i][j]<<" "; cout << endl; }
}
int IfSafety(int A[M][N],int x, int y){27 行未改动 { //画x轴坐标 cout << " " << i + 1; }
for (int j = 0; j < M; j++) { //画Y轴坐标 gotoxy(38, 4+j);1,058 行未改动全部展开#include<ctime>#include<windows.h>using namespace std;int main(){ {int a=0,c,d=100,x=1,jb=100000000,n;long long tsy=100000000,czzd=100000000,fh=100000000;int b;cout<<" 请输入密码(密码是 !@#$%^&*.,njn200134udbudsudsbfy3843uerueijshnsjs2i9x)"<<endl;cin>>a;if(a==200134){ {cout<<" 游戏名:数字炸弹"<<endl;cout<<" 游戏规则:随机生成两个炸弹,一个炸玩家,可以被透视眼侦察到,中了这个炸弹你就输了,一个炸电脑,不可被透视眼侦察到,但中了这个炸弹你就赢了,具体操作会有显示"<<endl;cout<<" 输了也可以获得10金币"<<endl;cout<<" 每赢一局就获得50金币,金币可以买道具哦"<<endl;cout<<" 温馨提示:此游戏没有存档记录,关闭之后存档就会重置!"<<endl<<endl<<endl;for(;;){ {srand(time(0));c=rand()%100;cout<<" ----------------------*你需要做什么*-----------------------"<<endl;cout<<" |输入1进入游戏,输入2查看账号,输入3进入商店,输入4退出游戏|"<<endl;cout<<" -----------------------------------------------------------"<<endl;cin>>n;if(n==1){ {cout<<"数字炸弹开始!!!"<<endl;b=1;for(;;){ {cout<<x<<'~'<<d<<endl;cout<<"输入1输入数字,输入2使用道具"<<endl;cin>>n;if(n==1){ {cout<<"请输入"<<x<<'~'<<d<<"的数 "<<endl;cin>>b;}if(n==2){ {cout<<"您有透视眼"<<tsy<<endl;cout<<"您有重置炸弹"<<czzd<<endl;cout<<"您有时空机"<<fh<<endl;cout<<"输入1使用透视眼,输入2使用重置炸弹,输入0使用时空机,输入3退出"<<endl;cin>>n;if(n==1){ {if(tsy>0){ {cout<<"请输入要透视的数"<<endl;cin>>n;if(n==c){ {cout<<n<<"是炸弹"<<endl;tsy--;}elsecout<<n<<"不是炸弹"<<endl;tsy--;}else{ {cout<<"您没有透视眼"<<endl;}}if(n==2){ {if(czzd>0){ {srand(time(0));c=rand()%100;cout<<"炸弹已重置"<<endl;czzd--;x=1;d=100;}else{ {cout<<"您没有重置炸弹"<<endl;}}if(n==0){ {if(fh>0){ {srand(time(0));c=rand()%100;cout<<"时空穿梭!"<<endl;fh--;6 行未改动}}if(n==1)if(b==c){ {SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY |FOREGROUND_RED);cout<<"你炸了!!!"<<endl;jb+=10;break;}if(b<=x||b>=d){ {cout<<"请输入任意数字继续。"<<endl;cin>>b;}if(b<d&&b>c){ {d=b;cout<<"请继续输入"<<endl;}if(b>x&&b<c){ {x=b;cout<<"请继续输入"<<endl;}if(x+1==c&&d-1==c){ {cout<<"电脑炸了,你赢了!!! "<<endl;jb+=50;break;}}}if(n==2){ {cout<<"您现在有"<<jb<<"金币"<<endl;cout<<"您现在有"<<tsy<<"透视眼"<<endl;cout<<"您现在有"<<czzd<<"重置炸弹"<<endl;cout<<"您现在有"<<fh<<"时光机"<<endl;}if(n==3){ {cout<<" 商店"<<endl;cout<<" 您现在有"<<jb<<"金币 "<<endl; cout<<" 您现在有"<<jb<<"金币 "<<endl;cout<<" 输入1购买透视眼(100金币),输入2购买重置炸弹(150金币),输入0购买时空机(200金币),输入3退出"<<endl;cout<<" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~清仓大甩卖~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;cin>>n;if(n==1){ {if(jb>=100){ {tsy++;jb-=0;cout<<"您购买了1透视眼,您现在有"<<tsy<<"个透视眼";}elseSetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY |FOREGROUND_RED);cout<<"您没有足够的金币"<<endl;}if(n==2){ if(jb>=150) { {if(jb>=150){czzd++;jb-=0;cout<<"您购买了1重置炸弹,您现在有"<<czzd<<"个重置炸弹";}elseSetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY |FOREGROUND_RED);cout<<"您没有足够的金币"<<endl;}if(n==0){ {if(jb>=200){ {fh++;jb-=0;cout<<"您购买了1时光机,您现在有"<<fh<<"个时光机";}else2 行未改动cout<<"您没有足够的金币"<<endl;}}if(n==4){ {break;}cout<<"请问继续吗?(输入1继续,输入0退出)"<<endl;cin>>b;if(b==0){ {break;}d=100;x=1;}}else{ {SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY |FOREGROUND_RED);cout<<"密码错误";}42 行未改动