Advertisement
Txemin

main

May 26th, 2019
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. from room import Room
  2.  
  3. from item import Item
  4.  
  5. kitchen = Room("Kitchen")
  6. kitchen.set_description("a dark and dirty room buzzing with flies.")
  7. kitchen.get_description()
  8. # kitchen.describe(kitchen)
  9.  
  10. dining_room = Room("Dinig room")
  11. dining_room.set_description("a well illuminated room with a long table and 12 chairs.")
  12. dining_room.get_description()
  13. # dining_room.describe(dining_room)
  14.  
  15. ballroom = Room("Ball room")
  16. ballroom.set_description("a vast room with a shiny wooden floor. Huge candlesticks guard the entrance.")
  17. ballroom.get_description()
  18. # ballroom.describe(dining_room)
  19.  
  20. kitchen.linked_room(dining_room, "south")
  21. dining_room.linked_room(kitchen, "north")
  22. dining_room.linked_room(ballroom, "west")
  23. ballroom.linked_room(dining_room, "east")
  24.  
  25. dining_room.get_details()
  26. kitchen.get_details()
  27. ballroom.get_details()
  28.  
  29. current_room = kitchen
  30.  
  31. '''
  32. sword = Item("Sword")
  33. sword.set_description("a five inches long, razor sharp blade")
  34. sword.get_description()
  35. sword.set_item_action("stab")
  36. sword.set_item_action("hit")
  37. sword.set_item_action("block")
  38. sword.set_item_action("split")
  39.  
  40. club = Item("Club")
  41. club.set_description("a 15 cm thick wooden stick with a nail through it")
  42. club.get_description()
  43. club.set_item_action("hit")
  44. club.set_item_action("block")
  45. club.set_item_action("push")
  46.  
  47. shield = Item("Shield")
  48. shield.set_description("a disc of wooden boards surrounded by a steel girth")
  49. shield.get_description()
  50. shield.set_item_action("hit")
  51. shield.set_item_action("block")
  52. shield.set_item_action("push")
  53.  
  54. sword.get_details_item()
  55. club.get_details_item()
  56. shield.get_details_item()
  57. '''
  58. from character import Enemy
  59. dave = Enemy("Dave", "A smelly zombie")
  60. dave.describe()
  61. dave.set_conversation("Brrlgrh... rgrhl... brains...!!!")
  62. dave.talk()
  63. dave.set_weakness("cheese")
  64. dining_room.set_character(dave)
  65.  
  66. print("What will you fight with?")
  67. fight_with = input()
  68. dave.fight(fight_with)
  69.  
  70. while True:
  71. print("\n")
  72. current_room.get_details()
  73. command = input("> ")
  74. current_room = current_room.move(command)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement