提交 8af2a9fe 编写于 作者: struct_cym's avatar struct_cym

Add new file

上级 f9de157a
/*
关于所有函数的解释
main12:主界面
main: 一开始进入的主界面
board: 一些选项
其它的可以百度一下,都是英文(有些是拼音)
有重要的变量
option:通用选择
游戏说明:
此游戏包含很多玩法
有迷宫,技能,等级制,战斗等等
可以自由去探索
*/
#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <time.h>
#include <windows.h>
#include <conio.h>
using namespace std;
int main12();
void start();
void 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();//未完成
int shanghai(double gong);
int jianshang(double fang);
int boss_shanghai(double gong);
void pretreatment();
void ten();
void eleven();
void twelve();
void thirteen();
void fourteen();
void fifteen();
void zhuxian1();
void x(const string f);
const int N=1e3+10;
int zhuangbei[N];
/*
最高级 神的庇护
第二级:
荆棘护甲 熔岩拳套 流水灵甲 重金宝剑 土流盾
第三级:
木藤鞭 熔岩枪 水灵环 金剑
*/
struct op {
string name;
string lei;
string fangyu;
string gongji;
} equip_attributes[N];
struct xh {
int cnn;
string bag;
} bags[N];
struct xu {
int cnn;
string boxx;
} boxs[N];
bool jineng[100]= {0,1,0,0,0,0,0}; //
int grade=1;
int blood[101]= {0,100};
int experience[101];
string name;
int option,attribute[5],attributes,flag_box[N],flag_bag[N],exits,savage,times,attack[N],defense[N];
int jinyan;
int baoji=5;
int sum_level[101]= {};
bool ops[N];
string head,body,trousers,shoes;
int zhuxiansum=1;
int shushen;
string shengfen;
void x(const string f) {
size_t len = f.size();
for(int i = 0; i < f.size(); i++) {
cout << f[i];
usleep(30000);
}
cout << endl;
}
int fang(string shengfen) {
if(shengfen[0] == '#') {
return 1;
}
int year = 0;
int a1 = (shengfen[6] - '0') * 1000;
int a2 = (shengfen[7] - '0') * 100;
int a3 = (shengfen[8] - '0') * 10;
int s4 = (shengfen[9] - '0') * 1;
year = a1 + a2 + a3 + s4;
cout << "你出生在:" << year << endl;
int len = 2021 - year;
cout << "你现在:" << len << endl;
if(len < 18) {
return 0;
}
return 1;
}
void zhuxian() {
x("注意:第一关和第二关是制作人本人为boss哦!");
x("第一关,制作人-struct_cym");
x("今天,你来到了求(狗)真(屎)六班");
x("一位长得猥琐的plain and confident boy站在门口,这就是lszyym(道标-愚公的外号)");
if(xingbie=='girl') {
x("因为你是女生,所以这个猥琐男直接扑了过来,你下意识的扇了一巴掌过去");
x("但是这个猥琐男并没有气馁,堆满笑容的凑了过来");
x("毕竟是个plain and confident boy");
}
}
int main() {
cout << "为了反映国家号召, 本游开设未成年人反沉迷系统, 请输入身份证号码" << endl;
cin >> shengfen;
if(!fang(shengfen)) {
cout << "未成年人, 禁止进入" << endl;
return 0;
}
start();
pretreatment();
cout<<endl<<"请输入你所要的属性"<<endl;
cout<<"1.金 2.木 3.水 4.火 5.土"<<endl;
cin>>attributes;
attribute[attributes]=1;
board();
cin>>option;
if(option==1) {
maps();
if(exits==1) {
return 0;
}
main12();
} else if(option==2) {
bag();
main12();
} else if(option==3) {
cout<<"已删除" <<endl;
main12();
} else if(option==4) {
equips();
main12();
} else if(option==5) {
skill_board();
main12();
}
}
void start() {
cout<<"Welcome to AXX";
cout<<endl;
cout<<"Please wait a moment"<<endl;
Sleep(1);
cout<<"请输入你的名字"<<endl;
cin>>name;
}
void pretreatment() {
int num=1;
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++;
}
}
void board() {
cout<<endl<<endl<<endl;
cout<<"姓名:"<<name<<endl;
cout<<"境界"<<endl; //暂不开放
cout<<"等级:"<<grade<<endl;
cout<<"血量:"<<blood[grade]<<endl;
cout<<"属性:";
if(attribute[1]==1) {
cout<<"金"<<" ";
}
if(attribute[2]==1) {
cout<<"木"<<" ";
}
if(attribute[3]==1) {
cout<<"水"<<" ";
}
if(attribute[4]==1) {
cout<<"火"<<" ";
}
if(attribute[5]==1) {
cout<<"土"<<" ";
}
cout<<endl;
cout<<"攻击:"<<attack[grade]<<endl;
cout<<"防御:"<<defense[grade]<<endl;
Sleep(1);
cout<<"1.地图 "<<"2.背包 "<<"3.精灵箱(已删除) "<<"4.合成台 "<<"5.技能板 "<<endl;
}
void maps() {
cout<<"1.灵洞(难度高) "<<"2.战场(难度高) "<<"3.生命之树 "<<"4.流火之地 "<<"5.深海之地 "<<endl;
cout<<"6.铁金山 "<<"7.恶魔树林 "<<"8.阿努比斯的大陆沙漠 "<<"9.退出";
cin>>option;
if(option==1) {
lingdong();
main12();
} else if(option==2) {
zhanchang();
main12();
} else if(option==3) {
shenming();
main12();
} else if(option==4) {
huo();
main12();
} else if(option==5) {
bin();
main12();
} else if(option==6) {
jin();
main12();
} else if(option==7) {
shu();
main12();
} else if(option==8) {
lu();
main12();
} else if(option == 9) {
exits=1;
}
}
void bag() { //bug
int sum=0;
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<<endl;
}
cout<<endl;
cout<<"1.丢弃";
cin>>option;
if(option==1) {
cout<<"请输入丢弃的序号";
cin>>option;
for(int i=0; i<100; i++) {
if(option==bags[i].cnn) {
flag_bag[i]=1;
for(int j=i+1; j<100; j++) {
bags[j].cnn--;
}
cout<<"丢弃成功";
return;
}
}
}
}
void box() {
int sum=0;
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<<endl;
}
cout<<endl;
cout<<"1.丢弃";
cin>>option;
if(option==1) {
Sleep(1);
cout<<"请输入丢弃的序号";
cin>>option;
for(int i=0; i<100; i++) {
if(option==bags[i].cnn) {
flag_box[i]=1;
for(int j=i+1; j<100; j++) {
bags[j].cnn--;
}
cout<<"丢弃成功";
return;
}
}
}
}
int main12() {
if(grade==0) {
grade++;
}
while(jinyan>=experience[grade]&&grade<100) {
grade++;
jinyan-=experience[grade-1];
}
if(exits==1) {
return 0;
}
board();
cin>>option;
if(option==1) {
maps();
system("cls");
if(exits==1) {
return 0;
}
main12();
} else if(option==2) {
bag();
system("cls");
main12();
} else if(option==3) {
box();
system("cls");
main12();
} else if(option==4) {
equips();
system("cls");
main12();
} else if(option==5) {
skill_board();
system("cls");
main12();
} else {
main12();
}
}
void lingdong() {
cout<<"欢迎来到灵洞"<<endl;
Sleep(1);
cout<<"1.刷级(等级高) 2.泡温泉";
cin>>option;
if(option==1) {
cout<<"你遇见了——"<<endl;
Sleep(1);
savage=rand()%2;
if(savage==0) {
double x=rand()%(100-80+1)+80;
cout<<"碧水金睛兽"<<" "<<"等级:"<<x<<endl;
int tema=blood[grade];
int temb=blood[(int)x];
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) {
cout<<"火神术--"<<endl;
cout<<"焚毁!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了碧水金睛兽一只";
} else {
cout<<",你获得了碧水珠";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==2) {
cout<<"木神术--"<<endl;
cout<<"千手顶上化佛!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了碧水金睛兽一只";
} else {
cout<<",你获得了碧水珠";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==3) {
cout<<"水神术--"<<endl;
cout<<"水乱波!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了碧水金睛兽一只";
} else {
cout<<",你获得了碧水珠";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==4) {
cout<<"土神术--"<<endl;
cout<<"土淹!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了碧水金睛兽一只";
} else {
cout<<",你获得了碧水珠";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==5) {
cout<<"金神术--"<<endl;
cout<<"金光剑!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了碧水金睛兽一只";
} else {
cout<<",你获得了碧水珠";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
}
int sum=0;
while(true) {
int y1=boss_shanghai(x);
tema-=y1+jianshang(defense[grade]);
cout<<"碧水金睛兽打出了"<<y1<<"点伤害"<<endl;
Sleep(1);
cout<<name<<"还剩"<<tema<<"滴血"<<endl;
Sleep(1);
if(tema<=0) {
cout<<"你落败了,等级-1"<<endl;
grade--;
return;
}
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) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了碧水金睛兽一只";
} else {
cout<<",你获得了碧水珠";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==2) {
cout<<"木神术--"<<endl;
cout<<"千手顶上化佛!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了碧水金睛兽一只";
} else {
cout<<",你获得了碧水珠";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==3) {
cout<<"水神术--"<<endl;
cout<<"水乱波!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了碧水金睛兽一只";
} else {
cout<<",你获得了碧水珠";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==4) {
cout<<"土神术--"<<endl;
cout<<"土淹!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了碧水金睛兽一只";
} else {
cout<<",你获得了碧水珠";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==5) {
cout<<"金神术--"<<endl;
cout<<"金光剑!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了碧水金睛兽一只";
} else {
cout<<",你获得了碧水珠";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
}
int y2=shanghai(attack[grade]);
temb-=y2;
temb+=jianshang(temf);
cout<<name<<"打出了"<<y2<<"点伤害"<<endl;
Sleep(1);
cout<<"碧水金睛兽还剩"<<temb<<"滴血";
Sleep(1);
sum++;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了碧水金睛兽一只";
} else {
cout<<",你获得了碧水珠";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
} else if(savage==1) {
double x=rand()%(100-80+1)+80;
cout<<"太古龙象"<<" "<<"等级:"<<x<<endl;
int tema=blood[grade];
int temb=blood[(int)x];
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) {
cout<<"火神术--"<<endl;
cout<<"焚毁!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了太古龙象一只";
} else {
cout<<",你获得了 龙象牙";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==2) {
cout<<"木神术--"<<endl;
cout<<"千手顶上化佛!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了太古龙象一只";
} else {
cout<<",你获得了 龙象牙";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==3) {
cout<<"水神术--"<<endl;
cout<<"水乱波!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了太古龙象一只";
} else {
cout<<",你获得了 龙象牙";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==4) {
cout<<"土神术--"<<endl;
cout<<"土淹!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了太古龙象一只";
} else {
cout<<",你获得了 龙象牙";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==5) {
cout<<"金神术--"<<endl;
cout<<"金光剑!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了太古龙象一只";
} else {
cout<<",你获得了 龙象牙";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
}
int sum=0;
while(true) {
int y1=boss_shanghai(x);
tema-=y1+jianshang((int)defense[grade]);
cout<<"太古龙象打出了"<<y1<<"点伤害"<<endl;
Sleep(1);
cout<<name<<"还剩"<<tema<<"滴血"<<endl;
Sleep(1);
if(tema<=0) {
cout<<"你落败了,等级-1"<<endl;
grade--;
return;
}
cout<<endl;
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) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了太古龙象一只";
} else {
cout<<",你获得了 龙象牙";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==2) {
cout<<"木神术--"<<endl;
cout<<"千手顶上化佛!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了太古龙象一只";
} else {
cout<<",你获得了 龙象牙";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==3) {
cout<<"水神术--"<<endl;
cout<<"水乱波!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了太古龙象一只";
} else {
cout<<",你获得了 龙象牙";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==4) {
cout<<"土神术--"<<endl;
cout<<"土淹!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了太古龙象一只";
} else {
cout<<",你获得了 龙象牙";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==5) {
cout<<"金神术--"<<endl;
cout<<"金光剑!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了太古龙象一只";
} else {
cout<<",你获得了 龙象牙";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
}
int y2=shanghai((int)attack[grade]);
temb-=y2+jianshang(temf);
cout<<name<<"打出了"<<y2<<"点伤害"<<endl;
Sleep(1);
cout<<"太古龙象还剩"<<temb<<"滴血"<<endl;
Sleep(1);
if(temb<=0) {
cout<<"你赢了"<<endl;
int n=rand()%10+1;
if(n==1) {
cout<<",你获得了太古龙象一只"<<endl;
//加坐骑的属性
} else {
cout<<",你获得了 龙象牙"<<endl;
}
jinyan+=(double)experience[(int)x]/10;
return;
}
cout<<endl;
sum++;
}
}
} else if(option==2) {
cout<<"请输入要泡的时间";
cin>>times;
for(int i=1; i<=times; i++) {
cout<<i<<" ";
// Sleep(1);
jinyan++;
}
cout << "你加了" <<times<<"点经验";
// Sleep(1);
} else {
return;
}
}
void equips() {
cout<<" 请问你要合成以下哪些装备呢? "<<endl;
}
void equip_bag() {
cout<<" 暂时为空 ";
}
void skill_board() {
cout<<" 暂时为空 ";
}
void zhanchang() {
cout<<" 删除 ";
}
void huo() {
cout<<"流火之地"<<endl;
cout<<"这里是火神祝融坐化的地方"<<endl;
cout<<"1.下矿 2.探险";
cin>>option;
int exits1=0;
if(option==1) {
while(!exits1) {
cout<<"挖矿中..."<<endl;
Sleep(3000);
int y=rand()%3+1;
if(y==1) {
cout<<"恭喜你获得了 炎溶石 "<<endl;
}
y=rand()%50+1;
if(y==5) {
cout<<"恭喜你找到了 火神传承 "<<endl;
grade++;
if(attribute[4]==4) {
cout<<"火神真迹 技能:焚毁"<<endl;
jineng[1]=1;
}
}
cout<<"恭喜你获得了 岩溶石 "<<endl;
cout<<"1.继续 2.离开"<<endl;
cin>>option;
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(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) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了熔岩虫一只";
} else {
cout<<",你获得了熔岩宝石";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==2) {
cout<<"木神术--"<<endl;
cout<<"千手顶上化佛!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了熔岩虫一只";
} else {
cout<<",你获得了熔岩宝石";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==3) {
cout<<"水神术--"<<endl;
cout<<"水乱波!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了熔岩虫一只";
} else {
cout<<",你获得了熔岩宝石";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==4) {
cout<<"土神术--"<<endl;
cout<<"土淹!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了熔岩虫一只";
} else {
cout<<",你获得了熔岩宝石";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==5) {
cout<<"金神术--"<<endl;
cout<<"金光剑!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了熔岩虫一只";
} else {
cout<<",你获得了熔岩宝石";
}
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(1);
cout<<name<<"还剩"<<tema<<"滴血"<<endl;
Sleep(1);
if(tema<=0) {
cout<<"你落败了,等级-1"<<endl;
grade--;
return;
}
cout<<endl;
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) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了熔岩虫一只";
} else {
cout<<",你获得了熔岩宝石";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==2) {
cout<<"木神术--"<<endl;
cout<<"千手顶上化佛!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了熔岩虫一只";
} else {
cout<<",你获得了熔岩宝石";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==3) {
cout<<"水神术--"<<endl;
cout<<"水乱波!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了熔岩虫一只";
} else {
cout<<",你获得了熔岩宝石";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==4) {
cout<<"土神术--"<<endl;
cout<<"土淹!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了熔岩虫一只";
} else {
cout<<",你获得了熔岩宝石";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==5) {
cout<<"金神术--"<<endl;
cout<<"金光剑!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了熔岩虫一只";
} else {
cout<<",你获得了熔岩宝石";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
}
int y2=shanghai((int)attack[grade]);
temb-=y2+jianshang(temf);
cout<<name<<"打出了"<<y2<<"点伤害"<<endl;
Sleep(1);
cout<<"熔岩虫还剩"<<temb<<"滴血"<<endl;
Sleep(1);
sum++;
if(temb<=0) {
cout<<"你赢了"<<endl;
cout<<"你获得了 熔岩宝石";
jinyan+=(double)experience[(int)x]/10;
return;
}
cout<<endl;
}
} else if(n==1) {
int op2=rand()%3;
if(op2==0||op2==1) {
double x=rand()%60+30;
cout<<"熔岩地龙"<<" "<<"等级:"<<x<<endl;
int tema=blood[grade];
int temb=blood[(int)x];
double temg=5;
double temf=1;
cout<<name<<"开始释放技能";
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) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了熔岩地龙一只";
} else {
cout<<",你获得了熔岩宝石";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==2) {
cout<<"木神术--"<<endl;
cout<<"千手顶上化佛!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了熔岩地龙一只";
} else {
cout<<",你获得了熔岩宝石";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==3) {
cout<<"水神术--"<<endl;
cout<<"水乱波!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了熔岩地龙一只";
} else {
cout<<",你获得了熔岩宝石";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==4) {
cout<<"土神术--"<<endl;
cout<<"土淹!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了一只";
} else {
cout<<",你获得了熔岩宝石";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==5) {
cout<<"金神术--"<<endl;
cout<<"金光剑!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了熔岩地龙一只";
} else {
cout<<",你获得了熔岩宝石";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
}
while(true) {
int sum=0;
int y1=shanghai(x);
tema-=y1+jianshang((int)defense[grade]);
cout<<"熔岩地龙打出了"<<y1<<"点伤害"<<endl;
Sleep(1);
cout<<name<<"还剩"<<tema<<"滴血"<<endl;
Sleep(1);
if(tema<=0) {
cout<<"你落败了,等级-1"<<endl;
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) {
cout<<"火神术--"<<endl;
cout<<"焚毁!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了熔岩地龙一只";
} else {
cout<<",你获得了熔岩宝石";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==2) {
cout<<"木神术--"<<endl;
cout<<"千手顶上化佛!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了熔岩地龙一只";
} else {
cout<<",你获得了熔岩宝石";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==3) {
cout<<"水神术--"<<endl;
cout<<"水乱波!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了熔岩地龙一只";
} else {
cout<<",你获得了熔岩宝石";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==4) {
cout<<"土神术--"<<endl;
cout<<"土淹!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了熔岩地龙一只";
} else {
cout<<",你获得了熔岩宝石";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==5) {
cout<<"金神术--"<<endl;
cout<<"金光剑!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了熔岩地龙一只";
} else {
cout<<",你获得了熔岩宝石";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
}
cout<<name<<"打出了"<<y2<<"点伤害"<<endl;
Sleep(1);
cout<<"熔岩地龙还剩"<<temb<<"滴血"<<endl;
Sleep(1);
sum++;
if(temb<=0) {
cout<<"你赢了"<<endl;
int n=rand()%10+1;
if(n==1) {
cout<<",你获得了 地龙之心 "<<endl;
//加坐骑的属性
} else {
cout<<",你获得了 熔炎宝石"<<endl;
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
}
}
}
}
void bin() {
cout<<"";
}
void jin() {
cout<<"删除";
}
void shu() {
cout<<"恶魔树林"<<endl;
cout<<"这里是恶魔居住的地方"<<endl;
if(shushen==1) {
cout<<"树神:你竟然还敢回来?!"<<endl;
cout<<"你被迫降了3级"<<endl;
if(grade>3) {
grade-=3;
} else {
grade=1;
}
shushen=0;
}
cout<<"1.撸树 2.闲逛(与恶魔干架)";
cin>>option;
int exits1=0;
if(option==1) {
while(!exits1) {
cout<<"撸树中..."<<endl;
Sleep(3000);
int y=rand()%5+1;
if(y==1) {
cout<<"恭喜你获得了 藤条"<<endl;
}
y=rand()%10+1;
if(y==5) {
cout<<"恭喜你惹怒了 树神 "<<endl;
grade++;
cout<<"但是树神早已被这里隐藏的恶魔折磨的虚弱不堪"<<endl;
Sleep(1);
cout<<"他想让你干掉恶魔"<<endl;
Sleep(1);
cout<<"他需要你"<<endl;
Sleep(1);
if(attribute[4]==2) {
cout<<"因为你是木系"<<endl;
Sleep(1);
cout << "所以你获得了树神的传承 千手顶上化佛"<<endl;
Sleep(1);
jineng[2]=1;
} else {
cout<<"但是因为你不是木系"<<endl;
Sleep(1);
}
cout<<"所以树神命令你干掉恶魔"<<endl;
Sleep(1);
cout<<"(你将要遇到的树魔是最高等级的boss)"<<endl;
Sleep(1);
cout<<"你是否要逃跑"<<endl;
Sleep(1);
cout<<"1.逃跑 2.加把油,干掉他"<<endl;
Sleep(1);
cin>>option;
if(option==1) {
cout<<"你成功逃跑"<<endl;
Sleep(1);
cout<<"但是树神很生气"<<endl;
Sleep(1);
shushen=1;
main12();
} else {
cout<<"树神开心的笑了"<<endl;
Sleep(1);
cout<<"它很赞赏你的勇气"<<endl;
Sleep(1);
cout<<"你遇到了---"<<endl;
Sleep(1);
cout<<"树魔神"<<" "<<"等级:"<<"神阶满级"<<endl;
Sleep(1);
cout<<endl<<endl;
cout<<"树神面色剧变"<<endl;
Sleep(1);
cout<<"它已经决定让你成为继承人了 它不能让你死"<<endl;
Sleep(1);
cout<<"树神"<<endl;
Sleep(1);
cout<<"开始释放技能"<<endl;
Sleep(1);
cout<<"神阶·千手顶上化佛"<<endl;
Sleep(1);
cout<<"树魔神已被击败"<<endl;
Sleep(1);
cout<<"可是树神已经奄奄一息 它已早不是神阶 这个技能耗费掉了它所有的生命"<<endl;
Sleep(1);
if(attribute[2]!=1) {
cout<<"树神:我的余力已经不足以培养你了"<<endl;
Sleep(1);
cout<<"我余下的力量可赋予你的就只有这些了"<<endl;
Sleep(1);
cout<<"恭喜你的属性变为双属性"<<endl;
Sleep(1);
cout<<"恭喜你获得技能"<<" "<<"千手顶上化佛"<<endl;
Sleep(1);
grade++;
attribute[2]=1;
jineng[2]=1;
}
main12();
}
}
cout<<"恭喜你获得了 木头 "<<endl;
cout<<"1.继续 2.离开"<<endl;
cin>>option;
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(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) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了树魔一只";
} else {
cout<<",你获得了树心";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==2) {
cout<<"木神术--"<<endl;
cout<<"千手顶上化佛!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了树魔一只";
} else {
cout<<",你获得了树心";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==3) {
cout<<"水神术--"<<endl;
cout<<"水乱波!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了树魔一只";
} else {
cout<<",你获得了树心";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==4) {
cout<<"土神术--"<<endl;
cout<<"土淹!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了树魔一只";
} else {
cout<<",你获得了树心";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==5) {
cout<<"金神术--"<<endl;
cout<<"金光剑!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了树魔一只";
} else {
cout<<",你获得了树心";
}
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(1);
cout<<name<<"还剩"<<tema<<"滴血"<<endl;
Sleep(1);
if(tema<=0) {
cout<<"你落败了,等级-1"<<endl;
grade--;
return;
}
cout<<endl;
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) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了树魔一只";
} else {
cout<<",你获得了树心";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==2) {
cout<<"木神术--"<<endl;
cout<<"千手顶上化佛!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了树魔一只";
} else {
cout<<",你获得了树心";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==3) {
cout<<"水神术--"<<endl;
cout<<"水乱波!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了树魔一只";
} else {
cout<<",你获得了树心";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==4) {
cout<<"土神术--"<<endl;
cout<<"土淹!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了树魔一只";
} else {
cout<<",你获得了树心";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
if(jineng[i]&&i==5) {
cout<<"金神术--"<<endl;
cout<<"金光剑!"<<endl;
temb-=5*10+attack[grade];
cout<<name<<"打出了"<<5*10+attack[grade]<<"点伤害"<<endl;
if(temb<=0) {
cout<<"你赢了";
int n=rand()%20+1;
if(n==1) {
cout<<",你获得了树魔一只";
} else {
cout<<",你获得了树心";
}
jinyan+=(double)experience[(int)x]/10;
return;
}
}
}
int y2=shanghai((int)attack[grade]);
temb-=y2+jianshang(temf);
cout<<name<<"打出了"<<y2<<"点伤害"<<endl;
Sleep(1);
cout<<"树魔还剩"<<temb<<"滴血"<<endl;
Sleep(1);
sum++;
if(temb<=0) {
cout<<"你赢了"<<endl;
cout<<"你获得了 树魔心";
jinyan+=(double)experience[(int)x]/10;
return;
}
cout<<endl;
}
}
}
}
void lu() {
cout<<"删除";
}
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++) {
ops[i]=1;
}
if(ops[op]) {
return n*(rand()%3+1);
bao=1;
} else {
return n;
}
}
int jianshang(double fang) {
return (double)fang/10;
}
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++) {
ops[i]=1;
}
if(ops[op]) {
return n*(rand()%2+1);
bao=1;
} else {
return n;
}
}
void ten() {
cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
char a[10][10] = {
{'#','#','#','#','#','#','#','#','#','#'},
{'#',' ',' ','#','#',' ','#','#',' ','@'},
{'#',' ','#',' ',' ',' ',' ','#',' ','#'},
{'#',' ',' ',' ','#','#',' ','#',' ','#'},
{'#','O',' ','#','#',' ',' ','#',' ','#'},
{'#',' ','#',' ',' ','#',' ',' ',' ','#'},
{'#',' ','#',' ',' ','#',' ','#',' ','#'},
{'#',' ',' ','#','#',' ',' ',' ',' ','#'},
{'#','#',' ',' ',' ',' ','#','#',' ','#'},
{'#','#','#','#','#','#','#','#','#','#'},
};
for(int i = 0; i < 10; i++) {
for(int j = 0; j < 10; j++) {
cout << a[i][j] << " ";
}
cout << endl;
}
char ch;
int x = 4, y = 1;
int q = 1, p = 9;
while(ch = getch()) {
system("cls");
cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
if(ch == 'w' && a[x - 1][y] != '#') {
a[x][y] = ' ';
x--;
a[x][y] = 'O';
} else if(ch == 's' && a[x + 1][y] != '#') {
a[x][y] = ' ';
x++;
a[x][y] = 'O';
} else if(ch == 'a' && a[x][y - 1] != '#') {
a[x][y] = ' ';
y--;
a[x][y] = 'O';
} 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++) {
cout << a[i][j] << " ";
}
cout << endl;
}
if(x == q && y == p) {
cout << "win"<<endl;
cout<<"你将获得10点经验"<<endl;
jinyan+=10;
break;
}
}
}
void eleven() {
cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
char a[11][11] = {
{'#','#','#','#','#','#','#','#','#','#','#'},
{'#','O','#','#','#',' ','#','#','#','#','#'},
{'#',' ','#',' ','#','#','#','#',' ',' ',' '},
{'#',' ','#',' ','#',' ','#','#',' ','#',' '},
{'#',' ','#',' ',' ',' ','#','#',' ','#',' '},
{'#',' ',' ',' ','#',' ','#','#',' ','#',' '},
{'#',' ','#','#','#',' ','#',' ',' ','#','@'},
{'#',' ','#','#','#',' ','#','#',' ','#',' '},
{'#',' ',' ',' ','#',' ','#','#',' ','#','#'},
{'#','#','#',' ',' ',' ',' ',' ',' ','#','#'},
{'#','#','#','#','#','#','#','#','#','#','#'},
};
for(int i = 0; i < 11; i++) {
for(int j = 0; j < 11; j++) {
cout << a[i][j] << " ";
}
cout << endl;
}
char ch;
int x = 1, y = 1;
int q = 6, p = 10;
while(ch = getch()) {
system("cls");
cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
if(ch == 'w' && a[x - 1][y] != '#') {
a[x][y] = ' ';
x--;
a[x][y] = 'O';
} else if(ch == 's' && a[x + 1][y] != '#') {
a[x][y] = ' ';
x++;
a[x][y] = 'O';
} else if(ch == 'a' && a[x][y - 1] != '#') {
a[x][y] = ' ';
y--;
a[x][y] = 'O';
} 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++) {
cout << a[i][j] << " ";
}
cout << endl;
}
if(x == q && y == p) {
cout << "win"<<endl;
cout<<"你将获得11点经验"<<endl;
jinyan+=11;
break;
}
}
}
void twelve() {
cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
char a[12][12] = {
{'#','#','#','#','#','#','#','#','#','#','#','#'},
{'#',' ',' ',' ',' ','#','#','#','#','#','#','#'},
{'#','O','#','#',' ','#','#',' ','#','#',' ',' '},
{'#',' ',' ','#',' ',' ',' ',' ','#',' ',' ','#'},
{'#','#',' ','#','#','#','#',' ','#',' ','#',' '},
{'#',' ',' ','#','#',' ','#',' ',' ',' ','#','@'},
{'#','#',' ',' ','#',' ','#','#','#','#','#',' '},
{'#','#','#',' ','#','#','#','#',' ',' ',' ',' '},
{'#',' ','#',' ',' ',' ','#','#',' ','#',' ',' '},
{'#',' ','#','#','#',' ',' ',' ',' ','#','#','#'},
{'#','#','#','#','#','#','#','#','#','#','#','#'},
};
for(int i = 0; i < 12; i++) {
for(int j = 0; j < 12; j++) {
cout << a[i][j] << " ";
}
cout << endl;
}
char ch;
int x = 2, y = 1;
int q = 5, p = 11;
while(ch = getch()) {
system("cls");
cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
if(ch == 'w' && a[x - 1][y] != '#') {
a[x][y] = ' ';
x--;
a[x][y] = 'O';
} else if(ch == 's' && a[x + 1][y] != '#') {
a[x][y] = ' ';
x++;
a[x][y] = 'O';
} else if(ch == 'a' && a[x][y - 1] != '#') {
a[x][y] = ' ';
y--;
a[x][y] = 'O';
} 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++) {
cout << a[i][j] << " ";
}
cout << endl;
}
if(x == q && y == p) {
cout << "win"<<endl;
cout<<"你将获得12点经验"<<endl;
jinyan+=12;
break;
}
}
}
void thirteen() {
cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
char a[13][13] = {
{'#','#','#','#','#','#','#','#','#','#','#','#','#'},
{'#',' ','#',' ',' ',' ',' ',' ',' ',' ','#','#','#'},
{'#','O','#','#','#','#','#','#','#','#','#','#','#'},
{'#',' ','#','#','#','#','#',' ',' ',' ','#','#','#'},
{'#',' ','#','#',' ',' ',' ','#','#',' ',' ','#','#'},
{'#',' ',' ',' ',' ','#',' ','#','#',' ',' ','#','#'},
{'#',' ','#','#',' ','#',' ','#','#','#',' ',' ',' '},
{'#',' ','#','#','#',' ',' ',' ',' ','#','#','#','@'},
{'#',' ','#','#','#',' ','#','#',' ','#',' ',' ',' '},
{'#',' ',' ',' ',' ',' ','#','#',' ',' ',' ','#','#'},
{'#',' ','#','#','#','#','#','#','#',' ',' ','#','#'},
{'#',' ',' ',' ',' ',' ','#',' ',' ','#','#','#','#'},
{'#','#','#','#','#','#','#','#','#','#','#','#','#'},
};
for(int i = 0; i < 13; i++) {
for(int j = 0; j < 13; j++) {
cout << a[i][j] << " ";
}
cout << endl;
}
char ch;
int x = 2, y = 1;
int q = 7, p = 12;
while(ch = getch()) {
system("cls");
cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
if(ch == 'w' && a[x - 1][y] != '#') {
a[x][y] = ' ';
x--;
a[x][y] = 'O';
} else if(ch == 's' && a[x + 1][y] != '#') {
a[x][y] = ' ';
x++;
a[x][y] = 'O';
} else if(ch == 'a' && a[x][y - 1] != '#') {
a[x][y] = ' ';
y--;
a[x][y] = 'O';
} 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++) {
cout << a[i][j] << " ";
}
cout << endl;
}
if(x == q && y == p) {
cout << "win"<<endl;
cout<<"你将获得13点经验"<<endl;
jinyan+=13;
break;
}
}
}
void forteen() {
cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
char a[14][14] = {
{'#','#','#','#','#','#','#','#','#','#','#','#','#','#'},
{'#','#','#','#',' ',' ','#',' ',' ','#','#','#','#','#'},
{'#','O','#','#',' ','#','#','#','#','#',' ','#','#','#'},
{'#',' ',' ',' ',' ','#',' ','#','#','#',' ','#','#','#'},
{'#','#',' ','#',' ','#',' ',' ','#','#',' ',' ',' ','@'},
{'#','#',' ','#',' ',' ','#',' ',' ','#','#','#',' ','#'},
{'#','#',' ',' ',' ','#','#','#',' ',' ',' ','#',' ','#'},
{'#','#','#',' ',' ',' ',' ','#',' ','#',' ','#',' ','#'},
{'#',' ','#','#',' ','#',' ','#',' ','#',' ','#',' ','#'},
{'#',' ','#','#','#','#',' ','#',' ','#',' ',' ',' ','#'},
{'#',' ','#','#','#','#',' ','#',' ','#',' ','#',' ','#'},
{'#',' ',' ',' ',' ',' ',' ','#',' ','#','#','#','#','#'},
{'#','#','#','#','#','#',' ',' ',' ','#','#','#','#','#'},
{'#','#','#','#','#','#','#','#','#','#','#','#','#','#'},
};
for(int i = 0; i < 14; i++) {
for(int j = 0; j < 14; j++) {
cout << a[i][j] << " ";
}
cout << endl;
}
char ch;
int x = 2, y = 1;
int q = 4, p = 13;
while(ch = getch()) {
system("cls");
cout << "wsad = 上下左右, @ 为终点 ,O 为你的位置" << endl;
if(ch == 'w' && a[x - 1][y] != '#') {
a[x][y] = ' ';
x--;
a[x][y] = 'O';
} else if(ch == 's' && a[x + 1][y] != '#') {
a[x][y] = ' ';
x++;
a[x][y] = 'O';
} else if(ch == 'a' && a[x][y - 1] != '#') {
a[x][y] = ' ';
y--;
a[x][y] = 'O';
} 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++) {
cout << a[i][j] << " ";
}
cout << endl;
}
if(x == q && y == p) {
cout << "win"<<endl;
cout<<"你将获得14点经验"<<endl;
jinyan+=14;
break;
}
}
}
void shenming() {
int n;
cout << "请输入你想要的级别 1 ~ 5" << endl;
cin >> n;
if(n == 1) {
ten();
} else if(n == 2) {
eleven();
} else if(n == 3) {
twelve();
} else if(n == 4) {
thirteen();
} else if(n == 5) {
forteen();
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册