neelthee-mansion 3.4.0__py3-none-any.whl → 3.4.1__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.
@@ -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):
neelthee_mansion/utils.py CHANGED
@@ -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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: neelthee-mansion
3
- Version: 3.4.0
3
+ Version: 3.4.1
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
@@ -4,11 +4,11 @@ neelthee_mansion/Rooms.py,sha256=bJrlA5UoY4ihmb-Bx2dbjK5skCbpj2CT-tc9KQRTnDA,878
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
- neelthee_mansion/creatures.py,sha256=kSfzQSE5UmFiDV0eDsTXCk-LQwZIyY5Rwsyh5Uhropw,14826
7
+ neelthee_mansion/creatures.py,sha256=FsBVgO6drEKS97lVXUZhbzzqHdOogzNzI8qmBkzvSZ4,15267
8
8
  neelthee_mansion/items.py,sha256=ysXxbGTfVSW9gc8N4uGEZlQ-_Nsv2eFjHdfIBUGxBNQ,5101
9
- neelthee_mansion/utils.py,sha256=PhFBDQXQoSNHpBUd0NKhP0KcclXK5Mho0qGnrpKAbe0,12187
10
- neelthee_mansion-3.4.0.dist-info/METADATA,sha256=j9-4zpHjSs8oGOrxgfnQEALl2PoA5GB1iIoJsQkrZ-c,1991
11
- neelthee_mansion-3.4.0.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
12
- neelthee_mansion-3.4.0.dist-info/entry_points.txt,sha256=j5ScTTyIidFhmT3F6hcX9pnlom4cJdDmfe26BmM6Igo,56
13
- neelthee_mansion-3.4.0.dist-info/top_level.txt,sha256=woQImQewylhly5Rb24HwPEGMxPY6do_PaUwGd5BNLOM,17
14
- neelthee_mansion-3.4.0.dist-info/RECORD,,
9
+ neelthee_mansion/utils.py,sha256=Wt1CdK4eCskrxRXkeKgzVoa_NIzwQ047dJU-b_e8pb8,13559
10
+ neelthee_mansion-3.4.1.dist-info/METADATA,sha256=vjRF4-Z0WXQxLB4efupnHfaJiOGRsjXlXO_lYsgCVno,1991
11
+ neelthee_mansion-3.4.1.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
12
+ neelthee_mansion-3.4.1.dist-info/entry_points.txt,sha256=j5ScTTyIidFhmT3F6hcX9pnlom4cJdDmfe26BmM6Igo,56
13
+ neelthee_mansion-3.4.1.dist-info/top_level.txt,sha256=woQImQewylhly5Rb24HwPEGMxPY6do_PaUwGd5BNLOM,17
14
+ neelthee_mansion-3.4.1.dist-info/RECORD,,