Commit ad145caa by BellCodeEditor

save project

parent 6a7dbf05
Showing with 18 additions and 4 deletions
import random
class Sans: class Sans:
def __init__(self,AT,HP,HUP,AUP,name,MP): def __init__(self,AT,HP,HUP,AUP,name,MP):
self.Level = 1 self.Level = 1
...@@ -32,6 +33,7 @@ class Sans: ...@@ -32,6 +33,7 @@ class Sans:
Hero.Name+'的攻击成长点'+str(Hero.Attack_UpPoint)+'\n') Hero.Name+'的攻击成长点'+str(Hero.Attack_UpPoint)+'\n')
def cure(plus): def cure(plus):
plus.HitPoint+=40 plus.HitPoint+=40
print(plus.Name+'回血,现血量:'+str(plus.HitPoint))
class Sanses(Sans): class Sanses(Sans):
def __init__(self,AT,HP,HUP,AUP,name): def __init__(self,AT,HP,HUP,AUP,name):
...@@ -46,9 +48,11 @@ while True: ...@@ -46,9 +48,11 @@ while True:
if choose=='Outer': if choose=='Outer':
Player1=Outer Player1=Outer
break break
print('-'*60)
if choose=='Mudder': if choose=='Mudder':
Player1=Mudder Player1=Mudder
break break
print('-'*60)
else: else:
print('请重新选择') print('请重新选择')
continue continue
...@@ -58,12 +62,18 @@ while True: ...@@ -58,12 +62,18 @@ while True:
if choose1=='Outer': if choose1=='Outer':
Player2=Outer Player2=Outer
break break
print('-'*60)
if choose1=='Mudder': if choose1=='Mudder':
Player2=Mudder Player2=Mudder
break break
print('-'*60)
else: else:
print('请重新选择') print('请重新选择')
continue continue
print('-'*60)
print('游戏开始')
print('-'*60)
while True: while True:
a=input('请行动(1·治疗/2·攻击):') a=input('请行动(1·治疗/2·攻击):')
...@@ -71,12 +81,16 @@ while True: ...@@ -71,12 +81,16 @@ while True:
Player1.cure() Player1.cure()
if Player1.HitPoint>=Player1.Max_HP: if Player1.HitPoint>=Player1.Max_HP:
Player1.HitPoint=Player1.Max_HP Player1.HitPoint=Player1.Max_HP
print('-'*60)
if a=='2': if a=='2':
Player1.combat(Player2) Player1.combat(Player2)
b=input('请行动(1·治疗/2·攻击):') print('-'*60)
b=str(random.choice([1,2]))
if b=='1': if b=='1':
Player2.cure() Player2.cure()
if Player2.HitPoint>=Player2.Max_HP: if Player2.HitPoint>=Player2.Max_HP:
Player2.HitPoint=Player2.Max_HP Player2.HitPoint=Player2.Max_HP
if a=='2': print('-'*60)
Player2.combat(Player1) if b=='2':
\ No newline at end of file Player2.combat(Player1)
print('-'*60)
\ 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