Advertisement
fumanbest

Mu Online

Mar 14th, 2020
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.44 KB | None | 0 0
  1. the_dungeons_rooms = input().split('|')
  2. initial_health = 100
  3. initial_bitcoins = 0
  4. best_room = 0
  5. count = 0
  6. for each in the_dungeons_rooms:
  7.     part = list(map(str, each.split()))
  8.     command = part[0]
  9.     number = int(part[1])
  10.     if command == 'potion':
  11.         best_room += 1
  12.         count += 1
  13.         hp = initial_health
  14.         initial_health += int(number)
  15.  
  16.         if initial_health > 100:
  17.             initial_health = 100
  18.             hp = initial_health - hp
  19.             print(f"You healed for {hp} hp.")
  20.             print(f"Current health: {initial_health} hp.")
  21.         else:
  22.             initial_health = initial_health
  23.             hp = initial_health - hp
  24.             print(f"You healed for {hp} hp.")
  25.             print(f"Current health: {initial_health} hp.")
  26.     elif command == 'chest':
  27.         best_room += 1
  28.         count += 1
  29.         if not initial_health <= 0:
  30.             initial_bitcoins += int(number)
  31.             print(f"You found {int(number)} bitcoins.")
  32.  
  33.     else:
  34.         initial_health -= int(number)
  35.         best_room += 1
  36.         if not initial_health <= 0:
  37.             count += 1
  38.             print(f"You slayed {command}.")
  39.  
  40.         else:
  41.             print(f"You died! Killed by {command}.")
  42.             print(f"Best room: {best_room}")
  43.  
  44. if best_room == count:
  45.     print("You've made it!")
  46.     print(f"Bitcoins: {initial_bitcoins}")
  47.     print(f"Health: {initial_health}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement