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
abe23f94
authored
May 24, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
beb166ed
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
5 deletions
diy1.py
fgh.py
hgdhe.py
jguuhuyuh.py
diy1.py
View file @
abe23f94
...
@@ -2,10 +2,12 @@ import random
...
@@ -2,10 +2,12 @@ import random
class
Hero
(
object
):
class
Hero
(
object
):
def
__init__
(
self
,
name
):
def
__init__
(
self
,
name
):
self
.
name
=
name
self
.
name
=
name
self
.
level
=
1
self
.
level
=
random
.
randint
(
100
,
200
)
self
.
hp
=
250
self
.
hp
=
random
.
randint
(
100
,
20000
)
self
.
attack
=
40
self
.
attack
=
random
.
randint
(
100
,
2000
)
self
.
max_hp
=
self
.
hp
self
.
max_hp
=
self
.
hp
print
(
"角色"
+
self
.
name
+
"创建成功"
)
print
(
"当前等级、血量、攻击力分别为:"
,
self
.
level
,
self
.
hp
,
self
.
attack
)
def
cure
(
self
):
# 治疗
def
cure
(
self
):
# 治疗
self
.
hp
+=
55
self
.
hp
+=
55
...
@@ -31,8 +33,8 @@ class Hero(object):
...
@@ -31,8 +33,8 @@ class Hero(object):
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
=
random
.
randint
(
100
,
20000
)
self
.
attack
=
50
self
.
attack
=
random
.
randint
(
100
,
2000
)
self
.
max_hp
=
self
.
hp
self
.
max_hp
=
self
.
hp
self
.
hero_type
=
hero_type
self
.
hero_type
=
hero_type
print
(
"角色"
+
self
.
name
+
"创建成功,英雄类型为:"
,
self
.
hero_type
)
print
(
"角色"
+
self
.
name
+
"创建成功,英雄类型为:"
,
self
.
hero_type
)
...
...
fgh.py
0 → 100644
View file @
abe23f94
print
(
"a
\n
bc"
)
\ No newline at end of file
hgdhe.py
0 → 100644
View file @
abe23f94
jguuhuyuh.py
0 → 100644
View file @
abe23f94
dictl
=
{
'埃隆马斯克'
:
15
,
'苏维埃'
:}
print
(
dictl
dictl
[
h
]
=
'苏 ,9LOP0GGDE
\ 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