Commit 854b4373 by BellCodeEditor

auto save

parent 0cd794b4
Showing with 26 additions and 43 deletions
class Hero: class Hero:
def __inir__(self,names,ages,hps,levals): def __init__(self,name,hp,attack):
self.name = names self.level=1
self.age = ages self.name=name
self.hp = hps self.hp=hp
self.leval = levals self.attack=attack
houyi = Hero("后忆",100,100000,1980) self.max_hp = self.hp
print(houyi.name) 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 upgrade(self):
self.level=self.level+1
self.hp=self.hp+50
self.attack=self.attack+5
houyi = player("射手","后羿")
yase = Hero("亚瑟")
print('-' * 30)
print(' 战斗开始')
while True:
print("-" * 30)
choice = input("请选择释放英雄技能(1/2)")
......
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