Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
struct_cym
游戏编写
提交
8e2f4e07
游
游戏编写
项目概览
struct_cym
/
游戏编写
通知
5
Star
2
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
游
游戏编写
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
8e2f4e07
编写于
9月 11, 2021
作者:
struct_cym
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update game.cpp
上级
db266d33
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
99 addition
and
8 deletion
+99
-8
game.cpp
game.cpp
+99
-8
未找到文件。
game.cpp
浏览文件 @
8e2f4e07
...
...
@@ -78,12 +78,12 @@ struct xu{
string
boxx
;
}
boxs
[
N
];
bool
jineng
[
100
]
;
bool
jineng
[
100
]
=
{
0
,
1
};
//
int
grade
=
1
;
int
blood
[
101
]
=
{
0
,
100
};
int
experience
[
101
];
string
name
;
int
option
,
attribute
,
flag_box
[
N
],
flag_bag
[
N
],
exits
,
savage
,
times
,
attack
=
1
,
defense
=
1
;
int
option
,
attribute
,
flag_box
[
N
],
flag_bag
[
N
],
exits
,
savage
,
times
,
attack
=
5
,
defense
=
1
;
int
jinyan
;
int
baoji
=
5
;
int
sum_level
[
101
]
=
{};
...
...
@@ -95,7 +95,7 @@ int main(){
start
();
pretreatment
();
cout
<<
endl
<<
"请输入你所要的属性"
<<
endl
;
cout
<<
"1.金 2.木 3.水 4.火 5.土"
;
cout
<<
"1.金 2.木 3.水 4.火 5.土"
<<
endl
;
cin
>>
attribute
;
board
();
cin
>>
option
;
...
...
@@ -327,7 +327,7 @@ void lingdong(){
}
}
while
(
true
){
int
sum
=
0
;
int
y1
=
boss_shanghai
(
x
);
tema
-=
y1
+
jianshang
(
defense
);
cout
<<
"碧水金睛兽打出了"
<<
y1
<<
"点伤害"
<<
endl
;
...
...
@@ -339,6 +339,27 @@ void lingdong(){
grade
--
;
return
;
}
for
(
int
i
=
1
;
i
<=
5
;
i
++
){
if
(
jineng
[
i
]
&&
i
==
1
&&
sum
==
5
){
cout
<<
"火神术--"
<<
endl
;
cout
<<
"焚毁!"
<<
endl
;
temb
-=
5
*
10
+
attack
;
cout
<<
name
<<
"打出了"
<<
5
*
10
+
attack
<<
"点伤害"
<<
endl
;
cout
<<
"太古龙象还剩"
<<
temb
<<
"滴血"
<<
endl
;
if
(
temb
<=
0
){
cout
<<
"你赢了"
<<
endl
;
int
n
=
rand
()
%
10
+
1
;
if
(
n
==
1
){
cout
<<
",你获得了太古龙象一只"
<<
endl
;
//加坐骑的属性
}
else
{
cout
<<
",你获得了 龙象牙"
<<
endl
;
}
jinyan
+=
(
double
)
experience
[(
int
)
x
]
/
10
;
return
;
}
}
}
int
y2
=
shanghai
(
attack
);
temb
-=
y2
;
temb
+=
jianshang
(
temf
);
...
...
@@ -346,6 +367,7 @@ void lingdong(){
Sleep
(
1000
);
cout
<<
"碧水金睛兽还剩"
<<
temb
<<
"滴血"
;
Sleep
(
1000
);
sum
++
;
if
(
temb
<=
0
){
cout
<<
"你赢了"
;
int
n
=
rand
()
%
20
+
1
;
...
...
@@ -388,6 +410,7 @@ void lingdong(){
}
}
while
(
true
){
int
sum
=
0
;
int
y1
=
boss_shanghai
(
x
);
tema
-=
y1
+
jianshang
((
int
)
defense
);
cout
<<
"太古龙象打出了"
<<
y1
<<
"点伤害"
<<
endl
;
...
...
@@ -400,6 +423,27 @@ void lingdong(){
return
;
}
cout
<<
endl
;
for
(
int
i
=
1
;
i
<=
5
;
i
++
){
if
(
jineng
[
i
]
&&
i
==
1
&&
sum
==
5
){
cout
<<
"火神术--"
<<
endl
;
cout
<<
"焚毁!"
<<
endl
;
temb
-=
5
*
10
+
attack
;
cout
<<
name
<<
"打出了"
<<
5
*
10
+
attack
<<
"点伤害"
<<
endl
;
cout
<<
"太古龙象还剩"
<<
temb
<<
"滴血"
<<
endl
;
if
(
temb
<=
0
){
cout
<<
"你赢了"
<<
endl
;
int
n
=
rand
()
%
10
+
1
;
if
(
n
==
1
){
cout
<<
",你获得了太古龙象一只"
<<
endl
;
//加坐骑的属性
}
else
{
cout
<<
",你获得了 龙象牙"
<<
endl
;
}
jinyan
+=
(
double
)
experience
[(
int
)
x
]
/
10
;
return
;
}
}
}
int
y2
=
shanghai
((
int
)
attack
);
temb
-=
y2
+
jianshang
(
temf
);
cout
<<
name
<<
"打出了"
<<
y2
<<
"点伤害"
<<
endl
;
...
...
@@ -417,8 +461,9 @@ void lingdong(){
}
jinyan
+=
(
double
)
experience
[(
int
)
x
]
/
10
;
return
;
}
}
cout
<<
endl
;
sum
++
;
}
}
}
else
if
(
option
==
2
){
...
...
@@ -504,7 +549,7 @@ void huo(){
}
}
else
{
cout
<<
"你遇到了---"
<<
endl
;
int
n
=
rand
()
%
2
;
int
n
=
rand
()
%
1
;
if
(
n
==
0
){
double
x
=
rand
()
%
20
;
cout
<<
"熔岩虫"
<<
" "
<<
"等级:"
<<
x
<<
endl
;
...
...
@@ -534,6 +579,7 @@ void huo(){
}
}
while
(
true
){
int
sum
=
0
;
int
y1
=
shanghai
(
x
);
tema
-=
y1
+
jianshang
((
int
)
defense
);
cout
<<
"熔岩虫打出了"
<<
y1
<<
"点伤害"
<<
endl
;
...
...
@@ -546,12 +592,34 @@ void huo(){
return
;
}
cout
<<
endl
;
for
(
int
i
=
1
;
i
<=
5
;
i
++
){
if
(
jineng
[
i
]
&&
i
==
1
&&
sum
==
5
){
cout
<<
"火神术--"
<<
endl
;
cout
<<
"焚毁!"
<<
endl
;
temb
-=
5
*
10
+
attack
;
cout
<<
name
<<
"打出了"
<<
5
*
10
+
attack
<<
"点伤害"
<<
endl
;
cout
<<
"太古龙象还剩"
<<
temb
<<
"滴血"
<<
endl
;
if
(
temb
<=
0
){
cout
<<
"你赢了"
<<
endl
;
int
n
=
rand
()
%
10
+
1
;
if
(
n
==
1
){
cout
<<
",你获得了太古龙象一只"
<<
endl
;
//加坐骑的属性
}
else
{
cout
<<
",你获得了 龙象牙"
<<
endl
;
}
jinyan
+=
(
double
)
experience
[(
int
)
x
]
/
10
;
return
;
}
}
}
int
y2
=
shanghai
((
int
)
attack
);
temb
-=
y2
+
jianshang
(
temf
);
cout
<<
name
<<
"打出了"
<<
y2
<<
"点伤害"
<<
endl
;
Sleep
(
1000
);
cout
<<
"熔岩虫还剩"
<<
temb
<<
"滴血"
<<
endl
;
Sleep
(
1000
);
sum
++
;
if
(
temb
<=
0
){
cout
<<
"你赢了"
<<
endl
;
cout
<<
"你获得了 熔岩宝石"
;
...
...
@@ -596,6 +664,7 @@ void huo(){
}
}
while
(
true
){
int
sum
=
0
;
int
y1
=
shanghai
(
x
);
tema
-=
y1
+
jianshang
((
int
)
defense
);
cout
<<
"熔岩地龙打出了"
<<
y1
<<
"点伤害"
<<
endl
;
...
...
@@ -610,10 +679,32 @@ void huo(){
cout
<<
endl
;
int
y2
=
shanghai
((
int
)
attack
);
temb
-=
y2
+
jianshang
(
temf
);
for
(
int
i
=
1
;
i
<=
5
;
i
++
){
if
(
jineng
[
i
]
&&
i
==
1
&&
sum
==
5
){
cout
<<
"火神术--"
<<
endl
;
cout
<<
"焚毁!"
<<
endl
;
temb
-=
5
*
10
+
attack
;
cout
<<
name
<<
"打出了"
<<
5
*
10
+
attack
<<
"点伤害"
<<
endl
;
cout
<<
"太古龙象还剩"
<<
temb
<<
"滴血"
<<
endl
;
if
(
temb
<=
0
){
cout
<<
"你赢了"
<<
endl
;
int
n
=
rand
()
%
10
+
1
;
if
(
n
==
1
){
cout
<<
",你获得了太古龙象一只"
<<
endl
;
//加坐骑的属性
}
else
{
cout
<<
",你获得了 龙象牙"
<<
endl
;
}
jinyan
+=
(
double
)
experience
[(
int
)
x
]
/
10
;
return
;
}
}
}
cout
<<
name
<<
"打出了"
<<
y2
<<
"点伤害"
<<
endl
;
Sleep
(
1000
);
cout
<<
"熔岩地龙还剩"
<<
temb
<<
"滴血"
<<
endl
;
Sleep
(
1000
);
sum
++
;
if
(
temb
<=
0
){
cout
<<
"你赢了"
<<
endl
;
int
n
=
rand
()
%
10
+
1
;
...
...
@@ -652,7 +743,7 @@ void lu(){
int
shanghai
(
double
gong
){
int
bao
=
0
;
int
n
=
10
*
((
double
)
gong
/
100
);
int
n
=
ceil
(
10
*
((
double
)
gong
/
100
)
);
int
op
=
rand
()
%
100
+
1
;
for
(
int
i
=
1
;
i
<=
baoji
;
i
++
){
ops
[
i
]
=
1
;
...
...
@@ -671,7 +762,7 @@ int jianshang(double fang){
int
boss_shanghai
(
double
gong
){
int
bao
=
0
;
int
n
=
10
*
((
double
)
gong
/
100
);
int
n
=
ceil
(
10
*
((
double
)
gong
/
100
)
);
int
op
=
rand
()
%
100
+
1
;
for
(
int
i
=
1
;
i
<=
baoji
;
i
++
){
ops
[
i
]
=
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录