Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson16_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
57faab64
authored
Feb 17, 2024
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
beb166ed
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
diy1.py
wwww.py
diy1.py
View file @
57faab64
...
@@ -28,7 +28,7 @@ class Hero(object):
...
@@ -28,7 +28,7 @@ class Hero(object):
print
(
'你干嘛啊~~'
)
print
(
'你干嘛啊~~'
)
exit
()
exit
()
class
Player
(
Hero
):
用了治疗,血
class
Player
(
Hero
):
def
__init__
(
self
,
hero_type
,
name
):
def
__init__
(
self
,
hero_type
,
name
):
super
()
.
__init__
(
name
)
super
()
.
__init__
(
name
)
self
.
hp
=
200
self
.
hp
=
200
...
@@ -44,7 +44,7 @@ class Player(Hero):
...
@@ -44,7 +44,7 @@ class Player(Hero):
self
.
hp
+=
c
self
.
hp
+=
c
if
self
.
hp
>
self
.
max_hp
:
if
self
.
hp
>
self
.
max_hp
:
self
.
hp
=
self
.
max_hp
self
.
hp
=
self
.
max_hp
print
(
self
.
name
+
"使
用了治疗,血
量增加:"
,
str
(
c
),
",目前的血量为:"
,
self
.
hp
)
print
(
self
.
name
+
"使量增加:"
,
str
(
c
),
",目前的血量为:"
,
self
.
hp
)
houyi
=
Player
(
"射手"
,
"后羿"
)
houyi
=
Player
(
"射手"
,
"后羿"
)
yase
=
Hero
(
"垭瑟"
)
yase
=
Hero
(
"垭瑟"
)
...
...
wwww.py
0 → 100644
View file @
57faab64
class
Playear
(
hero
):
def__init__
(
fdgyf
xjbdgbcyg
)
super
()
.
_init_name
self
.
hp
=
200
self
.
attack
=
50
self
.
max_hp
=
hero_type
houyi
=
Playear
()
yase
=
hero
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