diff --git a/levels/Wicked Quest/10.json b/levels/Wicked Quest/10.json index 2d256c5..516c28f 100644 --- a/levels/Wicked Quest/10.json +++ b/levels/Wicked Quest/10.json @@ -257,20 +257,17 @@ "static": true }, { - "x_range": [400, 415], + "x_range": [400, 420], "y": 0, - "enemy_type": "ghost", - "health": 16, - "damage": 2, + "enemy_type": "revenant", + "health": 40, + "damage": 1, "attack_range": 1, - "vulnerability_duration": 2000, - "invulnerability_duration": 5000, - "speed_multiplier": 0.8, - "attack_cooldown": 1200, + "zombie_spawn_cooldown": 2500, "attack_pattern": { "type": "patrol" } -} + } ], "boundaries": { "left": 0, diff --git a/levels/Wicked Quest/8.json b/levels/Wicked Quest/8.json index fd0c464..6b9315c 100644 --- a/levels/Wicked Quest/8.json +++ b/levels/Wicked Quest/8.json @@ -238,11 +238,26 @@ "sound": "coin", "collectible": true, "static": true - } + }, + { + "x_range": [400, 415], + "y": 0, + "enemy_type": "ghost", + "health": 20, + "damage": 2, + "attack_range": 1, + "vulnerability_duration": 1000, + "invulnerability_duration": 5000, + "speed_multiplier": 0.8, + "attack_cooldown": 1200, + "attack_pattern": { + "type": "patrol" + } +} ], "boundaries": { "left": 0, - "right": 325 + "right": 420 }, "ambience": "Wayward Ghouls.ogg", "footstep_sound": "footstep_stone" diff --git a/sounds/revenant.ogg b/sounds/revenant.ogg new file mode 100644 index 0000000..e2d6760 --- /dev/null +++ b/sounds/revenant.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f44cc5379f99e5620f603675f5c6cb8d14aa008a50e91d27fe7343ad4a20213f +size 14404 diff --git a/sounds/revenant_dies.ogg b/sounds/revenant_dies.ogg new file mode 100644 index 0000000..2bf735d --- /dev/null +++ b/sounds/revenant_dies.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3315456f866ecd3c0a1346cbe289639c427542459c991e01c27aab7251aec8fa +size 19315 diff --git a/src/enemy.py b/src/enemy.py index 8849448..e506a07 100644 --- a/src/enemy.py +++ b/src/enemy.py @@ -57,6 +57,15 @@ class Enemy(Object): 'type': 'hunter', 'turn_threshold': 2 }) + elif enemyType == "revenant": + self.movementSpeed *= 0.7 # Slower than normal + self.damage = 1 + self.health = kwargs.get('health', 40) + self.attackCooldown = 1500 # Slower direct attacks + self.zombieSpawnCooldown = kwargs.get('zombie_spawn_cooldown', 2000) # 2 seconds between spawns + self.lastZombieSpawn = 0 + self.zombieSpawnDistance = 5 + self.attackPattern = kwargs.get('attack_pattern', {'type': 'patrol'}) elif enemyType == "spider": speedMultiplier = kwargs.get('speed_multiplier', 2.0) self.movementSpeed *= speedMultiplier # Spiders are faster @@ -136,6 +145,34 @@ class Enemy(Object): # Other enemies and non-activated hunters use patrol pattern self.patrol_movement() + if self.enemyType == "revenant" and self.hunting: # Only spawn when player enters territory + # Check if it's time to spawn a zombie + if currentTime - self.lastZombieSpawn >= self.zombieSpawnCooldown: + # Spawn zombies relative to player position, not revenant + spawnDirection = random.choice([-1, 1]) + spawnX = player.xPos + (spawnDirection * self.zombieSpawnDistance) + + # Ensure spawn point is within level boundaries + spawnX = max(self.level.leftBoundary, min(spawnX, self.level.rightBoundary)) + + # Create new zombie + zombie = Enemy( + [spawnX, spawnX], # Single point range for spawn + self.yPos, + "zombie", + self.sounds, + self.level + ) + + # Add to level's enemies + self.level.enemies.append(zombie) + self.lastZombieSpawn = currentTime + + # Play spawn sound and speak message + if 'revenant_spawn_zombie' in self.sounds: + self.sounds['revenant_spawn_zombie'].play() + speak("Zombie spawned") + # Check for attack opportunity if self.can_attack(currentTime, player): self.attack(currentTime, player)