mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-16 17:11:33 +00:00
Adapt linedef types 303-304 to UDMF
This commit is contained in:
parent
f60873c19b
commit
92e724faca
3 changed files with 60 additions and 20 deletions
|
@ -2514,6 +2514,34 @@ udmf
|
|||
}
|
||||
}
|
||||
|
||||
303
|
||||
{
|
||||
title = "Ring Count";
|
||||
prefix = "(303)";
|
||||
arg0
|
||||
{
|
||||
title = "Trigger type";
|
||||
type = 11;
|
||||
enum = "triggertype";
|
||||
}
|
||||
arg1
|
||||
{
|
||||
title = "Rings";
|
||||
}
|
||||
arg2
|
||||
{
|
||||
title = "Comparison";
|
||||
type = 11;
|
||||
enum = "comparison";
|
||||
}
|
||||
arg3
|
||||
{
|
||||
title = "Count all players?";
|
||||
type = 11;
|
||||
enum = "noyes";
|
||||
}
|
||||
}
|
||||
|
||||
313
|
||||
{
|
||||
title = "No More Enemies - Once";
|
||||
|
|
|
@ -3724,6 +3724,19 @@ static void P_ConvertBinaryMap(void)
|
|||
lines[i].args[0] = TMT_ONCE;
|
||||
lines[i].special = 300;
|
||||
break;
|
||||
case 303: //Ring count - Continuous
|
||||
case 304: //Ring count - Once
|
||||
lines[i].args[0] = (lines[i].special == 304) ? TMT_ONCE : TMT_CONTINUOUS;
|
||||
lines[i].args[1] = P_AproxDistance(lines[i].dx, lines[i].dy) >> FRACBITS;
|
||||
if (lines[i].flags & ML_NOCLIMB)
|
||||
lines[i].args[2] = TMC_LTE;
|
||||
else if (lines[i].flags & ML_BLOCKMONSTERS)
|
||||
lines[i].args[2] = TMC_GTE;
|
||||
else
|
||||
lines[i].args[2] = TMC_EQUAL;
|
||||
lines[i].args[3] = !!(lines[i].flags & ML_EFFECT4);
|
||||
lines[i].special = 303;
|
||||
break;
|
||||
case 313: //No more enemies - once
|
||||
lines[i].args[0] = tag;
|
||||
break;
|
||||
|
|
39
src/p_spec.c
39
src/p_spec.c
|
@ -1519,14 +1519,14 @@ static boolean P_CheckPlayerMare(line_t *triggerline, INT32 targetmare)
|
|||
return mare == targetmare;
|
||||
}
|
||||
|
||||
static boolean P_CheckPlayerRings(line_t *triggerline, mobj_t *actor, INT32 targetrings)
|
||||
static boolean P_CheckPlayerRings(line_t *triggerline, mobj_t *actor)
|
||||
{
|
||||
INT32 rings = 0;
|
||||
INT32 targetrings = triggerline->args[1];
|
||||
size_t i;
|
||||
|
||||
// With the passuse flag, count all player's
|
||||
// rings.
|
||||
if (triggerline->flags & ML_EFFECT4)
|
||||
// Count all players' rings.
|
||||
if (triggerline->args[3])
|
||||
{
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
|
@ -1547,13 +1547,16 @@ static boolean P_CheckPlayerRings(line_t *triggerline, mobj_t *actor, INT32 targ
|
|||
rings = (maptol & TOL_NIGHTS) ? actor->player->spheres : actor->player->rings;
|
||||
}
|
||||
|
||||
if (triggerline->flags & ML_NOCLIMB)
|
||||
return rings <= targetrings;
|
||||
|
||||
if (triggerline->flags & ML_BLOCKMONSTERS)
|
||||
return rings >= targetrings;
|
||||
|
||||
return rings == targetrings;
|
||||
switch (triggerline->args[2])
|
||||
{
|
||||
case TMC_EQUAL:
|
||||
default:
|
||||
return rings == targetrings;
|
||||
case TMC_GTE:
|
||||
return rings >= targetrings;
|
||||
case TMC_LTE:
|
||||
return rings <= targetrings;
|
||||
}
|
||||
}
|
||||
|
||||
static boolean P_CheckPushables(line_t *triggerline, sector_t *caller, INT32 targetpushables)
|
||||
|
@ -1735,9 +1738,8 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller
|
|||
|
||||
switch (specialtype)
|
||||
{
|
||||
case 303: // continuous
|
||||
case 304: // once
|
||||
if (!P_CheckPlayerRings(triggerline, actor, dist))
|
||||
case 303:
|
||||
if (!P_CheckPlayerRings(triggerline, actor))
|
||||
return false;
|
||||
break;
|
||||
case 305: // continuous
|
||||
|
@ -1844,8 +1846,8 @@ 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 == 300 && triggerline->args[0] == TMT_ONCE) // Once
|
||||
|| specialtype == 304 // Ring count - Once
|
||||
if ((specialtype == 300 && triggerline->args[0] == TMT_ONCE) // Basic
|
||||
|| (specialtype == 303 && triggerline->args[0] == TMT_ONCE) // Ring count
|
||||
|| specialtype == 307 // Character ability - Once
|
||||
|| specialtype == 308 // Race only - Once
|
||||
|| specialtype == 313 // No More Enemies - Once
|
||||
|
@ -6660,14 +6662,11 @@ void P_SpawnSpecials(boolean fromnetsave)
|
|||
break;
|
||||
|
||||
case 300: // Trigger linedef executor
|
||||
case 303: // Count rings
|
||||
if (lines[i].args[0] > TMT_EACHTIMEMASK)
|
||||
P_AddEachTimeThinker(&lines[i], lines[i].args[0] == TMT_EACHTIMEENTERANDEXIT);
|
||||
break;
|
||||
|
||||
// Count rings
|
||||
case 303:
|
||||
case 304:
|
||||
|
||||
// Charability linedef executors
|
||||
case 305:
|
||||
case 307:
|
||||
|
|
Loading…
Reference in a new issue