mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 15:32:33 +00:00
Adapt monitors to UDMF
This commit is contained in:
parent
79c3197de2
commit
e71a952d70
6 changed files with 166 additions and 42 deletions
|
@ -590,6 +590,13 @@ enums
|
|||
2 = "Immovable";
|
||||
3 = "Classic";
|
||||
}
|
||||
|
||||
monitorrespawn
|
||||
{
|
||||
0 = "Same item";
|
||||
1 = "Random (Weak)";
|
||||
2 = "Random (Strong)";
|
||||
}
|
||||
}
|
||||
|
||||
//Default things filters
|
||||
|
|
|
@ -4472,56 +4472,131 @@ udmf
|
|||
title = "Monitors";
|
||||
width = 18;
|
||||
height = 40;
|
||||
arg0
|
||||
{
|
||||
title = "Death trigger tag";
|
||||
type = 15;
|
||||
}
|
||||
|
||||
400
|
||||
{
|
||||
title = "Super Ring (10 Rings)";
|
||||
sprite = "TVRIA0";
|
||||
arg1
|
||||
{
|
||||
title = "Respawn behavior";
|
||||
type = 11;
|
||||
enum = "monitorrespawn";
|
||||
}
|
||||
}
|
||||
401
|
||||
{
|
||||
title = "Pity Shield";
|
||||
sprite = "TVPIA0";
|
||||
arg1
|
||||
{
|
||||
title = "Respawn behavior";
|
||||
type = 11;
|
||||
enum = "monitorrespawn";
|
||||
}
|
||||
}
|
||||
402
|
||||
{
|
||||
title = "Attraction Shield";
|
||||
sprite = "TVATA0";
|
||||
arg1
|
||||
{
|
||||
title = "Respawn behavior";
|
||||
type = 11;
|
||||
enum = "monitorrespawn";
|
||||
}
|
||||
}
|
||||
403
|
||||
{
|
||||
title = "Force Shield";
|
||||
sprite = "TVFOA0";
|
||||
arg1
|
||||
{
|
||||
title = "Respawn behavior";
|
||||
type = 11;
|
||||
enum = "monitorrespawn";
|
||||
}
|
||||
}
|
||||
404
|
||||
{
|
||||
title = "Armageddon Shield";
|
||||
sprite = "TVARA0";
|
||||
arg1
|
||||
{
|
||||
title = "Respawn behavior";
|
||||
type = 11;
|
||||
enum = "monitorrespawn";
|
||||
}
|
||||
}
|
||||
405
|
||||
{
|
||||
title = "Whirlwind Shield";
|
||||
sprite = "TVWWA0";
|
||||
arg1
|
||||
{
|
||||
title = "Respawn behavior";
|
||||
type = 11;
|
||||
enum = "monitorrespawn";
|
||||
}
|
||||
}
|
||||
406
|
||||
{
|
||||
title = "Elemental Shield";
|
||||
sprite = "TVELA0";
|
||||
arg1
|
||||
{
|
||||
title = "Respawn behavior";
|
||||
type = 11;
|
||||
enum = "monitorrespawn";
|
||||
}
|
||||
}
|
||||
407
|
||||
{
|
||||
title = "Super Sneakers";
|
||||
sprite = "TVSSA0";
|
||||
arg1
|
||||
{
|
||||
title = "Respawn behavior";
|
||||
type = 11;
|
||||
enum = "monitorrespawn";
|
||||
}
|
||||
}
|
||||
408
|
||||
{
|
||||
title = "Invincibility";
|
||||
sprite = "TVIVA0";
|
||||
arg1
|
||||
{
|
||||
title = "Respawn behavior";
|
||||
type = 11;
|
||||
enum = "monitorrespawn";
|
||||
}
|
||||
}
|
||||
409
|
||||
{
|
||||
title = "Extra Life";
|
||||
sprite = "TV1UA0";
|
||||
arg1
|
||||
{
|
||||
title = "Respawn behavior";
|
||||
type = 11;
|
||||
enum = "monitorrespawn";
|
||||
}
|
||||
arg2
|
||||
{
|
||||
title = "Points";
|
||||
type = 11;
|
||||
enum
|
||||
{
|
||||
0 = "1,000";
|
||||
1 = "10,000";
|
||||
}
|
||||
}
|
||||
}
|
||||
410
|
||||
{
|
||||
|
@ -4532,6 +4607,12 @@ udmf
|
|||
{
|
||||
title = "Teleporter";
|
||||
sprite = "TVMXA0";
|
||||
arg1
|
||||
{
|
||||
title = "Respawn behavior";
|
||||
type = 11;
|
||||
enum = "monitorrespawn";
|
||||
}
|
||||
}
|
||||
413
|
||||
{
|
||||
|
@ -4552,6 +4633,12 @@ udmf
|
|||
{
|
||||
title = "Recycler";
|
||||
sprite = "TVRCA0";
|
||||
arg1
|
||||
{
|
||||
title = "Respawn behavior";
|
||||
type = 11;
|
||||
enum = "monitorrespawn";
|
||||
}
|
||||
}
|
||||
418
|
||||
{
|
||||
|
@ -4567,16 +4654,34 @@ udmf
|
|||
{
|
||||
title = "Flame Shield";
|
||||
sprite = "TVFLA0";
|
||||
arg1
|
||||
{
|
||||
title = "Respawn behavior";
|
||||
type = 11;
|
||||
enum = "monitorrespawn";
|
||||
}
|
||||
}
|
||||
421
|
||||
{
|
||||
title = "Water Shield";
|
||||
sprite = "TVBBA0";
|
||||
arg1
|
||||
{
|
||||
title = "Respawn behavior";
|
||||
type = 11;
|
||||
enum = "monitorrespawn";
|
||||
}
|
||||
}
|
||||
422
|
||||
{
|
||||
title = "Lightning Shield";
|
||||
sprite = "TVZPA0";
|
||||
arg1
|
||||
{
|
||||
title = "Respawn behavior";
|
||||
type = 11;
|
||||
enum = "monitorrespawn";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4587,6 +4692,11 @@ udmf
|
|||
title = "Monitors (Respawning)";
|
||||
width = 20;
|
||||
height = 44;
|
||||
arg0
|
||||
{
|
||||
title = "Death trigger tag";
|
||||
type = 15;
|
||||
}
|
||||
|
||||
431
|
||||
{
|
||||
|
|
|
@ -3717,8 +3717,8 @@ void A_MonitorPop(mobj_t *actor)
|
|||
|
||||
// Run a linedef executor immediately upon popping
|
||||
// You may want to delay your effects by 18 tics to sync with the reward giving
|
||||
if (actor->spawnpoint && actor->lastlook)
|
||||
P_LinedefExecute(actor->lastlook, actor->target, NULL);
|
||||
if (actor->spawnpoint && actor->spawnpoint->args[0])
|
||||
P_LinedefExecute(actor->spawnpoint->args[0], actor->target, NULL);
|
||||
}
|
||||
|
||||
// Function: A_GoldMonitorPop
|
||||
|
@ -3803,8 +3803,8 @@ void A_GoldMonitorPop(mobj_t *actor)
|
|||
|
||||
// Run a linedef executor immediately upon popping
|
||||
// You may want to delay your effects by 18 tics to sync with the reward giving
|
||||
if (actor->spawnpoint && actor->lastlook)
|
||||
P_LinedefExecute(actor->lastlook, actor->target, NULL);
|
||||
if (actor->spawnpoint && actor->spawnpoint->args[0])
|
||||
P_LinedefExecute(actor->spawnpoint->args[0], actor->target, NULL);
|
||||
}
|
||||
|
||||
// Function: A_GoldMonitorRestore
|
||||
|
|
56
src/p_mobj.c
56
src/p_mobj.c
|
@ -12033,7 +12033,7 @@ static mobjtype_t P_GetMobjtypeSubstitute(mapthing_t *mthing, mobjtype_t i)
|
|||
case 2: // Unchanging
|
||||
if (i == MT_MYSTERY_BOX)
|
||||
return MT_NULL; // don't spawn
|
||||
mthing->options &= ~(MTF_AMBUSH|MTF_OBJECTSPECIAL); // no random respawning!
|
||||
mthing->args[1] = TMMR_SAME; // no random respawning!
|
||||
return i;
|
||||
case 3: // Don't spawn
|
||||
return MT_NULL;
|
||||
|
@ -12063,8 +12063,7 @@ static mobjtype_t P_GetMobjtypeSubstitute(mapthing_t *mthing, mobjtype_t i)
|
|||
|
||||
if (modeattacking && i == MT_1UP_BOX) // 1UPs -->> Score TVs
|
||||
{
|
||||
// Either or, doesn't matter which.
|
||||
if (mthing->options & (MTF_AMBUSH | MTF_OBJECTSPECIAL))
|
||||
if (mthing->args[2])
|
||||
return MT_SCORE10K_BOX; // 10,000
|
||||
else
|
||||
return MT_SCORE1K_BOX; // 1,000
|
||||
|
@ -13157,22 +13156,27 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean
|
|||
if (mthing->args[0])
|
||||
mobj->flags2 |= MF2_AMBUSH;
|
||||
}
|
||||
|
||||
if ((mobj->flags & MF_MONITOR) && mobj->info->speed != 0)
|
||||
{
|
||||
switch (mthing->args[1])
|
||||
{
|
||||
case TMMR_SAME:
|
||||
default:
|
||||
break;
|
||||
case TMMR_WEAK:
|
||||
mobj->flags2 |= MF2_AMBUSH;
|
||||
break;
|
||||
case TMMR_STRONG:
|
||||
mobj->flags2 |= MF2_STRONGBOX;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void P_SetAmbush(mobj_t *mobj)
|
||||
{
|
||||
if ((mobj->flags & MF_MONITOR) && mobj->info->speed != 0)
|
||||
{
|
||||
// flag for strong/weak random boxes
|
||||
// any monitor with nonzero speed is allowed to respawn like this
|
||||
mobj->flags2 |= MF2_AMBUSH;
|
||||
}
|
||||
|
||||
//TODO: Make this obsolete
|
||||
else if (mobj->type != MT_AXIS &&
|
||||
if (mobj->type != MT_AXIS &&
|
||||
mobj->type != MT_AXISTRANSFER &&
|
||||
mobj->type != MT_AXISTRANSFERLINE &&
|
||||
mobj->type != MT_NIGHTSBUMPER &&
|
||||
|
@ -13198,20 +13202,11 @@ static void P_SetAmbush(mobj_t *mobj)
|
|||
mobj->type != MT_MINECARTSWITCHPOINT &&
|
||||
mobj->type != MT_ROLLOUTSPAWN &&
|
||||
mobj->type != MT_STARPOST &&
|
||||
!(mobj->flags & MF_SPRING && mobj->info->painchance == 3))
|
||||
!((mobj->flags & MF_SPRING) && mobj->info->painchance == 3) &&
|
||||
!((mobj->flags & MF_MONITOR) && mobj->info->speed != 0))
|
||||
mobj->flags2 |= MF2_AMBUSH;
|
||||
}
|
||||
|
||||
static void P_SetObjectSpecial(mobj_t *mobj)
|
||||
{
|
||||
if ((mobj->flags & MF_MONITOR) && mobj->info->speed != 0)
|
||||
{
|
||||
// flag for strong/weak random boxes
|
||||
// any monitor with nonzero speed is allowed to respawn like this
|
||||
mobj->flags2 |= MF2_STRONGBOX;
|
||||
}
|
||||
}
|
||||
|
||||
static mobj_t *P_SpawnMobjFromMapThing(mapthing_t *mthing, fixed_t x, fixed_t y, fixed_t z, mobjtype_t i)
|
||||
{
|
||||
mobj_t *mobj = NULL;
|
||||
|
@ -13241,9 +13236,6 @@ static mobj_t *P_SpawnMobjFromMapThing(mapthing_t *mthing, fixed_t x, fixed_t y,
|
|||
if (mthing->options & MTF_AMBUSH)
|
||||
P_SetAmbush(mobj);
|
||||
|
||||
if (mthing->options & MTF_OBJECTSPECIAL)
|
||||
P_SetObjectSpecial(mobj);
|
||||
|
||||
// Generic reverse gravity for individual objects flag.
|
||||
if (mthing->options & MTF_OBJECTFLIP)
|
||||
{
|
||||
|
@ -13251,16 +13243,6 @@ static mobj_t *P_SpawnMobjFromMapThing(mapthing_t *mthing, fixed_t x, fixed_t y,
|
|||
mobj->flags2 |= MF2_OBJECTFLIP;
|
||||
}
|
||||
|
||||
// Extra functionality
|
||||
if (mthing->options & MTF_EXTRA)
|
||||
{
|
||||
if (mobj->flags & MF_MONITOR && (mthing->angle & 16384))
|
||||
{
|
||||
// Store line exec tag to run upon popping
|
||||
mobj->lastlook = (mthing->angle & 16383);
|
||||
}
|
||||
}
|
||||
|
||||
// Final set of not being able to draw nightsitems.
|
||||
if (mobj->flags & MF_NIGHTSITEM)
|
||||
mobj->flags2 |= MF2_DONTDRAW;
|
||||
|
|
|
@ -4914,8 +4914,23 @@ static void P_ConvertBinaryMap(void)
|
|||
else
|
||||
mapthings[i].args[0] = TMP_NORMAL;
|
||||
}
|
||||
if (mobjinfo[mobjtype].flags & MF_SPRING && mobjinfo[mobjtype].painchance == 3)
|
||||
if ((mobjinfo[mobjtype].flags & MF_SPRING) && mobjinfo[mobjtype].painchance == 3)
|
||||
mapthings[i].args[0] = !!(mapthings[i].options & MTF_AMBUSH);
|
||||
if (mobjinfo[mobjtype].flags & MF_MONITOR)
|
||||
{
|
||||
if ((mapthings[i].options & MTF_EXTRA) && mapthings[i].angle & 16384)
|
||||
mapthings[i].args[0] = mapthings[i].angle & 16383;
|
||||
|
||||
if (mobjinfo[mobjtype].speed != 0)
|
||||
{
|
||||
if (mapthings[i].options & MTF_OBJECTSPECIAL)
|
||||
mapthings[i].args[1] = TMMR_STRONG;
|
||||
else if (mapthings[i].options & MTF_AMBUSH)
|
||||
mapthings[i].args[1] = TMMR_WEAK;
|
||||
else
|
||||
mapthings[i].args[1] = TMMR_SAME;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mapthings[i].type >= 1 && mapthings[i].type <= 35) //Player starts
|
||||
|
@ -5024,6 +5039,9 @@ static void P_ConvertBinaryMap(void)
|
|||
case 1800: //Coin
|
||||
mapthings[i].args[0] = !(mapthings[i].options & MTF_AMBUSH);
|
||||
break;
|
||||
case 409: //Extra life monitor
|
||||
mapthings[i].args[2] = !(mapthings[i].options & (MTF_AMBUSH|MTF_OBJECTSPECIAL));
|
||||
break;
|
||||
case 500: //Air bubble patch
|
||||
mapthings[i].args[0] = !!(mapthings[i].options & MTF_AMBUSH);
|
||||
break;
|
||||
|
|
|
@ -103,6 +103,13 @@ typedef enum
|
|||
TMED_LEFT = 2,
|
||||
} textmapeggrobodirection_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
TMMR_SAME = 0,
|
||||
TMMR_WEAK = 1,
|
||||
TMMR_STRONG = 2,
|
||||
} textmapmonitorrespawn_t;
|
||||
|
||||
//FOF flags
|
||||
typedef enum
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue