1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-11-05 02:39:41 +01:00

Use enums for sound effects

This adds an anonymous enum for sound effects and replaces all calls to
music.playef that use integer literals.

This is not a named enum (that can be used for strict typechecking)
because sound effect IDs are essentially part of the API of the game -
many custom levels use these numbers. This is just to make the source
code more readable without needing a comment to denote what number is
what sound.
This commit is contained in:
Misa 2023-06-03 15:29:02 -07:00
parent cdeca65be7
commit 4058975ce9
8 changed files with 367 additions and 335 deletions

View file

@ -2402,20 +2402,20 @@ static void editormenuactionpress(void)
map.nexttowercolour();
break;
}
music.playef(11);
music.playef(Sound_VIRIDIAN);
break;
case Menu::ed_settings:
switch (game.currentmenuoption)
{
case 0:
//Change level description stuff
music.playef(11);
music.playef(Sound_VIRIDIAN);
game.createmenu(Menu::ed_desc);
map.nexttowercolour();
break;
case 1:
//Enter script editormode
music.playef(11);
music.playef(Sound_VIRIDIAN);
ed.state = EditorState_SCRIPTS;
ed.substate = EditorSubState_MAIN;
@ -2431,13 +2431,13 @@ static void editormenuactionpress(void)
ed.lines_visible = 200 / font::height(PR_FONT_LEVEL);
break;
case 2:
music.playef(11);
music.playef(Sound_VIRIDIAN);
game.createmenu(Menu::ed_music);
map.nexttowercolour();
if(cl.levmusic>0) music.play(cl.levmusic);
break;
case 3:
music.playef(11);
music.playef(Sound_VIRIDIAN);
game.ghostsenabled = !game.ghostsenabled;
break;
case 4:
@ -2460,7 +2460,7 @@ static void editormenuactionpress(void)
break;
case 6:
/* Game options */
music.playef(11);
music.playef(Sound_VIRIDIAN);
game.gamestate = TITLEMODE;
game.ingame_titlemode = true;
game.ingame_editormode = true;
@ -2469,7 +2469,7 @@ static void editormenuactionpress(void)
DEFER_CALLBACK(nextbgcolor);
break;
default:
music.playef(11);
music.playef(Sound_VIRIDIAN);
game.createmenu(Menu::ed_quit);
map.nexttowercolour();
break;
@ -2501,10 +2501,10 @@ static void editormenuactionpress(void)
music.haltdasmusik();
}
music.playef(11);
music.playef(Sound_VIRIDIAN);
break;
case 2:
music.playef(11);
music.playef(Sound_VIRIDIAN);
music.fadeout();
game.returnmenu();
map.nexttowercolour();
@ -2527,14 +2527,14 @@ static void editormenuactionpress(void)
break;
case 1:
//Quit without saving
music.playef(11);
music.playef(Sound_VIRIDIAN);
music.fadeout();
graphics.fademode = FADE_START_FADEOUT;
graphics.backgrounddrawn = false;
break;
case 2:
//Go back to editor
music.playef(11);
music.playef(Sound_VIRIDIAN);
game.returnmenu();
map.nexttowercolour();
break;
@ -2553,7 +2553,7 @@ static void editormenuactionpress(void)
loc::new_level_font = cl.level_font_name;
}
font::set_level_font(cl.level_font_name.c_str());
music.playef(11);
music.playef(Sound_VIRIDIAN);
game.returnmenu();
map.nexttowercolour();
game.savestatsandsettings_menu();
@ -2931,7 +2931,7 @@ void editorinput(void)
if (escape_pressed)
{
// We're just in draw mode, so go to the settings menu
music.playef(11);
music.playef(Sound_VIRIDIAN);
ed.state = EditorState_MENU;
ed.substate = EditorSubState_MAIN;
game.createmenu(Menu::ed_settings);
@ -3238,7 +3238,7 @@ void editorinput(void)
if (escape_pressed)
{
bool esc_from_font = false;
music.playef(11);
music.playef(Sound_VIRIDIAN);
if (game.currentmenuname == Menu::ed_settings)
{
@ -3288,7 +3288,7 @@ void editorinput(void)
key.disabletextentry();
ed.current_text_mode = TEXT_NONE;
music.playef(11);
music.playef(Sound_VIRIDIAN);
}
if (enter_pressed)
@ -3309,7 +3309,7 @@ void editorinput(void)
{
if (escape_pressed)
{
music.playef(11);
music.playef(Sound_VIRIDIAN);
ed.state = EditorState_MENU;
ed.substate = EditorSubState_MAIN;
}
@ -3348,7 +3348,7 @@ void editorinput(void)
if (key.keymap[SDLK_BACKSPACE] && !ed.backspace_held && !script.customscripts.empty())
{
ed.backspace_held = true;
music.playef(2);
music.playef(Sound_CRY);
ed.remove_script(script.customscripts[(script.customscripts.size() - 1) - ed.selected_script].name);
}
@ -3380,7 +3380,7 @@ void editorinput(void)
key.keybuffer = ed.script_buffer[ed.script_cursor_y];
ed.script_cursor_x = UTF8_total_codepoints(ed.script_buffer[ed.script_cursor_y].c_str());
music.playef(11);
music.playef(Sound_VIRIDIAN);
}
}
break;
@ -3390,7 +3390,7 @@ void editorinput(void)
// Script editor!
if (escape_pressed)
{
music.playef(11);
music.playef(Sound_VIRIDIAN);
ed.substate = EditorSubState_MAIN;
// Alright, now re-add the script.

View file

@ -2575,7 +2575,7 @@ bool entityclass::updateentities( int i )
entities[i].state = 2;
entities[i].onentity = 0;
music.playef(7);
music.playef(Sound_DISAPPEAR);
}
else if (entities[i].state == 2)
{
@ -2621,7 +2621,7 @@ bool entityclass::updateentities( int i )
entities[i].life = 4;
entities[i].state = 2;
entities[i].onentity = 0;
music.playef(6);
music.playef(Sound_CRUMBLE);
}
else if (entities[i].state == 2)
{
@ -2658,7 +2658,7 @@ bool entityclass::updateentities( int i )
//wait for collision
if (entities[i].state == 1)
{
music.playef(4);
music.playef(Sound_COIN);
if (INBOUNDS_ARR(entities[i].para, collect))
{
collect[(int) entities[i].para] = true;
@ -2678,13 +2678,13 @@ bool entityclass::updateentities( int i )
if (game.intimetrial)
{
music.playef(25);
music.playef(Sound_NEWRECORD);
}
else
{
game.setstate(1000);
if(music.currentsong!=-1) music.silencedasmusik();
music.playef(3);
music.playef(Sound_TRINKET);
if (game.trinkets() > game.stat_trinkets && !map.custommode)
{
game.stat_trinkets = game.trinkets();
@ -2711,7 +2711,7 @@ bool entityclass::updateentities( int i )
entities[i].colour = 5;
entities[i].onentity = 0;
game.savepoint = entities[i].para;
music.playef(5);
music.playef(Sound_CHECKPOINT);
game.savex = entities[i].xp - 4;
@ -2756,7 +2756,7 @@ bool entityclass::updateentities( int i )
entities[i].state = 2;
music.playef(8);
music.playef(Sound_GRAVITYLINE);
game.gravitycontrol = (game.gravitycontrol + 1) % 2;
game.totalflips++;
int temp = getplayer();
@ -2798,7 +2798,7 @@ bool entityclass::updateentities( int i )
//Depending on the room the warp point is in, teleport to a new location!
entities[i].onentity = 0;
//play a sound or somefink
music.playef(10);
music.playef(Sound_TELEPORT);
game.teleport = true;
game.edteleportent = i;
@ -3150,7 +3150,7 @@ bool entityclass::updateentities( int i )
{
entities[i].colour = 5;
entities[i].onentity = 0;
music.playef(17);
music.playef(Sound_TERMINALTOUCH);
entities[i].state = 0;
}
@ -3327,14 +3327,14 @@ bool entityclass::updateentities( int i )
if (game.intimetrial)
{
music.playef(27);
music.playef(Sound_RESCUE);
}
else
{
game.setstate(1010);
//music.haltdasmusik();
if(music.currentsong!=-1) music.silencedasmusik();
music.playef(27);
music.playef(Sound_RESCUE);
}
return disableentity(i);
@ -3346,7 +3346,7 @@ bool entityclass::updateentities( int i )
//if inactive, activate!
if (entities[i].tile == 1)
{
music.playef(18);
music.playef(Sound_GAMESAVED);
entities[i].tile = 2;
entities[i].colour = 101;
if(!game.intimetrial && !game.nodeathmode)
@ -4841,7 +4841,7 @@ void entityclass::collisioncheck(int i, int j, bool scm /*= false*/)
{
if (entityhlinecollide(i, j))
{
music.playef(8);
music.playef(Sound_GRAVITYLINE);
game.gravitycontrol = (game.gravitycontrol + 1) % 2;
game.totalflips++;
if (game.gravitycontrol == 0)

View file

@ -1110,7 +1110,7 @@ void Game::updatestate(void)
if(INBOUNDS_VEC(i, obj.entities) && obj.entities[i].tile == 0)
{
obj.entities[i].tile = 144;
music.playef(2);
music.playef(Sound_CRY);
}
setstate(0);
break;
@ -1509,7 +1509,7 @@ void Game::updatestate(void)
break;
case 50:
music.playef(15);
music.playef(Sound_VIOLET);
graphics.createtextbox(loc::gettext("Help! Can anyone hear this message?"), 5, 8, TEXT_COLOUR("purple"));
graphics.textboxcommsrelay();
graphics.textboxtimer(60);
@ -1517,7 +1517,7 @@ void Game::updatestate(void)
setstatedelay(100);
break;
case 51:
music.playef(15);
music.playef(Sound_VIOLET);
graphics.createtextbox(loc::gettext("Verdigris? Are you out there? Are you ok?"), 5, 8, TEXT_COLOUR("purple"));
graphics.textboxcommsrelay();
graphics.textboxtimer(60);
@ -1525,7 +1525,7 @@ void Game::updatestate(void)
setstatedelay(100);
break;
case 52:
music.playef(15);
music.playef(Sound_VIOLET);
graphics.createtextbox(loc::gettext("Please help us! We've crashed and need assistance!"), 5, 8, TEXT_COLOUR("purple"));
graphics.textboxcommsrelay();
graphics.textboxtimer(60);
@ -1533,7 +1533,7 @@ void Game::updatestate(void)
setstatedelay(100);
break;
case 53:
music.playef(15);
music.playef(Sound_VIOLET);
graphics.createtextbox(loc::gettext("Hello? Anyone out there?"), 5, 8, TEXT_COLOUR("purple"));
graphics.textboxcommsrelay();
graphics.textboxtimer(60);
@ -1541,7 +1541,7 @@ void Game::updatestate(void)
setstatedelay(100);
break;
case 54:
music.playef(15);
music.playef(Sound_VIOLET);
graphics.createtextbox(loc::gettext("This is Doctor Violet from the D.S.S. Souleye! Please respond!"), 5, 8, TEXT_COLOUR("purple"));
graphics.textboxcommsrelay();
graphics.textboxtimer(60);
@ -1549,7 +1549,7 @@ void Game::updatestate(void)
setstatedelay(100);
break;
case 55:
music.playef(15);
music.playef(Sound_VIOLET);
graphics.createtextbox(loc::gettext("Please... Anyone..."), 5, 8, TEXT_COLOUR("purple"));
graphics.textboxcommsrelay();
graphics.textboxtimer(60);
@ -1557,7 +1557,7 @@ void Game::updatestate(void)
setstatedelay(100);
break;
case 56:
music.playef(15);
music.playef(Sound_VIOLET);
graphics.createtextbox(loc::gettext("Please be alright, everyone..."), 5, 8, TEXT_COLOUR("purple"));
graphics.textboxcommsrelay();
graphics.textboxtimer(60);
@ -1668,7 +1668,7 @@ void Game::updatestate(void)
obj.removetrigger(85);
//Init final stretch
incstate();
music.playef(9);
music.playef(Sound_FLASH);
music.play(Music_POSITIVEFORCE);
obj.flags[72] = true;
@ -1761,7 +1761,7 @@ void Game::updatestate(void)
if (INBOUNDS_VEC(i, obj.entities) && obj.entities[i].onroof > 0 && gravitycontrol == 1)
{
gravitycontrol = 0;
music.playef(1);
music.playef(Sound_UNFLIP);
}
if (INBOUNDS_VEC(i, obj.entities) && obj.entities[i].onground > 0)
{
@ -1787,14 +1787,14 @@ void Game::updatestate(void)
graphics.createtextbox("Captain! I've been so worried!", 60, 90, 164, 255, 164);
graphics.textboxprintflags(PR_FONT_8X8);
incstate();
music.playef(12);
music.playef(Sound_VERDIGRIS);
}
break;
case 104:
graphics.createtextbox("I'm glad you're ok!", 135, 152, TEXT_COLOUR("cyan"));
graphics.textboxprintflags(PR_FONT_8X8);
incstate();
music.playef(11);
music.playef(Sound_VIRIDIAN);
graphics.textboxactive();
break;
case 106:
@ -1804,7 +1804,7 @@ void Game::updatestate(void)
graphics.addline("around in circles...");
graphics.textboxprintflags(PR_FONT_8X8);
incstate();
music.playef(2);
music.playef(Sound_CRY);
graphics.textboxactive();
int i = obj.getcompanion();
if (INBOUNDS_VEC(i, obj.entities))
@ -1819,7 +1819,7 @@ void Game::updatestate(void)
graphics.addline("teleporter key!");
graphics.textboxprintflags(PR_FONT_8X8);
incstate();
music.playef(11);
music.playef(Sound_VIRIDIAN);
graphics.textboxactive();
break;
case 110:
@ -1834,7 +1834,7 @@ void Game::updatestate(void)
graphics.createtextbox("Follow me!", 185, 154, TEXT_COLOUR("cyan"));
graphics.textboxprintflags(PR_FONT_8X8);
incstate();
music.playef(11);
music.playef(Sound_VIRIDIAN);
graphics.textboxactive();
}
@ -1891,7 +1891,7 @@ void Game::updatestate(void)
if (INBOUNDS_VEC(i, obj.entities) && obj.entities[i].onground > 0 && gravitycontrol == 0)
{
gravitycontrol = 1;
music.playef(1);
music.playef(Sound_UNFLIP);
}
if (INBOUNDS_VEC(i, obj.entities) && obj.entities[i].onroof > 0)
{
@ -1916,7 +1916,7 @@ void Game::updatestate(void)
graphics.createtextbox("Captain! You're ok!", 60-10, 90-40, TEXT_COLOUR("yellow"));
graphics.textboxprintflags(PR_FONT_8X8);
incstate();
music.playef(14);
music.playef(Sound_VITELLARY);
break;
}
case 124:
@ -1925,7 +1925,7 @@ void Game::updatestate(void)
graphics.addline("I can't get it to go anywhere...");
graphics.textboxprintflags(PR_FONT_8X8);
incstate();
music.playef(2);
music.playef(Sound_CRY);
graphics.textboxactive();
break;
}
@ -1933,7 +1933,7 @@ void Game::updatestate(void)
graphics.createtextbox("I can help with that!", 125, 152-40, TEXT_COLOUR("cyan"));
graphics.textboxprintflags(PR_FONT_8X8);
incstate();
music.playef(11);
music.playef(Sound_VIRIDIAN);
graphics.textboxactive();
break;
case 128:
@ -1941,7 +1941,7 @@ void Game::updatestate(void)
graphics.addline("codex for our ship!");
graphics.textboxprintflags(PR_FONT_8X8);
incstate();
music.playef(11);
music.playef(Sound_VIRIDIAN);
graphics.textboxactive();
break;
@ -1950,7 +1950,7 @@ void Game::updatestate(void)
graphics.createtextbox("Yey! Let's go home!", 60-30, 90-35, TEXT_COLOUR("yellow"));
graphics.textboxprintflags(PR_FONT_8X8);
incstate();
music.playef(14);
music.playef(Sound_VITELLARY);
graphics.textboxactive();
int i = obj.getcompanion();
if (INBOUNDS_VEC(i, obj.entities))
@ -1971,7 +1971,7 @@ void Game::updatestate(void)
case 200:
//Init final stretch
incstate();
music.playef(9);
music.playef(Sound_FLASH);
obj.flags[72] = true;
screenshake = 10;
@ -2229,7 +2229,7 @@ void Game::updatestate(void)
setstatedelay(15);
flashlight = 5;
screenshake = 90;
music.playef(9);
music.playef(Sound_FLASH);
break;
case 2501:
//Activating a teleporter 2
@ -2238,7 +2238,7 @@ void Game::updatestate(void)
flashlight = 5;
screenshake = 0;
//we're done here!
music.playef(10);
music.playef(Sound_TELEPORT);
break;
case 2502:
{
@ -2346,7 +2346,7 @@ void Game::updatestate(void)
graphics.createtextbox("Hello?", 125+24, 152-20, TEXT_COLOUR("cyan"));
graphics.textboxprintflags(PR_FONT_8X8);
incstate();
music.playef(11);
music.playef(Sound_VIRIDIAN);
graphics.textboxactive();
break;
case 2512:
@ -2355,7 +2355,7 @@ void Game::updatestate(void)
graphics.createtextbox("Is anyone there?", 125+8, 152-24, TEXT_COLOUR("cyan"));
graphics.textboxprintflags(PR_FONT_8X8);
incstate();
music.playef(11);
music.playef(Sound_VIRIDIAN);
graphics.textboxactive();
break;
case 2514:
@ -2374,28 +2374,28 @@ void Game::updatestate(void)
setstatedelay(30);
flashlight = 5;
screenshake = 90;
music.playef(9);
music.playef(Sound_FLASH);
break;
case 3001:
//Activating a teleporter 2
incstate();
setstatedelay(15);
flashlight = 5;
music.playef(9);
music.playef(Sound_FLASH);
break;
case 3002:
//Activating a teleporter 2
incstate();
setstatedelay(15);
flashlight = 5;
music.playef(9);
music.playef(Sound_FLASH);
break;
case 3003:
//Activating a teleporter 2
incstate();
setstatedelay(15);
flashlight = 5;
music.playef(9);
music.playef(Sound_FLASH);
break;
case 3004:
//Activating a teleporter 2
@ -2404,7 +2404,7 @@ void Game::updatestate(void)
flashlight = 5;
screenshake = 0;
//we're done here!
music.playef(10);
music.playef(Sound_TELEPORT);
break;
case 3005:
{
@ -3058,7 +3058,7 @@ void Game::updatestate(void)
setstatedelay(30);
flashlight = 5;
screenshake = 90;
music.playef(9);
music.playef(Sound_FLASH);
break;
}
case 3512:
@ -3066,21 +3066,21 @@ void Game::updatestate(void)
incstate();
setstatedelay(15);
flashlight = 5;
music.playef(9);
music.playef(Sound_FLASH);
break;
case 3513:
//Activating a teleporter 2
incstate();
setstatedelay(15);
flashlight = 5;
music.playef(9);
music.playef(Sound_FLASH);
break;
case 3514:
//Activating a teleporter 2
incstate();
setstatedelay(15);
flashlight = 5;
music.playef(9);
music.playef(Sound_FLASH);
break;
case 3515:
{
@ -3098,7 +3098,7 @@ void Game::updatestate(void)
}
//we're done here!
music.playef(10);
music.playef(Sound_TELEPORT);
setstatedelay(60);
break;
}
@ -3158,7 +3158,7 @@ void Game::updatestate(void)
statedelay = 10;
flashlight = 5;
screenshake = 10;
music.playef(9);
music.playef(Sound_FLASH);
break;
case 4001:
//Activating a teleporter 2
@ -3167,7 +3167,7 @@ void Game::updatestate(void)
flashlight = 5;
screenshake = 0;
//we're done here!
music.playef(10);
music.playef(Sound_TELEPORT);
break;
case 4002:
{
@ -3203,7 +3203,7 @@ void Game::updatestate(void)
setstatedelay(15);
flashlight = 5;
screenshake = 90;
music.playef(9);
music.playef(Sound_FLASH);
break;
case 4011:
//Activating a teleporter 2
@ -3211,7 +3211,7 @@ void Game::updatestate(void)
setstatedelay(0);
flashlight = 5;
screenshake = 0;
music.playef(10);
music.playef(Sound_TELEPORT);
break;
case 4012:
{
@ -3334,7 +3334,7 @@ void Game::updatestate(void)
setstatedelay(15);
flashlight = 5;
screenshake = 90;
music.playef(9);
music.playef(Sound_FLASH);
break;
case 4021:
//Activating a teleporter 2
@ -3342,7 +3342,7 @@ void Game::updatestate(void)
setstatedelay(0);
flashlight = 5;
screenshake = 0;
music.playef(10);
music.playef(Sound_TELEPORT);
break;
case 4022:
{
@ -3447,7 +3447,7 @@ void Game::updatestate(void)
setstatedelay(15);
flashlight = 5;
screenshake = 90;
music.playef(9);
music.playef(Sound_FLASH);
break;
case 4031:
//Activating a teleporter 2
@ -3455,7 +3455,7 @@ void Game::updatestate(void)
setstatedelay(0);
flashlight = 5;
screenshake = 0;
music.playef(10);
music.playef(Sound_TELEPORT);
break;
case 4032:
{
@ -3560,7 +3560,7 @@ void Game::updatestate(void)
setstatedelay(15);
flashlight = 5;
screenshake = 90;
music.playef(9);
music.playef(Sound_FLASH);
break;
case 4041:
//Activating a teleporter 2
@ -3568,7 +3568,7 @@ void Game::updatestate(void)
setstatedelay(0);
flashlight = 5;
screenshake = 0;
music.playef(10);
music.playef(Sound_TELEPORT);
break;
case 4042:
{
@ -3678,7 +3678,7 @@ void Game::updatestate(void)
setstatedelay(15);
flashlight = 5;
screenshake = 90;
music.playef(9);
music.playef(Sound_FLASH);
break;
case 4051:
//Activating a teleporter 2
@ -3686,7 +3686,7 @@ void Game::updatestate(void)
setstatedelay(0);
flashlight = 5;
screenshake = 0;
music.playef(10);
music.playef(Sound_TELEPORT);
break;
case 4052:
{
@ -3796,7 +3796,7 @@ void Game::updatestate(void)
setstatedelay(15);
flashlight = 5;
screenshake = 90;
music.playef(9);
music.playef(Sound_FLASH);
break;
case 4061:
//Activating a teleporter 2
@ -3804,7 +3804,7 @@ void Game::updatestate(void)
setstatedelay(0);
flashlight = 5;
screenshake = 0;
music.playef(10);
music.playef(Sound_TELEPORT);
break;
case 4062:
{
@ -3912,7 +3912,7 @@ void Game::updatestate(void)
setstatedelay(15);
flashlight = 5;
screenshake = 90;
music.playef(9);
music.playef(Sound_FLASH);
break;
case 4071:
//Activating a teleporter 2
@ -3920,7 +3920,7 @@ void Game::updatestate(void)
setstatedelay(0);
flashlight = 5;
screenshake = 0;
music.playef(10);
music.playef(Sound_TELEPORT);
break;
case 4072:
{
@ -4025,7 +4025,7 @@ void Game::updatestate(void)
setstatedelay(15);
flashlight = 5;
screenshake = 90;
music.playef(9);
music.playef(Sound_FLASH);
break;
case 4081:
//Activating a teleporter 2
@ -4033,7 +4033,7 @@ void Game::updatestate(void)
setstatedelay(0);
flashlight = 5;
screenshake = 0;
music.playef(10);
music.playef(Sound_TELEPORT);
break;
case 4082:
{
@ -4138,7 +4138,7 @@ void Game::updatestate(void)
setstatedelay(15);
flashlight = 5;
screenshake = 90;
music.playef(9);
music.playef(Sound_FLASH);
break;
case 4091:
//Activating a teleporter 2
@ -4146,7 +4146,7 @@ void Game::updatestate(void)
setstatedelay(0);
flashlight = 5;
screenshake = 0;
music.playef(10);
music.playef(Sound_TELEPORT);
break;
case 4092:
{
@ -5040,7 +5040,7 @@ void Game::deathsequence(void)
music.nicefade = false;
}
deathcounts++;
music.playef(2);
music.playef(Sound_CRY);
if (INBOUNDS_VEC(i, obj.entities) && !noflashingmode)
{
obj.entities[i].invis = true;

File diff suppressed because it is too large Load diff

View file

@ -172,7 +172,7 @@ void KeyPoll::Poll(void)
{
/* Reload language files */
loc::loadtext(false);
music.playef(4);
music.playef(Sound_COIN);
}
BUTTONGLYPHS_keyboard_set_active(true);

View file

@ -31,11 +31,11 @@ void titlelogic(void)
}
else if (game.menudest == Menu::gameover2)
{
music.playef(11);
music.playef(Sound_VIRIDIAN);
}
else if (game.menudest == Menu::timetrialcomplete3)
{
music.playef(3);
music.playef(Sound_TRINKET);
}
game.createmenu(game.menudest, true);
}
@ -187,7 +187,7 @@ void gamelogic(void)
game.alarmdelay--;
if (game.alarmdelay <= 0)
{
music.playef(19);
music.playef(Sound_ALARM);
game.alarmdelay = 20;
}
}
@ -204,7 +204,7 @@ void gamelogic(void)
{
obj.entities[i].tile = 144;
}
music.playef(2);
music.playef(Sound_CRY);
}
if (obj.upset > 301) obj.upset = 301;
}
@ -446,7 +446,7 @@ void gamelogic(void)
game.swnrecord = game.swntimer;
if (game.swnmessage == 0)
{
music.playef(25);
music.playef(Sound_NEWRECORD);
game.savestatsandsettings();
}
game.swnmessage = 1;
@ -589,7 +589,7 @@ void gamelogic(void)
game.unlockAchievement("vvvvvvsupgrav5");
game.swnbestrank = 1;
game.swnmessage = 2+30;
music.playef(26);
music.playef(Sound_TROPHY);
}
}
else if (game.swntimer >= 300 && game.swnrank == 1)
@ -600,7 +600,7 @@ void gamelogic(void)
game.unlockAchievement("vvvvvvsupgrav10");
game.swnbestrank = 2;
game.swnmessage = 2+30;
music.playef(26);
music.playef(Sound_TROPHY);
}
}
else if (game.swntimer >= 450 && game.swnrank == 2)
@ -611,7 +611,7 @@ void gamelogic(void)
game.unlockAchievement("vvvvvvsupgrav15");
game.swnbestrank = 3;
game.swnmessage = 2+30;
music.playef(26);
music.playef(Sound_TROPHY);
}
}
else if (game.swntimer >= 600 && game.swnrank == 3)
@ -622,7 +622,7 @@ void gamelogic(void)
game.unlockAchievement("vvvvvvsupgrav20");
game.swnbestrank = 4;
game.swnmessage = 2+30;
music.playef(26);
music.playef(Sound_TROPHY);
}
}
else if (game.swntimer >= 900 && game.swnrank == 4)
@ -633,7 +633,7 @@ void gamelogic(void)
game.unlockAchievement("vvvvvvsupgrav30");
game.swnbestrank = 5;
game.swnmessage = 2+30;
music.playef(26);
music.playef(Sound_TROPHY);
}
}
else if (game.swntimer >= 1800 && game.swnrank == 5)
@ -644,7 +644,7 @@ void gamelogic(void)
game.unlockAchievement("vvvvvvsupgrav60");
game.swnbestrank = 6;
game.swnmessage = 2+30;
music.playef(26);
music.playef(Sound_TROPHY);
}
}
}
@ -753,9 +753,9 @@ void gamelogic(void)
{
game.hascontrol = false;
}
if(game.timetrialcountdown == 120) music.playef(21);
if(game.timetrialcountdown == 90) music.playef(21);
if(game.timetrialcountdown == 60) music.playef(21);
if(game.timetrialcountdown == 120) music.playef(Sound_COUNTDOWN);
if(game.timetrialcountdown == 90) music.playef(Sound_COUNTDOWN);
if(game.timetrialcountdown == 60) music.playef(Sound_COUNTDOWN);
if (game.timetrialcountdown == 30)
{
switch(game.timetriallevel)
@ -779,7 +779,7 @@ void gamelogic(void)
music.play(Music_PREDESTINEDFATEREMIX);
break;
}
music.playef(22);
music.playef(Sound_GO);
}
}
@ -794,7 +794,7 @@ void gamelogic(void)
{
obj.entities[i].tile = 144;
}
music.playef(2);
music.playef(Sound_CRY);
}
}
}

View file

@ -31,6 +31,38 @@ enum
Music_PREDESTINEDFATEREMIX = 15
};
enum
{
Sound_FLIP = 0,
Sound_UNFLIP = 1,
Sound_CRY = 2,
Sound_TRINKET = 3,
Sound_COIN = 4,
Sound_CHECKPOINT = 5,
Sound_CRUMBLE = 6,
Sound_DISAPPEAR = 7,
Sound_GRAVITYLINE = 8,
Sound_FLASH = 9,
Sound_TELEPORT = 10,
Sound_VIRIDIAN = 11,
Sound_VERDIGRIS = 12,
Sound_VICTORIA = 13,
Sound_VITELLARY = 14,
Sound_VIOLET = 15,
Sound_VERMILION = 16,
Sound_TERMINALTOUCH = 17,
Sound_GAMESAVED = 18,
Sound_ALARM = 19,
Sound_TERMINALTEXT = 20,
Sound_COUNTDOWN = 21,
Sound_GO = 22,
Sound_DESTROY = 23,
Sound_COMBINE = 24,
Sound_NEWRECORD = 25,
Sound_TROPHY = 26,
Sound_RESCUE = 27
};
class musicclass
{
public:

View file

@ -1095,39 +1095,39 @@ void scriptclass::run(void)
{
if (words[1] == "player")
{
music.playef(11);
music.playef(Sound_VIRIDIAN);
}
else if (words[1] == "cyan")
{
music.playef(11);
music.playef(Sound_VIRIDIAN);
}
else if (words[1] == "red")
{
music.playef(16);
music.playef(Sound_VERMILION);
}
else if (words[1] == "green")
{
music.playef(12);
music.playef(Sound_VERDIGRIS);
}
else if (words[1] == "yellow")
{
music.playef(14);
music.playef(Sound_VITELLARY);
}
else if (words[1] == "blue")
{
music.playef(13);
music.playef(Sound_VICTORIA);
}
else if (words[1] == "purple")
{
music.playef(15);
music.playef(Sound_VIOLET);
}
else if (words[1] == "cry")
{
music.playef(2);
music.playef(Sound_CRY);
}
else if (words[1] == "terminal")
{
music.playef(20);
music.playef(Sound_TERMINALTEXT);
}
}
else if (words[0] == "blackout")
@ -1749,7 +1749,7 @@ void scriptclass::run(void)
else if (words[0] == "foundtrinket")
{
music.silencedasmusik();
music.playef(3);
music.playef(Sound_TRINKET);
size_t trinket = ss_toi(words[1]);
if (trinket < SDL_arraysize(obj.collect))
@ -1805,7 +1805,7 @@ void scriptclass::run(void)
}
else if (words[0] == "foundlab")
{
music.playef(3);
music.playef(Sound_TRINKET);
graphics.textboxremovefast();