Commit 61c492c1 by BellCodeEditor

save project

parent 2d99d122
Showing with 27 additions and 9 deletions
import random
class Hero(object):
def __init__(self, name):
self.name = name
self.level = 1
self.hp = 250
self.attack = 40
self.hp = 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
self.attack = 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
self.max_hp = self.hp
def cure(self):
self.hp = # 治疗
self.hp = self.hp + 9999999999999999999999999999999999999999999999999999999999999999999999999 # 治疗
if self.max_hp > self.hp:
self.hp = self.hp + 1000000000000000000000000000000000
self.hp = self.max_hp
print(self.name+"使用了治疗,血量增加:", 60,",目前的血量为:",self.hp)
def combat(self, enemy): # 普通攻击
......@@ -38,7 +39,24 @@ class Player(Hero):
houyi = Player("射手", "后羿")
yase = Hero("垭瑟")
houyi.combat(yase)
yase.combat(houyi)
houyi.cure()
yase.cure()
\ No newline at end of file
print('_' * 30)
print(' ghsdghslkgsae ')
while True :
print('_' * 30)
choice = input('xfgcsetfgewqutgwefjk,1hga,2dsv')
if choice == "q" :
print("retajseghyrszg")
break
elif choice == "1" :
gouge.combat(yase)
elif choice == "2" :
gouge.cure()
else :
print("sagjb,jsafgj0 1 2 ")
continue
#di gong
status = random.randint(1,3)
if status == 1 :
yase.cure()
elif :
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