Commit 3b3bed03 by BellCodeEditor

save project

parent 486a1a31
Showing with 4 additions and 18 deletions
class Hero:
def _init_(self,hp,attack,name):
self.leve1=1
self.hp=hp
self.attack=attack
self.name=name
#def upgrade(self):
# self.leve1=self.leve1+1
# self.hp=self.hp+50
# self.attack=attack+4
def combat(self,enemy):
enemy.hp-= self.attack
info1=self.name+"对"+enemy.name+"发起进攻,"
info2="造成"+str(self.attack)+"点伤害,"
info3=enemy.name+"剩余血量"+str(enemy.hp)+"点"
info=info1+info2+info3
print(into)
\ No newline at end of file
import random
num = random.randint(-6,5)
print(num)
\ 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