rpg渣游戏(原创)
此为一个C语言渣游戏的代码 勿喷 #include using namespace std; #include #include SYSTEMTIME time; class Game { public: Game ; BOOL choice ; 选择开始 BOOL zhandou ; 战斗 BOOL guaishang ; BOOL tiaozhanboss int ; BOOL zhandoucaidan ; BOOL qiut; BOOL shang ; int dengji; int m s f; int guanka; void kaishi ; 开始 void setjiaose ; 创建角色 void jiaoseshuxing ; 角色属性 void setjindutiao int ; 进度条 void shopping ; string guainame; "小哥布林"; string xiaoguainame[10]; string bsname; string bossname[10]; private: char ch1; char shop; char wq fj yp; char name[20]; 角色名字 int tili i j; int bosstili bosspower; int manbosstili yaohoutili yaopinshuliang; int power fangyu guaitili guaipower wuqipower wuqitili fangjutili fangjupower fangjufangyu; int bosspower1 bosstili1 bosspower2 bosstili2 bosspower3 bosstili3; int mantili gold jingyan manguaitili; string fangju; string wuqi; string y; string x; string yaopin; }; BOOL Game::zhandou { setjindutiao 50 ; cout<<" n n n n t t t"; cout<>ch1; setjindutiao 1 ; cout<<" n n n n t t t"; cout<>ch1; setjindutiao 1 ; cout<<" n n n n t t t"; cout<>ch1; setjindutiao 1 ; cout<<" n n n n t t t"; cout<>ch1; setjindutiao 50 ; cout<<" n n t t“进入战斗” n"; cout<>ch1; mantili tili; manguaitili guaitili; yaohoutili tili; while manguaitili>0 { setjindutiao 1 ; cout<<" n n n"; cout<>ch1; cout<>ch1; } return true; } Game::Game :qiut true wuqipower 0 wuqitili 0 fangjutili 0 fangjupower 0 fangjufangyu 0 { power 20;tili 40; dengji 0; fangyu 0; jingyan 0; gold 0; guanka 0; yaopinshuliang 0; guaipower 2;guaitili 20; bosspower1 30;bosstili1 500; bosspower2 60;bosstili2 120; bosspower3 100;bosstili3 3000; j 1; wuqi "空";fangju "空"; yaopin "空"; xiaoguainame[1] "血色勇士"; xiaoguainame[2] "血色预言者"; xiaoguainame[3] "血色狗男女"; bossname[1] "克尔苏加德"; bossname[2] "伊利丹"; bossname[3] "基尔加丹"; } int main { begin: Game game; game kaishi ; if game choice goto begin; char ch ch2; int M; while game qiut { game setjindutiao 50 ; cout<<" n n n t t t1 去闯关 n n t t t2 挑战剧情boss n n t t t3 人物属性和物品 n n t t t4 商店购物 n n t t t5 返回游戏目录 n请选择"; cin>>ch; switch ch { case "1": 闯关 if game dengji 0&&game guanka 0|| game dengji%5 0&&game dengji> 5 { game setjindutiao 50 ; game guanka+ 1; cout<<" n n n n t t t《第"<>ch; } if game guanka 1 { game guainame game xiaoguainame[1]; if game zhandou break; else game qiut false; goto begin; }else if game guanka 2 { game guainame game xiaoguainame[2]; if game zhandou break; else game qiut false; goto begin; }else if game guanka 3 { game guainame game xiaoguainame[3]; if game zhandou break; else game qiut false; goto begin; }else game guainame "小强"; if game zhandou break; else game qiut false; goto begin; case "2": game setjindutiao 1 ; for M 1;M<4;M++ { cout<<" n n n n t t t"; cout<>ch2; if "1" ch2 { if game dengji> 15 { cout<<"挑战"<>ch2; } }else if "2" ch2 { if game dengji> 25 { cout<<"挑战"<>ch2; } }else if "3" ch2 { if game dengji> 35 { cout<<"挑战"<>ch2; } } break; case "3": game jiaoseshuxing ; break; case "4": game shopping ; break; case "5": char q; cout<<"确定退出 Y N n"; cin>>q; if "y" q||"Y" q { game qiut false; goto begin; } else break; default: cout<<"貌似你没选对 n"; break; } } } void Game::kaishi { setjindutiao 50 ; cout<<" n t t欢迎进入 n n"<<" t t魔兽"<<"世界 n"; cout<<"开始游戏 n"; cout<<" t t t1 创建角色 n n t t t2 查看游戏介绍 n n t t t3 退出游戏 n请选择:"; cin>>x; } BOOL Game::choice { if "1" x { setjiaose ; } else if "2" x { setjindutiao 50 ; cout<<" n n<<游戏介绍和说明>>: n@@@@@@@@@@@@@本人完全是兴趣爱好 才学C++ 1个月多几天 第一次写这个 走了很多弯路 写这个是为了纪念我和你们高中短暂的时光 一年一下子就过去了 同学们 虽然我们在不同的班 但我永远都会将你们铭记希望你们都能考上好的大学 在这里也谢谢那些帮助过我的人和我的朋友 谢谢 让我们记住这个夏天吧 n n t t t t t陈昕源 n"; cin>>ch1; }else if "3" x { qiut false; }else{ cout<<" t 输入错误 n"; return false; } } void Game::setjiaose { setjindutiao 50 ; cout<<" n n n n n t t角色名称:"; cin>>name; cout<<"人物职业: 等待加入功能 n"; } void Game::jiaoseshuxing { setjindutiao 50 ; cout<<" n人物: "<>ch1; } void Game::setjindutiao int p { system "cls" ; GetLocalTime &time ; m time wSecond; s time wHour; f time wMinute; SetConsoleTitle "陈昕源制作" ; 标题 COORD pos; 定义一个位置变量 pos X 2; 注意X要大写 pos Y 1; 同上Y要大写 cout<<"╔═════════════════════╗"<> n n t t t2 <<防具店>> n n t t t3 <<药店>> n n t t t4 返回 n"; cin>>shop; if "3" shop { cout<<" <<药店>> n n"; cout<<"1: 50 两 t|小生命药水| t体力+50 n"; cout<<"2: 80 两 t|中效生命药水| t体力+80 n"; cout<<"3: 100两 t|高级生命药水| t体力+150 n"; cout<<"4: 200两 t|特效生命药水| t体力+250 n"; cout<<"5: 返回 n"; cout<<" t t t t t t金币:"<>yp; if "1" yp&&50< gold { if "|小生命药水|" yaopin {yaopinshuliang 0;} 如果已有药物不是这个 yaopin "|小生命药水|";gold 50; cout<<"购买成功 n你获得一个"<>ch1; goto begin1; } if "2" yp&&200< gold { if "|中效生命药水|" yaopin {yaopinshuliang 0;} 如果已有药物不是这个 yaopin "|中效生命药水|";gold 80; cout<<"购买成功 n你获得一个"<>ch1; goto begin1; } if "3" yp&&800< gold { if "|高级生命药水|" yaopin {yaopinshuliang 0;} yaopin "|高级生命药水|";gold 100; cout<<"购买成功 n你获得一个"<>ch1; goto begin1; } if "4" yp&&1500< gold { if "|特效生命药水|" yaopin {yaopinshuliang 0;} yaopin "|特效生命药水|";gold 200; cout<<"购买成功 n你获得一个"<>ch1; goto begin1; }if "5" yp goto begin1; else cout<<" n 输入错误 或你的金币不够 请确定你是否有足够的金币 n"; cin>>ch1; }else if "1" shop { cout<<" <<武器店>> n n"; cout<<"1: 50 两 t|辛洛斯 诸界的毁灭者| t t攻击+10 t体力+5 n"; cout<<"2: 200 两 t|上古其拉撕裂者| t t攻击+30 t体力+15 n"; cout<<"3: 800 两 t|萨弗拉斯 炎魔拉格纳罗斯之手| t攻击+50 t体力+25 n"; cout<<"4: 1500两 t|雷霆之怒 逐风者的祝福之剑| t攻击+100体力+50 n"; cout<<"5: 返回 n"; cout<<" t t t t t t金币:"<>wq; if "1" wq&&50< gold { power power wuqipower; tili tili wuqitili; cout<<"购买成功 n你获得一把|辛洛斯 诸界的毁灭者| n"; wuqi "|辛洛斯 诸界的毁灭者|"; wuqipower 10; wuqitili 5; power power+wuqipower; tili tili+wuqitili; gold gold 50; cin>>ch1; goto begin1; }else if "2" wq&&200< gold { power power wuqipower; tili tili wuqitili; cout<<"购买成功 n你获得一把|上古其拉撕裂者| n"; wuqi "|上古其拉撕裂者|"; wuqipower 30; wuqitili 15; power power+wuqipower; tili tili+wuqitili; gold gold 200; cin>>ch1; goto begin1; }else if "3" wq&&800< gold { power power wuqipower; tili tili wuqitili; cout<<"购买成功 n你获得一把|萨弗拉斯 炎魔拉格纳罗斯之手| n"; wuqi "|萨弗拉斯 炎魔拉格纳罗斯之手|"; wuqipower 50; wuqitili 25; power power+wuqipower; tili tili+wuqitili; gold gold 800; cin>>ch1; goto begin1; }else if "4" wq&&1500< gold { power power wuqipower; tili tili wuqitili; cout<<"购买成功 n你获得一把|雷霆之怒 逐风者的祝福之剑| n"; wuqi "|雷霆之怒 逐风者的祝福之剑|"; wuqipower 100; wuqitili 50; power power+wuqipower; tili tili+wuqitili; gold gold 1500; cin>>ch1; goto begin1; }else if "5" wq goto begin1; else cout<<" n 输入错误 或你的金币不够 请确定你是否有足够的金币 n"; cin>>ch1; }else if "2" shop { cout<<" <<防具店>> n n"; cout<<"1: 50两 t t|T1| t体力+10 t防御+25 n"; cout<<"2: 200两 t|T2| t体力+15 t防御+35 n"; cout<<"3: 800两 t|T3| t体力+20 t防御+75 n"; cout<<"4: 1500两 t|T4| t体力+40 t防御+100 n"; cout<<"5: 返回 n"; cout<<" t t t t t t金币:"<>fj; if "1" fj&&50< gold { fangyu fangyu fangjufangyu; tili tili fangjutili; cout<<"购买成功 n你获得一件|T1| n"; fangju "|T1|"; fangjutili 10; fangjufangyu 25; fangyu fangyu+fangjufangyu; tili tili+fangjutili; gold gold 50; cin>>ch1; goto begin1; }else if "2" fj&&200< gold { fangyu fangyu fangjufangyu; tili tili fangjutili; cout<<"购买成功 n你获得一件|T2| n"; fangju "|T2|"; fangjutili 15; fangjufangyu 35; fangyu fangyu+fangjufangyu; tili tili+fangjutili; gold gold 200; cin>>ch1; goto begin1; }else if "3" fj&&800< gold { fangyu fangyu fangjufangyu; tili tili fangjutili; cout<<"购买成功 n你获得一件|T3| n"; fangju "|T3|"; fangjutili 20; fangjufangyu 75; fangyu fangyu+fangjufangyu; tili tili+fangjutili; gold gold 800; cin>>ch1; goto begin1; }else if "4" fj&&1500< gold { fangyu fangyu fangjufangyu; tili tili fangjutili; cout<<"购买成功 n你获得一件|T4| n"; fangju "|T4|"; fangjutili 40; fangjufangyu 100; fangyu fangyu+fangjufangyu; tili tili+fangjutili; gold gold 1500; cin>>ch1; goto begin1; }else if "5" fj goto begin1; else { cout<<" n 输入错误 或你的金币不够 请确定你是否有足够的金币 n"; cin>>ch1; } } } BOOL Game::shang { if mantili> 20 cout< 10 cout< 5 cout< 1 cout<>y; if "yes" y&&gold> 100 { setjindutiao 1 ; cout<<" n n n n t t t"; cout<<"使用春哥副魔卡成功 t"< 40 j { j++; setjindutiao 1 ; cout<<" n n n n t t t"; cout<<"恭喜你 n t t t 成功升级 n t t t体力+10 攻击+5 防御+4 n"; dengji+ 1; tili tili+10;power+ 5;fangyu+ 4; return false; } } return true; } BOOL Game::zhandoucaidan { char ch2; cout<<" n t t1 攻击 2 喝药 3 逃跑 n请选择:"; cin>>ch2; if "2" ch2 吃药 { if 1< yaopinshuliang { cout<<" n"<>ch1; setjindutiao 1 ; cout<<" n n n n生命本身毫无意义 只有死亡 才能让你了解人性的真谛 n"; cin>>ch1; if 2 x { manbosstili bosstili1;bosspower bosspower1; setjindutiao 1 ; cout<<" n n n n t t t"; cout<<" n n n n我被囚禁了一万 现在你竟敢闯入我的领地 n t t简直是自寻死路 n n n"; cin>>ch1; setjindutiao 1 ; cout<<" n n n n"; cout<<" n t t"<>ch1; setjindutiao 1 ; cout<<" n n n n"; cout<>ch1; } if 1 x { manbosstili bosstili2;bosspower bosspower2; setjindutiao 1 ; cout<<" n n n n t t t"; cout<<" n n n n就是他 天灾瘟疫才会散播在洛丹伦的土地上;就是他 人类濒临灭族的危险;就是他 阿尔萨斯才会堕落 n n n"; cin>>ch1; setjindutiao 1 ; cout<<" n n n nWho dares violate the sanctity of my domain Be warned all who trespass here are doomed"; cout<<" n谁敢入侵我的神圣领域 我警告你们:曾有许多蠢货入侵这里 他们都已经死啦 n"; cin>>ch1; setjindutiao 1 ; cout<<" n n n n"; cout<<" t t"<>ch1; setjindutiao 1 ; cout<<" n n n nYou have no idea what horrors lie ahead You have seen nothing The frozen heart of Naxxramas awaits you "; cout<<" n看来你们还不知道自己将面临怎样的恐怖 看来你们还一无所知 纳克萨玛斯的霜寒之心 正等待着你们 n"; 1 ;cin>>ch1; } if 3 x { manbosstili bosstili3;bosspower bosspower3; setjindutiao 1 ; cout<<" n n n n集中注意力 不要浪费时间 抽光她 直到剩下一具空空的躯壳为止 n"; cin>>ch1; setjindutiao 1 ; cout<<" n n n nThe expandable have perished so be it Now I shall succeed where Sargeras could not I will bleed this wretched world and secure my place as the true master of the Burning Legion The end has come Let the unraveling of this world commence"; cout<<" n这个消耗品已经没用了 不管它了 我现在已经做到了连萨格拉斯都没有做到的事情 我要彻底毁灭这个世界 真正成为燃烧军团的主宰者 末日已经到来啦 让这个世界就此支离破碎吧 n"; cin>>ch1; setjindutiao 1 ; cout<<" n n n n"; cout<>ch1; setjindutiao 1 ; cout<<" n n n n安薇娜说:我现在只效忠于主人 n"; cin>>ch1; setjindutiao 1 ; cout<<" n n n n The nightmare is over The spell is broken Good bye Kalec my love n"; cout<<"安薇娜说(安薇娜牺牲 ):噩梦结束了 法术被破除了 再见 亲爱的"<>ch1; setjindutiao 1 ; cout<<" n n n n"<>ch1; } setjindutiao 50 ; cout<<" n n t t“进入战斗” n"; cout<0 { cout<>ch1; setjindutiao 1 ; cout<<" n n n n"; cout<>ch1; cout<>ch1; setjindutiao 1 ; cout<<" n n n n t t t"; cout<<"恭喜你 n t t t 成功升级 n t t t体力+10 攻击+5 防御+4 n"; dengji+ 1; tili tili+10;power+ 5;fangyu+ 4; return true; } cout<>ch1; } return true ; }">此为一个C语言渣游戏的代码 勿喷 #include using namespace std; #include #include SYSTEMTIME time; class Game { public: Game ; BOOL choice ; 选择开始 BOOL zhandou ; 战斗 BOOL guaishang ; BOOL tiaozh [更多] void shopping ; string guainame; "小哥布林"; string xiaoguainame[10]; string bsname; string bossname[10]; private: char ch1; char shop; char wq fj yp; char name[20]; 角色名字 int tili i j; int bosstili bosspower; int manbosstili yaohoutili yaopinshuliang; int power fangyu guaitili guaipower wuqipower wuqitili fangjutili fangjupower fangjufangyu; int bosspower1 bosstili1 bosspower2 bosstili2 bosspower3 bosstili3; int mantili gold jingyan manguaitili; string fangju; string wuqi; string y; string x; string yaopin; }; BOOL Game::zhandou { setjindutiao 50 ; cout<<" n n n n t t t"; cout<>ch1; setjindutiao 1 ; cout<<" n n n n t t t"; cout<>ch1; setjindutiao 1 ; cout<<" n n n n t t t"; cout<>ch1; setjindutiao 1 ; cout<<" n n n n t t t"; cout<>ch1; setjindutiao 50 ; cout<<" n n t t“进入战斗” n"; cout<>ch1; mantili tili; manguaitili guaitili; yaohoutili tili; while manguaitili>0 { setjindutiao 1 ; cout<<" n n n"; cout<>ch1; cout<>ch1; } return true; } Game::Game :qiut true wuqipower 0 wuqitili 0 fangjutili 0 fangjupower 0 fangjufangyu 0 { power 20;tili 40; dengji 0; fangyu 0; jingyan 0; gold 0; guanka 0; yaopinshuliang 0; guaipower 2;guaitili 20; bosspower1 30;bosstili1 500; bosspower2 60;bosstili2 120; bosspower3 100;bosstili3 3000; j 1; wuqi "空";fangju "空"; yaopin "空"; xiaoguainame[1] "血色勇士"; xiaoguainame[2] "血色预言者"; xiaoguainame[3] "血色狗男女"; bossname[1] "克尔苏加德"; bossname[2] "伊利丹"; bossname[3] "基尔加丹"; } int main { begin: Game game; game kaishi ; if game choice goto begin; char ch ch2; int M; while game qiut { game setjindutiao 50 ; cout<<" n n n t t t1 去闯关 n n t t t2 挑战剧情boss n n t t t3 人物属性和物品 n n t t t4 商店购物 n n t t t5 返回游戏目录 n请选择"; cin>>ch; switch ch { case "1": 闯关 if game dengji 0&&game guanka 0|| game dengji%5 0&&game dengji> 5 { game setjindutiao 50 ; game guanka+ 1; cout<<" n n n n t t t《第"<>ch; } if game guanka 1 { game guainame game xiaoguainame[1]; if game zhandou break; else game qiut false; goto begin; }else if game guanka 2 { game guainame game xiaoguainame[2]; if game zhandou break; else game qiut false; goto begin; }else if game guanka 3 { game guainame game xiaoguainame[3]; if game zhandou break; else game qiut false; goto begin; }else game guainame "小强"; if game zhandou break; else game qiut false; goto begin; case "2": game setjindutiao 1 ; for M 1;M<4;M++ { cout<<" n n n n t t t"; cout<>ch2; if "1" ch2 { if game dengji> 15 { cout<<"挑战"<>ch2; } }else if "2" ch2 { if game dengji> 25 { cout<<"挑战"<>ch2; } }else if "3" ch2 { if game dengji> 35 { cout<<"挑战"<>ch2; } } break; case "3": game jiaoseshuxing ; break; case "4": game shopping ; break; case "5": char q; cout<<"确定退出 Y N n"; cin>>q; if "y" q||"Y" q { game qiut false; goto begin; } else break; default: cout<<"貌似你没选对 n"; break; } } } void Game::kaishi { setjindutiao 50 ; cout<<" n t t欢迎进入 n n"<<" t t魔兽"<<"世界 n"; cout<<"开始游戏 n"; cout<<" t t t1 创建角色 n n t t t2 查看游戏介绍 n n t t t3 退出游戏 n请选择:"; cin>>x; } BOOL Game::choice { if "1" x { setjiaose ; } else if "2" x { setjindutiao 50 ; cout<<" n n<<游戏介绍和说明>>: n@@@@@@@@@@@@@本人完全是兴趣爱好 才学C++ 1个月多几天 第一次写这个 走了很多弯路 写这个是为了纪念我和你们高中短暂的时光 一年一下子就过去了 同学们 虽然我们在不同的班 但我永远都会将你们铭记希望你们都能考上好的大学 在这里也谢谢那些帮助过我的人和我的朋友 谢谢 让我们记住这个夏天吧 n n t t t t t陈昕源 n"; cin>>ch1; }else if "3" x { qiut false; }else{ cout<<" t 输入错误 n"; return false; } } void Game::setjiaose { setjindutiao 50 ; cout<<" n n n n n t t角色名称:"; cin>>name; cout<<"人物职业: 等待加入功能 n"; } void Game::jiaoseshuxing { setjindutiao 50 ; cout<<" n人物: "<>ch1; } void Game::setjindutiao int p { system "cls" ; GetLocalTime &time ; m time wSecond; s time wHour; f time wMinute; SetConsoleTitle "陈昕源制作" ; 标题 COORD pos; 定义一个位置变量 pos X 2; 注意X要大写 pos Y 1; 同上Y要大写 cout<<"╔═════════════════════╗"<> n n t t t2 <<防具店>> n n t t t3 <<药店>> n n t t t4 返回 n"; cin>>shop; if "3" shop { cout<<" <<药店>> n n"; cout<<"1: 50 两 t|小生命药水| t体力+50 n"; cout<<"2: 80 两 t|中效生命药水| t体力+80 n"; cout<<"3: 100两 t|高级生命药水| t体力+150 n"; cout<<"4: 200两 t|特效生命药水| t体力+250 n"; cout<<"5: 返回 n"; cout<<" t t t t t t金币:"<>yp; if "1" yp&&50< gold { if "|小生命药水|" yaopin {yaopinshuliang 0;} 如果已有药物不是这个 yaopin "|小生命药水|";gold 50; cout<<"购买成功 n你获得一个"<>ch1; goto begin1; } if "2" yp&&200< gold { if "|中效生命药水|" yaopin {yaopinshuliang 0;} 如果已有药物不是这个 yaopin "|中效生命药水|";gold 80; cout<<"购买成功 n你获得一个"<>ch1; goto begin1; } if "3" yp&&800< gold { if "|高级生命药水|" yaopin {yaopinshuliang 0;} yaopin "|高级生命药水|";gold 100; cout<<"购买成功 n你获得一个"<>ch1; goto begin1; } if "4" yp&&1500< gold { if "|特效生命药水|" yaopin {yaopinshuliang 0;} yaopin "|特效生命药水|";gold 200; cout<<"购买成功 n你获得一个"<>ch1; goto begin1; }if "5" yp goto begin1; else cout<<" n 输入错误 或你的金币不够 请确定你是否有足够的金币 n"; cin>>ch1; }else if "1" shop { cout<<" <<武器店>> n n"; cout<<"1: 50 两 t|辛洛斯 诸界的毁灭者| t t攻击+10 t体力+5 n"; cout<<"2: 200 两 t|上古其拉撕裂者| t t攻击+30 t体力+15 n"; cout<<"3: 800 两 t|萨弗拉斯 炎魔拉格纳罗斯之手| t攻击+50 t体力+25 n"; cout<<"4: 1500两 t|雷霆之怒 逐风者的祝福之剑| t攻击+100体力+50 n"; cout<<"5: 返回 n"; cout<<" t t t t t t金币:"<>wq; if "1" wq&&50< gold { power power wuqipower; tili tili wuqitili; cout<<"购买成功 n你获得一把|辛洛斯 诸界的毁灭者| n"; wuqi "|辛洛斯 诸界的毁灭者|"; wuqipower 10; wuqitili 5; power power+wuqipower; tili tili+wuqitili; gold gold 50; cin>>ch1; goto begin1; }else if "2" wq&&200< gold { power power wuqipower; tili tili wuqitili; cout<<"购买成功 n你获得一把|上古其拉撕裂者| n"; wuqi "|上古其拉撕裂者|"; wuqipower 30; wuqitili 15; power power+wuqipower; tili tili+wuqitili; gold gold 200; cin>>ch1; goto begin1; }else if "3" wq&&800< gold { power power wuqipower; tili tili wuqitili; cout<<"购买成功 n你获得一把|萨弗拉斯 炎魔拉格纳罗斯之手| n"; wuqi "|萨弗拉斯 炎魔拉格纳罗斯之手|"; wuqipower 50; wuqitili 25; power power+wuqipower; tili tili+wuqitili; gold gold 800; cin>>ch1; goto begin1; }else if "4" wq&&1500< gold { power power wuqipower; tili tili wuqitili; cout<<"购买成功 n你获得一把|雷霆之怒 逐风者的祝福之剑| n"; wuqi "|雷霆之怒 逐风者的祝福之剑|"; wuqipower 100; wuqitili 50; power power+wuqipower; tili tili+wuqitili; gold gold 1500; cin>>ch1; goto begin1; }else if "5" wq goto begin1; else cout<<" n 输入错误 或你的金币不够 请确定你是否有足够的金币 n"; cin>>ch1; }else if "2" shop { cout<<" <<防具店>> n n"; cout<<"1: 50两 t t|T1| t体力+10 t防御+25 n"; cout<<"2: 200两 t|T2| t体力+15 t防御+35 n"; cout<<"3: 800两 t|T3| t体力+20 t防御+75 n"; cout<<"4: 1500两 t|T4| t体力+40 t防御+100 n"; cout<<"5: 返回 n"; cout<<" t t t t t t金币:"<>fj; if "1" fj&&50< gold { fangyu fangyu fangjufangyu; tili tili fangjutili; cout<<"购买成功 n你获得一件|T1| n"; fangju "|T1|"; fangjutili 10; fangjufangyu 25; fangyu fangyu+fangjufangyu; tili tili+fangjutili; gold gold 50; cin>>ch1; goto begin1; }else if "2" fj&&200< gold { fangyu fangyu fangjufangyu; tili tili fangjutili; cout<<"购买成功 n你获得一件|T2| n"; fangju "|T2|"; fangjutili 15; fangjufangyu 35; fangyu fangyu+fangjufangyu; tili tili+fangjutili; gold gold 200; cin>>ch1; goto begin1; }else if "3" fj&&800< gold { fangyu fangyu fangjufangyu; tili tili fangjutili; cout<<"购买成功 n你获得一件|T3| n"; fangju "|T3|"; fangjutili 20; fangjufangyu 75; fangyu fangyu+fangjufangyu; tili tili+fangjutili; gold gold 800; cin>>ch1; goto begin1; }else if "4" fj&&1500< gold { fangyu fangyu fangjufangyu; tili tili fangjutili; cout<<"购买成功 n你获得一件|T4| n"; fangju "|T4|"; fangjutili 40; fangjufangyu 100; fangyu fangyu+fangjufangyu; tili tili+fangjutili; gold gold 1500; cin>>ch1; goto begin1; }else if "5" fj goto begin1; else { cout<<" n 输入错误 或你的金币不够 请确定你是否有足够的金币 n"; cin>>ch1; } } } BOOL Game::shang { if mantili> 20 cout< 10 cout< 5 cout< 1 cout<>y; if "yes" y&&gold> 100 { setjindutiao 1 ; cout<<" n n n n t t t"; cout<<"使用春哥副魔卡成功 t"< 40 j { j++; setjindutiao 1 ; cout<<" n n n n t t t"; cout<<"恭喜你 n t t t 成功升级 n t t t体力+10 攻击+5 防御+4 n"; dengji+ 1; tili tili+10;power+ 5;fangyu+ 4; return false; } } return true; } BOOL Game::zhandoucaidan { char ch2; cout<<" n t t1 攻击 2 喝药 3 逃跑 n请选择:"; cin>>ch2; if "2" ch2 吃药 { if 1< yaopinshuliang { cout<<" n"<>ch1; setjindutiao 1 ; cout<<" n n n n生命本身毫无意义 只有死亡 才能让你了解人性的真谛 n"; cin>>ch1; if 2 x { manbosstili bosstili1;bosspower bosspower1; setjindutiao 1 ; cout<<" n n n n t t t"; cout<<" n n n n我被囚禁了一万 现在你竟敢闯入我的领地 n t t简直是自寻死路 n n n"; cin>>ch1; setjindutiao 1 ; cout<<" n n n n"; cout<<" n t t"<>ch1; setjindutiao 1 ; cout<<" n n n n"; cout<>ch1; } if 1 x { manbosstili bosstili2;bosspower bosspower2; setjindutiao 1 ; cout<<" n n n n t t t"; cout<<" n n n n就是他 天灾瘟疫才会散播在洛丹伦的土地上;就是他 人类濒临灭族的危险;就是他 阿尔萨斯才会堕落 n n n"; cin>>ch1; setjindutiao 1 ; cout<<" n n n nWho dares violate the sanctity of my domain Be warned all who trespass here are doomed"; cout<<" n谁敢入侵我的神圣领域 我警告你们:曾有许多蠢货入侵这里 他们都已经死啦 n"; cin>>ch1; setjindutiao 1 ; cout<<" n n n n"; cout<<" t t"<>ch1; setjindutiao 1 ; cout<<" n n n nYou have no idea what horrors lie ahead You have seen nothing The frozen heart of Naxxramas awaits you "; cout<<" n看来你们还不知道自己将面临怎样的恐怖 看来你们还一无所知 纳克萨玛斯的霜寒之心 正等待着你们 n"; 1 ;cin>>ch1; } if 3 x { manbosstili bosstili3;bosspower bosspower3; setjindutiao 1 ; cout<<" n n n n集中注意力 不要浪费时间 抽光她 直到剩下一具空空的躯壳为止 n"; cin>>ch1; setjindutiao 1 ; cout<<" n n n nThe expandable have perished so be it Now I shall succeed where Sargeras could not I will bleed this wretched world and secure my place as the true master of the Burning Legion The end has come Let the unraveling of this world commence"; cout<<" n这个消耗品已经没用了 不管它了 我现在已经做到了连萨格拉斯都没有做到的事情 我要彻底毁灭这个世界 真正成为燃烧军团的主宰者 末日已经到来啦 让这个世界就此支离破碎吧 n"; cin>>ch1; setjindutiao 1 ; cout<<" n n n n"; cout<>ch1; setjindutiao 1 ; cout<<" n n n n安薇娜说:我现在只效忠于主人 n"; cin>>ch1; setjindutiao 1 ; cout<<" n n n n The nightmare is over The spell is broken Good bye Kalec my love n"; cout<<"安薇娜说(安薇娜牺牲 ):噩梦结束了 法术被破除了 再见 亲爱的"<>ch1; setjindutiao 1 ; cout<<" n n n n"<>ch1; } setjindutiao 50 ; cout<<" n n t t“进入战斗” n"; cout<0 { cout<>ch1; setjindutiao 1 ; cout<<" n n n n"; cout<>ch1; cout<>ch1; setjindutiao 1 ; cout<<" n n n n t t t"; cout<<"恭喜你 n t t t 成功升级 n t t t体力+10 攻击+5 防御+4 n"; dengji+ 1; tili tili+10;power+ 5;fangyu+ 4; return true; } cout<>ch1; } return true ; }">此为一个C语言渣游戏的代码 勿喷 #include using namespace std; #include #include SYSTEMTIME time; class Game { public: Game ; BOOL choice ; 选择开始 BOOL zhandou ; 战斗 BOOL guaishang ; BOOL tiaozh [更多]
暂无评论