Commit 7032163d by BellCodeEditor

save project

parent a18fe985
Showing with 17 additions and 11 deletions
...@@ -65,7 +65,7 @@ player1 = Player("后羿",200,5) ...@@ -65,7 +65,7 @@ player1 = Player("后羿",200,5)
player2 = Player("亚瑟",200,5) player2 = Player("亚瑟",200,5)
while True: while True:
print('=' * 35) print('=' * 35)
user_input = str(input('请选择英雄技能(1:攻击,2:回血,3:挖矿):')) user_input = str(input('请选择英雄技能(1:攻击,2:回血,3:挖矿,4:升级):'))
if user_input == "1": if user_input == "1":
player1.combat(player2) player1.combat(player2)
if player2.hp > 50: if player2.hp > 50:
...@@ -74,29 +74,37 @@ while True: ...@@ -74,29 +74,37 @@ while True:
player2.cure() player2.cure()
elif user_input == "2": elif user_input == "2":
player1.cure() player1.cure()
if random.randint(0,1) == 0: if random.randint(0,2) == 0:
if player2.level >= 5: if player2.level >= 5:
player2.wk() player2.wk()
else: else:
player2.cure() player2.cure()
elif random.randint(0,2) == 1:
player2.combat(player1)
else:
player2.sj()
elif user_input == "3": elif user_input == "3":
player1.wk() player1.wk()
if random.randint(0,1) == 0: if random.randint(0,2) == 0:
if player2.level >= 5: if player2.level >= 5:
player2.wk() player2.wk()
else: else:
player2.cure() player2.cure()
else: elif random.randint(0,2) == 1:
player2.combat(player1) player2.combat(player1)
else:
player2.sj()
elif user_input == "4": elif user_input == "4":
player1.sj() player1.sj()
if random.randint(0,1) == 0: if random.randint(0,2) == 0:
if player2.level >= 5: if player2.level >= 5:
player2.wk() player2.wk()
else: else:
player2.cure() player2.cure()
else: elif random.randint(0,2) == 1:
player2.combat(player1) player2.combat(player1)
else:
player2.sj()
else: else:
print('无效字符,请重新输入') print('无效字符,请重新输入')
\ No newline at end of file
a = [1, 2, 3, 4, 5] class
print(a) \ No newline at end of file
a.append(12)
print(a)
\ 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