Commit f990a432 by BellCodeEditor

auto save

parent 5b09bd73
Showing with 12 additions and 2 deletions
......@@ -12,4 +12,14 @@ houyi=Hero("后羿",240,23)
houyi.upgrade()
print("等级",houyi.level)
print("血量",houyi.hp)
print("攻击力",houyi.attack)
\ No newline at end of file
print("攻击力",houyi.attack)
class Hero:
def __init__(self,enemy):
self.level=1
self.name=name
self.hp=10000
self.attack=150
def combat.hp -=self.attack
info1 = self.name+"对"+enemy.name+"发起攻击,"
info2 = "造成"+str(self.attack)+"伤害"
if enemy.hp>0:
\ 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