Commit 366c01c9 by BellCodeEditor

save project

parent c2d4bc1e
Showing with 42 additions and 11 deletions
A = "ABCDEFG"
B = "1000"
C = input("zhanghao")
D = input("mima")
if A == C and B == D:
print("哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈")
\ No newline at end of file
# 英雄角色类
class Hero(object):
def __init__(self, name):
self.level = 1
self.hp = 250
self.attack = 40
def __init__(self, name,hp,level,attack):
self.level = level#等
self.hp = hp#生
self.attack = attack#攻
self.name = name
def gongji(self,enemy): # 攻击
yase = Hero("垭瑟")
houyi= Hero("后羿")
yase.combat(houyi)
\ No newline at end of file
def combat(self,enemy): # 攻击
df.hp-=self.attack
i1=self.name+'對'+df.name+'發起攻擊'
i2='造成了'+self.attack+'攻擊'
if df.name >0:
i3=df.name+'還剩下'+str(df.hp)
print(i1+i2+i3)
else:
i3=df.name+'以被KO'
print(i1+i2+i3)
exit()
def wuxiangdeyidao(self,enemy): # 攻击
df.hp-=(self.attackguan+99999999999999999999999999999999999999)
i1=self.name+'對'+df.name+'發起無想的一刀'
i2='造成了'+self.attack+'攻擊'
if df.name >0:
i3=df.name+'還剩下'+str
print(i1+i2+i3)
else:
i3=df.name+'以被KO'
print(i1+i2+i3)
exit()
yase = Hero("雅瑟",250,20,1)
houyi= Hero("后羿",300,40,1)
yase.combat(houyi)
print(houyi,attack)
print(houyi,attack)
print(houyi,attack)
print(houyi,attack)
print(wuxiangdeyidao)
\ 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