Adapt linedef type 305-307 to UDMF

This commit is contained in:
MascaraSnake 2021-12-09 19:17:16 +01:00
parent 670e32908e
commit a7f5bcfea7
3 changed files with 63 additions and 19 deletions

View file

@ -2542,6 +2542,42 @@ udmf
}
}
305
{
title = "Character Ability";
prefix = "(305)";
arg0
{
title = "Trigger type";
type = 11;
enum = "triggertype";
}
arg1
{
title = "Ability";
type = 11;
enum
{
0 = "None";
1 = "Thok";
2 = "Fly";
3 = "Glide and climb";
4 = "Homing attack";
5 = "Swim";
6 = "Double jump";
7 = "Float";
8 = "Float with slow descent";
9 = "Telekinesis";
10 = "Fall switch";
11 = "Jump boost";
12 = "Air drill";
13 = "Jump-thok";
14 = "Pogo bounce";
15 = "Twin spin";
}
}
}
308
{
title = "Gametype";

View file

@ -3714,14 +3714,14 @@ static void P_ConvertBinaryMap(void)
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;
if (lines[i].special == 302)
lines[i].args[0] = TMT_ONCE;
else if (lines[i].special == 301)
lines[i].args[0] = (lines[i].flags & ML_BOUNCY) ? TMT_EACHTIMEENTERANDEXIT : TMT_EACHTIMEENTER;
else
lines[i].args[0] = TMT_CONTINUOUS;
lines[i].special = 300;
break;
case 303: //Ring count - Continuous
@ -3737,6 +3737,18 @@ static void P_ConvertBinaryMap(void)
lines[i].args[3] = !!(lines[i].flags & ML_EFFECT4);
lines[i].special = 303;
break;
case 305: //Character ability - Continuous
case 306: //Character ability - Each time
case 307: //Character ability - Once
if (lines[i].special == 307)
lines[i].args[0] = TMT_ONCE;
else if (lines[i].special == 306)
lines[i].args[0] = (lines[i].flags & ML_BOUNCY) ? TMT_EACHTIMEENTERANDEXIT : TMT_EACHTIMEENTER;
else
lines[i].args[0] = TMT_CONTINUOUS;
lines[i].args[1] = (P_AproxDistance(lines[i].dx, lines[i].dy) >> FRACBITS) / 10;
lines[i].special = 305;
break;
case 308: //Race only - once
lines[i].args[0] = TMT_ONCE;
lines[i].args[1] = GTR_RACE;

View file

@ -1501,9 +1501,10 @@ static boolean P_CheckNightsTriggerLine(line_t *triggerline, mobj_t *actor)
return true;
}
static boolean P_CheckPlayerMare(line_t *triggerline, INT32 targetmare)
static boolean P_CheckPlayerMare(line_t *triggerline)
{
UINT8 mare;
INT32 targetmare = P_AproxDistance(triggerline->dx, triggerline->dy) >> FRACBITS;
if (!(maptol & TOL_NIGHTS))
return false;
@ -1709,7 +1710,6 @@ static boolean P_ActivateLinedefExecutorsInSector(line_t *triggerline, mobj_t *a
*/
boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller)
{
fixed_t dist = P_AproxDistance(triggerline->dx, triggerline->dy)>>FRACBITS;
INT16 specialtype = triggerline->special;
////////////////////////
@ -1725,7 +1725,7 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller
}
else if (GETSECSPECIAL(caller->special, 2) == 7)
{
if (!P_CheckPlayerMare(triggerline, dist))
if (!P_CheckPlayerMare(triggerline))
return false;
}
// If we were not triggered by a sector type especially for the purpose,
@ -1746,10 +1746,8 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller
if (!P_CheckPlayerRings(triggerline, actor))
return false;
break;
case 305: // continuous
case 306: // each time
case 307: // once
if (!(actor && actor->player && actor->player->charability == dist/10))
case 305:
if (!(actor && actor->player && actor->player->charability == triggerline->args[1]))
return false;
break;
case 309:
@ -1843,7 +1841,7 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller
// These special types work only 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 == 305 && triggerline->args[0] == TMT_ONCE) // Character ability
|| (specialtype == 308 && triggerline->args[0] == TMT_ONCE) // Gametype
|| (specialtype == 309 && triggerline->args[0] == TMT_ONCE) // CTF team
|| specialtype == 313 // No More Enemies - Once
@ -1897,6 +1895,7 @@ void P_LinedefExecute(INT16 tag, mobj_t *actor, sector_t *caller)
// Each-time executors handle themselves, too
if ((lines[masterline].special == 300 // Basic
|| lines[masterline].special == 303 // Ring count
|| lines[masterline].special == 305 // Character ability
|| lines[masterline].special == 308 // Gametype
|| lines[masterline].special == 309 // CTF team
|| lines[masterline].special == 314 // Number of pushables
@ -1908,8 +1907,7 @@ void P_LinedefExecute(INT16 tag, mobj_t *actor, sector_t *caller)
if (lines[masterline].special == 321 && lines[masterline].args[0] > TMXT_EACHTIMEMASK) // Trigger after X calls
continue;
if (lines[masterline].special == 306 // Character ability
|| lines[masterline].special == 332 // Skin
if (lines[masterline].special == 332 // Skin
|| lines[masterline].special == 335)// Dye
continue;
@ -6687,6 +6685,7 @@ void P_SpawnSpecials(boolean fromnetsave)
case 300: // Trigger linedef executor
case 303: // Count rings
case 305: // Character ability
case 314: // Pushable linedef executors (count # of pushables)
case 317: // Condition set trigger
case 319: // Unlockable trigger
@ -6694,9 +6693,6 @@ void P_SpawnSpecials(boolean fromnetsave)
P_AddEachTimeThinker(&lines[i], lines[i].args[0] == TMT_EACHTIMEENTERANDEXIT);
break;
// Charability linedef executors
case 305:
case 307:
break;
case 308: // Race-only linedef executor. Triggers once.