mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-20 10:53:27 +00:00
Merge branch 'remove-character-flags' into 'master'
Remove character flags Closes #27 See merge request STJr/SRB2Internal!246
This commit is contained in:
commit
574cf2609f
5 changed files with 42 additions and 80 deletions
|
@ -9575,11 +9575,6 @@ static inline int lib_getenum(lua_State *L)
|
|||
lua_pushinteger(L, ((lua_Integer)1<<i));
|
||||
return 1;
|
||||
}
|
||||
if (fastcmp(p, "NETONLY"))
|
||||
{
|
||||
lua_pushinteger(L, (lua_Integer)ML_NETONLY);
|
||||
return 1;
|
||||
}
|
||||
if (mathlib) return luaL_error(L, "linedef flag '%s' could not be found.\n", word);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -130,11 +130,9 @@ typedef struct
|
|||
#define ML_EFFECT4 512
|
||||
#define ML_EFFECT5 1024
|
||||
|
||||
// New ones to disable lines for characters
|
||||
#define ML_NOSONIC 2048
|
||||
#define ML_NOTAILS 4096
|
||||
#define ML_NOKNUX 8192
|
||||
#define ML_NETONLY 14336 // all of the above
|
||||
#define ML_NETONLY 2048 // Apply effect only in netgames
|
||||
#define ML_NONET 4096 // Apply effect only in single player games
|
||||
#define ML_EFFECT6 8192
|
||||
|
||||
// Bounce off walls!
|
||||
#define ML_BOUNCY 16384
|
||||
|
|
|
@ -1282,6 +1282,9 @@ static void P_LoadLineDefs2(void)
|
|||
// Compile linedef 'text' from both sidedefs 'text' for appropriate specials.
|
||||
switch(ld->special)
|
||||
{
|
||||
case 331: // Trigger linedef executor: Skin - Continuous
|
||||
case 332: // Trigger linedef executor: Skin - Each time
|
||||
case 333: // Trigger linedef executor: Skin - Once
|
||||
case 443: // Calls a named Lua function
|
||||
if (sides[ld->sidenum[0]].text)
|
||||
{
|
||||
|
@ -1492,6 +1495,9 @@ static void P_LoadRawSideDefs2(void *data)
|
|||
break;
|
||||
}
|
||||
|
||||
case 331: // Trigger linedef executor: Skin - Continuous
|
||||
case 332: // Trigger linedef executor: Skin - Each time
|
||||
case 333: // Trigger linedef executor: Skin - Once
|
||||
case 443: // Calls a named Lua function
|
||||
case 459: // Control text prompt (named tag)
|
||||
{
|
||||
|
|
|
@ -259,9 +259,9 @@ static void line_SpawnViaLine(const int linenum, const boolean spawnthinker)
|
|||
boolean backceil = (special == 711 || special == 712 || special == 703);
|
||||
|
||||
UINT8 flags = 0; // Slope flags
|
||||
if (line->flags & ML_NOSONIC)
|
||||
if (line->flags & ML_NETONLY)
|
||||
flags |= SL_NOPHYSICS;
|
||||
if (line->flags & ML_NOTAILS)
|
||||
if (line->flags & ML_NONET)
|
||||
flags |= SL_DYNAMIC;
|
||||
|
||||
if(!frontfloor && !backfloor && !frontceil && !backceil)
|
||||
|
@ -468,9 +468,9 @@ static void line_SpawnViaVertexes(const int linenum, const boolean spawnthinker)
|
|||
UINT16 tag1, tag2, tag3;
|
||||
|
||||
UINT8 flags = 0;
|
||||
if (line->flags & ML_NOSONIC)
|
||||
if (line->flags & ML_NETONLY)
|
||||
flags |= SL_NOPHYSICS;
|
||||
if (line->flags & ML_NOTAILS)
|
||||
if (line->flags & ML_NONET)
|
||||
flags |= SL_DYNAMIC;
|
||||
|
||||
switch(line->special)
|
||||
|
@ -494,7 +494,7 @@ static void line_SpawnViaVertexes(const int linenum, const boolean spawnthinker)
|
|||
return;
|
||||
}
|
||||
|
||||
if (line->flags & ML_NOKNUX)
|
||||
if (line->flags & ML_EFFECT6)
|
||||
{
|
||||
tag1 = line->tag;
|
||||
tag2 = side->textureoffset >> FRACBITS;
|
||||
|
|
93
src/p_spec.c
93
src/p_spec.c
|
@ -36,6 +36,7 @@
|
|||
#include "m_cond.h" //unlock triggers
|
||||
#include "lua_hook.h" // LUAh_LinedefExecute
|
||||
#include "f_finale.h" // control text prompt
|
||||
#include "r_things.h" // skins
|
||||
|
||||
#ifdef HW3SOUND
|
||||
#include "hardware/hw3sound.h"
|
||||
|
@ -98,7 +99,6 @@ typedef struct
|
|||
thinker_t **thinkers;
|
||||
} thinkerlist_t;
|
||||
|
||||
static void P_SearchForDisableLinedefs(void);
|
||||
static void P_SpawnScrollers(void);
|
||||
static void P_SpawnFriction(void);
|
||||
static void P_SpawnPushers(void);
|
||||
|
@ -2008,7 +2008,12 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller
|
|||
if (!P_CheckNightsTriggerLine(triggerline, actor))
|
||||
return false;
|
||||
break;
|
||||
|
||||
case 331: // continuous
|
||||
case 332: // each time
|
||||
case 333: // once
|
||||
if (!(actor && actor->player && ((stricmp(triggerline->text, skins[actor->player->skin].name) == 0) ^ ((triggerline->flags & ML_NOCLIMB) == ML_NOCLIMB))))
|
||||
return false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -2141,6 +2146,7 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller
|
|||
|| specialtype == 326 // DeNightserize - Once
|
||||
|| specialtype == 328 // Nights lap - Once
|
||||
|| specialtype == 330 // Nights Bonus Time - Once
|
||||
|| specialtype == 333 // Skin - Once
|
||||
|| specialtype == 399) // Level Load
|
||||
triggerline->special = 0; // Clear it out
|
||||
|
||||
|
@ -2181,7 +2187,8 @@ void P_LinedefExecute(INT16 tag, mobj_t *actor, sector_t *caller)
|
|||
|| 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
|
||||
|| lines[masterline].special == 322) // Trigger on X calls - Each Time
|
||||
|| lines[masterline].special == 322 // Trigger on X calls - Each Time
|
||||
|| lines[masterline].special == 332)// Skin - Each time
|
||||
continue;
|
||||
|
||||
if (lines[masterline].special < 300
|
||||
|
@ -6322,7 +6329,7 @@ void P_InitSpecials(void)
|
|||
|
||||
static void P_ApplyFlatAlignment(line_t *master, sector_t *sector, angle_t flatangle, fixed_t xoffs, fixed_t yoffs)
|
||||
{
|
||||
if (!(master->flags & ML_NOSONIC)) // Modify floor flat alignment unless NOSONIC flag is set
|
||||
if (!(master->flags & ML_NETONLY)) // Modify floor flat alignment unless ML_NETONLY flag is set
|
||||
{
|
||||
sector->spawn_flrpic_angle = sector->floorpic_angle = flatangle;
|
||||
sector->floor_xoffs += xoffs;
|
||||
|
@ -6332,7 +6339,7 @@ static void P_ApplyFlatAlignment(line_t *master, sector_t *sector, angle_t flata
|
|||
sector->spawn_flr_yoffs = sector->floor_yoffs;
|
||||
}
|
||||
|
||||
if (!(master->flags & ML_NOTAILS)) // Modify ceiling flat alignment unless NOTAILS flag is set
|
||||
if (!(master->flags & ML_NONET)) // Modify ceiling flat alignment unless ML_NONET flag is set
|
||||
{
|
||||
sector->spawn_ceilpic_angle = sector->ceilingpic_angle = flatangle;
|
||||
sector->ceiling_xoffs += xoffs;
|
||||
|
@ -6413,8 +6420,6 @@ void P_SpawnSpecials(INT32 fromnetsave)
|
|||
}
|
||||
}
|
||||
|
||||
P_SearchForDisableLinedefs(); // Disable linedefs are now allowed to disable *any* line
|
||||
|
||||
P_SpawnScrollers(); // Add generalized scrollers
|
||||
P_SpawnFriction(); // Friction model using linedefs
|
||||
P_SpawnPushers(); // Pusher model using linedefs
|
||||
|
@ -6463,28 +6468,22 @@ void P_SpawnSpecials(INT32 fromnetsave)
|
|||
// Init line EFFECTs
|
||||
for (i = 0; i < numlines; i++)
|
||||
{
|
||||
if (lines[i].special != 7) // This is a hack. I can at least hope nobody wants to prevent flat alignment with arbitrary skin setups...
|
||||
if (lines[i].special != 7) // This is a hack. I can at least hope nobody wants to prevent flat alignment in netgames...
|
||||
{
|
||||
// set line specials to 0 here too, same reason as above
|
||||
if (netgame || multiplayer)
|
||||
{
|
||||
// future: nonet flag?
|
||||
}
|
||||
else if ((lines[i].flags & ML_NETONLY) == ML_NETONLY)
|
||||
{
|
||||
lines[i].special = 0;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((players[consoleplayer].charability == CA_THOK && (lines[i].flags & ML_NOSONIC))
|
||||
|| (players[consoleplayer].charability == CA_FLY && (lines[i].flags & ML_NOTAILS))
|
||||
|| (players[consoleplayer].charability == CA_GLIDEANDCLIMB && (lines[i].flags & ML_NOKNUX)))
|
||||
if (lines[i].flags & ML_NONET)
|
||||
{
|
||||
lines[i].special = 0;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if (lines[i].flags & ML_NETONLY)
|
||||
{
|
||||
lines[i].special = 0;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
switch (lines[i].special)
|
||||
|
@ -6523,20 +6522,14 @@ void P_SpawnSpecials(INT32 fromnetsave)
|
|||
P_AddCameraScanner(§ors[sec], §ors[s], R_PointToAngle2(lines[i].v2->x, lines[i].v2->y, lines[i].v1->x, lines[i].v1->y));
|
||||
break;
|
||||
|
||||
#ifdef PARANOIA
|
||||
case 6: // Disable tags if level not cleared
|
||||
I_Error("Failed to catch a disable linedef");
|
||||
break;
|
||||
#endif
|
||||
|
||||
case 7: // Flat alignment - redone by toast
|
||||
if ((lines[i].flags & (ML_NOSONIC|ML_NOTAILS)) != (ML_NOSONIC|ML_NOTAILS)) // If you can do something...
|
||||
if ((lines[i].flags & (ML_NETONLY|ML_NONET)) != (ML_NETONLY|ML_NONET)) // If you can do something...
|
||||
{
|
||||
angle_t flatangle = InvAngle(R_PointToAngle2(lines[i].v1->x, lines[i].v1->y, lines[i].v2->x, lines[i].v2->y));
|
||||
fixed_t xoffs;
|
||||
fixed_t yoffs;
|
||||
|
||||
if (lines[i].flags & ML_NOKNUX) // Set offset through x and y texture offsets if NOKNUX flag is set
|
||||
if (lines[i].flags & ML_EFFECT6) // Set offset through x and y texture offsets if ML_EFFECT6 flag is set
|
||||
{
|
||||
xoffs = sides[lines[i].sidenum[0]].textureoffset;
|
||||
yoffs = sides[lines[i].sidenum[0]].rowoffset;
|
||||
|
@ -7175,6 +7168,7 @@ void P_SpawnSpecials(INT32 fromnetsave)
|
|||
case 301:
|
||||
case 310:
|
||||
case 312:
|
||||
case 332:
|
||||
sec = sides[*lines[i].sidenum].sector - sectors;
|
||||
P_AddEachTimeThinker(§ors[sec], &lines[i]);
|
||||
break;
|
||||
|
@ -7223,6 +7217,11 @@ void P_SpawnSpecials(INT32 fromnetsave)
|
|||
case 330:
|
||||
break;
|
||||
|
||||
// Skin trigger executors
|
||||
case 331:
|
||||
case 333:
|
||||
break;
|
||||
|
||||
case 399: // Linedef execute on map load
|
||||
// This is handled in P_RunLevelLoadExecutors.
|
||||
break;
|
||||
|
@ -9177,40 +9176,4 @@ static void P_SpawnPushers(void)
|
|||
Add_Pusher(p_downwind, l->dx, l->dy, NULL, s, -1, l->flags & ML_NOCLIMB, l->flags & ML_EFFECT4);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void P_SearchForDisableLinedefs(void)
|
||||
{
|
||||
size_t i;
|
||||
INT32 j;
|
||||
|
||||
// Look for disable linedefs
|
||||
for (i = 0; i < numlines; i++)
|
||||
{
|
||||
if (lines[i].special == 6)
|
||||
{
|
||||
// Remove special
|
||||
// Do *not* remove tag. That would mess with the tag lists
|
||||
// that P_InitTagLists literally just created!
|
||||
lines[i].special = 0;
|
||||
|
||||
// Ability flags can disable disable linedefs now, lol
|
||||
if (netgame || multiplayer)
|
||||
{
|
||||
// future: nonet flag?
|
||||
}
|
||||
else if ((lines[i].flags & ML_NETONLY) == ML_NETONLY)
|
||||
continue; // Net-only never triggers in single player
|
||||
else if (players[consoleplayer].charability == CA_THOK && (lines[i].flags & ML_NOSONIC))
|
||||
continue;
|
||||
else if (players[consoleplayer].charability == CA_FLY && (lines[i].flags & ML_NOTAILS))
|
||||
continue;
|
||||
else if (players[consoleplayer].charability == CA_GLIDEANDCLIMB && (lines[i].flags & ML_NOKNUX))
|
||||
continue;
|
||||
|
||||
// Disable any linedef specials with our tag.
|
||||
for (j = -1; (j = P_FindLineFromLineTag(&lines[i], j)) >= 0;)
|
||||
lines[j].special = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue