Commit 4ae60682 by BellCodeEditor

save project

parent ef6a51b5
Showing with 12 additions and 3 deletions
...@@ -5,10 +5,18 @@ class Hero(object): ...@@ -5,10 +5,18 @@ class Hero(object):
self.hp = 250 self.hp = 250
self.attack = 40 self.attack = 40
self.name = name self.name = name
self.max_hp = self.hp
class Player(Hero):
def __init__(self,name):
super __init__(slef,name):
def cure(self):
self.hp=self.hp+60
if self.hp>self.max_hp
self.hp=self.max_hp
def combat(): # 攻击
???
yase = Hero("垭瑟") yase = Hero("垭瑟")
houyi= Hero("后羿") houyi = Player("后羿")
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