Set Drone hitbox radius by upmost 4 bits of Angle

This commit is contained in:
mazmazz 2018-08-12 12:42:21 -04:00
parent 8f50fbeb4f
commit ce0b23a576
2 changed files with 7 additions and 5 deletions

View File

@ -16121,7 +16121,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
1000, // mass
0, // damage
sfx_ideya, // activesound
MF_NOGRAVITY|MF_SPECIAL, // flags
MF_NOGRAVITY|MF_NOCLIP|MF_SPECIAL, // flags
S_NULL // raisestate
},

View File

@ -10685,16 +10685,18 @@ ML_EFFECT4 : Don't clip inside the ground
boolean middlealigned = (mthing->options & MTF_EXTRA) && !(mthing->options & MTF_OBJECTSPECIAL);
boolean bottomoffsetted = !(mthing->options & MTF_OBJECTSPECIAL) && !(mthing->options & MTF_EXTRA);
INT16 timelimit = mthing->angle;
INT16 timelimit = mthing->angle & 0xFFF;
fixed_t hitboxradius = (mthing->angle & 0xF000) * 32 * FRACUNIT;
fixed_t hitboxheight = mthing->extrainfo * 32 * FRACUNIT;
// if you want to use parameter for something else, do this instead:
// timelimit = mthing->angle & 0xFFF; hitboxheight = (mthing->extrainfo >> 12) * 32 * FRACUNIT;
fixed_t oldheight = mobj->height;
fixed_t dronemanoffset, goaloffset, sparkleoffset, droneboxmandiff, dronemangoaldiff;
if (mthing->angle > 0)
if (timelimit > 0)
mobj->health = timelimit;
if (hitboxradius > 0)
mobj->radius = hitboxradius;
if (hitboxheight > 0)
mobj->height = hitboxheight;
else