[C++] 小游戏 斗破苍穹 2.11.6 版本 zty出品

作者 : admin 本文共32688个字,预计阅读时间需要82分钟 发布时间: 2024-06-16 共1人阅读

   大家好,今天zty带来的是斗破苍穹的 2.11.6 版本,这个版本主要更新了:1、背包   2、将退出游戏改到了设置里面  3、如果不逃跑不会停止战斗。废话不多说,  先赞后看  养成习惯

code

#include
#include
#include
#include
#include
#include
#include
#include //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<<"         ■                       ■                                  
";
Sleep(50);
cout<<"      ■ ■        ■■■■    ■■■■■                        
";
Sleep(50);
cout<<"   ■ ■ ■           ■      ■  ■  ■                  
";
Sleep(50);
cout<<"    ■   ■         ■        ■  ■                         
";
Sleep(50);
cout<<"   ■■■■■■   ■■■■   ■ ■■■                    
";
Sleep(50);
cout<<"         ■     ■  ■  ■  ■  ■  ■                         
";
Sleep(50);
cout<<"         ■         ■■■ ■     ■            ■            
";
Sleep(50);
cout<<"         ■               ■    ■  ■  ▆▆▆▆▆▆▆▆▆                
";
Sleep(50);
cout<<"                                      ▆               ▆              
";
Sleep(50);
cout<<" 欢迎来到 [斗破苍穹]   ■      ■        ■           ■                
";
Sleep(50);
cout<<"                    ▆▆▆▆▆▆▆▆    ■ ▆▆▆▆▆  ■          
";
Sleep(50);
cout<<"  zty郑桐羽出品        ■      ■                  ■     
";
Sleep(50);
cout<<"                           ▆              ▆▆▆▆▆                   
";
Sleep(50);
cout<<"  2.11.6 正式版        ▆■  ■▆          ■                   
";
Sleep(50);
cout<<"                     ▆  ▆▆▆  ▆        ▆▆▆▆▆                  
";
Sleep(50);
cout<<" 新增 合成台功能         ■  ■                     ■  
";
Sleep(50);
cout<<"                         ■■■                 ▆  ■               
";
Sleep(50);
cout<<" zty出品,必属精品       ■    ■                 ■                
";
Sleep(50);
cout<<"                          ▆▆▆                                
";
Sleep(50);
cout<<" 努力通关吧!                                             
";
Sleep(50);
cout<<"                                                              
";
Sleep(50);
cout<<" 输入“1 ”下一页                           
";
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<<"                                                
";
Sleep(50);
cout<<"        ■ ■■■        ■■■  ■      ■     
";
Sleep(50);
cout<<"    ■■      ■       ■   ■  ■       ■     
";
Sleep(50);
cout<<"            ■      ■     ■   ■       ■     
";
Sleep(50);
cout<<"           ■   ■■      ■    ■       ■     
";
Sleep(50);
cout<<"         ■  ■            ■  ■ ■     ■     
";
Sleep(50);
cout<<"       ■■■               ■■    ■■■      
";
Sleep(50);
cout<<"                                         ■     
";
Sleep(50);
cout<<"                                 ■      ■     
";
Sleep(50);
cout<<" 欢迎来到 [斗破苍穹]               ■    ■     
";
Sleep(50);
cout<<"                                     ■■       
";
Sleep(50);
cout<<"  zty工作室出品          ■                     
";
Sleep(50);
cout<<"                     ■  ■  ■     ■■■■    
";
Sleep(50);
cout<<"  2.11.6 正式版      ■■■■■     ■    ■    
";
Sleep(50);
cout<<"                         ■         ■■■■    
";
Sleep(50);
cout<<" 新增 合成台功能     ■  ■  ■                 
";
Sleep(50);
cout<<"                     ■■■■■  ■■■  ■■■ 
";
Sleep(50);
cout<<" zty出品,必属精品               ■  ■  ■  ■ 
";
Sleep(50);
cout<<"                                 ■■■  ■■■ 
";
Sleep(50);
cout<<" 努力通关吧!                                   
";
Sleep(50);
cout<<"                                                
";
Sleep(50);
cout<0) {
printf("使用止血草,HP增加120
");
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("没有止血草了
");
system("color 8A");
break;
case 2:
if(jijiubao>0) {
printf("使用急救包,HP增加180
");
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("没有急救包了
");
system("color 8A");
break;
case 3:
if(baiyao>0) {
printf("使用云南白药,HP增加240
z
");
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("没有云南白药了
");
system("color 8A");
break;
case 4:
if(superbaiyao>0) {
printf("使用超级云南白药,HP增加400
");
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("没有超级云南白药了
");
system("color 8A");
break;
case 5:
if(battle) { //在战斗中(battle=1),否则(battle=0)不能使用攻击性物品
if(boom>0) {
printf("使用手雷,敌人HP减少100
");
system("color 84");
if(sheng==1) Beep(1200,100);
boom--;
guai.health-=100;
AttackResult();
}
} else printf("非战斗状态,不能使用手雷!
");
system("color 84");
break;
case 6:
if(battle) { //在战斗中(battle=1),否则(battle=0)不能使用攻击性物品
if(dubiao>0) {
printf("使用毒标,敌人HP减少200
");
system("color 84");
if(sheng==1) Beep(1200,100);
dubiao--;
guai.health-=200;
AttackResult();
}
} else printf("非战斗状态,不能使用毒标!
");
system("color 84");
break;
case 7:
if(battle) { //在战斗中(battle=1),否则(battle=0)不能使用攻击性物品
if(yuanzidan>0) {
printf("使用手抛式原子弹,敌人HP减少1500
");
system("color 84");
if(sheng==1) Beep(1200,100);
yuanzidan--;
guai.health-=1500;
AttackResult();
}
} else printf("非战斗状态,不能使用手抛式原子弹!
");
system("color 84");
break;
case 8:
if(jingyancao>0 && player.level<200) {
printf("使用经验草,等级增加3级
");
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
",player.level);
system("color 8E");
if(sheng==1) Beep(1200,100);
} else    if(jingyancao0 && player.level197&&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
",player.level);
system("color 8E");
} else {
printf("使用经验包,等级增加5级
");
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
",player.level);
system("color 8E");
}
} else if(jingyanbao0 && player.level192&&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级
",sheng);
system("color 8E");
if(sheng==1) Beep(1200,100);
printf("等级:%d
",player.level);
system("color 8E");
} else {
printf("使用经验石,等级增加10级
");
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(jingyanshi0 && player.level482&&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
",player.level);
system("color 8E");
} else {
printf("使用巨龙晶石,等级增加20级
");
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
",player.level);
system("color 8E");
}
} else if(strongman_arm0) {
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<player.max_health)player.health=player.max_health;
else player.health+=999999;
} else printf("没有免死金牌了
");
system("color 8b");
break;
break;
case 13:
if(diaolingxin>0) {
printf("使用凋零之心
HP上限+100  攻击+100
");
system("color 8b");
if(sheng==1) Beep(1200,100);
diaolingxin--;
player.max_health+=100;
player.attack+=100;
} else printf("没有凋零之心了
");
system("color 8b");
break;
case 14:
if(battle) { //在战斗中(battle=1),否则(battle=0)不能使用攻击性物品
if(zhadan>0) {
printf("使用毁灭炸弹,敌人HP减少15000
");
system("color 84");
if(sheng==1) Beep(1200,100);
zhadan--;
guai.health-=15000;
AttackResult();
}
}
case 0:
break;
default:
printf("ChooseWupin error!
");
}
}
int AttackResult() { //攻击结果:判断是否获胜 是否获得物品 和 是否升级
if(guai.health<=0) {
printf("战斗胜利!获得金币%d,经验%d
",guai.money,guai.exp);
system("color 8C");
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
",guai.wupin);
AddWupin(guai.wupin_sign);
}
WhetherLevelUp();
if(strcmp(guai.name,".+*凋零风暴*+.")==0) {
printf("结束了
");
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
",guai.name);
system("color 8C");
} else {
player.health-=guai.attack+s-player.defense/3;
printf("%s反击,你的HP减少了%d
",guai.name,guai.attack+s-player.defense/3);
system("color 8C");
}
if(player.health<0) {
battle=0;
printf("%s战死!金币掉落%d
",player.name,player.level*500);
system("color CC");
money-=player.level*500;
player.health=player.max_health/5;
OrdinaryAct();//
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++;
break;
case 16:
mingshu++;
if(sheng==1) Beep(1200,100);
break;
case 17:
boss2++;
if(sheng==1) Beep(1200,100);
break;
default:
printf("AddWupin error
");
}
}
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.level0) { //15级以下,经验足够 都满足则升级
if(l1==1) {
printf("%s",player.name);
printf(" 升级!
攻击力+3, 防御力+2, HP上限+20
");
system("color 8E");
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");
printf("攻击力+%d, 防御力+%d, HP上限+%d
",3*l1,2*l1,20*l1);
system("color 8E");
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.level0) {
if(l2==1) {
printf("%s",player.name);
printf(" 升级!
攻击力+3, 防御力+2, HP上限+20
");
system("color 8E");
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");
printf("攻击力+%d, 防御力+%d, HP上限+%d
",3*l2,2*l2,20*l2);
system("color 8E");
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(" 升级!
攻击力+3, 防御力+2, HP上限+20
");
system("color 8E");
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
",3*l3,2*l3,20*l3);
system("color 8E");
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 OrdinaryAct() { //正常行为菜单
while(1) {
// \(1000);
// system("cls");
if(ui==0) {
system("cls");
puts("=============================================================================");
system("color 8E");
printf("要做什么?
1,移动     2,道具     3,对话  4,查看状态 
5,装备  6,关于游戏    7,后台   8,合成台 
9,设置  10,打开背包 
");
system("color 8E");
if(sheng==1) Beep(1200,100);
puts("=============================================================================");
system("color 8E");
} else {
system("cls");
puts("=============================================================================");
system("color 8E");
printf("要做什么?
1,移动 2,道具 3,对话 4,查看状态 5,装备 6,关于游戏 7,后台 8,合成台 9,设置 10,背包
");
system("color 8E");
puts("=============================================================================");
system("color 8E");
}
switch(scanf("%d",&choose_number),choose_number) {
case 1: //显示移动菜单
printf("要去哪里?
");
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,冒险荒野
";
Sleep(150);
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个金币 
1,是 0,否
");
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,你的钱不够~
");
system("color 8E");
printf("金币:%d",money);
system("color 8E");
} else {
printf("好好休息
HP满
第二天了
");
system("color 8E");
if(sheng==1) Beep(1200,100);
printf("金币:%d
",money);
system("color 8E");
money-=200; //花费200住店费
player.health=player.max_health; //体力满
}
break;
case 0:
printf("下次再来!
");
system("color 8E");
break;
default:
printf("hotel talk error!
");
system("color 8E");
}
place_sign=0;
break;
case 3:
int yongju,gong,fang;
printf("请问您要购买什么类型的物品?
");
system("color 8E");
if(sheng==1) Beep(1200,100);
cout<<"1,攻击装备 ";
Sleep(50);
cout<<"2,防御装备 ";
Sleep(50);
cout<=300) {
gong1n++;
money=money-300;
printf ("匕首+1
");
system("color 8E");
if(sheng==1) Beep(1200,100);
printf("匕首:%d个
",gong1n);
system("color 8E");
printf("金币:%d
",money);
system("color 8E");
break;
} else {
printf("钱不够!
");
system("color 8E");
printf("金币:%d
",money);
system("color 8E");
break;
}
case 2:
if(money>=500) {
gong2n++;
money=money-500;
printf ("西洋剑+1
");
system("color 8E");
if(sheng==1) Beep(1200,100);
printf("西洋剑:%d个
",gong2n);
system("color 8E");
printf("金币:%d
",money);
system("color 8E");
break;
} else {
printf("钱不够!
");
system("color 8E");
if(sheng==1) Beep(1200,100);
printf("金币:%d
",money);
system("color 8E");
break;
}
case 3:
if(money>=1000) {
gong3n++;
money=money-1000;
printf ("碧血战锤+1
");
system("color 8E");
if(sheng==1) Beep(1200,100);
printf("碧血战锤:%d个
",gong3n);
system("color 8E");
printf("金币:%d
",money);
system("color 8E");
break;
} else {
printf("钱不够!
");
system("color 8E");
printf("金币:%d
",money);
system("color 8E");
break;
}
default:
printf("对不起,我们只会打造以上武器。");
system("color 8E");
break;
}
break;
case 2:
int fang;
printf("请问您要购买什么防具?
1,布衣¥300 2,鳞甲¥500 3,重甲¥1000
");
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
");
system("color 8E");
if(sheng==1) Beep(1200,100);
printf("布衣:%d个
",fang1n);
system("color 8E");
printf("金币:%d
",money);
system("color 8E");
} else {
printf("钱不够!
");
system("color 8E");
printf("金币:%d
",money);
system("color 8E");
}
break;
case 2:
if(money>=500) {
fang2n++;
money=money-500;
printf ("鳞甲+1
");
system("color 8E");
if(sheng==1) Beep(1200,100);
printf("鳞甲:%d个
",fang2n);
system("color 8E");
printf("金币:%d
",money);
system("color 8E");
} else {
printf("钱不够!
");
system("color 8E");
printf("金币:%d",money);
system("color 8E");
}
break;
case 3:
if(money>=1000) {
fang3n++;
money=money-1000;
printf ("重甲+1
");
system("color 8E");
if(sheng==1) Beep(1200,100);
printf("重甲:%d个
",fang3n);
system("color 8E");
printf("金币:%d
",money);
system("color 8E");
} else {
printf("钱不够!
");
system("color 8E");
printf("金币:%d
",money);
system("color 8E");
}
default:
printf("对不起,我们只会打造以上防具。");
system("color 8E");
break;
}
printf("金币:%d
",money);
system("color 8E");
break;
case 3:
printf("请问您要购买什么一次性伤害武器?
1,手雷 2,毒镖 3,手抛式原子弹
");
system("color 8E");
int yi;
scanf("%d",&yi);
switch(yi) {
case 1:
if(money>=300 && boom=600 && dubiao=1000 && yuanzidan=shu) {
gong1n=gong1n-shu;
money=money+shu*240;
printf("匕首:%d
",gong1n);
system("color 8E");
if(sheng==1) Beep(1200,100);
printf("金币:%d
",money);
system("color 8E");
break;
} else {
printf("装备数不够,无法出售!
");
system("color 8E");
break;
}
break;
case 2:
printf("请问您要出售几件?
");
system("color 8E");
scanf("%d",&shu);
if(gong2n>=shu) {
gong2n=gong2n-shu;
money=money+shu*400;
printf("西洋剑:%d
",gong2n);
if(sheng==1) Beep(1200,100);
printf("金币:%d
",money);
break;
} else {
printf("装备数不够,无法出售!
");
break;
}
case 3:
printf("请问您要出售几件?
");
system("color 8E");
scanf("%d",&shu);
if(gong7n>=shu) {
gong7n=gong7n-shu;
money=money+shu*800;
printf("粗制石剑:%d
",gong7n);
printf("金币:%d
",money);
if(sheng==1) Beep(1200,100);
break;
} else {
printf("装备数不够,无法出售!
");
break;
}
case 4:
printf("请问您要出售几件?
");
scanf("%d",&shu);
if(gong3n>=shu) {
gong3n=gong3n-shu;
money=money+shu*800;
printf("碧血战锤:%d
",gong3n);
if(sheng==1) Beep(1200,100);
printf("金币:%d
",money);
break;
} else {
printf("装备数不够,无法出售!
");
break;
}
case 5:
printf("请问您要出售几件?
");
system("color 8E");
scanf("%d",&shu);
if(gong6n>=shu) {
gong6n=gong6n-shu;
money=money+shu*1000;
printf("蜘蛛毒剑:%d
",gong6n);
if(sheng==1) Beep(1200,100);
printf("金币:%d
",money);
break;
} else {
printf("装备数不够,无法出售!
");
break;
}
case 6:
printf("请问您要出售几件?
");
scanf("%d",&shu);
if(gong4n>=shu) {
gong4n=gong4n-shu;
money=money+shu*1500;
printf("尚方宝剑:%d
",gong4n);
if(sheng==1) Beep(1200,100);
printf("金币:%d
",money);
break;
} else {
printf("装备数不够,无法出售!
");
break;
}
case 7:
printf("请问您要出售几件?
");
scanf("%d",&shu);
if(gong5n>=shu) {
gong5n=gong5n-shu;
money=money+shu*3000;
printf("皮卡大剑:%d
",gong5n);
if(sheng==1) Beep(1200,100);
printf("金币:%d
",money);
break;
} else {
printf("装备数不够,无法出售!
");
break;
}
case 8:
printf("请问您要出售几件?
");
scanf("%d",&shu);
if(fang1n>=shu) {
fang1n=fang1n-shu;
money=money+shu*240;
printf("布衣:%d
",fang1n);
if(sheng==1) Beep(1200,100);
printf("金币:%d
",money);
break;
} else {
printf("装备数不够,无法出售!
");
break;
}
case 9:
printf("请问您要出售几件?
");
scanf("%d",&shu);
if(fang2n>=shu) {
fang2n=fang2n-shu;
money=money+shu*500;
printf("鳞甲:%d
",fang2n);
if(sheng==1) Beep(1200,100);
printf("金币:%d
",money);
break;
} else {
printf("装备数不够,无法出售!
");
break;
}
case 10:
printf("请问您要出售几件?
");
scanf("%d",&shu);
if(fang7n>=shu) {
fang7n=fang7n-shu;
money=money+shu*1000;
printf("战斗马甲:%d
",fang7n);
if(sheng==1) Beep(1200,100);
printf("金币:%d
",money);
break;
} else {
printf("装备数不够,无法出售!
");
break;
}
case 11:
printf("请问您要出售几件?
");
scanf("%d",&shu);
if(fang3n>=shu) {
fang3n=fang3n-shu;
money=money+shu*800;
printf("重甲:%d
",fang3n);
if(sheng==1) Beep(1200,100);
printf("金币:%d
",money);
break;
} else {
printf("装备数不够,无法出售!
");
break;
}
break;
case 12:
printf("请问您要出售几件?
");
scanf("%d",&shu);
if(fang6n>=shu) {
fang6n=fang6n-shu;
money=money+shu*2000;
printf("石凯甲:%d
",fang6n);
if(sheng==1) Beep(1200,100);
printf("金币:%d
",money);
break;
} else {
printf("装备数不够,无法出售!
");
break;
}
case 13:
printf("请问您要出售几件?
");
scanf("%d",&shu);
if(fang4n>=shu) {
fang4n=fang4n-shu;
money=money+shu*1500;
printf("传说圣甲:%d
",fang4n);
if(sheng==1) Beep(1200,100);
printf("金币:%d
",money);
break;
} else {
printf("装备数不够,无法出售!
");
break;
}
case 14:
printf("请问您要出售几件?
");
scanf("%d",&shu);
if(fang5n>=shu) {
fang5n=fang5n-shu;
money=money+shu*3000;
printf("金龙铠:%d
",fang5n);
if(sheng==1) Beep(1200,100);
printf("金币:%d
",money);
break;
} else {
printf("装备数不够,无法出售!
");
break;
}
case 15:
printf("请问您要出售几颗?");
scanf("%d",&shu);
if(strongman_arm>=shu) {
strongman_arm=strongman_arm-shu;
money=money+shu*4000;
printf("巨龙晶石:%d
",strongman_arm);
if(sheng==1) Beep(1200,100);
printf("金币:%d
",money);
} else {
printf("晶石数不够,无法出售!
");
break;
}
break;
case 0:
break;
break;
default:
printf("没有该装备,无法出售!
");
break;
}
break;
case 5:
int yewai;
while(1) {
puts("=============================================================================");
printf("要去哪冒险呢?");
system("color 8c");
if(sheng==1) Beep(1200,100);
printf("
");
cout<<"1,神秘沼泽 危险程度:★
";
Sleep(50);
system("color 8c");
cout<<"2,星耀草原 危险程度:★★★
";
Sleep(50);
cout<<"3,诡异森林 危险程度:★★★
";
Sleep(50);
cout<<"4,荒漠矿场 危险程度:★★★★
";
Sleep(50);
cout<<"5,炽热炎洞 危险程度:★★★★★
";
Sleep(50);
cout<<"6,皮卡营地 危险程度:★★★★★★
";
Sleep(50);
cout<<"7,花朵宫殿 危险程度:★★★★★★
";
Sleep(50);
cout<<"8,熔岩龙穴 危险程度:★★★★★★★
";
Sleep(50);
cout<<"9,凋零宇宙 危险程度:★★★★★★★★
";
Sleep(50);
cout<<"0,离开
";
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<7) {
guai=xiyi;
printf("%s扑了过来!
",guai.name);
BattleAct();
} else if(s<9) {
guai=witch;
printf("%s扑了过来!
",guai.name);
BattleAct();
} else {
printf("这里安全
");
}
}
break;
case 3:
battle=1;
while(battle==1) {
system("cls");
place_sign=place.forest2;
s=SuiJi();
if(s<4) {
guai=witch;
printf("%s扑了过来!
",guai.name);
BattleAct();
} else if(s<7) {
battle=1;
guai=strongman;
printf("横冲直撞的%s扑了过来!
",guai.name);
BattleAct();
} else {
battle=1;
guai=zhizhu;
printf("可怕的%s爬了过来!
",guai.name);
BattleAct();
}
}
break;
case 5:
battle=1;
while(battle==1) {
system("cls");
place_sign=place.forest3;
s=SuiJi();
if(s<=3) {
guai=strongman;
printf("横冲直撞的%s扑了过来!
",guai.name);
BattleAct();
} else if(s<5) {
guai=huolong;
printf("炽热的%s拍打着翅膀扑了过来!
",guai.name);
BattleAct();
} else if(s<8) {
guai=gl;
printf("全身长满矿石的%s扑了过来!
",guai.name);
BattleAct();
} else {
guai=zhizhu;
printf("可怕的%s扑爬了过来!
",guai.name);
BattleAct();
}
}
break;
case 2:
battle=1;
while(battle==1) {
system("cls");
place_sign=place.grass1;
s=SuiJi();
if(s<=3) {
guai=bee;
printf("%s扑了过来!
",guai.name);
BattleAct();
} else if(s<5) {
battle=1;
guai=horse;
printf("%s扑了过来!
",guai.name);
BattleAct();
} else if(s<8) {
guai=ymr;
printf("横冲直撞的%s扑了过来!
",guai.name);
BattleAct();
} else {
guai=nz;
printf("帅气但令人讨厌的%s向你开枪!
",guai.name);
BattleAct();
}
}
break;
case 4:
battle=1;
while(battle==1) {
system("cls");
place_sign=place.grass2;
s=SuiJi();
if(s<5) {
guai=horse;
printf("%s扑了过来!
",guai.name);
BattleAct();
} else if(s<7) {
guai=lion;
printf("%s举着尚方宝剑拦住了你!
",guai.name);
BattleAct();
} else {
guai=gl;
printf("全身长满矿石的%s扑了过来!
",guai.name);
BattleAct();
}
}
break;
case 6:
battle=1;
while(battle==1) {
system("cls");
s=SuiJi();
if(s<7) {
guai=pika;
printf("你感到了强烈的电流涌入全身,%s走了过来!
",guai.name);
BattleAct();
} else if(s<9) {
guai=dapika;
printf("天空一声巨响,三道闪电劈到%s的身上,%s手持雷霆之刃冲了过来!
",guai.name,guai.name);
BattleAct();
} else {
printf("这里安全
");
}
}
break;
case 8:
battle=1;
while(battle==1) {
system("cls");
s=SuiJi();
if(s<=3) {
guai=cl;
printf("一条飞龙横卧洞内,你定睛一看,是%s扑了过来!
",guai.name);
BattleAct();
} else if(s=4) {
guai=huolong;
printf("炽热的%s拍打着翅膀扑了过来!
",guai.name);
BattleAct();
} else {
guai=jl;
printf("一条金光闪闪的飞龙盘旋空中,,是传说中的%s扑了过来!
",guai.name);
BattleAct();
}
}
break;
case 7:
battle=1;
while(battle==1) {
system("cls");
place_sign=place.grass3;
s=SuiJi();
if(s<5) {
guai=lion;
printf("%s举着尚方宝剑拦住了你!
",guai.name);
BattleAct();
} else if(s=1) {
printf("神秘老人:
哈哈,年轻人,做的不错,不过...嘿嘿,你上当啦!巨龙晶石我要了,公主你也别想带走!
");
guai=bossno1;
printf("瞬间,你被一团黑雾笼罩,你被拉入了凋零幻境,%s向你发起攻击!
",guai.name);
BattleAct();
} else printf("神秘老人:
年轻人,你好啊.如果你有巨龙晶石,我可以告诉你公主的下落哦~
");
} else {
guai=nz;
printf("帅气但令人讨厌的%s向你开枪!
",guai.name);
BattleAct();
}
}
break;
case 9:
battle=1;
while(battle==1) {
system("cls");
s=SuiJi();
if(diaolingxinhave!=0) {
if(s==1&&boss2==0) {
guai=dlfb;
printf("一个巨大的黑暗物体,周围环绕着大量的由破碎方块组成的黑色颗粒云环的%s向你发起攻击!
",guai.name);
BattleAct();
} else if(s>=2 && s=5&&s<=7) {
guai=gst;
printf("一个巨大的触手向你打来,你挡了下来%s扑了过来!
",guai.name);
BattleAct();
} else {
guai=dljs;
printf("一只巨大的猛兽%s冲了过来!
",guai.name);
BattleAct();
}
}
if(diaolingxinhave==0) {
cout<<"你没有击败过凋零女巫,请去花朵宫殿击败凋零女巫。" <<endl;
}
}
break;
if(yewai!=0) {
system("cls");
printf("该区域为未知区域,无法进入。
");
system("color 8E");
break;
}
}
if(yewai==0) {
system("cls");
break;
printf("已离开荒野。");
system("color 8E");
if(sheng==1) Beep(1200,100);
}
}
}
break;
case 2:
ChooseWupin();
break; //显示道具,并可以使用.
case 3: //对话选项
if(sheng==1) Beep(1200,100);
if(place_sign==place.bar) {
printf("要和谁说话?
1,红发女郎 2,赏金猎人 3,酒吧老板 4,药品商人
");
system("color 8E");
if(sheng==1) Beep(1200,100);//显示对话人物
switch(scanf("%d",&choose_number),choose_number) {
case 1:
printf("红发女郎:
吧台边那个Hunter好帅啊!(~脸红~)
听说他经常外出打猎,外面的路他应该很熟悉的!
");
system("color 8E");
if(sheng==1) Beep(1200,100);
break;
case 2:
if(fang1n<1&&gong1n<1) {
printf("赏金猎人:
你要救公主啊!好胆量!
不过外面的世界很险恶,而且越深越危险,这是匕首和布衣,对你会有些帮助的,拿去吧!
");
system("color 8E");
if(sheng==1) Beep(1200,100);
printf("%s心想:哇,这位大叔人真好啊!
)",player.name);
gong1n++;
fang1n++;
} else printf("赏金猎人:
加油吧,年轻人!
不要被外面世界所吓倒!
");
system("color 8E");
if(sheng==1) Beep(1200,100);
break;
case 3:
printf("要喝点什么?
1,二锅头25金币 HP+20 2,伏特加80金币 HP+50 3,人头马面150金币 HP+100 0,返回
");
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("钱不够!");
system("color 8E");
if(sheng==1) Beep(1200,100);
} else {
if(player.health+20<=player.max_health) {
printf("HP+20.");
system("color 8E");
money-=25;
if(sheng==1) Beep(1200,100);
player.health+=20;
} else {
printf("HP满了");
system("color 8E");
if(sheng==1) Beep(1200,100);
player.health=player.max_health;
}
}
break;
case 2:
if(money<80) {
printf("钱不够!");
system("color 8E");
} else {
if(player.health+50<=player.max_health) {
printf("HP+50.");
system("color 8E");
if(sheng==1) Beep(1200,100);
money-=80;
player.health+=50;
} else {
printf("HP满了");
system("color 8E");
if(sheng==1) Beep(1200,100);
player.health=player.max_health;
}
}
break;
case 3:
if(money<150) {
printf("钱不够!");
system("color 8E");
if(sheng==1) Beep(1200,100);
} else {
if(player.health+100=100&&cao=150&&jijiubao=250&&baiyao=400&&superbaiyao=150) {
jingyancao++;
money=money-150;
printf ("经验草+1
");
system("color 8E");
if(sheng==1) Beep(1200,100);
} else {
printf("钱不够!
");
system("color 8E");
}
break;
case 6:
if(money>=300) {
jingyanbao++;
money=money-300;
printf ("经验包+1
");
system("color 8E");
if(sheng==1) Beep(1200,100);
} else {
printf("钱不够!
");
system("color 8E");
}
break;
case 7:
if(money>=500) {
jingyanshi++;
money=money-500;
printf ("经验石+1
");
system("color 8E");
if(sheng==1) Beep(1200,100);
} else {
printf("钱不够!
");
system("color 8E");
}
break;
}
case 0:
printf("金币:%d
",money);
system("color 8E");
printf("再见,欢迎下次再来!
");
system("color 8E");
if(sheng==1) Beep(1200,100);
break;
}
if(mai==2) {
printf("药品商人:去去去,老子没时间陪你聊。
");
system("color 8E");
}
}
} else if(place_sign==place.hotel)
printf("“老板娘!我...”
“我忙着呢,没空理你~”
");
else printf("这里好像没人可以聊天
");
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个
",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个		0,返回
",fang1n,fang2n,fang7n,fang3n,fang6n,fang4n,fang5n,fang4Xn,mfangn);
system("color 8E");
printf("选择要装备的武器或防具:
");
system("color 8E");
switch(scanf("%d",&choose_number),choose_number) {
case 1:
if(gong1n>=1) {
printf("拿起了匕首
");
system("color 8E");
if(sheng==1) Beep(1200,100);
gong=gong1;
strcpy(gongname,"匕首");
system("color 8E");
} else printf("你没有匕首可以装备
");
system("color 8E");
break;
case 2:
if(gong2n>=1) {
printf("拿起了西洋剑
");
system("color 8E");
if(sheng==1) Beep(1200,100);
gong=gong2;
strcpy(gongname,"西洋剑");
system("color 8E");
} else printf("你没有西洋剑可以装备
");
system("color 8E");
break;
case 3:
if(gong7n>=1) {
printf("拿起了粗制石剑
");
gong=gong7;
strcpy(gongname,"粗制石剑");
} else printf("你没有粗制石剑可以装备
");
if(sheng==1) Beep(1200,100);
break;
case 4:
if(gong3n>=1) {
printf("拿起了碧血战锤
");
gong=gong3;
strcpy(gongname,"碧血战锤");
} else printf("你没有碧血战锤可以装备
");
if(sheng==1) Beep(1200,100);
break;
case 5:
if(gong6n>=1) {
printf("拿起了蜘蛛毒剑
");
gong=gong6;
strcpy(gongname,"蜘蛛毒剑");
} else printf("你没有蜘蛛毒剑可以装备
");
if(sheng==1) Beep(1200,100);
break;
case 6:
if(gong4n>=1) {
printf("拿起了尚方宝剑
");
gong=gong4;
strcpy(gongname,"尚方宝剑");
} else printf("你没有尚方宝剑可以装备
");
if(sheng==1) Beep(1200,100);
break;
case 7:
if(gong5n>=1) {
printf("拿起了雷霆之刃
");
if(sheng==1) Beep(1200,100);
gong=gong5;
strcpy(gongname,"雷霆之刃");
} else printf("你没有雷霆之刃可以装备
");
break;
case 8:
if(gong4Xn>=1) {
printf("拿起了X尚方宝剑X
");
if(sheng==1) Beep(1200,100);
gong=gong4X;
strcpy(gongname,"X尚方宝剑X");
} else printf("你没有X尚方宝剑X可以装备
");
break;
case 9:
if(mgongn>=1) {
printf("拿起了命令之剑
");
if(sheng==1) Beep(1200,100);
gong=mgong;
strcpy(gongname,"命令之剑");
} else printf("你没有命令之剑可以装备
");
break;
case 10:
if(fang1n>=1) {
printf("穿上了布衣
");
if(sheng==1) Beep(1200,100);
fang=fang1;
strcpy(fangname,"布衣");
} else printf("你没有布衣可以装备
");
break;
case 11:
if(fang2n>=1) {
printf("穿上了鳞甲
");
if(sheng==1) Beep(1200,100);
fang=fang2;
strcpy(fangname,"鳞甲");
} else printf("你没有鳞甲可以装备
");
break;
case 12:
if(fang7n>=1) {
printf("穿上了战斗马甲
");
if(sheng==1) Beep(1200,100);
fang=fang7;
strcpy(fangname,"战斗马甲");
} else printf("你没有战斗马甲可以装备
");
break;
case 13:
if(fang3n>=1) {
printf("穿上了重甲
");
if(sheng==1) Beep(1200,100);
fang=fang3;
strcpy(fangname,"重甲");
} else printf("你没有重甲可以装备
");
break;
case 14:
if(fang6n>=1) {
printf("穿上了石铠甲
");
if(sheng==1) Beep(1200,100);
fang=fang6;
strcpy(fangname,"石凯甲");
} else printf("你没有石凯甲可以装备
");
break;
case 15:
if(fang4n>=1) {
if(sheng==1) Beep(1200,100);
printf("穿上了传说圣甲
");
fang=fang4;
strcpy(fangname,"传说圣甲");
} else printf("你没有传说圣甲可以装备
");
break;
case 16:
if(fang5n>=1) {
printf("穿上了金龙铠
");
if(sheng==1) Beep(1200,100);
fang=fang5;
strcpy(fangname,"金龙铠");
} else printf("你没有金龙铠可以装备
");
break;
case 17:
if(fang4Xn>=1) {
printf("穿上了X传说圣甲X
");
if(sheng==1) Beep(1200,100);
fang=fang4X;
strcpy(fangname,"X传说圣甲X");
} else printf("你没有X传说圣甲X可以装备
");
break;
case 18:
if(mfangn>=1) {
printf("穿上了命令之甲
");
if(sheng==1) Beep(1200,100);
fang=mfang;
strcpy(fangname,"命令之甲");
} else printf("你没有命令之甲可以装备
");
break;
case 0:
printf("未更换装备
");
break;
default:
printf("change error!");
}
break;
case 6:
if(sheng==1) Beep(1200,100);
printf(" 您好,欢迎您玩斗破苍穹(苍穹世界)。");
cout<<"为了给您更好的游戏体验,";
Sleep(250);
cout<<"zty时不时会优化本游戏,";
Sleep(250);
cout<<"优化后会尽快发布在网上。";
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<<"11.";
Sleep(250);
cout<<"5";
Sleep(250);
cout<<"版本内容";
Sleep(250);
cout<<"的基础上进行添加,";
Sleep(250);
cout<<"主要内容为新增背包和将退出游戏改到了设置里面还有如果不逃跑是不会停止战斗";
Sleep(250);
cout<<"已更新完毕,";
Sleep(250);
cout<<"希望大家喜欢。";
//				cout<<"在这里要感谢";
//				Sleep(250);
//				cout<<"吴";
//				Sleep(250);
//				cout<<"昊";
//				Sleep(250);
//				cout<<"同学,";
//				Sleep(250);
//				cout<<"他给了我许多宝贵的建议,";
//				Sleep(250);
//				cout<<"谢";
//				Sleep(250);
//				cout<<"谢";
//				Sleep(250);
cout<<"
";
Sleep(250);
system("color 8E");
break;
case 8:
if(sheng==1) Beep(1200,100);
printf("合成台:                   0:退出
");
system("color 8E");
cout<<"命令之书:"<<mingshu<<"
1: 命令之剑   需要材料:1*X尚方宝剑X + 3*命令之书
";
Sleep(150);
if(sheng==1) Beep(1200,100);
cout<<"2:X尚方宝剑X  需要材料:1* 尚方宝剑  + 1*命令之书
";
Sleep(150);
if(sheng==1) Beep(1200,100);
cout<<"3: 命令之甲   需要材料:1*X传说圣甲X + 3*命令之书
";
Sleep(150);
if(sheng==1) Beep(1200,100);
cout<<"4:X传说圣甲X  需要材料:1* 传说圣甲  + 1*命令之书
";
Sleep(150);
if(sheng==1) Beep(1200,100);
cout<<"5: 毁灭炸弹   需要材料:5*手抛原子弹 + 3*命令之书
";
Sleep(150);
if(sheng==1) Beep(1200,100);
cout<<"6:  金龙铠    需要材料:5*龙鳞  
";
Sleep(150);
if(sheng==1) Beep(1200,100);
cout<>he;
if(he==1)
if(he==1&&gong4Xn>=1&&mingshu>=3) {
gong4Xn--;
mingshu-=3;
mgongn++;
cout<<"恭喜获得命令之剑
";
if(sheng==1) Beep(1200,100);
} else cout<=1&&mingshu>=1) {
gong4n--;
mingshu--;
gong4Xn++;
cout<<"恭喜获得X尚方宝剑X
";
if(sheng==1) Beep(1200,100);
} else cout<=1&&mingshu>=3) {
fang4Xn--;
mingshu-=3;
mfangn++;
cout<<"恭喜获得命令之甲
";
if(sheng==1) Beep(1200,100);
} else cout<=1&&mingshu>=1) {
fang4n--;
mingshu--;
fang4Xn++;
cout<<"恭喜获得X传说圣甲X
";
if(sheng==1) Beep(1200,100);
} else cout<=5&&mingshu>=3) {
yuanzidan-=5;
mingshu-=3;
zhadan++;
cout<<"恭喜获得毁灭炸弹
";
if(sheng==1) Beep(1200,100);
} else cout<=5) {
ll-=5;
fang5n++;
cout<<"恭喜获得金龙铠
";
if(sheng==1) Beep(1200,100);
} else cout<=5) {
lp-=5;
fang2n++;
cout<<"恭喜获得鳞甲
";
if(sheng==1) Beep(1200,100);
} else cout<<"材料不足
";
if(he==0) break;
break;
case 9:
system("cls");
cout<<"设置        0:退出
";
cout<<"1:声音 ";
if(sheng==1) cout<<"开
";
else cout<<"关
";
cout<<"
2:UI界面 ";
if(ui==1) cout<<"老版";
else cout<<"新版";
cout<>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)
");
system("color 8E");
getchar();
proof=getchar();
if(proof=='y'||proof=='Y') {
printf("按回车退出");
system("color 8E");
getchar();
return;
} else if(proof=='n'||proof=='N')printf("继续游戏!
");
else printf("继续!
");
}
if(shen==0) break;
break;
case 7:
if(sheng==1) Beep(1200,100);
int mi;
cout<>mi;
if(mi%20120913==0&&mi!=0) {
cout<<"输入正确!欢迎进入后台!
=================================================
后台服务:
1.金币加999999
2.血量上限加9999
3.现有血量加9999
4.攻击加9999
5.防御加9999
0.退出
=================================================
"<>htsr;
if(htsr==1) {
cout<<"成功获得效果 *金币加999999
";
if(sheng==1) Beep(1200,100);
money+=999999;
}
if(htsr==2) {
cout<<"成功获得效果 *血量加9999
";
if(sheng==1) Beep(1200,100);
player.health+=9999;
}
if(htsr==3) {
cout<<"成功获得效果 *血量上限加9999
";
if(sheng==1) Beep(1200,100);
player.max_health+=9999;
}
if(htsr==4) {
cout<<"成功获得效果 *攻击加9999
";
if(sheng==1) Beep(1200,100);
player.attack+=9999;
}
if(htsr==5) {
cout<<"成功获得效果 *防御加9999
";
if(sheng==1) Beep(1200,100);
player.defense+=9999;
}
if(htsr==0) {
cout<<"成功退出
";
if(sheng==1) Beep(1200,100);
continue;
}
} else {
cout<<"输入错误!请检查!"<<endl;
continue;
}
break;
case 10:
system("cls");
printf("物品:止血草:%d个 急救包:%d个 云南白药:%d个 超级云南白药:%d个 手雷:%d个 毒标:%d个 手抛式原子弹:%d个 经验草:%d个经验包:%d个 经验石:%d个 巨龙晶石:%d个 免死金牌:%d个 凋零之心:%d个 毁灭炸弹:%d个 
合成材料:鳞片:%d个 龙鳞:%d个 命令之书:%d个
",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个
",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个		
",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 
",player.name,player.attack,gong,player.attack+gong,player.defense,fang,player.defense+fang,player.health,player.max_health);
printf("武器: %s 防具: %s 
",gongname,fangname);
printf("等级:%d 经验:%d/%d 还需要%d经验升级 金币:%d 
",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("要怎么办?
1,攻击 2,使用物品 3,查看状态 4,逃跑
");
switch(scanf("%d",&choose_number),choose_number) {
case 1:
s=SuiJi();
printf("%s攻击! %sHP减少%d
",player.name,guai.name,player.attack+s+gong-guai.defense/3);
guai.health-=player.attack+s+gong-guai.defense/3;
if(AttackResult())return; //如果攻击有结果(敌人或玩家战死)退出函数
else continue;
case 2:
ChooseWupin();
break; //选择物品,可以使用,战斗中允许使用攻击性物品
case 3:
DisplayState();
break; //显示状态
case 4:
s=SuiJi();
if(s<4) { //40%的概率可以逃跑
printf("%s逃跑了~
",player.name);
if(sheng==1) Beep(1200,100);
battle=0;
return;
} else printf("%s逃跑失败!
",player.name);
if(sheng==1) Beep(200,100);
break;
default:
printf("输入错误,重新输入!
");
if(sheng==1) Beep(200,100);
}
}
}
void printf(char *p) {
while(1) {
if(*p!=0)
printf("%c",*p++);
else
break;
Sleep(100);
}
}

我的赞呢,你看见了吗

作者:zty郑桐羽呀

联系方式:(不挂了,有事私信)

本站无任何商业行为
个人在线分享 » [C++] 小游戏 斗破苍穹 2.11.6 版本 zty出品
E-->