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
3 months ago
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
675aa8bb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
542 additions
and
0 deletions
diy1.py
diy1.py
View file @
a2242478
...
@@ -5,6 +5,12 @@ class Hero:
...
@@ -5,6 +5,12 @@ class Hero:
self
.
attack
=
40
self
.
attack
=
40
self
.
name
=
name
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
):
# 普通攻击
def
combat
(
self
,
enemy
):
# 普通攻击
info1
=
self
.
name
+
"对"
+
enemy
.
name
+
"发起进攻,"
info1
=
self
.
name
+
"对"
+
enemy
.
name
+
"发起进攻,"
info2
=
"造成"
+
str
(
self
.
attack
)
+
"点伤害,"
info2
=
"造成"
+
str
(
self
.
attack
)
+
"点伤害,"
...
@@ -26,3 +32,539 @@ class player(Hero)
...
@@ -26,3 +32,539 @@ class player(Hero)
houyi
=
Hero
(
"后羿"
)
houyi
=
Hero
(
"后羿"
)
print
(
"玩家的血量浙外"
,
player
.
he
)
print
(
"玩家的血量浙外"
,
player
.
he
)
print
(
"玩家的攻击了为"
,
player
.
attack
)
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
This diff is collapsed.
Click to expand it.
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