Adapt spikes to UDMF

This commit is contained in:
MascaraSnake 2021-12-27 07:32:57 +01:00
parent 36217c6468
commit c550de5dfa
4 changed files with 76 additions and 21 deletions

View file

@ -4417,6 +4417,24 @@ udmf
width = 16;
height = 14;
arrow = 1;
arg0
{
title = "Retraction interval";
}
arg1
{
title = "Start interval";
}
arg2
{
title = "Flags";
type = 12;
enum
{
1 = "Start retracted";
2 = "Intangible";
}
}
}
523
{
@ -4424,6 +4442,24 @@ udmf
sprite = "USPKA0";
width = 8;
height = 32;
arg0
{
title = "Retraction interval";
}
arg1
{
title = "Start interval";
}
arg2
{
title = "Flags";
type = 12;
enum
{
1 = "Start retracted";
2 = "Intangible";
}
}
}
1130
{

View file

@ -10072,16 +10072,9 @@ static boolean P_FuseThink(mobj_t *mobj)
case MT_METALSONIC_BATTLE:
break; // don't remove
case MT_SPIKE:
P_SetMobjState(mobj, mobj->state->nextstate);
mobj->fuse = mobj->info->speed;
if (mobj->spawnpoint)
mobj->fuse += mobj->spawnpoint->angle;
break;
case MT_WALLSPIKE:
P_SetMobjState(mobj, mobj->state->nextstate);
mobj->fuse = mobj->info->speed;
if (mobj->spawnpoint)
mobj->fuse += (mobj->spawnpoint->angle / 360);
mobj->fuse = mobj->spawnpoint ? mobj->spawnpoint->args[0] : mobj->info->speed;
break;
case MT_NIGHTSCORE:
P_RemoveMobj(mobj);
@ -12992,15 +12985,13 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean
break;
case MT_SPIKE:
// Pop up spikes!
if (mthing->options & MTF_OBJECTSPECIAL)
if (mthing->args[0])
{
mobj->flags &= ~MF_SCENERY;
mobj->fuse = (16 - mthing->extrainfo)*(mthing->angle + mobj->info->speed)/16;
if (mthing->options & MTF_EXTRA)
P_SetMobjState(mobj, mobj->info->meleestate);
mobj->fuse = mthing->args[1];
}
// Use per-thing collision for spikes if the deaf flag isn't checked.
if (!(mthing->options & MTF_AMBUSH) && !metalrecording)
// Use per-thing collision for spikes unless the intangible flag is checked.
if (!(mthing->args[2] & TMSF_INTANGIBLE) && !metalrecording)
{
P_UnsetThingPosition(mobj);
mobj->flags &= ~(MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIPHEIGHT);
@ -13010,18 +13001,18 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean
break;
case MT_WALLSPIKE:
// Pop up spikes!
if (mthing->options & MTF_OBJECTSPECIAL)
if (mthing->args[0])
{
mobj->flags &= ~MF_SCENERY;
mobj->fuse = (16 - mthing->extrainfo)*((mthing->angle/360) + mobj->info->speed)/16;
if (mthing->options & MTF_EXTRA)
P_SetMobjState(mobj, mobj->info->meleestate);
mobj->fuse = mthing->args[1];
}
// Use per-thing collision for spikes if the deaf flag isn't checked.
if (!(mthing->options & MTF_AMBUSH) && !metalrecording)
if (mthing->args[2] & TMSF_RETRACTED)
P_SetMobjState(mobj, mobj->info->meleestate);
// Use per-thing collision for spikes unless the intangible flag is checked.
if (!(mthing->args[2] & TMSF_INTANGIBLE) && !metalrecording)
{
P_UnsetThingPosition(mobj);
mobj->flags &= ~(MF_NOBLOCKMAP | MF_NOCLIPHEIGHT);
mobj->flags &= ~(MF_NOBLOCKMAP|MF_NOCLIPHEIGHT);
mobj->flags |= MF_SOLID;
P_SetThingPosition(mobj);
}

View file

@ -4915,6 +4915,28 @@ static void P_ConvertBinaryMap(void)
// Old behavior if Parameter is 0; add 360 to the angle for each consecutive star post.
mapthings[i].args[0] = (mapthings[i].angle/360);
break;
case 522: //Wall spike
if (mapthings[i].options & MTF_OBJECTSPECIAL)
{
mapthings[i].args[0] = mobjinfo[MT_WALLSPIKE].speed + mapthings[i].angle/360;
mapthings[i].args[1] = (16 - mapthings[i].extrainfo) * mapthings[i].args[0]/16;
if (mapthings[i].options & MTF_EXTRA)
mapthings[i].args[2] |= TMSF_RETRACTED;
}
if (mapthings[i].options & MTF_AMBUSH)
mapthings[i].args[2] |= TMSF_INTANGIBLE;
break;
case 523: //Spike
if (mapthings[i].options & MTF_OBJECTSPECIAL)
{
mapthings[i].args[0] = mobjinfo[MT_SPIKE].speed + mapthings[i].angle;
mapthings[i].args[1] = (16 - mapthings[i].extrainfo) * mapthings[i].args[0]/16;
if (mapthings[i].options & MTF_EXTRA)
mapthings[i].args[2] |= TMSF_RETRACTED;
}
if (mapthings[i].options & MTF_AMBUSH)
mapthings[i].args[2] |= TMSF_INTANGIBLE;
break;
case 750: //Slope vertex
mapthings[i].args[0] = mapthings[i].extrainfo;
break;

View file

@ -44,6 +44,12 @@ typedef enum
TMDA_TOP = 1<<3,
} textmapdronealignment_t;
typedef enum
{
TMSF_RETRACTED = 1,
TMSF_INTANGIBLE = 1<<1,
} textmapspikeflags_t;
//FOF flags
typedef enum
{