[C++] 小游戲 決戰蒼穹

大家好,各位看到這個標題,斗破蒼穹什么時候改叫決戰蒼穹了?其實,因為版權等一系列問題,斗破蒼穹正式改名為決戰蒼穹,這個版本主要更新內容為解決了皇冠競技場太過影響游戲平衡,并且提高了一些裝備的基礎數值

先贊后看,養成習慣

CODE:

#include<stdio.h>
#include<iostream>
#include<ctime>
#include<bits/stdc++.h>
#include<conio.h>
#include<time.h>
#include<cmath>
#include<windows.h> //SLEEP函數
using namespace std;
int shen=0;
int ui=0;
int sheng=1;
void SetColorAndBackground(int ForgC, int BackC) {WORD wColor = ((BackC & 0x0F) << 4) + (ForgC & 0x0F);SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), wColor);
}
void Bling() {for(int i=0; i<=5; i++) {system("color 1A");Sleep(20);if(sheng==1) if(sheng==1) Beep(1200,50);system("color 2B");Sleep(20);system("color 3C");Sleep(20);system("color 4D");Sleep(20);if(sheng==1) Beep(1200,50);system("color 5D");Sleep(20);system("color 6E");Sleep(20);system("color 7F");Sleep(20);if(sheng==1) Beep(1200,50);}
}
void Start() {if(sheng==1) Beep(3200,50);system("color 8E");cout<<" \n";cout<<"                ■                      ■                 \n";Sleep(50);cout<<"    ■          ■              ■       ■                \n";Sleep(50);cout<<"      ■    ■■■■■          ■■■   ■   ■■         \n";Sleep(50);cout<<"               ■   ■          ■    ■■■■             \n";Sleep(50);cout<<"       ■ ■■■■■■■      ■■■     ■    ■          \n";Sleep(50);cout<<"      ■       ■             ■  ■      ■ ■            \n";Sleep(50);cout<<"     ■     ■    ■          ■  ■     ■■              \n";Sleep(50);cout<<"    ■    ■        ■■      ■■■        ■ ■          \n";Sleep(50);cout<<"                                             ■            \n";Sleep(50);cout<<" 歡迎來到 [決戰蒼穹]   ■      ■                          \n";Sleep(50);cout<<"                    ▆▆▆▆▆▆▆▆            ■         \n";Sleep(50);cout<<"  學生小羊出品      ■      ■        ▆▆▆▆▆▆▆▆▆\n";Sleep(50);cout<<"                           ▆          ▆               ▆\n";Sleep(50);cout<<"  2.12.3 正式版        ▆■  ■▆        ■           ■  \n";Sleep(50);cout<<"                     ▆  ▆▆▆  ▆     ■ ▆▆▆▆▆  ■ \n";Sleep(50);cout<<" 新增 皇冠競技場         ■  ■                     ■    \n";Sleep(50);cout<<"                         ■■■            ▆▆▆▆▆     \n";Sleep(50);cout<<" 學生小羊出品,必屬精品       ■    ■          ■             \n";Sleep(50);cout<<"                          ▆▆▆           ▆▆▆▆▆     \n";Sleep(50);cout<<" 努力通關吧!                                       ■    \n";Sleep(50);cout<<"                                                ▆  ■    \n";Sleep(50);cout<<" 輸入“1 ”下一頁        zty出品                  ■      \n\n";Sleep(50);
A:char y=_getch();if(y=='1') return;else goto A;
}
void Start2() {system("color 8E");system("cls");if(sheng==1) Beep(3200,50);cout<<"                                                \n";Sleep(50);cout<<"        ■ ■■■        ■■■  ■      ■     \n";Sleep(50);cout<<"    ■■      ■       ■   ■  ■       ■     \n";Sleep(50);cout<<"            ■      ■     ■   ■       ■     \n";Sleep(50);cout<<"           ■   ■■      ■    ■       ■     \n";Sleep(50);cout<<"         ■  ■            ■  ■ ■     ■     \n";Sleep(50);cout<<"       ■■■               ■■    ■■■      \n";Sleep(50);cout<<"                                         ■     \n";Sleep(50);cout<<"                                 ■      ■     \n";Sleep(50);cout<<" 歡迎來到 [決戰蒼穹]               ■    ■     \n";Sleep(50);cout<<"                                     ■■       \n";Sleep(50);cout<<"  學生小羊出品        ■                     \n";Sleep(50);cout<<"                     ■  ■  ■     ■■■■    \n";Sleep(50);cout<<"  2.12.3 正式版      ■■■■■     ■    ■    \n";Sleep(50);cout<<"                         ■         ■■■■    \n";Sleep(50);cout<<" 新增 皇冠競技場     ■  ■  ■                 \n";Sleep(50);cout<<"                     ■■■■■  ■■■  ■■■ \n";Sleep(50);cout<<" 學生小羊出品,必屬精品               ■  ■  ■  ■ \n";Sleep(50);cout<<"                                 ■■■  ■■■ \n";Sleep(50);cout<<" 努力通關吧!                                   \n";Sleep(50);cout<<"                                                \n";Sleep(50);cout<<" 輸入“1 ”開始游戲                    \n\n";Sleep(50);
A:char y=_getch();if(y=='1') return;else goto A;
}
int boss1=0,boss2=0;
struct Player { //玩家結構體,并初始化playerchar name[21];int attack;int defense;int health;long int max_health;int level;int exp;int range_exp;long int max_exp;
} player= {"勇者",100,80,200,200,1,0,0,100};
struct Diren {//競技場敵人的結構體
//	char wupin1[20];
//	char wupin2[20];int attack;int defense;int health;int money;int level;long int exp;
} diren= {100,80,200,0,0,0};
struct Enemy {//怪的結構體,并初始化各種怪char name[20];char wupin[20];int attack;int defense;int health;int money;long int exp;int wupin_sign;int wupinpro;int double_attack;int miss;
}
//怪,拿格倫石人舉例
// 怪變量  怪名     掉落的裝備 攻   防  血  金幣 經驗 掉落裝備編號 掉落概率 真傷(被防御后的破甲傷害)   不能改
//  gl= {"格倫石人","石鎧甲",  30, 150,1000,500, 250,      11,       7,        1,                         0},
gl= {"格倫石人","石鎧甲",30,150,1000,500,250,11,65,1,0},
zhizhu= {"洞穴蜘蛛","蜘蛛毒劍",140,20,250,400,200,12,55,1,0},
ymr= {"野蠻人","粗制石劍",20,20,150,100,50,13,55,1,0},
nz= {"牛仔","戰斗馬甲",80,20,250,500,250,14,85,1,0},
strongman= {"森林巨人","傳說圣甲",50,50,580,200,100,1,55,1,0},
witch= {"獸人","重甲",35,55,250,50,50,2,45,1,1},
xiyi= {"毒蜴","鱗片",20,25,80,30,35,3,75,2,2},
huolong= {"噴火龍","巨龍晶石",200,250,1000,1000,500,4,45,2,0},
shibing= {"皇家士兵","尚方寶劍",100,30,380,200,100,5,45,1,0},
horse= {"獨眼巨人","碧血戰錘",50,22,360,50,50,6,55,1,1},
bee= {"劍客","西洋劍",27,11,60,30,35,7,50,2,2},
bossno1= {"凋零女巫","\0",1400,500,15000,10000,5000,15,10,1,0},
dljs= {"凋零巨獸","凋零之心",1200,700,20000,10000,500,10,75,1,0},
pika= {"皮卡超人","\0",300,40*8,1000,2000,1000,0,0,1,0},
dapika= {"雷霆皮卡","雷霆之刃",350,40*10,1500,3000,2000,8,65,6,0},
cl= {"熔巖飛龍","\0",450,50*10,2000,3500,2500,0,0,1,0},
jl= {"裂凱金龍","龍鱗",500,40*20,5000,8000,4500,9,65,6,1},
gst= {"凋零共生體","命令之書",1800,65*10,15000,20000,1000,16,95,1,0},
dlkl= {"凋零骷髏","凋零之骨",3000,30*10,12000,20000,1000,0,0,1,0},
dlfb= {".+*凋零風暴*+.","\0",9000,1500,49000,500000,500000,17,10,1,0},
guai= {"\0","\0",0,0,0,0,0,0,0,0,0};
struct Place {int bar,hotel,forest1,forest2,forest3,grass1,grass2,grass3,te1,te2,te3,te4;
} place= {1,2,3,4,5,6,7,8,9,10,11,12};
int max_exp=0;
int htsr;
int lun=0;
int he=0;
int choose_number=0,s=0,strongman_arm=0,battle=0,money=500,place_sign=10;
int cao=3,jijiubao=3,baiyao=3,superbaiyao=3,miansi=1,boom=3,dubiao=2,yuanzidan=1;
int fang=0,fang1=10,fang1n=0,fang2=120,fang2n=0,fang3=40,fang3n=0,fang4=300,fang4n=0,fang5=1200,fang5n=0,fang6=250,fang6n=0,fang7=60,fang7n=0,fang4X=1500,fang4Xn=0,mfang=1800,mfangn=0;
int gong=0,gong1=10,gong1n=0,gong2=20,gong2n=0,gong3=45,gong3n=0,gong4=200,gong4n=0,gong5=625,gong5n=0,gong6=250,gong6n=0,gong7=45,gong7n=0,gong4X=850,gong4Xn=0,mgong=1250,mgongn=0;
int jingyancao=0,jingyanbao=0,jingyanshi=0,htmmcs=5;
int diaolingxinhave=0,diaolingxin=0,mingshu=0,zhadan=0;
char gongname[20]="無",fangname[20]="無";
char proof;
int lp=0,ll=0;
void AddWupin(int);
int AttackResult();
void BattleAct();  //      ____
void ChooseWupin();  //   /___/|
void DisplayState();  //  |   |/
void yidongcaidan();     //▔▔
int SuiJi();
int SuiJi100();
void jingjishengji();
int jingjipanduan();
void jingjicaidan();
void WhetherLevelUp();
void SlowDisplay(char *);
int main() {if(sheng==1) Beep(1200,100);MessageBox(NULL, "歡迎來到決戰蒼穹 2.12.3 正式版 !", "決戰蒼穹 游戲開始提示", MB_OK);int i=0,j=0,k=0;Start();Bling();Start2();Bling();int kaishi;char player_name[21];
//Sleep(100);system("color A3");
//Sleep(50);system("color E4");
//Sleep(50);system("color B3");
//Sleep(50);system("color E4");
//Sleep(50);system("color 34");
//Sleep(50);system("color E3");
//Sleep(50);system("color 54");
//Sleep(50);system("color E3");
//Sleep(50);system("color 43");
//Sleep(50);system("color E4");
//Sleep(50);system("color 93");
//Sleep(50);system("color E4");
//Sleep(50);system("color C3");
//Sleep(50);system("color E4");
//Sleep(50);system("color D3");
//Sleep(50);system("color E4");
//Sleep(50);system("color F3");
//Sleep(50);system("color E4");
//Sleep(50);system("color 8E");
//printf("                            _________________________________                    ");system("color 8E");
//printf("                          /________________________________/|                    ");system("color 8E");
//printf("                _.+=*^--{|歡迎來到 [決戰蒼穹] 2.11.1 正式版|}--^*=+.              ");system("color 8E");
//printf("                          ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔                      \n");system("color 8E");
//如果想使用外掛,名字請輸入:“學生小羊 ”。Sleep(300);if(sheng==1) Beep(1200,100);system("cls");printf("這里是決戰蒼穹(蒼穹世界)! 契晉赫茍國的漓嘉茜公主被神秘人綁架了!\n\n\n 偉大的勇者啊~拿起你的武器,營救公主!\n\n\n輸入你的名字: (20個字符)\n\n\n");system("color 8E");scanf("%s",player_name);Sleep(300);strncpy(player.name,player_name,20);if(strcmp(player.name,"zty")==0) {if(sheng==1) Beep(5200,300);printf("\n\n\n封印多年的官方血統啊!你終于覺醒了!\n\n\nzty,你成為了天選之人,請你救出公主吧!\n\n\n");player.attack=99999;player.defense=99999;player.health=999999;player.max_health=999999;system("pause");}getchar();yidongcaidan();return 0;
}
int SuiJi() {srand((unsigned)time(NULL));return rand()%100;
}
int SuiJi100() {srand((unsigned)time(NULL));return rand()%100;
}
void ChooseWupin() { //選擇物品 并使用if(sheng==1) Beep(1200,100);printf("物品: 1,止血草%d個 2,急救包%d個 3,云南白藥%d個 4,超級云南白藥%d個 5,手雷%d個 6,毒標%d個 7,手拋式原子彈%d個 8,經驗草%d個 9,經驗包%d個 10,經驗石%d個 11,巨龍晶石%d個 12,免死金牌%d個 13,凋零之心%d個 14,毀滅炸彈%d個 0,返回\n\n\n",cao,jijiubao,baiyao,superbaiyao,boom,dubiao,yuanzidan,jingyancao,jingyanbao,jingyanshi,strongman_arm,miansi,diaolingxin,zhadan);system("color 8A");switch(scanf("%d",&choose_number),choose_number) {case 1:if(cao>0) {printf("使用止血草,HP增加120\n\n\n");system("color 8A");if(sheng==1) Beep(1200,100);cao--;if(player.health+120>player.max_health)player.health=player.max_health;else player.health+=120;} else printf("沒有止血草了\n\n\n");system("color 8A");break;case 2:if(jijiubao>0) {printf("使用急救包,HP增加180\n\n\n");system("color 8A");if(sheng==1) Beep(1200,100);jijiubao--;if(player.health+180>player.max_health)player.health=player.max_health;else player.health+=180;} else printf("沒有急救包了\n\n\n");system("color 8A");break;case 3:if(baiyao>0) {printf("使用云南白藥,HP增加240\nz\n\n");system("color 8A");if(sheng==1) Beep(1200,100);baiyao--;if(player.health+240>player.max_health)player.health=player.max_health;else player.health+=240;} else printf("沒有云南白藥了\n\n\n");system("color 8A");break;case 4:if(superbaiyao>0) {printf("使用超級云南白藥,HP增加400\n\n\n");system("color 8A");if(sheng==1) Beep(1200,100);superbaiyao--;if(player.health+400>player.max_health)player.health=player.max_health;else player.health+=400;} else printf("沒有超級云南白藥了\n\n\n");system("color 8A");break;case 5:if(battle) { //在戰斗中(battle=1),否則(battle=0)不能使用攻擊性物品if(boom>0) {printf("使用手雷,敵人HP減少100\n\n\n");system("color 84");Sleep(500);if(sheng==1) Beep(1200,100);boom--;guai.health-=100;AttackResult();}} else printf("非戰斗狀態,不能使用手雷!\n\n\n");system("color 84");break;case 6:if(battle) { //在戰斗中(battle=1),否則(battle=0)不能使用攻擊性物品if(dubiao>0) {printf("使用毒標,敵人HP減少200\n\n\n");system("color 84");Sleep(500);if(sheng==1) Beep(1200,100);dubiao--;guai.health-=200;AttackResult();}} else printf("非戰斗狀態,不能使用毒標!\n\n\n");system("color 84");break;case 7:if(battle) { //在戰斗中(battle=1),否則(battle=0)不能使用攻擊性物品if(yuanzidan>0) {printf("使用手拋式原子彈,敵人HP減少1500\n\n\n");system("color 84");Sleep(500);if(sheng==1) Beep(1200,100);yuanzidan--;guai.health-=1500;AttackResult();}} else printf("非戰斗狀態,不能使用手拋式原子彈!\n\n\n");system("color 84");break;case 8:if(jingyancao>0 && player.level<200) {printf("使用經驗草,等級增加3級\n\n\n");system("color 8E");if(sheng==1) Beep(1200,100);jingyancao--;player.max_health=player.max_health+60;player.attack+=9;player.defense+=6;player.level+=3;player.health=player.max_health;printf("等級:%d\n",player.level);system("color 8E");if(sheng==1) Beep(1200,100);} else    if(jingyancao<1) {printf("沒有經驗草了\n\n\n");system("color 8E");} else printf("等級超過200級,修為太高,無法使用。\n\n\n");system("color 8E");break;case 9:if(jingyanbao>0 && player.level<200) {if(player.level>197&&player.level<200) {int sheng;sheng=100-player.level;player.level+=sheng;jingyanbao--;player.max_health=player.max_health+sheng*20;player.attack+=sheng*3;player.defense+=sheng*2;player.health=player.max_health;printf("使用經驗包,等級增加%d級",sheng);system("color 8E");if(sheng==1) Beep(1200,100);printf("等級:%d\n",player.level);system("color 8E");} else {printf("使用經驗包,等級增加5級\n\n\n");system("color 8E");if(sheng==1) Beep(1200,100);jingyanbao--;player.max_health=player.max_health+100;player.attack+=15;player.defense+=10;player.level+=5;player.health=player.max_health;printf("等級:%d\n",player.level);system("color 8E");}} else if(jingyanbao<1) {printf("沒有經驗包了");system("color 8E");} else printf("等級超過200級,修為太高,無法使用。\n\n\n");system("color 8E");break;case 10:if(jingyanshi>0 && player.level<200) {if(player.level>192&&player.level<200) {int sheng;sheng=100-player.level;player.level+=sheng;player.max_health+=sheng*20;player.attack+=sheng*3;player.defense+=sheng*2;player.health=player.max_health;printf("使用經驗石,等級增加%d級\n",sheng);system("color 8E");if(sheng==1) Beep(1200,100);printf("等級:%d\n",player.level);system("color 8E");} else {printf("使用經驗石,等級增加10級\n");system("color 8E");if(sheng==1) Beep(1200,100);jingyanshi--;player.max_health=player.max_health+200;player.attack+=30;player.defense+=20;player.level+=10;player.health=player.max_health;}} else if(jingyanshi<1) {printf("沒有經驗石了\n\n\n");system("color 8E");} else printf("等級超過200級,修為太高,無法使用。\n\n\n");system("color 8E");break;case 11:if(strongman_arm>0 && player.level<500) {if(player.level>482&&player.level<500) {int sheng;sheng=500-player.level;player.level+=sheng;player.max_health=player.max_health+sheng*20;player.attack+=sheng*3;player.defense+=sheng*2;player.health=player.max_health;printf("使用巨龍晶石,等級增加%d級",sheng);system("color 8E");if(sheng==1) Beep(1200,100);printf("等級:%d\n",player.level);system("color 8E");} else {printf("使用巨龍晶石,等級增加20級\n\n\n");system("color 8E");if(sheng==1) Beep(1200,100);strongman_arm--;player.max_health=player.max_health+400;player.attack+=60;player.defense+=40;player.health=player.max_health;player.level+=20;printf("等級:%d\n",player.level);system("color 8E");}} else if(strongman_arm<1) {printf("沒有巨龍晶石了。\n\n\n");system("color 8E");if(sheng==1) Beep(1200,100);} else printf("等級超過500級,修為太高,無法使用。\n\n\n");system("color 8E");break;case 12:if(miansi>0) {if(sheng==1) Beep(1200,100);cout<<"使";Sleep(50);cout<<"用";Sleep(50);cout<<"免";Sleep(50);cout<<"死";Sleep(50);cout<<"金";Sleep(50);cout<<"牌";Sleep(50);cout<<"HP";Sleep(50);cout<<"滿";Sleep(50);system("color 8b");miansi--;if(player.health+999999>player.max_health)player.health=player.max_health;else player.health+=999999;} else printf("沒有免死金牌了\n\n\n");Sleep(500);system("color 8b");break;break;case 13:if(diaolingxin>0) {printf("使用凋零之心\nHP上限+100  攻擊+100\n\n\n");system("color 8b");Sleep(500);if(sheng==1) Beep(1200,100);diaolingxin--;player.max_health+=100;player.attack+=100;} else printf("沒有凋零之心了\n\n\n");system("color 8b");Sleep(500);break;case 14:if(battle) { //在戰斗中(battle=1),否則(battle=0)不能使用攻擊性物品if(zhadan>0) {printf("使用毀滅炸彈,敵人HP減少15000\n\n\n");Sleep(500);system("color 84");if(sheng==1) Beep(1200,100);zhadan--;guai.health-=15000;AttackResult();}}case 0:break;default:printf("ChooseWupin error!\n\n\n");}
}
void jingjiwupin() { //選擇物品 并使用if(sheng==1) Beep(1200,100);printf("物品: 1,止血草%d個 2,急救包%d個 3,云南白藥%d個 4,超級云南白藥%d個 5,手雷%d個 6,毒標%d個 7,手拋式原子彈%d個 8,經驗草%d個 9,經驗包%d個 10,經驗石%d個 11,巨龍晶石%d個 12,免死金牌%d個 13,凋零之心%d個 14,毀滅炸彈%d個 0,返回\n\n\n",cao,jijiubao,baiyao,superbaiyao,boom,dubiao,yuanzidan,jingyancao,jingyanbao,jingyanshi,strongman_arm,miansi,diaolingxin,zhadan);system("color 8A");switch(scanf("%d",&choose_number),choose_number) {case 1:if(cao>0) {printf("使用止血草,HP增加120\n\n\n");system("color 8A");if(sheng==1) Beep(1200,100);cao--;if(player.health+120>player.max_health)player.health=player.max_health;else player.health+=120;} else printf("沒有止血草了\n\n\n");system("color 8A");break;case 2:if(jijiubao>0) {printf("使用急救包,HP增加180\n\n\n");system("color 8A");if(sheng==1) Beep(1200,100);jijiubao--;if(player.health+180>player.max_health)player.health=player.max_health;else player.health+=180;} else printf("沒有急救包了\n\n\n");system("color 8A");break;case 3:if(baiyao>0) {printf("使用云南白藥,HP增加240\nz\n\n");system("color 8A");if(sheng==1) Beep(1200,100);baiyao--;if(player.health+240>player.max_health)player.health=player.max_health;else player.health+=240;} else printf("沒有云南白藥了\n\n\n");system("color 8A");break;case 4:if(superbaiyao>0) {printf("使用超級云南白藥,HP增加400\n\n\n");system("color 8A");if(sheng==1) Beep(1200,100);superbaiyao--;if(player.health+400>player.max_health)player.health=player.max_health;else player.health+=400;} else printf("沒有超級云南白藥了\n\n\n");system("color 8A");break;case 5:if(battle) { //在戰斗中(battle=1),否則(battle=0)不能使用攻擊性物品if(boom>0) {printf("使用手雷,敵人HP減少100\n\n\n");system("color 84");Sleep(500);if(sheng==1) Beep(1200,100);boom--;diren.health-=100;AttackResult();}} else printf("非戰斗狀態,不能使用手雷!\n\n\n");system("color 84");Sleep(500);break;case 6:if(battle) { //在戰斗中(battle=1),否則(battle=0)不能使用攻擊性物品if(dubiao>0) {printf("使用毒標,敵人HP減少200\n\n\n");system("color 84");Sleep(500);if(sheng==1) Beep(1200,100);dubiao--;diren.health-=200;AttackResult();}} else printf("非戰斗狀態,不能使用毒標!\n\n\n");system("color 84");Sleep(500);break;case 7:if(battle) { //在戰斗中(battle=1),否則(battle=0)不能使用攻擊性物品if(yuanzidan>0) {printf("使用手拋式原子彈,敵人HP減少1500\n\n\n");system("color 84");Sleep(500);if(sheng==1) Beep(1200,100);yuanzidan--;diren.health-=1500;AttackResult();}} else printf("非戰斗狀態,不能使用手拋式原子彈!\n\n\n");system("color 84");Sleep(500);break;case 8:if(jingyancao>0 && player.level<200) {printf("使用經驗草,等級增加3級\n\n\n");system("color 8E");if(sheng==1) Beep(1200,100);jingyancao--;player.max_health=player.max_health+60;player.attack+=9;player.defense+=6;player.level+=3;player.health=player.max_health;printf("等級:%d\n",player.level);system("color 8E");if(sheng==1) Beep(1200,100);} else    if(jingyancao<1) {printf("沒有經驗草了\n\n\n");system("color 8E");} else printf("等級超過200級,修為太高,無法使用。\n\n\n");system("color 8E");break;case 9:if(jingyanbao>0 && player.level<200) {if(player.level>197&&player.level<200) {int sheng;sheng=100-player.level;player.level+=sheng;jingyanbao--;player.max_health=player.max_health+sheng*20;player.attack+=sheng*3;player.defense+=sheng*2;player.health=player.max_health;printf("使用經驗包,等級增加%d級",sheng);system("color 8E");if(sheng==1) Beep(1200,100);printf("等級:%d\n",player.level);system("color 8E");} else {printf("使用經驗包,等級增加5級\n\n\n");system("color 8E");if(sheng==1) Beep(1200,100);jingyanbao--;player.max_health=player.max_health+100;player.attack+=15;player.defense+=10;player.level+=5;player.health=player.max_health;printf("等級:%d\n",player.level);system("color 8E");}} else if(jingyanbao<1) {printf("沒有經驗包了");system("color 8E");} else printf("等級超過200級,修為太高,無法使用。\n\n\n");system("color 8E");break;case 10:if(jingyanshi>0 && player.level<200) {if(player.level>192&&player.level<200) {int sheng;sheng=100-player.level;player.level+=sheng;player.max_health+=sheng*20;player.attack+=sheng*3;player.defense+=sheng*2;player.health=player.max_health;printf("使用經驗石,等級增加%d級\n",sheng);system("color 8E");if(sheng==1) Beep(1200,100);printf("等級:%d\n",player.level);system("color 8E");} else {printf("使用經驗石,等級增加10級\n");system("color 8E");if(sheng==1) Beep(1200,100);jingyanshi--;player.max_health=player.max_health+200;player.attack+=30;player.defense+=20;player.level+=10;player.health=player.max_health;}} else if(jingyanshi<1) {printf("沒有經驗石了\n\n\n");system("color 8E");} else printf("等級超過200級,修為太高,無法使用。\n\n\n");system("color 8E");break;case 11:if(strongman_arm>0 && player.level<500) {if(player.level>482&&player.level<500) {int sheng;sheng=500-player.level;player.level+=sheng;player.max_health=player.max_health+sheng*20;player.attack+=sheng*3;player.defense+=sheng*2;player.health=player.max_health;printf("使用巨龍晶石,等級增加%d級",sheng);system("color 8E");if(sheng==1) Beep(1200,100);printf("等級:%d\n",player.level);system("color 8E");} else {printf("使用巨龍晶石,等級增加20級\n\n\n");system("color 8E");if(sheng==1) Beep(1200,100);strongman_arm--;player.max_health=player.max_health+400;player.attack+=60;player.defense+=40;player.health=player.max_health;player.level+=20;printf("等級:%d\n",player.level);system("color 8E");}} else if(strongman_arm<1) {printf("沒有巨龍晶石了。\n\n\n");system("color 8E");Sleep(500);if(sheng==1) Beep(1200,100);} else printf("等級超過500級,修為太高,無法使用。\n\n\n");system("color 8E");Sleep(500);break;case 12:if(miansi>0) {if(sheng==1) Beep(1200,100);cout<<"使";Sleep(50);cout<<"用";Sleep(50);cout<<"免";Sleep(50);cout<<"死";Sleep(50);cout<<"金";Sleep(50);cout<<"牌";Sleep(50);cout<<"HP";Sleep(50);cout<<"滿";Sleep(50);system("color 8b");miansi--;if(player.health+999999>player.max_health)player.health=player.max_health;else player.health+=999999;} else printf("沒有免死金牌了\n\n\n");system("color 8b");Sleep(500);break;break;case 13:if(diaolingxin>0) {printf("使用凋零之心\nHP上限+100  攻擊+100\n\n\n");system("color 8b");Sleep(500);if(sheng==1) Beep(1200,100);diaolingxin--;player.max_health+=100;player.attack+=100;} else printf("沒有凋零之心了\n\n\n");system("color 8b");Sleep(500);break;case 14:if(battle) { //在戰斗中(battle=1),否則(battle=0)不能使用攻擊性物品if(zhadan>0) {printf("使用毀滅炸彈,敵人HP減少15000\n\n\n");system("color 84");Sleep(500);if(sheng==1) Beep(1200,100);zhadan--;guai.health-=15000;AttackResult();}}case 0:break;default:printf("ChooseWupin error!\n\n\n");}
}
int AttackResult() { //攻擊結果:判斷是否獲勝 是否獲得物品 和 是否升級if(guai.health<=0) {printf("戰斗勝利!獲得金幣%d,經驗%d\n\n\n",guai.money,guai.exp);system("color 8C");Sleep(500);Sleep(500);if(sheng==1) Beep(1200,100);player.exp+=guai.exp;player.range_exp+=guai.exp;money+=guai.money;s=SuiJi();if(s<guai.wupinpro) {cout<<"從";Sleep(100);if(sheng==1) Beep(1200,100);cout<<"敵";Sleep(100);cout<<"人";Sleep(100);cout<<"尸";Sleep(100);cout<<"骸";Sleep(100);cout<<"中";Sleep(100);cout<<"發";Sleep(100);cout<<"現";Sleep(100);system("color 8C");printf("%s\n\n\n",guai.wupin);Sleep(500);Sleep(500);AddWupin(guai.wupin_sign);}WhetherLevelUp();if(strcmp(guai.name,".+*凋零風暴*+.")==0) {printf("結束了\n\n");Sleep(500);Sleep(500);Sleep(500);Sleep(500);Sleep(500);Sleep(500);Sleep(500);Sleep(500);Sleep(500);Sleep(500);if(sheng==1) Beep(1200,100);system("color 8C");}return 1; //攻擊有結果了返回1,否則返回0,用于判斷是否繼續做戰斗行為} else {int s=SuiJi();if((guai.attack+s-player.defense/3)<0) {player.health-=1;printf("%s反擊,你的HP減少了 1\n\n",guai.name);system("color 8C");Sleep(500);Sleep(500);} else {player.health-=guai.attack+s-player.defense/3;printf("%s反擊,你的HP減少了%d\n\n",guai.name,guai.attack+s-player.defense/3);system("color 8C");Sleep(500);Sleep(500);}if(player.health<0) {battle=0;printf("%s戰死!金幣掉落%d\n\n\n",player.name,player.level*500);system("color CC");Sleep(500);Sleep(500);Sleep(500);Sleep(500);money-=player.level*500;player.health=player.max_health/5;yidongcaidan();//return 1;}}return 0;
}
void AddWupin(int wupin_sign) {switch(wupin_sign) {case 1:fang4n++;if(sheng==1) Beep(1200,100);break;case 2:fang3n++;if(sheng==1) Beep(1200,100);break;case 3:lp++;if(sheng==1) Beep(1200,100);break;case 4:strongman_arm++;if(sheng==1) Beep(1200,100);break;case 5:gong4n++;if(sheng==1) Beep(1200,100);break;case 6:gong3n++;if(sheng==1) Beep(1200,100);break;case 7:gong2n++;if(sheng==1) Beep(1200,100);break;case 8:gong5n++;if(sheng==1) Beep(1200,100);break;case 9:ll++;if(sheng==1) Beep(1200,100);break;case 10:diaolingxin++;if(sheng==1) Beep(1200,100);break;case 11:fang6n++;if(sheng==1) Beep(1200,100);break;case 12:gong6n++;if(sheng==1) Beep(1200,100);break;case 13:gong7n++;if(sheng==1) Beep(1200,100);break;case 14:fang7n++;if(sheng==1) Beep(1200,100);break;case 15:diaolingxinhave++;if(sheng==1) Beep(1200,100);boss1=1;break;case 16:mingshu++;if(sheng==1) Beep(1200,100);break;case 17:boss2=1;if(sheng==1) Beep(1200,100);break;default:printf("AddWupin error\n\n\n");}}
void WhetherLevelUp() {int i=0,j=0;int l1=player.range_exp/150;int l2=player.range_exp/300;int l3=player.range_exp/600;if(player.level<=15&&l1>0) { //15級以下,經驗足夠 都滿足則升級if(l1==1) {printf("%s",player.name);printf(" 升級!\n\n\n攻擊力+3, 防御力+2, HP上限+20\n\n\n");system("color 8E");Sleep(500);Sleep(500);player.exp=player.exp+guai.exp-(player.exp+guai.exp)%100;player.attack+=3;player.defense+=2;player.max_health+=20;player.health=player.max_health;player.level++;player.range_exp=0;player.exp=player.max_exp;player.max_exp+=100;} else {printf("好厲害!連升%d級!",l1);system("color 8E");Sleep(500);Sleep(500);printf("攻擊力+%d, 防御力+%d, HP上限+%d\n\n\n",3*l1,2*l1,20*l1);system("color 8E");Sleep(500);Sleep(500);player.exp=(player.exp+guai.exp) || player.exp-((player.exp+guai.exp) || player.exp)%100;player.attack+=3*l1;player.defense+=2*l1;player.max_health+=20*l1;player.health=player.max_health;player.level+=l1;player.range_exp=0;player.exp=player.max_exp;player.max_exp+=100*l1;}} else if(player.level<=40&&l2>0) {if(l2==1) {printf("%s",player.name);printf(" 升級!\n\n\n攻擊力+3, 防御力+2, HP上限+20\n\n\n");system("color 8E");Sleep(500);Sleep(500);player.exp=player.exp+guai.exp-(player.exp+guai.exp)%100;player.attack+=3;player.defense+=2;player.max_health+=20;player.health=player.max_health;player.level++;player.range_exp=0;player.exp=player.max_exp;player.max_exp+=300;} else {printf("好厲害!連升%d級!",l2);system("color 8E");Sleep(500);Sleep(500);printf("攻擊力+%d, 防御力+%d, HP上限+%d\n\n\n",3*l2,2*l2,20*l2);system("color 8E");Sleep(500);Sleep(500);player.exp=player.exp+guai.exp-(player.exp+guai.exp)%100;player.attack+=3*l2;player.defense+=2*l2;player.max_health+=20*l2;player.health=player.max_health;player.level+=l2;player.range_exp=0;player.exp=player.max_exp;player.max_exp+=300*l2;}} else if(l3>0) {if(l3==1) {printf("%s",player.name);printf(" 升級!\n\n\n攻擊力+3, 防御力+2, HP上限+20\n\n\n");system("color 8E");Sleep(500);Sleep(500);player.exp=player.exp+guai.exp-(player.exp+guai.exp)%100;player.attack+=3;player.defense+=2;player.max_health+=20;player.health=player.max_health;player.level++;player.range_exp=0;player.exp=player.max_exp;player.max_exp+=600;} else {printf("好厲害!連升%d級!",l3);printf("攻擊力+%d, 防御力+%d, HP上限+%d\n\n\n",3*l3,2*l3,20*l3);system("color 8E");Sleep(500);Sleep(500);player.exp=player.exp+guai.exp-(player.exp+guai.exp)%100;player.attack+=3*l3;player.defense+=2*l3;player.max_health+=20*l3;player.health=player.max_health;player.level+=l3;player.range_exp=0;player.exp=player.max_exp;player.max_exp+=600*l3;}}
}void yidongcaidan() { //正常行為菜單while(1) {
// \(1000);
// system("cls");if(ui==0) {system("cls");lun=0;puts("=============================================================================");system("color 8E");printf("要做什么?\n\n  1,移動     2,道具     3,對話  4,查看狀態 \n\n  5,裝備  6,關于游戲    7,后臺   8,合成臺 \n\n  9,設置  10,打開背包 \n\n");system("color 8E");if(sheng==1) Beep(1200,100);puts("=============================================================================");system("color 8E");} else {system("cls");lun=0;puts("=============================================================================");system("color 8E");printf("要做什么?\n\n1,移動 2,道具 3,對話 4,查看狀態 5,裝備 6,關于游戲 7,后臺 8,合成臺 9,設置 10,背包\n\n\n\n");system("color 8E");puts("=============================================================================");system("color 8E");}switch(scanf("%d",&choose_number),choose_number) {case 1: //顯示移動菜單printf("要去哪里?\n\n\n");system("color 8E");cout<<"1,小鄭子酒吧  ";Sleep(150);if(sheng==1) Beep(1200,100);cout<<"2,諾亞方舟酒店  ";Sleep(150);if(sheng==1) Beep(1200,100);cout<<"3,北朝商會  ";Sleep(150);if(sheng==1) Beep(1200,100);cout<<"4,紅玉拍賣行  ";Sleep(150);if(sheng==1) Beep(1200,100);cout<<"5,冒險荒野\n\n\n";Sleep(150);if(sheng==1) Beep(1200,100);cout<<"6,皇冠競技場\n\n\n";system("color 8E");if(sheng==1) Beep(1200,100);switch(scanf("%d",&choose_number),choose_number) {case 1:place_sign=place.bar; //記錄目前位置-酒吧break;case 2:place_sign=place.hotel; //進入旅店printf("金幣:%d",money);system("color 8E");printf("要開房嗎? 200個金幣 \n 1,是 0,否\n\n\n");system("color 8E");if(sheng==1) Beep(1200,100);choose_number=1;switch(scanf("%d",&choose_number),choose_number) {case 1:if(money-200<=0) { //判斷錢是否夠printf("Sorry,你的錢不夠~\n\n\n");system("color 8E");printf("金幣:%d",money);system("color 8E");} else {printf("好好休息\nHP滿\n第二天了\n\n");system("color 8E");if(sheng==1) Beep(1200,100);printf("金幣:%d\n",money);system("color 8E");money-=200; //花費200住店費player.health=player.max_health; //體力滿}break;case 0:printf("下次再來!\n\n\n");system("color 8E");break;default:printf("hotel talk error!\n\n\n");system("color 8E");}place_sign=0;break;case 3:int yongju,gong,fang;printf("請問您要購買什么類型的物品?\n\n\n");system("color 8E");if(sheng==1) Beep(1200,100);cout<<"1,攻擊裝備 ";Sleep(50);cout<<"2,防御裝備 ";Sleep(50);cout<<"3,一次性傷害武器\n\n\n";Sleep(50);scanf("%d",&yongju);switch(yongju) {case 1:printf("請問您要購買什么武器?\n\n\n 1,匕首¥300 2,西洋劍¥500 3,碧血戰錘¥1000\n\n\n");system("color 8E");if(sheng==1) Beep(1200,100);scanf("%d",&gong);switch(gong) {case 1:if(money>=300) {gong1n++;money=money-300;printf ("匕首+1\n");system("color 8E");if(sheng==1) Beep(1200,100);printf("匕首:%d個\n",gong1n);system("color 8E");printf("金幣:%d\n",money);system("color 8E");break;} else {printf("錢不夠!\n");system("color 8E");printf("金幣:%d\n",money);system("color 8E");break;}case 2:if(money>=500) {gong2n++;money=money-500;printf ("西洋劍+1\n");system("color 8E");if(sheng==1) Beep(1200,100);printf("西洋劍:%d個\n",gong2n);system("color 8E");printf("金幣:%d\n",money);system("color 8E");break;} else {printf("錢不夠!\n");system("color 8E");if(sheng==1) Beep(1200,100);printf("金幣:%d\n",money);system("color 8E");break;}case 3:if(money>=1000) {gong3n++;money=money-1000;printf ("碧血戰錘+1\n");system("color 8E");if(sheng==1) Beep(1200,100);printf("碧血戰錘:%d個\n",gong3n);system("color 8E");printf("金幣:%d\n",money);system("color 8E");break;} else {printf("錢不夠!\n");system("color 8E");printf("金幣:%d\n",money);system("color 8E");break;}default:printf("對不起,我們只會打造以上武器。");system("color 8E");break;}break;case 2:int fang;printf("請問您要購買什么防具?\n\n\n 1,布衣¥300 2,鱗甲¥500 3,重甲¥1000\n\n\n");system("color 8E");if(sheng==1) Beep(1200,100);scanf("%d",&fang);switch(fang) {case 1:if(money>=300) {fang1n++;money=money-300;printf ("布衣+1\n");system("color 8E");if(sheng==1) Beep(1200,100);printf("布衣:%d個\n",fang1n);system("color 8E");printf("金幣:%d\n",money);system("color 8E");} else {printf("錢不夠!\n");system("color 8E");printf("金幣:%d\n",money);system("color 8E");}break;case 2:if(money>=500) {fang2n++;money=money-500;printf ("鱗甲+1\n");system("color 8E");if(sheng==1) Beep(1200,100);printf("鱗甲:%d個\n",fang2n);system("color 8E");printf("金幣:%d\n",money);system("color 8E");} else {printf("錢不夠!\n");system("color 8E");printf("金幣:%d",money);system("color 8E");}break;case 3:if(money>=1000) {fang3n++;money=money-1000;printf ("重甲+1\n");system("color 8E");if(sheng==1) Beep(1200,100);printf("重甲:%d個\n",fang3n);system("color 8E");printf("金幣:%d\n",money);system("color 8E");} else {printf("錢不夠!\n");system("color 8E");printf("金幣:%d\n",money);system("color 8E");}default:printf("對不起,我們只會打造以上防具。");system("color 8E");break;}printf("金幣:%d\n",money);system("color 8E");break;case 3:printf("請問您要購買什么一次性傷害武器?\n 1,手雷 2,毒鏢 3,手拋式原子彈\n\n\n");system("color 8E");int yi;scanf("%d",&yi);switch(yi) {case 1:if(money>=300 && boom<5) {boom++;money=money-300;printf("手雷+1\n");system("color 8E");if(sheng==1) Beep(1200,100);printf("手雷:%d\n",boom);system("color 8E");printf("金幣:%d\n",money);system("color 8E");Sleep(500);} else {printf("錢不夠!\n");Sleep(500);system("color 8E");printf("金幣:%d",money);system("color 8E");Sleep(500);}break;case 2:if(money>=600 && dubiao<9999999) {dubiao++;money=money-600;printf("毒鏢+1\n");system("color 8E");if(sheng==1) Beep(1200,100);printf("毒鏢:%d\n",dubiao);system("color 8E");printf("金幣:%d\n",money);system("color 8E");Sleep(500);} else {printf("錢不夠!\n");system("color 8E");printf("金幣:%d\n",money);system("color 8E");Sleep(500);}break;case 3:if(money>=1000 && yuanzidan<5) {yuanzidan=yuanzidan+1;money=money-1000;printf("手拋式原子彈+1\n");system("color 8E");if(sheng==1) Beep(1200,100);printf("手拋式原子彈:%d\n",yuanzidan);system("color 8E");printf("金幣:%d\n",money);system("color 8E");Sleep(500);} else {printf("錢不夠!\n\n\n");system("color 8E");printf("金幣:%d\n",money);system("color 8E");Sleep(500);}break;}}break;case 4:if(sheng==1) Beep(1200,100);printf ("歡迎您光臨本拍賣行,請問您要賣什么東西?\n\n");system("color 8E");printf("攻擊裝備: 1,匕首:%d個 2,西洋劍:%d個 3,粗制石劍:%n 4,碧血戰錘:%d個 5,蜘蛛毒劍:%n個 6,尚方寶劍:%d個 7,皮卡大劍:%d個\n",gong1n,gong2n,gong7n,gong3n,gong6n,gong4n,gong5n);system("color 8E");printf("防御裝備: 8,布衣:%d個 9,鱗甲:%d個 10,戰斗馬甲:%d個 11,重甲:%d個 12,石鎧甲:%d個 13,傳說圣甲:%d個 14,金龍鎧:%d個 15,巨龍晶石:%d個\n 0,返回\n\n\n",fang1n,fang2n,fang7n,fang3n,fang6n,fang4n,fang5n,strongman_arm);system("color 8E");int pai,shu,i;scanf("%d",&pai);system("color 8E");switch(pai) {case 1:printf("請問您要出售幾件?");system("color 8E");scanf("%d",&shu);if(gong1n>=shu) {gong1n=gong1n-shu;money=money+shu*240;printf("匕首:%d\n",gong1n);system("color 8E");if(sheng==1) Beep(1200,100);printf("金幣:%d\n",money);system("color 8E");Sleep(500);break;} else {printf("裝備數不夠,無法出售!\n");system("color 8E");Sleep(500);break;}break;case 2:printf("請問您要出售幾件?\n");system("color 8E");Sleep(500);scanf("%d",&shu);if(gong2n>=shu) {gong2n=gong2n-shu;money=money+shu*400;printf("西洋劍:%d\n",gong2n);if(sheng==1) Beep(1200,100);printf("金幣:%d\n",money);Sleep(500);break;} else {printf("裝備數不夠,無法出售!\n");Sleep(500);break;}case 3:printf("請問您要出售幾件?\n");system("color 8E");scanf("%d",&shu);if(gong7n>=shu) {gong7n=gong7n-shu;money=money+shu*800;printf("粗制石劍:%d\n",gong7n);printf("金幣:%d\n",money);Sleep(500);if(sheng==1) Beep(1200,100);break;} else {printf("裝備數不夠,無法出售!\n");Sleep(500);break;}case 4:printf("請問您要出售幾件?\n");scanf("%d",&shu);if(gong3n>=shu) {gong3n=gong3n-shu;money=money+shu*800;printf("碧血戰錘:%d\n",gong3n);if(sheng==1) Beep(1200,100);printf("金幣:%d\n",money);Sleep(500);break;} else {printf("裝備數不夠,無法出售!\n");Sleep(500);break;}case 5:printf("請問您要出售幾件?\n");system("color 8E");scanf("%d",&shu);if(gong6n>=shu) {gong6n=gong6n-shu;money=money+shu*1000;printf("蜘蛛毒劍:%d\n",gong6n);if(sheng==1) Beep(1200,100);printf("金幣:%d\n",money);Sleep(500);break;} else {printf("裝備數不夠,無法出售!\n");Sleep(500);break;}case 6:printf("請問您要出售幾件?\n");scanf("%d",&shu);if(gong4n>=shu) {gong4n=gong4n-shu;money=money+shu*1500;printf("尚方寶劍:%d\n",gong4n);if(sheng==1) Beep(1200,100);printf("金幣:%d\n",money);Sleep(500);break;} else {printf("裝備數不夠,無法出售!\n");Sleep(500);break;}case 7:printf("請問您要出售幾件?\n");scanf("%d",&shu);if(gong5n>=shu) {gong5n=gong5n-shu;money=money+shu*3000;printf("雷霆之刃:%d\n",gong5n);Sleep(500);if(sheng==1) Beep(1200,100);printf("金幣:%d\n",money);break;} else {printf("裝備數不夠,無法出售!\n");Sleep(500);break;}case 8:printf("請問您要出售幾件?\n");scanf("%d",&shu);if(fang1n>=shu) {fang1n=fang1n-shu;money=money+shu*240;printf("布衣:%d\n",fang1n);if(sheng==1) Beep(1200,100);printf("金幣:%d\n",money);Sleep(500);break;} else {printf("裝備數不夠,無法出售!\n");Sleep(500);break;}case 9:printf("請問您要出售幾件?\n");scanf("%d",&shu);if(fang2n>=shu) {fang2n=fang2n-shu;money=money+shu*500;printf("鱗甲:%d\n",fang2n);if(sheng==1) Beep(1200,100);printf("金幣:%d\n",money);Sleep(500);break;} else {printf("裝備數不夠,無法出售!\n");Sleep(500);break;}case 10:printf("請問您要出售幾件?\n");Sleep(500);scanf("%d",&shu);if(fang7n>=shu) {fang7n=fang7n-shu;money=money+shu*1000;printf("戰斗馬甲:%d\n",fang7n);if(sheng==1) Beep(1200,100);printf("金幣:%d\n",money);Sleep(500);break;} else {printf("裝備數不夠,無法出售!\n");Sleep(500);break;}case 11:printf("請問您要出售幾件?\n");scanf("%d",&shu);if(fang3n>=shu) {fang3n=fang3n-shu;money=money+shu*800;printf("重甲:%d\n",fang3n);if(sheng==1) Beep(1200,100);printf("金幣:%d\n",money);Sleep(500);break;} else {printf("裝備數不夠,無法出售!\n");Sleep(500);break;}break;case 12:printf("請問您要出售幾件?\n");scanf("%d",&shu);if(fang6n>=shu) {fang6n=fang6n-shu;money=money+shu*2000;printf("石凱甲:%d\n",fang6n);if(sheng==1) Beep(1200,100);printf("金幣:%d\n",money);Sleep(500);break;} else {printf("裝備數不夠,無法出售!\n");Sleep(500);break;}case 13:printf("請問您要出售幾件?\n");scanf("%d",&shu);if(fang4n>=shu) {fang4n=fang4n-shu;money=money+shu*1500;printf("傳說圣甲:%d\n",fang4n);if(sheng==1) Beep(1200,100);printf("金幣:%d\n",money);Sleep(500);break;} else {printf("裝備數不夠,無法出售!\n");Sleep(500);break;}case 14:printf("請問您要出售幾件?\n");scanf("%d",&shu);if(fang5n>=shu) {fang5n=fang5n-shu;money=money+shu*3000;printf("金龍鎧:%d\n",fang5n);if(sheng==1) Beep(1200,100);printf("金幣:%d\n",money);Sleep(500);break;} else {printf("裝備數不夠,無法出售!\n");Sleep(500);break;}case 15:printf("請問您要出售幾顆?");scanf("%d",&shu);if(strongman_arm>=shu) {strongman_arm=strongman_arm-shu;money=money+shu*4000;printf("巨龍晶石:%d\n",strongman_arm);if(sheng==1) Beep(1200,100);printf("金幣:%d\n",money);Sleep(500);} else {printf("晶石數不夠,無法出售!\n");Sleep(500);break;}break;case 0:break;break;default:printf("沒有該裝備,無法出售!\n");Sleep(500);Sleep(500);break;}break;case 5:int yewai;while(1) {lun=0;puts("=============================================================================");printf("要去哪冒險呢?");system("color 8c");if(sheng==1) Beep(1200,100);printf("\n\n");cout<<"1,神秘沼澤 危險程度:★\n\n";Sleep(50);system("color 8c");cout<<"2,星耀草原 危險程度:★★★\n\n";Sleep(50);cout<<"3,詭異森林 危險程度:★★★\n\n";Sleep(50);cout<<"4,荒漠礦場 危險程度:★★★★\n\n";Sleep(50);cout<<"5,熾熱炎洞 危險程度:★★★★★\n\n";Sleep(50);cout<<"6,皮卡營地 危險程度:★★★★★★\n\n";Sleep(50);cout<<"7,花朵宮殿 危險程度:★★★★★★\n\n";Sleep(50);cout<<"8,熔巖龍穴 危險程度:★★★★★★★\n\n";Sleep(50);cout<<"9,凋零宇宙 危險程度:★★★★★★★★\n\n";Sleep(50);cout<<"0,離開\n";Sleep(150);system("color 8c");puts("=============================================================================");scanf("%d",&yewai);switch(yewai) {case 1:battle=1;while(battle==1) {system("cls");place_sign=place.forest1;s=SuiJi();if(s<61) {guai=xiyi;printf("%s撲了過來!\n\n\n",guai.name);BattleAct();} else if(s<95) {guai=witch;printf("%s撲了過來!\n\n\n",guai.name);BattleAct();} else {printf("這里安全\n\n\n");}}break;case 3:battle=1;while(battle==1) {system("cls");place_sign=place.forest2;s=SuiJi();if(s<45) {guai=witch;printf("%s撲了過來!\n\n\n",guai.name);BattleAct();} else if(s<73) {battle=1;guai=strongman;printf("橫沖直撞的%s撲了過來!\n\n\n",guai.name);BattleAct();} else {battle=1;guai=zhizhu;printf("可怕的%s爬了過來!\n\n\n",guai.name);BattleAct();}}break;case 5:battle=1;while(battle==1) {system("cls");place_sign=place.forest3;s=SuiJi();if(s<=34) {guai=strongman;printf("橫沖直撞的%s撲了過來!\n\n\n",guai.name);BattleAct();} else if(s<59) {guai=huolong;printf("熾熱的%s拍打著翅膀撲了過來!\n\n\n",guai.name);BattleAct();} else if(s<77) {guai=gl;printf("全身長滿礦石的%s撲了過來!\n\n\n",guai.name);BattleAct();} else {guai=zhizhu;printf("可怕的%s撲爬了過來!\n\n\n",guai.name);BattleAct();}}break;case 2:battle=1;while(battle==1) {system("cls");place_sign=place.grass1;s=SuiJi();if(s<=19) {guai=bee;printf("%s撲了過來!\n\n\n",guai.name);BattleAct();} else if(s<59) {battle=1;guai=horse;printf("%s撲了過來!\n\n\n",guai.name);BattleAct();} else if(s<74) {guai=ymr;printf("橫沖直撞的%s撲了過來!\n\n\n",guai.name);BattleAct();} else {guai=nz;printf("帥氣但令人討厭的%s向你開槍!\n\n\n",guai.name);BattleAct();}}break;case 4:battle=1;while(battle==1) {system("cls");place_sign=place.grass2;s=SuiJi();if(s<49) {guai=horse;printf("%s撲了過來!\n\n\n",guai.name);BattleAct();} else if(s<67) {guai=shibing;printf("%s舉著尚方寶劍攔住了你!\n\n\n",guai.name);BattleAct();} else {guai=gl;printf("全身長滿礦石的%s撲了過來!\n\n\n",guai.name);BattleAct();}}break;case 6:battle=1;while(battle==1) {system("cls");s=SuiJi();if(s<67) {guai=pika;printf("你感到了強烈的電流涌入全身,%s走了過來!\n\n\n",guai.name);BattleAct();} else if(s<99) {guai=dapika;printf("天空一聲巨響,三道閃電劈到%s的身上,%s手持雷霆之刃沖了過來!\n\n\n",guai.name,guai.name);BattleAct();} else {printf("這里安全\n\n\n");}}break;case 8:battle=1;while(battle==1) {system("cls");s=SuiJi();if(s<=39) {guai=cl;printf("一條飛龍橫臥洞內,你定睛一看,是%s撲了過來!\n\n\n",guai.name);BattleAct();} else if(s<80) {guai=huolong;printf("熾熱的%s拍打著翅膀撲了過來!\n\n\n",guai.name);BattleAct();} else {guai=jl;printf("一條金光閃閃的飛龍盤旋空中,,是傳說中的%s撲了過來!\n\n\n",guai.name);BattleAct();}}break;case 7:battle=1;while(battle==1) {system("cls");place_sign=place.grass3;s=SuiJi();if(s<53) {guai=shibing;printf("%s舉著尚方寶劍攔住了你!\n\n\n",guai.name);BattleAct();} else if(s<78&&boss1==0) {if(strongman_arm>=1) {printf("神秘老人:\n\n\n 哈哈,年輕人,做的不錯,不過...嘿嘿,你上當啦!巨龍晶石我要了,公主你也別想帶走!\n\n\n");guai=bossno1;printf("瞬間,你被一團黑霧籠罩,你被拉入了凋零幻境,%s向你發起攻擊!\n\n\n",guai.name);BattleAct();} else printf("神秘老人:\n\n\n 年輕人,你好啊.如果你有巨龍晶石,我可以告訴你公主的下落哦~\n\n\n");} else {guai=nz;printf("帥氣但令人討厭的%s向你開槍!\n\n\n",guai.name);BattleAct();}}break;case 9:battle=1;while(battle==1) {system("cls");s=SuiJi();if(diaolingxinhave!=0) {if(s<10&&boss2==0) {guai=dlfb;printf("一個巨大的黑暗物體,周圍環繞著大量的由破碎方塊組成的黑色顆粒云環的%s向你發起攻擊!\n\n\n",guai.name);BattleAct();} else if(s<40) {guai=dlkl;printf("手持凋零劍的黑色兇惡%s撲了過來!\n\n\n",guai.name);BattleAct();} else if(s<70) {guai=gst;printf("一個巨大的觸手向你打來,你擋了下來%s撲了過來!\n\n\n",guai.name);BattleAct();} else {guai=dljs;printf("一只巨大的猛獸%s沖了過來!\n\n\n",guai.name);BattleAct();}}if(diaolingxinhave==0) {cout<<"你沒有擊敗過凋零女巫,請去花朵宮殿擊敗凋零女巫。" <<endl;}}break;if(yewai!=0) {system("cls");printf("該區域為未知區域,無法進入。\n\n\n");system("color 8E");break;}}if(yewai==0) {system("cls");break;printf("已離開荒野。");system("color 8E");if(sheng==1) Beep(1200,100);}}break;case 6:int hao,ji;cout<<"歡迎進入皇冠競技場,年輕人,準備好了嗎\n\n\n這是一場賭命的游戲,結果除了生,便是死\n\n\n1,準備好了 0,沒有準備好\n\n\n";cin>>hao;if(!hao) break;diren.health=200;diren.attack=100;diren.defense=80;ji=player.level/25;srand((int)time(0));diren.level=rand()%50+1;diren.level+=ji*25;cout<<"敵人等級: ";//3 2 20 500cout<<diren.level<<"\n\n\n";diren.attack+=diren.level*3;diren.defense+=diren.level*2;diren.health+=diren.level*20;diren.money=diren.level*250;diren.exp=diren.level*25;//		cout<<diren.attack<<"  "<<diren.defense<<"  "<<diren.health<<"  "<<diren.money<<" "<<diren.exp;//			Sleep(10000);battle=1;Sleep(500);jingjicaidan();//	jingjipanduan();Sleep(1000);break;}break;case 2:ChooseWupin();break; //顯示道具,并可以使用.case 3: //對話選項if(sheng==1) Beep(1200,100);if(place_sign==place.bar) {printf("要和誰說話?\n\n\n1,紅發女郎 2,賞金獵人 3,酒吧老板 4,藥品商人\n\n\n");system("color 8E");if(sheng==1) Beep(1200,100);//顯示對話人物switch(scanf("%d",&choose_number),choose_number) {case 1:printf("紅發女郎:\n\n\n 吧臺邊那個Hunter好帥啊!(~臉紅~)\n\n\n聽說他經常外出打獵,外面的路他應該很熟悉的!\n\n\n");system("color 8E");if(sheng==1) Beep(1200,100);break;case 2:if(fang1n<1&&gong1n<1) {printf("賞金獵人:\n\n\n 你要救公主啊!好膽量!\n\n\n 不過外面的世界很險惡,而且越深越危險,這是匕首和布衣,對你會有些幫助的,拿去吧!\n\n\n");system("color 8E");if(sheng==1) Beep(1200,100);printf("%s心想:哇,這位大叔人真好啊!\n\n\n)",player.name);gong1n++;fang1n++;} else printf("賞金獵人:\n\n\n 加油吧,年輕人!\n\n\n 不要被外面世界所嚇倒!\n\n\n");system("color 8E");if(sheng==1) Beep(1200,100);break;case 3:printf("要喝點什么?\n\n\n 1,二鍋頭25金幣 HP+20 2,伏特加80金幣 HP+50 3,人頭馬面150金幣 HP+100 0,返回\n\n\n");system("color 8E");if(sheng==1) Beep(1200,100);choose_number=1;while(choose_number) {switch(scanf("%d",&choose_number),choose_number) {case 1:if(money<25) {printf("錢不夠!");Sleep(500);system("color 8E");if(sheng==1) Beep(1200,100);} else {if(player.health+20<=player.max_health) {printf("HP+20.");system("color 8E");Sleep(500);money-=25;if(sheng==1) Beep(1200,100);player.health+=20;} else {printf("HP滿了");system("color 8E");Sleep(500);if(sheng==1) Beep(1200,100);player.health=player.max_health;}}break;case 2:if(money<80) {printf("錢不夠!");Sleep(500);system("color 8E");} else {if(player.health+50<=player.max_health) {printf("HP+50.");system("color 8E");Sleep(500);if(sheng==1) Beep(1200,100);money-=80;player.health+=50;} else {printf("HP滿了");system("color 8E");Sleep(500);if(sheng==1) Beep(1200,100);player.health=player.max_health;}}break;case 3:if(money<150) {printf("錢不夠!");system("color 8E");Sleep(500);if(sheng==1) Beep(1200,100);} else {if(player.health+100<=player.max_health) {printf("HP+100.");system("color 8E");Sleep(500);if(sheng==1) Beep(1200,100);money-=150;player.health+=100;} else {printf("HP滿了");system("color 8E");Sleep(500);if(sheng==1) Beep(1200,100);player.health=player.max_health;}}break;case 0:printf("下次再來!\n");system("color 8E");Sleep(500);break;default:printf("輸入錯誤\n\n\n");system("color 8E");Sleep(500);break;}break;}break;case 4:printf("你要干什么?\n\n\n 1,買東西 2,聊天 \n\n\n");system("color 8E");if(sheng==1) Beep(1200,100);int mai;scanf("%d",&mai);if(mai==1) {printf("買點什么呢?\n1,止血草¥100 HP+60\n2,急救包¥150 HP+80 \n3,云南白藥¥250 HP+120\n4,超級云南白藥¥400 HP+200 \n5,經驗草¥150 經驗+300 \n6,經驗包¥600 經驗+600\n7,經驗石¥500 經驗+1000 \n0,拜拜\n");system("color 8E");Sleep(500);if(sheng==1) Beep(1200,100);int dongxi;scanf("%d",&dongxi);switch(dongxi) {case 1:if(money>=100&&cao<6) {cao++;money=money-100;printf ("止血草+1\n");system("color 8E");Sleep(500);if(sheng==1) Beep(1200,100);} else {printf("錢不夠!\n");system("color 8E");Sleep(500);}break;case 2:if(money>=150&&jijiubao<10) {jijiubao++;money=money-150;printf ("急救包+1\n");system("color 8E");Sleep(500);if(sheng==1) Beep(1200,100);} else {printf("錢不夠!\n");system("color 8E");Sleep(500);}break;case 3:if(money>=250&&baiyao<10) {baiyao++;money=money-250;printf ("云南白藥+1\n");system("color 8E");Sleep(500);if(sheng==1) Beep(1200,100);} else {printf("錢不夠!\n");system("color 8E");Sleep(500);}break;case 4:if(money>=400&&superbaiyao<10) {superbaiyao++;money=money-400;printf ("超級云南白藥+1\n");system("color 8E");Sleep(500);if(sheng==1) Beep(1200,100);} else {printf("錢不夠!\n");system("color 8E");Sleep(500);}break;case 5:if(money>=150) {jingyancao++;money=money-150;printf ("經驗草+1\n");system("color 8E");Sleep(500);if(sheng==1) Beep(1200,100);} else {printf("錢不夠!\n");system("color 8E");Sleep(500);}break;case 6:if(money>=300) {jingyanbao++;money=money-300;printf ("經驗包+1\n");system("color 8E");Sleep(500);if(sheng==1) Beep(1200,100);} else {printf("錢不夠!\n");system("color 8E");Sleep(500);}break;case 7:if(money>=500) {jingyanshi++;money=money-500;printf ("經驗石+1\n");system("color 8E");Sleep(500);if(sheng==1) Beep(1200,100);} else {printf("錢不夠!\n");system("color 8E");Sleep(500);}break;}case 0:printf("金幣:%d\n",money);system("color 8E");printf("再見,歡迎下次再來!\n");system("color 8E");Sleep(500);if(sheng==1) Beep(1200,100);break;}if(mai==2) {printf("藥品商人:去去去,老子沒時間陪你聊。\n");system("color 8E");Sleep(500);}}} else if(place_sign==place.hotel)printf("“老板娘!我...”\n\n\n“我忙著呢,沒空理你~”\n\n\n"),Sleep(500);else printf("這里好像沒人可以聊天\n\n\n");Sleep(500);system("color 8E");break;case 4:DisplayState();break; //顯示狀態case 5: //裝備if(sheng==1) Beep(1200,100);printf("攻擊裝備: 1,匕首:%d個 2,西洋劍:%d個 3,粗制石劍:%d個 4,碧血戰錘:%d個 5,蜘蛛毒劍:%d個 6,尚方寶劍:%d個 7,雷霆之刃:%d個 8,X尚方寶劍X:%d個 9,命令之劍:%d個\n\n\n",gong1n,gong2n,gong7n,gong3n,gong6n,gong4n,gong5n,gong4Xn,mgongn);system("color 8E");printf("防御裝備: 10,布衣:%d個 11,鱗甲:%d個 12,戰斗馬甲:%d個 13,重甲:%d個 14,石鎧甲:%d個 15,傳說圣甲:%d個 16,金龍鎧:%d個 17,X傳說圣甲X:%d個 18,命令之甲:%d個\t\t0,返回\n\n\n",fang1n,fang2n,fang7n,fang3n,fang6n,fang4n,fang5n,fang4Xn,mfangn);system("color 8E");printf("選擇要裝備的武器或防具:\n\n\n");system("color 8E");switch(scanf("%d",&choose_number),choose_number) {case 1:if(gong1n>=1) {printf("拿起了匕首\n\n\n");system("color 8E");if(sheng==1) Beep(1200,100);gong=gong1;strcpy(gongname,"匕首");system("color 8E");} else printf("你沒有匕首可以裝備\n\n\n");system("color 8E");break;case 2:if(gong2n>=1) {printf("拿起了西洋劍\n\n\n");system("color 8E");if(sheng==1) Beep(1200,100);gong=gong2;strcpy(gongname,"西洋劍");system("color 8E");} else printf("你沒有西洋劍可以裝備\n\n\n");system("color 8E");break;case 3:if(gong7n>=1) {printf("拿起了粗制石劍\n\n\n");gong=gong7;strcpy(gongname,"粗制石劍");} else printf("你沒有粗制石劍可以裝備\n\n\n");if(sheng==1) Beep(1200,100);break;case 4:if(gong3n>=1) {printf("拿起了碧血戰錘\n\n\n");gong=gong3;strcpy(gongname,"碧血戰錘");} else printf("你沒有碧血戰錘可以裝備\n\n\n");if(sheng==1) Beep(1200,100);break;case 5:if(gong6n>=1) {printf("拿起了蜘蛛毒劍\n\n\n");gong=gong6;strcpy(gongname,"蜘蛛毒劍");} else printf("你沒有蜘蛛毒劍可以裝備\n\n\n");if(sheng==1) Beep(1200,100);break;case 6:if(gong4n>=1) {printf("拿起了尚方寶劍\n\n\n");gong=gong4;strcpy(gongname,"尚方寶劍");} else printf("你沒有尚方寶劍可以裝備\n\n\n");if(sheng==1) Beep(1200,100);break;case 7:if(gong5n>=1) {printf("拿起了雷霆之刃\n\n\n");if(sheng==1) Beep(1200,100);gong=gong5;strcpy(gongname,"雷霆之刃");} else printf("你沒有雷霆之刃可以裝備\n\n\n");break;case 8:if(gong4Xn>=1) {printf("拿起了X尚方寶劍X\n\n\n");if(sheng==1) Beep(1200,100);gong=gong4X;strcpy(gongname,"X尚方寶劍X");} else printf("你沒有X尚方寶劍X可以裝備\n\n\n");break;case 9:if(mgongn>=1) {printf("拿起了命令之劍\n\n\n");if(sheng==1) Beep(1200,100);gong=mgong;strcpy(gongname,"命令之劍");} else printf("你沒有命令之劍可以裝備\n\n\n");break;case 10:if(fang1n>=1) {printf("穿上了布衣\n\n\n");if(sheng==1) Beep(1200,100);fang=fang1;strcpy(fangname,"布衣");} else printf("你沒有布衣可以裝備\n\n\n");break;case 11:if(fang2n>=1) {printf("穿上了鱗甲\n\n\n");if(sheng==1) Beep(1200,100);fang=fang2;strcpy(fangname,"鱗甲");} else printf("你沒有鱗甲可以裝備\n\n\n");break;case 12:if(fang7n>=1) {printf("穿上了戰斗馬甲\n\n\n");if(sheng==1) Beep(1200,100);fang=fang7;strcpy(fangname,"戰斗馬甲");} else printf("你沒有戰斗馬甲可以裝備\n\n\n");break;case 13:if(fang3n>=1) {printf("穿上了重甲\n\n\n");if(sheng==1) Beep(1200,100);fang=fang3;strcpy(fangname,"重甲");} else printf("你沒有重甲可以裝備\n\n\n");break;case 14:if(fang6n>=1) {printf("穿上了石鎧甲\n\n\n");if(sheng==1) Beep(1200,100);fang=fang6;strcpy(fangname,"石凱甲");} else printf("你沒有石凱甲可以裝備\n\n\n");break;case 15:if(fang4n>=1) {if(sheng==1) Beep(1200,100);printf("穿上了傳說圣甲\n\n\n");fang=fang4;strcpy(fangname,"傳說圣甲");} else printf("你沒有傳說圣甲可以裝備\n\n\n");break;case 16:if(fang5n>=1) {printf("穿上了金龍鎧\n\n\n");if(sheng==1) Beep(1200,100);fang=fang5;strcpy(fangname,"金龍鎧");} else printf("你沒有金龍鎧可以裝備\n\n\n");break;case 17:if(fang4Xn>=1) {printf("穿上了X傳說圣甲X\n\n\n");if(sheng==1) Beep(1200,100);fang=fang4X;strcpy(fangname,"X傳說圣甲X");} else printf("你沒有X傳說圣甲X可以裝備\n\n\n");break;case 18:if(mfangn>=1) {printf("穿上了命令之甲\n\n\n");if(sheng==1) Beep(1200,100);fang=mfang;strcpy(fangname,"命令之甲");} else printf("你沒有命令之甲可以裝備\n\n\n");break;case 0:printf("未更換裝備\n\n\n");break;default:printf("change error!");}break;case 6:if(sheng==1) Beep(1200,100);printf(" 您好,歡迎您玩決戰蒼穹(蒼穹世界)。");cout<<"為了給您更好的游戲體驗,";Sleep(250);cout<<"zty時不時會優化本游戲,";Sleep(250);cout<<"優化后會盡快發布在網上(CSDN)。";Sleep(250);cout<<"關于外掛方面,";Sleep(250);cout<<"開啟外掛的方式是設定勇者姓名時,";Sleep(250);cout<<"輸入";Sleep(250);cout<<"“";Sleep(250);cout<<"z";Sleep(250);cout<<"t";Sleep(250);cout<<"y";Sleep(250);cout<<"”";Sleep(250);cout<<"(不包括雙引號)。";Sleep(250);cout<<"我們在";Sleep(250);cout<<"2.";Sleep(250);cout<<"12.";Sleep(250);cout<<"2";Sleep(250);cout<<"版本內容";Sleep(250);cout<<"的基礎上進行改進";Sleep(250);cout<<"主要內容為修復皇冠競技場功能太過于逆天";Sleep(250);//	cout<<"在逃跑時不會退出副本而是切換敵人。";//		Sleep(250);cout<<"已更新完畢,";Sleep(250);cout<<"希望大家喜歡。";Sleep(250);cout<<"在這里要感謝";Sleep(250);cout<<"Cpp-King";Sleep(250);cout<<"姜乙";Sleep(250);cout<<"同學,";Sleep(250);cout<<"他給了我許多寶貴的建議,";Sleep(250);cout<<"謝";Sleep(250);cout<<"謝";Sleep(250);cout<<"\n\n";Sleep(250);system("color 8E");system("pause");break;case 8:if(sheng==1) Beep(1200,100);printf("合成臺:                   0:退出\n\n");system("color 8E");cout<<"命令之書:"<<mingshu<<"\n1: 命令之劍   需要材料:1*X尚方寶劍X + 3*命令之書\n\n";Sleep(150);if(sheng==1) Beep(1200,100);cout<<"2:X尚方寶劍X  需要材料:1* 尚方寶劍  + 1*命令之書\n\n";Sleep(150);if(sheng==1) Beep(1200,100);cout<<"3: 命令之甲   需要材料:1*X傳說圣甲X + 3*命令之書\n\n";Sleep(150);if(sheng==1) Beep(1200,100);cout<<"4:X傳說圣甲X  需要材料:1* 傳說圣甲  + 1*命令之書\n\n";Sleep(150);if(sheng==1) Beep(1200,100);cout<<"5: 毀滅炸彈   需要材料:5*手拋原子彈 + 3*命令之書\n\n";Sleep(150);if(sheng==1) Beep(1200,100);cout<<"6:  金龍鎧    需要材料:5*龍鱗  \n\n";Sleep(150);if(sheng==1) Beep(1200,100);cout<<"7:   鱗甲     需要材料:5*鱗片  \n\n";Sleep(150);if(sheng==1) Beep(1200,100);cin>>he;if(he==1)if(he==1&&gong4Xn>=1&&mingshu>=3) {gong4Xn--;mingshu-=3;mgongn++;cout<<"恭喜獲得命令之劍\n";Sleep(250);if(sheng==1) Beep(1200,100);} else cout<<"材料不足\n\n";Sleep(250);if(he==2)if(he==2&&gong4n>=1&&mingshu>=1) {gong4n--;mingshu--;gong4Xn++;cout<<"恭喜獲得X尚方寶劍X\n";Sleep(250);if(sheng==1) Beep(1200,100);} else cout<<"材料不足\n\n";Sleep(250);if(he==3)if(he==3&&fang4Xn>=1&&mingshu>=3) {fang4Xn--;mingshu-=3;mfangn++;cout<<"恭喜獲得命令之甲\n";Sleep(250);if(sheng==1) Beep(1200,100);} else cout<<"材料不足\n\n";Sleep(250);if(he==4)if(he==4&&fang4n>=1&&mingshu>=1) {fang4n--;mingshu--;fang4Xn++;cout<<"恭喜獲得X傳說圣甲X\n";Sleep(250);if(sheng==1) Beep(1200,100);} else cout<<"材料不足\n\n";Sleep(250);if(he==5)if(he==5&&yuanzidan>=5&&mingshu>=3) {yuanzidan-=5;mingshu-=3;zhadan++;cout<<"恭喜獲得毀滅炸彈\n";Sleep(250);if(sheng==1) Beep(1200,100);} else cout<<"材料不足\n\n";Sleep(250);if(he==6)if(he==6&&ll>=5) {ll-=5;fang5n++;cout<<"恭喜獲得金龍鎧\n";Sleep(250);if(sheng==1) Beep(1200,100);} else cout<<"材料不足\n\n";Sleep(250);if(he==7)if(he==7&&lp>=5) {lp-=5;fang2n++;cout<<"恭喜獲得鱗甲\n";Sleep(250);if(sheng==1) Beep(1200,100);} else cout<<"材料不足\n\n";Sleep(250);if(he==0) break;break;case 9:system("cls");cout<<"設置        0:退出\n\n";cout<<"1:聲音 ";if(sheng==1) cout<<"開\n";else cout<<"關\n";cout<<"\n2:UI界面 ";if(ui==1) cout<<"老版";else cout<<"新版";cout<<"\n\n3,退出游戲";cin>>shen;if(shen==1) {if(sheng==1) sheng=0;else sheng=1;}if(shen==2) {if(ui==1) ui=0;else ui=1;}if(shen==3) {printf("確定退出游戲?(Y/N)\n\n\n");system("color 8E");getchar();proof=getchar();if(proof=='y'||proof=='Y') {printf("按回車退出");system("color 8E");getchar();return;} else if(proof=='n'||proof=='N')printf("繼續游戲!\n\n\n");else printf("繼續!\n\n\n");}Sleep(250);Sleep(250);if(shen==0) break;break;case 7:if(sheng==1) Beep(1200,100);int mi;cout<<"============================*【后臺 開掛 測試Bug】*=============================\n密碼:";cin>>mi;if(mi%20120913==0&&mi!=0) {cout<<"輸入正確!歡迎進入后臺!\n\n=================================================\n后臺服務:\n\n1.金幣加999999\n\n2.血量上限加9999\n\n3.現有血量加9999\n\n4.攻擊加9999\n\n5.防御加9999\n\n0.退出\n\n=================================================\n\n "<<endl;cin>>htsr;if(htsr==1) {cout<<"成功獲得效果 *金幣加999999\n";if(sheng==1) Beep(1200,100);money+=999999;}if(htsr==2) {cout<<"成功獲得效果 *血量加9999\n";if(sheng==1) Beep(1200,100);player.health+=9999;}if(htsr==3) {cout<<"成功獲得效果 *血量上限加9999\n";if(sheng==1) Beep(1200,100);player.max_health+=9999;}if(htsr==4) {cout<<"成功獲得效果 *攻擊加9999\n";if(sheng==1) Beep(1200,100);player.attack+=9999;}if(htsr==5) {cout<<"成功獲得效果 *防御加9999\n";if(sheng==1) Beep(1200,100);player.defense+=9999;}if(htsr==0) {cout<<"成功退出\n";if(sheng==1) Beep(1200,100);continue;}} else {cout<<"輸入錯誤!請檢查!"<<endl;continue;}Sleep(250);Sleep(250);Sleep(250);Sleep(250);break;case 10:system("cls");printf("物品:止血草:%d個 急救包:%d個 云南白藥:%d個 超級云南白藥:%d個 手雷:%d個 毒標:%d個 手拋式原子彈:%d個 經驗草:%d個經驗包:%d個 經驗石:%d個 巨龍晶石:%d個 免死金牌:%d個 凋零之心:%d個 毀滅炸彈:%d個 \n合成材料:鱗片:%d個 龍鱗:%d個 命令之書:%d個\n",cao,jijiubao,baiyao,superbaiyao,boom,dubiao,yuanzidan,jingyancao,jingyanbao,jingyanshi,strongman_arm,miansi,diaolingxin,zhadan,lp,ll,mingshu);printf("攻擊裝備: 匕首:%d個 西洋劍:%d個 粗制石劍:%d個 碧血戰錘:%d個 蜘蛛毒劍:%d個 尚方寶劍:%d個 雷霆之刃:%d個 X尚方寶劍X:%d個 命令之劍:%d個\n",gong1n,gong2n,gong7n,gong3n,gong6n,gong4n,gong5n,gong4Xn,mgongn);system("color 8E");printf("防御裝備: 布衣:%d個 鱗甲:%d個 12,戰斗馬甲:%d個 重甲:%d個 石鎧甲:%d個 傳說圣甲:%d個 金龍鎧:%d個 X傳說圣甲X:%d個 命令之甲:%d個\t\t\n\n\n",fang1n,fang2n,fang7n,fang3n,fang6n,fang4n,fang5n,fang4Xn,mfangn);system("color 8E");system("pause");break;}}
}
void DisplayState() {printf("%s 攻擊力:%d+%d=%d 防御力:%d+%d=%d HP:%d/%d \n\n\n",player.name,player.attack,gong,player.attack+gong,player.defense,fang,player.defense+fang,player.health,player.max_health);printf("武器: %s 防具: %s \n\n\n",gongname,fangname);printf("等級:%d 經驗:%d/%d 還需要%d經驗升級 金幣:%d \n\n\n",player.level,player.exp,player.max_exp,player.max_exp-player.exp,money);system("pause");
}
void BattleAct() {while(1) {puts("=============================================================================");if(sheng==1) Beep(1200,100);printf("要怎么辦?\n\n\n 1,攻擊 2,使用物品 3,查看狀態 4,裝備 5,逃跑 6,離開副本 7,查看背包\n\n\n");switch(scanf("%d",&choose_number),choose_number) {case 1:s=SuiJi();printf("%s攻擊! %sHP減少%d\n\n\n",player.name,guai.name,player.attack+s+gong-guai.defense/3);guai.health-=player.attack+s+gong-guai.defense/3;if(AttackResult()) {lun=0;return; //如果攻擊有結果(敵人或玩家戰死)退出函數} else {lun++;continue;}case 2:ChooseWupin();//選擇物品,可以使用,戰斗中允許使用攻擊性物品lun++;break;case 3:DisplayState();break; //顯示狀態case 4: //裝備if(sheng==1) Beep(1200,100);printf("攻擊裝備: 1,匕首:%d個 2,西洋劍:%d個 3,粗制石劍:%d個 4,碧血戰錘:%d個 5,蜘蛛毒劍:%d個 6,尚方寶劍:%d個 7,雷霆之刃:%d個 8,X尚方寶劍X:%d個 9,命令之劍:%d個\n\n\n",gong1n,gong2n,gong7n,gong3n,gong6n,gong4n,gong5n,gong4Xn,mgongn);system("color 8E");printf("防御裝備: 10,布衣:%d個 11,鱗甲:%d個 12,戰斗馬甲:%d個 13,重甲:%d個 14,石鎧甲:%d個 15,傳說圣甲:%d個 16,金龍鎧:%d個 17,X傳說圣甲X:%d個 18,命令之甲:%d個\t\t0,返回\n\n\n",fang1n,fang2n,fang7n,fang3n,fang6n,fang4n,fang5n,fang4Xn,mfangn);system("color 8E");printf("選擇要裝備的武器或防具:\n\n\n");system("color 8E");switch(scanf("%d",&choose_number),choose_number) {case 1:if(gong1n>=1) {printf("拿起了匕首\n\n\n");system("color 8E");if(sheng==1) Beep(1200,100);gong=gong1;strcpy(gongname,"匕首");system("color 8E");} else printf("你沒有匕首可以裝備\n\n\n");system("color 8E");break;case 2:if(gong2n>=1) {printf("拿起了西洋劍\n\n\n");system("color 8E");if(sheng==1) Beep(1200,100);gong=gong2;strcpy(gongname,"西洋劍");system("color 8E");} else printf("你沒有西洋劍可以裝備\n\n\n");system("color 8E");break;case 3:if(gong7n>=1) {printf("拿起了粗制石劍\n\n\n");gong=gong7;strcpy(gongname,"粗制石劍");} else printf("你沒有粗制石劍可以裝備\n\n\n");if(sheng==1) Beep(1200,100);break;case 4:if(gong3n>=1) {printf("拿起了碧血戰錘\n\n\n");gong=gong3;strcpy(gongname,"碧血戰錘");} else printf("你沒有碧血戰錘可以裝備\n\n\n");if(sheng==1) Beep(1200,100);break;case 5:if(gong6n>=1) {printf("拿起了蜘蛛毒劍\n\n\n");gong=gong6;strcpy(gongname,"蜘蛛毒劍");} else printf("你沒有蜘蛛毒劍可以裝備\n\n\n");if(sheng==1) Beep(1200,100);break;case 6:if(gong4n>=1) {printf("拿起了尚方寶劍\n\n\n");gong=gong4;strcpy(gongname,"尚方寶劍");} else printf("你沒有尚方寶劍可以裝備\n\n\n");if(sheng==1) Beep(1200,100);break;case 7:if(gong5n>=1) {printf("拿起了雷霆之刃\n\n\n");if(sheng==1) Beep(1200,100);gong=gong5;strcpy(gongname,"雷霆之刃");} else printf("你沒有雷霆之刃可以裝備\n\n\n");break;case 8:if(gong4Xn>=1) {printf("拿起了X尚方寶劍X\n\n\n");if(sheng==1) Beep(1200,100);gong=gong4X;strcpy(gongname,"X尚方寶劍X");} else printf("你沒有X尚方寶劍X可以裝備\n\n\n");break;case 9:if(mgongn>=1) {printf("拿起了命令之劍\n\n\n");if(sheng==1) Beep(1200,100);gong=mgong;strcpy(gongname,"命令之劍");} else printf("你沒有命令之劍可以裝備\n\n\n");break;case 10:if(fang1n>=1) {printf("穿上了布衣\n\n\n");if(sheng==1) Beep(1200,100);fang=fang1;strcpy(fangname,"布衣");} else printf("你沒有布衣可以裝備\n\n\n");break;case 11:if(fang2n>=1) {printf("穿上了鱗甲\n\n\n");if(sheng==1) Beep(1200,100);fang=fang2;strcpy(fangname,"鱗甲");} else printf("你沒有鱗甲可以裝備\n\n\n");break;case 12:if(fang7n>=1) {printf("穿上了戰斗馬甲\n\n\n");if(sheng==1) Beep(1200,100);fang=fang7;strcpy(fangname,"戰斗馬甲");} else printf("你沒有戰斗馬甲可以裝備\n\n\n");break;case 13:if(fang3n>=1) {printf("穿上了重甲\n\n\n");if(sheng==1) Beep(1200,100);fang=fang3;strcpy(fangname,"重甲");} else printf("你沒有重甲可以裝備\n\n\n");break;case 14:if(fang6n>=1) {printf("穿上了石鎧甲\n\n\n");if(sheng==1) Beep(1200,100);fang=fang6;strcpy(fangname,"石凱甲");} else printf("你沒有石凱甲可以裝備\n\n\n");break;case 15:if(fang4n>=1) {if(sheng==1) Beep(1200,100);printf("穿上了傳說圣甲\n\n\n");fang=fang4;strcpy(fangname,"傳說圣甲");} else printf("你沒有傳說圣甲可以裝備\n\n\n");break;case 16:if(fang5n>=1) {printf("穿上了金龍鎧\n\n\n");if(sheng==1) Beep(1200,100);fang=fang5;strcpy(fangname,"金龍鎧");} else printf("你沒有金龍鎧可以裝備\n\n\n");break;case 17:if(fang4Xn>=1) {printf("穿上了X傳說圣甲X\n\n\n");if(sheng==1) Beep(1200,100);fang=fang4X;strcpy(fangname,"X傳說圣甲X");} else printf("你沒有X傳說圣甲X可以裝備\n\n\n");break;case 18:if(mfangn>=1) {printf("穿上了命令之甲\n\n\n");if(sheng==1) Beep(1200,100);fang=mfang;strcpy(fangname,"命令之甲");} else printf("你沒有命令之甲可以裝備\n\n\n");break;case 0:printf("未更換裝備\n\n\n");break;default:printf("change error!");}break;case 5:lun++;s=SuiJi();if(s<40) { //40%的概率可以逃跑printf("%s逃跑了~\n\n\n",player.name);if(sheng==1) Beep(1200,100);lun=0;Sleep(500);return;} else {printf("%s逃跑失敗!\n\n\n",player.name);if((guai.attack+s-player.defense/3)<0) {player.health-=1;printf("%s反擊,你的HP減少了 1\n\n",guai.name);Sleep(500);system("color 8C");} else {player.health-=guai.attack+s-player.defense/3;printf("%s反擊,你的HP減少了%d\n\n",guai.name,guai.attack+s-player.defense/3);Sleep(500);system("color 8C");}if(player.health<0) {battle=0;printf("%s戰死!金幣掉落%d\n\n\n",player.name,player.level*500);Sleep(500);Sleep(500);system("color CC");money-=player.level*500;player.health=player.max_health/5;yidongcaidan();return;}}if(sheng==1) Beep(200,100);break;case 6:if(lun==0) {lun=0;battle=0;printf("%s已退出~\n\n\n",player.name);Sleep(500);return;} else cout<<"已開始戰斗,無法退出\n\n\n";Sleep(500);break;case 7:system("cls");printf("物品:止血草:%d個 急救包:%d個 云南白藥:%d個 超級云南白藥:%d個 手雷:%d個 毒標:%d個 手拋式原子彈:%d個 經驗草:%d個經驗包:%d個 經驗石:%d個 巨龍晶石:%d個 免死金牌:%d個 凋零之心:%d個 毀滅炸彈:%d個 \n合成材料:鱗片:%d個 龍鱗:%d個 命令之書:%d個\n",cao,jijiubao,baiyao,superbaiyao,boom,dubiao,yuanzidan,jingyancao,jingyanbao,jingyanshi,strongman_arm,miansi,diaolingxin,zhadan,lp,ll,mingshu);printf("攻擊裝備: 匕首:%d個 西洋劍:%d個 粗制石劍:%d個 碧血戰錘:%d個 蜘蛛毒劍:%d個 尚方寶劍:%d個 雷霆之刃:%d個 X尚方寶劍X:%d個 命令之劍:%d個\n",gong1n,gong2n,gong7n,gong3n,gong6n,gong4n,gong5n,gong4Xn,mgongn);system("color 8E");printf("防御裝備: 布衣:%d個 鱗甲:%d個 12,戰斗馬甲:%d個 重甲:%d個 石鎧甲:%d個 傳說圣甲:%d個 金龍鎧:%d個 X傳說圣甲X:%d個 命令之甲:%d個\t\t\n\n\n",fang1n,fang2n,fang7n,fang3n,fang6n,fang4n,fang5n,fang4Xn,mfangn);system("color 8E");system("pause");break;default:printf("輸入錯誤,重新輸入!\n\n\n");if(sheng==1) Beep(200,100);Sleep(500);}}
}
void jingjicaidan() {while(1) {puts("=============================================================================");if(sheng==1) Beep(1200,100);printf("要怎么辦?\n\n\n 1,攻擊  2,查看狀態  \n\n\n");switch(scanf("%d",&choose_number),choose_number) {case 1:s=SuiJi();printf("%s攻擊! 敵人HP減少%d\n\n\n",player.name,player.attack+s-diren.defense/3);diren.health-=player.attack+s-diren.defense/3;if(jingjipanduan()) {lun=0;return; //如果攻擊有結果(敵人或玩家戰死)退出函數} else {lun++;continue;}
//			case 2:
//				jingjiwupin();//選擇物品,可以使用,戰斗中允許使用攻擊性物品
//				if(jingjipanduan()) {
//					lun=0;
//					return; //如果攻擊有結果(敵人或玩家戰死)退出函數
//				} else {
//					lun++;
//					continue;
//				}
//				break;case 2:DisplayState();break; //顯示狀態
//			case 3: //裝備
//				if(sheng==1) Beep(1200,100);
//				printf("攻擊裝備: 1,匕首:%d個 2,西洋劍:%d個 3,粗制石劍:%d個 4,碧血戰錘:%d個 5,蜘蛛毒劍:%d個 6,尚方寶劍:%d個 7,雷霆之刃:%d個 8,X尚方寶劍X:%d個 9,命令之劍:%d個\n\n\n",gong1n,gong2n,gong7n,gong3n,gong6n,gong4n,gong5n,gong4Xn,mgongn);
//				system("color 8E");
//				printf("防御裝備: 10,布衣:%d個 11,鱗甲:%d個 12,戰斗馬甲:%d個 13,重甲:%d個 14,石鎧甲:%d個 15,傳說圣甲:%d個 16,金龍鎧:%d個 17,X傳說圣甲X:%d個 18,命令之甲:%d個\t\t0,返回\n\n\n",fang1n,fang2n,fang7n,fang3n,fang6n,fang4n,fang5n,fang4Xn,mfangn);
//				system("color 8E");
//				printf("選擇要裝備的武器或防具:\n\n\n");
//				system("color 8E");
//				switch(scanf("%d",&choose_number),choose_number) {
//					case 1:
//						if(gong1n>=1) {
//							printf("拿起了匕首\n\n\n");
//							system("color 8E");
//							if(sheng==1) Beep(1200,100);
//							gong=gong1;
//							strcpy(gongname,"匕首");
//							system("color 8E");
//						} else printf("你沒有匕首可以裝備\n\n\n");
//						system("color 8E");
//						break;
//					case 2:
//						if(gong2n>=1) {
//							printf("拿起了西洋劍\n\n\n");
//							system("color 8E");
//							if(sheng==1) Beep(1200,100);
//							gong=gong2;
//							strcpy(gongname,"西洋劍");
//							system("color 8E");
//						} else printf("你沒有西洋劍可以裝備\n\n\n");
//						system("color 8E");
//						break;
//					case 3:
//						if(gong7n>=1) {
//							printf("拿起了粗制石劍\n\n\n");
//							gong=gong7;
//							strcpy(gongname,"粗制石劍");
//						} else printf("你沒有粗制石劍可以裝備\n\n\n");
//						if(sheng==1) Beep(1200,100);
//						break;
//					case 4:
//						if(gong3n>=1) {
//							printf("拿起了碧血戰錘\n\n\n");
//							gong=gong3;
//							strcpy(gongname,"碧血戰錘");
//						} else printf("你沒有碧血戰錘可以裝備\n\n\n");
//						if(sheng==1) Beep(1200,100);
//						break;
//					case 5:
//						if(gong6n>=1) {
//							printf("拿起了蜘蛛毒劍\n\n\n");
//							gong=gong6;
//							strcpy(gongname,"蜘蛛毒劍");
//						} else printf("你沒有蜘蛛毒劍可以裝備\n\n\n");
//						if(sheng==1) Beep(1200,100);
//						break;
//					case 6:
//						if(gong4n>=1) {
//							printf("拿起了尚方寶劍\n\n\n");
//							gong=gong4;
//							strcpy(gongname,"尚方寶劍");
//						} else printf("你沒有尚方寶劍可以裝備\n\n\n");
//						if(sheng==1) Beep(1200,100);
//						break;
//					case 7:
//						if(gong5n>=1) {
//							printf("拿起了雷霆之刃\n\n\n");
//							if(sheng==1) Beep(1200,100);
//							gong=gong5;
//							strcpy(gongname,"雷霆之刃");
//						} else printf("你沒有雷霆之刃可以裝備\n\n\n");
//						break;
//					case 8:
//						if(gong4Xn>=1) {
//							printf("拿起了X尚方寶劍X\n\n\n");
//							if(sheng==1) Beep(1200,100);
//							gong=gong4X;
//							strcpy(gongname,"X尚方寶劍X");
//						} else printf("你沒有X尚方寶劍X可以裝備\n\n\n");
//						break;
//					case 9:
//						if(mgongn>=1) {
//							printf("拿起了命令之劍\n\n\n");
//							if(sheng==1) Beep(1200,100);
//							gong=mgong;
//							strcpy(gongname,"命令之劍");
//						} else printf("你沒有命令之劍可以裝備\n\n\n");
//						break;
//					case 10:
//						if(fang1n>=1) {
//							printf("穿上了布衣\n\n\n");
//							if(sheng==1) Beep(1200,100);
//							fang=fang1;
//							strcpy(fangname,"布衣");
//						} else printf("你沒有布衣可以裝備\n\n\n");
//						break;
//					case 11:
//						if(fang2n>=1) {
//							printf("穿上了鱗甲\n\n\n");
//							if(sheng==1) Beep(1200,100);
//							fang=fang2;
//							strcpy(fangname,"鱗甲");
//						} else printf("你沒有鱗甲可以裝備\n\n\n");
//						break;
//					case 12:
//						if(fang7n>=1) {
//							printf("穿上了戰斗馬甲\n\n\n");
//							if(sheng==1) Beep(1200,100);
//							fang=fang7;
//							strcpy(fangname,"戰斗馬甲");
//						} else printf("你沒有戰斗馬甲可以裝備\n\n\n");
//						break;
//					case 13:
//						if(fang3n>=1) {
//							printf("穿上了重甲\n\n\n");
//							if(sheng==1) Beep(1200,100);
//							fang=fang3;
//							strcpy(fangname,"重甲");
//						} else printf("你沒有重甲可以裝備\n\n\n");
//						break;
//					case 14:
//						if(fang6n>=1) {
//							printf("穿上了石鎧甲\n\n\n");
//							if(sheng==1) Beep(1200,100);
//							fang=fang6;
//							strcpy(fangname,"石凱甲");
//						} else printf("你沒有石凱甲可以裝備\n\n\n");
//						break;
//					case 15:
//						if(fang4n>=1) {
//							if(sheng==1) Beep(1200,100);
//							printf("穿上了傳說圣甲\n\n\n");
//							fang=fang4;
//							strcpy(fangname,"傳說圣甲");
//						} else printf("你沒有傳說圣甲可以裝備\n\n\n");
//						break;
//					case 16:
//						if(fang5n>=1) {
//							printf("穿上了金龍鎧\n\n\n");
//							if(sheng==1) Beep(1200,100);
//							fang=fang5;
//							strcpy(fangname,"金龍鎧");
//						} else printf("你沒有金龍鎧可以裝備\n\n\n");
//						break;
//					case 17:
//						if(fang4Xn>=1) {
//							printf("穿上了X傳說圣甲X\n\n\n");
//							if(sheng==1) Beep(1200,100);
//							fang=fang4X;
//							strcpy(fangname,"X傳說圣甲X");
//						} else printf("你沒有X傳說圣甲X可以裝備\n\n\n");
//						break;
//					case 18:
//						if(mfangn>=1) {
//							printf("穿上了命令之甲\n\n\n");
//							if(sheng==1) Beep(1200,100);
//							fang=mfang;
//							strcpy(fangname,"命令之甲");
//						} else printf("你沒有命令之甲可以裝備\n\n\n");
//						break;
//					case 0:
//						printf("未更換裝備\n\n\n");
//						break;
//					default:
//						printf("change error!");
//				}
//				break;
//			case 5:
//				lun++;
//				s=SuiJi();
//				if(s<4) { //40%的概率可以逃跑
//					printf("%s逃跑了~\n\n\n",player.name);
//					if(sheng==1) Beep(1200,100);
//					lun=0;
//					Sleep(500);
//					return;
//				} else {
//					printf("%s逃跑失敗!\n\n\n",player.name);
//					if((diren.attack+s-player.defense/3)<0) {
//						player.health-=1;
//						printf("敵人反擊,你的HP減少了 1\n\n");
//						Sleep(500);
//						system("color 8C");
//					} else {
//						player.health-=diren.attack+s-player.defense/3;
//						printf("敵人反擊,你的HP減少了%d\n\n",diren.attack+s-player.defense/3);
//						Sleep(500);
//						system("color 8C");
//					}
//					if(player.health<0) {
//						battle=0;
//						printf("%s戰死!金幣掉落%d\n\n\n",player.name,player.level*500);
//						Sleep(500);
//						Sleep(500);
//						system("color CC");
//						money-=player.level*500;
//						player.health=player.max_health/5;
//						yidongcaidan();
//						return;
//					}
//				}
//				if(sheng==1) Beep(200,100);
//				break;
//			case 6:
//				if(lun==0) {
//					lun=0;
//					battle=0;
//					printf("%s已退出~\n\n\n",player.name);
//					Sleep(500);
//					return;
//				} else cout<<"已開始戰斗,無法退出\n\n\n";
//				Sleep(500);
//				break;default:printf("輸入錯誤,重新輸入!\n\n\n");if(sheng==1) Beep(200,100);Sleep(500);}}
}
int jingjipanduan() { //攻擊結果:判斷是否獲勝 是否獲得物品 和 是否升級if(diren.health<=0) {printf("戰斗勝利!獲得金幣%d,經驗%d\n\n\n",diren.money,diren.exp);system("color 8C");Sleep(1000);if(sheng==1) Beep(1200,100);player.exp+=diren.exp;player.range_exp+=diren.exp;money+=diren.money;jingjishengji();system("color 8C");return 1; //攻擊有結果了返回1,否則返回0,用于判斷是否繼續做戰斗行為} else {if((diren.attack+player.defense/3)<0) {player.health-=1;printf("敵人反擊,你的HP減少了 1\n\n");system("color 8C");Sleep(100);} else {player.health-=diren.attack+s-player.defense/3;printf("敵人反擊,你的HP減少了%d\n\n",diren.attack+s-player.defense/3);system("color 8C");Sleep(100);}if(player.health<0) {battle=0;printf("%s戰死!金幣掉落%d\n\n\n",player.name,player.level*500);system("color CC");money-=player.level*500;Sleep(1000);Sleep(1000);player.health=player.max_health/5;yidongcaidan();//return 1;}}return 0;
}
void jingjishengji() {int i=0,j=0;int l1=player.range_exp/150;int l2=player.range_exp/300;int l3=player.range_exp/600;if(player.level<=15&&l1>0) { //15級以下,經驗足夠 都滿足則升級if(l1==1) {printf("%s",player.name);printf(" 升級!\n\n\n攻擊力+3, 防御力+2, HP上限+20\n\n\n");system("color 8E");Sleep(1000);player.exp=player.exp+diren.exp-(player.exp+diren.exp)%100;player.attack+=3;player.defense+=2;player.max_health+=20;player.health=player.max_health;player.level++;player.range_exp=0;player.exp=player.max_exp;player.max_exp+=100;} else {printf("好厲害!連升%d級!",l1);system("color 8E");Sleep(1000);printf("攻擊力+%d, 防御力+%d, HP上限+%d\n\n\n",3*l1,2*l1,20*l1);system("color 8E");Sleep(1000);player.exp=(player.exp+diren.exp) || player.exp-((player.exp+diren.exp) || player.exp)%100;player.attack+=3*l1;player.defense+=2*l1;player.max_health+=20*l1;player.health=player.max_health;player.level+=l1;player.range_exp=0;player.exp=player.max_exp;player.max_exp+=100*l1;}} else if(player.level<=40&&l2>0) {if(l2==1) {printf("%s",player.name);printf(" 升級!\n\n\n攻擊力+3, 防御力+2, HP上限+20\n\n\n");system("color 8E");Sleep(1000);player.exp=player.exp+diren.exp-(player.exp+diren.exp)%100;player.attack+=3;player.defense+=2;player.max_health+=20;player.health=player.max_health;player.level++;player.range_exp=0;player.exp=player.max_exp;player.max_exp+=300;} else {printf("好厲害!連升%d級!",l2);system("color 8E");Sleep(1000);printf("攻擊力+%d, 防御力+%d, HP上限+%d\n\n\n",3*l2,2*l2,20*l2);system("color 8E");Sleep(1000);player.exp=player.exp+diren.exp-(player.exp+diren.exp)%100;player.attack+=3*l2;player.defense+=2*l2;player.max_health+=20*l2;player.health=player.max_health;player.level+=l2;player.range_exp=0;player.exp=player.max_exp;player.max_exp+=300*l2;}} else if(l3>0) {if(l3==1) {printf("%s",player.name);printf(" 升級!\n\n\n攻擊力+3, 防御力+2, HP上限+20\n\n\n");system("color 8E");Sleep(1000);player.exp=player.exp+diren.exp-(player.exp+diren.exp)%100;player.attack+=3;player.defense+=2;player.max_health+=20;player.health=player.max_health;player.level++;player.range_exp=0;player.exp=player.max_exp;player.max_exp+=600;} else {printf("好厲害!連升%d級!",l3);Sleep(1000);printf("攻擊力+%d, 防御力+%d, HP上限+%d\n\n\n",3*l3,2*l3,20*l3);system("color 8E");Sleep(1000);player.exp=player.exp+diren.exp-(player.exp+diren.exp)%100;player.attack+=3*l3;player.defense+=2*l3;player.max_health+=20*l3;player.health=player.max_health;player.level+=l3;player.range_exp=0;player.exp=player.max_exp;player.max_exp+=600*l3;}}
}
void printf(char *p) {while(1) {if(*p!=0)printf("%c",*p++);elsebreak;Sleep(100);}
}

我的贊呢,你看見了嗎

作者:學生小羊

聯系方式:(不掛了,有事私信)

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/904321.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/904321.shtml
英文地址,請注明出處:http://en.pswp.cn/news/904321.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

Spring的數據庫編程

本內容采用最新SpringBoot3框架版本,視頻觀看地址:B站視頻播放 1. JdbcTemplate概述 針對數據庫操作,Spring框架提供了JdbcTemplate類,JdbcTemplate是一個模板類,Spring JDBC中的更高層次的抽象類均在JdbcTemplate模板類的基礎上創建。 JdbcTemplate類提供了操作數據庫…

Debezium MySqlValueConverters詳解

Debezium MySqlValueConverters詳解 1. 類的作用與功能 1.1 核心作用 MySqlValueConverters是Debezium中負責MySQL數據類型轉換的核心類,主要功能包括: 數據類型映射:將MySQL的數據類型映射到Kafka Connect的Schema類型值轉換:將MySQL的原始值轉換為Kafka Connect可用的…

進程與線程:06 操作系統之“樹”

操作系統核心知識回顧與思維訓練 在之前的學習中&#xff0c;我們深入探討了CPU管理相關內容。 CPU管理內容回顧&#xff1a;我們學習了CPU直觀管理方法&#xff0c;了解如何讓簡單程序執行&#xff0c;分析了CPU效率低下的原因及處理辦法&#xff0c;即實現多程序執行。接著…

Android Studio Profiler

1.我們想要查看自己方法的調用鏈&#xff0c;或者分析方法耗時的情況&#xff0c;可以選擇Android Studio的Profiler&#xff0c;比較方便快捷。如下&#xff1a; 2.基本的面板參數講解&#xff1a; 3.可以通過搜索&#xff0c;查看對應的方法&#xff0c;以及方法的調用鏈…

33、VS中提示“以下文件中的行尾不一致。是否將行尾標準化?“是什么意思?

在Visual Studio&#xff08;VS&#xff09;中遇到提示“以下文件中的行尾不一致。是否將行尾標準化&#xff1f;”時&#xff0c;意味著當前打開或正在編輯的文件內部存在行尾符&#xff08;EOL&#xff0c;End-Of-Line&#xff09;格式不統一的情況。以下是詳細解釋和應對建議…

頭歌實驗 庫、表、數據的創建管理與備份遷移

第1關&#xff1a;創建db_ebank數據庫 drop database IF EXISTS db_ebank;/********** Begin **********/ create database db_ebank; /********** End **********/show databases; 第2關&#xff1a;創建數據表并設置約束 1.任務要求 在 db_ebank 數據庫中創建相應8個數據…

同城跑腿小程序幫取幫送接單搶單預約取件智能派單同城配送全開源運營版源碼優創

一、源碼描述 這是一套同城跑腿小程序&#xff0c;基于FastadminUniapp框架&#xff0c;全開源無加密&#xff0c;可私有化部署&#xff0c;包含用戶端、騎手端和運營端&#xff08;后端&#xff09;&#xff0c;支持幫取/幫送模式&#xff0c;支持一鍵接單/搶單&#xff0c;主…

利用無事務方式插入數據庫解決并發插入問題

一、背景 由于項目中同一個網元&#xff0c;可能會被多個不同用戶操作&#xff0c;而且操作大部分都是以異步子任務形式進行執行&#xff0c;這樣就會帶來并發寫數據問題&#xff0c;本文通過利用無事務方式插入數據庫解決并發插入問題&#xff0c;算是解決問題的一種思路&…

Nuxt3還能用嗎?

Nuxt3還能用嗎&#xff1f; 前一段時間&#xff0c;我完成了整個產品&#xff0c;從Nuxt到Next的遷移&#xff0c;因為面臨了一些在框架層面就無法解決的問題。 payload json化 在所有的的Nuxt中&#xff0c;我們都能看到有這樣一個東西。 其實有這個東西也很正常&#xff0…

Dify 獲取天氣數據并以echarts圖表顯示

Dify 獲取天氣數據并以echarts圖表顯示 1. 創建一個 Chatflow2. 創建一個 HTTP 請求節點3. 創建一個代碼執行節點4. 創建一個直接回復節點5. 發布并預覽 1. 創建一個 Chatflow 2. 創建一個 HTTP 請求節點 請求地址&#xff1a;https://weather.cma.cn/api/climate?stationid5…

計算機圖形學編程(使用OpenGL和C++)(第2版)學習筆記 02.OpenGL圖像管線

1. OpenGL圖像管線 OpenGL&#xff08;Open Graphics Library&#xff09;是一個跨平臺的、功能強大的圖形渲染API&#xff0c;用于開發2D和3D圖形應用程序。它由Khronos Group維護&#xff0c;廣泛應用于游戲開發、圖形設計、虛擬現實等領域。 1.0.1. OpenGL的特點&#xff…

Linux架構篇、第1章_02源碼編譯安裝Apache HTTP Server 最新穩定版本是 2.4.62

Linux_基礎篇 歡迎來到Linux的世界&#xff0c;看筆記好好學多敲多打&#xff0c;每個人都是大神&#xff01; 題目&#xff1a;源碼編譯安裝Apache HTTP Server 最新穩定版本是 2.4.62 版本號: 1.0,0 作者: 老王要學習 日期: 2025.05.01 適用環境: Centos7 文檔說明 本文…

算法基礎學習|03二分

一、思路 &#xff08;1&#xff09;mid(lr1)/2 if(check(mid)):1.true [mid,r] lmid 2.false [l,mid-1] rmid-1 &#xff08;2&#xff09;mid(lr)/2 if(check(mid)):1.true [l,mid] rmid 2.false [mid1,r] lmid1 二、模板 如何選擇模…

18. LangChain分布式任務調度:大規模應用的性能優化

引言&#xff1a;從單機到萬級并發的進化 2025年某全球客服系統通過LangChain分布式改造&#xff0c;成功應對黑五期間每秒12,000次的咨詢請求。本文將基于LangChain的分布式架構&#xff0c;詳解如何實現AI任務的自動擴縮容與智能調度。 一、分布式系統核心指標 1.1 性能基準…

Java泛型(補檔)

核心概念 Java 泛型是 Java SE 1.5 引入的一項重要特性&#xff0c;它的核心思想是 參數化類型&#xff08;Parameterized Types&#xff09;&#xff0c;即通過將數據類型作為參數傳遞給類、接口或方法&#xff0c;使代碼能夠靈活地處理多種類型&#xff0c;同時保證類型安全性…

LeetCode 熱題 100:普通數組

53. 最大子數組和 給你一個整數數組 nums &#xff0c;請你找出一個具有最大和的連續子數組&#xff08;子數組最少包含一個元素&#xff09;&#xff0c;返回其最大和。 子數組是數組中的一個連續部分。 示例 1&#xff1a; 輸入&#xff1a;nums [-2,1,-3,4,-1,2,1,-5,4] 輸…

【kafka系列】消費者組

目錄 消費者組功能點 1. 動態負載均衡 2. 容錯高可用 3. 消費進度管理 4. 并行消費能力 5. 消費隔離性 其他要點 1. Rebalance過程詳解 2. 位移提交的精確語義 3. 消費者限速策略 4. 跨機房消費設計 消費者組功能點 1. 動態負載均衡 核心機制&#xff1a;通過Rebal…

黑馬點評day01(基于Redis)

1.7 Redis代替session的業務流程 1.7.1、設計key的結構 首先我們要思考一下利用redis來存儲數據&#xff0c;那么到底使用哪種結構呢&#xff1f;由于存入的數據比較簡單&#xff0c;我們可以考慮使用String&#xff0c;或者是使用哈希&#xff0c;如下圖&#xff0c;如果使用…

Python爬蟲實戰:獲取優美圖庫各類高清圖片,為用戶提供設計素材

一、引言 在互聯網時代,高清壁紙資源豐富多樣,而優美圖庫作為一個提供大量精美壁紙的網站,吸引了眾多用戶。通過 Python 爬蟲技術,可以自動化地從該網站獲取所需的壁紙資源,為用戶節省時間和精力。然而,網站通常會采取反爬措施來防止數據被惡意抓取,因此需要在爬蟲程序…

Go反射-通過反射調用結構體的方法(帶入參)

使用反射前&#xff0c;我們需要提前做好映射配置 papckage_struct_relationship.go package reflectcommonimport (api "template/api" )// 包名到包對象的映射 var structMap map[string]func() interface{}{"template/api": func() interface{} { re…