Merge branch 'next' into gfz3laser-mkii

This commit is contained in:
Lachlan 2020-05-06 09:10:27 +08:00
commit 05ea95d0eb
9 changed files with 271 additions and 467 deletions

View file

@ -760,6 +760,7 @@ linedeftypes
{
title = "Parameters";
prefix = "(22)";
flags8text = "[3] Set translucency by X offset";
flags32text = "[5] Render outer sides only";
flags64text = "[6] Trigger linedef executor";
flags128text = "[7] Intangible";
@ -2245,6 +2246,13 @@ linedeftypes
title = "Dye Object";
prefix = "(463)";
}
464
{
title = "Trigger Egg Capsule";
prefix = "(464)";
flags64text = "[6] Don't end level";
}
}
linedefexecmisc
@ -3731,6 +3739,7 @@ thingtypes
width = 8;
height = 16;
sprite = "internal:capsule";
angletext = "Tag";
}
292
{

View file

@ -5062,7 +5062,7 @@ void NetUpdate(void)
// In case the cvar value was lowered
if (joindelay)
joindelay = min(joindelay - 1, 3 * cv_joindelay.value * TICRATE);
joindelay = min(joindelay - 1, 3 * (tic_t)cv_joindelay.value * TICRATE);
}
nowtime /= NEWTICRATERATIO;

View file

@ -1863,6 +1863,12 @@ static void readlevelheader(MYFILE *f, INT32 num)
}
else if (fastcmp(word, "STARTRINGS"))
mapheaderinfo[num-1]->startrings = (UINT16)i;
else if (fastcmp(word, "SPECIALSTAGETIME"))
mapheaderinfo[num-1]->sstimer = i;
else if (fastcmp(word, "SPECIALSTAGESPHERES"))
mapheaderinfo[num-1]->ssspheres = i;
else if (fastcmp(word, "GRAVITY"))
mapheaderinfo[num-1]->gravity = FLOAT_TO_FIXED(atof(word2));
else
deh_warning("Level header %d: unknown word '%s'", num, word);
}

View file

@ -319,6 +319,9 @@ typedef struct
char selectheading[22]; ///< Level select heading. Allows for controllable grouping.
UINT16 startrings; ///< Number of rings players start with.
INT32 sstimer; ///< Timer for special stages.
UINT32 ssspheres; ///< Sphere requirement in special stages.
fixed_t gravity; ///< Map-wide gravity.
// Title card.
char ltzzpatch[8]; ///< Zig zag patch.

View file

@ -2082,6 +2082,12 @@ static int mapheaderinfo_get(lua_State *L)
lua_pushinteger(L, header->menuflags);
else if (fastcmp(field,"startrings"))
lua_pushinteger(L, header->startrings);
else if (fastcmp(field, "sstimer"))
lua_pushinteger(L, header->sstimer);
else if (fastcmp(field, "ssspheres"))
lua_pushinteger(L, header->ssspheres);
else if (fastcmp(field, "gravity"))
lua_pushfixed(L, header->gravity);
// TODO add support for reading numGradedMares and grades
else {
// Read custom vars now

File diff suppressed because it is too large Load diff

View file

@ -29,7 +29,6 @@
#define POLYOBJ_SPAWNCRUSH_DOOMEDNUM 762 // todo: REMOVE
#define POLYOBJ_START_LINE 20
#define POLYOBJ_EXPLICIT_LINE 21
#define POLYINFO_SPECIALNUM 22
typedef enum
@ -299,6 +298,14 @@ typedef struct polyrotdisplacedata_s
UINT8 turnobjs;
} polyrotdisplacedata_t;
typedef struct polyflagdata_s
{
INT32 polyObjNum;
INT32 speed;
UINT32 angle;
fixed_t momx;
} polyflagdata_t;
typedef struct polyfadedata_s
{
INT32 polyObjNum;
@ -320,7 +327,6 @@ boolean P_PointInsidePolyobj(polyobj_t *po, fixed_t x, fixed_t y);
boolean P_MobjTouchingPolyobj(polyobj_t *po, mobj_t *mo);
boolean P_MobjInsidePolyobj(polyobj_t *po, mobj_t *mo);
boolean P_BBoxInsidePolyobj(polyobj_t *po, fixed_t *bbox);
void Polyobj_GetInfo(INT16 poid, INT32 *poflags, INT32 *parentID, INT32 *potrans);
// thinkers (needed in p_saveg.c)
void T_PolyObjRotate(polyrotate_t *);
@ -333,14 +339,14 @@ void T_PolyObjRotDisplace (polyrotdisplace_t *);
void T_PolyObjFlag (polymove_t *);
void T_PolyObjFade (polyfade_t *);
INT32 EV_DoPolyDoor(polydoordata_t *);
INT32 EV_DoPolyObjMove(polymovedata_t *);
INT32 EV_DoPolyObjWaypoint(polywaypointdata_t *);
INT32 EV_DoPolyObjRotate(polyrotdata_t *);
INT32 EV_DoPolyObjDisplace(polydisplacedata_t *);
INT32 EV_DoPolyObjRotDisplace(polyrotdisplacedata_t *);
INT32 EV_DoPolyObjFlag(struct line_s *);
INT32 EV_DoPolyObjFade(polyfadedata_t *);
boolean EV_DoPolyDoor(polydoordata_t *);
boolean EV_DoPolyObjMove(polymovedata_t *);
boolean EV_DoPolyObjWaypoint(polywaypointdata_t *);
boolean EV_DoPolyObjRotate(polyrotdata_t *);
boolean EV_DoPolyObjDisplace(polydisplacedata_t *);
boolean EV_DoPolyObjRotDisplace(polyrotdisplacedata_t *);
boolean EV_DoPolyObjFlag(polyflagdata_t *);
boolean EV_DoPolyObjFade(polyfadedata_t *);
//

View file

@ -218,6 +218,9 @@ static void P_ClearSingleMapHeaderInfo(INT16 i)
mapheaderinfo[num]->typeoflevel = 0;
mapheaderinfo[num]->nextlevel = (INT16)(i + 1);
mapheaderinfo[num]->startrings = 0;
mapheaderinfo[num]->sstimer = 90;
mapheaderinfo[num]->ssspheres = 1;
mapheaderinfo[num]->gravity = FRACUNIT/2;
mapheaderinfo[num]->keywords[0] = '\0';
snprintf(mapheaderinfo[num]->musname, 7, "%sM", G_BuildMapName(i));
mapheaderinfo[num]->musname[6] = 0;

View file

@ -1044,9 +1044,6 @@ static INT32 P_FindLineFromTag(INT32 tag, INT32 start)
}
}
//
// P_FindSpecialLineFromTag
//
INT32 P_FindSpecialLineFromTag(INT16 special, INT16 tag, INT32 start)
{
if (tag == -1)
@ -1076,11 +1073,8 @@ INT32 P_FindSpecialLineFromTag(INT16 special, INT16 tag, INT32 start)
}
}
//
// PolyDoor
//
// Parses arguments for parameterized polyobject door types
//
static boolean PolyDoor(line_t *line)
{
polydoordata_t pdd;
@ -1117,11 +1111,7 @@ static boolean PolyDoor(line_t *line)
return EV_DoPolyDoor(&pdd);
}
//
// PolyMove
//
// Parses arguments for parameterized polyobject move specials
//
static boolean PolyMove(line_t *line)
{
polymovedata_t pmd;
@ -1136,12 +1126,8 @@ static boolean PolyMove(line_t *line)
return EV_DoPolyObjMove(&pmd);
}
//
// PolyInvisible
//
// Makes a polyobject invisible and intangible
// If NOCLIMB is ticked, the polyobject will still be tangible, just not visible.
//
static void PolyInvisible(line_t *line)
{
INT32 polyObjNum = line->tag;
@ -1164,12 +1150,8 @@ static void PolyInvisible(line_t *line)
po->flags &= ~POF_RENDERALL;
}
//
// PolyVisible
//
// Makes a polyobject visible and tangible
// If NOCLIMB is ticked, the polyobject will not be tangible, just visible.
//
static void PolyVisible(line_t *line)
{
INT32 polyObjNum = line->tag;
@ -1192,16 +1174,14 @@ static void PolyVisible(line_t *line)
po->flags |= (po->spawnflags & POF_RENDERALL);
}
//
// PolyTranslucency
//
// Sets the translucency of a polyobject
// Frontsector floor / 100 = translevel
//
static void PolyTranslucency(line_t *line)
{
INT32 polyObjNum = line->tag;
polyobj_t *po;
INT32 value;
if (!(po = Polyobj_GetForNum(polyObjNum)))
{
@ -1213,37 +1193,28 @@ static void PolyTranslucency(line_t *line)
if (po->isBad)
return;
// if DONTPEGBOTTOM, specify raw translucency value in Front X Offset
// else, take it out of 1000. If Front X Offset is specified, use that. Else, use floorheight.
// If Front X Offset is specified, use that. Else, use floorheight.
value = (sides[line->sidenum[0]].textureoffset ? sides[line->sidenum[0]].textureoffset : line->frontsector->floorheight) >> FRACBITS;
// If DONTPEGBOTTOM, specify raw translucency value. Else, take it out of 1000.
if (!(line->flags & ML_DONTPEGBOTTOM))
value /= 100;
if (line->flags & ML_EFFECT3) // relative calc
po->translucency = max(min(po->translucency + ((line->flags & ML_DONTPEGBOTTOM) ?
(sides[line->sidenum[0]].textureoffset ?
max(min(sides[line->sidenum[0]].textureoffset>>FRACBITS, NUMTRANSMAPS), -NUMTRANSMAPS)
: max(min(line->frontsector->floorheight>>FRACBITS, NUMTRANSMAPS), -NUMTRANSMAPS))
: (sides[line->sidenum[0]].textureoffset ?
max(min(sides[line->sidenum[0]].textureoffset>>FRACBITS, 1000), -1000) / 100
: max(min(line->frontsector->floorheight>>FRACBITS, 1000), -1000) / 100)),
NUMTRANSMAPS), 0);
po->translucency += value;
else
po->translucency = (line->flags & ML_DONTPEGBOTTOM) ?
(sides[line->sidenum[0]].textureoffset ?
max(min(sides[line->sidenum[0]].textureoffset>>FRACBITS, NUMTRANSMAPS), 0)
: max(min(line->frontsector->floorheight>>FRACBITS, NUMTRANSMAPS), 0))
: (sides[line->sidenum[0]].textureoffset ?
max(min(sides[line->sidenum[0]].textureoffset>>FRACBITS, 1000), 0) / 100
: max(min(line->frontsector->floorheight>>FRACBITS, 1000), 0) / 100);
po->translucency = value;
po->translucency = max(min(po->translucency, NUMTRANSMAPS), 0);
}
//
// PolyFade
//
// Makes a polyobject translucency fade and applies tangibility
//
static boolean PolyFade(line_t *line)
{
INT32 polyObjNum = line->tag;
polyobj_t *po;
polyfadedata_t pfd;
INT32 value;
if (!(po = Polyobj_GetForNum(polyObjNum)))
{
@ -1266,25 +1237,19 @@ static boolean PolyFade(line_t *line)
pfd.polyObjNum = polyObjNum;
// if DONTPEGBOTTOM, specify raw translucency value in Front X Offset
// else, take it out of 1000. If Front X Offset is specified, use that. Else, use floorheight.
// If Front X Offset is specified, use that. Else, use floorheight.
value = (sides[line->sidenum[0]].textureoffset ? sides[line->sidenum[0]].textureoffset : line->frontsector->floorheight) >> FRACBITS;
// If DONTPEGBOTTOM, specify raw translucency value. Else, take it out of 1000.
if (!(line->flags & ML_DONTPEGBOTTOM))
value /= 100;
if (line->flags & ML_EFFECT3) // relative calc
pfd.destvalue = max(min(po->translucency + ((line->flags & ML_DONTPEGBOTTOM) ?
(sides[line->sidenum[0]].textureoffset ?
max(min(sides[line->sidenum[0]].textureoffset>>FRACBITS, NUMTRANSMAPS), -NUMTRANSMAPS)
: max(min(line->frontsector->floorheight>>FRACBITS, NUMTRANSMAPS), -NUMTRANSMAPS))
: (sides[line->sidenum[0]].textureoffset ?
max(min(sides[line->sidenum[0]].textureoffset>>FRACBITS, 1000), -1000) / 100
: max(min(line->frontsector->floorheight>>FRACBITS, 1000), -1000) / 100)),
NUMTRANSMAPS), 0);
pfd.destvalue = po->translucency + value;
else
pfd.destvalue = (line->flags & ML_DONTPEGBOTTOM) ?
(sides[line->sidenum[0]].textureoffset ?
max(min(sides[line->sidenum[0]].textureoffset>>FRACBITS, NUMTRANSMAPS), 0)
: max(min(line->frontsector->floorheight>>FRACBITS, NUMTRANSMAPS), 0))
: (sides[line->sidenum[0]].textureoffset ?
max(min(sides[line->sidenum[0]].textureoffset>>FRACBITS, 1000), 0) / 100
: max(min(line->frontsector->floorheight>>FRACBITS, 1000), 0) / 100);
pfd.destvalue = value;
pfd.destvalue = max(min(pfd.destvalue, NUMTRANSMAPS), 0);
// already equal, nothing to do
if (po->translucency == pfd.destvalue)
@ -1303,11 +1268,7 @@ static boolean PolyFade(line_t *line)
return EV_DoPolyObjFade(&pfd);
}
//
// PolyWaypoint
//
// Parses arguments for parameterized polyobject waypoint movement
//
static boolean PolyWaypoint(line_t *line)
{
polywaypointdata_t pwd;
@ -1323,11 +1284,7 @@ static boolean PolyWaypoint(line_t *line)
return EV_DoPolyObjWaypoint(&pwd);
}
//
// PolyRotate
//
// Parses arguments for parameterized polyobject rotate specials
//
static boolean PolyRotate(line_t *line)
{
polyrotdata_t prd;
@ -1352,11 +1309,20 @@ static boolean PolyRotate(line_t *line)
return EV_DoPolyObjRotate(&prd);
}
//
// PolyDisplace
//
// Parses arguments for polyobject flag waving special
static boolean PolyFlag(line_t *line)
{
polyflagdata_t pfd;
pfd.polyObjNum = line->tag;
pfd.speed = P_AproxDistance(line->dx, line->dy) >> FRACBITS;
pfd.angle = R_PointToAngle2(line->v1->x, line->v1->y, line->v2->x, line->v2->y) >> ANGLETOFINESHIFT;
pfd.momx = sides[line->sidenum[0]].textureoffset >> FRACBITS;
return EV_DoPolyObjFlag(&pfd);
}
// Parses arguments for parameterized polyobject move-by-sector-heights specials
//
static boolean PolyDisplace(line_t *line)
{
polydisplacedata_t pdd;
@ -1371,8 +1337,7 @@ static boolean PolyDisplace(line_t *line)
}
/** Similar to PolyDisplace().
*/
// Parses arguments for parameterized polyobject rotate-by-sector-heights specials
static boolean PolyRotDisplace(line_t *line)
{
polyrotdisplacedata_t pdd;
@ -4005,6 +3970,47 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
}
break;
case 464: // Trigger Egg Capsule
{
thinker_t *th;
mobj_t *mo2;
// Find the center of the Eggtrap and release all the pretty animals!
// The chimps are my friends.. heeheeheheehehee..... - LouisJM
for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next)
{
if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed)
continue;
mo2 = (mobj_t *)th;
if (mo2->type != MT_EGGTRAP)
continue;
if (!mo2->spawnpoint)
continue;
if (mo2->spawnpoint->angle != line->tag)
continue;
P_KillMobj(mo2, NULL, mo, 0);
}
if (!(line->flags & ML_NOCLIMB))
{
INT32 i;
// Mark all players with the time to exit thingy!
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i])
continue;
P_DoPlayerExit(&players[i]);
}
}
}
break;
case 480: // Polyobj_DoorSlide
case 481: // Polyobj_DoorSwing
PolyDoor(line);
@ -6246,11 +6252,11 @@ static void P_RunLevelLoadExecutors(void)
void P_InitSpecials(void)
{
// Set the default gravity. Custom gravity overrides this setting.
gravity = FRACUNIT/2;
gravity = mapheaderinfo[gamemap-1]->gravity;
// Defaults in case levels don't have them set.
sstimer = 90*TICRATE + 6;
ssspheres = 1;
sstimer = mapheaderinfo[gamemap-1]->sstimer*TICRATE + 6;
ssspheres = mapheaderinfo[gamemap-1]->ssspheres;
CheckForBustableBlocks = CheckForBouncySector = CheckForQuicksand = CheckForMarioBlocks = CheckForFloatBob = CheckForReverseGravity = false;
@ -7282,7 +7288,7 @@ void P_SpawnSpecials(boolean fromnetsave)
switch (lines[i].special)
{
case 30: // Polyobj_Flag
EV_DoPolyObjFlag(&lines[i]);
PolyFlag(&lines[i]);
break;
case 31: // Polyobj_Displace