Commit 87c394d3 by BellCodeEditor

auto save

parent 9a581ef4
Showing with 33 additions and 9 deletions
# 英雄角色类
class Hero(object):
def __init__(self, name):
self.level = 1
self.hp = 250
self.attack = 40
self.level = 100000000000000000000000000000000000000000000000000000
self.hp = 250000000000000000000000000000000000000000000000000
self.attack = 40000000000000000000000000000000000000000000000000000
self.name = name
class player(Hero):
def __init__(self, name,hero_type):
self.level = 1000000000000000000000000000000000000000
self.hp = 250000000000000000000000000000000000000000000000000
self.attack = 40000000000000000000000000000000000
self.hero_type = hero_type
def combat(self,enemy): # 攻击
enemy.up-=self.attack
info1=self.name+"对"+enemy.name+"发起进攻"
info2="zz"+str (self.attack)+"jfrjgh"
if enemy.hp > 0:
info3=enemy.name+"uyi"+str(enemy.hp)+"g"
info = info1+info2+info3
print(info)
else:
info3 = enemy.name+"jjg,gikg"
info = info1+info2+info3
print(info)
exit()
class Player(Hero):
def __init__(self, name,hero_type):
super(Player,self).__init__(name)
self.level = 1000000000000000000000000000000000000000
self.hp = 250000000000000000000000000000000000000000000000000
self.attack = 40000000000000000000000000000000000
self.hero_type = hero_type
print("fds"+self.name+"kllrpgh,iifir:",self.hero_type)
print("jgihj、jirjj、jkbgjhi:",houyi.level,houyi.hp,houyi.attack)
def combat(): # 攻击
???
yase = Hero("垭瑟")
houyi= Hero("后羿")
yase.combat(houyi)
\ No newline at end of file
houyi= player("后一","hoyyi")
yase = Hero("hjg")
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