Barotrauma icon indicating copy to clipboard operation
Barotrauma copied to clipboard

Add custom music types for monsters

Open TheNinjaScout opened this issue 4 years ago • 0 comments

This PR implements the ability to make monsters play certain music types when encountered, as well as a setting for music tracks to mute intensity background music while being played.

Commit Message

Characters now accept three new parameters:

- MusicType: Defaults to "monster".  If set to a string which corresponds to a music type found in a sounds xml file, a music that has that music type will begin to play when the monster is encountered by a player/submarine.

- MusicWeight: Defaults to 1. If set to a higher number, it will increase the chances of this monster's music playing over another monsters'.

- MusicRangeMultiplier: Defaults to 1. If set to a higher number, it will increase the minimum distance required before the monster's music will play.

Background music now accepts a new parameter:

- MuteIntensityMusic: Defaults to false. If set to true, it will mute any intensity music while this music is playing. This parameter is only useful for main tracks and won't do anything if used for biome noise loops or intensity music.
- Minimumrequiredtimetoplay: Defaults to 30. Defines the minimum amount of time (which is added to the default 5 it takes to update the current music) that the current monster music must be played for.

Monster encounter music now has priority over "deep" and "flooded" music types, preventing it from stopping to play if the submarine becomes flooded or falls into crush depth.

This would allow for boss fight music and/or music specific to certain monster types to be easily implemented, spicing up the music portion of the game.

TheNinjaScout avatar Sep 06 '21 16:09 TheNinjaScout