Batfoxkid / FreakFortressBat

No longer supported.
https://github.com/Batfoxkid/Freak-Fortress-2-Rewrite
GNU General Public License v3.0
30 stars 20 forks source link

[Request] Add Music-per-life feature #122

Open JPZV opened 4 years ago

JPZV commented 4 years ago

Description

Some bosses uses a special script that allow them to play a new music when they lose a life. The problem with this is that it's a little glitchy* with the mode's own music system. It could be a good feature that the mode could have this option implemented so the boss' creator has only to put an extra parameter in "sound_bgm" and also the player could control the music.

Applications

Boss creator's side: Let's have this boss' current config:

"character"
{
//Boss Basic Info
    "name" "My boss" //Boss public name.
    "lives" "3" //Boss' lifes
    ...

    "sound_bgm"
    {
        "path1" "first_music.mp3"
        "time1" "250"

        "path2" "middle_music.mp3"
        "time2" "150"

        "path3" "last_music.mp3"
        "time3" "100"
    }
    ...
}

So, the idea is that with a new parameter in "sound_bgm" (like "lifeX", where X is the ascending life) the creator could configurate which music will be played in every life. As My Boss has 3 lives, the "new" configuration file could be like this:

    ...
    "sound_bgm"
    {
        "path1" "first_music.mp3"
        "time1" "250"
        "life1" "0" //This music will be played at the start

        "path2" "middle_music.mp3"
        "time2" "150"
        "life2" "1" //This music will be played when the boss lose his first life

        "path3" "last_music.mp3"
        "time3" "100"
        "life3" "2" //This music will be played in the boss' last life
    }
    ...
}

As you can see, I started the music index from 0. As no every boss will have a Music-Per-Life, the lifeX's default value should be -1. That means that every music with that index will be the default music in case of that the current life's music is missing. Also, if there is no music for the current life, it will be assumed that the previous music should be still be playing. For example (using the same config as before, i.e. a boss with 3 lives)

    ...
    "sound_bgm"
    {
        "path1" "first_music.mp3"
        "time1" "250"
        "life1" "0" //This music will be played at the start and in the second life

        "path2" "middle_music.mp3"
        "time2" "150"
        "life2" "2" //This music will be played only in the last life
    }
    ...
}

In-game Player's side: There will be almost no difference but in /ff2music command. With this feature, the /ff2music must controls only the current life music.

Code Snippet

Other Information

Notes: *Nowadays if the player uses /ff2music when the boss is playing its "special" music, there could be some mixes. In some cases if the player try to skip or play another music, the special music will still being played, mixing with the selected new music. Also the player cannot stop the special music, and even if the player has the music disabled, the special music will still be played when the boss lose a life.

Batfoxkid commented 4 years ago

Haven't actually gotten to this but it is possible through a plugin using a FF2_RandomSound native and using the music setting in the config.