Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson16_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
637d4439
authored
Dec 10, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
164f74ef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
diy1.py
diy1.py
View file @
637d4439
...
...
@@ -25,7 +25,13 @@ class Hero(object):
info
=
info1
+
info2
+
info3
print
(
info
)
exit
()
def
dazhao
(
self
,
enemy
):
if
self
.
hp
>
self
.
max_hp
/
2
:
enemy
.
hp
-=
150
self
.
hp
-=
self
.
max_hp
/
2
print
(
self
.
name
+
"使用大招,对"
+
enemy
+
"造成150伤害"
+
enemy
+
"血量:"
+
str
(
enemy
.
hp
)
+
self
.
name
+
"血量"
+
str
(
self
.
hp
))
else
:
pass
class
Player
(
Hero
):
def
__init__
(
self
,
hero_type
,
name
):
super
()
.
__init__
(
name
)
...
...
@@ -50,9 +56,11 @@ while True:
print
(
"-"
*
30
)
aaa
=
input
(
"请选择释放英雄技能(1攻击/2治疗/q退出)"
)
if
aaa
==
"1"
:
houyi
.
combat
(
yase
)
houyi
.
combat
(
"yase"
)
elif
aaa
==
"2"
:
houyi
.
cure
()
elif
aaa
==
"3"
:
houyi
.
dazhao
(
"yase"
)
elif
aaa
==
"q"
:
exit
()
else
:
...
...
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