neelthee-mansion 3.19.15__tar.gz → 3.19.16__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.
- {neelthee_mansion-3.19.15 → neelthee_mansion-3.19.16}/PKG-INFO +1 -1
- {neelthee_mansion-3.19.15 → neelthee_mansion-3.19.16}/neelthee_mansion/creatures.py +106 -0
- {neelthee_mansion-3.19.15 → neelthee_mansion-3.19.16}/neelthee_mansion.egg-info/PKG-INFO +1 -1
- {neelthee_mansion-3.19.15 → neelthee_mansion-3.19.16}/setup.py +1 -1
- {neelthee_mansion-3.19.15 → neelthee_mansion-3.19.16}/LICENSE.md +0 -0
- {neelthee_mansion-3.19.15 → neelthee_mansion-3.19.16}/README.md +0 -0
- {neelthee_mansion-3.19.15 → neelthee_mansion-3.19.16}/neelthee_mansion/Books.py +0 -0
- {neelthee_mansion-3.19.15 → neelthee_mansion-3.19.16}/neelthee_mansion/Mansion_of_Amnesia.py +0 -0
- {neelthee_mansion-3.19.15 → neelthee_mansion-3.19.16}/neelthee_mansion/Quests.py +0 -0
- {neelthee_mansion-3.19.15 → neelthee_mansion-3.19.16}/neelthee_mansion/Rooms.py +0 -0
- {neelthee_mansion-3.19.15 → neelthee_mansion-3.19.16}/neelthee_mansion/__init__.py +0 -0
- {neelthee_mansion-3.19.15 → neelthee_mansion-3.19.16}/neelthee_mansion/__main__.py +0 -0
- {neelthee_mansion-3.19.15 → neelthee_mansion-3.19.16}/neelthee_mansion/all_game_utils.py +0 -0
- {neelthee_mansion-3.19.15 → neelthee_mansion-3.19.16}/neelthee_mansion/items.py +0 -0
- {neelthee_mansion-3.19.15 → neelthee_mansion-3.19.16}/neelthee_mansion/utils.py +0 -0
- {neelthee_mansion-3.19.15 → neelthee_mansion-3.19.16}/neelthee_mansion.egg-info/SOURCES.txt +0 -0
- {neelthee_mansion-3.19.15 → neelthee_mansion-3.19.16}/neelthee_mansion.egg-info/dependency_links.txt +0 -0
- {neelthee_mansion-3.19.15 → neelthee_mansion-3.19.16}/neelthee_mansion.egg-info/entry_points.txt +0 -0
- {neelthee_mansion-3.19.15 → neelthee_mansion-3.19.16}/neelthee_mansion.egg-info/requires.txt +0 -0
- {neelthee_mansion-3.19.15 → neelthee_mansion-3.19.16}/neelthee_mansion.egg-info/top_level.txt +0 -0
- {neelthee_mansion-3.19.15 → neelthee_mansion-3.19.16}/setup.cfg +0 -0
@@ -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
|
+
)
|
File without changes
|
File without changes
|
File without changes
|
{neelthee_mansion-3.19.15 → neelthee_mansion-3.19.16}/neelthee_mansion/Mansion_of_Amnesia.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{neelthee_mansion-3.19.15 → neelthee_mansion-3.19.16}/neelthee_mansion.egg-info/dependency_links.txt
RENAMED
File without changes
|
{neelthee_mansion-3.19.15 → neelthee_mansion-3.19.16}/neelthee_mansion.egg-info/entry_points.txt
RENAMED
File without changes
|
{neelthee_mansion-3.19.15 → neelthee_mansion-3.19.16}/neelthee_mansion.egg-info/requires.txt
RENAMED
File without changes
|
{neelthee_mansion-3.19.15 → neelthee_mansion-3.19.16}/neelthee_mansion.egg-info/top_level.txt
RENAMED
File without changes
|
File without changes
|