Adapt ambient sound effects to UDMF

This commit is contained in:
MascaraSnake 2021-12-28 09:58:45 +01:00
parent 5248271619
commit 1cff7a161a
7 changed files with 53 additions and 358 deletions

View file

@ -4965,68 +4965,16 @@ udmf
700
{
title = "Water Ambience A (Large)";
sprite = "internal:ambiance";
}
701
{
title = "Water Ambience B (Large)";
sprite = "internal:ambiance";
}
702
{
title = "Water Ambience C (Medium)";
sprite = "internal:ambiance";
}
703
{
title = "Water Ambience D (Medium)";
sprite = "internal:ambiance";
}
704
{
title = "Water Ambience E (Small)";
sprite = "internal:ambiance";
}
705
{
title = "Water Ambience F (Small)";
sprite = "internal:ambiance";
}
706
{
title = "Water Ambience G (Extra Large)";
sprite = "internal:ambiance";
}
707
{
title = "Water Ambience H (Extra Large)";
sprite = "internal:ambiance";
}
708
{
title = "Disco Ambience";
sprite = "internal:ambiance";
}
709
{
title = "Volcano Ambience";
sprite = "internal:ambiance";
}
710
{
title = "Machine Ambience";
title = "Ambient Sound Effect";
sprite = "internal:ambiance";
arg0
{
title = "Repeat speed";
}
stringarg0
{
title = "Sound";
}
}
750

View file

@ -18056,13 +18056,13 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL // raisestate
},
// ambient water 1a (large)
{ // MT_AWATERA
// ambient sound effect
{ // MT_AMBIENT
700, // doomednum
S_INVISIBLE, // spawnstate
35, // spawnhealth
1000, // spawnhealth
S_NULL, // seestate
sfx_amwtr1, // seesound
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
@ -18084,283 +18084,6 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL // raisestate
},
// ambient water 1b (large)
{ // MT_AWATERB
701, // doomednum
S_INVISIBLE, // spawnstate
35, // spawnhealth
S_NULL, // seestate
sfx_amwtr2, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
16*FRACUNIT, // radius
16*FRACUNIT, // height
0, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOGRAVITY|MF_AMBIENT, // flags
S_NULL // raisestate
},
// ambient water 2a (medium)
{ // MT_AWATERC
702, // doomednum
S_INVISIBLE, // spawnstate
35, // spawnhealth
S_NULL, // seestate
sfx_amwtr3, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
16*FRACUNIT, // radius
16*FRACUNIT, // height
0, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOGRAVITY|MF_AMBIENT, // flags
S_NULL // raisestate
},
// ambient water 2b (medium)
{ // MT_AWATERD
703, // doomednum
S_INVISIBLE, // spawnstate
35, // spawnhealth
S_NULL, // seestate
sfx_amwtr4, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
16*FRACUNIT, // radius
16*FRACUNIT, // height
0, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOGRAVITY|MF_AMBIENT, // flags
S_NULL // raisestate
},
// ambient water 3a (small)
{ // MT_AWATERE
704, // doomednum
S_INVISIBLE, // spawnstate
35, // spawnhealth
S_NULL, // seestate
sfx_amwtr5, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
16*FRACUNIT, // radius
16*FRACUNIT, // height
0, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOGRAVITY|MF_AMBIENT, // flags
S_NULL // raisestate
},
// ambient water 3b (small)
{ // MT_AWATERF
705, // doomednum
S_INVISIBLE, // spawnstate
35, // spawnhealth
S_NULL, // seestate
sfx_amwtr6, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
16*FRACUNIT, // radius
16*FRACUNIT, // height
0, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOGRAVITY|MF_AMBIENT, // flags
S_NULL // raisestate
},
// ambient water 4a (extra large)
{ // MT_AWATERG
706, // doomednum
S_INVISIBLE, // spawnstate
35, // spawnhealth
S_NULL, // seestate
sfx_amwtr7, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
16*FRACUNIT, // radius
16*FRACUNIT, // height
0, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOGRAVITY|MF_AMBIENT, // flags
S_NULL // raisestate
},
// ambient water 4b (extra large)
{ // MT_AWATERH
707, // doomednum
S_INVISIBLE, // spawnstate
35, // spawnhealth
S_NULL, // seestate
sfx_amwtr8, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
16*FRACUNIT, // radius
16*FRACUNIT, // height
0, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOGRAVITY|MF_AMBIENT, // flags
S_NULL // raisestate
},
{ // MT_RANDOMAMBIENT
708, // doomednum
S_INVISIBLE, // spawnstate
512, // spawnhealth: repeat speed
S_NULL, // seestate
sfx_ambint, // seesound
0, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
255, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
8*FRACUNIT, // radius
16*FRACUNIT, // height
0, // display offset
1000, // mass
0, // damage
sfx_None, // activesound
MF_NOSECTOR|MF_NOBLOCKMAP|MF_NOGRAVITY|MF_AMBIENT, // flags
S_NULL // raisestate
},
{ // MT_RANDOMAMBIENT2
709, // doomednum
S_INVISIBLE, // spawnstate
220, // spawnhealth: repeat speed
S_NULL, // seestate
sfx_ambin2, // seesound
0, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
255, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
8*FRACUNIT, // radius
16*FRACUNIT, // height
0, // display offset
1000, // mass
0, // damage
sfx_None, // activesound
MF_NOSECTOR|MF_NOBLOCKMAP|MF_NOGRAVITY|MF_AMBIENT, // flags
S_NULL // raisestate
},
{ // MT_MACHINEAMBIENCE
710, // doomednum
S_INVISIBLE, // spawnstate
24, // spawnhealth: repeat speed
S_NULL, // seestate
sfx_ambmac, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
200, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
1*FRACUNIT, // speed
16*FRACUNIT, // radius
16*FRACUNIT, // height
0, // display offset
100, // mass
20, // damage
sfx_None, // activesound
MF_NOSECTOR|MF_NOBLOCKMAP|MF_NOGRAVITY|MF_AMBIENT, // flags
S_NULL // raisestate
},
{ // MT_CORK
-1, // doomednum
S_CORK, // spawnstate

View file

@ -4934,17 +4934,7 @@ typedef enum mobj_type
MT_FINISHFLAG, // Finish flag
// Ambient Sounds
MT_AWATERA, // Ambient Water Sound 1
MT_AWATERB, // Ambient Water Sound 2
MT_AWATERC, // Ambient Water Sound 3
MT_AWATERD, // Ambient Water Sound 4
MT_AWATERE, // Ambient Water Sound 5
MT_AWATERF, // Ambient Water Sound 6
MT_AWATERG, // Ambient Water Sound 7
MT_AWATERH, // Ambient Water Sound 8
MT_RANDOMAMBIENT,
MT_RANDOMAMBIENT2,
MT_MACHINEAMBIENCE,
MT_AMBIENT,
MT_CORK,
MT_LHRT,

View file

@ -1004,7 +1004,7 @@ static void OP_CycleThings(INT32 amt)
} while
(mobjinfo[op_currentthing].doomednum == -1
|| op_currentthing == MT_NIGHTSDRONE
|| mobjinfo[op_currentthing].flags & (MF_AMBIENT|MF_NOSECTOR)
|| mobjinfo[op_currentthing].flags & MF_NOSECTOR
|| (states[mobjinfo[op_currentthing].spawnstate].sprite == SPR_NULL
&& states[mobjinfo[op_currentthing].seestate].sprite == SPR_NULL)
);

View file

@ -10230,10 +10230,12 @@ void P_MobjThinker(mobj_t *mobj)
if (mobj->flags2 & MF2_FIRING)
P_FiringThink(mobj);
if (mobj->flags & MF_AMBIENT)
if (mobj->type == MT_AMBIENT)
{
if (!(leveltime % mobj->health) && mobj->info->seesound)
S_StartSound(mobj, mobj->info->seesound);
if (leveltime % mobj->health)
return;
if (mobj->threshold)
S_StartSound(mobj, mobj->threshold);
return;
}
@ -13060,6 +13062,11 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean
mobj->angle += ANGLE_22h;
*doangle = false;
break;
case MT_AMBIENT:
if (mthing->stringargs[0])
mobj->threshold = get_number(mthing->stringargs[0]);
mobj->health = mthing->args[0] ? mthing->args[0] : TICRATE;
break;
default:
break;
}

View file

@ -118,7 +118,7 @@ typedef enum
// Don't apply gravity (every tic); object will float, keeping current height
// or changing it actively.
MF_NOGRAVITY = 1<<9,
// This object is an ambient sound.
// This object is an ambient sound. Obsolete, but keep this around for backwards compatibility.
MF_AMBIENT = 1<<10,
// Slide this object when it hits a wall.
MF_SLIDEME = 1<<11,

View file

@ -5006,6 +5006,33 @@ static void P_ConvertBinaryMap(void)
if (mapthings[i].options & MTF_AMBUSH)
mapthings[i].args[0] |= TMDS_ROTATEEXTRA;
break;
case 700: //Water ambience A
case 701: //Water ambience A
case 702: //Water ambience A
case 703: //Water ambience A
case 704: //Water ambience A
case 705: //Water ambience A
case 706: //Water ambience A
case 707: //Water ambience A
mapthings[i].args[0] = 35;
P_WriteConstant(sfx_amwtr1 + mapthings[i].type - 700, &mapthings[i].stringargs[0]);
mapthings[i].type = 700;
break;
case 708: //Disco ambience
mapthings[i].args[0] = 512;
P_WriteConstant(sfx_ambint, &mapthings[i].stringargs[0]);
mapthings[i].type = 700;
break;
case 709: //Volcano ambience
mapthings[i].args[0] = 220;
P_WriteConstant(sfx_ambin2, &mapthings[i].stringargs[0]);
mapthings[i].type = 700;
break;
case 710: //Machine ambience
mapthings[i].args[0] = 24;
P_WriteConstant(sfx_ambmac, &mapthings[i].stringargs[0]);
mapthings[i].type = 700;
break;
case 750: //Slope vertex
mapthings[i].args[0] = mapthings[i].extrainfo;
break;