Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
lesson14_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
854b4373
authored
Dec 17, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
0cd794b4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
43 deletions
diy.py
diy.py
View file @
854b4373
class
Hero
:
class
Hero
:
def
__inir__
(
self
,
names
,
ages
,
hps
,
levals
):
def
__init__
(
self
,
name
,
hp
,
attack
):
self
.
name
=
names
self
.
level
=
1
self
.
age
=
ages
self
.
name
=
name
self
.
hp
=
hps
self
.
hp
=
hp
self
.
leval
=
levals
self
.
attack
=
attack
houyi
=
Hero
(
"后忆"
,
100
,
100000
,
1980
)
self
.
max_hp
=
self
.
hp
print
(
houyi
.
name
)
def
cure
(
self
):
self
.
hp
=
self
.
hp
+
60
if
self
.
hp
>
self
.
max_hp
:
self
.
hp
=
self
.
max_hp
print
(
self
.
name
+
""
:,
60
""
),
self
.
hp
def
upgrade
(
self
):
self
.
level
=
self
.
level
+
1
self
.
hp
=
self
.
hp
+
50
self
.
attack
=
self
.
attack
+
5
houyi
=
player
(
"射手"
,
"后羿"
)
yase
=
Hero
(
"亚瑟"
)
print
(
'-'
*
30
)
print
(
' 战斗开始'
)
while
True
:
print
(
"-"
*
30
)
choice
=
input
(
"请选择释放英雄技能(1/2)"
)
...
...
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