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

Upload New File

上级 a7c6f233
#include <Windows.h>
#include <iostream>
#include<conio.h>
#include "Prepare.h"
#define W Sleep(1000);//延时一秒
using namespace std;
void Battle::Battle_hongliu() //打洪流
{
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[1];
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 << "你得到了英灵的力量:治愈之力(死亡后复活至半血,每次战斗可用一次)" << endl;W
process++;
break;
}
else if (3 == (*XuanZe)) {
break;
}
//怪物反应
if (count == 3)
{
W
cout << endl << "“洪流”开始蓄力”,水元素正在聚集" << endl;
}
else if (count == 4)
{
cout << endl;
Xuanwo();
count = 0;
}
else
{
W
cout << endl<< "“洪流”向你攻击!" << endl;W
if (feng1)
{
cout << "英灵之力——凭风而起发动,躲避了这次攻击" << endl;
feng1 = false;
}
else
{
life -= ((g_Attack[1]) - Defense);//攻击剩余生命
*pKillValue = (g_Attack[1]) - Defense;
cout << "“洪流”打掉了你" << *pKillValue << "点生命" << endl;
cout << "你还剩" << life << "点生命" << endl;
}
}
//怪物结算
if (life <= 0) //你被杀死
{
cout << "你被“洪流”击败,身负重伤" << endl; W
cout << "失去了所有金钱" << endl;
Money = 0;
break;
}
}
//末尾
delete pKillValue;
delete mKillValue;
delete XuanZe;
delete HuiHe;
char input;
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.
先完成此消息的编辑!
想要评论请 注册