Commit 8aa96f21 by BellCodeEditor

auto save

parent f040fc5f
Showing with 11 additions and 2 deletions
...@@ -28,6 +28,14 @@ class Player(Hero): # 玩家英雄 ...@@ -28,6 +28,14 @@ class Player(Hero): # 玩家英雄
print(str(name)+"创建") print(str(name)+"创建")
print("等级"+str(self.level)+"血量"+str(self.hp),"攻击力为"+str(self.attack)) print("等级"+str(self.level)+"血量"+str(self.hp),"攻击力为"+str(self.attack))
class Enermy(Hero):
def __init__(self,name):
super().__init__(name)
self.hp = 300
self.attack = 25
player = Player("后羿") player = Player("后羿")
print("玩家的血量值为:",player.hp) enermy1 = Enermy("亚瑟")
print("玩家的攻击力为:",player.attack)
player.combat(enermy1)
print("亚瑟的等级为"+str(enermy1.level))
\ 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