Reset invincibility and spider web on start of new level.

This commit is contained in:
Storm Dragon
2025-02-12 00:53:47 -05:00
parent af3ddb0efc
commit 361f085a4c
2 changed files with 12 additions and 1 deletions

View File

@@ -37,6 +37,17 @@ class WickedQuest:
self.player.isDucking = False
self.player.xPos = levelData["player_start"]["x"]
self.player.yPos = levelData["player_start"]["y"]
self.player.isInvincible = False
if hasattr(self.player, '_last_countdown'):
del self.player._last_countdown
self.player.invincibilityStartTime = 0
# Clean up spider web effects
if hasattr(self.player, 'webPenaltyEndTime'):
del self.player.webPenaltyEndTime # Remove the penalty timer
self.player.moveSpeed *= 2 # Restore normal speed
if self.player.currentWeapon:
self.player.currentWeapon.attackDuration *= 0.5 # Restore normal attack speed
# Pass existing player to new level
pygame.event.pump()