neelthee-mansion 3.23.9__tar.gz → 3.23.11__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.9 → neelthee_mansion-3.23.11}/PKG-INFO +1 -1
  2. {neelthee_mansion-3.23.9 → neelthee_mansion-3.23.11}/neelthee_mansion/Mansion_of_Amnesia.py +51 -50
  3. {neelthee_mansion-3.23.9 → neelthee_mansion-3.23.11}/neelthee_mansion/Rooms.py +25 -25
  4. neelthee_mansion-3.23.11/neelthee_mansion/all_game_utils.py +12 -0
  5. {neelthee_mansion-3.23.9 → neelthee_mansion-3.23.11}/neelthee_mansion/utils.py +4 -0
  6. {neelthee_mansion-3.23.9 → neelthee_mansion-3.23.11}/neelthee_mansion.egg-info/PKG-INFO +1 -1
  7. {neelthee_mansion-3.23.9 → neelthee_mansion-3.23.11}/setup.py +1 -1
  8. neelthee_mansion-3.23.9/neelthee_mansion/all_game_utils.py +0 -14
  9. {neelthee_mansion-3.23.9 → neelthee_mansion-3.23.11}/LICENSE.md +0 -0
  10. {neelthee_mansion-3.23.9 → neelthee_mansion-3.23.11}/README.md +0 -0
  11. {neelthee_mansion-3.23.9 → neelthee_mansion-3.23.11}/neelthee_mansion/Books.py +0 -0
  12. {neelthee_mansion-3.23.9 → neelthee_mansion-3.23.11}/neelthee_mansion/Quests.py +0 -0
  13. {neelthee_mansion-3.23.9 → neelthee_mansion-3.23.11}/neelthee_mansion/__init__.py +0 -0
  14. {neelthee_mansion-3.23.9 → neelthee_mansion-3.23.11}/neelthee_mansion/__main__.py +0 -0
  15. {neelthee_mansion-3.23.9 → neelthee_mansion-3.23.11}/neelthee_mansion/creatures.py +0 -0
  16. {neelthee_mansion-3.23.9 → neelthee_mansion-3.23.11}/neelthee_mansion/items.py +0 -0
  17. {neelthee_mansion-3.23.9 → neelthee_mansion-3.23.11}/neelthee_mansion.egg-info/SOURCES.txt +0 -0
  18. {neelthee_mansion-3.23.9 → neelthee_mansion-3.23.11}/neelthee_mansion.egg-info/dependency_links.txt +0 -0
  19. {neelthee_mansion-3.23.9 → neelthee_mansion-3.23.11}/neelthee_mansion.egg-info/entry_points.txt +0 -0
  20. {neelthee_mansion-3.23.9 → neelthee_mansion-3.23.11}/neelthee_mansion.egg-info/requires.txt +0 -0
  21. {neelthee_mansion-3.23.9 → neelthee_mansion-3.23.11}/neelthee_mansion.egg-info/top_level.txt +0 -0
  22. {neelthee_mansion-3.23.9 → neelthee_mansion-3.23.11}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: neelthee_mansion
3
- Version: 3.23.9
3
+ Version: 3.23.11
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, color_coding, 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 = {
@@ -33,8 +35,6 @@ revealer = KeyRevealer()
33
35
 
34
36
  quest_manager = QuestManager()
35
37
 
36
- color_coding = False
37
-
38
38
  credits = """
39
39
  Made by: Alexander.E.F
40
40
  AI assisted the creation"""
@@ -349,7 +349,7 @@ def Move(move):
349
349
  def move_to_room():
350
350
  global player
351
351
  player.LASTROOM = player.CURRENTROOM
352
- if "descovered" in ROOMS[newRoom] and not ROOMS[newRoom]["descovered"]:
352
+ if "descovered" in ROOMS[newRoom]:
353
353
  ROOMS[newRoom]["descovered"] = True
354
354
  if move == "0":
355
355
  return attempt_charter()
@@ -389,7 +389,7 @@ def Move(move):
389
389
  def start():
390
390
  global player, info_text_area
391
391
  # Wait until info_text_area is initialized
392
- while info_text_area is None:
392
+ while info_text_area is None or map_label is None:
393
393
  sleep(0.1)
394
394
  # shows the main menu
395
395
  add_text_to_textbox(info_text_area,
@@ -424,10 +424,39 @@ def update_player_info():
424
424
  info_text = get_inventory_text()
425
425
  player_info_root.after(0, lambda: player_info_label.config(text=info_text))
426
426
 
427
+ def get_map():
428
+ text = f"\n---------------------------"
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)
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
+
427
453
  def start_tkinter_thread():
428
454
  player_info_thread = threading.Thread(target=show_player_info)
429
455
  player_info_thread.daemon = True
430
456
  player_info_thread.start()
457
+ map_thread = threading.Thread(target=show_map)
458
+ map_thread.daemon = True
459
+ map_thread.start()
431
460
 
432
461
  def showStatus():
433
462
  global player
@@ -441,10 +470,11 @@ def showStatus():
441
470
  # Display possible directions of travel
442
471
  text = display_directions(text)
443
472
 
444
- # Display the map if available
445
- if "map" in ROOMS[player.CURRENTROOM]:
446
- text += f'\n\nKey: {"; ".join(KEY)}\n'
447
- 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()
448
478
 
449
479
  # Display the description of the current room
450
480
  text += "\n" + str(ROOMS[player.CURRENTROOM]["info"])
@@ -777,8 +807,8 @@ def select_target(chooser, targets: list):
777
807
 
778
808
 
779
809
  def command():
780
- global player
781
- #try:
810
+ global player
811
+ try:
782
812
  ShouldBreak = False
783
813
 
784
814
  while True:
@@ -809,12 +839,12 @@ def command():
809
839
  ShouldBreak = True
810
840
  if ShouldBreak:
811
841
  return
812
- #except KeyError as e:
813
- # add_text_to_textbox(info_text_area, f"KeyError: {e} - This might be due to an undefined command or incorrect arguments.")
814
- #except ValueError as e:
815
- # add_text_to_textbox(info_text_area, f"ValueError: {e} - This might be due to incorrect arguments provided.")
816
- #except Exception as e:
817
- # 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}")
818
848
 
819
849
 
820
850
  def handle_sleep_command(player: PC):
@@ -894,13 +924,10 @@ def handle_search_command(player, *Args):
894
924
  def search_container(player: PC, Container):
895
925
  ContainerName = Container
896
926
  Container = ROOMS[player.CURRENTROOM]["containers"][Container]
897
- print("Got to if staitment")
898
927
  if isinstance(Container, container):
899
- print("got past if statement")
900
928
  if isinstance(Container.lock, Lock):
901
929
  key = PickKey(Container.lock)
902
930
  Container.Unlock(key, player)
903
- print("Adding text now")
904
931
  add_text_to_textbox(info_text_area,
905
932
  f"You search the{' secret' if Container.secret else ''} {ContainerName} and find a ",
906
933
  newline=False
@@ -1132,7 +1159,7 @@ def handle_guard_action(guard):
1132
1159
  def create_info_textbox():
1133
1160
  global info_text_area
1134
1161
  root = tk.Tk()
1135
- root.title("Text Box with Scrollbar")
1162
+ root.title("Main Window")
1136
1163
 
1137
1164
  info_text_area = scrolledtext.ScrolledText(root, wrap=tk.WORD, width=120, height=40)
1138
1165
  info_text_area.pack(padx=10, pady=10)
@@ -1230,19 +1257,6 @@ def initializer():
1230
1257
  # I will add more logic for starting the game later
1231
1258
  root.destroy()
1232
1259
 
1233
- def ask_color_coding():
1234
- color_window = tk.Toplevel(root)
1235
- color_window.title("Color Coding")
1236
- tk.Label(color_window, text="Do you want color coding?").pack()
1237
- tk.Button(color_window, text="Yes", command=lambda: set_color_coding(True)).pack()
1238
- tk.Button(color_window, text="No", command=lambda: set_color_coding(False)).pack()
1239
-
1240
- def set_color_coding(choice):
1241
- global color_coding
1242
- color_coding = choice
1243
- # Add your logic for enabling/disabling color coding here
1244
- choose_background()
1245
-
1246
1260
  root = tk.Tk()
1247
1261
  root.title("Character Creation")
1248
1262
 
@@ -1288,12 +1302,12 @@ def main():
1288
1302
  # this is the initializer
1289
1303
  initializer()
1290
1304
 
1291
- # shows the instructions
1292
- start()
1293
-
1294
1305
  # starts the tkinter thread that shows the player's stats
1295
1306
  start_tkinter_thread()
1296
1307
 
1308
+ # shows the instructions
1309
+ start()
1310
+
1297
1311
  # loop forever while the player wants to play
1298
1312
  while True:
1299
1313
  command()
@@ -1395,19 +1409,6 @@ def main():
1395
1409
  if bad_guys:
1396
1410
  good_guys, bad_guys = battle(player, good_guys, bad_guys, player.LASTROOM)
1397
1411
 
1398
- # Handle NPC interactions
1399
- if "NPCs" in ROOMS[player.CURRENTROOM]:
1400
- for npcname, npcstats in ROOMS[player.CURRENTROOM]["NPCs"].items():
1401
- if (
1402
- ask_for_consent("Do you want to interact with this NPC")
1403
- or npcstats.aggressive
1404
- ):
1405
- npcstats.interact()
1406
- if npcstats.aggressive:
1407
- ROOMS[player.CURRENTROOM]["NPCs"][npcname] = battle(
1408
- player, [], [npcstats], player.LASTROOM
1409
- )[1]
1410
-
1411
1412
  player.special_ability.Tick(info_text_area)
1412
1413
  quest_manager.update_objective(f"Kill {GameState['Enemies killed']} creatures")
1413
1414
  for Item in GameState["collected items"]:
@@ -92,8 +92,8 @@ def SetMapsAndPosiitionsDicts(map_dict, positions):
92
92
 
93
93
  positions = {}
94
94
  for RoomName, RoomItem in ROOMS.items():
95
- if "discovered" in RoomItem and "position" in RoomItem and "map" in RoomItem:
96
- if RoomItem["discovered"]:
95
+ if "descovered" in RoomItem and "position" in RoomItem and "map" in RoomItem:
96
+ if RoomItem["descovered"]:
97
97
  map_dict[RoomName] = string_to_2d_list(RoomItem["map"])
98
98
  positions[RoomName] = RoomItem["position"]
99
99
  return map_dict, positions
@@ -164,7 +164,7 @@ ROOMS = {
164
164
  "Hall": {
165
165
  "room type": "house",
166
166
  "position": (0, 8, 0),
167
- "discovered": True,
167
+ "descovered": True,
168
168
  "directions": {
169
169
  "south": Door("Kitchen"),
170
170
  "east": Door("Dining Room"),
@@ -253,7 +253,7 @@ smash from the south.",
253
253
  "Kitchen": {
254
254
  "room type": "house",
255
255
  "position": (0, 16, 0),
256
- "discovered": False,
256
+ "descovered": False,
257
257
  "directions": {
258
258
  "north": Door("Hall"),
259
259
  "east": Door("Garden"),
@@ -303,7 +303,7 @@ smash from the south.",
303
303
  "Dining Room": {
304
304
  "room type": "house",
305
305
  "position": (0, 8, 8),
306
- "discovered": False,
306
+ "descovered": False,
307
307
  "directions": {
308
308
  "west": Door("Hall"),
309
309
  "south": Door("Garden"),
@@ -335,7 +335,7 @@ ripping from the north.",
335
335
  "Garden": {
336
336
  "room type": "house",
337
337
  "position": (0, 16, 8),
338
- "discovered": False,
338
+ "descovered": False,
339
339
  "directions": {
340
340
  "north": Door("Dining Room"),
341
341
  "west": Door("Kitchen"),
@@ -364,7 +364,7 @@ ripping from the north.",
364
364
  "Armoury": {
365
365
  "room type": "house",
366
366
  "position": (0, 0, 0),
367
- "discovered": False,
367
+ "descovered": False,
368
368
  "directions": {
369
369
  "south": Door("Hall"),
370
370
  "east": Door("Sitting Room"),
@@ -396,7 +396,7 @@ You notice a "
396
396
  "Sitting Room": {
397
397
  "room type": "house",
398
398
  "position": (0, 0, 8),
399
- "discovered": False,
399
+ "descovered": False,
400
400
  "directions": {
401
401
  "west": Door("Armoury"),
402
402
  "south": Door("Dining Room"),
@@ -435,7 +435,7 @@ You notice a "
435
435
  "Landing": {
436
436
  "room type": "house",
437
437
  "position": (1, 8, 0),
438
- "discovered": False,
438
+ "descovered": False,
439
439
  "directions": {
440
440
  "down": Door("Hall"),
441
441
  "north": Door("Tower Bottom"),
@@ -461,7 +461,7 @@ You notice a "
461
461
  "Bedroom": {
462
462
  "room type": "house",
463
463
  "position": (1, 8, 8),
464
- "discovered": False,
464
+ "descovered": False,
465
465
  "directions": {
466
466
  "west": Door("Landing"),
467
467
  "north": Door("Office"),
@@ -492,7 +492,7 @@ You notice a "
492
492
  "Office": {
493
493
  "room type": "house",
494
494
  "position": (1, 0, 8),
495
- "discovered": False,
495
+ "descovered": False,
496
496
  "directions": {
497
497
  "south": Door("Bedroom"),
498
498
  "west": Door("Tower Bottom"),
@@ -528,7 +528,7 @@ You notice a "
528
528
  "Balcony": {
529
529
  "room type": "house",
530
530
  "position": (1, 16, 0),
531
- "discovered": False,
531
+ "descovered": False,
532
532
  "directions": {
533
533
  "north": Door("Landing"),
534
534
  },
@@ -550,7 +550,7 @@ You notice a "
550
550
  "Tower Bottom": {
551
551
  "room type": "house",
552
552
  "position": (1, 0, 0),
553
- "discovered": False,
553
+ "descovered": False,
554
554
  "directions": {
555
555
  "south": Door("Landing"),
556
556
  "east": Door("Office"),
@@ -578,7 +578,7 @@ You notice a "
578
578
  "Tower Middle": {
579
579
  "room type": "house",
580
580
  "position": (2, 0, 0),
581
- "discovered": False,
581
+ "descovered": False,
582
582
  "directions": {
583
583
  "down": Door("Tower Bottom"),
584
584
  "up": Door("Tower Top"),
@@ -609,7 +609,7 @@ You notice a "
609
609
  "Tower Top": {
610
610
  "room type": "house",
611
611
  "position": (3, 0, 0),
612
- "discovered": False,
612
+ "descovered": False,
613
613
  "directions": {
614
614
  "down": Door("Tower Middle"),
615
615
  "teleport": Door("Teleportation Deck"),
@@ -643,7 +643,7 @@ You notice a "
643
643
  "Basement Armoury": {
644
644
  "room type": "house",
645
645
  "position": (-1, 0, 0),
646
- "discovered": False,
646
+ "descovered": False,
647
647
  "directions": {
648
648
  "south": Door("Basement 3"),
649
649
  "east": Door("Basement 1"),
@@ -676,7 +676,7 @@ rack-1 has damaged bows and rack-2 has damaged spears.",
676
676
  "Basement 1": {
677
677
  "room type": "house",
678
678
  "position": (-1, 0, 8),
679
- "discovered": False,
679
+ "descovered": False,
680
680
  "directions": {
681
681
  "south": Door("Basement 2"),
682
682
  "west": Door("Basement Armoury"),
@@ -704,7 +704,7 @@ rack-1 has damaged bows and rack-2 has damaged spears.",
704
704
  "Basement 2": {
705
705
  "room type": "house",
706
706
  "position": (-1, 8, 8),
707
- "discovered": False,
707
+ "descovered": False,
708
708
  "directions": {
709
709
  "north": Door("Basement 1"),
710
710
  "west": Door("Basement 3"),
@@ -730,7 +730,7 @@ rack-1 has damaged bows and rack-2 has damaged spears.",
730
730
  "Basement 3": {
731
731
  "room type": "house",
732
732
  "position": (-1, 8, 0),
733
- "discovered": False,
733
+ "descovered": False,
734
734
  "directions": {
735
735
  "south": Door("Basement 4"),
736
736
  "east": Door("Basement 2"),
@@ -754,7 +754,7 @@ rack-1 has damaged bows and rack-2 has damaged spears.",
754
754
  "Basement 4": {
755
755
  "room type": "house",
756
756
  "position": (-1, 16, 0),
757
- "discovered": False,
757
+ "descovered": False,
758
758
  "directions": {
759
759
  "north": Door("Basement 3"),
760
760
  "east": Door("Library"),
@@ -781,7 +781,7 @@ rack-1 has damaged bows and rack-2 has damaged spears.",
781
781
  "Library": {
782
782
  "room type": "house",
783
783
  "position": (-1, 16, 8),
784
- "discovered": False,
784
+ "descovered": False,
785
785
  "directions": {
786
786
  "west": Door("Room name"),
787
787
  "bookcase": Door("Cavern 3"),
@@ -808,7 +808,7 @@ rack-1 has damaged bows and rack-2 has damaged spears.",
808
808
  'DND': {
809
809
  'room type': 'type',
810
810
  'position': (-1, -8, 0),
811
- 'discovered': False,
811
+ 'descovered': False,
812
812
  'directions': {
813
813
  'north': Door('Room name'),
814
814
  'south': Door("Basement Armoury"),
@@ -867,7 +867,7 @@ Oh and before I forget, If you go through the door to the north, there wil be no
867
867
  "Cavern 1": {
868
868
  "room type": "cavern",
869
869
  "position": (-2, 0, 0),
870
- "discovered": False,
870
+ "descovered": False,
871
871
  "directions": {
872
872
  "up": Door("Basement 4"),
873
873
  "down": Door("Cavern 2"),
@@ -890,7 +890,7 @@ Oh and before I forget, If you go through the door to the north, there wil be no
890
890
  "Cavern 2": {
891
891
  "room type": "cavern",
892
892
  "position": (-3, 0, 0),
893
- "discovered": False,
893
+ "descovered": False,
894
894
  "directions": {"up": SwitchDoor("Cavern 1", "Cavern 3", "7k69fImz4y")},
895
895
  "info": "you are in a dark cavern with the only light coming from the shoot you came through. A voice in the back of your head says: 'You fool! You can never get back now!'",
896
896
  "map": """
@@ -911,7 +911,7 @@ Oh and before I forget, If you go through the door to the north, there wil be no
911
911
  "Cavern 3": {
912
912
  "room type": "cavern",
913
913
  "position": (-2, 8, 0),
914
- "discovered": False,
914
+ "descovered": False,
915
915
  "directions": {
916
916
  "down": Door("Cavern 2"),
917
917
  "bookcase": Door("Library"),
@@ -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
@@ -47,6 +47,10 @@ These utilities aim to simplify development processes, promote code reuse, and i
47
47
  """
48
48
 
49
49
 
50
+ def debug(text: str):
51
+ print(f"DEBUG: {text}")
52
+
53
+
50
54
  # a function that adds text to a text box and scrolls to the bottom and updates it
51
55
  def add_text_to_textbox(text_area: scrolledtext.ScrolledText, text, newline=True):
52
56
  # Enable the text box to insert text
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: neelthee-mansion
3
- Version: 3.23.9
3
+ Version: 3.23.11
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.9", # Update version number for each release
5
+ version="3.23.11", # 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")