Commit 3f2dac26 by BellCodeEditor

save project

parent 2c772dd3
Showing with 14 additions and 4 deletions
...@@ -6,9 +6,18 @@ class Hero(object): ...@@ -6,9 +6,18 @@ class Hero(object):
self.attack = 40 self.attack = 40
self.name = name self.name = name
def combat(): # 攻击 def combat(self,Mill): # 攻击
??? Mill.hp-=self.attack
Roblox01=self.name+'对'+Mill.name+'发起攻击,'
yase = Hero("垭瑟") Roblox02='造成'+str(self.attack)+'点伤害'
if Mill.hp>0:
Roblox03=Mill.name+'还剩下'+str(Mill.hp)+'血量'
Roblox=Roblox01+Roblox02+Roblox03
print(Roblox)
else:
Roblox03=Mill.name+'Loser'
Roblox=Roblox01+Roblox02+Roblox03
print(Roblox)
yase = Hero("")
houyi= Hero("后羿") houyi= Hero("后羿")
yase.combat(houyi) yase.combat(houyi)
\ 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