(Mostly) adapt fan to UDMF

This commit is contained in:
MascaraSnake 2021-12-28 07:40:38 +01:00
parent 90eb7c71a3
commit b1d0870511
4 changed files with 18 additions and 4 deletions

View file

@ -4680,6 +4680,16 @@ udmf
sprite = "FANSA0D0";
width = 16;
height = 8;
arg0
{
title = "Lift height";
}
arg1
{
title = "Invisible?";
type = 11;
enum = "noyes";
}
}
541
{

View file

@ -492,7 +492,7 @@ static void P_DoFanAndGasJet(mobj_t *spring, mobj_t *object)
switch (spring->type)
{
case MT_FAN: // fan
if (zdist > (spring->health << FRACBITS)) // max z distance determined by health (set by map thing angle)
if (zdist > (spring->health << FRACBITS)) // max z distance determined by health (set by map thing args[0])
break;
if (flipval*object->momz >= FixedMul(speed, spring->scale)) // if object's already moving faster than your best, don't bother
break;

View file

@ -12722,7 +12722,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean
mobj->cusval = mthing->args[0];
break;
case MT_FAN:
if (mthing->options & MTF_OBJECTSPECIAL)
if (mthing->args[1])
{
P_UnsetThingPosition(mobj);
if (sector_list)
@ -12733,8 +12733,8 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean
mobj->flags |= MF_NOSECTOR; // this flag basically turns it invisible
P_SetThingPosition(mobj);
}
if (mthing->angle)
mobj->health = mthing->angle;
if (mthing->args[0])
mobj->health = mthing->args[0];
else
mobj->health = FixedMul(mobj->subsector->sector->ceilingheight - mobj->subsector->sector->floorheight, 3*(FRACUNIT/4)) >> FRACBITS;
break;

View file

@ -4990,6 +4990,10 @@ static void P_ConvertBinaryMap(void)
if (mapthings[i].options & MTF_AMBUSH)
mapthings[i].args[2] |= TMSF_INTANGIBLE;
break;
case 540: //Fan
mapthings[i].args[0] = mapthings[i].angle;
mapthings[i].args[1] = !!(mapthings[i].options & MTF_OBJECTSPECIAL);
break;
case 555: //Diagonal yellow spring
case 556: //Diagonal red spring
case 557: //Diagonal blue spring