Add SSF flags for kart specials, use SSF for compat, implement way to set offroad and tripwire without terrain

This commit is contained in:
NepDisk 2025-02-08 12:38:58 -05:00
parent f4d7643d22
commit 410ef4989b
8 changed files with 288 additions and 207 deletions

View file

@ -1362,10 +1362,16 @@ constants
SSF_NOSTEPDOWN;
SSF_WINDCURRENT;
SSF_CONVEYOR;
SSF_SPEEDPAD;
SSF_STARPOSTACTIVATOR;
SSF_EXIT;
SSF_DELETEITEMS;
SSF_SNEAKERPANEL;
SSF_WATERPANEL;
SSF_REDPOGOSPRING;
SSF_YELLOWPOGOSPRING;
SSF_FAN;
SSF_FINISHLINE;
SSF_ZOOMTUBESTART;
SSF_ZOOMTUBEEND;

View file

@ -364,13 +364,16 @@ enum
SSF_NOSTEPDOWN = 1<<2,
SSF_WINDCURRENT = 1<<3,
SSF_CONVEYOR = 1<<4,
SSF_SPEEDPAD = 1<<5,
SSF_STARPOSTACTIVATOR = 1<<6,
SSF_EXIT = 1<<7,
SSF_DELETEITEMS = 1<<8,
SSF_FAN = 1<<12,
SSF_SNEAKERPANEL = 1<<9,
SSF_WATERPANEL = 1<<10,
SSF_REDPOGOSPRING = 1<<11,
SSF_YELLOWPOGOSPRING = 1<<12,
SSF_FAN = 1<<13,
SSF_FINISHLINE = 1<14,
SSF_ZOOMTUBESTART = 1<<15,
SSF_ZOOMTUBEEND = 1<<16,
};

View file

@ -63,31 +63,29 @@ sectorflags
invertprecip = "Invert Precipitation";
gravityflip = "Flip Objects in Reverse Gravity";
heatwave = "Heat Wave";
noclipcamera = "Intangible to the Camera";
colormapfog = "Fog Planes";
colormapfadesprites = "Fade Fullbright";
colormapprotected = "Protected from Tagging";
outerspace = "Space Countdown";
doublestepup = "Ramp Sector (double step-up/down)";
nostepup = "Wall Sector (No step-up)";
doublestepup = "Ramp Sector (Double step-up/down)";
nostepdown = "Non-Ramp Sector (No step-down)";
speedpad = "Speed Pad";
starpostactivator = "Star Post Activator";
exit = "Exit";
specialstagepit = "Special Stage Pit";
returnflag = "Return Flag";
redteambase = "Red Team Base";
blueteambase = "Blue Team Base";
fan = "Fan Sector";
supertransform = "Super Sonic Transform";
forcespin = "Force Spin";
zoomtubestart = "Zoom Tube Start";
zoomtubeend = "Zoom Tube End";
finishline = "Circuit Finish Line";
ropehang = "Rope Hang";
jumpflip = "Flip Gravity on Jump";
gravityoverride = "Make Reverse Gravity Temporary";
ripple_floor = "Ripple Floor";
ripple_ceiling = "Ripple Ceiling";
// BlanKart SSF flags
speedpad = "Speed Pad";
finishline = "Legacy Finish Line (Use line instead)";
sneakerpanel = "Sneaker Panel";
waterpanel = "Water Run Panel";
redpogospring = "Spring Panel";
yellowpogospring = "Capped Spring Panel";
// RR ACS executor flags
repeatspecial = "Each Time (?) (ACS)";
@ -108,31 +106,29 @@ sectorflagscategories
invertprecip = "regular";
gravityflip = "regular";
heatwave = "regular";
noclipcamera = "regular";
colormapfog = "colormap";
colormapfadesprites = "colormap";
colormapprotected = "colormap";
outerspace = "special";
nostepup = "special";
doublestepup = "special";
nostepdown = "special";
speedpad = "special";
starpostactivator = "special";
exit = "special";
specialstagepit = "special";
returnflag = "special";
redteambase = "special";
blueteambase = "special";
fan = "special";
supertransform = "special";
forcespin = "special";
zoomtubestart = "special";
zoomtubeend = "special";
finishline = "special";
ropehang = "special";
jumpflip = "special";
gravityoverride = "special";
ripple_floor = "regular";
ripple_ceiling = "regular";
// BlanKart SSF flags
speedpad = "special";
finishline = "special";
sneakerpanel = "special";
waterpanel = "special";
redpogospring = "special";
yellowpogospring = "special";
// RR ACS executor flags
repeatspecial = "trigger";

View file

@ -389,15 +389,15 @@ const char *const SSF_LIST[] = {
"NOSTEPDOWN",
"WINDCURRENT",
"CONVEYOR",
"\x01", // free (name un-matchable)
"SPEEDPAD",
"STARPOSTACTIVATOR",
"EXIT",
"DELETEITEMS",
"\x01", // free (name un-matchable)
"\x01", // free (name un-matchable)
"\x01", // free (name un-matchable)
"SNEAKERPANEL" ,
"REDPOGOSPRING",
"YELLOWPOGOSPRING" ,
"FAN",
"\x01", // free (name un-matchable)
"FINISHLINE",
"\x01", // free (name un-matchable)
"ZOOMTUBESTART",
"ZOOMTUBEEND",

View file

@ -6819,6 +6819,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
case MT_ORBINAUT:
{
boolean grounded = P_IsObjectOnGround(mobj);
sector_t *sec2;
if (mobj->flags2 & MF2_AMBUSH)
{
@ -6875,7 +6876,10 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
P_Thrust(mobj, mobj->angle, thrustamount);
if (P_MobjTouchingSectorSpecial(mobj, 3, 1))
sec2 = P_ThingOnSpecial3DFloor(mobj);
if ((mobj->terrain && mobj->terrain->pogoSpring > 0) || (sec2 && (sec2->specialflags & (SSF_YELLOWPOGOSPRING|SSF_REDPOGOSPRING)))
|| (P_IsObjectOnRealGround(mobj, mobj->subsector->sector)
&& (mobj->subsector->sector->specialflags & (SSF_YELLOWPOGOSPRING|SSF_REDPOGOSPRING))))
K_DoPogoSpring(mobj, 0, 1);
if (mobj->threshold > 0)
@ -6939,9 +6943,9 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
K_DriftDustHandling(mobj);
sec2 = P_ThingOnSpecial3DFloor(mobj);
if ((sec2 && GETSECSPECIAL(sec2->special, 3) == 1)
if ((mobj->terrain && mobj->terrain->pogoSpring > 0) || (sec2 && (sec2->specialflags & (SSF_YELLOWPOGOSPRING|SSF_REDPOGOSPRING)))
|| (P_IsObjectOnRealGround(mobj, mobj->subsector->sector)
&& GETSECSPECIAL(mobj->subsector->sector->special, 3) == 1))
&& (mobj->subsector->sector->specialflags & (SSF_YELLOWPOGOSPRING|SSF_REDPOGOSPRING))))
K_DoPogoSpring(mobj, 0, 1);
break;
@ -6968,9 +6972,9 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
if (grounded)
{
sector_t *sec2 = P_ThingOnSpecial3DFloor(mobj);
if ((sec2 && GETSECSPECIAL(sec2->special, 3) == 1)
if ((mobj->terrain && mobj->terrain->pogoSpring > 0) || (sec2 && (sec2->specialflags & (SSF_YELLOWPOGOSPRING|SSF_REDPOGOSPRING)))
|| (P_IsObjectOnRealGround(mobj, mobj->subsector->sector)
&& GETSECSPECIAL(mobj->subsector->sector->special, 3) == 1))
&& (mobj->subsector->sector->specialflags & (SSF_YELLOWPOGOSPRING|SSF_REDPOGOSPRING))))
K_DoPogoSpring(mobj, 0, 1);
}

View file

@ -1391,6 +1391,7 @@ static void P_LoadSidedefs(UINT8 *data)
break;
}
case 4: // Speed pad parameters
case 414: // Play SFX
{
sd->toptexture = sd->midtexture = sd->bottomtexture = 0;
@ -1882,18 +1883,30 @@ static void ParseTextmapSectorParameter(UINT32 i, const char *param, const char
sectors[i].specialflags |= SSF_DOUBLESTEPUP;
else if (fastcmp(param, "nostepdown") && fastcmp("true", val))
sectors[i].specialflags |= SSF_NOSTEPDOWN;
else if (fastcmp(param, "speedpad") && fastcmp("true", val))
sectors[i].specialflags |= SSF_SPEEDPAD;
else if ((fastcmp(param, "cheatcheckactivator") || fastcmp(param, "starpostactivator")) && fastcmp("true", val))
sectors[i].specialflags |= SSF_STARPOSTACTIVATOR;
else if (fastcmp(param, "exit") && fastcmp("true", val))
sectors[i].specialflags |= SSF_EXIT;
else if (fastcmp(param, "deleteitems") && fastcmp("true", val))
sectors[i].specialflags |= SSF_DELETEITEMS;
else if (fastcmp(param, "sneakerpanel") && fastcmp("true", val))
sectors[i].specialflags |= SSF_SNEAKERPANEL;
else if (fastcmp(param, "waterpanel") && fastcmp("true", val))
sectors[i].specialflags |= SSF_WATERPANEL;
else if (fastcmp(param, "redpogospring") && fastcmp("true", val))
sectors[i].specialflags |= SSF_REDPOGOSPRING;
else if (fastcmp(param, "yellowpogospring") && fastcmp("true", val))
sectors[i].specialflags |= SSF_YELLOWPOGOSPRING;
else if (fastcmp(param, "fan") && fastcmp("true", val))
sectors[i].specialflags |= SSF_FAN;
else if (fastcmp(param, "zoomtubestart") && fastcmp("true", val))
sectors[i].specialflags |= SSF_ZOOMTUBESTART;
else if (fastcmp(param, "zoomtubeend") && fastcmp("true", val))
sectors[i].specialflags |= SSF_ZOOMTUBEEND;
else if (fastcmp(param, "finishline") && fastcmp("true", val))
sectors[i].specialflags |= SSF_FINISHLINE;
else if (fastcmp(param, "friction"))
sectors[i].friction = FLOAT_TO_FIXED(atof(val));
else if (fastcmp(param, "gravity"))
@ -1909,6 +1922,17 @@ static void ParseTextmapSectorParameter(UINT32 i, const char *param, const char
if (fastcmp(val, "Instakill"))
sectors[i].damagetype = SD_INSTAKILL;
}
else if (fastcmp(param, "offroad"))
{
if (fastcmp(val, "Weak"))
sectors[i].offroad = FRACUNIT;
else if (fastcmp(val, "Normal"))
sectors[i].offroad = 2*FRACUNIT;
else if (fastcmp(val, "Strong"))
sectors[i].offroad = 3*FRACUNIT;
else
sectors[i].offroad = FLOAT_TO_FIXED(atof(val));
}
else if (fastcmp(param, "triggertag"))
sectors[i].triggertag = atol(val);
else if (fastcmp(param, "triggerer"))
@ -2034,6 +2058,8 @@ static void ParseTextmapLinedefParameter(UINT32 i, const char *param, const char
}
else if (fastcmp(param, "executordelay"))
lines[i].executordelay = atol(val);
else if (fastcmp(param, "tripwire") && fastcmp("true", val)) // who needs terraindefs amiright :^)
lines[i].tripwire = true;
// Flags
else if (fastcmp(param, "blocking") && fastcmp("true", val))
@ -3005,22 +3031,45 @@ static void P_WriteTextmap(void)
fprintf(f, "doublestepup = true;\n");
if (wsectors[i].specialflags & SSF_NOSTEPDOWN)
fprintf(f, "nostepdown = true;\n");
if (wsectors[i].specialflags & SSF_SPEEDPAD)
fprintf(f, "speedpad = true;\n");
if (wsectors[i].specialflags & SSF_STARPOSTACTIVATOR)
fprintf(f, "starpostactivator = true;\n");
if (wsectors[i].specialflags & SSF_EXIT)
fprintf(f, "exit = true;\n");
if (wsectors[i].specialflags & SSF_DELETEITEMS)
fprintf(f, "deleteitems = true;\n");
if (wsectors[i].specialflags & SSF_SNEAKERPANEL)
fprintf(f, "sneakerpanel = true;\n");
if (wsectors[i].specialflags & SSF_WATERPANEL)
fprintf(f, "waterpanel = true;\n");
if (wsectors[i].specialflags & SSF_REDPOGOSPRING)
fprintf(f, "redpogospring = true;\n");
if (wsectors[i].specialflags & SSF_YELLOWPOGOSPRING)
fprintf(f, "yellowpogospring = true;\n");
if (wsectors[i].specialflags & SSF_FAN)
fprintf(f, "fan = true;\n");
if (wsectors[i].specialflags & SSF_ZOOMTUBESTART)
fprintf(f, "zoomtubestart = true;\n");
if (wsectors[i].specialflags & SSF_ZOOMTUBEEND)
fprintf(f, "zoomtubeend = true;\n");
if (wsectors[i].specialflags & SSF_FINISHLINE)
fprintf(f, "finishline = true;\n");
if (wsectors[i].friction != ORIG_FRICTION)
fprintf(f, "friction = %f;\n", FIXED_TO_FLOAT(wsectors[i].friction));
if (wsectors[i].gravity != FRACUNIT)
fprintf(f, "gravity = %f;\n", FIXED_TO_FLOAT(wsectors[i].gravity));
if (wsectors[i].offroad != 0)
{
if (wsectors[i].offroad == FRACUNIT)
fprintf(f, "offroad = Weak;\n");
else if (wsectors[i].offroad == 2*FRACUNIT)
fprintf(f, "offroad = Normal;\n");
else if (wsectors[i].offroad == 3*FRACUNIT)
fprintf(f, "offroad = Strong;\n");
else
fprintf(f, "gravity = %f;\n", FIXED_TO_FLOAT(wsectors[i].offroad));
}
if (wsectors[i].damagetype != SD_NONE)
{
switch (wsectors[i].damagetype)
@ -3403,7 +3452,7 @@ static boolean P_CheckLineSideTripWire(line_t *ld, int p)
sda = &sides[n];
terrain = K_GetTerrainForTextureNum(sda->midtexture);
tripwire = terrain && (terrain->flags & TRF_TRIPWIRE);
tripwire = (terrain && (terrain->flags & TRF_TRIPWIRE)) || (ld->tripwire == true);
if (tripwire)
{
@ -4839,7 +4888,11 @@ static void P_ConvertBinaryLinedefTypes(void)
lines[i].args[2] = !!(lines[i].flags & ML_MIDSOLID);
break;
case 4: //Speed pad parameters
//CONS_Alert(CONS_WARNING, "Speed Pad linedef is deprecated. Use the TERRAIN effect!\n");
lines[i].args[0] = P_AproxDistance(lines[i].v2->x-lines[i].v1->x, lines[i].v2->y-lines[i].v1->y) >> FRACBITS;
if (lines[i].flags & ML_MIDSOLID)
lines[i].args[1] |= TMSP_NOTELEPORT;
if (lines[i].flags & ML_WRAPMIDTEX)
lines[i].args[1] |= TMSP_FORCESPIN;
break;
case 7: //Sector flat alignment
lines[i].args[0] = tag;
@ -6737,10 +6790,14 @@ static void P_ConvertBinarySectorTypes(void)
switch(GETSECSPECIAL(sectors[i].special, 3))
{
case 1: //Trick panel
case 1: //Spring Panel
sectors[i].specialflags |= SSF_REDPOGOSPRING;
break;
case 3:
sectors[i].specialflags |= SSF_YELLOWPOGOSPRING;
break;
case 5: //Speed pad
sectors[i].specialflags |= SSF_SPEEDPAD;
break;
default:
break;
@ -6758,9 +6815,10 @@ static void P_ConvertBinarySectorTypes(void)
sectors[i].specialflags |= SSF_FAN;
break;
case 6: //Sneaker panel
sectors[i].specialflags |= SSF_SNEAKERPANEL;
break;
case 7: //Destroy items
sectors[i].specialflags |= SSF_DELETEITEMS;
case 7: // Oil Slik
sectors[i].damagetype = SD_GENERIC;
break;
case 8: //Zoom tube start
sectors[i].specialflags |= SSF_ZOOMTUBESTART;
@ -6768,6 +6826,9 @@ static void P_ConvertBinarySectorTypes(void)
case 9: //Zoom tube end
sectors[i].specialflags |= SSF_ZOOMTUBEEND;
break;
case 10: // Circuit Finish Line
sectors[i].specialflags |= SSF_FINISHLINE;
break;
default:
break;
}

View file

@ -4916,6 +4916,140 @@ static void P_ProcessEggCapsule(player_t *player, sector_t *sector)
}
}
static void P_ProcessSpeedPad(player_t *player, sector_t *sector, sector_t *roversector, mtag_t sectag)
{
INT32 lineindex = -1;
angle_t lineangle;
fixed_t linespeed;
fixed_t sfxnum;
size_t i;
if (player->dashpadcooldown != 0)
return;
// Try for lines facing the sector itself, with tag 0.
for (i = 0; i < sector->linecount; i++)
{
line_t *li = sector->lines[i];
if (li->frontsector != sector)
continue;
if (li->special != 4)
continue;
if (!Tag_Find(&li->tags, 0))
continue;
lineindex = li - lines;
break;
}
// Nothing found? Look via tag.
if (lineindex == -1)
lineindex = Tag_FindLineSpecial(4, sectag);
if (lineindex == -1)
{
CONS_Debug(DBG_GAMELOGIC, "ERROR: Speed pad missing line special #4.\n");
return;
}
lineangle = R_PointToAngle2(lines[lineindex].v1->x, lines[lineindex].v1->y, lines[lineindex].v2->x, lines[lineindex].v2->y);
linespeed = lines[lineindex].args[0] << FRACBITS;
if (linespeed == 0)
{
CONS_Debug(DBG_GAMELOGIC, "ERROR: Speed pad (tag %d) at zero speed.\n", sectag);
return;
}
player->mo->angle = player->drawangle = lineangle;
// SRB2Kart: Scale the speed you get from them!
// This is scaled differently from other horizontal speed boosts from stuff like springs, because of how this is used for some ramp jumps.
if (player->mo->scale > mapobjectscale)
linespeed = FixedMul(linespeed, mapobjectscale + (player->mo->scale - mapobjectscale));
if (!demo.playback)
P_SetPlayerAngle(player, player->mo->angle);
if (!(lines[lineindex].args[1] & TMSP_NOTELEPORT))
{
P_UnsetThingPosition(player->mo);
if (roversector) // make FOF speed pads work
{
player->mo->x = roversector->soundorg.x;
player->mo->y = roversector->soundorg.y;
}
else
{
player->mo->x = sector->soundorg.x;
player->mo->y = sector->soundorg.y;
}
P_SetThingPosition(player->mo);
}
P_InstaThrust(player->mo, player->mo->angle, linespeed);
player->dashpadcooldown = TICRATE/3;
player->drift = 0;
player->driftcharge = 0;
player->pogospring = 0;
sfxnum = lines[lineindex].stringargs[0] ? get_number(lines[lineindex].stringargs[0]) : sfx_spdpad;
if (!sfxnum)
sfxnum = sfx_spdpad;
S_StartSound(player->mo, sfxnum);
{
sfxenum_t pick = P_RandomKey(2); // Gotta roll the RNG every time this is called for sync reasons
if (cv_kartvoices.value)
S_StartSound(player->mo, sfx_kbost1+pick);
//K_TauntVoiceTimers(player);
}
}
static void P_ProcessPogoSpring(player_t *player, boolean isTouching, boolean type)
{
const fixed_t hscale = mapobjectscale + (mapobjectscale - player->mo->scale);
const fixed_t minspeed = 24*hscale;
const fixed_t maxspeed = 28*hscale;
angle_t pushangle = FixedHypot(player->mo->momx, player->mo->momy) ? R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy) : player->mo->angle;
if (!isTouching)
return;
if ((player->speed > maxspeed) && type == 2) // Prevent overshooting jumps
P_InstaThrust(player->mo, pushangle, maxspeed);
else if (player->speed < minspeed) // Push forward to prevent getting stuck
P_InstaThrust(player->mo, pushangle, minspeed);
if (type == 2)
player->pogospring = 2;
else
player->pogospring = 1;
K_DoPogoSpring(player->mo, 0, 1);
}
static void P_ProcessBoostPanel(player_t *player, boolean isTouching, boolean type)
{
if (isTouching)
{
if (!player->floorboost)
player->floorboost = 3;
else
player->floorboost = 2;
if (type == SBPT_WATER)
K_DoWaterRunPanel(player);
else
K_DoSneaker(player, 0);
}
}
static void P_ProcessExitSector(player_t *player, mtag_t sectag)
{
INT32 lineindex;
@ -5032,6 +5166,8 @@ static boolean P_SectorHasSpecial(sector_t *sec)
return false;
}
static void P_EvaluateSpecialFlags(player_t *player, sector_t *sector, sector_t *roversector, boolean isTouching)
{
mtag_t sectag = Tag_FGet(&sector->tags);
@ -5043,6 +5179,8 @@ static void P_EvaluateSpecialFlags(player_t *player, sector_t *sector, sector_t
player->onconveyor = 2;
if (sector->specialflags & SSF_CONVEYOR)
player->onconveyor = 4;
if ((sector->specialflags & SSF_SPEEDPAD) && isTouching)
P_ProcessSpeedPad(player, sector, roversector, sectag);
if (sector->specialflags & SSF_STARPOSTACTIVATOR)
{
mobj_t *post = P_GetObjectTypeInSectorNum(MT_STARPOST, sector - sectors);
@ -5064,10 +5202,26 @@ static void P_EvaluateSpecialFlags(player_t *player, sector_t *sector, sector_t
P_SetPlayerMobjState(player->mo, S_PLAY_FALL);
*/
}
if (sector->specialflags & SSF_SNEAKERPANEL)
P_ProcessBoostPanel(player, isTouching, SBPT_SNEAKER);
if (sector->specialflags & SSF_WATERPANEL)
P_ProcessBoostPanel(player, isTouching, SBPT_WATER);
if (sector->specialflags & SSF_REDPOGOSPRING)
P_ProcessPogoSpring(player, isTouching, SSPT_RED);
if (sector->specialflags & SSF_YELLOWPOGOSPRING)
P_ProcessPogoSpring(player, isTouching, SSPT_YELLOW);
if (sector->specialflags & SSF_ZOOMTUBESTART)
P_ProcessZoomTube(player, sectag, false);
if (sector->specialflags & SSF_ZOOMTUBEEND)
P_ProcessZoomTube(player, sectag, true);
if (sector->specialflags & SSF_FINISHLINE)
{
if ((gametyperules & GTR_CIRCUIT) && (player->exiting == 0) && !(player->pflags & PF_HITFINISHLINE))
{
K_HandleLapIncrement(player);
player->pflags |= PF_HITFINISHLINE;
}
}
}
static void P_EvaluateDamageType(player_t *player, sector_t *sector, boolean isTouching)
@ -5131,134 +5285,9 @@ static void P_EvaluateOldSectorSpecial(player_t *player, sector_t *sector, secto
break;
}
switch (GETSECSPECIAL(sector->special, 3))
{
case 1: // SRB2kart: Spring Panel
{
if (roversector || isTouching)
{
const fixed_t hscale = mapobjectscale + (mapobjectscale - player->mo->scale);
const fixed_t minspeed = 24*hscale;
angle_t pushangle = FixedHypot(player->mo->momx, player->mo->momy) ? R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy) : player->mo->angle;
// if we have no speed for SOME REASON, use the player's angle, otherwise we'd be forcefully thrusted to what I can only assume is angle 0
if (player->mo->eflags & MFE_SPRUNG)
break;
if (player->speed < minspeed) // Push forward to prevent getting stuck
P_InstaThrust(player->mo, pushangle, minspeed);
player->pogospring = 1;
K_DoPogoSpring(player->mo, 0, 1);
}
break;
}
case 3: // SRB2kart: Spring Panel (capped speed)
{
if (roversector || isTouching)
{
const fixed_t hscale = mapobjectscale + (mapobjectscale - player->mo->scale);
const fixed_t minspeed = 24*hscale;
const fixed_t maxspeed = 28*hscale;
angle_t pushangle = FixedHypot(player->mo->momx, player->mo->momy) ? R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy) : player->mo->angle;
// if we have no speed for SOME REASON, use the player's angle, otherwise we'd be forcefully thrusted to what I can only assume is angle 0
if (player->mo->eflags & MFE_SPRUNG)
break;
if (player->speed > maxspeed) // Prevent overshooting jumps
P_InstaThrust(player->mo, pushangle, maxspeed);
else if (player->speed < minspeed) // Push forward to prevent getting stuck
P_InstaThrust(player->mo, pushangle, minspeed);
player->pogospring = 2;
K_DoPogoSpring(player->mo, 0, 1);
}
break;
}
case 5: // Speed pad w/o spin
case 6: // Speed pad w/ spin
{
int i;
if (player->dashpadcooldown != 0)
break;
i = P_FindSpecialLineFromTag(4, Tag_FGet(&sector->tags), -1);
if ((i != -1) && (roversector || isTouching))
{
angle_t lineangle;
fixed_t linespeed;
lineangle = R_PointToAngle2(lines[i].v1->x, lines[i].v1->y, lines[i].v2->x, lines[i].v2->y);
linespeed = P_AproxDistance(lines[i].v2->x-lines[i].v1->x, lines[i].v2->y-lines[i].v1->y);
player->mo->angle = lineangle;
player->angleturn = player->mo->angle;
// SRB2Kart: Scale the speed you get from them!
// This is scaled differently from other horizontal speed boosts from stuff like springs, because of how this is used for some ramp jumps.
if (player->mo->scale > mapobjectscale)
linespeed = FixedMul(linespeed, mapobjectscale + (player->mo->scale - mapobjectscale));
if (!demo.playback)
{
for (SINT8 j = 0; j <= r_splitscreen; j++)
{
if (player == &players[displayplayers[j]])
{
localangle[j] = player->mo->angle;
break;
}
}
}
if (!(lines[i].flags & 512))
{
P_UnsetThingPosition(player->mo);
if (roversector) // make FOF speed pads work
{
player->mo->x = roversector->soundorg.x;
player->mo->y = roversector->soundorg.y;
}
else
{
player->mo->x = sector->soundorg.x;
player->mo->y = sector->soundorg.y;
}
P_SetThingPosition(player->mo);
}
P_InstaThrust(player->mo, player->mo->angle, linespeed);
player->dashpadcooldown = TICRATE/3;
player->drift = 0;
player->driftcharge = 0;
player->pogospring = 0;
S_StartSound(player->mo, sfx_spdpad);
{
sfxenum_t pick = P_RandomKey(2); // Gotta roll the RNG every time this is called for sync reasons
if (cv_kartvoices.value)
S_StartSound(player->mo, sfx_kbost1+pick);
//K_TauntVoiceTimers(player);
}
}
break;
}
}
switch (GETSECSPECIAL(sector->special, 4))
{
case 1: // StarPost Activator
{
mobj_t *post = P_GetObjectTypeInSectorNum(MT_STARPOST, sector - sectors);
if (!post)
break;
P_TouchStarPost(post, player, false);
break;
}
case 5: // Fan sector
case 5: // Fan sector
{
player->mo->momz += 5*FRACUNIT/4;
@ -5268,37 +5297,6 @@ static void P_EvaluateOldSectorSpecial(player_t *player, sector_t *sector, secto
P_ResetPlayer(player);
break;
}
case 6: // SRB2kart 190117 - Sneaker Panel
{
if (roversector || isTouching)
{
if (!player->floorboost)
player->floorboost = 3;
else
player->floorboost = 2;
K_DoSneaker(player, 0);
}
break;
}
case 7: // SRB2kart 190117 - Oil Slick (deprecated)
if (roversector || isTouching)
{
if (player)
P_DamageMobj(player->mo, NULL, NULL, 1, DMG_NORMAL);
}
break;
case 10: // Finish Line
{
if ((gametyperules & GTR_CIRCUIT) && (player->exiting == 0) && !(player->pflags & PF_HITFINISHLINE))
{
K_HandleLapIncrement(player);
//ACS_RunLapScript(mo, line);
//K_HandleLapIncrement(player);
player->pflags |= PF_HITFINISHLINE;
}
break;
}
}
}
@ -5333,7 +5331,7 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers
P_EvaluateDamageType(player, sector, isTouching);
P_EvaluateLinedefExecutorTrigger(player, sector, isTouching);
//if (!udmf)
if (!udmf)
P_EvaluateOldSectorSpecial(player, sector, roversector, isTouching);
}

View file

@ -367,16 +367,16 @@ typedef enum
SSF_NOSTEPDOWN = 1<<2,
SSF_WINDCURRENT = 1<<3,
SSF_CONVEYOR = 1<<4,
// free: 1<<5,
SSF_SPEEDPAD = 1<<5,
SSF_STARPOSTACTIVATOR = 1<<6,
SSF_EXIT = 1<<7,
SSF_DELETEITEMS = 1<<8,
// free: 1<<9,
// free: 1<<10,
// free: 1<<11,
SSF_FAN = 1<<12,
// free: 1<<13,
// free: 1<<14,
SSF_SNEAKERPANEL = 1<<9,
SSF_WATERPANEL = 1<<10,
SSF_REDPOGOSPRING = 1<<11,
SSF_YELLOWPOGOSPRING = 1<<12,
SSF_FAN = 1<<13,
SSF_FINISHLINE = 1<14,
SSF_ZOOMTUBESTART = 1<<15,
SSF_ZOOMTUBEEND = 1<<16,
} sectorspecialflags_t;
@ -448,6 +448,19 @@ typedef enum
CRUMBLE_RESTORE, // Crumble thinker is about to restore to original position
} crumblestate_t;
// enums for new SSF flags to prevent magic numbers!
typedef enum
{
SBPT_SNEAKER,
SBPT_WATER,
} specialboostpaneltype_t;
typedef enum
{
SSPT_RED,
SSPT_YELLOW,
} specialspringpaneltype_t;
//
// The SECTORS record, at runtime.
// Stores things/mobjs.