Adapt pushables to UDMF

This commit is contained in:
MascaraSnake 2021-12-28 14:28:36 +01:00
parent 42f823600c
commit 53931727bd
5 changed files with 146 additions and 21 deletions

View file

@ -582,6 +582,14 @@ enums
64 = "Clip inside ground";
128 = "No distance check";
}
pushablebehavior
{
0 = "Normal";
1 = "Slide";
2 = "Immovable";
3 = "Classic";
}
}
//Default things filters

View file

@ -3740,6 +3740,12 @@ udmf
sprite = "CBBSA1";
width = 32;
height = 72;
arg0
{
title = "Push behavior";
type = 11;
enum = "pushablebehavior";
}
}
119
{
@ -5379,6 +5385,12 @@ udmf
sprite = "GARGA1";
width = 16;
height = 40;
arg0
{
title = "Push behavior";
type = 11;
enum = "pushablebehavior";
}
}
1009
{
@ -5388,6 +5400,12 @@ udmf
sprite = "GARGB1";
width = 32;
height = 80;
arg0
{
title = "Push behavior";
type = 11;
enum = "pushablebehavior";
}
}
1001
{
@ -5548,6 +5566,12 @@ udmf
sprite = "ESTAA1";
width = 32;
height = 240;
arg0
{
title = "Push behavior";
type = 11;
enum = "pushablebehavior";
}
}
1103
{
@ -5875,6 +5899,12 @@ udmf
sprite = "CSTAA1";
width = 16;
height = 40;
arg0
{
title = "Push behavior";
type = 11;
enum = "pushablebehavior";
}
}
1112
{
@ -5884,6 +5914,12 @@ udmf
sprite = "CBBSA1";
width = 32;
height = 72;
arg0
{
title = "Push behavior";
type = 11;
enum = "pushablebehavior";
}
}
1114
{
@ -5986,6 +6022,12 @@ udmf
sprite = "CBLLA0";
width = 20;
height = 40;
arg0
{
title = "Push behavior";
type = 11;
enum = "pushablebehavior";
}
}
1125
{
@ -6182,6 +6224,12 @@ udmf
sprite = "BARRA1";
width = 24;
height = 63;
arg0
{
title = "Push behavior";
type = 11;
enum = "pushablebehavior";
}
}
1217
{
@ -6637,6 +6685,12 @@ udmf
sprite = "BGARA1";
width = 16;
height = 40;
arg0
{
title = "Push behavior";
type = 11;
enum = "pushablebehavior";
}
}
1501
{
@ -6646,6 +6700,12 @@ udmf
sprite = "BGARA1";
width = 16;
height = 40;
arg0
{
title = "Push behavior";
type = 11;
enum = "pushablebehavior";
}
}
1502
{
@ -6655,6 +6715,12 @@ udmf
sprite = "BGARA1";
width = 16;
height = 40;
arg0
{
title = "Push behavior";
type = 11;
enum = "pushablebehavior";
}
}
1503
{
@ -6664,6 +6730,12 @@ udmf
sprite = "BGARA1";
width = 16;
height = 40;
arg0
{
title = "Push behavior";
type = 11;
enum = "pushablebehavior";
}
}
1504
{
@ -6687,6 +6759,12 @@ udmf
sprite = "BGARD1";
width = 16;
height = 40;
arg0
{
title = "Push behavior";
type = 11;
enum = "pushablebehavior";
}
}
}
@ -7078,6 +7156,12 @@ udmf
sprite = "XMS3A0";
width = 16;
height = 64;
arg0
{
title = "Push behavior";
type = 11;
enum = "pushablebehavior";
}
}
1853
{
@ -7086,6 +7170,12 @@ udmf
sprite = "XMS3B0";
width = 16;
height = 80;
arg0
{
title = "Push behavior";
type = 11;
enum = "pushablebehavior";
}
}
1854
{
@ -7146,6 +7236,12 @@ udmf
sprite = "ESTAB1";
width = 20;
height = 96;
arg0
{
title = "Push behavior";
type = 11;
enum = "pushablebehavior";
}
}
}

View file

@ -13117,15 +13117,31 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean
mobj->flags &= ~MF_NIGHTSITEM;
}
}
if (mobj->flags & MF_PUSHABLE)
{
switch (mthing->args[0])
{
case TMP_NORMAL:
default:
break;
case TMP_SLIDE:
mobj->flags2 |= MF2_SLIDEPUSH;
mobj->flags |= MF_BOUNCE;
break;
case TMP_IMMOVABLE:
mobj->flags &= ~MF_PUSHABLE;
break;
case TMP_CLASSIC:
mobj->flags2 |= MF2_CLASSICPUSH;
break;
}
}
return true;
}
static void P_SetAmbush(mobj_t *mobj)
{
if (mobj->flags & MF_PUSHABLE)
mobj->flags &= ~MF_PUSHABLE;
if ((mobj->flags & MF_MONITOR) && mobj->info->speed != 0)
{
// flag for strong/weak random boxes
@ -13167,13 +13183,6 @@ static void P_SetObjectSpecial(mobj_t *mobj)
// any monitor with nonzero speed is allowed to respawn like this
mobj->flags2 |= MF2_STRONGBOX;
}
// Pushables bounce and slide coolly with object special flag set
if (mobj->flags & MF_PUSHABLE)
{
mobj->flags2 |= MF2_SLIDEPUSH;
mobj->flags |= MF_BOUNCE;
}
}
static mobj_t *P_SpawnMobjFromMapThing(mapthing_t *mthing, fixed_t x, fixed_t y, fixed_t z, mobjtype_t i)
@ -13202,18 +13211,11 @@ static mobj_t *P_SpawnMobjFromMapThing(mapthing_t *mthing, fixed_t x, fixed_t y,
if (i == MT_NIGHTSBUMPER)
return mobj;
if ((mthing->options & MTF_AMBUSH)
&& (mthing->options & MTF_OBJECTSPECIAL)
&& (mobj->flags & MF_PUSHABLE))
mobj->flags2 |= MF2_CLASSICPUSH;
else
{
if (mthing->options & MTF_AMBUSH)
P_SetAmbush(mobj);
if (mthing->options & MTF_AMBUSH)
P_SetAmbush(mobj);
if (mthing->options & MTF_OBJECTSPECIAL)
P_SetObjectSpecial(mobj);
}
if (mthing->options & MTF_OBJECTSPECIAL)
P_SetObjectSpecial(mobj);
// Generic reverse gravity for individual objects flag.
if (mthing->options & MTF_OBJECTFLIP)

View file

@ -4903,6 +4903,17 @@ static void P_ConvertBinaryMap(void)
if (mapthings[i].options & MTF_AMBUSH)
mapthings[i].args[0] |= TMNI_REVEAL;
}
if (mobjinfo[mobjtype].flags & MF_PUSHABLE)
{
if ((mapthings[i].options & (MTF_OBJECTSPECIAL|MTF_AMBUSH)) == (MTF_OBJECTSPECIAL|MTF_AMBUSH))
mapthings[i].args[0] = TMP_CLASSIC;
else if (mapthings[i].options & MTF_OBJECTSPECIAL)
mapthings[i].args[0] = TMP_SLIDE;
else if (mapthings[i].options & MTF_AMBUSH)
mapthings[i].args[0] = TMP_IMMOVABLE;
else
mapthings[i].args[0] = TMP_NORMAL;
}
}
if (mapthings[i].type >= 1 && mapthings[i].type <= 35) //Player starts

View file

@ -88,6 +88,14 @@ typedef enum
TMNI_REVEAL = 1<<1,
} textmapnightsitem_t;
typedef enum
{
TMP_NORMAL = 0,
TMP_SLIDE = 1,
TMP_IMMOVABLE = 2,
TMP_CLASSIC = 3,
} textmappushabletype_t;
//FOF flags
typedef enum
{