Missed a bit of the skullstorm override system. Fixed that and updated documentation.

This commit is contained in:
Storm Dragon
2025-09-21 23:40:10 -04:00
parent 77633adf14
commit a686e816f5
3 changed files with 32 additions and 3 deletions

View File

@@ -259,6 +259,32 @@ The `static` property means objects don't move - they stay in their fixed positi
The `maximum_skulls` setting controls how many skulls can be falling simultaneously. `frequency` is the number of seconds that can elapse before the next skull falls.
**Skull Storm Sound Overrides:**
```json
{
"x_range": [40, 60],
"y": 12,
"type": "skull_storm",
"damage": 4,
"maximum_skulls": 2,
"frequency": {"min": 1, "max": 4},
"sound_overrides": {
"skull_storm": "reindeer",
"falling_skull": "falling_poop",
"skull_lands": "poop_splat",
"end_message": "The reindeer fly away.",
"hit_message": "Hit by reindeer poop!"
}
}
```
**Override Properties:**
- `skull_storm`: Sound when entering the skull storm area
- `falling_skull`: Sound of skulls falling (system automatically uses numbered variants: falling_poop1, falling_poop2, etc. if they exist)
- `skull_lands`: Sound when skulls hit the ground
- `end_message`: TTS message when leaving the skull storm area
- `hit_message`: TTS message when hit by a falling skull
#### Catapult
```json
{

View File

@@ -736,7 +736,7 @@ class Level:
if soundKey in overriddenSounds and overrideKey in self.sounds:
overriddenSounds[soundKey] = self.sounds[overrideKey]
# Handle numbered sound overrides (e.g., falling_skull1, falling_skull2)
elif soundKey.endswith('_skull') and overrideKey in self.sounds:
elif soundKey.endswith('_skull') and (overrideKey in self.sounds or any(f"{overrideKey}{i}" in self.sounds for i in range(1, 10))):
# Find all numbered variants and override them
for i in range(1, 10): # Support up to 9 numbered variants
numberedKey = f"{soundKey}{i}"
@@ -751,6 +751,8 @@ class Level:
# Handle skull storm TTS message overrides
if hasattr(obj, 'endMessage') and "end_message" in soundOverrides:
obj.endMessage = soundOverrides["end_message"]
if hasattr(obj, 'hitMessage') and "hit_message" in soundOverrides:
obj.hitMessage = soundOverrides["hit_message"]
# Handle spider web sound overrides
if hasattr(obj, 'originalSoundName') and obj.originalSoundName == "spiderweb":

View File

@@ -24,8 +24,9 @@ class SkullStorm(Object):
self.nextSkullDelay = random.randint(self.minFreq, self.maxFreq)
self.playerInRange = False
# Default TTS message (can be overridden)
# Default TTS messages (can be overridden)
self.endMessage = "Skull storm ended."
self.hitMessage = "Hit by falling skull!"
def update(self, currentTime, player):
"""Update all active skulls and potentially spawn new ones."""
@@ -116,4 +117,4 @@ class SkullStorm(Object):
if not player.isInvincible:
player.set_health(player.get_health() - self.damage)
self.sounds["player_takes_damage"].play()
speak("Hit by falling skull!")
speak(self.hitMessage)