新增许多怪,及更新怪的掉落物(钻石)
新增怪怪的技能
给LCR点一个赞吧~~
===上代码===
#include<windows.h>
#include<bits/stdc++.h>//目前为1.18.50版
using namespace std;
int a,b,c,d,ms,maidongxi,e,jiaotan,f,tulong;
void mingzi();
void zhuangtai();
void daoju();
void jifen();
void skill();
void jijiu();
void direnzhuangtai();
void zhandoushengli();
void attack();
void shangdian();
void tulongzhe();
void elonggu();
void xiangganshenm();
struct player{
char name[15];//玩家名
double Armor=1; //护甲值
double blood_volume=10; //血量
double harm=5; //伤害
int diamond=5; //钻石
int experience=0; //经验
int grade=0; //等级
string right_hand[3],left_hand[3]; //左,右手物品
int first_aid_kit=0; //急救包
string tag[100];
int kill=0; //判断玩家是否死亡
}player;
struct monster{
char name[15];//怪物名
double Armor; //护甲值
double blood_volume; //血量
double harm; //伤害
int diamond; //怪物掉落钻石
char prompt[100]; //掉落提示
char skill[100]; //技能
int kill; //判断怪是否死亡
}corpse={"僵尸",2,15,2,3,"掉落3个钻石!","无技能",1},
skeleton={"骷髅",2,10,4,4,"掉落4个钻石!","使用弓箭攻击",1},
wither_skeleton={"凋零骷髅",2,10,4,4,"掉落4个钻石!","无视你的护甲值",1},
creeper={"苦力怕",1,15,15,2,"掉落2个钻石!","没有一下解决掉它会爆炸",1},
slime={"史莱姆",1,10,2,5,"掉落5个钻石!","把你黏住",1},
ender_man={"末影人",5,20,5,10,"掉落10个钻石!","可以瞬移",1},
thunder_dragon={"雷龙",8,50,6,30,"掉落30个钻石!","释放雷电,对你造成二次伤害",1},
fire_dragon={"火龙",12,40,8,30,"掉落30个钻石!","释放火焰,伤害x3",1},
ice_dragon={"冰龙",15,30,6,30,"掉落30个钻石!","无视你的防具",1},
guai={"0",0,0,0,0,"0",0,0};
void mingzi(){
Sleep(500);
cout<<'\n'<<"勇士,请输入你的名字!(15个字符)"<<'\n';
cin>>player.name;
}
void zhuangtai(){
cout<<'\n'<<"钻石:"<<player.diamond<<"个-------经验:"<<player.experience<<"/100-------等级:"<<player.grade<<'\n';
cout<<"护甲值:"<<player.Armor<<"/20-------血量:"<<player.blood_volume<<"/10-------伤害:"<<player.harm<<"/50"<<'\n';
cout<<"左手物品:"<<player.left_hand[1]<<" 右手物品:"<<player.right_hand[1]<<"\n\n";
Sleep(2000);
}
void daoju(){
cout<<"\n急救包:"<<player.first_aid_kit<<" ";
}
void jifen(){
cout<<'\n'<<"查看状态请按1,其余数字跳过查看。"<<'\n';
Sleep(1000);
int chakan;
cin>>chakan;
if(chakan==1){
zhuangtai();
}
}
void skill(){
if(guai.skill=="无技能"){
cout<<guai.name<<"对你造成"<<(guai.harm/player.Armor*1.0)<<"点伤害";
player.blood_volume-=(guai.harm/player.Armor*1.0);
}
if(guai.skill=="使用弓箭攻击"){
cout<<guai.name<<"使用弓箭攻击,对你造成"<<(guai.harm/player.Armor*1.0+1)<<"点伤害";
player.blood_volume-=(guai.harm/player.Armor*1.0+1);
}
if(guai.skill=="无视你的护甲值"){
cout<<guai.name<<"无视护甲值,对你造成"<<(guai.harm*1.0)<<"点伤害";
player.blood_volume-=(guai.harm*1.0);
}
if(guai.skill=="没有一下解决掉它会爆炸"){
cout<<guai.name<<"直接爆炸,对你造成"<<(guai.harm/player.Armor*1.0)<<"点伤害";
player.blood_volume-=(guai.harm/player.Armor*1.0);
guai.kill=0;
}
if(guai.skill=="把你黏住"){
cout<<guai.name<<"黏住你,护甲暂时减2,并对你造成"<<(guai.harm/(player.Armor-2)*1.0)<<"点伤害";
player.blood_volume-=(guai.harm/(player.Armor-2)*1.0);
}
if(guai.skill=="可以瞬移"){
cout<<guai.name<<"瞬移到你这,对你造成"<<(guai.harm/player.Armor*1.0+3)<<"点伤害";
player.blood_volume-=(guai.harm/player.Armor*1.0+3);
}
if(guai.skill=="释放雷电,对你造成二次伤害"){
cout<<guai.name<<"释放雷电,对你造成"<<(guai.harm/player.Armor*1.0)<<"x2点伤害";
player.blood_volume-=(guai.harm/player.Armor*1.0)*2;
}
if(guai.skill=="释放火焰,伤害x3"){
cout<<guai.name<<"释放火焰,对你造成"<<(guai.harm/player.Armor*1.0)<<"x3点伤害";
player.blood_volume-=(guai.harm/player.Armor*1.0+1)*3;
}
if(guai.skill=="无视防具"){
cout<<guai.name<<"无视你的防具,对你造成"<<(guai.harm*1.0)<<"点伤害";
player.blood_volume-=(guai.harm*1.0);
}
}
void jijiu(){
cout<<'\n'<<"当前血量小于0,是否使用急救包?"<<'\n';
cout<<"-----1:查看物品个数----2:使用急救包-----"<<'\n';
Sleep(1000);
int shiyong;
cin>>shiyong;
if(shiyong==1){
zhuangtai();
}
if(shiyong==2){
if(player.first_aid_kit<1){
cout<<"数量不足!"<<'\n';
if(MessageBox(NULL,"你失败了,要再来一次吗","提示",MB_YESNO)==IDYES){
mingzi();
}
else{
player.kill=1;
}
}
if(player.first_aid_kit>=1){
player.first_aid_kit--;
player.blood_volume+=5;
cout<<"使用成功!"<<'\n';
}
}
}
void direnzhuangtai(){
cout<<guai.name<<"的血量:"<<guai.blood_volume;
}
void zhandoushengli(){
if(guai.blood_volume<=0){
cout<<'\n'<<"战斗胜利!你打败了"<<guai.name<<'\n';
guai.kill==0;
Sleep(1000);
xiangganshenm();
}
}
void attack(){
if(player.blood_volume<=0&&player.left_hand[1]=="不死图腾"){
cout<<"不死图腾触发成功!血量恢复至5!"<<'\n';
player.blood_volume=5;
player.left_hand[1]=' ';
}
if(player.blood_volume<=0&&player.left_hand[1]!="不死图腾") jijiu();
cout<<"\n-----1:攻击----2:使用道具/装备----3:查看自己状态----4:查看敌人状态----5:逃走-----\n";
int gongji;
cin>>gongji;
switch(gongji){
case 1:{
guai.blood_volume-=player.harm/guai.Armor*1.0;
cout<<"你攻击"<<guai.name<<",造成了"<<player.harm/guai.Armor*2.0<<"点伤害\n";
zhandoushengli();
Sleep(1000);
cout<<guai.name<<"对你造成"<<guai.harm/player.Armor*2.0<<"点伤害";
player.blood_volume-=guai.harm/player.Armor*2.0;
break;
}
case 2:{
daoju();
break;
}
case 3:{
zhuangtai();
break;
}
case 4:{
direnzhuangtai();
break;
}
}
}
void shangdian(){
cout<<'\n'<<"老板:欢迎来到米奇妙妙屋!你想干什么?"<<'\n';
Sleep(1000);
cout<<"-----1:买东西----2:交谈----3:休息(回复护甲)----4:离开-----"<<'\n';
Sleep(1000);
int mai;
cin>>mai;
switch(mai){
case 1:{
cout<<"老板:有以下几样东西"<<'\n';
Sleep(1000);
cout<<"1:急救包(5钻石)----2:铁胸甲(3钻石)----3:铁大剑(8钻石)----4:不死图腾(6钻石)----5:力量药水(5钻石)----6:工作台(1钻石)----7:附魔苹果(10钻石)"<<'\n';
cin>>maidongxi;
switch(maidongxi){
case 1:{
if(player.diamond>=5){
player.diamond-=5;
player.first_aid_kit++;
MessageBox(NULL,"急救包购买成功!","提示",MB_OK);
}
else MessageBox(NULL,"钻石不足!","提示",MB_OK);
Sleep(1000);
break;
}
case 2:{
if(player.diamond>=3){
player.diamond-=3;
player.Armor+=5;
MessageBox(NULL,"铁胸甲购买成功!护甲值+5!","提示",MB_OK);
}
else MessageBox(NULL,"钻石不足!","提示",MB_OK);
Sleep(1000);
break;
}
case 3:{
if(player.diamond>=8&&player.right_hand[1]!="铁大剑"){
player.diamond-=8;
player.harm+=10000;
player.right_hand[1]="铁大剑";
MessageBox(NULL,"铁大剑购买成功,已置于右手!","提示",MB_OK);
}
else MessageBox(NULL,"钻石不足或是已购买!","提示",MB_OK);
Sleep(1000);
break;
}
case 4:{
if(player.diamond>=6&&player.left_hand[1]!="不死图腾"){
player.diamond-=6;
player.left_hand[1]="不死图腾";
MessageBox(NULL,"不死图腾购买成功,已置于左手!","提示",MB_OK);
}
else MessageBox(NULL,"钻石不足或是已购买!","提示",MB_OK);
Sleep(1000);
break;
}
}
break;
}
case 2:{
cout<<"跟谁交谈?"<<'\n'<<"-----1:女仆----2:面具男----3:老板妻子----4:其余客人-----"<<'\n';
cin>>jiaotan;
switch(jiaotan){
case 1:{
cout<<"女仆:听说南山那里有发现了怪物。"<<'\n';
break;
}
case 2:{
if(player.tag[1]=="发现犯人"){
cout<<"面具男:我已经改邪归正了!"<<'\n';
Sleep(1000);
}
if(player.tag[1]!="发现犯人"){
cout<<"(你去叫了一下面具男)"<<'\n';
Sleep(1000);
cout<<"(他忽然惊慌的浑身抖了一下,只见他的面具掉了下来,他竟然是被通缉的犯人!)"<<'\n';
Sleep(3000);
cout<<"恭喜你发现了犯人,获得10钻石!" <<'\n';
Sleep(2000);
player.diamond+=10;
player.tag[1]="发现犯人";
}
break;
}
case 3:{
cout<<"老板妻子:听说恶龙谷的火龙最近得到了火焰附魔,更厉害了!"<<'\n';
Sleep(1000);
break;
}
case 4:{
cout<<"酒鬼:你也是来这里买饭的吗?哈哈哈哈~~"<<'\n';
Sleep(3000);
cout<<"红衣女子(神情诡异的看了你一眼):疣方块出现在了恶龙谷……"<<'\n';
Sleep(3000);
cout<<"胖男人(跟着说道):说明~嗝!地狱传送门快~嗝!出现了!"<<'\n';
Sleep(3000);
break;
}
}
break;
}
case 3:{
if(player.Armor>=10){
cout<<"护甲值已满,无需休息!"<<'\n';
Sleep(1000);
}
if(player.Armor<10){
if(player.tag[2]!="休息完毕"){
cout<<"休息中。。。"<<'\n';
Sleep(1000);
cout<<"休息完毕!护甲值+2。"<<'\n';
Sleep(1000);
player.tag[2]="休息完毕";
}
if(player.tag[2]=="休息完毕"){
cout<<"您已休息过!"<<'\n';
Sleep(1000);
}
}
break;
}
}
}
void tulongzhe(){
Sleep(500);
cout<<" @@@@@@@@@@"<<'\n'<<" @@@ 传 @@@"<<'\n';
Sleep(500);
cout<<" @@@ 送 @@@"<<'\n';
Sleep(500);
cout<<" @@@ 中 @@@"<<'\n'<<" @@@@@@@@@@"<<'\n'<<'\n';
Sleep(500);
for(int i=5;i>=1;i--){
cout<<i<<' ';
Sleep(970);
}
Sleep(1000);
cout<<'\n'<<"(你进入了一片古老的森林,阳光斜洒,在地上斑驳)"<<'\n';
Sleep(1000);
cout<<"(你的面前有三条道路,一条路电闪雷鸣,另一条路火焰滚滚,最后一条冰天雪地)"<<'\n';
Sleep(2000);
cout<<player.name<<",你想走哪条路?"<<'\n';
Sleep(1000);
cout<<"-----1:电闪雷鸣路----2:火焰滚滚路----3:冰天雪地路----4:逃走"<<'\n';
int lu;
cin>>lu;
if(lu==1){
guai=thunder_dragon;
if(guai.kill==1){
cout<<"\n欢迎来到雷电峡谷,"<<player.name<<"\n";
Sleep(1000);
cout<<"(只见空中阴云密布,峡谷一副破败景象,雷龙栖息在盘龙柱上)\n";
Sleep(2000);
cout<<player.name<<"想到:好强大的气场!\n";
Sleep(1500);
cout<<"(雷龙逐渐睁开了眼睛):小不点,就你也想打败我?\n";
Sleep(1500);
cout<<player.name<<":我不是小不点!\n";
Sleep(1000);
cout<<"雷龙:那你就靠自己的实力证明吧!\n";
Sleep(1000);
while(guai.kill!=0){
attack();
}
}
else{
cout<<"\n这里安全了!\n";
}
}
if(lu==2){
}
if(lu==3){
}
if(lu==4){
Sleep(700);
cout<<" @@@@@@@@@@"<<'\n'<<" @@@ 传 @@@"<<'\n';
Sleep(500);
cout<<" @@@ 送 @@@"<<'\n';
Sleep(500);
cout<<" @@@ 中 @@@"<<'\n'<<" @@@@@@@@@@"<<'\n'<<'\n';
Sleep(500);
for(int i=5;i>=1;i--){
cout<<i<<' ';
Sleep(970);
}
cout<<"逃走成功!"<<'\n';
}
}
void elonggu(){
Sleep(1000);
cout<<'\n'<<player.name<<",欢迎来到恶龙谷!"<<'\n';
Sleep(1000);
cout<<"你在这里想:"<<'\n';
Sleep(1000);
cout<<"-----1:屠龙----2:前往地狱传送门----3:交谈----4:自由探索----5:逃走"<<'\n';
cin>>tulong;
switch(tulong){
case 1:{
tulongzhe();
break;
}
}
}
void xiangganshenm(){
cout<<'\n'<<"请选择你接下来要执行的事情:"<<'\n';
Sleep(1000);
cout<<"-----1:前往商店----2:前往恶龙谷----3:查看状态----4:在地面探索----5:使用物品-----"<<'\n';
cin>>f;
switch(f){
case 1:{
shangdian();
break;
}
case 2:{
elonggu();
break;
}
case 3:{
zhuangtai();
break;
}
}
}
int main(){
MessageBox(NULL,"切勿关闭运行页面!!!","提示",MB_OK);
mingzi();
while(player.kill!=1){
xiangganshenm();
}
MessageBox(NULL,"游戏结束","提示",MB_OK);
return 0;
}