Commit 6c1d4ff1 by BellCodeEditor

auto save

parent f47689a4
Showing with 37 additions and 0 deletions
class Hero:
def __init__(self,name,hp,attack):
self.level=1
self.name=name
self.hp=hp
self.attack=attack
def combat(self,enemy):
enemy.hp-=self.attack
infol=self.name+"对"+enemy.name+"jhdf"
info2="gj"+str(self.attack)+"fhnbv"
if enemy.hp > 0:
info3 = enemy.name+"mnfib"+str(enemy.hp)+"jvfmn"
info = infol+info2+info3
print(info)
else:
info3 = enemy.name+"jfg,hfy"
info = infol+info2+info3
print(info)
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