Commit eb8c9685 by BellCodeEditor

save project

parent 9cb2a470
Showing with 7 additions and 1 deletions
...@@ -4,9 +4,14 @@ class Hero: ...@@ -4,9 +4,14 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def combut(self,enemy):
enemy.hp-= self.attack
info1 = enemy.name+"对"+enemy.name+"发起进攻,"
info2 = "造成"+str(self.attack)oej
yase=Hero('yase',300,20) yase=Hero('yase',300,20)
hy=Hero('hy',250,23) hy=Hero('hy',250,23)
sb=Hero('sb',5600000000,19000000000000000009) sb=Hero('sb',5600000000,190)
print(yase.attack) print(yase.attack)
print(hy.attack) print(hy.attack)
print(sb.attack) print(sb.attack)
\ 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