Adapt linedef types 300-302 to UDMF

This commit is contained in:
MascaraSnake 2021-12-09 07:30:55 +01:00
parent 44434a64d1
commit f60873c19b
5 changed files with 52 additions and 9 deletions

View file

@ -2502,6 +2502,18 @@ udmf
{
title = "Linedef Executor Trigger";
300
{
title = "Basic";
prefix = "(300)";
arg0
{
title = "Trigger type";
type = 11;
enum = "triggertype";
}
}
313
{
title = "No More Enemies - Once";

View file

@ -495,6 +495,14 @@ enums
1 = "Less than or equal";
2 = "Greater than or equal";
}
triggertype
{
0 = "Continuous";
1 = "Once";
2 = "Each time on entry";
3 = "Each time on entry/exit";
}
}
//Default things filters

View file

@ -3713,6 +3713,17 @@ static void P_ConvertBinaryMap(void)
else
lines[i].args[1] = 255;
break;
case 300: //Trigger linedef executor - Continuous
lines[i].args[0] = TMT_CONTINUOUS;
break;
case 301: //Trigger linedef executor - Each time
lines[i].args[0] = (lines[i].flags & ML_BOUNCY) ? TMT_EACHTIMEENTERANDEXIT : TMT_EACHTIMEENTER;
lines[i].special = 300;
break;
case 302: //Trigger linedef executor - Once
lines[i].args[0] = TMT_ONCE;
lines[i].special = 300;
break;
case 313: //No more enemies - once
lines[i].args[0] = tag;
break;

View file

@ -1844,7 +1844,7 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller
triggerline->callcount = sides[triggerline->sidenum[0]].textureoffset>>FRACBITS;
else
// These special types work only once
if (specialtype == 302 // Once
if ((specialtype == 300 && triggerline->args[0] == TMT_ONCE) // Once
|| specialtype == 304 // Ring count - Once
|| specialtype == 307 // Character ability - Once
|| specialtype == 308 // Race only - Once
@ -1896,7 +1896,7 @@ void P_LinedefExecute(INT16 tag, mobj_t *actor, sector_t *caller)
if (lines[masterline].special == 313
|| lines[masterline].special == 399
// Each-time executors handle themselves, too
|| lines[masterline].special == 301 // Each time
|| (lines[masterline].special == 300 && lines[masterline].args[0] > TMT_EACHTIMEMASK) // Each time
|| lines[masterline].special == 306 // Character ability - Each time
|| lines[masterline].special == 310 // CTF Red team - Each time
|| lines[masterline].special == 312 // CTF Blue team - Each time
@ -5639,7 +5639,7 @@ static inline void P_AddNoEnemiesThinker(line_t *sourceline)
* \sa P_SpawnSpecials, T_EachTimeThinker
* \author SSNTails <http://www.ssntails.org>
*/
static void P_AddEachTimeThinker(line_t *sourceline)
static void P_AddEachTimeThinker(line_t *sourceline, boolean triggerOnExit)
{
eachtime_t *eachtime;
@ -5650,7 +5650,7 @@ static void P_AddEachTimeThinker(line_t *sourceline)
eachtime->thinker.function.acp1 = (actionf_p1)T_EachTimeThinker;
eachtime->sourceline = sourceline;
eachtime->triggerOnExit = !!(sourceline->flags & ML_BOUNCY);
eachtime->triggerOnExit = triggerOnExit;
}
/** Adds a camera scanner.
@ -6659,8 +6659,12 @@ void P_SpawnSpecials(boolean fromnetsave)
}
break;
case 300: // Linedef executor (combines with sector special 974/975) and commands
case 302:
case 300: // Trigger linedef executor
if (lines[i].args[0] > TMT_EACHTIMEMASK)
P_AddEachTimeThinker(&lines[i], lines[i].args[0] == TMT_EACHTIMEENTERANDEXIT);
break;
// Count rings
case 303:
case 304:
@ -6683,12 +6687,11 @@ void P_SpawnSpecials(boolean fromnetsave)
// Each time executors
case 306:
case 301:
case 310:
case 312:
case 332:
case 335:
P_AddEachTimeThinker(&lines[i]);
P_AddEachTimeThinker(&lines[i], !!(lines[i].flags & ML_BOUNCY));
break;
// No More Enemies Linedef Exec
@ -6717,7 +6720,7 @@ void P_SpawnSpecials(boolean fromnetsave)
else
lines[i].callcount = sides[lines[i].sidenum[0]].textureoffset>>FRACBITS;
if (lines[i].special == 322) // Each time
P_AddEachTimeThinker(&lines[i]);
P_AddEachTimeThinker(&lines[i], !!(lines[i].flags & ML_BOUNCY));
break;
// NiGHTS trigger executors

View file

@ -105,6 +105,15 @@ typedef enum
TMFL_SPLAT = 1<<1,
} textmapfoflaserflags_t;
typedef enum
{
TMT_CONTINUOUS = 0,
TMT_ONCE = 1,
TMT_EACHTIMEMASK = TMT_ONCE,
TMT_EACHTIMEENTER = 2,
TMT_EACHTIMEENTERANDEXIT = 3,
} textmaptriggertype_t;
typedef enum
{
TMC_EQUAL = 0,