neelthee-mansion 2.2.5__tar.gz → 2.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (19) hide show
  1. {neelthee_mansion-2.2.5 → neelthee_mansion-2.3.0}/PKG-INFO +1 -1
  2. {neelthee_mansion-2.2.5 → neelthee_mansion-2.3.0}/neelthee_mansion/Mansion_of_Amnesia.py +140 -92
  3. {neelthee_mansion-2.2.5 → neelthee_mansion-2.3.0}/neelthee_mansion/Rooms.py +1 -1
  4. {neelthee_mansion-2.2.5 → neelthee_mansion-2.3.0}/neelthee_mansion/creatures.py +20 -4
  5. {neelthee_mansion-2.2.5 → neelthee_mansion-2.3.0}/neelthee_mansion.egg-info/PKG-INFO +1 -1
  6. {neelthee_mansion-2.2.5 → neelthee_mansion-2.3.0}/setup.py +1 -1
  7. {neelthee_mansion-2.2.5 → neelthee_mansion-2.3.0}/README.md +0 -0
  8. {neelthee_mansion-2.2.5 → neelthee_mansion-2.3.0}/neelthee_mansion/Quests.py +0 -0
  9. {neelthee_mansion-2.2.5 → neelthee_mansion-2.3.0}/neelthee_mansion/__init__.py +0 -0
  10. {neelthee_mansion-2.2.5 → neelthee_mansion-2.3.0}/neelthee_mansion/__main__.py +0 -0
  11. {neelthee_mansion-2.2.5 → neelthee_mansion-2.3.0}/neelthee_mansion/all_game_utils.py +0 -0
  12. {neelthee_mansion-2.2.5 → neelthee_mansion-2.3.0}/neelthee_mansion/items.py +0 -0
  13. {neelthee_mansion-2.2.5 → neelthee_mansion-2.3.0}/neelthee_mansion/utils.py +0 -0
  14. {neelthee_mansion-2.2.5 → neelthee_mansion-2.3.0}/neelthee_mansion.egg-info/SOURCES.txt +0 -0
  15. {neelthee_mansion-2.2.5 → neelthee_mansion-2.3.0}/neelthee_mansion.egg-info/dependency_links.txt +0 -0
  16. {neelthee_mansion-2.2.5 → neelthee_mansion-2.3.0}/neelthee_mansion.egg-info/entry_points.txt +0 -0
  17. {neelthee_mansion-2.2.5 → neelthee_mansion-2.3.0}/neelthee_mansion.egg-info/requires.txt +0 -0
  18. {neelthee_mansion-2.2.5 → neelthee_mansion-2.3.0}/neelthee_mansion.egg-info/top_level.txt +0 -0
  19. {neelthee_mansion-2.2.5 → neelthee_mansion-2.3.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: neelthee_mansion
3
- Version: 2.2.5
3
+ Version: 2.3.0
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
@@ -15,7 +15,7 @@ GameState = {
15
15
  Neel-thee's Mansion of Amnesia
16
16
  '''
17
17
 
18
- global player, evil_mage, commands, NOTE_NUM, LAST_ROOM, CURRENTROOM, credits, characters, color_coding, quest_manager
18
+ global player, evil_mage, commands, NOTE_NUM, credits, characters, color_coding, quest_manager
19
19
 
20
20
  quest_manager = QuestManager()
21
21
 
@@ -24,10 +24,6 @@ color_coding = False
24
24
  credits = '''
25
25
  Made by: Alexander.E.F'''
26
26
 
27
- # start the player in the Hall
28
- CURRENTROOM = 'Hall'
29
-
30
- LAST_ROOM = CURRENTROOM
31
27
 
32
28
  name = ''
33
29
  age = 0
@@ -130,9 +126,9 @@ map - Display the map of places you have been to
130
126
 
131
127
  def showHint():
132
128
  global player
133
- if 'Hints' in ROOMS[CURRENTROOM]:
129
+ if 'Hints' in ROOMS[player.CURRENTROOM]:
134
130
  type_text("You think:", colorTrue=color_coding)
135
- hint = choice(ROOMS[CURRENTROOM]['Hints'])
131
+ hint = choice(ROOMS[player.CURRENTROOM]['Hints'])
136
132
  type_text(hint, colorTrue=color_coding)
137
133
  else:
138
134
  type_text("You can't think of anything", colorTrue=color_coding)
@@ -201,9 +197,9 @@ def Use_grappling_hook():
201
197
  else:
202
198
  type_text("You flick the rope and it unhooks. You continue exploring the forest", colorTrue=color_coding)
203
199
 
204
- if CURRENTROOM == 'Balcony' and 'grappling-hook' in player.inventory:
200
+ if player.CURRENTROOM == 'Balcony' and 'grappling-hook' in player.inventory:
205
201
  swing_into_forest()
206
- elif CURRENTROOM == 'Forest Clearing' and 'grappling-hook' in player.inventory:
202
+ elif player.CURRENTROOM == 'Forest Clearing' and 'grappling-hook' in player.inventory:
207
203
  climb_into_house()
208
204
 
209
205
 
@@ -258,7 +254,6 @@ def Use(moveone, movetwo=None):
258
254
 
259
255
  def Move(move):
260
256
  global player
261
- global CURRENTROOM, LAST_ROOM
262
257
 
263
258
 
264
259
  def attempt_charter():
@@ -267,10 +262,10 @@ def Move(move):
267
262
  player.money -= 10
268
263
  if 'descovered' in ROOMS[newRoom] and not ROOMS[newRoom]['descovered']:
269
264
  ROOMS[newRoom]['descovered'] = True
270
- return ROOMS[CURRENTROOM]['directions'][move]
265
+ return ROOMS[player.CURRENTROOM]['directions'][move]
271
266
  else:
272
267
  type_text("You don't have enough money to charter a ship.", colorTrue=color_coding)
273
- return CURRENTROOM
268
+ return player.CURRENTROOM
274
269
 
275
270
  def attempt_move_to_garden():
276
271
  global player
@@ -283,8 +278,7 @@ def Move(move):
283
278
 
284
279
  def move_to_room():
285
280
  global player
286
- global LAST_ROOM
287
- LAST_ROOM = CURRENTROOM
281
+ player.LASTROOM = player.CURRENTROOM
288
282
  if move == '0':
289
283
  return attempt_charter()
290
284
  elif newRoom == 'Garden':
@@ -296,17 +290,17 @@ def Move(move):
296
290
  ROOMS[newRoom]['descovered'] = True
297
291
  return newRoom
298
292
 
299
- if move in ROOMS[CURRENTROOM]['directions']:
300
- newRoom = ROOMS[CURRENTROOM]['directions'][move]
301
- CURRENTROOM = move_to_room()
293
+ if move in ROOMS[player.CURRENTROOM]['directions']:
294
+ newRoom = ROOMS[player.CURRENTROOM]['directions'][move]
295
+ player.CURRENTROOM = move_to_room()
302
296
  return
303
297
  elif move in ROOMS:
304
298
  newRoom = move
305
299
  if newRoom == 'Garden':
306
- CURRENTROOM = attempt_move_to_garden()
300
+ player.CURRENTROOM = attempt_move_to_garden()
307
301
  else:
308
- CURRENTROOM = newRoom
309
- LAST_ROOM = CURRENTROOM
302
+ player.CURRENTROOM = newRoom
303
+ player.LASTROOM = player.CURRENTROOM
310
304
  return
311
305
  type_text("You can't go that way!", colorTrue=color_coding)
312
306
 
@@ -332,21 +326,21 @@ def showStatus():
332
326
  text = display_directions(text)
333
327
 
334
328
  # Display the map if available
335
- if 'map' in ROOMS[CURRENTROOM]:
329
+ if 'map' in ROOMS[player.CURRENTROOM]:
336
330
  text += f'\n\nKey: {"; ".join(KEY)}\n'
337
- text += f'\n{ROOMS[CURRENTROOM]["map"]}\n'
331
+ text += f'\n{ROOMS[player.CURRENTROOM]["map"]}\n'
338
332
 
339
333
  # Display the description of the current room
340
- text += ('\n' + str(ROOMS[CURRENTROOM]['info']))
334
+ text += ('\n' + str(ROOMS[player.CURRENTROOM]['info']))
341
335
 
342
336
  text += f"\n---------------------------"
343
337
 
344
338
  type_text(text, colorTrue=color_coding)
345
339
 
346
340
  # Optionally display additional room description
347
- if 'description' in ROOMS[CURRENTROOM] and ask_for_consent("Do you want to observe the area"):
341
+ if 'description' in ROOMS[player.CURRENTROOM] and ask_for_consent("Do you want to observe the area"):
348
342
  type_text("The area:", colorTrue=color_coding)
349
- type_text(ROOMS[CURRENTROOM]['description'], colorTrue=color_coding)
343
+ type_text(ROOMS[player.CURRENTROOM]['description'], colorTrue=color_coding)
350
344
 
351
345
 
352
346
  def display_directions(text):
@@ -371,14 +365,14 @@ def display_directions(text):
371
365
  }
372
366
  }
373
367
 
374
- room_type = ROOMS[CURRENTROOM]['room type']
368
+ room_type = ROOMS[player.CURRENTROOM]['room type']
375
369
  if room_type in direction_descriptions:
376
370
  for direction in directions:
377
- if direction in ROOMS[CURRENTROOM]['directions']:
371
+ if direction in ROOMS[player.CURRENTROOM]['directions']:
378
372
  if direction != 'teleport':
379
373
  text += f'\n{direction_descriptions[room_type][direction]} %*GREEN*%{direction}%*RESET*%.'
380
374
 
381
- if 'teleport' in ROOMS[CURRENTROOM]['directions']:
375
+ if 'teleport' in ROOMS[player.CURRENTROOM]['directions']:
382
376
  text += "\nThere is a %*GREEN*%teleport%*RESET*%ation circle on the ground"
383
377
 
384
378
  return text
@@ -601,9 +595,9 @@ def handle_go_command(direction):
601
595
  Move(direction)
602
596
 
603
597
  def handle_get_command(player: PC, item_name):
604
- if "item" in ROOMS[CURRENTROOM] and item_name == ROOMS[CURRENTROOM]['item'].name:
605
- player.inventory_add([ROOMS[CURRENTROOM]['item']])
606
- del ROOMS[CURRENTROOM]['item']
598
+ if "item" in ROOMS[player.CURRENTROOM] and item_name == ROOMS[player.CURRENTROOM]['item'].name:
599
+ player.inventory_add([ROOMS[player.CURRENTROOM]['item']])
600
+ del ROOMS[player.CURRENTROOM]['item']
607
601
  type_text(f'%*BLUE*%{item_name}%*RESET*% got!', colorTrue=color_coding)
608
602
  else:
609
603
  type_text(f"Can't get {item_name}!", colorTrue=color_coding)
@@ -611,11 +605,11 @@ def handle_get_command(player: PC, item_name):
611
605
  def handle_look_command():
612
606
  global player
613
607
  return_ = False
614
- if 'item' in ROOMS[CURRENTROOM]:
615
- type_text(f'The item in the room: %*BLUE*%{ROOMS[CURRENTROOM]["item"].name}%*RESET*%.', colorTrue=color_coding)
608
+ if 'item' in ROOMS[player.CURRENTROOM]:
609
+ type_text(f'The item in the room: %*BLUE*%{ROOMS[player.CURRENTROOM]["item"].name}%*RESET*%.', colorTrue=color_coding)
616
610
  return_ = True
617
- if 'containers' in ROOMS[CURRENTROOM]:
618
- type_text(f"The containers here are: %*RED*%{', '.join(ROOMS[CURRENTROOM]['containers'].keys())}%*RESET*%", colorTrue=color_coding)
611
+ if 'containers' in ROOMS[player.CURRENTROOM]:
612
+ type_text(f"The containers here are: %*RED*%{', '.join(ROOMS[player.CURRENTROOM]['containers'].keys())}%*RESET*%", colorTrue=color_coding)
619
613
  return_ = True
620
614
  if return_:
621
615
  return
@@ -626,32 +620,32 @@ def handle_use_command(item = None, sub_item = None):
626
620
  Use(item, sub_item)
627
621
 
628
622
  def handle_search_command(player, container = None, sub_container = None):
629
- if 'containers' in ROOMS[CURRENTROOM]:
630
- if container == 'the' and sub_container in ROOMS[CURRENTROOM]['containers'] and not all_same_value(ROOMS[CURRENTROOM]['containers'][sub_container].contents, None):
623
+ if 'containers' in ROOMS[player.CURRENTROOM]:
624
+ if container == 'the' and sub_container in ROOMS[player.CURRENTROOM]['containers'] and not all_same_value(ROOMS[player.CURRENTROOM]['containers'][sub_container].contents, None):
631
625
  search_container(player, sub_container)
632
- elif container in ROOMS[CURRENTROOM]['containers'] and not all_same_value(ROOMS[CURRENTROOM]['containers'][container].contents, None):
626
+ elif container in ROOMS[player.CURRENTROOM]['containers'] and not all_same_value(ROOMS[player.CURRENTROOM]['containers'][container].contents, None):
633
627
  search_container(player, container)
634
628
  else:
635
629
  type_text(f"You cannot search the {container}", colorTrue=color_coding)
636
630
 
637
631
  def search_container(player: PC, container):
638
- player.inventory_add(ROOMS[CURRENTROOM]['containers'][container].contents)
639
- type_text(f"You search the{' secret' if ROOMS[CURRENTROOM]['containers'][container].secret else ''} %*RED*%{container}%*RESET*% and find a ", newline=False, colorTrue=color_coding)
640
- for searchitem in ROOMS[CURRENTROOM]['containers'][container].contents:
632
+ player.inventory_add(ROOMS[player.CURRENTROOM]['containers'][container].contents)
633
+ type_text(f"You search the{' secret' if ROOMS[player.CURRENTROOM]['containers'][container].secret else ''} %*RED*%{container}%*RESET*% and find a ", newline=False, colorTrue=color_coding)
634
+ for searchitem in ROOMS[player.CURRENTROOM]['containers'][container].contents:
641
635
  if searchitem:
642
636
  if isinstance(searchitem, item):
643
- end_str = ' and a ' if ROOMS[CURRENTROOM]['containers'][container].contents.index(searchitem) < last_index(ROOMS[CURRENTROOM]['containers'][container].contents) else '\n'
637
+ end_str = ' and a ' if ROOMS[player.CURRENTROOM]['containers'][container].contents.index(searchitem) < last_index(ROOMS[player.CURRENTROOM]['containers'][container].contents) else '\n'
644
638
  type_text(f"%*BLUE*%{searchitem.name}%*RESET*%{end_str}", newline=False, colorTrue=color_coding)
645
- ROOMS[CURRENTROOM]['containers'][container].contents = []
639
+ ROOMS[player.CURRENTROOM]['containers'][container].contents = []
646
640
 
647
641
 
648
642
  def handle_put_command(player: PC, PutItem: item = None, container = None, sub_container = None):
649
643
  if PutItem in player.inventory:
650
- if 'containers' in ROOMS[CURRENTROOM]:
651
- if container == 'the' and sub_container in ROOMS[CURRENTROOM]['containers']:
644
+ if 'containers' in ROOMS[player.CURRENTROOM]:
645
+ if container == 'the' and sub_container in ROOMS[player.CURRENTROOM]['containers']:
652
646
  put_in_container(player, player.inventory[player.inventory.index(PutItem)], sub_container)
653
647
  return
654
- elif container in ROOMS[CURRENTROOM]['containers']:
648
+ elif container in ROOMS[player.CURRENTROOM]['containers']:
655
649
  put_in_container(player, player.inventory[player.inventory.index(PutItem)], container)
656
650
  return
657
651
  type_text(f"You cannot put the {PutItem.name} in the {container}", colorTrue=color_coding)
@@ -659,22 +653,22 @@ def handle_put_command(player: PC, PutItem: item = None, container = None, sub_c
659
653
 
660
654
  def put_in_container(player: PC, PutItem = None, container = None):
661
655
  player.inventory.remove(PutItem.name)
662
- if not ROOMS[CURRENTROOM]['containers'][container].contents:
663
- ROOMS[CURRENTROOM][container].contents = []
664
- if not isinstance(ROOMS[CURRENTROOM][container].contents, list):
665
- ROOMS[CURRENTROOM]['containers'][container].contents = [ROOMS[CURRENTROOM]['containers'][container].contents]
666
- ROOMS[CURRENTROOM]['containers'][container].contents += [PutItem]
656
+ if not ROOMS[player.CURRENTROOM]['containers'][container].contents:
657
+ ROOMS[player.CURRENTROOM][container].contents = []
658
+ if not isinstance(ROOMS[player.CURRENTROOM][container].contents, list):
659
+ ROOMS[player.CURRENTROOM]['containers'][container].contents = [ROOMS[player.CURRENTROOM]['containers'][container].contents]
660
+ ROOMS[player.CURRENTROOM]['containers'][container].contents += [PutItem]
667
661
  type_text(f"You put you're %*BLUE*%{PutItem.name}%*RESET*% into the %*RED*%{container}%*RESET*%", colorTrue=color_coding)
668
662
 
669
663
 
670
664
 
671
665
  def handle_get_quest_command(questnum):
672
666
  global player
673
- if 'quests' in ROOMS[CURRENTROOM]:
674
- if questnum in ROOMS[CURRENTROOM]['quests']:
675
- quest_manager.add_quest(ROOMS[CURRENTROOM]['quests'][questnum])
676
- quest_manager.start_quest(ROOMS[CURRENTROOM]['quests'][questnum])
677
- del ROOMS[CURRENTROOM]['quests'][questnum]
667
+ if 'quests' in ROOMS[player.CURRENTROOM]:
668
+ if questnum in ROOMS[player.CURRENTROOM]['quests']:
669
+ quest_manager.add_quest(ROOMS[player.CURRENTROOM]['quests'][questnum])
670
+ quest_manager.start_quest(ROOMS[player.CURRENTROOM]['quests'][questnum])
671
+ del ROOMS[player.CURRENTROOM]['quests'][questnum]
678
672
 
679
673
 
680
674
  def PrintMap():
@@ -691,7 +685,7 @@ def handle_hungry_bear(player: PC, enemy: creature):
691
685
  del player.inventory[player.inventory.index('potion')]
692
686
  type_text(f'You throw the potion at the bear and it explodes into a puff of magic smoke that stuns the bear!', colorTrue=color_coding)
693
687
  if enemy_reacting:
694
- return battle(player, enemy, LAST_ROOM)
688
+ return battle(player, enemy, player.LASTROOM)
695
689
 
696
690
  def handle_grumpy_pig(player: PC, enemy: creature):
697
691
  enemy_reacting = True
@@ -699,7 +693,7 @@ def handle_grumpy_pig(player: PC, enemy: creature):
699
693
  if ask_for_consent("Do you want to use your saddle and pig-rod on the pig"):
700
694
  enemy_reacting = False
701
695
  type_text(f'You throw a saddle onto the pig and leap on steering it about with a pig fishing rod!', colorTrue=color_coding)
702
- del ROOMS[CURRENTROOM]['creatures stats']
696
+ del ROOMS[player.CURRENTROOM]['creatures stats']
703
697
  del player.inventory[player.inventory.index('saddle')]
704
698
  del player.inventory[player.inventory.index('pig-rod')]
705
699
  player.inventory_add(item['pig-steed'])
@@ -708,17 +702,17 @@ def handle_grumpy_pig(player: PC, enemy: creature):
708
702
  if ask_for_consent("Do you want to use your torch to scare the pig away"):
709
703
  enemy_reacting = False
710
704
  type_text(f'You wave your torch at the pig and it runs away through a tiny open window.', colorTrue=color_coding)
711
- del ROOMS[CURRENTROOM]['creatures stats']
705
+ del ROOMS[player.CURRENTROOM]['creatures stats']
712
706
  player.xp += 5
713
- if 'ration' in player.inventory:
707
+ if 'rations' in player.inventory:
714
708
  if ask_for_consent("Do you want to throw your ration at the pig"):
715
709
  enemy_reacting = False
716
710
  type_text(f"You quickly throw rations at the pig. It still doesn't look happy though.", colorTrue=color_coding)
717
- del player.inventory[player.inventory.index('ration')]
711
+ del player.inventory[player.inventory.index('rations')]
718
712
  player.xp += 15
719
713
 
720
714
  if enemy_reacting:
721
- return battle(player, enemy, LAST_ROOM)
715
+ return battle(player, enemy, player.LASTROOM)
722
716
 
723
717
  def handle_greedy_goblin(player: PC, enemy: creature):
724
718
  enemy_reacting = True
@@ -729,7 +723,7 @@ def handle_greedy_goblin(player: PC, enemy: creature):
729
723
  player.money -= 15
730
724
  enemy.dropped_items[1].value += 15
731
725
  if enemy_reacting:
732
- return battle(player, enemy, LAST_ROOM)
726
+ return battle(player, enemy, player.LASTROOM)
733
727
 
734
728
  commands = {
735
729
  'go': handle_go_command,
@@ -755,15 +749,56 @@ guards = [
755
749
  name="Guard",
756
750
  hp=10,
757
751
  atpw=4,
758
- description="A 5ft 8 human guard who looks like he doesn't belong here",
759
- flavor_text="A human guard spots you and says: 'You shouldn't be here'",
760
- type = creature_type('humanoid', 'human'),
752
+ description="A 5'8\" human guard who looks like he doesn't belong here.",
753
+ flavor_text="A human guard spots you and says: 'You shouldn't be here.'",
754
+ type=creature_type('humanoid', 'human'),
761
755
  current_room="Bedroom",
762
756
  patrol_route=["Bedroom", "Office", "Tower Bottom", "Landing", "Bedroom"],
763
- patrol_type='random'
764
- ),
757
+ patrol_type='normal'
758
+ ),
759
+ Guard(
760
+ name="Wolf",
761
+ hp=10,
762
+ atpw=4,
763
+ description="A large wolf with blood covering its face.",
764
+ flavor_text="A wolf spots you and growls.",
765
+ type=creature_type('beast', 'wolf'),
766
+ current_room="Balcony",
767
+ patrol_type='random',
768
+ frendly_text="The wolf nuzzles you"
769
+ ),
765
770
  ]
766
771
 
772
+ def handle_wolf(player: PC, wolf: Guard):
773
+ enemy_reacting = True
774
+ if 'rations' in player.inventory:
775
+ if ask_for_consent("Do you want to give your ration to the wolf"):
776
+ enemy_reacting = False
777
+ type_text(
778
+ "You quickly give your rations to the wolf. It looks happy, walks up to you, and nuzzles you.",
779
+ colorTrue=color_coding
780
+ )
781
+ player.inventory.remove('rations')
782
+ wolf.patrol_type = "follow"
783
+ wolf.frendly = True
784
+ return wolf
785
+ if enemy_reacting:
786
+ return battle(player, wolf, player.LASTROOM)
787
+
788
+ def handle_guard_action(guard):
789
+ # Dynamically build the function name
790
+ function_name = f"handle_{guard.name.lower()}"
791
+
792
+ # Use globals() to retrieve the function by name
793
+ function_to_call = globals().get(function_name)
794
+
795
+ if function_to_call:
796
+ # Call the found function
797
+ guard = function_to_call(player, guard)
798
+ return [True, guard] # Function was found and called
799
+ else:
800
+ return [False, guard] # Function was not found
801
+
767
802
  def main():
768
803
  global player, color_coding
769
804
  global charactersList
@@ -805,6 +840,8 @@ def main():
805
840
 
806
841
  color_coding = loop_til_valid_input("Do you want color coding (Y/N)?", "you didn't answer Y or N.", Y_N).value
807
842
 
843
+
844
+ # start the player in the Hall and sets up everything else
808
845
  player = PC(
809
846
  name,
810
847
  age,
@@ -827,20 +864,21 @@ def main():
827
864
  f"Your favorite weapon is a bow; however, the scimitar is a close second.",
828
865
  ],
829
866
  backstory=f"""
830
- You were born into a life of solitude as an only child. Your father was always away on grand adventures and passed away when you were just {7 if age >= 7 else age}. Your mother, a dedicated
831
- baker, raised you alone. Although she did her best, you spent most of your time helping her in the bakery rather than attending school, which left you feeling quite isolated.
867
+ You were born into a life of solitude as an only child. Your father was always away on grand adventures and passed away when you were just {7 if age >= 7 else age}. Your mother, a dedicated
868
+ baker, raised you alone. Although she did her best, you spent most of your time helping her in the bakery rather than attending school, which left you feeling quite isolated.
832
869
 
833
- At the age of {14 if age >= 14 else age}, driven by a desire for glory and a wish to end the war, you left home to join the army. You spent your first year in rigorous training, followed by a
834
- harsh life on the front lines. Against all odds, you survived, forging bonds with three close friends—though one of them tragically died in battle. Your journey took you from the heights of
835
- mountains to the vast expanses of the ocean, each experience shaping who you are.
870
+ At the age of {14 if age >= 14 else age}, driven by a desire for glory and a wish to end the war, you left home to join the army. You spent your first year in rigorous training, followed by a
871
+ harsh life on the front lines. Against all odds, you survived, forging bonds with three close friends—though one of them tragically died in battle. Your journey took you from the heights of
872
+ mountains to the vast expanses of the ocean, each experience shaping who you are.
836
873
 
837
- You were deeply influenced by the heroes of your childhood—Sam and Aragorn from %*ITALIC*%Lord of the Rings%*RESET*%, which you read as a child, and the characters from %*ITALIC*%The Hunger
838
- Games%*RESET*%, which you read when you were {13 if age >= 13 else age}. These stories inspired you and fueled your dream of heroism. Though your favorite weapon is a bow, you also have a
839
- fondness for the scimitar.
874
+ You were deeply influenced by the heroes of your childhood—Sam and Aragorn from %*ITALIC*%Lord of the Rings%*RESET*%, which you read as a child, and the characters from %*ITALIC*%The Hunger
875
+ Games%*RESET*%, which you read when you were {13 if age >= 13 else age}. These stories inspired you and fueled your dream of heroism. Though your favorite weapon is a bow, you also have a
876
+ fondness for the scimitar.
840
877
 
841
- Now, you find yourself in the Mansion of Amnesia, a place that seems to have erased your memories. The details of your past are fragmented, but the echoes of your history drive you forward. You
842
- must navigate the mansion and uncover the truth behind your captivity, all while drawing strength from the remnants of your past.
843
- """
878
+ Now, you find yourself in the Mansion of Amnesia, a place that seems to have erased your memories. The details of your past are fragmented, but the echoes of your history drive you forward. You
879
+ must navigate the mansion and uncover the truth behind your captivity, all while drawing strength from the remnants of your past.
880
+ """,
881
+ CURRENTROOM='Hall'
844
882
  )
845
883
 
846
884
  # shows the instructions
@@ -853,18 +891,28 @@ def main():
853
891
  # Move guards
854
892
  for guard in guards:
855
893
  if isinstance(guard, Guard):
856
- guard.move(ROOMS)
894
+ guard.move(ROOMS, player)
857
895
 
858
896
  # Check for detection
859
897
  for guard in guards:
860
- if isinstance(guard, Guard):
861
- if guard.check_detection(CURRENTROOM):
862
- guard.type_text_flavor_text()
863
- guards[guards.index(guard)] = battle(player, guard, LAST_ROOM)
898
+ #try:
899
+ if isinstance(guard, Guard):
900
+ if guard.check_detection(player.CURRENTROOM):
901
+ guard_handled = handle_guard_action(guard)
902
+ if not isinstance(guard_handled, list):
903
+ guard_handled = [guard_handled]
904
+ if not guard_handled[0]:
905
+ guard.type_text_flavor_text()
906
+ guards[guards.index(guard)] = battle(player, guard, player.LASTROOM)
907
+ else:
908
+ guards[guards.index(guard)] = guard_handled[1]
909
+ #except:
910
+ # guard.type_text_flavor_text()
911
+ # guards[guards.index(guard)] = battle(player, guard, player.LASTROOM)
864
912
 
865
913
  # player loses if they enter a room with a monster, unless they can fight it.
866
- if 'creatures stats' in ROOMS[CURRENTROOM]:
867
- enemies = ROOMS[CURRENTROOM]['creatures stats']
914
+ if 'creatures stats' in ROOMS[player.CURRENTROOM]:
915
+ enemies = ROOMS[player.CURRENTROOM]['creatures stats']
868
916
  if not isinstance(enemies, list):
869
917
  enemies = [enemies] # Ensure enemies is a list even if there's only one creature
870
918
 
@@ -883,20 +931,20 @@ def main():
883
931
  enemy_REF = handle_greedy_goblin(player, enemy)
884
932
  enemies[enemies.index(enemy)] = enemy_REF
885
933
  else:
886
- enemy_REF = battle(player, enemy, LAST_ROOM)
934
+ enemy_REF = battle(player, enemy, player.LASTROOM)
887
935
  enemies[enemies.index(enemy)] = enemy_REF
888
936
 
889
937
  if all_same_value(enemies, False):
890
- del ROOMS[CURRENTROOM]['creatures stats']
938
+ del ROOMS[player.CURRENTROOM]['creatures stats']
891
939
  else:
892
- ROOMS[CURRENTROOM]['creatures stats'] = enemies
940
+ ROOMS[player.CURRENTROOM]['creatures stats'] = enemies
893
941
 
894
- if 'NPCs' in ROOMS[CURRENTROOM]:
895
- for npcname, npcstats in ROOMS[CURRENTROOM]['NPCs'].items():
942
+ if 'NPCs' in ROOMS[player.CURRENTROOM]:
943
+ for npcname, npcstats in ROOMS[player.CURRENTROOM]['NPCs'].items():
896
944
  if ask_for_consent("Do you want to interact with this NPC") or npcstats.aggressive:
897
945
  npcstats.interact
898
946
  if npcstats.aggressive:
899
- ROOMS[CURRENTROOM]['NPCs'][npcname] = battle(player, npcstats)
947
+ ROOMS[player.CURRENTROOM]['NPCs'][npcname] = battle(player, npcstats)
900
948
 
901
949
  player.special_ability.Tick()
902
950
  quest_manager.update_objective(f"Kill {GameState['Enemys killed']} creatures")
@@ -450,7 +450,7 @@ You notice a ''%*RED*%storage%*RESET*% device in one corner. You hear a %*YELLOW
450
450
  'up': 'Tower Top',
451
451
  },
452
452
  'containers': {
453
- 'Stone': container([item('money-pouch', 'valuable', 25)], True),
453
+ 'stone': container([item('money-pouch', 'valuable', 25)], True),
454
454
  },
455
455
  'item': item('tome'),
456
456
  'info': 'You are in the middle of a stone tower. The only light comes from above, through the cracks around the hatch to above.',
@@ -152,7 +152,7 @@ class Guard(creature):
152
152
  patrol_route (list[str]): The list of rooms the guard patrols through.
153
153
  """
154
154
 
155
- def __init__(self, name: str, hp: int, atpw: int, dropped_items: list[str] = [], description: str = None, flavor_text: str = None, type: creature_type = creature_type('humanoid'), crit_chance: float = 0.05, current_room: str = None, patrol_route: list[str] = None, patrol_type: str = 'normal'):
155
+ def __init__(self, name: str, hp: int, atpw: int, dropped_items: list[str] = [], description: str = None, flavor_text: str = None, type: creature_type = creature_type('humanoid'), crit_chance: float = 0.05, current_room: str = None, patrol_route: list[str] = None, patrol_type: str = 'normal', frendly_text: str = ""):
156
156
  """
157
157
  Initializes a new guard instance.
158
158
 
@@ -167,14 +167,16 @@ class Guard(creature):
167
167
  crit_chance (float, optional): The chance of the guard landing a critical hit. Defaults to 0.05.
168
168
  current_room (str, optional): The current room where the guard is located. Defaults to None.
169
169
  patrol_route (list[str], optional): The list of rooms the guard patrols through. Defaults to None.
170
- patrol_type (str): The type of patrol the guard is doing. Defaults to narmol.
170
+ patrol_type (str): The type of patrol the guard is doing. Defaults to normal.
171
171
  """
172
172
  super().__init__(name, hp, atpw, dropped_items, description, flavor_text, type, crit_chance)
173
173
  self.current_room = current_room
174
174
  self.patrol_route = patrol_route or []
175
175
  self.patrol_type = patrol_type
176
+ self.frendly = False
177
+ self.frendly_text = frendly_text
176
178
 
177
- def move(self, ROOMS):
179
+ def move(self, ROOMS, player):
178
180
  """
179
181
  Moves the guard depending on his patrol type.
180
182
  """
@@ -189,6 +191,11 @@ class Guard(creature):
189
191
  for direction, room in ROOMS[self.current_room]['directions'].items():
190
192
  rooms.append(room)
191
193
  self.current_room = choice(rooms)
194
+ elif self.patrol_type == 'follow':
195
+ for direction, room in ROOMS[self.current_room]['directions'].items():
196
+ if room == player.CURRENTROOM:
197
+ self.current_room = room
198
+ return
192
199
 
193
200
  def check_detection(self, player_room):
194
201
  """
@@ -200,9 +207,12 @@ class Guard(creature):
200
207
  Returns:
201
208
  bool: True if the player is detected, False otherwise.
202
209
  """
203
- if self.current_room == player_room:
210
+ if self.current_room == player_room and not self.frendly:
204
211
  type_text(f"You have been caught by {self.name} in the {self.current_room}!")
205
212
  return True
213
+ elif self.current_room == player_room and self.frendly:
214
+ if random() <= 0.015:
215
+ type_text(self.frendly_text)
206
216
  return False
207
217
 
208
218
  class base_ability:
@@ -253,12 +263,16 @@ class PC(base_character):
253
263
  money: int = 0,
254
264
  weapons_atpws: list = [],
255
265
  backstory: str = "",
266
+ CURRENTROOM: str = "",
267
+ LASTROOM: str = None,
256
268
  ):
257
269
  if not xp:
258
270
  if Level == 1:
259
271
  xp = 0
260
272
  else:
261
273
  xp = Level*25
274
+ if not LASTROOM:
275
+ LASTROOM = CURRENTROOM
262
276
  self.name = Name
263
277
  self.Age = Age
264
278
  self.Class = Class
@@ -279,6 +293,8 @@ class PC(base_character):
279
293
  self.defending = False
280
294
  self.special_ability = special_ability
281
295
  self.backstory = backstory
296
+ self.CURRENTROOM = CURRENTROOM
297
+ self.LASTROOM = LASTROOM
282
298
 
283
299
  def get_change_weapon(self, weapon_atpw: int = 0, weapon_index: int = -1):
284
300
  if weapon_atpw > 0:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: neelthee-mansion
3
- Version: 2.2.5
3
+ Version: 2.3.0
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='2.2.5',
5
+ version='2.3.0',
6
6
  packages=find_packages(), # Automatically finds all packages and modules
7
7
  install_requires=[
8
8
  'psutil', 'playsound', 'requests', 'keyboard', 'pandas', 'validators', 'dicttoxml', 'pytz',