neelthee-mansion 3.3.1__tar.gz → 3.4.1__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.3.1 → neelthee_mansion-3.4.1}/PKG-INFO +1 -1
- {neelthee_mansion-3.3.1 → neelthee_mansion-3.4.1}/neelthee_mansion/Mansion_of_Amnesia.py +5 -0
- {neelthee_mansion-3.3.1 → neelthee_mansion-3.4.1}/neelthee_mansion/Rooms.py +8 -0
- {neelthee_mansion-3.3.1 → neelthee_mansion-3.4.1}/neelthee_mansion/creatures.py +13 -4
- {neelthee_mansion-3.3.1 → neelthee_mansion-3.4.1}/neelthee_mansion/utils.py +50 -0
- {neelthee_mansion-3.3.1 → neelthee_mansion-3.4.1}/neelthee_mansion.egg-info/PKG-INFO +1 -1
- {neelthee_mansion-3.3.1 → neelthee_mansion-3.4.1}/setup.py +1 -1
- {neelthee_mansion-3.3.1 → neelthee_mansion-3.4.1}/README.md +0 -0
- {neelthee_mansion-3.3.1 → neelthee_mansion-3.4.1}/neelthee_mansion/Quests.py +0 -0
- {neelthee_mansion-3.3.1 → neelthee_mansion-3.4.1}/neelthee_mansion/__init__.py +0 -0
- {neelthee_mansion-3.3.1 → neelthee_mansion-3.4.1}/neelthee_mansion/__main__.py +0 -0
- {neelthee_mansion-3.3.1 → neelthee_mansion-3.4.1}/neelthee_mansion/all_game_utils.py +0 -0
- {neelthee_mansion-3.3.1 → neelthee_mansion-3.4.1}/neelthee_mansion/items.py +0 -0
- {neelthee_mansion-3.3.1 → neelthee_mansion-3.4.1}/neelthee_mansion.egg-info/SOURCES.txt +0 -0
- {neelthee_mansion-3.3.1 → neelthee_mansion-3.4.1}/neelthee_mansion.egg-info/dependency_links.txt +0 -0
- {neelthee_mansion-3.3.1 → neelthee_mansion-3.4.1}/neelthee_mansion.egg-info/entry_points.txt +0 -0
- {neelthee_mansion-3.3.1 → neelthee_mansion-3.4.1}/neelthee_mansion.egg-info/requires.txt +0 -0
- {neelthee_mansion-3.3.1 → neelthee_mansion-3.4.1}/neelthee_mansion.egg-info/top_level.txt +0 -0
- {neelthee_mansion-3.3.1 → neelthee_mansion-3.4.1}/setup.cfg +0 -0
@@ -1012,6 +1012,11 @@ You must navigate the mansion and uncover the truth behind your captivity, all w
|
|
1012
1012
|
while True:
|
1013
1013
|
command()
|
1014
1014
|
|
1015
|
+
if 'random_events' in ROOMS[player.CURRENTROOM]:
|
1016
|
+
for event in ROOMS[player.CURRENTROOM]['random_events']:
|
1017
|
+
if isinstance(event, RandomEvent):
|
1018
|
+
event.check_and_trigger(player)
|
1019
|
+
|
1015
1020
|
# Move guards
|
1016
1021
|
for guard in guards:
|
1017
1022
|
if isinstance(guard, Guard):
|
@@ -224,6 +224,14 @@ ROOMS = {
|
|
224
224
|
'I wonder if there is anything salvageable in the %*RED*%cupboards%*RESET*%.',
|
225
225
|
'I should probably look around.',
|
226
226
|
],
|
227
|
+
'random_events': [
|
228
|
+
RandomEvent(
|
229
|
+
name='Event name',
|
230
|
+
probability=0.15, # Adjust this for the probability of the event running (e.g., 0.1 is 10% chance)
|
231
|
+
condition=lambda player: True, # Condition under which the event can occur
|
232
|
+
effect=lambda player: ROOMS['Kitchen']['containers']['cupboards'].take_contents(), # Define the effect of the event
|
233
|
+
)
|
234
|
+
],
|
227
235
|
},
|
228
236
|
|
229
237
|
'Dining Room': {
|
@@ -126,7 +126,7 @@ class creature(base_character):
|
|
126
126
|
self.difficulty = self.hp / 10 + self.atpw
|
127
127
|
self.dropped_items = dropped_items
|
128
128
|
self.xp = rounding(self.difficulty * 2 + len(self.dropped_items))
|
129
|
-
self.description = description if description else f'A %*CYAN*%{self.name}%*RESET'
|
129
|
+
self.description = description if description else f'A %*CYAN*%{self.name}%*RESET.'
|
130
130
|
self.flavor_text = flavor_text if flavor_text else f'You see a %*CYAN*%{self.name}%*RESET*%!'
|
131
131
|
self.type = type
|
132
132
|
self.crit_chance = crit_chance
|
@@ -144,6 +144,15 @@ class creature(base_character):
|
|
144
144
|
Prints the description of the creature.
|
145
145
|
"""
|
146
146
|
type_text(self.description)
|
147
|
+
curent_holiday = get_holiday()
|
148
|
+
if curent_holiday == 'christmas':
|
149
|
+
type_text(f"The {self.name} also has a santa hat.")
|
150
|
+
elif curent_holiday == 'easter':
|
151
|
+
type_text(f"The {self.name} also has bunny ears.")
|
152
|
+
elif curent_holiday == 'halloween':
|
153
|
+
if random < 0.2:
|
154
|
+
type_text(f"The {self.name} also has a pumkin on it's head.")
|
155
|
+
|
147
156
|
|
148
157
|
class Guard(creature):
|
149
158
|
"""
|
@@ -190,11 +199,11 @@ class Guard(creature):
|
|
190
199
|
rooms = []
|
191
200
|
for direction, room in ROOMS[self.current_room]['directions'].items():
|
192
201
|
rooms.append(room)
|
193
|
-
self.current_room = choice(rooms)
|
202
|
+
self.current_room = choice(rooms).GetRoom()
|
194
203
|
elif self.patrol_type == 'follow':
|
195
204
|
for direction, room in ROOMS[self.current_room]['directions'].items():
|
196
|
-
if room == player.CURRENTROOM:
|
197
|
-
self.current_room = room
|
205
|
+
if room.GetRoom() == player.CURRENTROOM:
|
206
|
+
self.current_room = room.GetRoom()
|
198
207
|
return
|
199
208
|
|
200
209
|
def check_detection(self, player_room):
|
@@ -254,6 +254,56 @@ def is_executable(code_str):
|
|
254
254
|
except (SyntaxError, TypeError):
|
255
255
|
return False
|
256
256
|
|
257
|
+
def get_holiday():
|
258
|
+
today = date.today()
|
259
|
+
year = today.year
|
260
|
+
|
261
|
+
# Define date ranges for holidays
|
262
|
+
halloween_start = date(year, 10, 20)
|
263
|
+
halloween_end = date(year, 10, 31)
|
264
|
+
|
265
|
+
christmas_start = date(year, 12, 24)
|
266
|
+
christmas_end = date(year, 12, 26)
|
267
|
+
|
268
|
+
easter_sunday = calculate_easter_date(year)
|
269
|
+
easter_start = easter_sunday - timedelta(days=3)
|
270
|
+
easter_end = easter_sunday + timedelta(days=3)
|
271
|
+
|
272
|
+
# Check if today is near Halloween
|
273
|
+
if halloween_start <= today <= halloween_end:
|
274
|
+
return 'halloween'
|
275
|
+
|
276
|
+
# Check if today is near Christmas
|
277
|
+
elif christmas_start <= today <= christmas_end:
|
278
|
+
return 'christmas'
|
279
|
+
|
280
|
+
# Check if today is near Easter
|
281
|
+
elif easter_start <= today <= easter_end:
|
282
|
+
return 'easter'
|
283
|
+
|
284
|
+
# No holiday near today
|
285
|
+
else:
|
286
|
+
return None
|
287
|
+
|
288
|
+
# Easter calculation (based on the "Computus" algorithm)
|
289
|
+
def calculate_easter_date(year):
|
290
|
+
a = year % 19
|
291
|
+
b = year // 100
|
292
|
+
c = year % 100
|
293
|
+
d = b // 4
|
294
|
+
e = b % 4
|
295
|
+
f = (b + 8) // 25
|
296
|
+
g = (b - f + 1) // 3
|
297
|
+
h = (19 * a + b - d - g + 15) % 30
|
298
|
+
i = c // 4
|
299
|
+
k = c % 4
|
300
|
+
l = (32 + 2 * e + 2 * i - h - k) % 7
|
301
|
+
m = (a + 11 * h + 22 * l) // 451
|
302
|
+
month = (h + l - 7 * m + 114) // 31
|
303
|
+
day = ((h + l - 7 * m + 114) % 31) + 1
|
304
|
+
|
305
|
+
return date(year, month, day)
|
306
|
+
|
257
307
|
def play_sound(sound_file):
|
258
308
|
playsound(sound_file)
|
259
309
|
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
2
2
|
|
3
3
|
setup(
|
4
4
|
name='neelthee_mansion',
|
5
|
-
version='3.
|
5
|
+
version='3.4.1',
|
6
6
|
packages=find_packages(), # Automatically finds all packages and modules
|
7
7
|
install_requires=[
|
8
8
|
'wheel', 'psutil', 'playsound', 'requests', 'keyboard', 'pandas', 'validators', 'dicttoxml', 'pytz',
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{neelthee_mansion-3.3.1 → neelthee_mansion-3.4.1}/neelthee_mansion.egg-info/dependency_links.txt
RENAMED
File without changes
|
{neelthee_mansion-3.3.1 → neelthee_mansion-3.4.1}/neelthee_mansion.egg-info/entry_points.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|