add toggable sound effect when player squishes after landing

"slamsound" toggles it
This commit is contained in:
alufolie91 committed 2023-08-25 19:19:04 +02:00
1 parent 6457af1cce
commit 5a7626d88e
6 files changed
+18 -1

No files matched your search

+2
View File
@@ -700,6 +700,8 @@ void D_RegisterServerCommands(void)
CV_RegisterVar(&cv_powerstones);
CV_RegisterVar(&cv_competitionboxes);
CV_RegisterVar(&cv_matchboxes);
CV_RegisterVar(&cv_slamsound);
/*CV_RegisterVar(&cv_recycler);
CV_RegisterVar(&cv_teleporters);
+4
View File
@@ -545,8 +545,12 @@ static CV_PossibleValue_t stretchfactor_t[] = {{0, "MIN"}, {FRACUNIT, "MAX"}, {0
consvar_t cv_gravstretch = {"gravstretch", "0", CV_FLOAT | CV_SAVE, stretchfactor_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_sloperoll = {"sloperoll", "Off", CV_SAVE|CV_CALL, CV_OnOff, PDistort_menu_Onchange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_sliptideroll = {"sliptideroll", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t slamsound_t[] = {{0, "Off"}, {1, "On"}, {0, NULL}};
consvar_t cv_slamsound = {"slamsound", "1", CV_SAVE, slamsound_t, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t sloperolldist_cons_t[] = {
/*{256, "256"},*/ {512, "512"}, {768, "768"},
{1024, "1024"}, {1536, "1536"}, {2048, "2048"},
+1
View File
@@ -150,6 +150,7 @@ extern consvar_t cv_driftsparkpulse;
extern consvar_t cv_gravstretch;
extern consvar_t cv_sloperoll;
extern consvar_t cv_sliptideroll;
extern consvar_t cv_slamsound;
extern consvar_t cv_sloperolldist;
extern consvar_t cv_invincmusicfade;
+7 -1
View File
@@ -3000,6 +3000,9 @@ static void K_StretchPlayerGravity(player_t *p)
I_Assert(p != NULL);
I_Assert(p->mo != NULL);
I_Assert(!P_MobjWasRemoved(p->mo));
if (!p->mo->stretchonground && P_IsObjectOnGround(p->mo) && (cv_slamsound.value == 1))
S_StartSound(p->mo, sfx_s3k4c);
if (!P_IsObjectOnGround(p->mo))
{
@@ -3019,6 +3022,7 @@ static void K_StretchPlayerGravity(player_t *p)
{
p->mo->spritexscale = (dxs);
p->mo->spriteyscale = (dys);
p->mo->stretchonground = false;
}
}
else
@@ -3033,8 +3037,10 @@ static void K_StretchPlayerGravity(player_t *p)
p->mo->stretchslam -= (4*mos);
else
p->mo->stretchslam = 0;
p->mo->stretchonground = true;
}
}
static INT32 K_FindPlayerNum(player_t *plyr)
+2
View File
@@ -9563,6 +9563,8 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
mobj->spritexscale = mobj->realxscale;
mobj->spriteyscale = mobj->realyscale;
mobj->spritexoffset = mobj->spriteyoffset = 0;
mobj->stretchonground = true;
// set subsector and/or block links
P_SetThingPosition(mobj);
+2
View File
@@ -299,6 +299,8 @@ typedef struct mobj_s
fixed_t realxscale, realyscale; // funn-E streeetch
fixed_t stretchslam; // "squish" effect when you land
boolean stretchonground; // Play funni sound when player lands on ground with stretch
//sloperollangle
angle_t sloperoll, reservezangle, reservexydir;