Commit 0139eb92 by BellCodeEditor

auto save

parent 6744184f
...@@ -37,7 +37,7 @@ class Player(Hero): ...@@ -37,7 +37,7 @@ class Player(Hero):
print("角色"+self.name+"创建成功,英雄类型为:", self.hero_type) print("角色"+self.name+"创建成功,英雄类型为:", self.hero_type)
print("当前等级、血量、攻击力分别为:",self.level,self.hp,self.attack) print("当前等级、血量、攻击力分别为:",self.level,self.hp,self.attack)
def cure(self): # 治疗 def cure(self): # 治疗
a = random.randint(30,50) a = random.randint(100,500)
self.hp=self.hp+a self.hp=self.hp+a
if self.hp > self.max_hp: if self.hp > self.max_hp:
self.hp=self.max_hp self.hp=self.max_hp
......
print(dog1.co)class Dog:
def __init__(self,co):
self.T1=4
self.E1=2
self.Y1=2
self.co=co
dog1 = Dog("红色")
\ No newline at end of file
class Animal():
def __init__(self):
self.foot=4
self.color="white"
self.wi
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