neelthee-mansion 2.2.2__py3-none-any.whl → 2.2.3__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.
@@ -750,6 +750,14 @@ commands = {
750
750
  def quit():
751
751
  exit()
752
752
 
753
+ def do_random_event():
754
+ if 'Random events' in ROOMS[CURRENTROOM] and 'Event chance' in ROOMS[CURRENTROOM]:
755
+ if random() <= ROOMS[CURRENTROOM]['Event chance']:
756
+ if is_executable(Event['Event code']):
757
+ Event = choice(ROOMS[CURRENTROOM]['Random events'])
758
+ type_text(Event['Output text'])
759
+ exec(Event['Event code'])
760
+
753
761
  guards = [
754
762
  Guard(
755
763
  name="Guard",
@@ -903,6 +911,7 @@ def main():
903
911
  for ___ in GameState['collected items']:
904
912
  if isinstance(___, item):
905
913
  quest_manager.update_objective(f"Colect {___.name}")
914
+ do_random_event()
906
915
 
907
916
 
908
917
 
neelthee_mansion/Rooms.py CHANGED
@@ -161,7 +161,7 @@ ROOMS = {
161
161
  'A %*CYAN*%hungry%*RESET*% bear attacks you!',
162
162
  ),
163
163
  ],
164
- 'info': 'You are in the kitchen, there are several trashed %*RED*%cupboards%*RESET*%, and a fireplace.',
164
+ 'info': 'You are in the kitchen, there are several trashed %*RED*%cupboards%*RESET*%, one of them has a knotted cord sticking out, and a fireplace.',
165
165
  'map': '''
166
166
  ████║████
167
167
  █ █
@@ -176,6 +176,13 @@ ROOMS = {
176
176
  'I wonder if there is anything salvageable in the %*RED*%cupboards%*RESET*%',
177
177
  'I should probably look around',
178
178
  ],
179
+ 'Event chance': 0.1,
180
+ 'Random events': [
181
+ {
182
+ 'Output text': "You hear a bang and the cupboard door swings open slowly and the cord is gone",
183
+ 'Event code': "ROOMS['Kitchen']['containers']['cupboards'].take_contents()"
184
+ },
185
+ ],
179
186
  },
180
187
 
181
188
  'Dining Room': {
neelthee_mansion/items.py CHANGED
@@ -65,3 +65,10 @@ class container:
65
65
  def __init__(self, contents: list[item], secret: bool = False) -> None:
66
66
  self.contents = contents
67
67
  self.secret = secret
68
+
69
+ def take_contents(self, geter = None):
70
+ try:
71
+ for Item in self.contents:
72
+ geter.inventory_add(Item)
73
+ finally:
74
+ self.contents = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: neelthee-mansion
3
- Version: 2.2.2
3
+ Version: 2.2.3
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
@@ -1,14 +1,14 @@
1
- neelthee_mansion/Mansion_of_Amnesia.py,sha256=0I6i8DXW5QW9xz2pT4eUtdNGYqmpv909tmgnQzNEOmk,37479
1
+ neelthee_mansion/Mansion_of_Amnesia.py,sha256=4jMfqF_eBOpThpG7mKYkO_fUqk_qbJi7q8ftKiL1xGU,37893
2
2
  neelthee_mansion/Quests.py,sha256=q6VzR3mt9AYe29ACWZuf-suz4yOKrL946aJ493eQRS0,2611
3
- neelthee_mansion/Rooms.py,sha256=J2FZcU63vxlfUCZxSxa_af2S04FiOVKzkP1hYxrE69c,81103
3
+ neelthee_mansion/Rooms.py,sha256=gsuHlQWclcEExt9c59-D-ElEk0uOMZpZogFjSYjetUc,81539
4
4
  neelthee_mansion/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  neelthee_mansion/__main__.py,sha256=OIAWZ04le70DyjtR4hlmK9csHej7EHxeUrMoNnM-Vjc,95
6
6
  neelthee_mansion/all_game_utils.py,sha256=Xfty9uXiYAfmA6iVzJurq852ZBPn7a4gQUcUcaV9yEU,341
7
7
  neelthee_mansion/creatures.py,sha256=BMznNtk4dH5ns1YVtOKprVOIp0PjFf7pMHjAVpxvchg,13994
8
- neelthee_mansion/items.py,sha256=MrLIpY33I5jU926MCapHAb34KKyZAf9rHo1E2hIUHS4,1898
8
+ neelthee_mansion/items.py,sha256=uzZ9fq6_YK3oQ2lkAsyidWwM6trasVsjdQi2V0JTPfw,2097
9
9
  neelthee_mansion/utils.py,sha256=IfaFlIDPGMxW5eBNDTuRi-wFpPwPKSThdjYGpOZphYs,11494
10
- neelthee_mansion-2.2.2.dist-info/METADATA,sha256=U4NEm2UpZUawuOSI507m-tEy62ahvaWvTCtzzOYxm8E,1680
11
- neelthee_mansion-2.2.2.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
12
- neelthee_mansion-2.2.2.dist-info/entry_points.txt,sha256=j5ScTTyIidFhmT3F6hcX9pnlom4cJdDmfe26BmM6Igo,56
13
- neelthee_mansion-2.2.2.dist-info/top_level.txt,sha256=woQImQewylhly5Rb24HwPEGMxPY6do_PaUwGd5BNLOM,17
14
- neelthee_mansion-2.2.2.dist-info/RECORD,,
10
+ neelthee_mansion-2.2.3.dist-info/METADATA,sha256=1UdYKJygrpbjpBehgXTgcffoLqzN6TP1p6X3WMb6gyE,1680
11
+ neelthee_mansion-2.2.3.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
12
+ neelthee_mansion-2.2.3.dist-info/entry_points.txt,sha256=j5ScTTyIidFhmT3F6hcX9pnlom4cJdDmfe26BmM6Igo,56
13
+ neelthee_mansion-2.2.3.dist-info/top_level.txt,sha256=woQImQewylhly5Rb24HwPEGMxPY6do_PaUwGd5BNLOM,17
14
+ neelthee_mansion-2.2.3.dist-info/RECORD,,