Skip to content
GitLab
菜单
项目
群组
代码片段
/
帮助
帮助
支持
社区论坛
快捷键
?
提交反馈
登录/注册
切换导航
菜单
打开侧边栏
哲昊 周
Zelda
提交
670399bb
提交
670399bb
编辑于
12月 21, 2021
作者:
哲昊 周
浏览文件
Upload New File
上级
69f49f3e
变更
1
Hide whitespace changes
Inline
Side-by-side
kuangfeng.cpp
0 → 100644
浏览文件 @
670399bb
#include
<Windows.h>
#include
<iostream>
#include
<conio.h>
#include
"Prepare.h"
#define W Sleep(1000);//延时一秒
using
namespace
std
;
void
Battle
::
Battle_Kuangfeng
()
//打狂风
{
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
[
0
];
longjuan
=
0
;
int
*
XuanZe
=
new
int
;
//战斗循坏
while
(
1
)
{
count
++
;
(
*
HuiHe
)
++
;
//第二回合
W
cout
<<
endl
<<
"现在是第"
<<
*
HuiHe
<<
"回合!"
<<
endl
;
if
(
longjuan
==
1
)
{
cout
<<
"你被击飞,此回合无法行动"
<<
endl
;
W
longjuan
=
0
;
}
else
{
cout
<<
"请选择你的动作:
\n
"
;
cout
<<
"1、攻击
\n
2、逃跑
\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
:
//逃跑 继续进行
cout
<<
"你决定逃跑!"
<<
endl
;
W
Money
=
(
int
)
Money
/
2
;
cout
<<
"逃跑成功!"
<<
endl
<<
"但损失了一半的金钱。"
<<
endl
;
W
break
;
default:
cout
<<
"你手忙脚乱,错失机会"
<<
endl
;
break
;
}
}
//人物结算
if
((
g_life
)
<=
0
)
//怪物被杀
{
W
cout
<<
endl
<<
"“狂风”被击败"
<<
endl
;
W
cout
<<
"你成功解救了力巴尔,得到了大师之剑碎片*1"
<<
endl
;
cout
<<
"你得到了英灵的力量:凭风而起(飞至空中躲避此回合的伤害,每次战斗可用三次)"
<<
endl
;
W
process
++
;
break
;
}
else
if
(
2
==
(
*
XuanZe
))
{
break
;
}
//怪物反应
if
(
count
==
2
)
{
W
cout
<<
endl
;
Longjuan
();
//技能龙卷
count
=
0
;
}
else
{
W
cout
<<
endl
<<
"“狂风”向你攻击!"
<<
endl
;
W
life
-=
((
g_Attack
[
0
])
-
Defense
);
//攻击剩余生命
*
pKillValue
=
(
g_Attack
[
0
])
-
Defense
;
cout
<<
"“狂风”打掉了你"
<<
*
pKillValue
<<
"点生命"
<<
endl
;
cout
<<
"你还剩"
<<
life
<<
"点生命"
<<
endl
;
}
//怪物结算
if
(
life
<=
0
)
//你被杀死
{
cout
<<
endl
<<
"你被“狂风”击败,身负重伤"
<<
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
();
}
编辑
预览
支持
Markdown
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录