提交 93f96e74 编辑于 作者: 哲昊 周's avatar 哲昊 周
浏览文件

Upload New File

上级 50ea5f71
#include <Windows.h>
#include <iostream>
#include<conio.h>
#include "Prepare.h"
#define W Sleep(1000);//延时一秒
using namespace std;
void Battle::Battle_Shabao() //打沙暴
{
system("cls");
cout << "开始讨伐“沙暴”" << endl;
//定义主角对怪物杀伤 和怪物对主角杀伤
int* pKillValue = new int(0);//初始值
int* mKillValue = new int(0);
int count = 0;
int* HuiHe = new int;//回合制初始化
*HuiHe = 0;
life = LifeValue;
g_life = g_LifeValue[2];
zhi1 = true;
feng1 = false;
feng2 = 0;
int* XuanZe = new int;
//战斗循坏
while (1)
{
count++;
(*HuiHe)++;//第二回合
W
cout << endl << "现在是第" << *HuiHe << "回合!" << endl;
cout << "请选择你的动作:\n";
cout << "1、攻击\n2、使用凭风而起(飞至空中躲避此回合的伤害,每次战斗可用三次)\n3、逃跑\n";
cin >> *XuanZe;
switch (*XuanZe)
{
case 1:
cout << "你砍向“沙暴”!" << endl; W
g_life -= Attack;//一次攻击 小怪剩余
*mKillValue = Attack;
cout << "造成了" << *mKillValue << "的伤害" << endl;
cout << "“沙暴”还剩" << g_life << "点生命" << endl;
break;
case 2:
Pingfengerqi();
break;
case 3://逃跑 继续进行
cout << "你决定逃跑!" << endl; W
Money = (int)Money / 2;
cout << "逃跑成功!" << endl << "但损失了一半的金钱。" << endl;W
break;
default:
cout << "你手忙脚乱,错失机会" << endl;
break;
}
//人物结算
if ((g_life) <= 0) //怪物被杀
{
cout << "“沙暴”被击败" << endl;W
cout << "你成功解救了乌尔波扎,得到了大师之剑碎片*1" << endl;
cout << "你得到了英灵的力量:雷神之怒(造成200%攻击力的雷元素伤害,每次战斗可用两次)" << endl;W
process++;
break;
}
else if (3 == (*XuanZe)) {
break;
}
//怪物反应
if (count == 3)
{
W
cout << endl;
Leibao();
count = 0;
}
else
{
W
cout << endl << "“沙暴”向你攻击!" << endl;W
if (feng1)
{
cout << "英灵之力——凭风而起发动,躲避了这次攻击" << endl;
feng1 = false;
}
else
{
life -= ((g_Attack[2]) - Defense);//攻击剩余生命
*pKillValue = (g_Attack[2]) - Defense;
cout << "“沙暴”打掉了你" << *pKillValue << "点生命" << endl;
cout << "你还剩" << life << "点生命" << endl;
}
}
//怪物结算
if (life <= 0 && zhi1) //治愈之力发动
{
Zhiyuzhili();
}
else if (life <= 0) //你被杀死
{
cout << "你被“沙暴”击败,身负重伤" << endl; W
cout << "失去了所有金钱" << endl;
Money = 0;
break;
}
}
//末尾
char input;
delete pKillValue;
delete mKillValue;
delete XuanZe;
delete HuiHe;
do {
cout << "按下空格继续" << endl;
input = _getch();
} while (input != 32);
Battle_Map();
}
\ No newline at end of file
支持 Markdown
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册