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
a9fff9f5
authored
Mar 27, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
70613bea
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletions
diy1.py
diy1.py
View file @
a9fff9f5
...
@@ -39,10 +39,25 @@ class Player(Hero):
...
@@ -39,10 +39,25 @@ class Player(Hero):
print
(
"当前等级、血量、攻击力分别为:"
,
self
.
level
,
self
.
hp
,
self
.
attack
)
print
(
"当前等级、血量、攻击力分别为:"
,
self
.
level
,
self
.
hp
,
self
.
attack
)
houyi
=
Player
(
"射手"
,
"后羿"
)
houyi
=
Player
(
"射手"
,
"后羿"
)
yase
=
Hero
(
"
垭
瑟"
)
yase
=
Hero
(
"
亚
瑟"
)
print
(
" "
*
30
)
print
(
" "
*
30
)
print
(
" "
*
4
,
"战斗开始"
)
print
(
" "
*
4
,
"战斗开始"
)
while
True
:
while
True
:
print
(
" "
*
30
)
print
(
" "
*
30
)
chose
=
input
(
"请选择(1/攻击 2/治疗)"
)
chose
=
input
(
"请选择(1/攻击 2/治疗)"
)
print
(
" "
*
30
)
print
(
" "
*
30
)
if
chose
==
"q"
:
print
(
"游戏结束"
)
break
elif
chose
==
"1"
:
houyi
.
combat
(
yase
)
elif
chose
==
"2"
:
houyi
.
cure
()
else
:
print
(
"无效,请重新输入,(1/攻击 2/治疗)"
)
a
=
random
.
randint
(
1
,
3
)
if
a
==
1
:
yase
.
cure
()
else
:
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