diff --git a/src/coffin.py b/src/coffin.py index 1f58896..0b7fe9a 100644 --- a/src/coffin.py +++ b/src/coffin.py @@ -57,13 +57,14 @@ class CoffinObject(Object): dropDistance = random.randint(1, 2) dropX = self.xPos + (direction * dropDistance) - self.droppedItem = PowerUp( - dropX, self.yPos, itemType, self.sounds, direction, self.level.leftBoundary, self.level.rightBoundary - ) - - # Apply sound override after creation (similar to how graves handle it) + # Use themed item name if override exists (for proper themed item handling) + actualItemType = itemType if hasattr(self, 'itemSoundOverride'): - self.droppedItem.soundName = self.itemSoundOverride + actualItemType = self.itemSoundOverride + + self.droppedItem = PowerUp( + dropX, self.yPos, actualItemType, self.sounds, direction, self.level.leftBoundary, self.level.rightBoundary + ) return True return False diff --git a/src/level.py b/src/level.py index f85f7e2..87f7110 100644 --- a/src/level.py +++ b/src/level.py @@ -562,9 +562,9 @@ class Level: play_sound(self.sounds[f"get_{itemSound}"]) play_sound(self.sounds.get("fill_in_grave", "shovel_dig")) # Also play fill sound self.player.stats.update_stat("Items collected", 1) - # Create PowerUp to handle the item effect + # Create PowerUp to handle the item effect (use themed name if override exists) item = PowerUp( - obj.xPos, obj.yPos, obj.graveItem, self.sounds, 1, self.leftBoundary, self.rightBoundary + obj.xPos, obj.yPos, itemSound, self.sounds, 1, self.leftBoundary, self.rightBoundary ) item.apply_effect(self.player, self) # Stop grave's current audio channel