[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);}
}
我的赞呢,你看见了吗
作者:学生小羊
联系方式:(不挂了,有事私信)
相关文章:
[C++] 小游戏 决战苍穹
大家好,各位看到这个标题,斗破苍穹什么时候改叫决战苍穹了?其实,因为版权等一系列问题,斗破苍穹正式改名为决战苍穹,这个版本主要更新内容为解决了皇冠竞技场太过影响游戏平衡,并且提高了一些装…...
项目成本管理_挣得进度ES
在项目成本管理的新实践中, 通过挣值管理(EVM) 的扩展,引入 挣得进度ES 这一概念, ES是EVM理论和实践的延伸,挣得进度理论用ES和实际时间(AT) 替代了传统EVM所使用的进度偏差测量指标SV(挣值—计划价值)。 使用这种替代方法计算…...
矩阵快速幂 快速求解递推公式
文章目录 习题790.多米诺和托米诺平铺 对于一个给定的递推公式,例如dp[i] dp[i-1] * a dp[i-2] * b,那么常用的做法,肯定是使用o(n)的时间复杂度进行线性求解,但是如果 n 10 18 n{10}^{18} n1018,那么肯定超时的,这…...
驱动开发硬核特训 · Day 28(上篇):pinctrl 子系统详解与实战分析
📅 日期:2025-05-05 📚 技术平台:嵌入式Jerry(B站) 一、引言 在嵌入式系统中,SoC 芯片的引脚通常具有多种功能,如 GPIO、UART、I2C、SPI 等。为了在不同的应用场景中灵活配置引脚功…...
20250505下载VLC for Android
20250505下载VLC for Android 2025/5/5 14:35 缘起:做Rockchip的RK3566的Android13下的跨网段PING。 酷芯的图传网段 和 softAP/以太网RJ45共享网段之间互相PING通。 图传的原厂/供应商说可以使用ffmpeg进行rtsp流的转发。 后来确认VLC for Android版本只有接受流&a…...
Jetpack Compose 响应式布局实战:BoxWithConstraints 完全指南
深入理解 Jetpack Compose 中的 BoxWithConstraints 前言 在构建现代 Android 应用时,响应式设计已成为必不可少的要求。Jetpack Compose 作为 Android 的现代 UI 工具包,提供了 BoxWithConstraints 这一强大组件,帮助我们轻松创建能够适应…...
ZYNQ笔记(十七):IP核封装与接口定义
版本:Vivado2020.2(Vitis) 任务:将“HDMI彩条显示实验”(正点原子 ZYNQ FPGA 开发视频)中所实现的 RGB2DVI 模块封装成一个 IP 核。 目录 一、介绍 (1)IP核 (2&#x…...
学习笔记msp430f5529lp
注:本文仅用于个人学习使用,记录笔记。 学习视频msp430f5529库函数入门教程 00.序言_哔哩哔哩_bilibili 向大佬致敬理工男小帅-CSDN博客 CCS环境快捷键使用 代码注释:Ctrl/ 提示/补全: CtrlShiftC 放大:Ctrl 缩小:Ctrl- 切换选择模式&…...
人工智能应用:从技术突破到生态重构的演进之路
一、人工智能的发展历程:从符号主义到通用智能探索 人工智能(AI)的发展始于20世纪中叶,其历程可划分为四个关键阶段: 符号主义与早期探索(1950s-1970s) 以逻辑推理和专家系统为核心&…...
【ZYNQ Linux移植】4-内核移植
文章目录 0 写在前面1 内核源码的文件结构2 Linux内核移植2.1 移植配置文件2.2 移植设备树2.3 创建脚本进行编译2.4 备份相关文件 3 测试4 总结5 参考资料 0 写在前面 这是一个系列博客,详细介绍如何在 ZYNQ 与 ZYNQ MP 平台上如何移植 Linux 系统。目前网络上的大部…...
代码随想录算法训练营第三十二天
LeetCode/卡码网题目: 518. 零钱兑换 II377. 组合总和 Ⅳ790. 多米诺和托米诺平铺(每日一题)57. 爬楼梯(第八期模拟笔试) 其他: 今日总结 往期打卡 背包问题特点: 滚动数组背包遍历顺序 完全背包从小到大,即基于当前物品更新过的继续更新01背包从大到…...
java CompletableFuture 异步编程工具用法1
1、测试异步调用: static void testCompletableFuture1() throws ExecutionException, InterruptedException {// 1、无返回值的异步任务。异步线程执行RunnableCompletableFuture.runAsync(() -> System.out.println("only you"));// 2、有返回值的异…...
Spring Boot 集成 Solr 的详细步骤及示例
环境准备 安装 Solr :从 Solr 官网(Welcome to Apache Solr - Apache Solr)下载并安装最新版本,然后通过命令 bin/solr start 启动 Solr 服务,使用 bin/solr create -c mycore 创建一个新的 Solr 核心。 安装 JDK &am…...
Nemotron-Research-Tool-N1 如何提升大语言模型工具使用能力?
Nemotron-Research-Tool-N1如何提升大语言模型工具使用能力? 如今,大语言模型(LLMs)发展迅猛,给它配备外部工具成为研究热点。但传统方法存在不少问题。这篇论文提出的Nemotron-Research-Tool-N1系列模型带来新突破&a…...
OpenCV进阶操作:图像直方图、直方图均衡化
文章目录 一、图像直方图二、图像直方图的作用三、使用matplotlib方法绘制直方图2.使用opencv的方法绘制直方图(划分16个小的子亮度区间)3、绘制彩色图像的直方图 四、直方图均衡化1、绘制原图的直方图2、绘制经过直方图均衡化后的图片的直方图3、自适应…...
Android控件VideoView用法
一 控件UI <VideoViewandroid:id="@+id/videoView"android:layout_width="match_parent"android:layout_height="match_parent"android:scaleType="fitCenter" /> 二 配置 <?xml version="1.0" encoding="u…...
人工智能数学基础(十)—— 图论
图论作为数学的重要分支,为人工智能提供了强大的建模和分析工具。无论是社交网络分析、路径规划还是数据结构设计,图论都发挥着不可替代的作用。今天,我将带领大家深入浅出地探索图论的核心概念,并结合 Python 实例,让…...
深入探索Anthropic Claude与Spring AI的融合应用
深入探索Anthropic Claude与Spring AI的融合应用 前言 在人工智能的蓬勃发展进程中,自然语言处理领域不断涌现出强大的模型和工具。Anthropic Claude系列基础AI模型凭借其出色的性能,在各种应用场景中展现出巨大潜力,为开发者和企业提供了丰…...
Python爬虫实战:获取优美图库各类高清图片,为用户提供设计素材
一、引言 在互联网时代,高清壁纸资源丰富多样,而优美图库作为一个提供大量精美壁纸的网站,吸引了众多用户。通过 Python 爬虫技术,可以自动化地从该网站获取所需的壁纸资源,为用户节省时间和精力。然而,网站通常会采取反爬措施来防止数据被恶意抓取,因此需要在爬虫程序…...
Java常用注解大全(基于JDK17+SpringBoot3)
一、基础注解(Java原生) 编译相关 @Override:方法重写校验 java 复制 下载 @Override public String toString() { return "CustomObj"; } @Deprecated:标记过时元素 java 复制 下载 @Deprecated(since="1.8", forRemoval=true) public void oldMethod…...
【NLP】30. 深入理解 In-Context Learning 的核心机制与策略
In-Context Learning(ICL)详解:提示学习时代的语言理解 一、什么是 In-Context Learning(ICL)? In-Context Learning 是指: 不改变模型参数,通过在输入中加入示例(demon…...
数字化工厂中央控制室驾驶舱系统 - Windows 部署笔记
数字化工厂中央控制室驾驶舱系统 - Windows 部署笔记 环境准备 这篇笔记记录了我在 Windows 10/11 上部署数字化工厂中央控制室驾驶舱系统的全过程,包括各种常见问题的解决方法。部署过程中使用了国内镜像源来加快下载速度。 前置需求 Python:3.8 到…...
数据库的原子事务
原子事务 11.1 全有或全无效应 二级索引需要原子性的多键更新,这不仅对数据库内部一致性至关重要,也对应用数据的一致性非常有用(例如考虑账户余额和账户交易)。 我们将放弃get-set-del接口,并添加一个新的接口来允…...
基于51单片机的红外人体感应报警器
基于51单片机的人体监测报警 (仿真+程序+原理图+PCB) 功能介绍 具体功能: 1.按下报警按钮会发生红LED蜂鸣器声光报警; 2.若检测到人,黄LED打开; 3.按下布防按键&…...
从Excel到高级工具:数据分析进阶指南
从Excel到高级工具:数据分析进阶指南 在数据分析的世界里,Excel曾经是众多人的第一站。它简单、直观、功能强大,从普通用户到专业人士,无不对其依赖。然而,随着数据规模增长、分析需求升级,Excel渐渐显得力…...
Excel VBA 自定义函数
一、VBA 函数基础概念 在 Excel VBA 中,函数主要分为两种类型: Sub 过程:执行操作但不返回值Function 函数:执行操作并返回结果 基本语法示例 1. Function 函数示例 定义一个返回字符串的公共函数 Public Function GetGreetin…...
004-nlohmann/json 快速认识-C++开源库108杰
了解 nlohmann/json 的特点;理解编程中 “数据战场”划分的概念;迅速上手多种方式构建一个JSON对象; 1 特点与安装 nlohmann/json 是一个在 github 长期霸占 “JSON” 热搜版第1的CJSON处理库。它的最大优点是与 C 标准库的容器数据…...
【Quest开发】接入语音转文字
参考官方文档:https://developers.meta.com/horizon/documentation/unity/voice-sdk-tutorials-overview 软件:Unity 2022.3.51f1c1、vscode、Meta XR All in One SDK V72 硬件:Meta Quest3 注意:需全程科学上网 Meta提供了一…...
Vim 命令从头学习记录
学习链接:eleon-vim基础教程 Vim - 基础翻屏操作 光标移动:hjkl 20j 向下移动20行,w 向后移动一个字符,b 向前移动一个字符。 Ctrl u 向上翻半页 UP Ctrl d 向下翻半页 Down Ctrl f 向下翻整页 Forward Ctrl b 向上翻整页 …...
[Linux]物理地址到虚拟地址的转化
[Linux]物理地址到虚拟地址的转化 水墨不写bug 文章目录 一、再次认识地址空间二、页表1、页表的结构设计2、页表节省了空间,省在哪里?3、页表的物理实现 一、再次认识地址空间 OS和磁盘交互的内存基本单位是4KB,这4KB通常被称为内存块。OS对…...
js获取明天日期、Vue3大菠萝 Pinia的使用
直接上代码 const today new Date(2019, 2, 28) const finalDate new Date(today) finalDate.setDate(today.getDate() 3)console.log(finalDate) // 31 March 2019 安装 yarn add pinia # or with npm npm install pinia创建第一个store仓库 1、在src目录下创建store目录…...
矩阵置零(中等)
可以用两个标记数组分别记录每一行和每一列是否有零出现。 首先遍历该数组一次,如果某个元素为 0,那么就将该元素所在的行和列所对应标记数组的位置置为 true。然后再次遍历该数组,用标记数组更新原数组。 class Solution {public void set…...
GZ人博会自然资源系统(测绘)备考笔记
本文为备考 GZ人才博览会自然资源系统(测绘) 的笔记,包括若干 知识点整理 及 近两年考核(面试)真题 (文末附《GZ人博会自然资源系统(测绘)备考笔记》1 的下载链接)。 目录…...
《进制转换的终极指南:原理、方法与编程应用》
🚀个人主页:BabyZZの秘密日记 📖收入专栏:C语言 🌍文章目入 一、进制转换的基本原理二、进制转换方法总结(一)使用权重法的转换1. 二进制 → 十进制2. 八进制 → 十进制3. 十六进制 → 十进制 &…...
2025系统架构师---论软件的设计模式论文
2023 年,我所在的公司承担了某部网络靶场的研发任务。我作为公司的技 术总监,希望能打造基于网络靶场的系列产品,参与到项目的设计中,以期开发 扩展性和可维护性良好的网络靶场,为以后的产品开发打下基础。网络靶场是网 络安全技术研究的基础支撑平台,它利用虚拟的和实物…...
嵌入式Linux驱动学习
Ubuntu18 下载链接 https://releases.ubuntu.com/bionic/ Ubuntu配置静态IP 更新Ubuntu18的镜像源 以清华大学镜像源举例 网站:https://mirrors.tuna.tsinghua.edu.cn/ 第一步点开网站搜索ubuntu然后点击问号 第二步选择自己的Ubuntu版本 第三步在Ubuntu中复制…...
基于大模型的子宫腺肌病全流程预测与诊疗方案研究报告
目录 一、引言 1.1 研究背景与意义 1.2 研究目的与创新点 二、子宫腺肌病概述 2.1 疾病定义与病理机制 2.2 流行病学特征 2.3 现有诊断与治疗方法综述 三、大模型技术原理与应用基础 3.1 大模型简介 3.2 在医疗领域的应用现状 3.3 适用于子宫腺肌病预测的可行性分析…...
Notebook.ai 开源程序是一套工具,供作家、游戏设计师和角色扮演者创建宏伟的宇宙 - 以及其中的一切
一、软件介绍 文末提供程序和源码下载 Notebook.ai 开源程序是一套工具,供作家、游戏设计师和角色扮演者创建宏伟的宇宙 - 以及其中的一切。 二、软件特点 Notebook 是作家的规划工具,用于创建从宇宙到角色、情节到单个项目的任何内容。通过浏览器、…...
关于 dex2oat 以及 vdex、cdex、dex 格式转换
版权归作者所有,如有转发,请注明文章出处:https://cyrus-studio.github.io/blog/ dex2oat dex2oat 是 Android 系统中的一个核心工具,负责将应用中的 .dex(Dalvik Executable)字节码编译为本地机器代码&am…...
Java---Object和内部类
Object类和内部类 前言:一、Object类1.object类初识2.Object的方法2.(1).获取对象的信息--toString方法2.(2).对象比较equals方法2.(3).hashCode方法 二、内部类1.内部类初识:2.内部类的分类:2.(1).实例内部类2.(2).静态内部类2.(3).匿名内部…...
【OSPF协议深度解析】从原理到企业级网络部署
目录 前言技术背景与价值当前技术痛点解决方案概述目标读者说明 一、技术原理剖析核心概念图解核心作用讲解关键技术模块说明技术选型对比 二、实战演示环境配置要求核心配置实现案例1:单区域基础配置案例2:多区域配置案例3:安全认证配置 运行…...
linux tar命令详解。压缩格式对比
1.压缩格式对比 压缩格式命令选项文件扩展名压缩率速度无压缩-cvf.tar无最快gzip-czvf.tar.gz中等较快bzip2-cjvf.tar.bz2较高较慢xz-cJvf.tar.xz最高最慢 9. 更多参考 【Linux基础】文件压缩tar命令指南tar压缩方式对比...
C++和Lua混和调用
为什么要C/C 流行的语言,学习人员多高性能,对于嵌入式设备则是省电大量的第三方库 为什么要Lua C缺点:编译慢,调试难,学习难度大Lua优点: 最快的脚本语言可以编译调试与C/C结合容易Lua是对性能有要求的必…...
Cadence高速系统设计流程及工具使用
上一章已经谈到,在Cadence的高速设计流程中,有两个重要的工具SigXP和Constrain Manager(CM约束管理器)。SigXP是仿真分析工具和约束生成工具,我们就是使用这个工具对关键信号进行仿真的。SI工程师通过对仿真结果的分析…...
Unity:AddTorque()(增加旋转力矩)
目录 什么是 AddTorque()? 第一性原理出发:什么是 Torque(力矩)? Torque 公式 Unity 中 AddTorque 的工作原理 参数属性 🔍 Linear Drag(线性阻力) 线性阻力模拟的现实情况&…...
嵌入式硬件设计全解析:从架构到实战
一、嵌入式硬件设计核心架构与系统组成 1. 处理器选型与架构设计 (1)处理器类型与应用场景 处理器类型 代表架构 / 型号 典型应用场景 核心优势 微控制器(MCU) ARM Cortex-M3/M4、STM32F 系列 低功耗控制、小型设备 集成外设、低功耗、低成本 微处…...
R7打卡——糖尿病预测模型优化探索
🍨 本文为🔗365天深度学习训练营中的学习记录博客 🍖 原作者:K同学啊 1.检查GPU import torch.nn as nn import torch.nn.functional as F import torchvision,torch# 设置硬件设备,如果有GPU则使用,没有…...
win10开了移动热点,手机无法连接,解决办法(chatgpt版)
提问: win10连着网线上网,有无线网卡intel Wireless-AC 9560网卡 可以用电脑开移动热点给手机连接吗?如何设置?我现在可以开热点,但是手机连不上,显示正在获取ip地址后就连不上了 chatgpt回答:…...
下载core5compat 模块时,被禁止,显示 - servese replied: Forbbidden. -->换镜像源
怎么解决? --->换镜像源 方法 1:使用命令行参数指定镜像源 在运行 Qt 安装器时,通过 --mirror 参数指定镜像源: # Windows qt-unified-windows-x64-online.exe --mirror https://mirrors.ustc.edu.cn/qtproject# Linux/macO…...
《MATLAB实战训练营:从入门到工业级应用》高阶挑战篇-《用无人机仿真玩转PID控制:MATLAB四旋翼仿真建模全攻略》
《MATLAB实战训练营:从入门到工业级应用》高阶挑战篇-✈️ 用无人机仿真玩转PID控制:MATLAB四旋翼仿真建模全攻略 🚁 欢迎来到这篇超级详细的MATLAB四旋翼无人机仿真教程!无论你是控制理论爱好者、无人机发烧友,还是M…...