Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson15_1
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
2db63aa3
authored
Jul 02, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
c1e43a62
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
diy1.py
diy1.py
View file @
2db63aa3
...
@@ -8,9 +8,24 @@ class Hero(object):
...
@@ -8,9 +8,24 @@ class Hero(object):
def
combat
(
self
,
enemy
):
# 攻击
def
combat
(
self
,
enemy
):
# 攻击
enemy
.
hp
-=
self
.
attack
enemy
.
hp
-=
self
.
attack
info1
=
self
.
name
+
"这个傻逼向"
+
enemy
.
name
+
"这个傻逼发起公鸡"
info1
=
self
.
name
+
"这个傻逼向"
+
enemy
.
name
+
"这个傻逼发起公鸡,"
info2
=
"死掉了"
+
str
(
self
.
attack
)
+
"个母亲"
info2
=
"死掉了"
+
str
(
self
.
attack
)
+
"个母亲,"
if
enemy
.
hp
>
0
:
info3
=
enemy
.
name
+
"还剩下"
+
str
(
enemy
.
hp
)
+
"个母亲"
info
=
info1
+
info2
+
info3
print
(
info
)
else
:
info3
=
enemy
.
name
+
"母亲没了"
info
=
info1
+
info2
+
info3
print
(
info
)
exit
()
yase
=
Hero
(
"垭瑟"
)
yase
=
Hero
(
"垭瑟"
)
houyi
=
Hero
(
"后羿"
)
houyi
=
Hero
(
"后羿"
)
yase
.
combat
(
houyi
)
yase
.
combat
(
houyi
)
yase
.
combat
(
houyi
)
yase
.
combat
(
houyi
)
yase
.
combat
(
houyi
)
yase
.
combat
(
houyi
)
yase
.
combat
(
houyi
)
yase
.
combat
(
houyi
)
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