Commit 555d8f8d by BellCodeEditor

auto save

parent 482b398e
Showing with 8 additions and 2 deletions
......@@ -2,8 +2,8 @@
class Hero(object):
def __init__(self, name):
self.level = 1
self.hp = 3500
self.ATK = 388
self.hp =1140000
self.ATK = 114
self.name = name
def combat(self,enemy):
enemy.hp-=self.ATK
......@@ -17,6 +17,11 @@ class Hero(object):
inof3=enemy.name+"阵亡"
inof=inof1+inof2+inof3
print(inof)
class palyer(Hero):
def __init__(self,name):
super().__init__(name)
self.hp = 4000
self.ATK = 114514
yase = Hero("垭瑟")
houyi= Hero("后羿")
yase.combat(houyi)
\ 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