初级光能
cout<<"你好!勇敢的勇士!\n丧尸包围了我们的城堡,请求支援!请求支援!!!\n";
cout<<"你好!看起来你需要帮助,我可以做些什么?\n";
cout<<"1.武器店"<<endl<<"2.药品店"<<endl<<"3.刷僵尸"<<endl<<"4.查看状态"<<endl<<"5.退出游戏"<<endl;
int a;
cin>>a;
if(a==1){
cout<<"你有"<<jq<<"枚金钱\n";
cout<<"1.小刀(10)\n2.长矛(30)\n3.双截棍(50)\n4.盾牌(100)\n5.铠甲(150)\n";
int b;
cin>>b;
if(b==1){
if(jq>=10){
cout<<"购买成功\n";
gj=gj+10;
jq=jq-10;
cout<<"你还有"<<jq<<"枚金钱\n";
}
else{
cout<<"钱不够\n";
}
}
if(b==2){
if(jq>=30){
cout<<"购买成功\n";
gj=gj+30;
jq=jq-30;
cout<<"你还有"<<jq<<"枚金钱\n";
}
else{
cout<<"钱不够\n\n";
}
}
if(b==3){
if(jq>=50){
cout<<"购买成功\n";
gj=gj+50;
jq=jq-50;
cout<<"你还有"<<jq<<"枚金钱\n";
}
else{
cout<<"钱不够\n";
}
}
if(b==4){
if(jq>=100){
cout<<"购买成功\n";
gj=gj+100;
jq=jq-100;
cout<<"你还有"<<jq<<"枚金钱\n";
}
else{
cout<<"钱不够\n";
}
}
if(b==5){
if(jq>=150){
cout<<"购买成功\n";
gj=gj+150;
jq=jq-150;
cout<<"你还有"<<jq<<"枚金钱\n";
}
else{
cout<<"钱不够\n";
}
}
}
if(a==2){
cout<<"你有"<<jq<<"枚金钱\n";
cout<<"1.1瓶药水(10)\n2.3瓶药水(30)\n3.4瓶药水(50)\n4.7瓶药水100)\n5.9瓶药水(150)\n";
int c;
cin>>c;
if(c==1){
if(jq>=10){
cout<<"购买成功\n";
sm=sm+10;
jq=jq-10;
cout<<"你还有"<<jq<<"枚金钱\n";
}
else{
cout<<"钱不够\n";
}
}
if(c==2){
if(jq>=30){
cout<<"购买成功\n";
sm=sm+30;
jq=jq-30;
cout<<"你还有"<<jq<<"枚金钱\n";
}
else{
cout<<"钱不够\n";
}
}
if(c==3){
if(jq>=50){
cout<<"购买成功\n";
sm=sm+50;
jq=jq-50;
cout<<"你还有"<<jq<<"枚金钱\n";
}
else{
cout<<"钱不够\n";
}
}
if(c==4){
if(jq>=100){
cout<<"购买成功\n";
sm=sm+100;
jq=jq-100;
cout<<"你还有"<<jq<<"枚金钱\n";
}
else{
cout<<"钱不够\n";
}
}
if(c==5){
if(jq>=150){
cout<<"购买成功\n";
sm=sm+150;
jq=jq-150;
cout<<"你还有"<<jq<<"枚金钱\n";
}
else{
cout<<"钱不够\n";
}
}
}
if(a==3){
cout<<"选择怪物\n";
cout<<"1.僵尸\n";
cout<<"2.boss\n";
int e;
cin>>e;
if(e==1){
cout<<"开始刷僵尸,请选择\n";
cout<<"1.攻击\n2.逃跑\n";
int d;
cin>>d;
if(d==1){
cout<<"正在攻击......\n";
cout<<"僵尸攻击了你\n";
sm=sm-25;
jssm=jssm-gj;
cout<<"你还剩"<<sm<<"生命\n";
if(jssm<=0){
cout<<"成功\n";
jq=jq+20;
js=js-1;
}
else{
cout<<"失败\n";
}
if(sm==0){
z=100;
}
}
if(d==2){
cout<<"逃跑成功\n";
}
}
if(e==2){
cout<<"开始刷boss,请选择\n";
cout<<"1.攻击\n2.逃跑\n";
int d;
cin>>d;
if(d==1){
cout<<"正在攻击......\n";
cout<<"boss攻击了你\n";
sm=sm-40;
bosssm=bosssm-gj;
cout<<"你还剩"<<sm<<"生命\n";
if(bosssm<=0){
cout<<"成功\n";
jq=jq+20;
boss=boss-1;
}
else{
cout<<"失败\n";
}
if(sm==0){
z=100;
}
}
if(d==2){
cout<<"逃跑成功\n";
}
}
}
if(a==4){
cout<<"你有"<<sm<<"生命\n";
cout<<"你有"<<jq<<"金钱\n";
cout<<"你有"<<gj<<"攻击\n";
cout<<"你有"<<fy<<"防御\n";
}
if(a==5){
cout<<"正在退出......\n";
z=100;
}
if(js==0&&boss==0){
cout<<"谢谢你!帮我们消灭了僵尸!!!";
}
}
cout<<"游戏结束";
//头文件已删除;
//for已删除;
//