Add MF_APPLYTERRAIN

I gave it to all of our items, to give them footstep particles. Replaced MF_NIGHTSITEM.
This commit is contained in:
Sally Coolatta 2022-09-15 05:46:40 -04:00
parent 125d1182d4
commit 0faf4d5f54
7 changed files with 52 additions and 48 deletions

View file

@ -5612,7 +5612,7 @@ const char *const MOBJFLAG_LIST[] = {
"SCENERY",
"PAIN",
"STICKY",
"NIGHTSITEM",
"APPLYTERRAIN",
"NOCLIPTHING",
"GRENADEBOUNCE",
"RUNSPAWNFUNC",

View file

@ -5251,7 +5251,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
1000, // mass
MT_THOK, // damage
sfx_None, // activesound
MF_SOLID|MF_SHOOTABLE|MF_DONTENCOREMAP, // flags
MF_SOLID|MF_SHOOTABLE|MF_DONTENCOREMAP|MF_APPLYTERRAIN, // flags
(statenum_t)MT_THOK // raisestate
},
@ -5278,7 +5278,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
1000, // mass
0, // damage
sfx_None, // activesound
MF_SOLID|MF_DONTENCOREMAP, // flags
MF_SOLID|MF_DONTENCOREMAP|MF_APPLYTERRAIN, // flags
S_NULL // raisestate
},
@ -20761,7 +20761,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
1000, // mass
0, // damage
sfx_None, // activesound
MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_NIGHTSITEM, // flags
MF_NOCLIPHEIGHT|MF_NOGRAVITY, // flags
S_NULL // raisestate
},
@ -20788,7 +20788,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
1000, // mass
0, // damage
sfx_None, // activesound
MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_NIGHTSITEM, // flags
MF_NOCLIPHEIGHT|MF_NOGRAVITY, // flags
S_NULL // raisestate
},
@ -20815,7 +20815,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
1000, // mass
0, // damage
sfx_None, // activesound
MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_NIGHTSITEM, // flags
MF_NOCLIPHEIGHT|MF_NOGRAVITY, // flags
S_NULL // raisestate
},
@ -20842,7 +20842,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
1000, // mass
0, // damage
sfx_None, // activesound
MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_NIGHTSITEM, // flags
MF_NOCLIPHEIGHT|MF_NOGRAVITY, // flags
S_NULL // raisestate
},
@ -20869,7 +20869,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
1000, // mass
0, // damage
sfx_None, // activesound
MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_NIGHTSITEM, // flags
MF_NOCLIPHEIGHT|MF_NOGRAVITY, // flags
S_NULL // raisestate
},
@ -23249,7 +23249,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_cdfm28, // activesound
MF_SHOOTABLE|MF_DONTENCOREMAP, // flags
MF_SHOOTABLE|MF_DONTENCOREMAP|MF_APPLYTERRAIN, // flags
S_NULL // raisestate
},
@ -23276,7 +23276,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_None, // activesound
MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags
MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP|MF_APPLYTERRAIN, // flags
S_NULL // raisestate
},
@ -23303,7 +23303,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_peel, // activesound
MF_SHOOTABLE|MF_DONTENCOREMAP, // flags
MF_SHOOTABLE|MF_DONTENCOREMAP|MF_APPLYTERRAIN, // flags
S_NULL // raisestate
},
@ -23330,7 +23330,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_None, // activesound
MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags
MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP|MF_APPLYTERRAIN, // flags
S_NULL // raisestate
},
@ -23357,7 +23357,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_s3k96, // activesound
MF_SHOOTABLE|MF_DONTENCOREMAP, // flags
MF_SHOOTABLE|MF_DONTENCOREMAP|MF_APPLYTERRAIN, // flags
S_NULL // raisestate
},
@ -23384,7 +23384,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_None, // activesound
MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags
MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP|MF_APPLYTERRAIN, // flags
S_NULL // raisestate
},
@ -23411,7 +23411,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_s3kc0s, // activesound
MF_SHOOTABLE|MF_DONTENCOREMAP, // flags
MF_SHOOTABLE|MF_DONTENCOREMAP|MF_APPLYTERRAIN, // flags
S_NULL // raisestate
},
@ -23438,7 +23438,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_s3kc0s, // activesound
MF_SHOOTABLE|MF_DONTENCOREMAP, // flags
MF_SHOOTABLE|MF_DONTENCOREMAP|MF_APPLYTERRAIN, // flags
S_NULL // raisestate
},
@ -23465,7 +23465,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_None, // activesound
MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags
MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP|MF_APPLYTERRAIN, // flags
S_NULL // raisestate
},
@ -23519,7 +23519,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_s3k5c, // activesound
MF_SHOOTABLE|MF_DONTENCOREMAP, // flags
MF_SHOOTABLE|MF_DONTENCOREMAP|MF_APPLYTERRAIN, // flags
S_NULL // raisestate
},
@ -23546,7 +23546,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_None, // activesound
MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags
MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP|MF_APPLYTERRAIN, // flags
S_NULL // raisestate
},
@ -23654,7 +23654,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
0, // mass
0, // damage
sfx_s3k5c, // activesound
MF_SHOOTABLE|MF_DONTENCOREMAP, // flags
MF_SHOOTABLE|MF_DONTENCOREMAP|MF_APPLYTERRAIN, // flags
S_NULL // raisestate
},
@ -23681,7 +23681,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_s3k96, // activesound
MF_SPECIAL|MF_DONTENCOREMAP, // flags
MF_SPECIAL|MF_DONTENCOREMAP|MF_APPLYTERRAIN, // flags
S_NULL // raisestate
},
@ -23708,7 +23708,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_None, // activesound
MF_SPECIAL|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags
MF_SPECIAL|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP|MF_APPLYTERRAIN, // flags
S_NULL // raisestate
},
@ -23735,7 +23735,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_None, // activesound
MF_SHOOTABLE|MF_DONTENCOREMAP, // flags
MF_SHOOTABLE|MF_DONTENCOREMAP|MF_APPLYTERRAIN, // flags
S_NULL // raisestate
},
@ -24005,7 +24005,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
0, // mass
0, // damage
sfx_None, // activesound
MF_SPECIAL|MF_NOCLIP|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags
MF_SPECIAL|MF_NOCLIP|MF_NOGRAVITY|MF_DONTENCOREMAP|MF_APPLYTERRAIN, // flags
S_NULL // raisestate
},
@ -24059,7 +24059,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_s3k5c, // activesound
MF_SHOOTABLE|MF_DONTENCOREMAP, // flags
MF_SHOOTABLE|MF_DONTENCOREMAP|MF_APPLYTERRAIN, // flags
S_NULL // raisestate
},
@ -24086,7 +24086,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
100, // mass
1, // damage
sfx_None, // activesound
MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags
MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP|MF_APPLYTERRAIN, // flags
S_NULL // raisestate
},

View file

@ -7344,9 +7344,6 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
ghost->renderflags |= RF_DONTDRAW;
}
// Could probably be moved somewhere else.
K_HandleFootstepParticles(player->mo);
if (P_IsObjectOnGround(player->mo))
{
// Draft dust

View file

@ -611,6 +611,12 @@ void K_SpawnSplashForMobj(mobj_t *mo, fixed_t impact)
return;
}
if (!(mo->flags & MF_APPLYTERRAIN))
{
// No TERRAIN effects for this object.
return;
}
if (mo->terrain == NULL || mo->terrain->splashID == SIZE_MAX)
{
// No impact for this terrain type.
@ -754,6 +760,12 @@ void K_HandleFootstepParticles(mobj_t *mo)
return;
}
if (!(mo->flags & MF_APPLYTERRAIN))
{
// No TERRAIN effects for this object.
return;
}
if (mo->terrain == NULL || mo->terrain->footstepID == SIZE_MAX)
{
// If no terrain, check for offroad.

View file

@ -1765,6 +1765,12 @@ void P_XYMovement(mobj_t *mo)
if (P_MobjWasRemoved(mo)) // MF_SPECIAL touched a player! O_o;;
return;
if (moved == true)
{
// TERRAIN footstep effects.
K_HandleFootstepParticles(mo);
}
if (moved && oldslope && !(mo->flags & MF_NOCLIPHEIGHT)) { // Check to see if we ran off
if (oldslope != mo->standingslope)
@ -2303,7 +2309,7 @@ boolean P_ZMovement(mobj_t *mo)
// clip movement
if (((mo->z <= mo->floorz && !(mo->eflags & MFE_VERTICALFLIP))
|| (mo->z + mo->height >= mo->ceilingz && mo->eflags & MFE_VERTICALFLIP))
&& !(mo->flags & MF_NOCLIPHEIGHT))
&& !(mo->flags & MF_NOCLIPHEIGHT))
{
vector3_t mom;
mom.x = mo->momx;
@ -2402,6 +2408,7 @@ boolean P_ZMovement(mobj_t *mo)
if (P_MobjFlip(mo)*mom.z < 0) // falling
{
mo->eflags |= MFE_JUSTHITFLOOR;
K_SpawnSplashForMobj(mo, abs(mom.z));
if (mo->flags2 & MF2_SKULLFLY) // the skull slammed into something
mom.z = -mom.z;
@ -12876,15 +12883,10 @@ static void P_SetAmbush(mobj_t *mobj)
mobj->flags ^= MF_NOGRAVITY;
}
if (mobj->flags & MF_NIGHTSITEM)
{
// Spawn already displayed
mobj->flags |= MF_SPECIAL;
mobj->flags &= ~MF_NIGHTSITEM;
}
if (mobj->flags & MF_PUSHABLE)
{
mobj->flags &= ~MF_PUSHABLE;
}
if ((mobj->flags & MF_MONITOR) && mobj->info->speed != 0)
{
@ -12910,10 +12912,6 @@ static void P_SetObjectSpecial(mobj_t *mobj)
mobj->flags2 |= MF2_STRONGBOX;
}
// Requires you to be in bonus time to activate
if (mobj->flags & MF_NIGHTSITEM)
mobj->flags2 |= MF2_STRONGBOX;
// Pushables bounce and slide coolly with object special flag set
if (mobj->flags & MF_PUSHABLE)
{
@ -12992,10 +12990,6 @@ static mobj_t *P_SpawnMobjFromMapThing(mapthing_t *mthing, fixed_t x, fixed_t y,
}
}
// Final set of not being able to draw nightsitems.
if (mobj->flags & MF_NIGHTSITEM)
mobj->renderflags |= RF_DONTDRAW;
return mobj;
}

View file

@ -147,8 +147,8 @@ typedef enum
MF_PAIN = 1<<22,
// This mobj will stick to any surface or solid object it touches.
MF_STICKY = 1<<23,
// NiGHTS hidden item. Goes to seestate and turns MF_SPECIAL when paralooped.
MF_NIGHTSITEM = 1<<24,
// Object uses terrain effects. (Overlays, footsteps, etc)
MF_APPLYTERRAIN = 1<<24,
// for chase camera, don't be blocked by things (partial clipping)
MF_NOCLIPTHING = 1<<25,
// Missile bounces like a grenade.

View file

@ -2186,8 +2186,9 @@ static void R_ProjectSprite(mobj_t *thing)
return;
}
if (thing->terrain != NULL)
if (thing->terrain != NULL && (thing->flags & MF_APPLYTERRAIN))
{
// Clip the bottom of the thing's sprite
floorClip = thing->terrain->floorClip;
}