neelthee-mansion 2.1.0__py3-none-any.whl → 2.1.2__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 +39 -1
- {neelthee_mansion-2.1.0.dist-info → neelthee_mansion-2.1.2.dist-info}/METADATA +1 -1
- {neelthee_mansion-2.1.0.dist-info → neelthee_mansion-2.1.2.dist-info}/RECORD +6 -6
- {neelthee_mansion-2.1.0.dist-info → neelthee_mansion-2.1.2.dist-info}/WHEEL +0 -0
- {neelthee_mansion-2.1.0.dist-info → neelthee_mansion-2.1.2.dist-info}/entry_points.txt +0 -0
- {neelthee_mansion-2.1.0.dist-info → neelthee_mansion-2.1.2.dist-info}/top_level.txt +0 -0
@@ -89,6 +89,7 @@ evil_mage = PC(
|
|
89
89
|
|
90
90
|
# Function to parse command
|
91
91
|
def parse_command(command_str: str, commands: dict):
|
92
|
+
global player
|
92
93
|
# Split the command string into parts
|
93
94
|
parts = command_str.split()
|
94
95
|
|
@@ -108,6 +109,7 @@ def parse_command(command_str: str, commands: dict):
|
|
108
109
|
|
109
110
|
|
110
111
|
def showInstructions():
|
112
|
+
global player
|
111
113
|
# Display the game instructions
|
112
114
|
type_text('''
|
113
115
|
===========================
|
@@ -127,6 +129,7 @@ map - Display the map of places you have been to
|
|
127
129
|
|
128
130
|
|
129
131
|
def showHint():
|
132
|
+
global player
|
130
133
|
if 'Hints' in ROOMS[CURRENTROOM]:
|
131
134
|
type_text("You think:", colorTrue=color_coding)
|
132
135
|
hint = choice(ROOMS[CURRENTROOM]['Hints'])
|
@@ -135,6 +138,7 @@ def showHint():
|
|
135
138
|
type_text("You can't think of anything", colorTrue=color_coding)
|
136
139
|
|
137
140
|
def check_direction(var: str, directions: list):
|
141
|
+
global player
|
138
142
|
for direction in directions:
|
139
143
|
if var == direction:
|
140
144
|
return True
|
@@ -142,6 +146,7 @@ def check_direction(var: str, directions: list):
|
|
142
146
|
|
143
147
|
|
144
148
|
def End(text: str, win: bool = True):
|
149
|
+
global player
|
145
150
|
type_text(text, colorTrue=color_coding)
|
146
151
|
if win:
|
147
152
|
type_text('Do you want to leave the game? Y/N', colorTrue=color_coding)
|
@@ -164,6 +169,7 @@ NOTE_NUM = 0
|
|
164
169
|
|
165
170
|
|
166
171
|
def add_note(note, parchment_index=None):
|
172
|
+
global player
|
167
173
|
player.NOTES.append(note)
|
168
174
|
NOTE_NUM += 1
|
169
175
|
inv_note = 'note ' + str(NOTE_NUM)
|
@@ -175,8 +181,10 @@ def add_note(note, parchment_index=None):
|
|
175
181
|
|
176
182
|
|
177
183
|
def Use_grappling_hook():
|
184
|
+
global player
|
178
185
|
|
179
186
|
def swing_into_forest():
|
187
|
+
global player
|
180
188
|
type_text("You throw your grappling-hook, it catches a branch of a nearby tree and hooks back onto itself. \nYou can swing into the forest!", colorTrue=color_coding)
|
181
189
|
if ask_for_consent("Do you want to swing into the forest"):
|
182
190
|
type_text("You swing into the forest", colorTrue=color_coding)
|
@@ -185,6 +193,7 @@ def Use_grappling_hook():
|
|
185
193
|
type_text("You flick the rope and it unhooks. You continue exploring the house.", colorTrue=color_coding)
|
186
194
|
|
187
195
|
def climb_into_house():
|
196
|
+
global player
|
188
197
|
type_text("You throw your grappling-hook, it catches the railing of the nearby house and hooks back onto itself. \nYou can climb into the house!", colorTrue=color_coding)
|
189
198
|
if ask_for_consent("Do you want to climb into the house"):
|
190
199
|
type_text("You climb into the house", colorTrue=color_coding)
|
@@ -199,6 +208,7 @@ def Use_grappling_hook():
|
|
199
208
|
|
200
209
|
|
201
210
|
def Use_quill():
|
211
|
+
global player
|
202
212
|
|
203
213
|
if all(item in player.inventory for item in ['ink-pot', 'parchment', 'quill']):
|
204
214
|
parchment_index = player.inventory.index('parchment')
|
@@ -214,6 +224,7 @@ def Use_quill():
|
|
214
224
|
|
215
225
|
|
216
226
|
def Use_note(note_number):
|
227
|
+
global player
|
217
228
|
"""Reads a specified note from the player's inventory."""
|
218
229
|
note_key = f'note {note_number}'
|
219
230
|
if note_key in player.inventory:
|
@@ -225,6 +236,7 @@ def Use_note(note_number):
|
|
225
236
|
|
226
237
|
|
227
238
|
def Use(moveone, movetwo=None):
|
239
|
+
global player
|
228
240
|
"""Uses an item from the player's inventory."""
|
229
241
|
if moveone in player.inventory:
|
230
242
|
item_obj = player.inventory[player.inventory.index(moveone)]
|
@@ -245,10 +257,12 @@ def Use(moveone, movetwo=None):
|
|
245
257
|
|
246
258
|
|
247
259
|
def Move(move):
|
260
|
+
global player
|
248
261
|
global CURRENTROOM, LAST_ROOM
|
249
262
|
|
250
263
|
|
251
264
|
def attempt_charter():
|
265
|
+
global player
|
252
266
|
if player.money >= 10:
|
253
267
|
player.money -= 10
|
254
268
|
if 'descovered' in ROOMS[newRoom] and not ROOMS[newRoom]['descovered']:
|
@@ -259,6 +273,7 @@ def Move(move):
|
|
259
273
|
return CURRENTROOM
|
260
274
|
|
261
275
|
def attempt_move_to_garden():
|
276
|
+
global player
|
262
277
|
if 'key' in player.inventory:
|
263
278
|
End('You unlock the gate to the garden with the key!')
|
264
279
|
return newRoom
|
@@ -267,6 +282,7 @@ def Move(move):
|
|
267
282
|
return newRoom
|
268
283
|
|
269
284
|
def move_to_room():
|
285
|
+
global player
|
270
286
|
global LAST_ROOM
|
271
287
|
LAST_ROOM = CURRENTROOM
|
272
288
|
if move == '0':
|
@@ -296,12 +312,14 @@ def Move(move):
|
|
296
312
|
|
297
313
|
|
298
314
|
def start():
|
315
|
+
global player
|
299
316
|
# type_text a main men, colorTrue=color_codingu
|
300
317
|
type_text(f'\nHello %*MAGENTA*%{player.name}%*RESET*% and welcome to my Role Playing Game. \nI hope you have fun!', colorTrue=color_coding)
|
301
318
|
showInstructions()
|
302
319
|
|
303
320
|
|
304
321
|
def showStatus():
|
322
|
+
global player
|
305
323
|
|
306
324
|
# Display player's current status
|
307
325
|
text = f'\n---------------------------'
|
@@ -332,6 +350,7 @@ def showStatus():
|
|
332
350
|
|
333
351
|
|
334
352
|
def display_directions(text):
|
353
|
+
global player
|
335
354
|
directions = ['north', 'east', 'south', 'west', 'up', 'down', 'teleport']
|
336
355
|
direction_descriptions = {
|
337
356
|
'house': {
|
@@ -431,34 +450,43 @@ def monster_turn(player: PC, monster: creature):
|
|
431
450
|
player.take_damage(damage)
|
432
451
|
|
433
452
|
def perform_attack(attacker: PC, defender: creature):
|
453
|
+
global player
|
434
454
|
"""
|
435
455
|
Perform an attack action.
|
436
456
|
|
437
457
|
Args:
|
438
458
|
attacker (PC): The attacking character.
|
439
459
|
defender (creature): The defending monster.
|
460
|
+
global player
|
440
461
|
"""
|
441
462
|
damage = calculate_damage(attacker, defender)
|
463
|
+
global player
|
442
464
|
defender.take_damage(damage)
|
465
|
+
global player
|
443
466
|
|
444
467
|
def handle_victory(player: PC, monster: creature):
|
445
468
|
"""
|
446
469
|
Handle the logic when the player defeats the monster.
|
470
|
+
global player
|
447
471
|
|
448
472
|
Args:
|
449
473
|
player (PC): The player character.
|
450
474
|
monster (creature): The defeated monster.
|
475
|
+
global player
|
451
476
|
"""
|
452
477
|
type_text(f"You defeat the %*CYAN*%{monster.name}%*RESET*%!", colorTrue=color_coding)
|
453
478
|
player.inventory_add(monster.dropped_items)
|
454
479
|
|
455
480
|
def calculate_damage(attacker, defender) -> int:
|
481
|
+
global player
|
456
482
|
"""
|
457
483
|
Calculate the damage inflicted by the attacker on the defender.
|
484
|
+
global player
|
458
485
|
|
459
486
|
Args:
|
460
487
|
attacker: The attacking character.
|
461
488
|
defender: The defending character.
|
489
|
+
global player
|
462
490
|
|
463
491
|
Returns:
|
464
492
|
int: The calculated damage.
|
@@ -478,6 +506,7 @@ def calculate_damage(attacker, defender) -> int:
|
|
478
506
|
return damage
|
479
507
|
|
480
508
|
def calculate_damage_range(atpw: int) -> tuple[int, int]:
|
509
|
+
global player
|
481
510
|
"""
|
482
511
|
Calculate the damage range based on attack power.
|
483
512
|
|
@@ -510,6 +539,7 @@ def use_special_ability(player: PC, monster: creature):
|
|
510
539
|
|
511
540
|
|
512
541
|
def command():
|
542
|
+
global player
|
513
543
|
try:
|
514
544
|
ShouldBreak = False
|
515
545
|
|
@@ -558,6 +588,7 @@ def handle_sleep_command(player: PC):
|
|
558
588
|
type_text("You feel refreshed after a good rest.", colorTrue=color_coding)
|
559
589
|
|
560
590
|
def get_player_input(split = True):
|
591
|
+
global player
|
561
592
|
move = ''
|
562
593
|
while move == '':
|
563
594
|
move = str(input('>')).strip().lower()
|
@@ -566,6 +597,7 @@ def get_player_input(split = True):
|
|
566
597
|
return move
|
567
598
|
|
568
599
|
def handle_go_command(direction):
|
600
|
+
global player
|
569
601
|
Move(direction)
|
570
602
|
|
571
603
|
def handle_get_command(player: PC, item_name):
|
@@ -577,6 +609,7 @@ def handle_get_command(player: PC, item_name):
|
|
577
609
|
type_text(f"Can't get {item_name}!", colorTrue=color_coding)
|
578
610
|
|
579
611
|
def handle_look_command():
|
612
|
+
global player
|
580
613
|
return_ = False
|
581
614
|
if 'item' in ROOMS[CURRENTROOM]:
|
582
615
|
type_text(f'The item in the room: %*BLUE*%{ROOMS[CURRENTROOM]["item"].name}%*RESET*%.', colorTrue=color_coding)
|
@@ -589,6 +622,7 @@ def handle_look_command():
|
|
589
622
|
type_text('There is nothing of interest.', colorTrue=color_coding)
|
590
623
|
|
591
624
|
def handle_use_command(item = None, sub_item = None):
|
625
|
+
global player
|
592
626
|
Use(item, sub_item)
|
593
627
|
|
594
628
|
def handle_search_command(player, container = None, sub_container = None):
|
@@ -635,6 +669,7 @@ def put_in_container(player: PC, PutItem = None, container = None):
|
|
635
669
|
|
636
670
|
|
637
671
|
def handle_get_quest_command(questnum):
|
672
|
+
global player
|
638
673
|
if 'quests' in ROOMS[CURRENTROOM]:
|
639
674
|
if questnum in ROOMS[CURRENTROOM]['quests']:
|
640
675
|
quest_manager.add_quest(ROOMS[CURRENTROOM]['quests'][questnum])
|
@@ -643,6 +678,7 @@ def handle_get_quest_command(questnum):
|
|
643
678
|
|
644
679
|
|
645
680
|
def PrintMap():
|
681
|
+
global player
|
646
682
|
type_text(ShowMap())
|
647
683
|
|
648
684
|
|
@@ -712,6 +748,7 @@ commands = {
|
|
712
748
|
|
713
749
|
|
714
750
|
def quit():
|
751
|
+
global player
|
715
752
|
exit()
|
716
753
|
|
717
754
|
guards = [
|
@@ -729,6 +766,7 @@ guards = [
|
|
729
766
|
]
|
730
767
|
|
731
768
|
def main():
|
769
|
+
global player
|
732
770
|
global charactersList
|
733
771
|
|
734
772
|
|
@@ -793,7 +831,7 @@ def main():
|
|
793
831
|
f"The people you admire the most are Sam and Aragorn from Lord of the Rings, which you read as a child. You have also read the Hunger Games when you were {13 if age >= 13 else age}",
|
794
832
|
f"Your favorite weapon is a bow; however, the scimitar is a close second.",
|
795
833
|
],
|
796
|
-
|
834
|
+
backstory=f"""
|
797
835
|
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
|
798
836
|
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.
|
799
837
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
neelthee_mansion/Mansion_of_Amnesia.py,sha256=
|
1
|
+
neelthee_mansion/Mansion_of_Amnesia.py,sha256=FcKk8xE4JXV6ZGF8cFQqrCZ4ftTN2GFfgps02DlHqyU,37650
|
2
2
|
neelthee_mansion/Quests.py,sha256=q6VzR3mt9AYe29ACWZuf-suz4yOKrL946aJ493eQRS0,2611
|
3
3
|
neelthee_mansion/Rooms.py,sha256=DPGcAWro1utfHjsTiwLfkf6dnypKNG-T_fnYlJXNsyk,79262
|
4
4
|
neelthee_mansion/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -7,8 +7,8 @@ neelthee_mansion/all_game_utils.py,sha256=Xfty9uXiYAfmA6iVzJurq852ZBPn7a4gQUcUca
|
|
7
7
|
neelthee_mansion/creatures.py,sha256=BMznNtk4dH5ns1YVtOKprVOIp0PjFf7pMHjAVpxvchg,13994
|
8
8
|
neelthee_mansion/items.py,sha256=MrLIpY33I5jU926MCapHAb34KKyZAf9rHo1E2hIUHS4,1898
|
9
9
|
neelthee_mansion/utils.py,sha256=IfaFlIDPGMxW5eBNDTuRi-wFpPwPKSThdjYGpOZphYs,11494
|
10
|
-
neelthee_mansion-2.1.
|
11
|
-
neelthee_mansion-2.1.
|
12
|
-
neelthee_mansion-2.1.
|
13
|
-
neelthee_mansion-2.1.
|
14
|
-
neelthee_mansion-2.1.
|
10
|
+
neelthee_mansion-2.1.2.dist-info/METADATA,sha256=N5s-LgC44cFb2nipkliHyGiTYWAEcCC3gMhQZRyT0E4,1680
|
11
|
+
neelthee_mansion-2.1.2.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
|
12
|
+
neelthee_mansion-2.1.2.dist-info/entry_points.txt,sha256=j5ScTTyIidFhmT3F6hcX9pnlom4cJdDmfe26BmM6Igo,56
|
13
|
+
neelthee_mansion-2.1.2.dist-info/top_level.txt,sha256=woQImQewylhly5Rb24HwPEGMxPY6do_PaUwGd5BNLOM,17
|
14
|
+
neelthee_mansion-2.1.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|