Commit 1607c9a1 by BellCodeEditor

auto save

parent 9f05b260
Showing with 15 additions and 1 deletions
...@@ -4,4 +4,17 @@ class Hero: ...@@ -4,4 +4,17 @@ class Hero:
self.hp=250 self.hp=250
self.attack=40 self.attack=40
self.name=name self.name=name
houyi=Hero("后羿") def combat(self,enemy)
enemy.hp-=self.attack
info1=self.name+"对"+enemy.name+"发起进攻"
info2="造成"+str(self.attack)+"点"
if enemy.hp>0:
info3=enemy.name+""+str(enemy.hp)+""
info=info1+info2+info3
print(into)
else:
info3=enemy.name+""
info=info1+info2+info3
print(into)
exit()
houyi=Hero("后羿")
\ 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