Commit d42a5fd1 by BellCodeEditor

save project

parent 3eb33b18
Showing with 11 additions and 3 deletions
...@@ -38,6 +38,14 @@ class Player(Hero): # 玩家英雄 ...@@ -38,6 +38,14 @@ class Player(Hero): # 玩家英雄
self.type=type self.type=type
print('恭喜您创建了'+self.name+",他是一个"+self.type+"类型的的英雄") print('恭喜您创建了'+self.name+",他是一个"+self.type+"类型的的英雄")
print('他的等级,血量,伤害依次是'+str(self.level)+' '+str(self.hp)+' '+str(self.attack)) print('他的等级,血量,伤害依次是'+str(self.level)+' '+str(self.hp)+' '+str(self.attack))
player = Player("后羿","射手") houyi = Player("后羿","射手")
print("玩家的血量值为:",player.hp) yase=Hero("亚瑟")
print("玩家的攻击力为:",player.attack) print('-'*40)
print(' 战斗开始')
while True:
print('-'*40)
choice=input('请选择攻击or治疗,1为攻击,2为治疗:')
if choice==1:
houyi.combat()
if choice==2:
houyi.cure()
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