Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson8-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
a2242478
authored
Mar 16, 2025
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
675aa8bb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
543 additions
and
2 deletions
diy1.py
diy1.py
View file @
a2242478
...
...
@@ -4,6 +4,12 @@ class Hero:
self
.
hp
=
250
self
.
attack
=
40
self
.
name
=
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
combat
(
self
,
enemy
):
# 普通攻击
info1
=
self
.
name
+
"对"
+
enemy
.
name
+
"发起进攻,"
...
...
@@ -25,4 +31,540 @@ class player(Hero)
self
.
attack
=
50
houyi
=
Hero
(
"后羿"
)
print
(
"玩家的血量浙外"
,
player
.
he
)
print
(
"玩家的攻击了为"
,
player
.
attack
)
\ No newline at end of file
print
(
"玩家的攻击了为"
,
player
.
attack
)
houyi
=
player
(
"搜索"
,
"火药"
)
yase
=
Hero
(
"颜色"
)
print
(
30
*
'-'
)
print
(
'战斗开始)
while True:
print("-")
choice=input("取消再发一下九年(1攻击/2这里)")
if choice=="q":
print("有序进行")
break
elif choice=="1":
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