Commit 1460e8e3 by BellCodeEditor

save project

parent c1e3748f
Showing with 982 additions and 2 deletions
......@@ -7,6 +7,12 @@ class Hero(object):
self.name = name
def combat(self,enemy): # 战斗
class player(Hero):
def __init__(self,name):
super().__init__(name)
self.hp=200
enemy.hp-=selfattack
info1=self.name+"对"+enemy.name+"发起进攻,"
info2="造成"+str(self.attack)+"点伤害,"
......@@ -21,4 +27,979 @@ class Hero(object):
yase = Hero("垭瑟")
houyi= Hero("后羿")
yase.combat(houyi)
\ No newline at end of file
yase.combat(houyi)
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