Commit c0037a09 by BellCodeEditor

save project

parent cc0bf084
Showing with 6 additions and 0 deletions
...@@ -36,6 +36,12 @@ class Player(Hero): # 玩家英雄 ...@@ -36,6 +36,12 @@ class Player(Hero): # 玩家英雄
self.max_hp = self.hp self.max_hp = self.hp
self.hp = 200 self.hp = 200
self.attack = 50 self.attack = 50
def cube(self):
we=random.randint(30,50)
self.hp=self.hp+we
if self.hp>self.max_hp:
self.hp=self.max_hp
print(self.name,'角色血量增加成功目前血量',self.hp)
player = Player("后羿",'射手') player = Player("后羿",'射手')
x=Hero('亚瑟','战士') x=Hero('亚瑟','战士')
print('-'*30) print('-'*30)
......
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