neelthee-mansion 3.19.14__py3-none-any.whl → 3.19.16__py3-none-any.whl

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.
@@ -457,3 +457,109 @@ class PC_action:
457
457
  if isinstance(value, PC_action):
458
458
  return self.value == value.value
459
459
  return self.value == value
460
+
461
+
462
+ class NPC(Guard):
463
+
464
+ def __init__(
465
+ self,
466
+ name,
467
+ hp,
468
+ atpw,
469
+ dropped_items=[],
470
+ description=None,
471
+ flavor_text=None,
472
+ type=creature_type("humanoid"),
473
+ crit_chance=0.05,
474
+ current_room=None,
475
+ patrol_route=None,
476
+ patrol_type="normal",
477
+ frendly_text="",
478
+ generic_response="The person looks like they don't see you.",
479
+ ):
480
+ super().__init__(
481
+ name,
482
+ hp,
483
+ atpw,
484
+ dropped_items,
485
+ description,
486
+ flavor_text,
487
+ type,
488
+ crit_chance,
489
+ current_room,
490
+ patrol_route,
491
+ patrol_type,
492
+ frendly_text,
493
+ )
494
+ self.frendly = True
495
+ # Define the responses for each topic
496
+ self.responses = {
497
+ "introduction": "Oh, hello. I didn't see you there.",
498
+ }
499
+
500
+ # Define keyword variations that map to the same topic
501
+ self.keyword_variations = {
502
+ "introduction": ["hello", "hi", "greetings", "hey"],
503
+ }
504
+
505
+ # To keep track of which topics the player has asked about
506
+ self.asked_about = set()
507
+ self.generic_response = generic_response
508
+
509
+ def talk(self):
510
+ player_input = input(
511
+ f"What do you want to say to %*BROWN*%{self.name}%*RESET*%? \n>"
512
+ )
513
+
514
+ # Normalize the input to lowercase
515
+ player_input = player_input.lower()
516
+
517
+ # Check for keywords and map to corresponding response
518
+ for topic, variations in self.keyword_variations.items():
519
+ if any(variation in player_input for variation in variations):
520
+ self.asked_about.add(topic)
521
+ return self._get_response(topic)
522
+
523
+ # If no keywords found, return a generic response
524
+ return self._generic_response()
525
+
526
+ def _get_response(self, topic):
527
+ """Return a response from the NPC based on the topic asked."""
528
+ return f"{self.responses[topic]}"
529
+
530
+ def _generic_response(self):
531
+ """Default response if no known keyword is found in the player's input."""
532
+ return self.generic_response
533
+
534
+
535
+ class Geraldo(NPC):
536
+
537
+ def __init__(self):
538
+ super().__init__(
539
+ "Geraldo Times",
540
+ 9999999999,
541
+ 999,
542
+ type=creature_type("beast", "cat"),
543
+ flavor_text="You see a cat sitting on a bookshelf.",
544
+ description="The cat looks at you with a bored look on its face.",
545
+ responses={
546
+ "introduction": "Oh, you're here. Didn't think you'd make it. But I suppose I'm not the one making the decisions around here, am I?",
547
+ "mansion": "The mansion? Well, it's not as grand as it may seem. Inside, it's as much a prison as it is a home. Everyone you find here has been trapped by Neel-thee. You’ll find that out soon enough.",
548
+ "neel-thee": "Neel-thee? Oh, you've heard of him, have you? He’s not one to be trifled with, but then again, neither am I.",
549
+ "escape": "Escape? Ha. If only it were that simple. If you're planning to leave, you'd better have a better idea than just running out the door.",
550
+ "danger": "Danger? Well, it’s always lurking, isn’t it? You might not see it, but I feel it in the air. Something's coming, something... wrong.",
551
+ },
552
+ keyword_variations={
553
+ "introduction": ["hello", "hi", "greetings", "hey"],
554
+ "mansion": ["mansion", "this place", "the mansion", "home", "house"],
555
+ "neel-thee": [
556
+ "neel-thee",
557
+ "who is neel-thee",
558
+ "tell me about neel-thee",
559
+ "who is this neel-thee",
560
+ ],
561
+ "escape": ["escape", "leave", "get out", "break free"],
562
+ "danger": ["danger", "something wrong", "something’s off", "dangerous"],
563
+ },
564
+ generic_response="The cat looks at you with those mysterious eyes, as if deciding whether or not to speak.",
565
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: neelthee-mansion
3
- Version: 3.19.14
3
+ Version: 3.19.16
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
@@ -5,12 +5,12 @@ neelthee_mansion/Rooms.py,sha256=DUTN0OpYvr-JjKvu9aGteyvvgKl2LAskvgt1onlTNXE,782
5
5
  neelthee_mansion/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  neelthee_mansion/__main__.py,sha256=OIAWZ04le70DyjtR4hlmK9csHej7EHxeUrMoNnM-Vjc,95
7
7
  neelthee_mansion/all_game_utils.py,sha256=AasunTkFmgAqt9ZIoYmymi4R7leBe4ubW-C1ts0Qclo,351
8
- neelthee_mansion/creatures.py,sha256=aJtEMzanOL9sYkozmZuzJ2Tutl85cWgQ2LbFbZ-Edao,15869
8
+ neelthee_mansion/creatures.py,sha256=C8Vab65oLIMIbRXFk_8s2Uwa9SVD65JJkxiclgiUSlI,20066
9
9
  neelthee_mansion/items.py,sha256=mV4K3Ep522LypL74NOT112bpP6ywQ1DR0A38KiHJFa8,5816
10
10
  neelthee_mansion/utils.py,sha256=GaCkein6dppeufYfBMk59gHAE2b4p9TJW2MsRjyyFvQ,13702
11
- neelthee_mansion-3.19.14.dist-info/LICENSE.md,sha256=CV8XGZaCyyAMdbkYFQUjb8AjBq9vkoyqdZCq1_hetms,1105
12
- neelthee_mansion-3.19.14.dist-info/METADATA,sha256=Z6GDglDjMZF718feeUjx2Uzj14LmqbsUea2Znc3SJcE,1757
13
- neelthee_mansion-3.19.14.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
14
- neelthee_mansion-3.19.14.dist-info/entry_points.txt,sha256=j5ScTTyIidFhmT3F6hcX9pnlom4cJdDmfe26BmM6Igo,56
15
- neelthee_mansion-3.19.14.dist-info/top_level.txt,sha256=woQImQewylhly5Rb24HwPEGMxPY6do_PaUwGd5BNLOM,17
16
- neelthee_mansion-3.19.14.dist-info/RECORD,,
11
+ neelthee_mansion-3.19.16.dist-info/LICENSE.md,sha256=CV8XGZaCyyAMdbkYFQUjb8AjBq9vkoyqdZCq1_hetms,1105
12
+ neelthee_mansion-3.19.16.dist-info/METADATA,sha256=qfWTZ9CElWXK6Qa5sKmIB1Z9fdvTZz0YmUhQSa9j3NM,1757
13
+ neelthee_mansion-3.19.16.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
14
+ neelthee_mansion-3.19.16.dist-info/entry_points.txt,sha256=j5ScTTyIidFhmT3F6hcX9pnlom4cJdDmfe26BmM6Igo,56
15
+ neelthee_mansion-3.19.16.dist-info/top_level.txt,sha256=woQImQewylhly5Rb24HwPEGMxPY6do_PaUwGd5BNLOM,17
16
+ neelthee_mansion-3.19.16.dist-info/RECORD,,