neelthee-mansion 3.16.6__py3-none-any.whl → 3.16.7__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/items.py CHANGED
@@ -60,37 +60,38 @@ class KeyRevealer:
60
60
  self.max_reveals = max_reveals
61
61
 
62
62
  def reveal_key_code(self, obj: Key, mask_char="="):
63
- if obj.reveal_count >= self.max_reveals:
64
- type_text(f"You can only reveal a Key Code {self.max_reveals} times.")
65
- type_text(f"Here is what you already know about this lock: {obj.CurentRevealStr}")
66
- return
63
+ if hasattr(obj, "reveal_count"):
64
+ if obj.reveal_count >= self.max_reveals:
65
+ type_text(f"You can only reveal a Key Code {self.max_reveals} times.")
66
+ type_text(f"Here is what you already know about this lock: {obj.CurentRevealStr}")
67
+ return
67
68
 
68
- if not hasattr(obj, 'lock'):
69
- key_code = obj.value
70
- else:
71
- key_code = obj.lock.key_code
72
-
73
- one_third_length = len(key_code) // 3
74
-
75
- # Keep track of already revealed indices
76
- revealed_indices = {i for i, char in enumerate(obj.CurentRevealStr) if char != mask_char}
77
-
78
- # Get new indices to reveal
79
- new_indices = set(sample(range(len(key_code)), one_third_length))
69
+ if not hasattr(obj, 'lock'):
70
+ key_code = obj.value
71
+ else:
72
+ key_code = obj.lock.key_code
80
73
 
81
- # Combine revealed and new indices
82
- all_revealed_indices = revealed_indices.union(new_indices)
83
-
84
- # Create the result with revealed characters
85
- result = [
86
- key_code[i] if i in all_revealed_indices else mask_char
87
- for i in range(len(key_code))
88
- ]
89
-
90
- obj.reveal_count += 1
91
- obj.CurentRevealStr = ''.join(result)
92
- type_text("".join(result))
93
- return True
74
+ one_third_length = len(key_code) // 3
75
+
76
+ # Keep track of already revealed indices
77
+ revealed_indices = {i for i, char in enumerate(obj.CurentRevealStr) if char != mask_char}
78
+
79
+ # Get new indices to reveal
80
+ new_indices = set(sample(range(len(key_code)), one_third_length))
81
+
82
+ # Combine revealed and new indices
83
+ all_revealed_indices = revealed_indices.union(new_indices)
84
+
85
+ # Create the result with revealed characters
86
+ result = [
87
+ key_code[i] if i in all_revealed_indices else mask_char
88
+ for i in range(len(key_code))
89
+ ]
90
+
91
+ obj.reveal_count += 1
92
+ obj.CurentRevealStr = ''.join(result)
93
+ type_text("".join(result))
94
+ return True
94
95
 
95
96
  class ShopItem:
96
97
  def __init__(self, item: item, price: int):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: neelthee-mansion
3
- Version: 3.16.6
3
+ Version: 3.16.7
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
@@ -6,10 +6,10 @@ neelthee_mansion/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
6
6
  neelthee_mansion/__main__.py,sha256=OIAWZ04le70DyjtR4hlmK9csHej7EHxeUrMoNnM-Vjc,95
7
7
  neelthee_mansion/all_game_utils.py,sha256=mnxws_YEnsoftkkBMZv1k_zlnGKWGenUvsZnNKjuFJQ,349
8
8
  neelthee_mansion/creatures.py,sha256=nc-6YQ7S89teDiypJdHKLLuq-q3UpbQCVGfJ4hnCb7M,15600
9
- neelthee_mansion/items.py,sha256=sMi2ZdeWYFNAeZ01szYBIHKQPHO14aAVuyAG4tz0ZyM,5538
9
+ neelthee_mansion/items.py,sha256=rfbyQ-2-MP-LCXKHRyimy-0fFFLmVYZWZcKyCCloF_M,5644
10
10
  neelthee_mansion/utils.py,sha256=Wt1CdK4eCskrxRXkeKgzVoa_NIzwQ047dJU-b_e8pb8,13559
11
- neelthee_mansion-3.16.6.dist-info/METADATA,sha256=jf4sEV_qyHum0wR-esl37uwdS3FBksjC9xJ-lZqH-z0,1992
12
- neelthee_mansion-3.16.6.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
13
- neelthee_mansion-3.16.6.dist-info/entry_points.txt,sha256=j5ScTTyIidFhmT3F6hcX9pnlom4cJdDmfe26BmM6Igo,56
14
- neelthee_mansion-3.16.6.dist-info/top_level.txt,sha256=woQImQewylhly5Rb24HwPEGMxPY6do_PaUwGd5BNLOM,17
15
- neelthee_mansion-3.16.6.dist-info/RECORD,,
11
+ neelthee_mansion-3.16.7.dist-info/METADATA,sha256=oQ2JXJ4-w8KbcSVasJ300FjQsbeKNcCGCbAm-tHQlnE,1992
12
+ neelthee_mansion-3.16.7.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
13
+ neelthee_mansion-3.16.7.dist-info/entry_points.txt,sha256=j5ScTTyIidFhmT3F6hcX9pnlom4cJdDmfe26BmM6Igo,56
14
+ neelthee_mansion-3.16.7.dist-info/top_level.txt,sha256=woQImQewylhly5Rb24HwPEGMxPY6do_PaUwGd5BNLOM,17
15
+ neelthee_mansion-3.16.7.dist-info/RECORD,,