提交 601e3713 编写于 作者: 道标 · 年's avatar 道标 · 年 🙂

Update game.cpp

上级 425ac817
/*
关于所有函数的解释
main12:主界面
main12:主界面
main: 一开始进入的主界面
board: 一些选项
其它的可以百度一下,都是英文(有些是拼音)
有重要的变量
option:通用选择
其它的可以百度一下,都是英文(有些是拼音)
有重要的变量
option:通用选择
游戏说明:
此游戏包含很多玩法
有迷宫,技能,等级制,战斗等等
可以自由去探索
可以自由去探索
*/
#include <bits/stdc++.h>
......@@ -23,22 +23,22 @@ option:通用选择
#include <conio.h>
using namespace std;
int main12();
int main12();
void start();
void board();
void maps();
void bag();//bug 可以先看一下,不知道出了什么问题
void equips();//装备 未完成
void skill_board();//技能板 未完成
void maps();
void bag();//bug 可以先看一下,不知道出了什么问题
void equips();//装备 未完成
void skill_board();//技能板 未完成
void lingdong();
void zhanchang();//未完成
void shenming();
void huo();
void bin();//未完成
void jin();//未完成
void shu();//未完成
void lu();//未完成
void equip_bag();//未完成
void zhanchang();//未完成
void shenming();
void huo();
void bin();//未完成
void jin();//未完成
void shu();//未完成
void lu();//未完成
void equip_bag();//未完成
int shanghai(double gong);
int jianshang(double fang);
int boss_shanghai(double gong);
......@@ -48,7 +48,7 @@ void eleven();
void twelve();
void thirteen();
void fourteen();
void fifteen();
void fifteen();
const int N=1e3+10;
int zhuangbei[N];
......@@ -57,71 +57,71 @@ int zhuangbei[N];
第二级:
荆棘护甲 熔岩拳套 流水灵甲 重金宝剑 土流盾
第三级:
木藤鞭 熔岩枪 水灵环 金剑
木藤鞭 熔岩枪 水灵环 金剑
*/
struct op{
struct op {
string name;
string lei;
string fangyu;
string gongji;
}equip_attributes[N];
} equip_attributes[N];
struct xh{
int cnn;
struct xh {
int cnn;
string bag;
}bags[N];
} bags[N];
struct xu{
struct xu {
int cnn;
string boxx;
}boxs[N];
} boxs[N];
bool jineng[100]={0,1}; //
bool jineng[100]= {0,1}; //
int grade=1;
int blood[101]={0,100};
int blood[101]= {0,100};
int experience[101];
string name;
int option,attribute,flag_box[N],flag_bag[N],exits,savage,times,attack[N],defense[N];
int jinyan;
int baoji=5;
int sum_level[101]={};
int sum_level[101]= {};
bool ops[N];
string head,body,trousers,shoes;
int main(){
int main() {
start();
pretreatment();
cout<<endl<<"请输入你所要的属性"<<endl;
cout<<endl<<"请输入你所要的属性"<<endl;
cout<<"1.金 2.木 3.水 4.火 5.土"<<endl;
cin>>attribute;
board();
cin>>option;
if(option==1){
if(option==1) {
maps();
if(exits==1){
if(exits==1) {
return 0;
}
main12();
}else if(option==2){
} else if(option==2) {
bag();
main12();
}else if(option==3){
} else if(option==3) {
box();
main12();
}else if(option==4){
} else if(option==4) {
equips();
main12();
}else if(option==5){
} else if(option==5) {
skill_board();
main12();
}
}
void start(){
void start() {
cout<<"Welcome to AXX";
cout<<endl;
cout<<"Please wait a moment"<<endl;
......@@ -130,183 +130,183 @@ void start(){
cin>>name;
}
void pretreatment(){
void pretreatment() {
int num=1;
for(int i=100;i<=10000;i+=100){
for(int i=100; i<=10000; i+=100) {
blood[num]=i;
experience[num]=i;
attack[num]=5+(i/100)*2;
defense[num]+=i/100;
num++;
}
for(int i=1;i<=100;i++){
for(int i=1; i<=100; i++) {
bags[i-1].cnn=i;
}
}
void board(){
void board() {
cout<<endl<<endl<<endl;
cout<<"姓名:"<<name<<endl;
cout<<"境界"<<endl; //暂不开放
cout<<"境界"<<endl; //暂不开放
cout<<"等级:"<<grade<<endl;
cout<<"血量:"<<blood[grade]<<endl;
cout<<"属性:";
if(attribute==1){
cout<<"金"<<endl;
}else if(attribute==2){
if(attribute==1) {
cout<<"金"<<endl;
} else if(attribute==2) {
cout<<"木"<<endl;
}else if(attribute==3){
cout<<"水"<<endl;
}else if(attribute==4){
cout<<"火"<<endl;
}else {
} else if(attribute==3) {
cout<<"水"<<endl;
} else if(attribute==4) {
cout<<"火"<<endl;
} else {
cout<<"土"<<endl;
}
cout<<"攻击:"<<attack[grade]<<endl;
cout<<"防御:"<<defense[grade]<<endl;
Sleep(1000);
cout<<"1.地图 "<<"2.背包 "<<"3.精灵箱(已删除) "<<"4.合成台 "<<"5.技能板 "<<endl;
cout<<"1.地图 "<<"2.背包 "<<"3.精灵箱(已删除) "<<"4.合成台 "<<"5.技能板 "<<endl;
}
void maps(){
void maps() {
cout<<"1.灵洞(难度高) "<<"2.战场(难度高) "<<"3.生命之树 "<<"4.流火之地 "<<"5.深海之地 "<<endl;
cout<<"6.铁金山 "<<"7.恶魔树林 "<<"8.阿努比斯的大陆沙漠 "<<"9.退出";
cin>>option;
if(option==1){
if(option==1) {
lingdong();
main12();
}else if(option==2){
} else if(option==2) {
zhanchang();
main12();
}else if(option==3){
} else if(option==3) {
shenming();
main12();
}else if(option==4){
} else if(option==4) {
huo();
main12();
}else if(option==5){
} else if(option==5) {
bin();
main12();
}else if(option==6){
} else if(option==6) {
jin();
main12();
}else if(option==7){
} else if(option==7) {
shu();
main12();
}else if(option==8){
} else if(option==8) {
lu();
main12();
}else{
} else {
exits=1;
}
}
}
void bag(){ //bug
void bag() { //bug
int sum=0;
for(int i=0;i<=20;i++){
for(int j=0;j<5;j++){
for(int i=0; i<=20; i++) {
for(int j=0; j<5; j++) {
if(!flag_bag[i])
cout<<bags[i].cnn<<":"<<bags[i].bag[j]<<" ";
}
cout<<bags[i].cnn<<":"<<bags[i].bag[j]<<" ";
}
cout<<endl;
}
cout<<endl;
cout<<"1.丢弃";
cin>>option;
if(option==1){
if(option==1) {
cout<<"请输入丢弃的序号";
cin>>option;
for(int i=0;i<100;i++){
if(option==bags[i].cnn){
for(int i=0; i<100; i++) {
if(option==bags[i].cnn) {
flag_bag[i]=1;
for(int j=i+1;j<100;j++){
for(int j=i+1; j<100; j++) {
bags[j].cnn--;
}
cout<<"丢弃成功";
cout<<"丢弃成功";
return;
}
}
}
}
void box(){
void box() {
int sum=0;
for(int i=0;i<20;i++){
for(int j=0;j<5;j++){
for(int i=0; i<20; i++) {
for(int j=0; j<5; j++) {
if(!flag_box[i])
cout<<boxs[i].cnn<<":"<<boxs[i].boxx[j]<<" ";
}
cout<<boxs[i].cnn<<":"<<boxs[i].boxx[j]<<" ";
}
cout<<endl;
}
cout<<endl;
cout<<"1.丢弃";
cin>>option;
if(option==1){
if(option==1) {
Sleep(1000);
cout<<"请输入丢弃的序号";
cin>>option;
for(int i=0;i<100;i++){
if(option==bags[i].cnn){
for(int i=0; i<100; i++) {
if(option==bags[i].cnn) {
flag_box[i]=1;
for(int j=i+1;j<100;j++){
for(int j=i+1; j<100; j++) {
bags[j].cnn--;
}
cout<<"丢弃成功";
cout<<"丢弃成功";
return;
}
}
}
}
}
int main12(){
if(grade==0){
int main12() {
if(grade==0) {
grade++;
}
if(jinyan>=experience[grade]){
if(jinyan>=experience[grade]) {
grade++;
jinyan-=experience[grade-1];
}
if(exits==1){
if(exits==1) {
return 0;
}
board();
cin>>option;
if(option==1){
if(option==1) {
maps();
system("cls");
if(exits==1){
if(exits==1) {
return 0;
}
main12();
}else if(option==2){
} else if(option==2) {
bag();
system("cls");
main12();
}else if(option==3){
} else if(option==3) {
box();
system("cls");
main12();
}else if(option==4){
} else if(option==4) {
equips();
system("cls");
main12();
}else if(option==5){
} else if(option==5) {
skill_board();
system("cls");
main12();
}
}
void lingdong(){
void lingdong() {
cout<<"欢迎来到灵洞"<<endl;
Sleep(1000);
cout<<"1.刷级(等级高) 2.泡温泉";
cin>>option;
if(option==1){
if(option==1) {
cout<<"你遇见了——"<<endl;
Sleep(1000);
savage=rand()%2;
if(savage==0){
if(savage==0) {
double x=rand()%(100-80+1)+80;
cout<<"碧水金睛兽"<<" "<<"等级:"<<x<<endl;
int tema=blood[grade];
......@@ -314,53 +314,53 @@ void lingdong(){
double temg=attack[grade]*1.5;
double temf=defense[grade]*1.5;
cout<<name<<"开始释放技能";
for(int i=1;i<=5;i++){
if(jineng[i]&&i==1){
for(int i=1; i<=5; i++) {
if(jineng[i]&&i==1) {
cout<<"火神术--"<<endl;
cout<<"焚毁!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0){
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1){
cout<<",你获得了碧水金睛兽一只";
}else{
cout<<",你获得了碧水珠";
if(n==1) {
cout<<",你获得了碧水金睛兽一只";
} else {
cout<<",你获得了碧水珠";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
}
}
int sum=0;
while(true){
while(true) {
int y1=boss_shanghai(x);
tema-=y1+jianshang(defense[grade]);
cout<<"碧水金睛兽打出了"<<y1<<"点伤害"<<endl;
Sleep(1000);
cout<<name<<"还剩"<<tema<<"滴血"<<endl;
Sleep(1000);
if(tema<=0){
if(tema<=0) {
cout<<"你落败了,等级-1"<<endl;
grade--;
grade--;
return;
}
for(int i=1;i<=5;i++){
if(jineng[i]&&i==1&&sum==5){
for(int i=1; i<=5; i++) {
if(jineng[i]&&i==1&&sum==5) {
cout<<"火神术--"<<endl;
cout<<"焚毁!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
cout<<"碧水金睛兽还剩"<<temb<<"滴血"<<endl;
if(temb<=0){
if(temb<=0) {
cout<<"你赢了"<<endl;
int n=rand()%10+1;
if(n==1){
if(n==1) {
cout<<",你获得了碧水金睛兽一只"<<endl;
//加坐骑的属性
}else{
cout<<",你获得了 碧水珠"<<endl;
//加坐骑的属性
} else {
cout<<",你获得了 碧水珠"<<endl;
}
jinyan+=(double)experience[(int)x]/10;
return;
......@@ -375,19 +375,19 @@ void lingdong(){
cout<<"碧水金睛兽还剩"<<temb<<"滴血";
Sleep(1000);
sum++;
if(temb<=0){
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1){
cout<<",你获得了碧水金睛兽一只";
}else{
cout<<",你获得了碧水珠";
if(n==1) {
cout<<",你获得了碧水金睛兽一只";
} else {
cout<<",你获得了碧水珠";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
}
}else if(savage==1){
} else if(savage==1) {
double x=rand()%(100-80+1)+80;
cout<<"太古龙象"<<" "<<"等级:"<<x<<endl;
int tema=blood[grade];
......@@ -395,56 +395,56 @@ void lingdong(){
double temg=attack[grade]*1.5;
double temf=defense[grade]*1.5;
cout<<name<<"开始释放技能";
for(int i=1;i<=5;i++){
if(jineng[i]&&i==1){
for(int i=1; i<=5; i++) {
if(jineng[i]&&i==1) {
cout<<"火神术--"<<endl;
cout<<"焚毁!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
cout<<"太古龙象还剩"<<temb<<"滴血"<<endl;
if(temb<=0){
if(temb<=0) {
cout<<"你赢了"<<endl;
int n=rand()%10+1;
if(n==1){
if(n==1) {
cout<<",你获得了太古龙象一只"<<endl;
//加坐骑的属性
}else{
cout<<",你获得了 龙象牙"<<endl;
//加坐骑的属性
} else {
cout<<",你获得了 龙象牙"<<endl;
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
}
}
}
int sum=0;
while(true){
while(true) {
int y1=boss_shanghai(x);
tema-=y1+jianshang((int)defense[grade]);
cout<<"太古龙象打出了"<<y1<<"点伤害"<<endl;
Sleep(1000);
cout<<name<<"还剩"<<tema<<"滴血"<<endl;
Sleep(1000);
if(tema<=0){
if(tema<=0) {
cout<<"你落败了,等级-1"<<endl;
grade--;
grade--;
return;
}
cout<<endl;
for(int i=1;i<=5;i++){
if(jineng[i]&&i==1&&sum==5){
for(int i=1; i<=5; i++) {
if(jineng[i]&&i==1&&sum==5) {
cout<<"火神术--"<<endl;
cout<<"焚毁!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
cout<<"太古龙象还剩"<<temb<<"滴血"<<endl;
if(temb<=0){
if(temb<=0) {
cout<<"你赢了"<<endl;
int n=rand()%10+1;
if(n==1){
if(n==1) {
cout<<",你获得了太古龙象一只"<<endl;
//加坐骑的属性
}else{
cout<<",你获得了 龙象牙"<<endl;
//加坐骑的属性
} else {
cout<<",你获得了 龙象牙"<<endl;
}
jinyan+=(double)experience[(int)x]/10;
return;
......@@ -457,14 +457,14 @@ void lingdong(){
Sleep(1000);
cout<<"太古龙象还剩"<<temb<<"滴血"<<endl;
Sleep(1000);
if(temb<=0){
if(temb<=0) {
cout<<"你赢了"<<endl;
int n=rand()%10+1;
if(n==1){
if(n==1) {
cout<<",你获得了太古龙象一只"<<endl;
//加坐骑的属性
}else{
cout<<",你获得了 龙象牙"<<endl;
//加坐骑的属性
} else {
cout<<",你获得了 龙象牙"<<endl;
}
jinyan+=(double)experience[(int)x]/10;
return;
......@@ -473,72 +473,72 @@ void lingdong(){
sum++;
}
}
}else if(option==2){
} else if(option==2) {
cout<<"请输入要泡的时间";
cin>>times;
for(int i=1;i<=times;i++){
for(int i=1; i<=times; i++) {
cout<<i<<" ";
Sleep(1000);
jinyan++;
}
cout << "你加了" <<times<<"点经验";
Sleep(1000);
}else{
} else {
return;
}
}
void equips(){
void equips() {
cout<<" 请问你要合成以下哪些装备呢? "<<endl;
}
void equip_bag(){
void equip_bag() {
cout<<" 暂时为空 ";
}
void skill_board(){
cout<<" 暂时为空 ";
}
void skill_board() {
cout<<" 暂时为空 ";
}
void zhanchang(){
cout<<" 删除 ";
void zhanchang() {
cout<<" 删除 ";
}
void huo(){
void huo() {
cout<<"流火之地"<<endl;
cout<<"这里是火神祝融坐化的地方"<<endl;
cout<<"1.下矿 2.探险";
cin>>option;
int exits1=0;
if(option==1){
while(!exits1){
if(option==1) {
while(!exits1) {
cout<<"挖矿中..."<<endl;
Sleep(3000);
int y=rand()%3+1;
if(y==1){
int y=rand()%3+1;
if(y==1) {
cout<<"恭喜你获得了 炎溶石 "<<endl;
}
y=rand()%50+1;
if(y==5){
if(y==5) {
cout<<"恭喜你找到了 火神传承 "<<endl;
grade++;
if(attribute==4){
if(attribute==4) {
cout<<"火神真迹 技能:焚毁"<<endl;
jineng[1]=1;
jineng[1]=1;
}
}
cout<<"恭喜你获得了 岩溶石 "<<endl;
}
cout<<"恭喜你获得了 岩溶石 "<<endl;
cout<<"1.继续 2.离开"<<endl;
cin>>option;
if(option==2){
if(option==2) {
exits1=1;
}
}
}else{
}
}
} else {
cout<<"你遇到了---"<<endl;
int n=rand()%1;
if(n==0){
if(n==0) {
double x=rand()%10;
cout<<"熔岩虫"<<" "<<"等级:"<<x<<endl;
int tema=blood[grade];
......@@ -546,50 +546,50 @@ void huo(){
double temg=5;
double temf=0;
cout<<name<<"开始释放技能";
Sleep(1000);
for(int i=1;i<=5;i++){
if(jineng[i]&&i==1){
Sleep(1000);
for(int i=1; i<=5; i++) {
if(jineng[i]&&i==1) {
cout<<"火神术--"<<endl;
Sleep(1000);
Sleep(1000);
cout<<"焚毁!"<<endl;
Sleep(1000);
Sleep(1000);
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
Sleep(1000);
Sleep(1000);
cout<<"熔岩虫还剩"<<temb<<"滴血"<<endl;
Sleep(1000);
if(temb<=0){
Sleep(1000);
if(temb<=0) {
cout<<"你赢了"<<endl;
cout<<"你获得了 熔岩宝石 "<<endl;
cout<<"你获得了 熔岩宝石 "<<endl;
jinyan+=(double)experience[(int)x]/10;
return;
}
}
}
}
}
int sum=0;
while(true){
while(true) {
int y1=shanghai(x);
tema-=y1+jianshang((int)defense[grade]);
cout<<"熔岩虫打出了"<<y1<<"点伤害"<<endl;
Sleep(1000);
cout<<name<<"还剩"<<tema<<"滴血"<<endl;
Sleep(1000);
if(tema<=0){
if(tema<=0) {
cout<<"你落败了,等级-1"<<endl;
grade--;
grade--;
return;
}
cout<<endl;
for(int i=1;i<=5;i++){
if(jineng[i]&&i==1&&sum==5){
for(int i=1; i<=5; i++) {
if(jineng[i]&&i==1&&sum==5) {
cout<<"火神术--"<<endl;
cout<<"焚毁!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
cout<<"熔岩虫还剩"<<temb<<"滴血"<<endl;
if(temb<=0){
if(temb<=0) {
cout<<"你赢了"<<endl;
cout<<"恭喜获鍀熔岩宝石";
cout<<"恭喜获鍀熔岩宝石";
jinyan+=(double)experience[(int)x]/10;
return;
}
......@@ -602,17 +602,17 @@ void huo(){
cout<<"熔岩虫还剩"<<temb<<"滴血"<<endl;
Sleep(1000);
sum++;
if(temb<=0){
if(temb<=0) {
cout<<"你赢了"<<endl;
cout<<"你获得了 熔岩宝石";
cout<<"你获得了 熔岩宝石";
jinyan+=(double)experience[(int)x]/10;
return;
}
return;
}
cout<<endl;
}
}else if(n==1){
} else if(n==1) {
int op2=rand()%3;
if(op2==0||op2==1){
if(op2==0||op2==1) {
double x=rand()%60+30;
cout<<"熔岩地龙"<<" "<<"等级:"<<x<<endl;
int tema=blood[grade];
......@@ -620,31 +620,31 @@ void huo(){
double temg=5;
double temf=1;
cout<<name<<"开始释放技能";
for(int i=1;i<=5;i++){
if(jineng[i]&&i==1){
for(int i=1; i<=5; i++) {
if(jineng[i]&&i==1) {
cout<<"火神术--"<<endl;
Sleep(1000);
Sleep(1000);
cout<<"焚毁!"<<endl;
Sleep(1000);
Sleep(1000);
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
Sleep(1000);
Sleep(1000);
cout<<"熔岩地龙还剩"<<temb<<"滴血"<<endl;
Sleep(1000);
if(temb<=0){
Sleep(1000);
if(temb<=0) {
cout<<"你赢了"<<endl;
int n=rand()%10+1;
if(n==1){
if(n==1) {
cout<<",你获得了 地龙之心 "<<endl;
}else{
cout<<",你获得了 熔炎宝石"<<endl;
} else {
cout<<",你获得了 熔炎宝石"<<endl;
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
}
}
}
while(true){
while(true) {
int sum=0;
int y1=shanghai(x);
tema-=y1+jianshang((int)defense[grade]);
......@@ -652,29 +652,29 @@ void huo(){
Sleep(1000);
cout<<name<<"还剩"<<tema<<"滴血"<<endl;
Sleep(1000);
if(tema<=0){
if(tema<=0) {
cout<<"你落败了,等级-1"<<endl;
grade--;
grade--;
return;
}
cout<<endl;
int y2=shanghai((int)attack[grade]);
temb-=y2+jianshang(temf);
for(int i=1;i<=5;i++){
if(jineng[i]&&i==1&&sum==5){
for(int i=1; i<=5; i++) {
if(jineng[i]&&i==1&&sum==5) {
cout<<"火神术--"<<endl;
cout<<"焚毁!"<<endl;
temb-=5*10+attack[grade];
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
cout<<"熔岩地龙还剩"<<temb<<"滴血"<<endl;
if(temb<=0){
if(temb<=0) {
cout<<"你赢了"<<endl;
int n=rand()%10+1;
if(n==1){
if(n==1) {
cout<<",你获得了地龙之心一只"<<endl;
//加坐骑的属性
}else{
cout<<",你获得了 熔岩宝石"<<endl;
//加坐骑的属性
} else {
cout<<",你获得了 熔岩宝石"<<endl;
}
jinyan+=(double)experience[(int)x]/10;
return;
......@@ -686,120 +686,195 @@ void huo(){
cout<<"熔岩地龙还剩"<<temb<<"滴血"<<endl;
Sleep(1000);
sum++;
if(temb<=0){
if(temb<=0) {
cout<<"你赢了"<<endl;
int n=rand()%10+1;
if(n==1){
if(n==1) {
cout<<",你获得了 地龙之心 "<<endl;
//加坐骑的属性
}else{
cout<<",你获得了 熔炎宝石"<<endl;
//加坐骑的属性
} else {
cout<<",你获得了 熔炎宝石"<<endl;
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
}
}
}
}
}
}
}
}
void bin(){
void bin() {
cout<<"";
}
void jin(){
cout<<"删除";
void jin() {
cout<<"删除";
}
void shu(){
void shu() {
cout<<"恶魔树林"<<endl;
cout<<"这里是恶魔居住的地方"<<endl;
cout<<"1.撸树 2.闲逛(与恶魔干架)";
cin>>option;
int exits1=0;
if(option==1){
while(!exits1){
if(option==1) {
while(!exits1) {
cout<<"撸树中..."<<endl;
Sleep(3000);
int y=rand()%5+1;
if(y==1){
int y=rand()%5+1;
if(y==1) {
cout<<"恭喜你获得了 藤条"<<endl;
}
y=rand()%10+1;
if(y==5){
if(y==5) {
cout<<"恭喜你惹怒了 树神 "<<endl;
grade++;
cout<<"但是树神早已被这里隐藏的恶魔折磨的虚弱不堪"<<endl;
Sleep(1000);
cout<<"他想让你干掉恶魔"<<endl;
Sleep(1000);
Sleep(1000);
cout<<"他需要你"<<endl;
Sleep(1000);
if(attribute==2){
Sleep(1000);
if(attribute==2) {
cout<<"因为你是木系"<<endl;
Sleep(1000);
cout << "所以你获得了树神的传承 千手顶上化佛"<<endl;
Sleep(1000);
jineng[2]=1;
Sleep(1000);
cout << "所以你获得了树神的传承 千手顶上化佛"<<endl;
Sleep(1000);
jineng[2]=1;
}
}
cout<<"恭喜你获得了 木头 "<<endl;
}
cout<<"恭喜你获得了 木头 "<<endl;
cout<<"1.继续 2.离开"<<endl;
cin>>option;
if(option==2){
if(option==2) {
exits1=1;
}
}
}
}
} else {
cout<<"你遇到了---"<<endl;
int n=rand()%1;
if(n==0) {
double x=rand()%10;
cout<<"树魔"<<" "<<"等级:"<<x<<endl;
int tema=blood[grade];
int temb=blood[(int)x];
double temg=5;
double temf=0;
cout<<name<<"开始释放技能";
Sleep(1000);
for(int i=1; i<=5; i++) {
if(jineng[i]&&i==1) {
cout<<"千手顶上化佛--"<<endl;
Sleep(1000);
cout<<"焚毁!"<<endl;
Sleep(1000);
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
Sleep(1000);
cout<<"树魔还剩"<<temb<<"滴血"<<endl;
Sleep(1000);
if(temb<=0) {
cout<<"你赢了"<<endl;
cout<<"你获得了 树魔心 "<<endl;
jinyan+=(double)experience[(int)x]/10;
return;
}
}
}
int sum=0;
while(true) {
int y1=shanghai(x);
tema-=y1+jianshang((int)defense[grade]);
cout<<"树魔打出了"<<y1<<"点伤害"<<endl;
Sleep(1000);
cout<<name<<"还剩"<<tema<<"滴血"<<endl;
Sleep(1000);
if(tema<=0) {
cout<<"你落败了,等级-1"<<endl;
grade--;
return;
}
cout<<endl;
for(int i=1; i<=5; i++) {
if(jineng[i]&&i==1&&sum==5) {
cout<<"千手顶上化佛--"<<endl;
cout<<"焚毁!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
cout<<"树魔还剩"<<temb<<"滴血"<<endl;
if(temb<=0) {
cout<<"你赢了"<<endl;
cout<<"恭喜获鍀树魔心";
jinyan+=(double)experience[(int)x]/10;
return;
}
}
}
int y2=shanghai((int)attack[grade]);
temb-=y2+jianshang(temf);
cout<<name<<"打出了"<<y2<<"点伤害"<<endl;
Sleep(1000);
cout<<"树魔还剩"<<temb<<"滴血"<<endl;
Sleep(1000);
sum++;
if(temb<=0) {
cout<<"你赢了"<<endl;
cout<<"你获得了 树魔心";
jinyan+=(double)experience[(int)x]/10;
return;
}
cout<<endl;
}
}
}
}
void lu(){
cout<<"删除";
void lu() {
cout<<"删除";
}
int shanghai(double gong){
int shanghai(double gong) {
int bao=0;
int n=ceil(10*((double)gong/100));
int op=rand()%100+1;
for(int i=1;i<=baoji;i++){
for(int i=1; i<=baoji; i++) {
ops[i]=1;
}
if(ops[op]){
if(ops[op]) {
return n*(rand()%3+1);
bao=1;
}else{
} else {
return n;
}
}
int jianshang(double fang){
int jianshang(double fang) {
return (double)fang/10;
}
int boss_shanghai(double gong){
int boss_shanghai(double gong) {
int bao=0;
int n=ceil(10*((double)gong/100));
int op=rand()%100+1;
for(int i=1;i<=baoji;i++){
for(int i=1; i<=baoji; i++) {
ops[i]=1;
}
if(ops[op]){
if(ops[op]) {
return n*(rand()%2+1);
bao=1;
}else{
} else {
return n;
}
}
void ten(){
void ten() {
cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
char a[10][10] =
{
char a[10][10] = {
{'#','#','#','#','#','#','#','#','#','#'},
{'#',' ',' ','#','#',' ','#','#',' ','@'},
{'#',' ','#',' ',' ',' ',' ','#',' ','#'},
......@@ -811,8 +886,8 @@ void ten(){
{'#','#',' ',' ',' ',' ','#','#',' ','#'},
{'#','#','#','#','#','#','#','#','#','#'},
};
for(int i = 0; i < 10; i++){
for(int j = 0; j < 10; j++){
for(int i = 0; i < 10; i++) {
for(int j = 0; j < 10; j++) {
cout << a[i][j] << " ";
}
cout << endl;
......@@ -820,37 +895,34 @@ void ten(){
char ch;
int x = 4, y = 1;
int q = 1, p = 9;
while(ch = getch()){
while(ch = getch()) {
system("cls");
cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
if(ch == 'w' && a[x - 1][y] != '#'){
if(ch == 'w' && a[x - 1][y] != '#') {
a[x][y] = ' ';
x--;
a[x][y] = 'O';
}
else if(ch == 's' && a[x + 1][y] != '#'){
} else if(ch == 's' && a[x + 1][y] != '#') {
a[x][y] = ' ';
x++;
a[x][y] = 'O';
}
else if(ch == 'a' && a[x][y - 1] != '#'){
} else if(ch == 'a' && a[x][y - 1] != '#') {
a[x][y] = ' ';
y--;
a[x][y] = 'O';
}
else if(ch == 'd' && a[x][y + 1] != '#'){
} else if(ch == 'd' && a[x][y + 1] != '#') {
a[x][y] = ' ';
y++;
a[x][y] = 'O';
}
for(int i = 0; i < 10; i++){
for(int j = 0; j < 10; j++){
for(int i = 0; i < 10; i++) {
for(int j = 0; j < 10; j++) {
cout << a[i][j] << " ";
}
cout << endl;
}
if(x == q && y == p){
if(x == q && y == p) {
cout << "win"<<endl;
cout<<"你将获得10点经验"<<endl;
jinyan+=10;
......@@ -858,10 +930,9 @@ void ten(){
}
}
}
void eleven(){
void eleven() {
cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
char a[11][11] =
{
char a[11][11] = {
{'#','#','#','#','#','#','#','#','#','#','#'},
{'#','O','#','#','#',' ','#','#','#','#','#'},
{'#',' ','#',' ','#','#','#','#',' ',' ',' '},
......@@ -874,8 +945,8 @@ void eleven(){
{'#','#','#',' ',' ',' ',' ',' ',' ','#','#'},
{'#','#','#','#','#','#','#','#','#','#','#'},
};
for(int i = 0; i < 11; i++){
for(int j = 0; j < 11; j++){
for(int i = 0; i < 11; i++) {
for(int j = 0; j < 11; j++) {
cout << a[i][j] << " ";
}
cout << endl;
......@@ -883,36 +954,33 @@ void eleven(){
char ch;
int x = 1, y = 1;
int q = 6, p = 10;
while(ch = getch()){
while(ch = getch()) {
system("cls");
cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
if(ch == 'w' && a[x - 1][y] != '#'){
if(ch == 'w' && a[x - 1][y] != '#') {
a[x][y] = ' ';
x--;
a[x][y] = 'O';
}
else if(ch == 's' && a[x + 1][y] != '#'){
} else if(ch == 's' && a[x + 1][y] != '#') {
a[x][y] = ' ';
x++;
a[x][y] = 'O';
}
else if(ch == 'a' && a[x][y - 1] != '#'){
} else if(ch == 'a' && a[x][y - 1] != '#') {
a[x][y] = ' ';
y--;
a[x][y] = 'O';
}
else if(ch == 'd' && a[x][y + 1] != '#'){
} else if(ch == 'd' && a[x][y + 1] != '#') {
a[x][y] = ' ';
y++;
a[x][y] = 'O';
}
for(int i = 0; i < 11; i++){
for(int j = 0; j < 11; j++){
for(int i = 0; i < 11; i++) {
for(int j = 0; j < 11; j++) {
cout << a[i][j] << " ";
}
cout << endl;
}
if(x == q && y == p){
if(x == q && y == p) {
cout << "win"<<endl;
cout<<"你将获得11点经验"<<endl;
jinyan+=11;
......@@ -920,10 +988,9 @@ void eleven(){
}
}
}
void twelve(){
void twelve() {
cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
char a[12][12] =
{
char a[12][12] = {
{'#','#','#','#','#','#','#','#','#','#','#','#'},
{'#',' ',' ',' ',' ','#','#','#','#','#','#','#'},
{'#','O','#','#',' ','#','#',' ','#','#',' ',' '},
......@@ -936,8 +1003,8 @@ void twelve(){
{'#',' ','#','#','#',' ',' ',' ',' ','#','#','#'},
{'#','#','#','#','#','#','#','#','#','#','#','#'},
};
for(int i = 0; i < 12; i++){
for(int j = 0; j < 12; j++){
for(int i = 0; i < 12; i++) {
for(int j = 0; j < 12; j++) {
cout << a[i][j] << " ";
}
cout << endl;
......@@ -945,36 +1012,33 @@ void twelve(){
char ch;
int x = 2, y = 1;
int q = 5, p = 11;
while(ch = getch()){
while(ch = getch()) {
system("cls");
cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
if(ch == 'w' && a[x - 1][y] != '#'){
if(ch == 'w' && a[x - 1][y] != '#') {
a[x][y] = ' ';
x--;
a[x][y] = 'O';
}
else if(ch == 's' && a[x + 1][y] != '#'){
} else if(ch == 's' && a[x + 1][y] != '#') {
a[x][y] = ' ';
x++;
a[x][y] = 'O';
}
else if(ch == 'a' && a[x][y - 1] != '#'){
} else if(ch == 'a' && a[x][y - 1] != '#') {
a[x][y] = ' ';
y--;
a[x][y] = 'O';
}
else if(ch == 'd' && a[x][y + 1] != '#'){
} else if(ch == 'd' && a[x][y + 1] != '#') {
a[x][y] = ' ';
y++;
a[x][y] = 'O';
}
for(int i = 0; i < 12; i++){
for(int j = 0; j < 12; j++){
for(int i = 0; i < 12; i++) {
for(int j = 0; j < 12; j++) {
cout << a[i][j] << " ";
}
cout << endl;
}
if(x == q && y == p){
if(x == q && y == p) {
cout << "win"<<endl;
cout<<"你将获得12点经验"<<endl;
jinyan+=12;
......@@ -982,10 +1046,9 @@ void twelve(){
}
}
}
void thirteen(){
void thirteen() {
cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
char a[13][13] =
{
char a[13][13] = {
{'#','#','#','#','#','#','#','#','#','#','#','#','#'},
{'#',' ','#',' ',' ',' ',' ',' ',' ',' ','#','#','#'},
{'#','O','#','#','#','#','#','#','#','#','#','#','#'},
......@@ -1000,8 +1063,8 @@ void thirteen(){
{'#',' ',' ',' ',' ',' ','#',' ',' ','#','#','#','#'},
{'#','#','#','#','#','#','#','#','#','#','#','#','#'},
};
for(int i = 0; i < 13; i++){
for(int j = 0; j < 13; j++){
for(int i = 0; i < 13; i++) {
for(int j = 0; j < 13; j++) {
cout << a[i][j] << " ";
}
cout << endl;
......@@ -1009,36 +1072,33 @@ void thirteen(){
char ch;
int x = 2, y = 1;
int q = 7, p = 12;
while(ch = getch()){
while(ch = getch()) {
system("cls");
cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
if(ch == 'w' && a[x - 1][y] != '#'){
if(ch == 'w' && a[x - 1][y] != '#') {
a[x][y] = ' ';
x--;
a[x][y] = 'O';
}
else if(ch == 's' && a[x + 1][y] != '#'){
} else if(ch == 's' && a[x + 1][y] != '#') {
a[x][y] = ' ';
x++;
a[x][y] = 'O';
}
else if(ch == 'a' && a[x][y - 1] != '#'){
} else if(ch == 'a' && a[x][y - 1] != '#') {
a[x][y] = ' ';
y--;
a[x][y] = 'O';
}
else if(ch == 'd' && a[x][y + 1] != '#'){
} else if(ch == 'd' && a[x][y + 1] != '#') {
a[x][y] = ' ';
y++;
a[x][y] = 'O';
}
for(int i = 0; i < 13; i++){
for(int j = 0; j < 13; j++){
for(int i = 0; i < 13; i++) {
for(int j = 0; j < 13; j++) {
cout << a[i][j] << " ";
}
cout << endl;
}
if(x == q && y == p){
if(x == q && y == p) {
cout << "win"<<endl;
cout<<"你将获得13点经验"<<endl;
jinyan+=13;
......@@ -1046,10 +1106,9 @@ void thirteen(){
}
}
}
void forteen(){
void forteen() {
cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
char a[14][14] =
{
char a[14][14] = {
{'#','#','#','#','#','#','#','#','#','#','#','#','#','#'},
{'#','#','#','#',' ',' ','#',' ',' ','#','#','#','#','#'},
{'#','O','#','#',' ','#','#','#','#','#',' ','#','#','#'},
......@@ -1065,8 +1124,8 @@ void forteen(){
{'#','#','#','#','#','#',' ',' ',' ','#','#','#','#','#'},
{'#','#','#','#','#','#','#','#','#','#','#','#','#','#'},
};
for(int i = 0; i < 14; i++){
for(int j = 0; j < 14; j++){
for(int i = 0; i < 14; i++) {
for(int j = 0; j < 14; j++) {
cout << a[i][j] << " ";
}
cout << endl;
......@@ -1074,36 +1133,33 @@ void forteen(){
char ch;
int x = 2, y = 1;
int q = 4, p = 13;
while(ch = getch()){
while(ch = getch()) {
system("cls");
cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
if(ch == 'w' && a[x - 1][y] != '#'){
if(ch == 'w' && a[x - 1][y] != '#') {
a[x][y] = ' ';
x--;
a[x][y] = 'O';
}
else if(ch == 's' && a[x + 1][y] != '#'){
} else if(ch == 's' && a[x + 1][y] != '#') {
a[x][y] = ' ';
x++;
a[x][y] = 'O';
}
else if(ch == 'a' && a[x][y - 1] != '#'){
} else if(ch == 'a' && a[x][y - 1] != '#') {
a[x][y] = ' ';
y--;
a[x][y] = 'O';
}
else if(ch == 'd' && a[x][y + 1] != '#'){
} else if(ch == 'd' && a[x][y + 1] != '#') {
a[x][y] = ' ';
y++;
a[x][y] = 'O';
}
for(int i = 0; i < 14; i++){
for(int j = 0; j < 14; j++){
for(int i = 0; i < 14; i++) {
for(int j = 0; j < 14; j++) {
cout << a[i][j] << " ";
}
cout << endl;
}
if(x == q && y == p){
if(x == q && y == p) {
cout << "win"<<endl;
cout<<"你将获得14点经验"<<endl;
jinyan+=14;
......@@ -1112,23 +1168,19 @@ void forteen(){
}
}
void shenming(){
void shenming() {
int n;
cout << "请输入你想要的级别 1 ~ 5" << endl;
cin >> n;
if(n == 1){
if(n == 1) {
ten();
}
else if(n == 2){
} else if(n == 2) {
eleven();
}
else if(n == 3){
} else if(n == 3) {
twelve();
}
else if(n == 4){
} else if(n == 4) {
thirteen();
}
else if(n == 5){
} else if(n == 5) {
forteen();
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册