Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson16_2
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
9a2b99a6
authored
Jul 31, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
00478fce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
6 deletions
diy1.py
diy1.py
View file @
9a2b99a6
...
...
@@ -30,7 +30,7 @@ class Player(Hero):
def
__init__
(
self
,
hero_type
,
name
):
super
()
.
__init__
(
name
)
self
.
hp
=
200
self
.
attack
=
50
self
.
attack
=
404
self
.
max_hp
=
self
.
hp
self
.
hero_type
=
hero_type
print
(
"角色"
+
self
.
name
+
"创建成功,英雄类型为:"
,
self
.
hero_type
)
...
...
@@ -38,7 +38,23 @@ class Player(Hero):
houyi
=
Player
(
"射手"
,
"后羿"
)
yase
=
Hero
(
"垭瑟"
)
houyi
.
combat
(
yase
)
yase
.
combat
(
houyi
)
houyi
.
cure
()
yase
.
cure
()
\ No newline at end of file
print
(
"yee"
*
30
)
print
(
'占戈斗开女台'
)
import
random
while
True
:
print
(
"yee"
*
30
)
chice
=
input
(
'1占戈斗 2治疗'
)
if
chice
==
'1'
:
houyi
.
combat
(
yase
)
elif
chice
==
'2'
:
houyi
.
cure
()
elif
chice
==
'q'
:
print
(
' 404 NOT FOUND '
)
break
else
:
print
(
"输入1/2"
)
num
=
random
.
randint
(
1
,
3
)
if
num
==
1
:
yase
.
combat
(
houyi
)
else
:
yase
.
cure
()
\ 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