Commit 46968e4a by BellCodeEditor

save project

parent d7fc980c
Showing with 10 additions and 2 deletions
...@@ -4,9 +4,17 @@ class Hero(object): ...@@ -4,9 +4,17 @@ class Hero(object):
self.level = 1 self.level = 1
self.hp = 250 self.hp = 250
self.attack = 40 self.attack = 40
self.name = name self.max_hp = self.hp
def combat(): # 攻击 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 + "对" + str(enemy.hp) + "血量"
info2 = "造成" +
yase = Hero("垭瑟") yase = Hero("垭瑟")
......
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