neelthee-mansion 3.23.10__tar.gz → 3.23.12__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (22) hide show
  1. {neelthee_mansion-3.23.10 → neelthee_mansion-3.23.12}/PKG-INFO +1 -1
  2. {neelthee_mansion-3.23.10 → neelthee_mansion-3.23.12}/neelthee_mansion/Mansion_of_Amnesia.py +50 -31
  3. neelthee_mansion-3.23.12/neelthee_mansion/all_game_utils.py +12 -0
  4. {neelthee_mansion-3.23.10 → neelthee_mansion-3.23.12}/neelthee_mansion.egg-info/PKG-INFO +1 -1
  5. {neelthee_mansion-3.23.10 → neelthee_mansion-3.23.12}/setup.py +1 -1
  6. neelthee_mansion-3.23.10/neelthee_mansion/all_game_utils.py +0 -14
  7. {neelthee_mansion-3.23.10 → neelthee_mansion-3.23.12}/LICENSE.md +0 -0
  8. {neelthee_mansion-3.23.10 → neelthee_mansion-3.23.12}/README.md +0 -0
  9. {neelthee_mansion-3.23.10 → neelthee_mansion-3.23.12}/neelthee_mansion/Books.py +0 -0
  10. {neelthee_mansion-3.23.10 → neelthee_mansion-3.23.12}/neelthee_mansion/Quests.py +0 -0
  11. {neelthee_mansion-3.23.10 → neelthee_mansion-3.23.12}/neelthee_mansion/Rooms.py +0 -0
  12. {neelthee_mansion-3.23.10 → neelthee_mansion-3.23.12}/neelthee_mansion/__init__.py +0 -0
  13. {neelthee_mansion-3.23.10 → neelthee_mansion-3.23.12}/neelthee_mansion/__main__.py +0 -0
  14. {neelthee_mansion-3.23.10 → neelthee_mansion-3.23.12}/neelthee_mansion/creatures.py +0 -0
  15. {neelthee_mansion-3.23.10 → neelthee_mansion-3.23.12}/neelthee_mansion/items.py +0 -0
  16. {neelthee_mansion-3.23.10 → neelthee_mansion-3.23.12}/neelthee_mansion/utils.py +0 -0
  17. {neelthee_mansion-3.23.10 → neelthee_mansion-3.23.12}/neelthee_mansion.egg-info/SOURCES.txt +0 -0
  18. {neelthee_mansion-3.23.10 → neelthee_mansion-3.23.12}/neelthee_mansion.egg-info/dependency_links.txt +0 -0
  19. {neelthee_mansion-3.23.10 → neelthee_mansion-3.23.12}/neelthee_mansion.egg-info/entry_points.txt +0 -0
  20. {neelthee_mansion-3.23.10 → neelthee_mansion-3.23.12}/neelthee_mansion.egg-info/requires.txt +0 -0
  21. {neelthee_mansion-3.23.10 → neelthee_mansion-3.23.12}/neelthee_mansion.egg-info/top_level.txt +0 -0
  22. {neelthee_mansion-3.23.10 → neelthee_mansion-3.23.12}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: neelthee_mansion
3
- Version: 3.23.10
3
+ Version: 3.23.12
4
4
  Summary: A text-based adventure game set in Neel-thee’s mansion.
5
5
  Home-page: https://github.com/Flameblade375/neelthee_mansion
6
6
  Author: Alexander.E.F
@@ -17,10 +17,12 @@ GameState = {
17
17
  Neel-thee's Mansion of Amnesia
18
18
  """
19
19
 
20
- global player, evil_mage, commands, NOTE_NUM, credits, quest_manager, revealer, CHARACTERSLIST, BACKGROUNDS, info_text_area
20
+ global player, evil_mage, commands, NOTE_NUM, credits, quest_manager, revealer, CHARACTERSLIST, BACKGROUNDS, info_text_area, map_root, map_label, player_info_root, player_info_label
21
21
 
22
22
  player_info_root = None
23
23
  player_info_label = None
24
+ map_root = None
25
+ map_label = None
24
26
  info_text_area = None
25
27
 
26
28
  BACKGROUNDS = {
@@ -387,7 +389,7 @@ def Move(move):
387
389
  def start():
388
390
  global player, info_text_area
389
391
  # Wait until info_text_area is initialized
390
- while info_text_area is None:
392
+ while info_text_area is None or map_label is None:
391
393
  sleep(0.1)
392
394
  # shows the main menu
393
395
  add_text_to_textbox(info_text_area,
@@ -422,10 +424,39 @@ def update_player_info():
422
424
  info_text = get_inventory_text()
423
425
  player_info_root.after(0, lambda: player_info_label.config(text=info_text))
424
426
 
427
+ def get_map():
428
+ text = ""
429
+ if "map" in ROOMS[player.CURRENTROOM]:
430
+ text += f'\n\nKey: {"; ".join(KEY)}\n'
431
+ text += f'\n{ROOMS[player.CURRENTROOM]["map"]}\n'
432
+ else:
433
+ text += f"\nNo map available for this room."
434
+ return text
435
+
436
+ def show_map():
437
+ global map_root, map_label
438
+ map_root = tk.Tk()
439
+ map_root.title("Map")
440
+
441
+ map_text = get_map()
442
+ map_label = tk.Label(map_root, text=map_text, font=("Courier", 12), width=100, height=40)
443
+ map_label.pack()
444
+
445
+ map_root.mainloop()
446
+
447
+ def update_map():
448
+ global map_root, map_label
449
+ if map_root and map_label:
450
+ map_text = get_map()
451
+ map_root.after(0, lambda: map_label.config(text=map_text))
452
+
425
453
  def start_tkinter_thread():
426
454
  player_info_thread = threading.Thread(target=show_player_info)
427
455
  player_info_thread.daemon = True
428
456
  player_info_thread.start()
457
+ map_thread = threading.Thread(target=show_map)
458
+ map_thread.daemon = True
459
+ map_thread.start()
429
460
 
430
461
  def showStatus():
431
462
  global player
@@ -439,10 +470,11 @@ def showStatus():
439
470
  # Display possible directions of travel
440
471
  text = display_directions(text)
441
472
 
442
- # Display the map if available
443
- if "map" in ROOMS[player.CURRENTROOM]:
444
- text += f'\n\nKey: {"; ".join(KEY)}\n'
445
- text += f'\n{ROOMS[player.CURRENTROOM]["map"]}\n'
473
+ ## Display the map if available
474
+ #if "map" in ROOMS[player.CURRENTROOM]:
475
+ # text += f'\n\nKey: {"; ".join(KEY)}\n'
476
+ # text += f'\n{ROOMS[player.CURRENTROOM]["map"]}\n'
477
+ update_map()
446
478
 
447
479
  # Display the description of the current room
448
480
  text += "\n" + str(ROOMS[player.CURRENTROOM]["info"])
@@ -775,8 +807,8 @@ def select_target(chooser, targets: list):
775
807
 
776
808
 
777
809
  def command():
778
- global player
779
- #try:
810
+ global player
811
+ try:
780
812
  ShouldBreak = False
781
813
 
782
814
  while True:
@@ -807,12 +839,12 @@ def command():
807
839
  ShouldBreak = True
808
840
  if ShouldBreak:
809
841
  return
810
- #except KeyError as e:
811
- # add_text_to_textbox(info_text_area, f"KeyError: {e} - This might be due to an undefined command or incorrect arguments.")
812
- #except ValueError as e:
813
- # add_text_to_textbox(info_text_area, f"ValueError: {e} - This might be due to incorrect arguments provided.")
814
- #except Exception as e:
815
- # add_text_to_textbox(info_text_area, f"Unexpected Error: {e}")
842
+ except KeyError as e:
843
+ add_text_to_textbox(info_text_area, f"KeyError: {e} - This might be due to an undefined command or incorrect arguments.")
844
+ except ValueError as e:
845
+ add_text_to_textbox(info_text_area, f"ValueError: {e} - This might be due to incorrect arguments provided.")
846
+ except Exception as e:
847
+ add_text_to_textbox(info_text_area, f"Unexpected Error: {e}")
816
848
 
817
849
 
818
850
  def handle_sleep_command(player: PC):
@@ -1127,7 +1159,7 @@ def handle_guard_action(guard):
1127
1159
  def create_info_textbox():
1128
1160
  global info_text_area
1129
1161
  root = tk.Tk()
1130
- root.title("Text Box with Scrollbar")
1162
+ root.title("Main Window")
1131
1163
 
1132
1164
  info_text_area = scrolledtext.ScrolledText(root, wrap=tk.WORD, width=120, height=40)
1133
1165
  info_text_area.pack(padx=10, pady=10)
@@ -1270,12 +1302,12 @@ def main():
1270
1302
  # this is the initializer
1271
1303
  initializer()
1272
1304
 
1273
- # shows the instructions
1274
- start()
1275
-
1276
1305
  # starts the tkinter thread that shows the player's stats
1277
1306
  start_tkinter_thread()
1278
1307
 
1308
+ # shows the instructions
1309
+ start()
1310
+
1279
1311
  # loop forever while the player wants to play
1280
1312
  while True:
1281
1313
  command()
@@ -1377,19 +1409,6 @@ def main():
1377
1409
  if bad_guys:
1378
1410
  good_guys, bad_guys = battle(player, good_guys, bad_guys, player.LASTROOM)
1379
1411
 
1380
- # Handle NPC interactions
1381
- if "NPCs" in ROOMS[player.CURRENTROOM]:
1382
- for npcname, npcstats in ROOMS[player.CURRENTROOM]["NPCs"].items():
1383
- if (
1384
- ask_for_consent("Do you want to interact with this NPC")
1385
- or npcstats.aggressive
1386
- ):
1387
- npcstats.interact()
1388
- if npcstats.aggressive:
1389
- ROOMS[player.CURRENTROOM]["NPCs"][npcname] = battle(
1390
- player, [], [npcstats], player.LASTROOM
1391
- )[1]
1392
-
1393
1412
  player.special_ability.Tick(info_text_area)
1394
1413
  quest_manager.update_objective(f"Kill {GameState['Enemies killed']} creatures")
1395
1414
  for Item in GameState["collected items"]:
@@ -0,0 +1,12 @@
1
+ from .utils import *
2
+ from re import *
3
+
4
+
5
+ def ask_for_consent(text: str, text_area) -> bool:
6
+ while True:
7
+ add_text_to_textbox(text_area, f"{text}? Y/N")
8
+ anser = loop_til_valid_input("", "That wasn't Y or N", Y_N).Value
9
+ if anser == "y":
10
+ return True
11
+ elif anser == "n":
12
+ return False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: neelthee-mansion
3
- Version: 3.23.10
3
+ Version: 3.23.12
4
4
  Summary: A text-based adventure game set in Neel-thee’s mansion.
5
5
  Home-page: https://github.com/Flameblade375/neelthee_mansion
6
6
  Author: Alexander.E.F
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="neelthee_mansion",
5
- version="3.23.10", # Update version number for each release
5
+ version="3.23.12", # Update version number for each release
6
6
  packages=find_packages(), # Automatically finds all packages and modules
7
7
  install_requires=[
8
8
  "wheel",
@@ -1,14 +0,0 @@
1
- from .utils import *
2
- from re import *
3
-
4
-
5
- def ask_for_consent(text: str) -> bool:
6
- while True:
7
- type_text(f"{text}? Y/N")
8
- anser = str(input(">")).lower().strip()
9
- if anser == "y":
10
- return True
11
- elif anser == "n":
12
- return False
13
- else:
14
- type_text("That wasn't Y or N")