Commit db55d070 by BellCodeEditor

save project

parent f6ef2056
class Hero:
class Hero:
def__init__(self,name):
self.hp=250 # 等级
self.level=1 # 血量
self.attack=40
self.name =name
def upgrade(self):
self.leve=self.leve+1
self.hp = self.hp + 50
self.attack = self.attack + 4
def combat(self,enemy):
enemy.hp -= self.attack
info1 = self.name+"yes"+enemy.name+"发起进攻,"
info2 ="造成"+str(self.attack)"
if enemy.hp > 0:
info3 = name+"剩下"+str(enemy.hp)+"血量"
info = info1+info2+info3
print(info)
else:
info3
\ 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