Commit f07b6bb2 by BellCodeEditor

save project

parent c4ac6c04
Showing with 7 additions and 1 deletions
# 英雄角色类 # 英雄角色类
class Hero(object): class Hero:
def __init__(self, name): def __init__(self, name):
self.level = 1 self.level = 1
self.hp = 250 self.hp = 250
...@@ -16,6 +16,11 @@ class Hero(object): ...@@ -16,6 +16,11 @@ class Hero(object):
c5=enemy.name+'已阵亡' c5=enemy.name+'已阵亡'
c4=c1+c2+c3 c4=c1+c2+c3
print(c4) print(c4)
class player(Hero):
def __init__(self, name)
super.__init__(self, name)
self.hp = 200
self.attack = 40
yase = Hero("垭瑟") yase = Hero("垭瑟")
houyi= Hero("后羿") houyi= Hero("后羿")
yase.combat(houyi) yase.combat(houyi)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment