Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson13-3
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
0c062487
authored
Sep 11, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
831adf9c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
4 deletions
diy.py
ty.py
diy.py
View file @
0c062487
import
random
def
__init__
Hero
(
self
):
self
.
hp
=
250
self
.
max_hp
=
self
.
hp
houyi
=
Player
(
'射手'
,
'后羿'
)
Yase
=
Hero
def
cure
(
self
):
blood
=
random
.
randint
(
30
,
61
)
self
.
hp
+=
blood
if
self
.
hp
>
self
.
max_hp
:
self
.
hp
=
self
.
max_hp
print
(
self
.
name
+
'恢复了'
+
blood
+
"点血量,当前血量为"
+
self
.
hp
)
print
(
'-'
*
30
)
print
(
'-'
*
30
)
print
(
' 战斗开始'
)
print
(
' 战斗开始'
)
while
True
:
while
True
:
print
(
'-'
*
30
)
print
(
'-'
*
30
)
choise
=
input
(
'请选择释放英雄的技能:(1.攻击 2.治疗):'
)
choise
=
input
(
'请选择释放英雄的技能:(1.攻击 2.治疗):'
)
if
choise
==
'q'
:
if
choise
==
'q'
:
...
@@ -17,4 +30,9 @@ while True:
...
@@ -17,4 +30,9 @@ while True:
houyi
.
cure
()
houyi
.
cure
()
else
:
else
:
print
(
"输入错误,请重新输入!"
)
print
(
"输入错误,请重新输入!"
)
continue
continue
\ No newline at end of file
status
=
random
.
randint
(
1
,
3
)
if
status
==
1
:
yase
.
combat
(
houyi
)
else
:
yase
.
cure
()
\ No newline at end of file
ty.py
0 → 100644
View file @
0c062487
import
turtle
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment