neelthee-mansion 3.19.15__py3-none-any.whl → 3.19.17__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.
- neelthee_mansion/Mansion_of_Amnesia.py +7 -0
- neelthee_mansion/Rooms.py +4 -1
- neelthee_mansion/creatures.py +106 -0
- {neelthee_mansion-3.19.15.dist-info → neelthee_mansion-3.19.17.dist-info}/METADATA +1 -1
- {neelthee_mansion-3.19.15.dist-info → neelthee_mansion-3.19.17.dist-info}/RECORD +9 -9
- {neelthee_mansion-3.19.15.dist-info → neelthee_mansion-3.19.17.dist-info}/LICENSE.md +0 -0
- {neelthee_mansion-3.19.15.dist-info → neelthee_mansion-3.19.17.dist-info}/WHEEL +0 -0
- {neelthee_mansion-3.19.15.dist-info → neelthee_mansion-3.19.17.dist-info}/entry_points.txt +0 -0
- {neelthee_mansion-3.19.15.dist-info → neelthee_mansion-3.19.17.dist-info}/top_level.txt +0 -0
@@ -531,6 +531,13 @@ def Examine(*Args):
|
|
531
531
|
type_text(f"The container {Name} has no lock.")
|
532
532
|
else:
|
533
533
|
type_text(f"There is no container named {Name} in this room.")
|
534
|
+
elif "creatures stats" in ROOMS[player.CURRENTROOM]:
|
535
|
+
for Creature in ROOMS[player.CURRENTROOM]["creatures stats"]:
|
536
|
+
if isinstance(Creature, creature):
|
537
|
+
if isinstance(Creature, NPC):
|
538
|
+
if Creature.name.lower() == Name:
|
539
|
+
Creature.talk()
|
540
|
+
return
|
534
541
|
else:
|
535
542
|
type_text(f"There is nothing special about the {Name}.")
|
536
543
|
|
neelthee_mansion/Rooms.py
CHANGED
@@ -737,10 +737,13 @@ You notice a "
|
|
737
737
|
"west": Door("Room name"),
|
738
738
|
"bookcase": Door("Cavern 3"),
|
739
739
|
},
|
740
|
+
"creatures stats": [
|
741
|
+
Geraldo()
|
742
|
+
],
|
740
743
|
"containers": {
|
741
744
|
"bookcases": container(sample(books, 3)),
|
742
745
|
},
|
743
|
-
"info": "Towering %*RED*%bookcases%*RESET*% filled with odd, mismatched books line the walls. Some have faded titles, others are blank, arranged almost deliberately. One bookcase stands slightly forward, leaving a faint scrape on the floor. The air is still, as if waiting for you to notice.",
|
746
|
+
"info": "Towering %*RED*%bookcases%*RESET*% filled with odd, mismatched books line the walls. A cat named %*BROWN*%geraldo times%*RESET*% Some have faded titles, others are blank, arranged almost deliberately. One bookcase stands slightly forward, leaving a faint scrape on the floor. The air is still, as if waiting for you to notice.",
|
744
747
|
"map": """
|
745
748
|
█████████
|
746
749
|
█ █
|
neelthee_mansion/creatures.py
CHANGED
@@ -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,16 +1,16 @@
|
|
1
1
|
neelthee_mansion/Books.py,sha256=ABAdO2LQJ0PwPlHXpvdANoyz6uNbMTkI8-_RDpq6Qcc,25627
|
2
|
-
neelthee_mansion/Mansion_of_Amnesia.py,sha256=
|
2
|
+
neelthee_mansion/Mansion_of_Amnesia.py,sha256=uvBFoEJbchJDFLKrfcK3sZ7R-4T8xA7a-jcLqgfSp5Q,49504
|
3
3
|
neelthee_mansion/Quests.py,sha256=pUlru2RugP57MACQORZaF_X9lsbefTdPYTSO474phgo,2791
|
4
|
-
neelthee_mansion/Rooms.py,sha256=
|
4
|
+
neelthee_mansion/Rooms.py,sha256=OU2A0XhR6xQuGUWE_65JFSOXn6Unxpmow12ucPgWNW4,78352
|
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=
|
8
|
+
neelthee_mansion/creatures.py,sha256=G-0PmSVwbbdyYA5p0IrEaFyV7lbO4JamOiYDwvncgAo,20066
|
9
9
|
neelthee_mansion/items.py,sha256=mV4K3Ep522LypL74NOT112bpP6ywQ1DR0A38KiHJFa8,5816
|
10
10
|
neelthee_mansion/utils.py,sha256=GaCkein6dppeufYfBMk59gHAE2b4p9TJW2MsRjyyFvQ,13702
|
11
|
-
neelthee_mansion-3.19.
|
12
|
-
neelthee_mansion-3.19.
|
13
|
-
neelthee_mansion-3.19.
|
14
|
-
neelthee_mansion-3.19.
|
15
|
-
neelthee_mansion-3.19.
|
16
|
-
neelthee_mansion-3.19.
|
11
|
+
neelthee_mansion-3.19.17.dist-info/LICENSE.md,sha256=CV8XGZaCyyAMdbkYFQUjb8AjBq9vkoyqdZCq1_hetms,1105
|
12
|
+
neelthee_mansion-3.19.17.dist-info/METADATA,sha256=rW2T321GkvgqC-f4_DWN9gKdFCW_Jub7Dqe2grML66A,1757
|
13
|
+
neelthee_mansion-3.19.17.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
|
14
|
+
neelthee_mansion-3.19.17.dist-info/entry_points.txt,sha256=j5ScTTyIidFhmT3F6hcX9pnlom4cJdDmfe26BmM6Igo,56
|
15
|
+
neelthee_mansion-3.19.17.dist-info/top_level.txt,sha256=woQImQewylhly5Rb24HwPEGMxPY6do_PaUwGd5BNLOM,17
|
16
|
+
neelthee_mansion-3.19.17.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|