小游戏《武艺时代》
曾经发过一个帖子,有人让我发文章 可能会更新
//请按F11开始运行
#include<iostream>
#include<ctime>
#include<conio.h>
#include<windows.h>
#include<cstdlib>
#define color(i) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),i)
using namespace std;
float bf(float yu,int q){
float baifen=yu/100;
yu+=baifen*q;
return yu;
}
int main(){
cout<<"这是一个以武为尊的世界,人们称它为“武艺时代”,在这里,人们被根据武力值分为九个等级,瞳孔颜色会随之而变,分别为:棕灰黄橙绿蓝紫白红"<<endl;
cout<<"为了成为四大长老之一"<<endl;
cout<<"玩家需要操作小码君进行为期一年半的特训"<<endl;
cout<<"只有总属性值超过800,达到9级红瞳才能当选"<<endl;
cout<<"在一年半中,每一个月小码君都可以进行一次探险"<<endl;
cout<<"小码君每个月要支付15武币房租,3武币水费和2武币电费"<<endl;
cout<<endl;
cout<<"挖矿:增加攻击力和金钱,但是会减少少量武功真气"<<endl;
cout<<"挖宝:使用稿子挖宝藏"<<endl;
cout<<"闭关:随机增加或减少攻击或武功真气,但是会消耗金钱"<<endl;
cout<<"吃饭:增加大量生命,但是会消耗很多金钱"<<endl;
cout<<"闯荡:出门闯荡,触发战斗"<<endl;
cout<<"闲逛:购买装备增加自身属性,但是会消耗金钱"<<endl;
cout<<"附魔:随机增加属性,但会消耗武功真气,属性越好,消耗越高"<<endl;
cout<<"彩票:输入三个幸运代码,进行抽奖"<<endl;
cout<<"买卖房子:花钱买房,购买后无需支付房租,一人只能买一栋,卖房就不解释了"<<endl;
cout<<"作弊码:玩过游戏的人都懂"<<endl;
cout<<"造反:有%80的概率失败,失败后你将一无所有,成功则获得1000武币,需要100武币"<<endl;
cout<<endl;
cout<<"准备好开始冒险了吗?"<<endl;
system("pause");
long long m2,ge,temppro,biao;
string gupiao[10]={"管道保险","纸糊钢铁","恺英网络","武艺时代","ETO","星环公司","熔岩制冷","宇宙安全联盟","迷城速递","地狱入口医院"};
int gum[10],chiyou[10]={0,0,0,0,0,0,0,0,0,0},zd[10];
char cchh,ccchhh,ch3;
bool fange=0,fantan=0,sudu;
char names[4][100]={"阿瑞斯","宙斯","普罗米修斯","阿克琉斯"},playatt[5][10]={"攻击","血量","武功真气","防御","武币"},user,user2,ch,event[3][100]={"感悟天道,功力大增,增加攻击与武功真气","走火入魔,功力大减,减少攻击与武功真气"
},att[7][80]={"锋利I","锋利II","保护I","保护II","荆棘I","荆棘II","成神"},buff[5][80]={"效果拔萃,","效果不错,","效果平平,","效果较差,","效果弱鸡,"};
long long jian=20,year,jian2=0,minci[5],aaa[10000]={-1},qqmonth=999,zong,phb[5]={300,1000,600,500};
string name,jie[6]={"武器的原始形态","血量-60%,但攻击×3","防御+40%","血量+50%,攻击+30%","攻击+80%","现在还无从知晓"},xing[6]={"阿瑞斯形态","关羽形态","天神形态","普罗米修斯形态","宙斯形态","???形态"};
float player[6]={};
long long xieshu[6]={0,300,200,200,200,1000};//解锁价格
long long zhuang=0,ch4;
long long kes=444444;
bool yyds=1;
bool p=1;
bool jiez[6]={1,0,0,0,0,0};//武器解锁状态
for(int i=0;i<=10000;i++){
aaa[i]=-1;
}
int c=1,cc=0;
int zuobima;
cout<<"请输入您的姓名:";
cin>>name;
while(true){
c++;
system("cls");
srand(time(0));
for(int i=0;i<=9;i++){
gum[i]=rand()%90+10;
}
cout<<"请选择你的初始属性:"<<endl;
for(int i=0;i<5;i++){
player[i]=rand()%70+40;
}
cout<<"当前角色信息"<<endl;
for(int i=0;i<5;i++){
cout<<playatt[i]<<":"<<player[i]<<endl;
}
cout<<"是否选择初始属性(y/n)"<<endl;
user=getch();
if(user=='y'||user=='Y'||c>5){
break;
}
}
cout<<"正在创建角色"<<endl;
for(int i=3;i>=1;i--){
Sleep(1000);
Beep(800,400);
cout<<i<<endl;
}
cout<<"角色创建成功 !!"<<endl;
cout<<"当前角色信息"<<endl;
for(int i=0;i<5;i++){
cout<<playatt[i]<<":"<<player[i]<<endl;
}
system("pause") ;
year=rand()%2500+1;
int jia=0;
for(int month=1;month<=18;month++){
system("cls");
color(7);
if(month>12){
jian2=12;
if(jia==0){
year++;
jia=2;
}
}
cout<<"现在是武艺时代"<<year<<"年"<<month-jian2<<"月"<<endl;
if(qqmonth!=999){
cout<<"紧急通知!请在"<<qqmonth<<"月内还完贷款,否则后果自负"<<endl;
}
if(fange==1){
temppro=rand()%5;
if(temppro==4){
ge/=1.125;
}
else if(temppro==3){
ge/=1.1;
}
else if(temppro==1){
ge*=1.1;
}
else if(temppro==0){
ge*=1.125;
}
cout<<"当前房价:"<<ge<<endl;
}
cout<<"当前属性如下:"<<endl;
for(int i=0;i<5;i++){
if(player[i]>=120){
color(4);
cout<<playatt[i]<<":"<<player[i]<<endl;
}
else if(player[i]>=80){
color(6);
cout<<playatt[i]<<":"<<player[i]<<endl;
}
else if(player[i]<=30){
color(2);
cout<<playatt[i]<<":"<<player[i]<<endl;
}
else{
color(7);
cout<<playatt[i]<<":"<<player[i]<<endl;
}
}
zong=player[0]+player[1]+player[2]+player[3];
color(7);
cout<<"瞳孔颜色:";
if(zong>=1&&zong<=99){
color(0);
cout<<"黑"<<endl;
color(7);
}
else if(zong>=100&&zong<=149){
color(8);
cout<<"灰"<<endl;
color(7);
}
else if(zong>=150&&zong<=199){
color(6);
cout<<"黄"<<endl;
color(7);
}
else if(zong>=200&&zong<=249){
color(12);
cout<<"橙"<<endl;
color(7);
}
else if(zong>=250&&zong<=299){
color(2);
cout<<"绿"<<endl;
color(7);
}
else if(zong>=300&&zong<=449){
color(9);
cout<<"蓝"<<endl;
color(7);
}
else if(zong>=450&&zong<=699){
color(5);
cout<<"紫"<<endl;
color(7);
}
else if(zong>=700&&zong<=799){
color(15);
cout<<"白"<<endl;
color(7);
}
else if(zong>=800){
color(4);
cout<<"红"<<endl;
color(7);
}
if(yyds==0){
break;
}
cout<<"a 挖矿"<<endl;
cout<<"q 挖宝"<<endl;
cout<<"s 闭关"<<endl;
cout<<"d 吃饭"<<endl;
cout<<"f 闯荡"<<endl;
cout<<"g 闲逛"<<endl;
cout<<"o 附魔"<<endl;
cout<<"c 彩票"<<endl;
cout<<"u 买卖房子"<<endl;
cout<<"k 调整武器形态"<<endl;
cout<<"n 消磨"<<endl;
cout<<"m 作弊码"<<endl;
cout<<"x 查看属性"<<endl;
cout<<"z 查看排行榜"<<endl;
cout<<"w 造反"<<endl;
cout<<"e 股市"<<endl;
cout<<"请输入:"<<endl;
cin>>ch;
if(month!=1){
phb[0]*=1.2;
phb[1]*=1.01;
phb[2]*=1.05;
phb[3]*=1.1;
}
if(ch=='k'){
for(int i=0;i<=5;i++){
cout<<i+1<<"、"<<xing[i]<<" ";
if(jiez[i]==0&&i!=5){
cout<<"未解锁,解锁需要"<<xieshu[i]<<"武币"<<endl;
}
else if(i==5&&jiez[i]==0){
cout<<"未解锁,解锁需要"<<xieshu[i]<<"武币或命运女神许可"<<endl;
}
else{
cout<<"已解锁"<<endl;
}
cout<<jie[i]<<endl;
}
cout<<"当前装备:"<<xing[zhuang]<<endl;
cout<<"请问你要装备武器形态还是购买武器形态?按0装备,其他键购买:";
cin>>ch3;
if(ch3=='0'){
cout<<"请问你要装备几号形态?(不准乱输,乱输直接自杀)"<<endl;
cin>>ch4;
if(ch4<1 or ch4>6){
yyds=0;
break;
}
ch4--;
if(jiez[ch4]==0){
cout<<"该形态未解锁!"<<endl;
}
else{
if(ch4==0){
if(zhuang==1){
player[1]=bf(player[1],60);
player[0]/=3;
}
else if(zhuang==2){
player[3]=bf(player[3],-40);
}
else if(zhuang==3){
player[1]=bf(player[1],-50);
player[0]=bf(player[0],-30);
}
else if(zhuang==4){
player[0]=bf(player[0],-80);
}
else if(zhuang==5){
fantan=0;
}
}
else if(ch4==1){
player[1]=bf(player[1],-60);
player[0]*=3;
if(zhuang==2){
player[3]=bf(player[3],-40);
}
else if(zhuang==3){
player[1]=bf(player[1],-50);
player[0]=bf(player[0],-30);
}
else if(zhuang==4){
player[0]=bf(player[0],-80);
}
else if(zhuang==5){
fantan=0;
}
zhuang=1;
}
else if(ch4==2){
player[3]=bf(player[3],40);
if(zhuang==1){
player[1]=bf(player[1],60);
player[0]/=3;
}
else if(zhuang==3){
player[1]=bf(player[1],-50);
player[0]=bf(player[0],-30);
}
else if(zhuang==4){
player[0]=bf(player[0],-80);
}
else if(zhuang==5){
fantan=0;
}
zhuang=2;
}
else if(ch4==3){
player[1]=bf(player[1],50);
player[0]=bf(player[0],30);
if(zhuang==2){
player[3]=bf(player[3],-40);
}
else if(zhuang==1){
player[1]=bf(player[1],60);
player[0]/=3;
}
else if(zhuang==4){
player[0]=bf(player[0],-80);
}
else if(zhuang==5){
fantan=0;
}
zhuang=3;
}
else if(ch4==4){
if(zhuang==2){
player[3]=bf(player[3],-40);
}
else if(zhuang==3){
player[1]=bf(player[1],-50);
player[0]=bf(player[0],-30);
}
else if(zhuang==1){
player[1]=bf(player[1],60);
player[0]/=3;
}
else if(zhuang==5){
fantan=0;
}
zhuang=4;
}
else if(ch4==5){
fantan=1;
if(zhuang==1){
player[1]=bf(player[1],60);
player[0]/=3;
}
else if(zhuang==2){
player[3]=bf(player[3],-40);
}
else if(zhuang==3){
player[1]=bf(player[1],-50);
player[0]=bf(player[0],-30);
}
else if(zhuang==4){
player[0]=bf(player[0],-80);
}
zhuang=5;
}
cout<<"装备成功!";
// "武器的原始形态","血量-60%,但攻击×3","防御+40%","血量+50%,攻击+30%","攻击+80%"
}
}
else{
cout<<"请问你要购买几号形态?(不准乱输,乱输直接自杀)"<<endl;
cin>>ch4;
if(ch4<1 or ch4>6){
yyds=0;
break;
}
if(jiez[ch4-1]==0){
if(player[4]>=xieshu[ch4-1]){
player[4]-=xieshu[ch4-1];
jiez[ch4-1]=1;
cout<<"购买成功!"<<endl;
if(ch4==6){
jie[5]={"你拥有了阿波罗之盾,可反弹50%伤害"};
xing[5]={"阿波罗形态"};
jiez[5]=1;
}
}
else{
cout<<"你自己有多少钱心里没点数吗?"<<endl;
}
}
else{
cout<<"该武器形态你已拥有!"<<endl;
}
}
system("pause");
}
else if(ch=='a'){
cout<<name<<"疯狂挖矿中"<<endl;
Beep(2500,500);
Beep(2500,500);
cout<<"嘿咻!!嘿咻!!金钱增加"<<endl;
Sleep(2000);
Beep(2500,500);
Beep(2500,500);
cout<<"嘿咻!!嘿咻!!金钱增加"<<endl;
Sleep(2000);
cout<<name<<"加强了麒麟臂,攻击增加"<<endl;
Sleep(2000);
cout<<name<<"荒废了练功,武功真气减少"<<endl;
Sleep(2000);
player[4]+=rand()%40;
player[0]+=rand()%20;
player[2]-=rand()%10;
}
else if(ch=='w'){
int mmo;
mmo=rand()%5;
if(mmo==1){
cout<<"造反成功,你获得了1000元"<<endl;
system("pause");
player[4]+=1000;
}
else{
cout<<"造反失败,你被没收了全部家产"<<endl;
system("pause");
player[4]=0;
fange=0;
jian=20;
}
}
else if(ch=='q'){
char maze2[10][11]= {"**********",
"* *",
"* *",
"* *",
"* *",
"* *",
"* *",
"* *",
"* *",
"**********"};
int nai=10,xxx,yyy,xx,yy,txx,tyy,txx1,tyy1,txx2,tyy2,txx3,tyy3,tx4,ty4,tx5,ty5,tx6,ty6,tx7,ty7,tx8,ty8,tx9,ty9;
srand(time(0));
xx=rand()%10;
yy=rand()%10;//所在位置
xxx = rand() % 10;
yyy = rand() % 10;//木稿
txx = rand() % 10;
tyy = rand() % 10;//铁镐
txx1 = rand() % 10;
tyy1 = rand() % 10;//钻石镐
txx2 = rand() % 10;
tyy2 = rand() % 10;//炸弹!
txx3 = rand() % 10;
tyy3 = rand() % 10;//200武币10克拉大钻石
tx4=rand()%10;
ty4=rand()%10;//圣灵剑魂
tx5=rand()%10;
ty5=rand()%10;//无影拳
tx6=rand()%10;
ty6=rand()%10;//气功宝典
tx7=rand()%10;
ty7=rand()%10;//神之庇佑
tx8=rand()%10;
ty8=rand()%10;//潜龙在渊
tx9=rand()%10;
ty9=rand()%10;//卡俄斯的祝福
while(maze2[xx][yy] == '*'){
xx = rand() % 10;
yy = rand() % 10;
}
while(maze2[txx][tyy] == '*'){
txx = rand() % 10;
tyy = rand() % 10;
}
while(maze2[txx1][tyy1] == '*'){
txx1 = rand() % 10;
tyy1 = rand() % 10;
}
while(maze2[txx2][tyy2] == '*'){
txx2 = rand() % 10;
tyy2 = rand() % 10;
}
while(maze2[txx3][tyy3] == '*'){
txx3 = rand() % 10;
tyy3 = rand() % 10;
}
while(maze2[tx4][ty4] == '*'){
tx4 = rand() % 10;
ty4 = rand() % 10;
}
while(maze2[tx5][ty5] == '*'){
tx5 = rand() % 10;
ty5 = rand() % 10;
}
while(maze2[tx6][ty6] == '*'){
tx6 = rand() % 10;
ty6 = rand() % 10;
}
while(maze2[tx7][ty7] == '*'){
tx7 = rand() % 10;
ty7 = rand() % 10;
}
while(maze2[tx8][ty8] == '*'){
tx8 = rand() % 10;
ty8 = rand() % 10;
}
int i1,jj;
for(i1 = 0;i1 < 10;++i1){
for(jj = 0;jj <10;++jj){
cout << maze2[i1][jj] << " ";
}
cout << endl;
}
cout<<"请按WASD移动,Q挖开"<<endl;
cout<<"你的稿子还有"<<nai<<"点耐久"<<endl;
char cca;
while(true){
maze2[xx][yy]='i';
cca = getch();
system("cls");
if(cca == 'w'){
if(maze2[xx-1][yy] != '*'){
maze2[xx][yy] = ' ';
--xx;
maze2[xx][yy] = 'i';
}
else{
MessageBox(0,"你撞墙了,撞得头破血流,血量-2","警告",MB_OK);
player[1]-=2;
}
}
if(cca == 'a'){
if(maze2[xx][yy-1] != '*'){
maze2[xx][yy] = ' ';
--yy;
maze2[xx][yy] = 'i';
}
else{
MessageBox(0,"你撞墙了,撞得头破血流,血量-2","警告",MB_OK);
player[1]-=2;
}
}
if(cca == 's'){
if(maze2[xx+1][yy] != '*'){
maze2[xx][yy] = ' ';
++xx;
maze2[xx][yy] = 'i';
}
else{
MessageBox(0,"你撞墙了,撞得头破血流,血量-2","警告",MB_OK);
player[1]-=2;
}
}
if(cca == 'd'){
if(maze2[xx][yy+1] != '*'){
maze2[xx][yy] = ' ';
++yy;
maze2[xx][yy] = 'i';
}
else{
MessageBox(0,"你撞墙了,撞得头破血流,血量-2","警告",MB_OK);
player[1]-=2;
}
}
if(cca=='q'){
nai--;
if(maze2[xxx][yyy]=='i'){
cout<<"恭喜你,你获得了木稿,耐久+1"<<endl ;
nai+=2;
xxx=0;
yyy=0;
}
else if(maze2[txx1][tyy1]=='i'){
cout<<"恭喜你,你获得了铁稿,耐久+3"<<endl ;
nai+=4;
txx1=0;
tyy1=0;
}
else if(maze2[txx2][tyy2]=='i'){
cout<<"恭喜你,你获得了钻石稿,耐久+5"<<endl ;
nai+=4;
txx2=0;
tyy2=0;
}
else if(maze2[txx3][tyy3]=='i'){
cout<<"恭喜你,你挖到了......炸弹,血量减少"<<endl ;
player[1]-=rand()%30+10;
txx3=0;
tyy3=0;
}
else if(maze2[tx4][ty4]=='i'){
cout<<"恭喜你,你获得了一块价值两百武币的钻石,武币+200"<<endl ;
player[4]+=200;
tx4=0;
ty4=0;
}
else if(maze2[tx5][ty5]=='i'){
cout<<"恭喜你,你获得了一本名叫圣灵剑魂的武功秘籍,攻击翻倍"<<endl ;
player[0]*=2;
tx5=0;
ty5=0;
}
else if(maze2[tx6][ty6]=='i'){
cout<<"恭喜你,你获得了一本名叫无影拳的武功秘籍,攻击+30"<<endl ;
player[0]+=30;
tx6=0;
ty6=0;
}
else if(maze2[tx7][ty7]=='i'){
cout<<"恭喜你,你获得了一本名叫气功宝典的武功秘籍,武功真气+50"<<endl ;
player[2]+=50;
tx7=0;
ty7=0;
}
else if(maze2[tx8][ty8]=='i'){
cout<<"恭喜你,你获得了一本名叫潜龙在渊的武功秘籍,攻击×1.5"<<endl ;
player[0]*=1.5;
tx8=0;
tx8=0;
}
else if(maze2[txx][tyy]=='i'){
cout<<"恭喜你,你获得了一本名叫神之庇佑的武功秘籍,防御翻倍"<<endl ;
player[3]*=2;
txx=0;
tyy=0;
}
else if(maze2[tx9][ty9]=='i'){
cout<<"恭喜你,获得了卡俄斯的祝福,所有属性减半3个月,此后,所有属性翻倍"<<endl;
for(int i=0;i<=3;i++){
player[i]/=2;
}
kes=3;
}
else{
cout<<"对不起,你什么也没挖到"<<endl;
}
system("pause");
}
for(i1 = 0;i1 < 10;++i1){
for(jj = 0;jj < 10;++jj){
cout << maze2[i1][jj] << " ";
}
cout << endl;
}
if(nai==0){
cout<<"你的稿子废了,你离开了宝区"<<endl;
system("pause");
break;
}
cout<<"请按WASD移动,Q挖开"<<endl;
cout<<"你的稿子还有"<<nai<<"点耐久"<<endl;
}
}
else if(ch=='z'){
int tphb[5];
for(int i=0;i<=4;i++){
tphb[i]=phb[i];
}
char names[4][100]={"阿瑞斯","宙斯","普罗米修斯","阿克琉斯"},cheng[5][5]={"冠军","亚军","季军","殿军","瑙军"};
int tong=zong,max=0;
for(int j=0;j<=4;j++){
max=0;
for(int i=0;i<=4;i++){
if(tphb[i]>max){
max=tphb[i];
minci[j]=i;
}
}
if(tong>max){
if(j==0){
color(6);
}
else if(j==1){
color(8);
}
else if(j==2){
color(12);
}
else{
color(7);
}
cout<<cheng[j]<<": "<<name<<" ";
cout<<"瞳孔颜色:";
if(zong>=1&&zong<=99){
color(0);
cout<<"黑"<<endl;
color(7);
}
else if(zong>=100&&zong<=149){
color(8);
cout<<"灰"<<endl;
color(7);
}
else if(zong>=150&&zong<=199){
color(6);
cout<<"黄"<<endl;
color(7);
}
else if(zong>=200&&zong<=249){
color(12);
cout<<"橙"<<endl;
color(7);
}
else if(zong>=250&&zong<=299){
color(2);
cout<<"绿"<<endl;
color(7);
}
else if(zong>=300&&zong<=449){
color(9);
cout<<"蓝"<<endl;
color(7);
}
else if(zong>=450&&zong<=699){
color(5);
cout<<"紫"<<endl;
color(7);
}
else if(zong>=700&&zong<=799){
color(15);
cout<<"白"<<endl;
color(7);
}
else if(zong>=800){
color(4);
cout<<"红"<<endl;
color(7);
}
cout<<"总属性:"<<zong<<endl;
tong=0;
}
else{
if(j==0){
color(6);
}
else if(j==1){
color(8);
}
else if(j==2){
color(12);
}
else{
color(7);
}
cout<<cheng[j]<<": "<<names[minci[j]]<<" ";
color(7);
cout<<"瞳孔颜色:";
if(tphb[minci[j]]>=1&&tphb[minci[j]]<=99){
color(0);
cout<<"黑"<<endl;
color(7);
}
else if(tphb[minci[j]]>=100&&tphb[minci[j]]<=149){
color(8);
cout<<"灰"<<endl;
color(7);
}
else if(tphb[minci[j]]>=150&&tphb[minci[j]]<=199){
color(6);
cout<<"黄"<<endl;
color(7);
}
else if(tphb[minci[j]]>=200&&tphb[minci[j]]<=249){
color(12);
cout<<"橙"<<endl;
color(7);
}
else if(tphb[minci[j]]>=250&&tphb[minci[j]]<=299){
color(2);
cout<<"绿"<<endl;
color(7);
}
else if(tphb[minci[j]]>=300&&tphb[minci[j]]<=449){
color(9);
cout<<"蓝"<<endl;
color(7);
}
else if(tphb[minci[j]]>=450&&tphb[minci[j]]<=699){
color(5);
cout<<"紫"<<endl;
color(7);
}
else if(tphb[minci[j]]>=700&&tphb[minci[j]]<=799){
color(15);
cout<<"白"<<endl;
color(7);
}
else if(tphb[minci[j]]>=800){
color(4);
cout<<"红"<<endl;
color(7);
}
cout<<"总属性:"<<phb[minci[j]]<<endl;
tphb[minci[j]]=0;
}
color(7);
}
month--;
if(qqmonth!=999){
qqmonth++;
}
if(month!=1){
phb[0]/=1.2;
phb[1]/=1.01;
phb[2]/=1.05;
phb[3]/=1.1;
}
system("pause");
}
else if(ch=='c'){
int zi,hui[3],lucky[3]={0,0,0},zhi=0,coutf;
cout<<"请输入你的初始投入:";
cin>>zi;
player[4]-=zi;
for(int i=0;i<=2;i++){
lucky[i]=rand()%30+1;
}
for(int j=0;j<=2;j++){
cout<<"请输入你的第"<<j+1<<"个幸运代码(1-30)"<<endl;
cin>>hui[j];
}
cout<<"开奖啦!";
for(int x=0;x<=2;x++){
for(int y=0;y<=2;y++){
if(hui[x]==lucky[y]){
zhi++;
}
}
}
for(int k=0;k<=2;k++){
while(true){
coutf=rand()%30+1;
cout<<"第"<<k+1<<"个数是:"<<coutf<<endl;
if(coutf==lucky[k]){
system("pause");
break;
}
Sleep(200);
system("cls");
}
}
if(zhi>=3){
cout<<"恭喜获得一等奖,奖投入的十倍!"<<endl;
player[4]+=zi*10;
}
else if (zhi==2){
cout<<"恭喜获得二等奖,奖投入的五倍!"<<endl;
player[4]+=zi*5;
}
else if(zhi==1){
cout<<"恭喜获得三等奖,奖投入的三倍!"<<endl;
player[4]+=zi*3;
}
else{
cout<<"谢谢惠顾"<<endl;
}
system("pause");
}
else if(ch=='u'){
cout<<"欢迎来到电子房产公司,按0买房,按其他卖房"<<endl;
cin>>ccchhh;
if(ccchhh=='0'){
if(fange==0){
cout<<"请输入你的房子面积:";
while(true){
cin>>m2;
if(m2<=200&&m2>=25){
break;
}
else{
cout<<"房子面积过大或过小,我们这没有,请重新输入(提示:房子面积在200-25之间可以购买):"<<endl;
}
}
Beep(500,1000);
ge=rand()%15+1;
ge*=m2;
cout<<"电脑查找到了你要的房型,当前房价:"<<ge<<"\n是否购买(y买 其他键不买)";
char yy;
cin>>yy;
if(yy=='y'){
if(ge<=player[4]+100){
cout <<"购买成功!"<<endl;
player[4]-=ge;
fange=1;
jian=5;
}
else{
cout<<"对不起,你的钱不够,最多只能贷款100武币"<<endl;
}
}
else{
cout<<"你离开了"<<endl;
yy='p';
}
}
else{
cout<<"国家规定一人只能有一套房,这单生意我不能接"<<endl;
}
}
else{
if(fange==1){
cout<<"当前房价"<<ge<<"武币,是否售出(y售出)"<<endl;
cin>>cchh;
if(cchh=='y'){
cout<<"售房成功!你获得了"<<ge<<"武币"<<endl;
player[4]+=ge;
fange=0;
jian=20;
}
else{
cout<<"你离开了"<<endl;
cchh='p';
}
}
else{
cout<<"你自己有没有房不知道吗?!"<<endl;
}
}
system("pause");
}
else if(ch=='n'){
int y=-1;
cout<<"请输入你要消磨的月数:";
while(y<=0){
cin>>y;
if(y<=0){
cout<<"请重新输入!"<<endl;
cout<<"请输入你要消磨的月数:";
}
}
month+=y-1;
}
else if(ch== 'f'){
cout << name<<"开始闯荡" << endl;
char enemyName[5][1000]={"恶金城小兵","灵焰组织喽啰","恶金城团长","Him","实体303"};
int enemyAtt[5][4]={{60,60,50,0},
{70,60,60,0},
{90,60,50,20},
{100,100,80,50},
{200,150,60,80}};
int enemyMoney[5]={30,50,80,100,500};
int enemyzong[5]={170,190,220,330,490};
int temp=rand()%5,temp0=rand()%5;
char maze[18][24]= {"************** ********",//1
"* * * *",//2
"* ************ * ** * *",//3
"* * **** * *",//4
"* ********** * * * *",//5
"* ** * * ******",//6
"* ** ***** ***** * ** *",//7
"* * * *",//8
"****** * ********** *",//9
"* * * * * *",//10
"* **** * * ****** *****",//11
"* * * * * * * *",//12
"* * ****** * ** * * * *",//13
"* * * ** * * * *",//14
"* ********** ** * *",//15
"* * *",//16
"*************** *******",//17
"***********************"};//18
int x,y,tx,ty,tx1,ty1,tx2,ty2,tx3,ty3;
int count = 0;
srand(time(0));
x = rand() % 18;
y = rand() % 23;
tx = rand() % 18;
ty = rand() % 23;
tx1 = rand() % 18;
ty1 = rand() % 23;
tx2 = rand() % 18;
ty2 = rand() % 23;
tx3 = rand() % 18;
ty3 = rand() % 23;
while(maze[x][y] == '*'){
x = rand() % 18;
y = rand() % 23;
}
while(maze[tx][ty] == '*'){
tx = rand() % 18;
ty = rand() % 23;
}
while(maze[tx1][ty1] == '*'){
tx1 = rand() % 18;
ty1 = rand() % 23;
}
while(maze[tx2][ty2] == '*'){
tx2 = rand() % 18;
ty2 = rand() % 23;
}
while(maze[tx3][ty3] == '*'){
tx3 = rand() % 18;
ty3 = rand() % 23;
}
maze[x][y] = 'i';
maze[tx1][ty1]='d';
maze[tx2][ty2]='d';
maze[tx3][ty3]='Q';
int i,j;
for(i = 0;i < 18;++i){
for(j = 0;j < 23;++j){
cout << maze[i][j] << " ";
}
cout << endl;
}
char c;
while(true){
c = getch();
++count;
system("cls");
if(c == 'w'){
if(maze[x-1][y] != '*'){
maze[x][y] = ' ';
--x;
maze[x][y] = 'i';
}
else{
MessageBox(0,"你撞墙了,撞得头破血流,血量-2","警告",MB_OK);
player[1]-=2;
}
}
if(c == 'a'){
if(maze[x][y-1] != '*'){
maze[x][y] = ' ';
--y;
maze[x][y] = 'i';
}
else{
MessageBox(0,"你撞墙了,撞得头破血流,血量-2","警告",MB_OK);
player[1]-=2;
}
}
if(c == 's'){
if(maze[x+1][y] != '*'){
maze[x][y] = ' ';
++x;
maze[x][y] = 'i';
}
else{
MessageBox(0,"你撞墙了,撞得头破血流,血量-2","警告",MB_OK);
player[1]-=2;
}
}
if(c == 'd'){
if(maze[x][y+1] != '*'){
maze[x][y] = ' ';
++y;
maze[x][y] = 'i';
}
else{
MessageBox(0,"你撞墙了,撞得头破血流,血量-2","警告",MB_OK);
player[1]-=2;
}
}
for(i = 0;i < 18;++i){
for(j = 0;j < 23;++j){
cout << maze[i][j] << " ";
}
cout << endl;
}
if(maze[tx][ty] == 'i'){
maze[0][14] = ' ';
MessageBox(0,"取到宝箱","提示",MB_OK);
player[4]+=100;
tx=0;
ty=0;
}
if(maze[tx3][ty3]=='i'){
cout<<"你发现了一张先人留下的字条,上面写着:“这里没宝箱”,你要挖开看看吗(y/n)" <<endl;
int user888;
user888=getch();
if(user888=='y'){
int t;
t=rand()%2;
if(t==0){
MessageBox(0,"挖到隐藏宝箱","提示",MB_OK);
player[4]+=100;
}
else{
MessageBox(0,"挖到隐藏炸弹","提示",MB_OK);
player[1]-=rand()%40;
}
}
else{
cout<<"你离开了"<<endl;
system ("pause");
}
tx3=0;
ty3=0;
}
if(x == 0 && y == 14 ){
string steps = "走出迷宫,使用步数为:"; //messagebox显示使用步数
char sum[100];
itoa(count,sum,10); //将记录玩家步数的变量sum,转成字符串,赋值给iToA数组
steps += sum;
MessageBox(0,steps.c_str(),"提示",MB_OK);//将获得的字符串显示在messagebox上
break;
}
if(x<0){
MessageBox(0,"请重新开始","提示",MB_OK);
break;
}
if(maze[tx1][ty1]=='i'){
sudu=rand()%2;
char enemyName[5][1000]={"恶金城小兵","灵焰组织喽啰","恶金城团长","Him","实体303"};
int enemyAtt[5][4]={{60,60,50,0},
{70,60,60,0},
{90,60,50,20},
{100,100,80,50},
{200,150,60,80}};
int enemyMoney[5]={30,50,80,100,500};
int sudu=rand()%2,temp=rand()%5,temp0=rand()%5;
cout<<"当前敌人:"<<enemyName[temp]<<endl;
for(int i=0;i<4;i++){
cout<<playatt[i]<<":"<<enemyAtt[temp][i]<<endl;
}
cout<<"瞳孔颜色:";
if(enemyzong[temp]>=1&&enemyzong[temp]<=99){
color(0);
cout<<"黑"<<endl;
color(7);
}
else if(enemyzong[temp]>=100&&enemyzong[temp]<=149){
color(8);
cout<<"灰"<<endl;
color(7);
}
else if(enemyzong[temp]>=150&&enemyzong[temp]<=199){
color(6);
cout<<"黄"<<endl;
color(7);
}
else if(enemyzong[temp]>=200&&enemyzong[temp]<=249){
color(12);
cout<<"橙"<<endl;
color(7);
}
else if(enemyzong[temp]>=250&&enemyzong[temp]<=299){
color(2);
cout<<"绿"<<endl;
color(7);
}
else if(enemyzong[temp]>=300&&enemyzong[temp]<=449){
color(9);
cout<<"蓝"<<endl;
color(7);
}
else if(enemyzong[temp]>=450&&enemyzong[temp]<=699){
color(5);
cout<<"紫"<<endl;
color(7);
}
else if(enemyzong[temp]>=700&&enemyzong[temp]<=799){
color(15);
cout<<"白"<<endl;
color(7);
}
else if(enemyzong[temp]>=800){
color(4);
cout<<"红"<<endl;
color(7);
}
cout<<"赏金:"<<enemyMoney[temp]<<endl;
cout<<"当前属性如下:"<<endl;
for(int i=0;i<5;i++){
if(player[i]>=120){
color(4);
cout<<playatt[i]<<":"<<player[i]<<endl;
}
else if(player[i]>=80){
color(6);
cout<<playatt[i]<<":"<<player[i]<<endl;
}
else if(player[i]<=30){
color(2);
cout<<playatt[i]<<":"<<player[i]<<endl;
}
else{
color(7);
cout<<playatt[i]<<":"<<player[i]<<endl;
}
color(7);
}
cout<<"瞳孔颜色:";
if(zong>=1&&zong<=99){
color(0);
cout<<"黑"<<endl;
color(7);
}
else if(zong>=100&&zong<=149){
color(8);
cout<<"灰"<<endl;
color(7);
}
else if(zong>=150&&zong<=199){
color(6);
cout<<"黄"<<endl;
color(7);
}
else if(zong>=200&&zong<=249){
color(12);
cout<<"橙"<<endl;
color(7);
}
else if(zong>=250&&zong<=299){
color(2);
cout<<"绿"<<endl;
color(7);
}
else if(zong>=300&&zong<=449){
color(9);
cout<<"蓝"<<endl;
color(7);
}
else if(zong>=450&&zong<=699){
color(5);
cout<<"紫"<<endl;
color(7);
}
else if(zong>=700&&zong<=799){
color(15);
cout<<"白"<<endl;
color(7);
}
else if(zong>=800){
color(4);
cout<<"红"<<endl;
color(7);
}
color(7);
cout<<"是否迎战(y/n)"<<endl;
cin>>user;
if(user=='y'){
if(enemyAtt[temp][2]>player[2]){
cout<<"武功真气不够,被抢劫了"<<endl;
player[4]-=rand()%16*temp;
}
else{
if(sudu==0){
cout<<"你抽到后手"<<endl;
while(enemyAtt[temp][1]>0){
biao=0;
temp0=rand()%5;
int temp1=rand()%5;
if(player[1]<0){
cout<<"你去世了"<<endl;
yyds=0;
break;
}
int attack1=enemyAtt[temp][0]-player[3];
if(temp0==0){
attack1*=2;
}
else if(temp0==1){
attack1*=1.5;
}
else if(temp0==3){
attack1/=1.5;
}
else if(temp0==4){
attack1/=2;
}
if(fantan=1){
biao=attack1/2;
attack1/=2;
}
if(attack1<0) attack1=0;
cout<<enemyName[temp]<<"发动攻击,"<<buff[temp0]<<"造成"<<attack1<<"伤害"<<endl;
player[1]-=attack1;
int attack2=player[0]-enemyAtt[temp][3];
if(temp1==0){
attack2*=3;
}
else if(temp1==1){
attack2*=2;
}
else if(temp1==3){
attack2/=1.5;
}
else if(temp1==4){
attack2/=2;
}
if(fantan==1) attack2+=biao;
if(attack2<0) attack2=0;
cout<<name<<"发动攻击,"<<buff[temp1]<<"造成"<<attack2<<"伤害"<<endl;
enemyAtt[temp][1]-=attack2;
}
if(player[1]>0){
cout<<"战斗胜利,获得"<<enemyMoney[temp]<<"赏金"<<endl;
player[4]+=enemyMoney[temp];
if(jiez[5]==0&&temp==4&&jiez[0]==1&&jiez[1]==1&&jiez[2]==1&&jiez[3]==1&&jiez[4]==1){
cout<<"你发现303掉落了一瓶不明液体,你将他注入了你的武器中,竟解锁了武器最后一个形态:阿波罗形态!"<<endl;
jie[5]={"你拥有了阿波罗之盾,可反弹50%伤害"};
xing[5]={"阿波罗形态"};
jiez[5]=1;
}
}
}
else if(sudu==1){
cout<<"你抽到先手"<<endl;
while(enemyAtt[temp][1]>0){
temp0=rand()%5;
int temp1=rand()%5;
if(player[1]<0){
cout<<"你去世了"<<endl;
yyds=0;
break;
}
int attack2=player[0]-enemyAtt[temp][3];
if(temp1==0){
attack2*=3;
}
else if(temp1==1){
attack2*=2;
}
else if(temp1==3){
attack2/=1.5;
}
else if(temp1==4){
attack2/=2;
}
if(fantan==1) attack2+=biao;
if(attack2<0) attack2=0;
cout<<name<<"发动攻击,"<<buff[temp1]<<"造成"<<attack2<<"伤害"<<endl;
enemyAtt[temp][1]-=attack2;
int attack1=enemyAtt[temp][0]-player[3];
if(temp0==0){
attack1*=2;
}
else if(temp0==1){
attack1*=1.5;
}
else if(temp0==3){
attack1/=1.5;
}
else if(temp0==4){
attack1/=2;
}
if(fantan=1){
biao=attack1/2;
attack1/=2;
}
if(attack1<0) attack1=0;
cout<<enemyName[temp]<<"发动攻击,"<<buff[temp0]<<"造成"<<attack1<<"伤害"<<endl;
player[1]-=attack1;
}
if(player[1]>0){
cout<<"战斗胜利,获得"<<enemyMoney[temp]<<"赏金"<<endl;
player[4]+=enemyMoney[temp];
if(jiez[5]==0&&temp==4&&jiez[0]==1&&jiez[1]==1&&jiez[2]==1&&jiez[3]==1&&jiez[4]==1){
cout<<"你发现303掉落了一瓶不明液体,你将他注入了你的武器中,竟解锁了武器最后一个形态:阿波罗形态!"<<endl;
jie[5]={"你拥有了阿波罗之盾,可反弹50%伤害"};
xing[5]={"阿波罗形态"};
jiez[5]=1;
}
}
}////
}
}
else{
int d;
d=rand()%2;
if(d==0){
cout<<"你悄悄逃跑,成功了"<<endl;
}
else if(d==1){
cout<<"你悄悄逃跑,但被发现了,被勒索了十枚武币"<<endl;
player[4]-=10;
}
}
system("pause");
tx1=0;
ty1=0;
}
if(maze[tx2][ty2]=='i'){
sudu=rand()%2;
char enemyName[5][1000]={"恶金城小兵","灵焰组织喽啰","恶金城团长","Him","实体303"};
int enemyAtt[5][4]={{60,60,50,0},
{70,60,60,0},
{90,60,50,20},
{100,100,80,50},
{200,150,60,80}};
int enemyMoney[5]={30,50,80,100,500};
int sudu=rand()%2,temp=rand()%5,temp0=rand()%5;
cout<<"当前敌人:"<<enemyName[temp]<<endl;
for(int i=0;i<4;i++){
cout<<playatt[i]<<":"<<enemyAtt[temp][i]<<endl;
}
cout<<"瞳孔颜色:";
if(enemyzong[temp]>=1&&enemyzong[temp]<=99){
color(0);
cout<<"黑"<<endl;
color(7);
}
else if(enemyzong[temp]>=100&&enemyzong[temp]<=149){
color(8);
cout<<"灰"<<endl;
color(7);
}
else if(enemyzong[temp]>=150&&enemyzong[temp]<=199){
color(6);
cout<<"黄"<<endl;
color(7);
}
else if(enemyzong[temp]>=200&&enemyzong[temp]<=249){
color(12);
cout<<"橙"<<endl;
color(7);
}
else if(enemyzong[temp]>=250&&enemyzong[temp]<=299){
color(2);
cout<<"绿"<<endl;
color(7);
}
else if(enemyzong[temp]>=300&&enemyzong[temp]<=449){
color(9);
cout<<"蓝"<<endl;
color(7);
}
else if(enemyzong[temp]>=450&&enemyzong[temp]<=699){
color(5);
cout<<"紫"<<endl;
color(7);
}
else if(enemyzong[temp]>=700&&enemyzong[temp]<=799){
color(15);
cout<<"白"<<endl;
color(7);
}
else if(enemyzong[temp]>=800){
color(4);
cout<<"红"<<endl;
color(7);
}
cout<<"赏金:"<<enemyMoney[temp]<<endl;
cout<<"当前属性如下:"<<endl;
for(int i=0;i<5;i++){
if(player[i]>=120){
color(4);
cout<<playatt[i]<<":"<<player[i]<<endl;
}
else if(player[i]>=80){
color(6);
cout<<playatt[i]<<":"<<player[i]<<endl;
}
else if(player[i]<=30){
color(2);
cout<<playatt[i]<<":"<<player[i]<<endl;
}
else{
color(7);
cout<<playatt[i]<<":"<<player[i]<<endl;
}
color(7);
}
cout<<"瞳孔颜色:";
if(zong>=1&&zong<=99){
color(0);
cout<<"黑"<<endl;
color(7);
}
else if(zong>=100&&zong<=149){
color(8);
cout<<"灰"<<endl;
color(7);
}
else if(zong>=150&&zong<=199){
color(6);
cout<<"黄"<<endl;
color(7);
}
else if(zong>=200&&zong<=249){
color(12);
cout<<"橙"<<endl;
color(7);
}
else if(zong>=250&&zong<=299){
color(2);
cout<<"绿"<<endl;
color(7);
}
else if(zong>=300&&zong<=449){
color(9);
cout<<"蓝"<<endl;
color(7);
}
else if(zong>=450&&zong<=699){
color(5);
cout<<"紫"<<endl;
color(7);
}
else if(zong>=700&&zong<=799){
color(15);
cout<<"白"<<endl;
color(7);
}
else if(zong>=800){
color(4);
cout<<"红"<<endl;
color(7);
}
color(7);
cout<<"是否迎战(y/n)"<<endl;
cin>>user;
if(user=='y'){
if(enemyAtt[temp][2]>player[2]){
cout<<"武功真气不够,被抢劫了"<<endl;
player[4]-=rand()%16*temp;
}
else{
if(sudu==0){
cout<<"你抽到后手"<<endl;
while(enemyAtt[temp][1]>0){
biao=0;
temp0=rand()%5;
int temp1=rand()%5;
if(player[1]<0){
cout<<"你去世了"<<endl;
yyds=0;
break;
}
int attack1=enemyAtt[temp][0]-player[3];
if(temp0==0){
attack1*=2;
}
else if(temp0==1){
attack1*=1.5;
}
else if(temp0==3){
attack1/=1.5;
}
else if(temp0==4){
attack1/=2;
}
if(fantan=1){
biao=attack1/2;
attack1/=2;
}
if(attack1<0) attack1=0;
cout<<enemyName[temp]<<"发动攻击,"<<buff[temp0]<<"造成"<<attack1<<"伤害"<<endl;
player[1]-=attack1;
int attack2=player[0]-enemyAtt[temp][3];
if(temp1==0){
attack2*=3;
}
else if(temp1==1){
attack2*=2;
}
else if(temp1==3){
attack2/=1.5;
}
else if(temp1==4){
attack2/=2;
}
if(fantan==1) attack2+=biao;
if(attack2<0) attack2=0;
cout<<name<<"发动攻击,"<<buff[temp1]<<"造成"<<attack2<<"伤害"<<endl;
enemyAtt[temp][1]-=attack2;
}
if(player[1]>0){
cout<<"战斗胜利,获得"<<enemyMoney[temp]<<"赏金"<<endl;
player[4]+=enemyMoney[temp];
if(jiez[5]==0&&temp==4&&jiez[0]==1&&jiez[1]==1&&jiez[2]==1&&jiez[3]==1&&jiez[4]==1){
cout<<"你发现303掉落了一瓶不明液体,你将他注入了你的武器中,竟解锁了武器最后一个形态:阿波罗形态!"<<endl;
jie[5]={"你拥有了阿波罗之盾,可反弹50%伤害"};
xing[5]={"阿波罗形态"};
jiez[5]=1;
}
}
}
else if(sudu==1){
cout<<"你抽到先手"<<endl;
while(enemyAtt[temp][1]>0){
temp0=rand()%5;
int temp1=rand()%5;
if(player[1]<0){
cout<<"你去世了"<<endl;
yyds=0;
break;
}
int attack2=player[0]-enemyAtt[temp][3];
if(temp1==0){
attack2*=3;
}
else if(temp1==1){
attack2*=2;
}
else if(temp1==3){
attack2/=1.5;
}
else if(temp1==4){
attack2/=2;
}
if(fantan==1) attack2+=biao;
if(attack2<0) attack2=0;
cout<<name<<"发动攻击,"<<buff[temp1]<<"造成"<<attack2<<"伤害"<<endl;
enemyAtt[temp][1]-=attack2;
int attack1=enemyAtt[temp][0]-player[3];
if(temp0==0){
attack1*=2;
}
else if(temp0==1){
attack1*=1.5;
}
else if(temp0==3){
attack1/=1.5;
}
else if(temp0==4){
attack1/=2;
}
if(fantan=1){
biao=attack1/2;
attack1/=2;
}
if(attack1<0) attack1=0;
cout<<enemyName[temp]<<"发动攻击,"<<buff[temp0]<<"造成"<<attack1<<"伤害"<<endl;
player[1]-=attack1;
}
if(player[1]>0){
cout<<"战斗胜利,获得"<<enemyMoney[temp]<<"赏金"<<endl;
player[4]+=enemyMoney[temp];
if(jiez[5]==0&&temp==4&&jiez[0]==1&&jiez[1]==1&&jiez[2]==1&&jiez[3]==1&&jiez[4]==1){
cout<<"你发现303掉落了一瓶不明液体,你将他注入了你的武器中,竟解锁了武器最后一个形态:阿波罗形态!"<<endl;
jie[5]={"你拥有了阿波罗之盾,可反弹50%伤害"};
xing[5]={"阿波罗形态"};
jiez[5]=1;
}
}
}////
}
}
else{
int d;
d=rand()%2;
if(d==0){
cout<<"你悄悄逃跑,成功了"<<endl;
}
else if(d==1){
cout<<"你悄悄逃跑,但被发现了,被勒索了十枚武币"<<endl;
player[4]-=10;
}
}
system("pause");
tx2=0;
ty2=0;
}
}
}
else if(ch=='g'){
cout<<" *** "<<endl;
cout<<"* $ * :"<<player[4]<<endl;
cout<<" *** "<<endl;
char item[11][100]={"木剑","青金石","铁套","钻石剑","绿宝石","风之戒指","天堂陨落长弓","灭霸手套","无尽套装","创世之刃","氪金萝莉"};
int prices[11]={10,10,10,20,50,50,200,200,300,500,2000};
int index[5]={-1,-1,-1,-1,-1};
int itemAtt[11][4]={{10,0,0,0},{0,0,20,0},{0,0,0,20},{40,0,0,0},{0,60,0,0},{0,20,30,0}, {300,0,0,0},{20,100,100,20},{0,200,150,200},{1000,0,0,0},{10000000,1000000,1000000,1000000}};
for(int i=0;i<5;i++){
index[i]=rand()%11;
for(int j=0;j<i;j++){
if(index[i]==index[j]){
i--;
}
}
}
for(int i=0;i<5;i++){
if(index[i]<3){
color(15);
}else if(index[i]<6){
color(10);
}else if(index[i]<8){
color(1);
}
else{
color(5);
}
cout<<(i+1)<<" "<<item[index[i]]<<" ";
cout<<"价格"<<prices[index[i]]<<endl;
cout<<" "<<"装备属性值:";
for(int j=0;j<4;j++){
cout<<playatt[j]<<":"<<itemAtt[index[i]][j]<<" ";
}
cout<<endl;
color(15);
}
cout<<"按6退出(有BUG,别用)"<<endl;
cout<<"其他键自杀"<<endl;
cout<<"请问你要购买几号装备?(数字)"<<endl;
int user2;
cin>>user2;
if(user2>=1&&user2<=5&&player[4]>=prices[index[user2-1]]){
cout<<"成功购买"<<item[index[user2-1]]<<endl;
player[4]-=prices[index[user2-1]];
for(int i = 0;i < 10;++i){ //将买完的装备放到装备列表中
if(aaa[i] == -1){
aaa[i] = index[user2-1];
break;
}
}
for(int i = 0;i < 4;++i){ //根据装备属性,提升角色对应属性
if(itemAtt[index[user2-1]][i] != 0){
cout <<"获得"<< playatt[i]<<itemAtt[index[user2-1]][i]<<"点"<<endl;
player[i]+= itemAtt[index[user2-1]][i];
}
}
system("pause");
}
else if(user==6){
cout<<name<<"离开了商店"<<endl;
system("pause");
month--;
}
else{
yyds=0;
break;
}
}
else if(ch=='s'){
cout<<name<<"疯狂修炼中"<<endl;
for(int i=0;i<3;i++){
int temp=rand()%2;
cout<<event[temp]<<endl;
Sleep(2000);
if(temp==0){
player[0]+=rand()%25;
player[2]+=rand()%25;
}
else if(temp==1){
player[0]-=rand()%15;
player[2]-=rand()%15;
}
}
cout<<"在此修炼,需支付武币"<<endl;
system("pause");
player[4]-=rand()%20;
}
else if(ch=='m'){
if(cc==0){
cout<<"你:作弊码是什么?"<<endl;
Sleep(2000);
cout<<"官方:就不告诉你!气死你!"<<endl;
Sleep(2000);
cout<<"神仙:既然你诚心诚意地发问了,我就大发慈悲的告诉你"<<endl<<" 作弊码就是作者的学号1与学号2与lucky number的拔"<<endl;
Sleep(2000);
cout<<"宝箱:请问作弊码是几?"<<endl;
cin>>zuobima;
if(zuobima==10427){
cout<<"你成功打开了作弊宝箱,功力大增,所有属性+50"<<endl;
for(int i=0;i<5;i++){
player[i]+=50;
}
}
else if(zuobima==42107){
cout<<"你成功打开了作弊宝箱,功力大增,解锁全部武器形态"<<endl;
jiez[1]=1;
jiez[2]=1;
jiez[3]=1;
jiez[4]=1;
jiez[5]=1;
system("pause");
}
else{
cout<<"你因乱输作弊码,激怒了众神,功力大减"<<endl;
for(int i=0;i<5; i++){
player[i]-=30;
}
system("pause");
}
cc++;
}
else{
cout<<"还想重复刷作弊码?不可能!";
Sleep(2000);
month-- ;
}
}
else if(ch=='x'){
cout<<"当前属性如下:"<<endl;
for(int i=0;i<5;i++){
if(player[i]>=120){
color(4);
cout<<playatt[i]<<":"<<player[i]<<endl;
}
else if(player[i]>=80){
color(6);
cout<<playatt[i]<<":"<<player[i]<<endl;
}
else if(player[i]<=30){
color(2);
cout<<playatt[i]<<":"<<player[i]<<endl;
}
else{
color(7);
cout<<playatt[i]<<":"<<player[i]<<endl;
}
}
color(7);
cout<<"瞳孔颜色:";
if(zong>=1&&zong<=99){
color(0);
cout<<"黑"<<endl;
color(7);
}
else if(zong>=100&&zong<=149){
color(8);
cout<<"灰"<<endl;
color(7);
}
else if(zong>=150&&zong<=199){
color(6);
cout<<"黄"<<endl;
color(7);
}
else if(zong>=200&&zong<=249){
color(12);
cout<<"橙"<<endl;
color(7);
}
else if(zong>=250&&zong<=299){
color(2);
cout<<"绿"<<endl;
color(7);
}
else if(zong>=300&&zong<=449){
color(9);
cout<<"蓝"<<endl;
color(7);
}
else if(zong>=450&&zong<=699){
color(5);
cout<<"紫"<<endl;
color(7);
}
else if(zong>=700&&zong<=799){
color(15);
cout<<"白"<<endl;
color(7);
}
else if(zong>=800){
color(4);
cout<<"红"<<endl;
color(7);
}
if(qqmonth!=999){
qqmonth++;
}
if(month!=1){
phb[0]/=1.2;
phb[1]/=1.01;
phb[2]/=1.05;
phb[3]/=1.1;
}
color(7);
system("pause");
month--;
}
else if(ch=='d'){
int eee=rand()%10;
cout<<name<<"来到了饭馆,开始吃饭"<<endl;
if(player[4]<=0){
cout<<"店小二看到你这个衣衫褴褛,身无分文的穷人,骂道:“你这个穷鬼,滚出我的店”,说着把你打出了饭店,血量减少"<<endl;
player[1]-=rand()%10+5;
}
else{
if(eee==0){
cout<<"食物中毒,血量大幅减少"<<endl;
cout<<"你获得了餐厅的补偿"<<endl;
player[1]-=rand()%51+30;
player[4]+=rand()%81+200;
system("pause");
}
else if(eee==1){
cout<<"啊呜,啊呜,真好吃"<<endl;
Sleep(2000);
cout<<"啊呜,啊呜,真好吃"<<endl;
Sleep(2000);
cout<<name<<"支付了许多武币作为饭钱"<<endl;
Sleep(2000);
cout<<"你喝了一瓶酒,回家路上被警察抓到酒驾,罚款了200武币"<<endl;
system("pause");
player[4]-=rand()%25+210;
player[1]+=rand()%30+10;
}
else{
cout<<"啊呜,啊呜,真好吃"<<endl;
Sleep(2000);
cout<<"啊呜,啊呜,真好吃"<<endl;
Sleep(2000);
cout<<name<<"支付了许多武币作为饭钱"<<endl;
Sleep(2000);
player[4]-=rand()%25+10;
player[1]+=rand()%30+10;
system("pause");
}
}
}
else if(ch=='o'){
cout<<name<<"运转真气,真气摄入附魔台中,武功真气减少"<<endl;
int tempi=rand()%7;
cout<<"只见附魔台一阵蓝光闪过,竟附魔出了绝世属性:"<<att[tempi]<<"!"<<endl;
Sleep(2000);
if(tempi==0){
player[0]+=rand()%10;
player[2]-=rand()%10;
}
else if(tempi==1){
player[0]+=rand()%25;
player[2]-=rand()%25;
}
else if(tempi==2){
player[3]+=rand()%10;
player[2]-=rand()%10;
}
else if(tempi==3){
player[3]+=rand()%25;
player[2]-=rand()%25;
}
else if(tempi==4){
player[3]+=rand()%10;
player[0]+=rand()%10;
player[2]-=rand()%15;
}
else if(tempi==5){
player[3]+=rand()%25;
player[0]+=rand()%25;
player[2]-=rand()%40;
}
else if(tempi==6){
player[1]+=rand()%50;
player[0]+=rand()%50;
player[3]+=rand()%50;
player[2]-=rand()%75;
}
system("pause");
}
else if(ch=='e'){
for(int i=0;i<=9;i++){
zd[i]=rand()%20+90;
gum[i]=gum[i]*zd[i]/100;
cout<<i+1<<" "<<gupiao[i]<<" 价格:"<<gum[i]<<" 持有:"<<chiyou[i]<<" 涨跌幅:";//红4绿2
if(zd[i]<100){
color(2);
cout<<"-";
}
if(zd[i]>100){
color(4);
cout<<"+";
}
cout<<zd[i]-100<<"%\n";
color(7);
}
int abcd,id;
abcd=999;
while(abcd){
cout<<"输入1买入,输入2卖出,输入0退出股市\n";
cin>>abcd;
if(abcd==1){
cout<<"你要购买哪一个股票?(输入ID)\n";
cin>>id;
id--;
cout<<"购买多少股?\n";
cin>>abcd;
if(gum[id]*abcd>player[4]){
cout<<"对不起,你的钱不够。\n";
system("pause");
}
else{
cout<<"购买成功!\n";
chiyou[id]+=abcd;
player[4]-=gum[id]*abcd;
system("pause");
}
}
else if(abcd==2){
cout<<"你要出售哪一个股票?(输入ID)\n";
cin>>id;
id--;
cout<<"出售多少股?\n";
cin>>abcd;
if(abcd>chiyou[id]){
cout<<"对不起,你的股票数不够\n";
system("pause");
}
else{
cout<<"出售成功!\n";
chiyou[id]-=abcd;
player[4]+=gum[id]*abcd;
system("pause");
}
}
else{
if(abcd!=0){
cout<<"没有这个操作!\n";
system("pause");
}
}
}
}
else{
cout<<"你当前的选择不存在"<<endl;
month--;
p=0;
}
if(ch!='z'&&ch!='x'&&ch!='n'&&p!=0){
if(jian==20){
cout<<"本月房租,电费和水费共计20武币"<<endl;
}
else if(jian==5){
cout<<"本月水费,电费共计5武币"<<endl;
}
if(kes<=3&&kes>0){
kes--;
}
else if(kes==0){
for(int i=0;i<=3;i++){
player[i]*=4;
}
kes=444;
}
player[4]-=jian;
system("pause");
}
for(int i=0;i<4;i++){
if(player[i]<=10){
MessageBox(0,"请及时查看属性值!","警告",MB_ICONEXCLAMATION);
}
}
for(int o=0;o<4;o++){
if(player[o]<0){
MessageBox(0,"你因属性过低而亡","警告",MB_ICONEXCLAMATION);
yyds=0;
break;
cout<<"当前属性如下:"<<endl;
for(int i=0;i<5;i++){
if(player[i]>=120){
color(4);
cout<<playatt[i]<<":"<<player[i]<<endl;
}
else if(player[i]>=80){
color(6);
cout<<playatt[i]<<":"<<player[i]<<endl;
}
else if(player[i]<=30){
color(2);
cout<<playatt[i]<<":"<<player[i]<<endl;
}
else{
color(7);
cout<<playatt[i]<<":"<<player[i]<<endl;
}
}
}
}
if(player[4]<0){
MessageBox(0,"银行查看了你的经济状况,发现非常糟糕,如果你不在五个月内还清欠款与每月1%的利息,你就会流落街头,最终饿死","警告",MB_ICONEXCLAMATION);
if(qqmonth==999){
qqmonth=5;
}
else if(qqmonth==1){
cout<<"银行变卖了你的全部资产,你穷到吃土,最终饿死了"<<endl;
yyds=0;
break;
}
else{
qqmonth--;
}
player[4]*=1.01;
}
else{
qqmonth=999;
}
}
if(yyds==1){
cout<<"新长老竞选开始了"<<endl;
if(player[0]+player[1]+player[2]+player[3]>=800&&player[4]>=0){
MessageBox(0,"游戏胜利","提示",MB_OK);
cout<<"恭喜你,成为新任长老"<<endl;
}
else{
MessageBox(0,"游戏失败","提示",MB_OK);
cout<<"对不起,你竞选长老失败了"<<endl;
}
cout<<"你的总属性值为:"<<player[0]+player[1]+player[2]+player[3]<<endl;
}
else{
cout<<"你阵亡了"<<endl;
}
cout<<"------------------------------------------------"<<endl;
return 0;
}
代码巨长,2000多行