Commit 24fab1a3 by BellCodeEditor

save project

parent 9a581ef4
Showing with 16 additions and 5 deletions
# 英雄角色类
class Hero(object):
def __init__(self, name):
def __init__(self,name ):
self.level = 1
self.hp = 250
self.attack = 40
self.name = name
self.attack=40
self.name=name
def combat(self,hen):
hen.hp-=self.attack
a='双方火热交战中,'+self.name+'把敌人爆头了,'+hen.name+'步步后退!'
b=hen.name+'可真是个老六,受到了来自八嘎呀路'+str(self.attack)+'的伤害,是大大的伤害,快gg了!'
if hen.hp>0:
c=hen.name+'还剩八嘎呀路的'+str(hen.hp)+'血量。'
d=a+b+c
print(d)
else:
c=hen.name+'已gg,下线了???敌人:我还会回来的'
d=a+b+c
print(d)
exit()
def combat(): # 攻击
???
yase = Hero("垭瑟")
houyi= Hero("后羿")
......
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