From 0c6d27a319dd2eb6bbc9dc3eb53a818c5daf77e0 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Fri, 26 Apr 2019 14:14:25 -0400 Subject: [PATCH 01/49] Flush random map pool after all but 3 are played --- src/g_game.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/g_game.c b/src/g_game.c index ad25c8ce9..36b696fb4 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3428,7 +3428,7 @@ tryagain: void G_AddMapToBuffer(INT16 map) { - INT16 bufx, refreshnum = (TOLMaps(G_TOLFlag(gametype)) / 2) + 1; + INT16 bufx, refreshnum = max(0, TOLMaps(G_TOLFlag(gametype))-3); // Add the map to the buffer. for (bufx = NUMMAPS-1; bufx > 0; bufx--) From 927c5e008048855dc408217887749b2f41236ace Mon Sep 17 00:00:00 2001 From: Sryder Date: Tue, 7 May 2019 23:35:19 +0100 Subject: [PATCH 02/49] Use spin slope physics on all players Disable increased slope strength with more speed --- src/p_slopes.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/p_slopes.c b/src/p_slopes.c index c6416b75a..6928e93e9 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -869,26 +869,22 @@ void P_ButteredSlope(mobj_t *mo) return; // Allow the player to stand still on slopes below a certain steepness } - thrust = FINESINE(mo->standingslope->zangle>>ANGLETOFINESHIFT) * 15 / 16 * (mo->eflags & MFE_VERTICALFLIP ? 1 : -1); + thrust = FINESINE(mo->standingslope->zangle>>ANGLETOFINESHIFT) * 4 / 5 * (mo->eflags & MFE_VERTICALFLIP ? 1 : -1); - if (mo->player && (mo->player->pflags & PF_SPINNING)) { - fixed_t mult = 0; + if (mo->player) { + fixed_t mult = FRACUNIT; if (mo->momx || mo->momy) { angle_t angle = R_PointToAngle2(0, 0, mo->momx, mo->momy) - mo->standingslope->xydirection; if (P_MobjFlip(mo) * mo->standingslope->zdelta < 0) angle ^= ANGLE_180; - mult = FINECOSINE(angle >> ANGLETOFINESHIFT); + mult = FRACUNIT + (FRACUNIT + FINECOSINE(angle>>ANGLETOFINESHIFT))*3/2; } - thrust = FixedMul(thrust, FRACUNIT*2/3 + mult/8); + thrust = FixedMul(thrust, mult); } - if (mo->momx || mo->momy) // Slightly increase thrust based on the object's speed - thrust = FixedMul(thrust, FRACUNIT+P_AproxDistance(mo->momx, mo->momy)/16); - // This makes it harder to zigzag up steep slopes, as well as allows greater top speed when rolling down - // Let's get the gravity strength for the object... thrust = FixedMul(thrust, abs(P_GetMobjGravity(mo))); From 682a8f68295b1b643c6e25f79108ff37b2e0c842 Mon Sep 17 00:00:00 2001 From: Sryder Date: Wed, 8 May 2019 20:49:47 +0100 Subject: [PATCH 03/49] Disable the speedcap on players. Don't calculate acceleration as ever being above top speed. --- src/k_kart.c | 11 +++++++---- src/p_user.c | 4 +++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index d9bc1f26d..18ef5ac90 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1636,7 +1636,7 @@ static void K_DrawDraftCombiring(player_t *player, player_t *victim, fixed_t cur curx += stepx; cury += stepy; curz += stepz; - + offset = abs(offset-1) % 3; n--; } @@ -2241,7 +2241,7 @@ static void K_GetKartBoostPower(player_t *player) { speedboost += (player->kartstuff[k_draftpower]) / 3; // + 0 to 33.3% top speed //accelboost += (FRACUNIT / 3); // + 33.3% acceleration - numboosts++; // (Drafting suffers no boost stack penalty!) + numboosts++; // (Drafting suffers no boost stack penalty!) } player->kartstuff[k_boostpower] = boostpower; @@ -2319,6 +2319,9 @@ fixed_t K_3dKartMovement(player_t *player, boolean onground, fixed_t forwardmove // ACCELCODE!!!1!11! oldspeed = R_PointToDist2(0, 0, player->rmomx, player->rmomy); // FixedMul(P_AproxDistance(player->rmomx, player->rmomy), player->mo->scale); + // Don't calculate the acceleration as ever being above top speed + if (oldspeed > p_speed) + oldspeed = p_speed; newspeed = FixedDiv(FixedDiv(FixedMul(oldspeed, accelmax - p_accel) + FixedMul(p_speed, p_accel), accelmax), ORIG_FRICTION); if (player->kartstuff[k_pogospring]) // Pogo Spring minimum/maximum thrust @@ -3413,7 +3416,7 @@ void K_SpawnDraftDust(mobj_t *mo) ang = mo->player->frameangle; - if (mo->player->kartstuff[k_drift] != 0) + if (mo->player->kartstuff[k_drift] != 0) { drifting = true; ang += (mo->player->kartstuff[k_drift] * ((ANGLE_270 + ANGLE_22h) / 5)); // -112.5 doesn't work. I fucking HATE SRB2 angles @@ -8382,7 +8385,7 @@ static void K_drawKartRingsAndLives(void) } else if (stplyr->kartstuff[k_rings] >= 20) // Maxed out ringmap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_YELLOW, GTC_CACHE); - + if (netgame) V_DrawScaledPatch(LAPS_X, LAPS_Y-11, V_HUDTRANS|splitflags, kp_ringsticker[1]); diff --git a/src/p_user.c b/src/p_user.c index d4e6a03de..a331d56b7 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4184,6 +4184,7 @@ static void P_3dMovement(player_t *player) // If "no" to 2, normalize to topspeed, so we can't suddenly run faster than it of our own accord. // If "no" to 1, we're not reaching any limits yet, so ignore this entirely! // -Shadow Hog + /* newMagnitude = R_PointToDist2(player->mo->momx - player->cmomx, player->mo->momy - player->cmomy, 0, 0); if (newMagnitude > K_GetKartSpeed(player, true)) //topspeed) { @@ -4207,6 +4208,7 @@ static void P_3dMovement(player_t *player) player->mo->momy = tempmomy + player->cmomy; } } + */ } // @@ -7352,7 +7354,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall if (P_CameraThinker(player, thiscam, resetcalled)) return true; - + if (thiscam == &camera[1]) // Camera 2 { num = 1; From 00ec2b5f16856e05dab479078ec2d71143ccde08 Mon Sep 17 00:00:00 2001 From: Sryder Date: Fri, 10 May 2019 20:21:21 +0100 Subject: [PATCH 04/49] Re-enable the speed cap Only in midair to prevent pogo jump acceleration to infinity. --- src/p_user.c | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index a331d56b7..d25095f0c 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4184,31 +4184,35 @@ static void P_3dMovement(player_t *player) // If "no" to 2, normalize to topspeed, so we can't suddenly run faster than it of our own accord. // If "no" to 1, we're not reaching any limits yet, so ignore this entirely! // -Shadow Hog - /* - newMagnitude = R_PointToDist2(player->mo->momx - player->cmomx, player->mo->momy - player->cmomy, 0, 0); - if (newMagnitude > K_GetKartSpeed(player, true)) //topspeed) + // Only do this forced cap of speed when in midair, the kart acceleration code takes into account friction, and + // doesn't let you accelerate past top speed, so this is unnecessary on the ground, but in the air is needed to + // allow for being able to change direction on spring jumps without being accelerated into the void - Sryder + if (!P_IsObjectOnGround(player->mo)) { - fixed_t tempmomx, tempmomy; - if (oldMagnitude > K_GetKartSpeed(player, true)) + newMagnitude = R_PointToDist2(player->mo->momx - player->cmomx, player->mo->momy - player->cmomy, 0, 0); + if (newMagnitude > K_GetKartSpeed(player, true)) //topspeed) { - if (newMagnitude > oldMagnitude) + fixed_t tempmomx, tempmomy; + if (oldMagnitude > K_GetKartSpeed(player, true)) { - tempmomx = FixedMul(FixedDiv(player->mo->momx - player->cmomx, newMagnitude), oldMagnitude); - tempmomy = FixedMul(FixedDiv(player->mo->momy - player->cmomy, newMagnitude), oldMagnitude); + if (newMagnitude > oldMagnitude) + { + tempmomx = FixedMul(FixedDiv(player->mo->momx - player->cmomx, newMagnitude), oldMagnitude); + tempmomy = FixedMul(FixedDiv(player->mo->momy - player->cmomy, newMagnitude), oldMagnitude); + player->mo->momx = tempmomx + player->cmomx; + player->mo->momy = tempmomy + player->cmomy; + } + // else do nothing + } + else + { + tempmomx = FixedMul(FixedDiv(player->mo->momx - player->cmomx, newMagnitude), K_GetKartSpeed(player, true)); //topspeed) + tempmomy = FixedMul(FixedDiv(player->mo->momy - player->cmomy, newMagnitude), K_GetKartSpeed(player, true)); //topspeed) player->mo->momx = tempmomx + player->cmomx; player->mo->momy = tempmomy + player->cmomy; } - // else do nothing - } - else - { - tempmomx = FixedMul(FixedDiv(player->mo->momx - player->cmomx, newMagnitude), K_GetKartSpeed(player, true)); //topspeed) - tempmomy = FixedMul(FixedDiv(player->mo->momy - player->cmomy, newMagnitude), K_GetKartSpeed(player, true)); //topspeed) - player->mo->momx = tempmomx + player->cmomx; - player->mo->momy = tempmomy + player->cmomy; } } - */ } // From c0d2689ae4d5ee0c971bac2e6ff945c745c728d7 Mon Sep 17 00:00:00 2001 From: Sryder Date: Fri, 10 May 2019 21:25:45 +0100 Subject: [PATCH 05/49] Allow slope physics to apply on all but slight gradients. --- src/p_slopes.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/p_slopes.c b/src/p_slopes.c index 6928e93e9..b672be56e 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -862,9 +862,11 @@ void P_ButteredSlope(mobj_t *mo) return; // don't slide down slopes if you can't touch them or you're not affected by gravity if (mo->player) { - if (abs(mo->standingslope->zdelta) < FRACUNIT/4 && !(mo->player->pflags & PF_SPINNING)) + // Changed in kart to only not apply physics on very slight slopes (I think about 4 degree angles) + if (abs(mo->standingslope->zdelta) < FRACUNIT/21 && !(mo->player->pflags & PF_SPINNING)) return; // Don't slide on non-steep slopes unless spinning + // This only means you can be stopped on slopes that aren't steeper than 45 degrees if (abs(mo->standingslope->zdelta) < FRACUNIT/2 && !(mo->player->rmomx || mo->player->rmomy)) return; // Allow the player to stand still on slopes below a certain steepness } From dca1a05a7f70b536fb4b7f9e759b82f419f54fe7 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 26 May 2019 03:41:18 -0400 Subject: [PATCH 06/49] Gradient skincolors for MD2 blend textures --- src/hardware/hw_md2.c | 167 +++++++++++++++++++++++------------------- src/k_kart.c | 2 +- 2 files changed, 93 insertions(+), 76 deletions(-) diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index d217f4094..cc69fad02 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -653,13 +653,12 @@ spritemd2found: // 0.2126 to red // 0.7152 to green // 0.0722 to blue -// (See this same define in k_kart.c!) +// (See this same define in hw_md2.c!) #define SETBRIGHTNESS(brightness,r,g,b) \ - brightness = (UINT8)(((1063*((UINT16)r)/5000) + (3576*((UINT16)g)/5000) + (361*((UINT16)b)/5000)) / 3) + brightness = (UINT8)(((1063*(UINT16)(r))/5000) + ((3576*(UINT16)(g))/5000) + ((361*(UINT16)(b))/5000)) static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, GLMipmap_t *grmip, INT32 skinnum, skincolors_t color) { - UINT8 i; UINT16 w = gpatch->width, h = gpatch->height; UINT32 size = w*h; RGBA_t *image, *blendimage, *cur, blendcolor; @@ -684,102 +683,120 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, image = gpatch->mipmap.grInfo.data; blendimage = blendgpatch->mipmap.grInfo.data; + blendcolor = V_GetColor(0); // initialize - // Average all of the translation's colors + while (size--) { - const UINT8 div = 6; - const UINT8 start = 4; - UINT32 r, g, b; + UINT16 brightness; - blendcolor = V_GetColor(colortranslations[color][start]); - r = (UINT32)(blendcolor.s.red*blendcolor.s.red); - g = (UINT32)(blendcolor.s.green*blendcolor.s.green); - b = (UINT32)(blendcolor.s.blue*blendcolor.s.blue); - - for (i = 1; i < div; i++) - { - RGBA_t nextcolor = V_GetColor(colortranslations[color][start+i]); - r += (UINT32)(nextcolor.s.red*nextcolor.s.red); - g += (UINT32)(nextcolor.s.green*nextcolor.s.green); - b += (UINT32)(nextcolor.s.blue*nextcolor.s.blue); - } - - blendcolor.s.red = (UINT8)(FixedSqrt((r/div)<>FRACBITS); - blendcolor.s.green = (UINT8)(FixedSqrt((g/div)<>FRACBITS); - blendcolor.s.blue = (UINT8)(FixedSqrt((b/div)<>FRACBITS); - } - - // rainbow support, could theoretically support boss ones too - if (skinnum == TC_RAINBOW) - { - while (size--) + // Don't bother with blending the pixel if the alpha of the blend pixel is 0 + if (skinnum == TC_RAINBOW) { if (image->s.alpha == 0 && blendimage->s.alpha == 0) { - // Don't bother with blending the pixel if the alpha of the blend pixel is 0 cur->rgba = image->rgba; + cur++; image++; blendimage++; + continue; } else { - UINT32 tempcolor; - UINT16 imagebright, blendbright, finalbright, colorbright; + UINT16 imagebright, blendbright; SETBRIGHTNESS(imagebright,image->s.red,image->s.green,image->s.blue); SETBRIGHTNESS(blendbright,blendimage->s.red,blendimage->s.green,blendimage->s.blue); // slightly dumb average between the blend image color and base image colour, usually one or the other will be fully opaque anyway - finalbright = (imagebright*(255-blendimage->s.alpha))/255 + (blendbright*blendimage->s.alpha)/255; - SETBRIGHTNESS(colorbright,blendcolor.s.red,blendcolor.s.green,blendcolor.s.blue); - - tempcolor = (finalbright*blendcolor.s.red)/colorbright; - tempcolor = min(255, tempcolor); - cur->s.red = (UINT8)tempcolor; - tempcolor = (finalbright*blendcolor.s.green)/colorbright; - tempcolor = min(255, tempcolor); - cur->s.green = (UINT8)tempcolor; - tempcolor = (finalbright*blendcolor.s.blue)/colorbright; - tempcolor = min(255, tempcolor); - cur->s.blue = (UINT8)tempcolor; - cur->s.alpha = image->s.alpha; + brightness = (imagebright*(255-blendimage->s.alpha))/255 + (blendbright*blendimage->s.alpha)/255; } - - cur++; image++; blendimage++; } - } - else - { - while (size--) + else { if (blendimage->s.alpha == 0) { - // Don't bother with blending the pixel if the alpha of the blend pixel is 0 cur->rgba = image->rgba; + cur++; image++; blendimage++; + continue; } else { - INT32 tempcolor; - INT16 tempmult, tempalpha; - tempalpha = -(abs(blendimage->s.red-127)-127)*2; - if (tempalpha > 255) - tempalpha = 255; - else if (tempalpha < 0) - tempalpha = 0; - - tempmult = (blendimage->s.red-127)*2; - if (tempmult > 255) - tempmult = 255; - else if (tempmult < 0) - tempmult = 0; - - tempcolor = (image->s.red*(255-blendimage->s.alpha))/255 + ((tempmult + ((tempalpha*blendcolor.s.red)/255)) * blendimage->s.alpha)/255; - cur->s.red = (UINT8)tempcolor; - tempcolor = (image->s.green*(255-blendimage->s.alpha))/255 + ((tempmult + ((tempalpha*blendcolor.s.green)/255)) * blendimage->s.alpha)/255; - cur->s.green = (UINT8)tempcolor; - tempcolor = (image->s.blue*(255-blendimage->s.alpha))/255 + ((tempmult + ((tempalpha*blendcolor.s.blue)/255)) * blendimage->s.alpha)/255; - cur->s.blue = (UINT8)tempcolor; - cur->s.alpha = image->s.alpha; + SETBRIGHTNESS(brightness,blendimage->s.red,blendimage->s.green,blendimage->s.blue); } - - cur++; image++; blendimage++; } + + // Calculate a sort of "gradient" for the skincolor + // (Me splitting this into a function didn't work, so I had to ruin this entire function's groove...) + { + RGBA_t nextcolor; + UINT8 firsti, secondi, mul; + UINT32 r, g, b; + + firsti = ((UINT8)(255-brightness) / 16); + mul = ((UINT8)(255-brightness) % 16); + + blendcolor = V_GetColor(colortranslations[color][firsti]); + + if (mul > 0) // If it's 0, then we only need the first color. + { + secondi = firsti+1; + + if (secondi == 16) // blend to black + nextcolor = V_GetColor(31); + else + nextcolor = V_GetColor(colortranslations[color][secondi]); + + // Find difference between points + r = (UINT32)(nextcolor.s.red - blendcolor.s.red); + g = (UINT32)(nextcolor.s.green - blendcolor.s.green); + b = (UINT32)(nextcolor.s.blue - blendcolor.s.blue); + + // Find the gradient of the two points + r = ((mul * r) / 16); + g = ((mul * g) / 16); + b = ((mul * b) / 16); + + // Add gradient value to color + blendcolor.s.red += r; + blendcolor.s.green += g; + blendcolor.s.blue += b; + } + } + + if (skinnum == TC_RAINBOW) + { + // Directly set blendcolor + cur->s.red = blendcolor.s.red; + cur->s.green = blendcolor.s.green; + cur->s.blue = blendcolor.s.blue; + cur->s.alpha = image->s.alpha; + } + else + { + // Color strength depends on image alpha + INT32 tempcolor; + INT16 tempmult, tempalpha; + + tempalpha = -(abs(blendimage->s.red-127)-127)*2; + if (tempalpha > 255) + tempalpha = 255; + else if (tempalpha < 0) + tempalpha = 0; + + tempmult = (blendimage->s.red-127)*2; + if (tempmult > 255) + tempmult = 255; + else if (tempmult < 0) + tempmult = 0; + + tempcolor = (image->s.red*(255-blendimage->s.alpha))/255 + ((tempmult + ((tempalpha*blendcolor.s.red)/255)) * blendimage->s.alpha)/255; + cur->s.red = (UINT8)tempcolor; + + tempcolor = (image->s.green*(255-blendimage->s.alpha))/255 + ((tempmult + ((tempalpha*blendcolor.s.green)/255)) * blendimage->s.alpha)/255; + cur->s.green = (UINT8)tempcolor; + + tempcolor = (image->s.blue*(255-blendimage->s.alpha))/255 + ((tempmult + ((tempalpha*blendcolor.s.blue)/255)) * blendimage->s.alpha)/255; + cur->s.blue = (UINT8)tempcolor; + cur->s.alpha = image->s.alpha; + } + + cur++; image++; blendimage++; } return; diff --git a/src/k_kart.c b/src/k_kart.c index 659c499db..5ec49b444 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -410,7 +410,7 @@ UINT8 colortranslations[MAXTRANSLATIONS][16] = { // 0.0722 to blue // (See this same define in hw_md2.c!) #define SETBRIGHTNESS(brightness,r,g,b) \ - brightness = (UINT8)(((1063*((UINT16)r)/5000) + (3576*((UINT16)g)/5000) + (361*((UINT16)b)/5000)) / 3) + brightness = (UINT8)(((1063*(UINT16)(r))/5000) + ((3576*(UINT16)(g))/5000) + ((361*(UINT16)(b))/5000)) /** \brief Generates the rainbow colourmaps that are used when a player has the invincibility power From 179bb2bd8b1fe801c1817734f3451657162f96d8 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 26 May 2019 06:22:14 -0400 Subject: [PATCH 07/49] Update colorize blending Didn't notice for a moment that it was back to 2.0-style rainbow blending -- this is horrible but it keeps the brightness of the textures in-tact --- src/hardware/hw_md2.c | 89 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 81 insertions(+), 8 deletions(-) diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index cc69fad02..36d2a606f 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -728,15 +728,78 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, UINT8 firsti, secondi, mul; UINT32 r, g, b; - firsti = ((UINT8)(255-brightness) / 16); - mul = ((UINT8)(255-brightness) % 16); + // Rainbow needs to find the closest match to the textures themselves, instead of matching brightnesses to other colors. + // Ensue horrible mess. + if (skinnum == TC_RAINBOW) + { + UINT16 brightdif = 256; + UINT8 colorbrightnesses[16]; + INT32 compare, m, d; + UINT8 i; + + // Ignore pure white & pitch black + if (brightness > 246 || brightness < 7) + { + cur->rgba = image->rgba; + cur++; image++; blendimage++; + continue; + } + + firsti = 0; + mul = 0; + + for (i = 0; i < 16; i++) + { + RGBA_t tempc = V_GetColor(colortranslations[color][i]); + SETBRIGHTNESS(colorbrightnesses[i], tempc.s.red, tempc.s.green, tempc.s.blue); // store brightnesses for comparison + } + + for (i = 0; i < 16; i++) + { + if (brightness > colorbrightnesses[i]) // don't allow greater matches (because calculating a makeshift gradient for this is already a huge mess as is) + continue; + compare = abs((INT16)(colorbrightnesses[i]) - (INT16)(brightness)); + if (compare < brightdif) + { + brightdif = (UINT16)compare; + firsti = i; // best matching color that's equal brightness or darker + } + } + + secondi = firsti+1; // next color in line + if (secondi == 16) + { + m = (INT16)brightness; // - 0; + d = (INT16)colorbrightnesses[firsti]; // - 0; + } + else + { + m = (INT16)brightness - (INT16)colorbrightnesses[secondi]; + d = (INT16)colorbrightnesses[firsti] - (INT16)colorbrightnesses[secondi]; + } + + if (m >= d) + m = d-1; + + // calculate the "gradient" multiplier based on how close this color is to the one next in line + if (m <= 0 || d <= 0) + mul = 0; + else + mul = 15 - ((m * 16) / d); + } + else + { + // Thankfully, it's normally way more simple. + // Just convert brightness to a skincolor value, use remainder to find the gradient multipler + firsti = ((UINT8)(255-brightness) / 16); + secondi = firsti+1; + mul = ((UINT8)(255-brightness) % 16); + } blendcolor = V_GetColor(colortranslations[color][firsti]); if (mul > 0) // If it's 0, then we only need the first color. { - secondi = firsti+1; - if (secondi == 16) // blend to black nextcolor = V_GetColor(31); else @@ -761,10 +824,20 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, if (skinnum == TC_RAINBOW) { - // Directly set blendcolor - cur->s.red = blendcolor.s.red; - cur->s.green = blendcolor.s.green; - cur->s.blue = blendcolor.s.blue; + UINT32 tempcolor; + UINT16 colorbright = 127; // an arbitrary value now, since blendcolor is always changing + + tempcolor = (brightness * blendcolor.s.red) / colorbright; + tempcolor = min(255, tempcolor); + cur->s.red = (UINT8)tempcolor; + + tempcolor = (brightness * blendcolor.s.green) / colorbright; + tempcolor = min(255, tempcolor); + cur->s.green = (UINT8)tempcolor; + + tempcolor = (brightness * blendcolor.s.blue) / colorbright; + tempcolor = min(255, tempcolor); + cur->s.blue = (UINT8)tempcolor; cur->s.alpha = image->s.alpha; } else From ee60e6d76c326a22e57418708dacf0e49203a963 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 26 May 2019 07:44:40 -0400 Subject: [PATCH 08/49] Minor touchup to colorization code --- src/hardware/hw_md2.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index 36d2a606f..02594eb70 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -738,7 +738,7 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, UINT8 i; // Ignore pure white & pitch black - if (brightness > 246 || brightness < 7) + if (brightness > 253 || brightness < 2) { cur->rgba = image->rgba; cur++; image++; blendimage++; @@ -825,7 +825,11 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, if (skinnum == TC_RAINBOW) { UINT32 tempcolor; - UINT16 colorbright = 127; // an arbitrary value now, since blendcolor is always changing + UINT16 colorbright; + + SETBRIGHTNESS(colorbright,blendcolor.s.red,blendcolor.s.green,blendcolor.s.blue); + if (colorbright == 0) + colorbright = 1; // no dividing by 0 please tempcolor = (brightness * blendcolor.s.red) / colorbright; tempcolor = min(255, tempcolor); From e1d73d0e3502bf7bb44f428b82b1c8bb689375ae Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 26 May 2019 15:20:16 -0400 Subject: [PATCH 09/49] Tiny optimization --- src/hardware/hw_md2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index 02594eb70..561daf058 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -798,7 +798,8 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, blendcolor = V_GetColor(colortranslations[color][firsti]); - if (mul > 0) // If it's 0, then we only need the first color. + if (mul > 0 // If it's 0, then we only need the first color. + && colortranslations[color][firsti] != colortranslations[color][secondi]) // Some colors have duplicate colors in a row, so let's just save the process { if (secondi == 16) // blend to black nextcolor = V_GetColor(31); From c6a0a41d1a614a9ece8ae38d7699abe186a4cfa8 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 28 May 2019 17:21:22 -0400 Subject: [PATCH 10/49] Model tilts - Add modeltilt variable, for more manual control of the model tilting. By default this just copies standingslope, but doesn't get cleared in the air. - Shadows & trailing bananas now tilt to match the ground they are on. - Rocket Sneakers & afterimages now tilt to match the player's current orientation. --- src/hardware/hw_md2.c | 8 +-- src/k_kart.c | 83 +++++++++++++++++++++++++++ src/p_map.c | 12 +++- src/p_mobj.c | 129 +++++++++++++++++++++++++++++++++++++----- src/p_mobj.h | 3 + src/p_saveg.c | 5 ++ src/p_slopes.c | 6 ++ src/p_user.c | 6 +- 8 files changed, 233 insertions(+), 19 deletions(-) diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index 561daf058..b610d410c 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -1186,11 +1186,11 @@ void HWR_DrawMD2(gr_vissprite_t *spr) #ifdef USE_FTRANSFORM_ANGLEZ // Slope rotation from Kart p.anglez = 0.0f; - if (spr->mobj->standingslope) + if (spr->mobj->modeltilt) { - fixed_t tempz = spr->mobj->standingslope->normal.z; - fixed_t tempy = spr->mobj->standingslope->normal.y; - fixed_t tempx = spr->mobj->standingslope->normal.x; + fixed_t tempz = spr->mobj->modeltilt->normal.z; + fixed_t tempy = spr->mobj->modeltilt->normal.y; + fixed_t tempx = spr->mobj->modeltilt->normal.x; fixed_t tempangle = AngleFixed(R_PointToAngle2(0, 0, FixedSqrt(FixedMul(tempy, tempy) + FixedMul(tempz, tempz)), tempx)); p.anglez = FIXED_TO_FLOAT(tempangle); tempangle = -AngleFixed(R_PointToAngle2(0, 0, tempz, tempy)); diff --git a/src/k_kart.c b/src/k_kart.c index 5ec49b444..12c4f14e0 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4093,6 +4093,86 @@ static void K_MoveHeldObjects(player_t *player) if (R_PointToDist2(cur->x, cur->y, targx, targy) > 768*FRACUNIT) P_TeleportMove(cur, targx, targy, cur->z); +#ifdef ESLOPE + // We gotta do ALL of this... just so that bananas can tilt in OGL :V + if (P_IsObjectOnGround(cur)) + { + pslope_t *slope = NULL; + sector_t *sec = R_PointInSubsector(cur->x, cur->y)->sector; + boolean flip = (cur->eflags & MFE_VERTICALFLIP); + + if (flip) + { + if (sec->c_slope) + { + slope = sec->c_slope; + targz = P_GetZAt(sec->c_slope, cur->x, cur->y); + } + else + targz = sec->ceilingheight; + } + else + { + if (sec->f_slope) + { + slope = sec->f_slope; + targz = P_GetZAt(sec->f_slope, cur->x, cur->y); + } + else + targz = sec->floorheight; + } + + // Check FOFs for a better suited slope + if (sec->ffloors) + { + ffloor_t *rover; + + for (rover = sec->ffloors; rover; rover = rover->next) + { + fixed_t surface; + + if (!(rover->flags & FF_EXISTS)) + continue; + + if (!((rover->flags & FF_BLOCKOTHERS) || (rover->flags & FF_QUICKSAND)) || (rover->flags & FF_SWIMMABLE)) + continue; + + if (flip) + { + surface = *rover->bottomheight; + if (*rover->b_slope) + surface = P_GetZAt(*rover->b_slope, cur->x, cur->y); + + if (surface < targz && surface > (cur->z + cur->height)) + { + targz = surface; + if (*rover->b_slope) + slope = *rover->b_slope; + } + } + else + { + surface = *rover->topheight; + if (*rover->t_slope) + surface = P_GetZAt(*rover->t_slope, cur->x, cur->y); + + if (surface > targz && surface < cur->z) + { + targz = surface; + if (*rover->t_slope) + slope = *rover->t_slope; + } + } + } + } + + cur->standingslope = slope; +#ifdef HWRENDER + cur->modeltilt = cur->standingslope; +#endif + } +#endif + cur = cur->hnext; } } @@ -4182,6 +4262,9 @@ static void K_MoveHeldObjects(player_t *player) P_TeleportMove(cur, targx, targy, targz); K_FlipFromObject(cur, player->mo); // Update graviflip in real time thanks. +#ifdef HWRENDER + cur->modeltilt = player->mo->modeltilt; +#endif num = (num+1) % 2; cur = cur->hnext; } diff --git a/src/p_map.c b/src/p_map.c index 2c766349d..e7041afea 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2881,14 +2881,24 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) P_HandleSlopeLanding(thing, tmfloorslope); if (thing->momz <= 0) + { thing->standingslope = tmfloorslope; +#ifdef HWRENDER + thing->modeltilt = thing->standingslope; +#endif + } } else if (thing->z+thing->height >= tmceilingz && (thing->eflags & MFE_VERTICALFLIP)) { if (!startingonground && tmceilingslope) P_HandleSlopeLanding(thing, tmceilingslope); if (thing->momz >= 0) + { thing->standingslope = tmceilingslope; +#ifdef HWRENDER + thing->modeltilt = thing->standingslope; +#endif + } } } else // don't set standingslope if you're not going to clip against it @@ -4691,7 +4701,7 @@ fixed_t P_FloorzAtPos(fixed_t x, fixed_t y, fixed_t z, fixed_t height) if (!(rover->flags & FF_EXISTS)) continue; - if ((!(rover->flags & FF_SOLID || rover->flags & FF_QUICKSAND) || (rover->flags & FF_SWIMMABLE))) + if (!((rover->flags & FF_SOLID) || (rover->flags & FF_QUICKSAND)) || (rover->flags & FF_SWIMMABLE)) continue; topheight = *rover->topheight; diff --git a/src/p_mobj.c b/src/p_mobj.c index 1d0224590..dda3d045b 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1816,6 +1816,9 @@ void P_XYMovement(mobj_t *mo) // Now compare the Zs of the different quantizations if (oldangle-newangle > ANG30 && oldangle-newangle < ANGLE_180) { // Allow for a bit of sticking - this value can be adjusted later mo->standingslope = oldslope; +#ifdef HWRENDER + mo->modeltilt = mo->standingslope; +#endif P_SlopeLaunch(mo); //CONS_Printf("launched off of slope - "); @@ -2389,6 +2392,9 @@ static boolean P_ZMovement(mobj_t *mo) if (((mo->eflags & MFE_VERTICALFLIP) ? tmceilingslope : tmfloorslope) && (mo->type != MT_STEAM)) { mo->standingslope = (mo->eflags & MFE_VERTICALFLIP) ? tmceilingslope : tmfloorslope; +#ifdef HWRENDER + mo->modeltilt = mo->standingslope; +#endif P_ReverseQuantizeMomentumToSlope(&mom, mo->standingslope); } #endif @@ -6173,7 +6179,12 @@ void P_RunShadows(void) for (mobj = shadowcap; mobj; mobj = next) { - fixed_t floorz; + boolean flip; + fixed_t newz; + sector_t *sec; +#ifdef ESLOPE + pslope_t *slope = NULL; +#endif next = mobj->hnext; P_SetTarget(&mobj->hnext, NULL); @@ -6184,16 +6195,106 @@ void P_RunShadows(void) continue; // shouldn't you already be dead? } - if (mobj->target->player) - floorz = mobj->target->floorz; - else // FOR SOME REASON, plain floorz is not reliable for normal objects, only players?! - floorz = P_FloorzAtPos(mobj->target->x, mobj->target->y, mobj->target->z, mobj->target->height); - K_MatchGenericExtraFlags(mobj, mobj->target); + flip = (mobj->eflags & MFE_VERTICALFLIP); - if (((mobj->target->eflags & MFE_VERTICALFLIP) && mobj->target->z+mobj->target->height > mobj->target->ceilingz) - || (!(mobj->target->eflags & MFE_VERTICALFLIP) && mobj->target->z < floorz)) - mobj->flags2 |= MF2_DONTDRAW; + sec = R_PointInSubsector(mobj->target->x, mobj->target->y)->sector; + + if (flip) + { +#ifdef ESLOPE + if (sec->c_slope) + { + slope = sec->c_slope; + newz = P_GetZAt(sec->c_slope, mobj->target->x, mobj->target->y); + } + else +#endif + newz = sec->ceilingheight; + } + else + { +#ifdef ESLOPE + if (sec->f_slope) + { + slope = sec->f_slope; + newz = P_GetZAt(sec->f_slope, mobj->target->x, mobj->target->y); + } + else +#endif + newz = sec->floorheight; + } + + // Check FOFs for a better suited slope + if (sec->ffloors) + { + ffloor_t *rover; + + for (rover = sec->ffloors; rover; rover = rover->next) + { + fixed_t surface; + + if (!(rover->flags & FF_EXISTS)) + continue; + + if ((!(((rover->flags & FF_BLOCKPLAYER && mobj->target->player) + || (rover->flags & FF_BLOCKOTHERS && !mobj->target->player)) + || (rover->flags & FF_QUICKSAND)) + || (rover->flags & FF_SWIMMABLE))) + continue; + + if (flip) + { + surface = *rover->bottomheight; +#ifdef ESLOPE + if (*rover->b_slope) + surface = P_GetZAt(*rover->b_slope, mobj->target->x, mobj->target->y); +#endif + + if (surface < newz && surface > (mobj->target->z + mobj->target->height)) + { + newz = surface; +#ifdef ESLOPE + if (*rover->b_slope) + slope = *rover->b_slope; +#endif + } + } + else + { + surface = *rover->topheight; +#ifdef ESLOPE + if (*rover->t_slope) + surface = P_GetZAt(*rover->t_slope, mobj->target->x, mobj->target->y); +#endif + + if (surface > newz && surface < mobj->target->z) + { + newz = surface; +#ifdef ESLOPE + if (*rover->t_slope) + slope = *rover->t_slope; +#endif + } + } + } + } + + mobj->standingslope = slope; +#ifdef HWRENDER + mobj->modeltilt = mobj->standingslope; +#endif + + if (flip) + { + if ((mobj->target->z + mobj->target->height) > newz) + mobj->flags2 |= MF2_DONTDRAW; + } + else + { + if (mobj->target->z < newz) + mobj->flags2 |= MF2_DONTDRAW; + } // First scale to the same radius P_SetScale(mobj, FixedDiv(mobj->target->radius, mobj->info->radius)); @@ -6205,13 +6306,12 @@ void P_RunShadows(void) P_TeleportMove(mobj, dest->x, dest->y, mobj->target->z); - if (((mobj->eflags & MFE_VERTICALFLIP) && (mobj->ceilingz > mobj->z+mobj->height)) - || (!(mobj->eflags & MFE_VERTICALFLIP) && (floorz < mobj->z))) + if ((flip && newz > (mobj->z + mobj->height)) || (!flip && newz < mobj->z)) { INT32 i; fixed_t prevz; - mobj->z = (mobj->eflags & MFE_VERTICALFLIP ? mobj->ceilingz : floorz); + mobj->z = newz; for (i = 0; i < MAXFFLOORS; i++) { @@ -6223,7 +6323,7 @@ void P_RunShadows(void) // Check new position to see if you should still be on that ledge P_TeleportMove(mobj, dest->x, dest->y, mobj->z); - mobj->z = (mobj->eflags & MFE_VERTICALFLIP ? mobj->ceilingz : floorz); + mobj->z = newz; if (mobj->z == prevz) break; @@ -8132,6 +8232,9 @@ void P_MobjThinker(mobj_t *mobj) P_TeleportMove(mobj, mobj->target->x + P_ReturnThrustX(mobj, mobj->angle+ANGLE_180, mobj->target->radius), mobj->target->y + P_ReturnThrustY(mobj, mobj->angle+ANGLE_180, mobj->target->radius), mobj->target->z); P_SetScale(mobj, mobj->target->scale); +#ifdef HWRENDER + mobj->modeltilt = mobj->target->modeltilt; +#endif { player_t *p = NULL; diff --git a/src/p_mobj.h b/src/p_mobj.h index dfc8fc738..aec2ed951 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -370,6 +370,9 @@ typedef struct mobj_s #ifdef ESLOPE struct pslope_s *standingslope; // The slope that the object is standing on (shouldn't need synced in savegames, right?) +#ifdef HWRENDER + struct pslope_s *modeltilt; // Slope used for model tilting. Also is not synched, this is totally visual. +#endif #endif boolean colorized; // Whether the mobj uses the rainbow colormap diff --git a/src/p_saveg.c b/src/p_saveg.c index 7d2e9a307..a3b80633a 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -2144,7 +2144,12 @@ static void LoadMobjThinker(actionf_p1 thinker) mobj->hprev = (mobj_t *)(size_t)READUINT32(save_p); #ifdef ESLOPE if (diff2 & MD2_SLOPE) + { mobj->standingslope = P_SlopeById(READUINT16(save_p)); +#ifdef HWRENDER + mobj->modeltilt = mobj->standingslope; +#endif + } #endif if (diff2 & MD2_COLORIZED) mobj->colorized = READUINT8(save_p); diff --git a/src/p_slopes.c b/src/p_slopes.c index 76af7bfde..47e624da9 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -827,6 +827,9 @@ void P_HandleSlopeLanding(mobj_t *thing, pslope_t *slope) if (P_MobjFlip(thing)*(thing->momz) < 0) { // falling, land on slope thing->momz = -P_MobjFlip(thing); thing->standingslope = slope; +#ifdef HWRENDER + thing->modeltilt = thing->standingslope; +#endif } return; } @@ -843,6 +846,9 @@ void P_HandleSlopeLanding(mobj_t *thing, pslope_t *slope) thing->momz = -P_MobjFlip(thing); thing->standingslope = slope; +#ifdef HWRENDER + thing->modeltilt = thing->standingslope; +#endif } } diff --git a/src/p_user.c b/src/p_user.c index 61d8f36f3..6802a9120 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1675,12 +1675,16 @@ mobj_t *P_SpawnGhostMobj(mobj_t *mobj) ghost->frame |= tr_trans50<fuse = ghost->info->damage; ghost->skin = mobj->skin; + ghost->standingslope = mobj->standingslope; +#ifdef HWRENDER + ghost->modeltilt = mobj->modeltilt; +#endif if (mobj->flags2 & MF2_OBJECTFLIP) ghost->flags |= MF2_OBJECTFLIP; if (!(mobj->flags & MF_DONTENCOREMAP)) - mobj->flags &= ~MF_DONTENCOREMAP; + ghost->flags &= ~MF_DONTENCOREMAP; return ghost; } From f3f0b5eddaf97e1621d84f3285bac297e5e31358 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 30 May 2019 03:07:31 -0400 Subject: [PATCH 11/49] Fix FOF shadows again --- src/p_mobj.c | 69 +++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 52 insertions(+), 17 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index a58ff3387..67f540fde 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6264,7 +6264,8 @@ void P_RunShadows(void) for (rover = sec->ffloors; rover; rover = rover->next) { - fixed_t surface; + fixed_t top, bottom; + fixed_t d1, d2; if (!(rover->flags & FF_EXISTS)) continue; @@ -6275,17 +6276,41 @@ void P_RunShadows(void) || (rover->flags & FF_SWIMMABLE))) continue; +#ifdef ESLOPE + if (*rover->t_slope) + top = P_GetZAt(*rover->t_slope, mobj->target->x, mobj->target->y); + else +#endif + top = *rover->topheight; + +#ifdef ESLOPE + if (*rover->b_slope) + bottom = P_GetZAt(*rover->b_slope, mobj->target->x, mobj->target->y); + else +#endif + bottom = *rover->bottomheight; + if (flip) { - surface = *rover->bottomheight; -#ifdef ESLOPE - if (*rover->b_slope) - surface = P_GetZAt(*rover->b_slope, mobj->target->x, mobj->target->y); -#endif - - if (surface < newz && surface > (mobj->target->z + mobj->target->height)) + if (rover->flags & FF_QUICKSAND) { - newz = surface; + if (mobj->target->z < top && (mobj->target->z + mobj->target->height) > bottom) + { + if (newz > (mobj->target->z + mobj->target->height)) + { + newz = (mobj->target->z + mobj->target->height); + slope = NULL; + } + } + continue; + } + + d1 = (mobj->target->z + mobj->target->height) - (top + ((bottom - top)/2)); + d2 = mobj->target->z - (top + ((bottom - top)/2)); + + if (bottom < newz && abs(d1) < abs(d2)) + { + newz = bottom; #ifdef ESLOPE if (*rover->b_slope) slope = *rover->b_slope; @@ -6294,15 +6319,25 @@ void P_RunShadows(void) } else { - surface = *rover->topheight; -#ifdef ESLOPE - if (*rover->t_slope) - surface = P_GetZAt(*rover->t_slope, mobj->target->x, mobj->target->y); -#endif - - if (surface > newz && surface < mobj->target->z) + if (rover->flags & FF_QUICKSAND) { - newz = surface; + if (mobj->target->z < top && (mobj->target->z + mobj->target->height) > bottom) + { + if (newz < mobj->target->z) + { + newz = mobj->target->z; + slope = NULL; + } + } + continue; + } + + d1 = mobj->target->z - (bottom + ((top - bottom)/2)); + d2 = (mobj->target->z + mobj->target->height) - (bottom + ((top - bottom)/2)); + + if (top > newz && abs(d1) < abs(d2)) + { + newz = top; #ifdef ESLOPE if (*rover->t_slope) slope = *rover->t_slope; From 24feb8167195ab18bd556dea102a2ea8d582478d Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Fri, 31 May 2019 01:08:04 -0400 Subject: [PATCH 12/49] Improve shadow code yet again by testing highest value of slopes This makes it follow the sprites a bit better on slopes. Also split into a sub-function so that Banana doesn't need the duplicated code anymore. The accuracy can be further improved on by doing the calculation 3 extra times for every surface, for each corner of the hitbox -- it wouldn't be THAT much more expensive, but it would only make subtle differences on sector boundaries that we usually zoom past anyway, so I figured it wasn't worth it. (It'll be easy enough to do so if we decide that we want the uber-accuracy) --- src/k_kart.c | 77 +------------ src/p_local.h | 1 + src/p_mobj.c | 291 ++++++++++++++++++++++++++++---------------------- 3 files changed, 170 insertions(+), 199 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index b3c75a599..45c8652c8 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4527,82 +4527,11 @@ static void K_MoveHeldObjects(player_t *player) P_TeleportMove(cur, targx, targy, cur->z); #ifdef ESLOPE - // We gotta do ALL of this... just so that bananas can tilt in OGL :V if (P_IsObjectOnGround(cur)) { - pslope_t *slope = NULL; - sector_t *sec = R_PointInSubsector(cur->x, cur->y)->sector; - boolean flip = (cur->eflags & MFE_VERTICALFLIP); - - if (flip) - { - if (sec->c_slope) - { - slope = sec->c_slope; - targz = P_GetZAt(sec->c_slope, cur->x, cur->y); - } - else - targz = sec->ceilingheight; - } - else - { - if (sec->f_slope) - { - slope = sec->f_slope; - targz = P_GetZAt(sec->f_slope, cur->x, cur->y); - } - else - targz = sec->floorheight; - } - - // Check FOFs for a better suited slope - if (sec->ffloors) - { - ffloor_t *rover; - - for (rover = sec->ffloors; rover; rover = rover->next) - { - fixed_t surface; - - if (!(rover->flags & FF_EXISTS)) - continue; - - if (!((rover->flags & FF_BLOCKOTHERS) || (rover->flags & FF_QUICKSAND)) || (rover->flags & FF_SWIMMABLE)) - continue; - - if (flip) - { - surface = *rover->bottomheight; - if (*rover->b_slope) - surface = P_GetZAt(*rover->b_slope, cur->x, cur->y); - - if (surface < targz && surface > (cur->z + cur->height)) - { - targz = surface; - if (*rover->b_slope) - slope = *rover->b_slope; - } - } - else - { - surface = *rover->topheight; - if (*rover->t_slope) - surface = P_GetZAt(*rover->t_slope, cur->x, cur->y); - - if (surface > targz && surface < cur->z) - { - targz = surface; - if (*rover->t_slope) - slope = *rover->t_slope; - } - } - } - } - - cur->standingslope = slope; -#ifdef HWRENDER - cur->modeltilt = cur->standingslope; -#endif + // Slope values are set in the function, but we DON'T want to use its return value. + P_CalculateShadowFloor(cur, cur->x, cur->y, cur->z, + cur->radius, cur->height, (cur->eflags & MFE_VERTICALFLIP), false); } #endif diff --git a/src/p_local.h b/src/p_local.h index bc25affd4..d4da9fe29 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -227,6 +227,7 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state); boolean P_SetMobjState(mobj_t *mobj, statenum_t state); //void P_RunShields(void); void P_RunOverlays(void); +fixed_t P_CalculateShadowFloor(mobj_t *mobj, fixed_t x, fixed_t y, fixed_t z, fixed_t radius, fixed_t height, boolean flip, boolean player); void P_RunShadows(void); void P_MobjThinker(mobj_t *mobj); boolean P_RailThinker(mobj_t *mobj); diff --git a/src/p_mobj.c b/src/p_mobj.c index 67f540fde..c2a14cd45 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6205,6 +6205,170 @@ static void P_RemoveOverlay(mobj_t *thing) } } +// Simplified version of a code bit in P_MobjFloorZ +static fixed_t P_ShadowSlopeZ(pslope_t *slope, fixed_t x, fixed_t y, fixed_t radius, boolean ceiling) +{ + fixed_t testx, testy; + + if (slope->d.x < 0) + testx = radius; + else + testx = -radius; + + if (slope->d.y < 0) + testy = radius; + else + testy = -radius; + + if ((slope->zdelta > 0) ^ !!(ceiling)) + { + testx = -testx; + testy = -testy; + } + + testx += x; + testy += y; + + return P_GetZAt(slope, testx, testy); +} + +// Sets standingslope/modeltilt, returns z position for shadows; used also for stuff like bananas +// (I would've preferred to be able to return both the slope & z, but I'll take what I can get...) +fixed_t P_CalculateShadowFloor(mobj_t *mobj, fixed_t x, fixed_t y, fixed_t z, fixed_t radius, fixed_t height, boolean flip, boolean player) +{ + fixed_t newz; + sector_t *sec; +#ifdef ESLOPE + pslope_t *slope = NULL; +#endif + + sec = R_PointInSubsector(x, y)->sector; + + if (flip) + { +#ifdef ESLOPE + if (sec->c_slope) + { + slope = sec->c_slope; + newz = P_ShadowSlopeZ(slope, x, y, radius, true); + } + else +#endif + newz = sec->ceilingheight; + } + else + { +#ifdef ESLOPE + if (sec->f_slope) + { + slope = sec->f_slope; + newz = P_ShadowSlopeZ(slope, x, y, radius, false); + } + else +#endif + newz = sec->floorheight; + } + + // Check FOFs for a better suited slope + if (sec->ffloors) + { + ffloor_t *rover; + + for (rover = sec->ffloors; rover; rover = rover->next) + { + fixed_t top, bottom; + fixed_t d1, d2; + + if (!(rover->flags & FF_EXISTS)) + continue; + + if ((!(((rover->flags & FF_BLOCKPLAYER && player) + || (rover->flags & FF_BLOCKOTHERS && !player)) + || (rover->flags & FF_QUICKSAND)) + || (rover->flags & FF_SWIMMABLE))) + continue; + +#ifdef ESLOPE + if (*rover->t_slope) + top = P_ShadowSlopeZ(*rover->t_slope, x, y, radius, false); + else +#endif + top = *rover->topheight; + +#ifdef ESLOPE + if (*rover->b_slope) + bottom = P_ShadowSlopeZ(*rover->b_slope, x, y, radius, true); + else +#endif + bottom = *rover->bottomheight; + + if (flip) + { + if (rover->flags & FF_QUICKSAND) + { + if (z < top && (z + height) > bottom) + { + if (newz > (z + height)) + { + newz = (z + height); + slope = NULL; + } + } + continue; + } + + d1 = (z + height) - (top + ((bottom - top)/2)); + d2 = z - (top + ((bottom - top)/2)); + + if (bottom < newz && abs(d1) < abs(d2)) + { + newz = bottom; +#ifdef ESLOPE + if (*rover->b_slope) + slope = *rover->b_slope; +#endif + } + } + else + { + if (rover->flags & FF_QUICKSAND) + { + if (z < top && (z + height) > bottom) + { + if (newz < z) + { + newz = z; + slope = NULL; + } + } + continue; + } + + d1 = z - (bottom + ((top - bottom)/2)); + d2 = (z + height) - (bottom + ((top - bottom)/2)); + + if (top > newz && abs(d1) < abs(d2)) + { + newz = top; +#ifdef ESLOPE + if (*rover->t_slope) + slope = *rover->t_slope; +#endif + } + } + } + } + +#if 0 + mobj->standingslope = slope; +#endif +#ifdef HWRENDER + mobj->modeltilt = slope; +#endif + + return newz; +} + void P_RunShadows(void) { mobj_t *mobj, *next, *dest; @@ -6213,10 +6377,6 @@ void P_RunShadows(void) { boolean flip; fixed_t newz; - sector_t *sec; -#ifdef ESLOPE - pslope_t *slope = NULL; -#endif next = mobj->hnext; P_SetTarget(&mobj->hnext, NULL); @@ -6230,127 +6390,8 @@ void P_RunShadows(void) K_MatchGenericExtraFlags(mobj, mobj->target); flip = (mobj->eflags & MFE_VERTICALFLIP); - sec = R_PointInSubsector(mobj->target->x, mobj->target->y)->sector; - - if (flip) - { -#ifdef ESLOPE - if (sec->c_slope) - { - slope = sec->c_slope; - newz = P_GetZAt(sec->c_slope, mobj->target->x, mobj->target->y); - } - else -#endif - newz = sec->ceilingheight; - } - else - { -#ifdef ESLOPE - if (sec->f_slope) - { - slope = sec->f_slope; - newz = P_GetZAt(sec->f_slope, mobj->target->x, mobj->target->y); - } - else -#endif - newz = sec->floorheight; - } - - // Check FOFs for a better suited slope - if (sec->ffloors) - { - ffloor_t *rover; - - for (rover = sec->ffloors; rover; rover = rover->next) - { - fixed_t top, bottom; - fixed_t d1, d2; - - if (!(rover->flags & FF_EXISTS)) - continue; - - if ((!(((rover->flags & FF_BLOCKPLAYER && mobj->target->player) - || (rover->flags & FF_BLOCKOTHERS && !mobj->target->player)) - || (rover->flags & FF_QUICKSAND)) - || (rover->flags & FF_SWIMMABLE))) - continue; - -#ifdef ESLOPE - if (*rover->t_slope) - top = P_GetZAt(*rover->t_slope, mobj->target->x, mobj->target->y); - else -#endif - top = *rover->topheight; - -#ifdef ESLOPE - if (*rover->b_slope) - bottom = P_GetZAt(*rover->b_slope, mobj->target->x, mobj->target->y); - else -#endif - bottom = *rover->bottomheight; - - if (flip) - { - if (rover->flags & FF_QUICKSAND) - { - if (mobj->target->z < top && (mobj->target->z + mobj->target->height) > bottom) - { - if (newz > (mobj->target->z + mobj->target->height)) - { - newz = (mobj->target->z + mobj->target->height); - slope = NULL; - } - } - continue; - } - - d1 = (mobj->target->z + mobj->target->height) - (top + ((bottom - top)/2)); - d2 = mobj->target->z - (top + ((bottom - top)/2)); - - if (bottom < newz && abs(d1) < abs(d2)) - { - newz = bottom; -#ifdef ESLOPE - if (*rover->b_slope) - slope = *rover->b_slope; -#endif - } - } - else - { - if (rover->flags & FF_QUICKSAND) - { - if (mobj->target->z < top && (mobj->target->z + mobj->target->height) > bottom) - { - if (newz < mobj->target->z) - { - newz = mobj->target->z; - slope = NULL; - } - } - continue; - } - - d1 = mobj->target->z - (bottom + ((top - bottom)/2)); - d2 = (mobj->target->z + mobj->target->height) - (bottom + ((top - bottom)/2)); - - if (top > newz && abs(d1) < abs(d2)) - { - newz = top; -#ifdef ESLOPE - if (*rover->t_slope) - slope = *rover->t_slope; -#endif - } - } - } - } - - mobj->standingslope = slope; -#ifdef HWRENDER - mobj->modeltilt = mobj->standingslope; -#endif + newz = P_CalculateShadowFloor(mobj, mobj->target->x, mobj->target->y, mobj->target->z, + mobj->target->radius, mobj->target->height, flip, (mobj->target->player != NULL)); if (flip) { From de62209d966c1d952b6a3b78cd733dcb3354d1c0 Mon Sep 17 00:00:00 2001 From: Sryder Date: Fri, 5 Jul 2019 20:34:36 +0100 Subject: [PATCH 13/49] Orbinaut supports slopes, slows down naturally when above top speed. Still has it's speed reset lower when hitting a wall. Doesn't maintain slope speed increase. --- src/p_mobj.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 9919b2266..470615101 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1937,7 +1937,7 @@ void P_XYMovement(mobj_t *mo) #endif //{ SRB2kart stuff - if (mo->type == MT_ORBINAUT || mo->type == MT_JAWZ_DUD || mo->type == MT_JAWZ || mo->type == MT_BALLHOG || mo->type == MT_FLINGRING) //(mo->type == MT_JAWZ && !mo->tracer)) + if (mo->type == MT_JAWZ_DUD || mo->type == MT_JAWZ || mo->type == MT_BALLHOG || mo->type == MT_FLINGRING) //(mo->type == MT_JAWZ && !mo->tracer)) return; if (mo->player && (mo->player->kartstuff[k_spinouttimer] && !mo->player->kartstuff[k_wipeoutslow]) && mo->player->speed <= K_GetKartSpeed(mo->player, false)/2) @@ -7935,6 +7935,8 @@ void P_MobjThinker(mobj_t *mobj) else { fixed_t finalspeed = mobj->movefactor; + const fixed_t currentspeed = R_PointToDist2(0, 0, mobj->momx, mobj->momy); + fixed_t thrustamount = 0; mobj_t *ghost = P_SpawnGhostMobj(mobj); ghost->colorized = true; // already has color! @@ -7946,7 +7948,24 @@ void P_MobjThinker(mobj_t *mobj) finalspeed = FixedMul(finalspeed, FRACUNIT-FRACUNIT/4); } - P_InstaThrust(mobj, mobj->angle, finalspeed); + if (currentspeed >= finalspeed) + { + const fixed_t frictionsafety = (mobj->friction == 0) ? 1 : mobj->friction; + // Thrust as if you were at top speed, slow down naturally + thrustamount = FixedDiv(finalspeed, frictionsafety) - finalspeed; + } + else + { + const fixed_t frictionsafety = (mobj->friction == 0) ? 1 : mobj->friction; + const fixed_t beatfriction = FixedDiv(currentspeed, frictionsafety) - currentspeed; + // Thrust to immediately get to top speed + thrustamount = beatfriction + FixedDiv(finalspeed - currentspeed, frictionsafety); + } + + + P_Thrust(mobj, mobj->angle, thrustamount); + + if (grounded) { @@ -9439,7 +9458,8 @@ for (i = ((mobj->flags2 & MF2_STRONGBOX) ? strongboxamt : weakboxamt); i; --i) s || mobj->type == MT_BIGTUMBLEWEED || mobj->type == MT_LITTLETUMBLEWEED || mobj->type == MT_CANNONBALLDECOR - || mobj->type == MT_FALLINGROCK) { + || mobj->type == MT_FALLINGROCK + || mobj->type == MT_ORBINAUT) { P_TryMove(mobj, mobj->x, mobj->y, true); // Sets mo->standingslope correctly //if (mobj->standingslope) CONS_Printf("slope physics on mobj\n"); P_ButteredSlope(mobj); From 893d8cd211e80a0e828d02727b7407feeaa69acf Mon Sep 17 00:00:00 2001 From: Sryder Date: Fri, 5 Jul 2019 21:11:13 +0100 Subject: [PATCH 14/49] Support Jawz dud on slopes Don't let orbinaut accelerate infinitely when in the air. --- src/p_mobj.c | 41 +++++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 470615101..6af652028 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1937,7 +1937,7 @@ void P_XYMovement(mobj_t *mo) #endif //{ SRB2kart stuff - if (mo->type == MT_JAWZ_DUD || mo->type == MT_JAWZ || mo->type == MT_BALLHOG || mo->type == MT_FLINGRING) //(mo->type == MT_JAWZ && !mo->tracer)) + if (mo->type == MT_JAWZ || mo->type == MT_BALLHOG || mo->type == MT_FLINGRING) //(mo->type == MT_JAWZ && !mo->tracer)) return; if (mo->player && (mo->player->kartstuff[k_spinouttimer] && !mo->player->kartstuff[k_wipeoutslow]) && mo->player->speed <= K_GetKartSpeed(mo->player, false)/2) @@ -7937,9 +7937,16 @@ void P_MobjThinker(mobj_t *mobj) fixed_t finalspeed = mobj->movefactor; const fixed_t currentspeed = R_PointToDist2(0, 0, mobj->momx, mobj->momy); fixed_t thrustamount = 0; + fixed_t frictionsafety = (mobj->friction == 0) ? 1 : mobj->friction; mobj_t *ghost = P_SpawnGhostMobj(mobj); ghost->colorized = true; // already has color! + if (!grounded) + { + // No friction in the air + frictionsafety = FRACUNIT; + } + mobj->angle = R_PointToAngle2(0, 0, mobj->momx, mobj->momy); if (mobj->health <= 5) { @@ -7950,23 +7957,19 @@ void P_MobjThinker(mobj_t *mobj) if (currentspeed >= finalspeed) { - const fixed_t frictionsafety = (mobj->friction == 0) ? 1 : mobj->friction; + // Thrust as if you were at top speed, slow down naturally thrustamount = FixedDiv(finalspeed, frictionsafety) - finalspeed; } else { - const fixed_t frictionsafety = (mobj->friction == 0) ? 1 : mobj->friction; const fixed_t beatfriction = FixedDiv(currentspeed, frictionsafety) - currentspeed; // Thrust to immediately get to top speed thrustamount = beatfriction + FixedDiv(finalspeed - currentspeed, frictionsafety); } - P_Thrust(mobj, mobj->angle, thrustamount); - - if (grounded) { sector_t *sec2 = P_ThingOnSpecial3DFloor(mobj); @@ -8061,6 +8064,9 @@ void P_MobjThinker(mobj_t *mobj) else { mobj_t *ghost = P_SpawnGhostMobj(mobj); + const fixed_t currentspeed = R_PointToDist2(0, 0, mobj->momx, mobj->momy); + fixed_t frictionsafety = (mobj->friction == 0) ? 1 : mobj->friction; + fixed_t thrustamount = 0; if (mobj->target && !P_MobjWasRemoved(mobj->target) && mobj->target->player) { @@ -8068,8 +8074,26 @@ void P_MobjThinker(mobj_t *mobj) ghost->colorized = true; } + if (!grounded) + { + // No friction in the air + frictionsafety = FRACUNIT; + } + + if (currentspeed >= mobj->movefactor) + { + // Thrust as if you were at top speed, slow down naturally + thrustamount = FixedDiv(mobj->movefactor, frictionsafety) - mobj->movefactor; + } + else + { + const fixed_t beatfriction = FixedDiv(currentspeed, frictionsafety) - currentspeed; + // Thrust to immediately get to top speed + thrustamount = beatfriction + FixedDiv(mobj->movefactor - currentspeed, frictionsafety); + } + mobj->angle = R_PointToAngle2(0, 0, mobj->momx, mobj->momy); - P_InstaThrust(mobj, mobj->angle, mobj->movefactor); + P_Thrust(mobj, mobj->angle, thrustamount); if (grounded) { @@ -9459,7 +9483,8 @@ for (i = ((mobj->flags2 & MF2_STRONGBOX) ? strongboxamt : weakboxamt); i; --i) s || mobj->type == MT_LITTLETUMBLEWEED || mobj->type == MT_CANNONBALLDECOR || mobj->type == MT_FALLINGROCK - || mobj->type == MT_ORBINAUT) { + || mobj->type == MT_ORBINAUT + || mobj->type == MT_JAWZ_DUD) { P_TryMove(mobj, mobj->x, mobj->y, true); // Sets mo->standingslope correctly //if (mobj->standingslope) CONS_Printf("slope physics on mobj\n"); P_ButteredSlope(mobj); From d6ec65de5991e8a5fe59cc040c7617b3729b84c0 Mon Sep 17 00:00:00 2001 From: Sryder Date: Fri, 5 Jul 2019 23:29:31 +0100 Subject: [PATCH 15/49] Added some slope handling for regular jawz. Jawz as a result can absolutely behave differently, but it's mostly the case when in the range where it would slow down. Will need testing, seems like it can sometimes rocket past a player that's stationary, maybe that's not a bad thing? --- src/p_mobj.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 6af652028..c22d029cc 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1937,7 +1937,7 @@ void P_XYMovement(mobj_t *mo) #endif //{ SRB2kart stuff - if (mo->type == MT_JAWZ || mo->type == MT_BALLHOG || mo->type == MT_FLINGRING) //(mo->type == MT_JAWZ && !mo->tracer)) + if (mo->type == MT_BALLHOG || mo->type == MT_FLINGRING) //(mo->type == MT_JAWZ && !mo->tracer)) return; if (mo->player && (mo->player->kartstuff[k_spinouttimer] && !mo->player->kartstuff[k_wipeoutslow]) && mo->player->speed <= K_GetKartSpeed(mo->player, false)/2) @@ -7957,7 +7957,6 @@ void P_MobjThinker(mobj_t *mobj) if (currentspeed >= finalspeed) { - // Thrust as if you were at top speed, slow down naturally thrustamount = FixedDiv(finalspeed, frictionsafety) - finalspeed; } @@ -7993,6 +7992,9 @@ void P_MobjThinker(mobj_t *mobj) fixed_t topspeed = mobj->movefactor; fixed_t distbarrier = 512*mapobjectscale; fixed_t distaway; + const fixed_t currentspeed = R_PointToDist2(0, 0, mobj->momx, mobj->momy); + fixed_t thrustamount = 0; + fixed_t frictionsafety = (mobj->friction == 0) ? 1 : mobj->friction; mobj_t *ghost = P_SpawnGhostMobj(mobj); if (mobj->target && !P_MobjWasRemoved(mobj->target) && mobj->target->player) @@ -8008,6 +8010,12 @@ void P_MobjThinker(mobj_t *mobj) distbarrier = FixedMul(distbarrier, FRACUNIT + ((gamespeed-1) * (FRACUNIT/4))); + if (!P_IsObjectOnGround(mobj)) + { + // No friction in the air + frictionsafety = FRACUNIT; + } + if (G_RaceGametype() && mobj->tracer) { distaway = P_AproxDistance(mobj->tracer->x - mobj->x, mobj->tracer->y - mobj->y); @@ -8021,17 +8029,21 @@ void P_MobjThinker(mobj_t *mobj) } } - if (G_BattleGametype()) + // Don't thrust at ALL if we're in the barrier range and above top speed, harsher slowdown + if ((currentspeed >= topspeed) && topspeed == mobj->movefactor) { - mobj->friction -= 1228; - if (mobj->friction > FRACUNIT) - mobj->friction = FRACUNIT; - if (mobj->friction < 0) - mobj->friction = 0; + // Thrust as if you were at top speed, slow down naturally + thrustamount = FixedDiv(topspeed, frictionsafety) - topspeed; + } + else + { + const fixed_t beatfriction = FixedDiv(currentspeed, frictionsafety) - currentspeed; + // Thrust to immediately get to top speed + thrustamount = beatfriction + FixedDiv(topspeed - currentspeed, frictionsafety); } mobj->angle = R_PointToAngle2(0, 0, mobj->momx, mobj->momy); - P_InstaThrust(mobj, mobj->angle, topspeed); + P_Thrust(mobj, mobj->angle, thrustamount); if (mobj->tracer) mobj->angle = R_PointToAngle2(mobj->x, mobj->y, mobj->tracer->x, mobj->tracer->y); @@ -9484,7 +9496,7 @@ for (i = ((mobj->flags2 & MF2_STRONGBOX) ? strongboxamt : weakboxamt); i; --i) s || mobj->type == MT_CANNONBALLDECOR || mobj->type == MT_FALLINGROCK || mobj->type == MT_ORBINAUT - || mobj->type == MT_JAWZ_DUD) { + || mobj->type == MT_JAWZ || mobj->type == MT_JAWZ_DUD) { P_TryMove(mobj, mobj->x, mobj->y, true); // Sets mo->standingslope correctly //if (mobj->standingslope) CONS_Printf("slope physics on mobj\n"); P_ButteredSlope(mobj); From fbc5b9f8803d20f6ff5d9c583548fb5ae3998b8a Mon Sep 17 00:00:00 2001 From: Sryder Date: Sun, 7 Jul 2019 15:24:32 +0100 Subject: [PATCH 16/49] Added () for slight clarity --- src/p_mobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index c22d029cc..f9bfc807b 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8030,7 +8030,7 @@ void P_MobjThinker(mobj_t *mobj) } // Don't thrust at ALL if we're in the barrier range and above top speed, harsher slowdown - if ((currentspeed >= topspeed) && topspeed == mobj->movefactor) + if ((currentspeed >= topspeed) && (topspeed == mobj->movefactor)) { // Thrust as if you were at top speed, slow down naturally thrustamount = FixedDiv(topspeed, frictionsafety) - topspeed; From d6382107d378892f4005977425d394a21ed3f7c4 Mon Sep 17 00:00:00 2001 From: Sryder Date: Sun, 7 Jul 2019 21:56:23 +0100 Subject: [PATCH 17/49] Hopefully better Jawz behaviour Moved the movement code for it out of the thinker and into A_JawzChase to have it all in a consistent place. --- src/p_enemy.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++++-- src/p_mobj.c | 48 +-------------------------- 2 files changed, 90 insertions(+), 50 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 7baca2adc..14eea8135 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -8309,7 +8309,11 @@ void A_ItemPop(mobj_t *actor) void A_JawzChase(mobj_t *actor) { + const fixed_t currentspeed = R_PointToDist2(0, 0, actor->momx, actor->momy); player_t *player; + fixed_t thrustamount = 0; + fixed_t frictionsafety = (actor->friction == 0) ? 1 : actor->friction; + fixed_t topspeed = actor->movefactor; #ifdef HAVE_BLUA if (LUA_CallAction("A_JawzChase", actor)) return; @@ -8322,20 +8326,102 @@ void A_JawzChase(mobj_t *actor) if (actor->tracer->health) { + const angle_t targetangle = R_PointToAngle2(actor->x, actor->y, actor->tracer->x, actor->tracer->y); mobj_t *ret; + angle_t angledelta = actor->angle - targetangle; + boolean turnclockwise = true; + + if (G_RaceGametype()) + { + const fixed_t distbarrier = FixedMul(512*mapobjectscale, FRACUNIT + ((gamespeed-1) * (FRACUNIT/4))); + const fixed_t distaway = P_AproxDistance(actor->tracer->x - actor->x, actor->tracer->y - actor->y); + if (distaway < distbarrier) + { + if (actor->tracer->player) + { + fixed_t speeddifference = abs(topspeed - min(actor->tracer->player->speed, K_GetKartSpeed(actor->tracer->player, false))); + topspeed = topspeed - FixedMul(speeddifference, FRACUNIT-FixedDiv(distaway, distbarrier)); + } + } + } + + if (angledelta != 0) + { + angle_t MAX_JAWZ_TURN = ANGLE_90/15; // We can turn a maximum of 6 degrees per frame at regular max speed + // MAX_JAWZ_TURN gets stronger the slower the top speed of jawz + if (topspeed < actor->movefactor) + { + if (topspeed == 0) + { + MAX_JAWZ_TURN = ANGLE_180; + } + else + { + fixed_t anglemultiplier = FixedDiv(actor->movefactor, topspeed); + MAX_JAWZ_TURN += FixedAngle(FixedMul(AngleFixed(MAX_JAWZ_TURN), anglemultiplier)); + } + } + + if (angledelta > ANGLE_180) + { + angledelta = InvAngle(angledelta); + turnclockwise = false; + } + + if (angledelta > MAX_JAWZ_TURN) + { + angledelta = MAX_JAWZ_TURN; + } + + if (turnclockwise) + { + actor->angle -= angledelta; + } + else + { + actor->angle += angledelta; + } + } + + CONS_Printf("ad: %d\n", angledelta); ret = P_SpawnMobj(actor->tracer->x, actor->tracer->y, actor->tracer->z, MT_PLAYERRETICULE); P_SetTarget(&ret->target, actor->tracer); ret->frame |= ((leveltime % 10) / 2) + 5; ret->color = actor->cvmem; - - P_Thrust(actor, R_PointToAngle2(actor->x, actor->y, actor->tracer->x, actor->tracer->y), (7*actor->movefactor)/64); - return; } else P_SetTarget(&actor->tracer, NULL); } + if (!P_IsObjectOnGround(actor)) + { + // No friction in the air + frictionsafety = FRACUNIT; + } + + if (currentspeed >= topspeed) + { + // Thrust as if you were at top speed, slow down naturally + thrustamount = FixedDiv(topspeed, frictionsafety) - topspeed; + } + else + { + const fixed_t beatfriction = FixedDiv(currentspeed, frictionsafety) - currentspeed; + // Thrust to immediately get to top speed + thrustamount = beatfriction + FixedDiv(topspeed - currentspeed, frictionsafety); + } + + if (!actor->tracer) + { + actor->angle = R_PointToAngle2(0, 0, actor->momx, actor->momy); + } + + P_Thrust(actor, actor->angle, thrustamount); + + if ((actor->tracer != NULL) && (actor->tracer->health > 0)) + return; + if (actor->extravalue1) // Disable looking by setting this return; diff --git a/src/p_mobj.c b/src/p_mobj.c index f9bfc807b..aae777335 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -7989,12 +7989,6 @@ void P_MobjThinker(mobj_t *mobj) case MT_JAWZ: { sector_t *sec2; - fixed_t topspeed = mobj->movefactor; - fixed_t distbarrier = 512*mapobjectscale; - fixed_t distaway; - const fixed_t currentspeed = R_PointToDist2(0, 0, mobj->momx, mobj->momy); - fixed_t thrustamount = 0; - fixed_t frictionsafety = (mobj->friction == 0) ? 1 : mobj->friction; mobj_t *ghost = P_SpawnGhostMobj(mobj); if (mobj->target && !P_MobjWasRemoved(mobj->target) && mobj->target->player) @@ -8008,47 +8002,7 @@ void P_MobjThinker(mobj_t *mobj) if (leveltime % TICRATE == 0) S_StartSound(mobj, mobj->info->activesound); - distbarrier = FixedMul(distbarrier, FRACUNIT + ((gamespeed-1) * (FRACUNIT/4))); - - if (!P_IsObjectOnGround(mobj)) - { - // No friction in the air - frictionsafety = FRACUNIT; - } - - if (G_RaceGametype() && mobj->tracer) - { - distaway = P_AproxDistance(mobj->tracer->x - mobj->x, mobj->tracer->y - mobj->y); - if (distaway < distbarrier) - { - if (mobj->tracer->player) - { - fixed_t speeddifference = abs(topspeed - min(mobj->tracer->player->speed, K_GetKartSpeed(mobj->tracer->player, false))); - topspeed = topspeed - FixedMul(speeddifference, FRACUNIT-FixedDiv(distaway, distbarrier)); - } - } - } - - // Don't thrust at ALL if we're in the barrier range and above top speed, harsher slowdown - if ((currentspeed >= topspeed) && (topspeed == mobj->movefactor)) - { - // Thrust as if you were at top speed, slow down naturally - thrustamount = FixedDiv(topspeed, frictionsafety) - topspeed; - } - else - { - const fixed_t beatfriction = FixedDiv(currentspeed, frictionsafety) - currentspeed; - // Thrust to immediately get to top speed - thrustamount = beatfriction + FixedDiv(topspeed - currentspeed, frictionsafety); - } - - mobj->angle = R_PointToAngle2(0, 0, mobj->momx, mobj->momy); - P_Thrust(mobj, mobj->angle, thrustamount); - - if (mobj->tracer) - mobj->angle = R_PointToAngle2(mobj->x, mobj->y, mobj->tracer->x, mobj->tracer->y); - else - mobj->angle = R_PointToAngle2(0, 0, mobj->momx, mobj->momy); + // Movement handling has ALL been moved to A_JawzChase K_DriftDustHandling(mobj); From 407157496a56b97925dbf9034910da585643fd65 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 16 Jul 2019 16:03:31 -0400 Subject: [PATCH 18/49] Fix colors looking washed-out on models --- src/hardware/hw_md2.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index b610d410c..21deed84b 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -849,27 +849,17 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, { // Color strength depends on image alpha INT32 tempcolor; - INT16 tempmult, tempalpha; - tempalpha = -(abs(blendimage->s.red-127)-127)*2; - if (tempalpha > 255) - tempalpha = 255; - else if (tempalpha < 0) - tempalpha = 0; - - tempmult = (blendimage->s.red-127)*2; - if (tempmult > 255) - tempmult = 255; - else if (tempmult < 0) - tempmult = 0; - - tempcolor = (image->s.red*(255-blendimage->s.alpha))/255 + ((tempmult + ((tempalpha*blendcolor.s.red)/255)) * blendimage->s.alpha)/255; + tempcolor = ((image->s.red * (255-blendimage->s.alpha)) / 255) + ((blendcolor.s.red * blendimage->s.alpha) / 255); + tempcolor = min(255, tempcolor); cur->s.red = (UINT8)tempcolor; - tempcolor = (image->s.green*(255-blendimage->s.alpha))/255 + ((tempmult + ((tempalpha*blendcolor.s.green)/255)) * blendimage->s.alpha)/255; + tempcolor = ((image->s.green * (255-blendimage->s.alpha)) / 255) + ((blendcolor.s.green * blendimage->s.alpha) / 255); + tempcolor = min(255, tempcolor); cur->s.green = (UINT8)tempcolor; - tempcolor = (image->s.blue*(255-blendimage->s.alpha))/255 + ((tempmult + ((tempalpha*blendcolor.s.blue)/255)) * blendimage->s.alpha)/255; + tempcolor = ((image->s.blue * (255-blendimage->s.alpha)) / 255) + ((blendcolor.s.blue * blendimage->s.alpha) / 255); + tempcolor = min(255, tempcolor); cur->s.blue = (UINT8)tempcolor; cur->s.alpha = image->s.alpha; } From 0006ceac888346401948a5e5df1e0e62a34dd672 Mon Sep 17 00:00:00 2001 From: Sryder Date: Sun, 11 Aug 2019 18:37:18 +0100 Subject: [PATCH 19/49] Remove stray CONS_Printf --- src/p_enemy.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index bb8169a23..9569b2c4c 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -8395,8 +8395,6 @@ void A_JawzChase(mobj_t *actor) } } - CONS_Printf("ad: %d\n", angledelta); - ret = P_SpawnMobj(actor->tracer->x, actor->tracer->y, actor->tracer->z, MT_PLAYERRETICULE); P_SetTarget(&ret->target, actor->tracer); ret->frame |= ((leveltime % 10) / 2) + 5; From de8030bc2eabc50d7fd87d23d16c2e3fb7845967 Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 11 Aug 2019 12:32:57 -0700 Subject: [PATCH 20/49] Toggle ping and FPS counters with HUD --- src/sdl/i_video.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 42e0a917f..e5f1c23fc 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -1377,11 +1377,14 @@ void I_FinishUpdate(void) if (I_SkipFrame()) return; - if (cv_ticrate.value) - SCR_DisplayTicRate(); + if (st_overlay) + { + if (cv_ticrate.value) + SCR_DisplayTicRate(); - if (cv_showping.value && netgame && consoleplayer != serverplayer) - SCR_DisplayLocalPing(); + if (cv_showping.value && netgame && consoleplayer != serverplayer) + SCR_DisplayLocalPing(); + } if (rendermode == render_soft && screens[0]) { From 63abd92a0e4171656d4c57c1713dc0a1f63f37c9 Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 11 Aug 2019 12:35:06 -0700 Subject: [PATCH 21/49] Apply HUD translucency to ping and FPS counters --- src/screen.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/screen.c b/src/screen.c index 4cb8bac5d..96a78ae8e 100644 --- a/src/screen.c +++ b/src/screen.c @@ -427,13 +427,13 @@ void SCR_DisplayTicRate(void) ticcntcolor|V_NOSCALESTART, va("%02d/%02u", totaltics, TICRATE));*/ // draw "FPS" - V_DrawFixedPatch(306< servermaxping)) // only show 2 (warning) if our ping is at a bad level { INT32 dispy = cv_ticrate.value ? 160 : 181; - HU_drawPing(307, dispy, ping, V_SNAPTORIGHT | V_SNAPTOBOTTOM); + HU_drawPing(307, dispy, ping, V_SNAPTORIGHT | V_SNAPTOBOTTOM | V_HUDTRANS); } } From 094c926fd095be6514bf160ee72d5d095930c606 Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 11 Aug 2019 13:09:03 -0700 Subject: [PATCH 22/49] Apply hud translucency to FREE PLAY --- src/k_kart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index c56c7c982..d0fef36a8 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -9560,7 +9560,7 @@ void K_drawKartFreePlay(UINT32 flashtime) return; V_DrawKartString((BASEVIDWIDTH - (LAPS_X+1)) - (12*9), // mirror the laps thingy - LAPS_Y+3, V_SNAPTOBOTTOM|V_SNAPTORIGHT, "FREE PLAY"); + LAPS_Y+3, V_HUDTRANS|V_SNAPTOBOTTOM|V_SNAPTORIGHT, "FREE PLAY"); } static void K_drawDistributionDebugger(void) From e0a177e612135de8c393f30a4858c12ee6233fa3 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 11 Sep 2019 23:33:33 -0400 Subject: [PATCH 23/49] Horizontal springs, bigger hitboxes, springs use the meatier Sonic 3 sound effect --- src/dehacked.c | 62 +++++---- src/info.c | 363 ++++++++++++++++++++++++++++++------------------- src/info.h | 77 ++++++----- src/k_kart.c | 11 -- 4 files changed, 303 insertions(+), 210 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index be45f3f0f..b8f2ecdec 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -5609,44 +5609,59 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_RBIRD2", "S_RBIRD3", - "S_YELLOWSPRING", + // Yellow Spring + "S_YELLOWSPRING1", "S_YELLOWSPRING2", "S_YELLOWSPRING3", "S_YELLOWSPRING4", - "S_YELLOWSPRING5", - "S_REDSPRING", + // Red Spring + "S_REDSPRING1", "S_REDSPRING2", "S_REDSPRING3", "S_REDSPRING4", - "S_REDSPRING5", - // Blue Springs - "S_BLUESPRING", + // Blue Spring + "S_BLUESPRING1", "S_BLUESPRING2", "S_BLUESPRING3", "S_BLUESPRING4", - "S_BLUESPRING5", // Yellow Diagonal Spring "S_YDIAG1", "S_YDIAG2", "S_YDIAG3", "S_YDIAG4", - "S_YDIAG5", - "S_YDIAG6", - "S_YDIAG7", - "S_YDIAG8", // Red Diagonal Spring "S_RDIAG1", "S_RDIAG2", "S_RDIAG3", "S_RDIAG4", - "S_RDIAG5", - "S_RDIAG6", - "S_RDIAG7", - "S_RDIAG8", + + // Blue Diagonal Spring + "S_BDIAG1", + "S_BDIAG2", + "S_BDIAG3", + "S_BDIAG4", + + // Yellow Horizontal Spring + "S_YHORIZ1", + "S_YHORIZ2", + "S_YHORIZ3", + "S_YHORIZ4", + + // Red Horizontal Spring + "S_RHORIZ1", + "S_RHORIZ2", + "S_RHORIZ3", + "S_RHORIZ4", + + // Blue Horizontal Spring + "S_BHORIZ1", + "S_BHORIZ2", + "S_BHORIZ3", + "S_BHORIZ4", // Rain "S_RAIN1", @@ -6281,16 +6296,6 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit // Invis-spring - this is used just for the sproing sound. "S_INVISSPRING", - // Blue Diagonal Spring - "S_BDIAG1", - "S_BDIAG2", - "S_BDIAG3", - "S_BDIAG4", - "S_BDIAG5", - "S_BDIAG6", - "S_BDIAG7", - "S_BDIAG8", - //{ Random Item Box "S_RANDOMITEM1", "S_RANDOMITEM2", @@ -7328,11 +7333,15 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s // Springs and others "MT_FAN", "MT_STEAM", // Steam riser - "MT_BLUESPRING", "MT_YELLOWSPRING", "MT_REDSPRING", + "MT_BLUESPRING", "MT_YELLOWDIAG", // Yellow Diagonal Spring "MT_REDDIAG", // Red Diagonal Spring + "MT_BLUEDIAG", // Blue Diagonal Spring + "MT_YELLOWHORIZ", // Yellow Horizontal Spring + "MT_REDHORIZ", // Red Horizontal Spring + "MT_BLUEHORIZ", // Blue Horizontal Spring // Interactive Objects "MT_BUBBLES", // Bubble source @@ -7716,7 +7725,6 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s // SRB2kart "MT_GRAYSPRING", "MT_INVISSPRING", - "MT_BLUEDIAG", "MT_RANDOMITEM", "MT_RANDOMITEMPOP", "MT_FLOATINGITEM", diff --git a/src/info.c b/src/info.c index 31f2f8348..c7a826372 100644 --- a/src/info.c +++ b/src/info.c @@ -43,33 +43,33 @@ char sprnames[NUMSPRITES + 1][5] = "DFLM","XMS1","XMS2","XMS3","BSZ1","BSZ2","BSZ3","BSZ4","BSZ5","BSZ6", "BSZ7","BSZ8","STLG","DBAL","RCRY","ARMA","ARMF","ARMB","WIND","MAGN", "ELEM","FORC","PITY","IVSP","SSPK","GOAL","BIRD","BUNY","MOUS","CHIC", - "COWZ","RBRD","SPRY","SPRR","SPRB","YSPR","RSPR","RAIN","SNO1","SPLH", - "SPLA","SMOK","BUBP","BUBO","BUBN","BUBM","POPP","TFOG","SEED","PRTL", - "SCOR","DRWN","TTAG","GFLG","RRNG","RNGB","RNGR","RNGI","RNGA","RNGE", - "RNGS","RNGG","PIKB","PIKR","PIKA","PIKE","PIKS","PIKG","TAUT","TGRE", - "TSCR","COIN","CPRK","GOOM","BGOM","FFWR","FBLL","SHLL","PUMA","HAMM", - "KOOP","BFLM","MAXE","MUS1","MUS2","TOAD","NDRN","SUPE","SUPZ","NDRL", - "NSPK","NBMP","HOOP","NSCR","NPRU","CAPS","SUPT","SPRK","BOM1","BOM2", - "BOM3","BOM4","ROIA","ROIB","ROIC","ROID","ROIE","ROIF","ROIG","ROIH", - "ROII","ROIJ","ROIK","ROIL","ROIM","ROIN","ROIO","ROIP","BBAL","GWLG", - "GWLR","SRBA","SRBB","SRBC","SRBD","SRBE","SRBF","SRBG","SRBH","SRBI", - "SRBJ","SRBK","SRBL","SRBM","SRBN","SRBO", + "COWZ","RBRD","SPVY","SPVR","SPVB","SPDY","SPDR","SPDB","SPHY","SPHR", + "SPHB","RAIN","SNO1","SPLH","SPLA","SMOK","BUBP","BUBO","BUBN","BUBM", + "POPP","TFOG","SEED","PRTL","SCOR","DRWN","TTAG","GFLG","RRNG","RNGB", + "RNGR","RNGI","RNGA","RNGE","RNGS","RNGG","PIKB","PIKR","PIKA","PIKE", + "PIKS","PIKG","TAUT","TGRE","TSCR","COIN","CPRK","GOOM","BGOM","FFWR", + "FBLL","SHLL","PUMA","HAMM","KOOP","BFLM","MAXE","MUS1","MUS2","TOAD", + "NDRN","SUPE","SUPZ","NDRL","NSPK","NBMP","HOOP","NSCR","NPRU","CAPS", + "SUPT","SPRK","BOM1","BOM2","BOM3","BOM4","ROIA","ROIB","ROIC","ROID", + "ROIE","ROIF","ROIG","ROIH","ROII","ROIJ","ROIK","ROIL","ROIM","ROIN", + "ROIO","ROIP","BBAL","GWLG","GWLR","SRBA","SRBB","SRBC","SRBD","SRBE", + "SRBF","SRBG","SRBH","SRBI","SRBJ","SRBK","SRBL","SRBM","SRBN","SRBO", //SRB2kart Sprites - "SPRG","BSPR","RNDM","RPOP","SGNS","FAST","DSHR","BOST","BOSM","KFRE", - "KINV","KINF","WIPD","DRIF","BDRF","DUST","RSHE","FITM","BANA","ORBN", - "JAWZ","SSMN","KRBM","BHOG","BHBM","SPBM","THNS","SINK","SITR","KBLN", - "DEZL","POKE","AUDI","DECO","DOOD","SNES","GBAS","SPRS","BUZB","CHOM", - "SACO","CRAB","SHAD","BRNG","BUMP","FLEN","CLAS","PSHW","ISTA","ISTB", - "ARRO","ITEM","ITMO","ITMI","ITMN","WANT","PBOM","HIT1","HIT2","HIT3", - "RETI","AIDU","KSPK","LZI1","LZI2","KLIT","FZSM","FZBM","FPRT","SBUS", - "MARB","FUFO","RUST","BLON","VAPE","HTZA","HTZB","SGVA","SGVB","SGVC", - "PGTR","PGF1","PGF2","PGF3","PGBH","DPLR","SPTL","ENM1","GARU","MARR", - "REAP","JITB","CDMO","CDBU","PINE","PPLR","DPPT","AATR","COCO","BDST", - "FROG","CBRA","HOLE","BBRA","EGFG","SMKP","MTYM","THWP","SNOB","ICEB", - "CNDL","DOCH","DUCK","GTRE","CHES","CHIM","DRGN","LZMN","PGSS","ZTCH", - "MKMA","MKMP","RTCH","BOWL","BOWH","BRRL","BRRR","HRSE","TOAH","BFRT", - "OFRT","RFRT","PFRT","ASPK","HBST","HBSO","HBSF","WBLZ","WBLN","FWRK", - "MXCL","RGSP","DRAF","XMS4","XMS5","VIEW" + "SPRG","RNDM","RPOP","SGNS","FAST","DSHR","BOST","BOSM","KFRE","KINV", + "KINF","WIPD","DRIF","BDRF","DUST","RSHE","FITM","BANA","ORBN","JAWZ", + "SSMN","KRBM","BHOG","BHBM","SPBM","THNS","SINK","SITR","KBLN","DEZL", + "POKE","AUDI","DECO","DOOD","SNES","GBAS","SPRS","BUZB","CHOM","SACO", + "CRAB","SHAD","BRNG","BUMP","FLEN","CLAS","PSHW","ISTA","ISTB","ARRO", + "ITEM","ITMO","ITMI","ITMN","WANT","PBOM","HIT1","HIT2","HIT3","RETI", + "AIDU","KSPK","LZI1","LZI2","KLIT","FZSM","FZBM","FPRT","SBUS","MARB", + "FUFO","RUST","BLON","VAPE","HTZA","HTZB","SGVA","SGVB","SGVC","PGTR", + "PGF1","PGF2","PGF3","PGBH","DPLR","SPTL","ENM1","GARU","MARR","REAP", + "JITB","CDMO","CDBU","PINE","PPLR","DPPT","AATR","COCO","BDST","FROG", + "CBRA","HOLE","BBRA","EGFG","SMKP","MTYM","THWP","SNOB","ICEB","CNDL", + "DOCH","DUCK","GTRE","CHES","CHIM","DRGN","LZMN","PGSS","ZTCH","MKMA", + "MKMP","RTCH","BOWL","BOWH","BRRL","BRRR","HRSE","TOAH","BFRT","OFRT", + "RFRT","PFRT","ASPK","HBST","HBSO","HBSF","WBLZ","WBLN","FWRK","MXCL", + "RGSP","DRAF","XMS4","XMS5","VIEW" }; // Doesn't work with g++, needs actionf_p1 (don't modify this comment) @@ -1795,45 +1795,58 @@ state_t states[NUMSTATES] = {SPR_RBRD, 1, 4, {A_Chase}, 0, 0, S_RBIRD2}, // S_RBIRD3 // Yellow Spring - {SPR_SPRY, 0, -1, {NULL}, 0, 0, S_NULL}, // S_YELLOWSPRING - {SPR_SPRY, 4, 4, {A_Pain}, 0, 0, S_YELLOWSPRING3}, // S_YELLOWSPRING2 - {SPR_SPRY, 3, 1, {NULL}, 0, 0, S_YELLOWSPRING4}, // S_YELLOWSPRING3 - {SPR_SPRY, 2, 1, {NULL}, 0, 0, S_YELLOWSPRING5}, // S_YELLOWSPRING4 - {SPR_SPRY, 1, 1, {NULL}, 0, 0, S_YELLOWSPRING}, // S_YELLOWSPRING5 + {SPR_SPVY, 0, -1, {NULL}, 0, 0, S_NULL}, // S_YELLOWSPRING1 + {SPR_SPVY, 1, 1, {A_Pain}, 0, 0, S_YELLOWSPRING3}, // S_YELLOWSPRING2 + {SPR_SPVY, 0, 1, {NULL}, 0, 0, S_YELLOWSPRING4}, // S_YELLOWSPRING3 + {SPR_SPVY, 2, 4, {NULL}, 0, 0, S_YELLOWSPRING1}, // S_YELLOWSPRING4 // Red Spring - {SPR_SPRR, 0, -1, {NULL}, 0, 0, S_NULL}, // S_REDSPRING - {SPR_SPRR, 4, 4, {A_Pain}, 0, 0, S_REDSPRING3}, // S_REDSPRING2 - {SPR_SPRR, 3, 1, {NULL}, 0, 0, S_REDSPRING4}, // S_REDSPRING3 - {SPR_SPRR, 2, 1, {NULL}, 0, 0, S_REDSPRING5}, // S_REDSPRING4 - {SPR_SPRR, 1, 1, {NULL}, 0, 0, S_REDSPRING}, // S_REDSPRING5 + {SPR_SPVR, 0, -1, {NULL}, 0, 0, S_NULL}, // S_REDSPRING1 + {SPR_SPVR, 1, 1, {A_Pain}, 0, 0, S_REDSPRING3}, // S_REDSPRING2 + {SPR_SPVR, 0, 1, {NULL}, 0, 0, S_REDSPRING4}, // S_REDSPRING3 + {SPR_SPVR, 2, 4, {NULL}, 0, 0, S_REDSPRING1}, // S_REDSPRING4 // Blue Spring - {SPR_SPRB, 0, -1, {NULL}, 0, 0, S_NULL}, // S_BLUESPRING - {SPR_SPRB, 4, 4, {A_Pain}, 0, 0, S_BLUESPRING3}, // S_BLUESPRING2 - {SPR_SPRB, 3, 1, {NULL}, 0, 0, S_BLUESPRING4}, // S_BLUESPRING3 - {SPR_SPRB, 2, 1, {NULL}, 0, 0, S_BLUESPRING5}, // S_BLUESPRING4 - {SPR_SPRB, 1, 1, {NULL}, 0, 0, S_BLUESPRING}, // S_BLUESPRING5 + {SPR_SPVB, 0, -1, {NULL}, 0, 0, S_NULL}, // S_BLUESPRING1 + {SPR_SPVB, 1, 1, {A_Pain}, 0, 0, S_BLUESPRING3}, // S_BLUESPRING2 + {SPR_SPVB, 0, 1, {NULL}, 0, 0, S_BLUESPRING4}, // S_BLUESPRING3 + {SPR_SPVB, 2, 4, {NULL}, 0, 0, S_BLUESPRING1}, // S_BLUESPRING4 // Yellow Diagonal Spring - {SPR_YSPR, 0, -1, {NULL}, 0, 0, S_NULL}, // S_YDIAG1 - {SPR_YSPR, 1, 1, {A_Pain}, 0, 0, S_YDIAG3}, // S_YDIAG2 - {SPR_YSPR, 2, 1, {NULL}, 0, 0, S_YDIAG4}, // S_YDIAG3 - {SPR_YSPR, 3, 1, {NULL}, 0, 0, S_YDIAG5}, // S_YDIAG4 - {SPR_YSPR, 4, 1, {NULL}, 0, 0, S_YDIAG6}, // S_YDIAG5 - {SPR_YSPR, 3, 1, {NULL}, 0, 0, S_YDIAG7}, // S_YDIAG6 - {SPR_YSPR, 2, 1, {NULL}, 0, 0, S_YDIAG8}, // S_YDIAG7 - {SPR_YSPR, 1, 1, {NULL}, 0, 0, S_YDIAG1}, // S_YDIAG8 + {SPR_SPDY, 0, -1, {NULL}, 0, 0, S_NULL}, // S_YDIAG1 + {SPR_SPDY, 1, 1, {A_Pain}, 0, 0, S_YDIAG3}, // S_YDIAG2 + {SPR_SPDY, 0, 1, {NULL}, 0, 0, S_YDIAG4}, // S_YDIAG3 + {SPR_SPDY, 2, 4, {NULL}, 0, 0, S_YDIAG1}, // S_YDIAG4 // Red Diagonal Spring - {SPR_RSPR, 0, -1, {NULL}, 0, 0, S_NULL}, // S_RDIAG1 - {SPR_RSPR, 1, 1, {A_Pain}, 0, 0, S_RDIAG3}, // S_RDIAG2 - {SPR_RSPR, 2, 1, {NULL}, 0, 0, S_RDIAG4}, // S_RDIAG3 - {SPR_RSPR, 3, 1, {NULL}, 0, 0, S_RDIAG5}, // S_RDIAG4 - {SPR_RSPR, 4, 1, {NULL}, 0, 0, S_RDIAG6}, // S_RDIAG5 - {SPR_RSPR, 3, 1, {NULL}, 0, 0, S_RDIAG7}, // S_RDIAG6 - {SPR_RSPR, 2, 1, {NULL}, 0, 0, S_RDIAG8}, // S_RDIAG7 - {SPR_RSPR, 1, 1, {NULL}, 0, 0, S_RDIAG1}, // S_RDIAG8 + {SPR_SPDR, 0, -1, {NULL}, 0, 0, S_NULL}, // S_RDIAG1 + {SPR_SPDR, 1, 1, {A_Pain}, 0, 0, S_RDIAG3}, // S_RDIAG2 + {SPR_SPDR, 0, 1, {NULL}, 0, 0, S_RDIAG4}, // S_RDIAG3 + {SPR_SPDR, 2, 4, {NULL}, 0, 0, S_RDIAG1}, // S_RDIAG4 + + // Blue Diagonal Spring + {SPR_SPDB, 0, -1, {NULL}, 0, 0, S_NULL}, // S_BDIAG1 + {SPR_SPDB, 1, 1, {A_Pain}, 0, 0, S_BDIAG3}, // S_BDIAG2 + {SPR_SPDB, 0, 1, {NULL}, 0, 0, S_BDIAG4}, // S_BDIAG3 + {SPR_SPDB, 2, 4, {NULL}, 0, 0, S_BDIAG1}, // S_BDIAG4 + + // Yellow Horizontal Spring + {SPR_SPHY, 0, -1, {NULL}, 0, 0, S_NULL}, // S_YHORIZ1 + {SPR_SPHY, 1, 1, {A_Pain}, 0, 0, S_YHORIZ3}, // S_YHORIZ2 + {SPR_SPHY, 0, 1, {NULL}, 0, 0, S_YHORIZ4}, // S_YHORIZ3 + {SPR_SPHY, 2, 4, {NULL}, 0, 0, S_YHORIZ1}, // S_YHORIZ4 + + // Red Horizontal Spring + {SPR_SPHR, 0, -1, {NULL}, 0, 0, S_NULL}, // S_RHORIZ1 + {SPR_SPHR, 1, 1, {A_Pain}, 0, 0, S_RHORIZ3}, // S_RHORIZ2 + {SPR_SPHR, 0, 1, {NULL}, 0, 0, S_RHORIZ4}, // S_RHORIZ3 + {SPR_SPHR, 2, 4, {NULL}, 0, 0, S_RHORIZ1}, // S_RHORIZ4 + + // Blue Horizontal Spring + {SPR_SPHB, 0, -1, {NULL}, 0, 0, S_NULL}, // S_BHORIZ1 + {SPR_SPHB, 1, 1, {A_Pain}, 0, 0, S_BHORIZ3}, // S_BHORIZ2 + {SPR_SPHB, 0, 1, {NULL}, 0, 0, S_BHORIZ4}, // S_BHORIZ3 + {SPR_SPHB, 2, 4, {NULL}, 0, 0, S_BHORIZ1}, // S_BHORIZ4 // Rain {SPR_RAIN, FF_TRANS50, -1, {NULL}, 0, 0, S_NULL}, // S_RAIN1 @@ -2520,15 +2533,6 @@ state_t states[NUMSTATES] = {SPR_NULL, 0, 1, {A_Pain}, 0, 0, S_INVISIBLE}, // S_INVISSPRING - {SPR_BSPR, 0, -1, {NULL}, 0, 0, S_NULL}, // S_BDIAG1 - {SPR_BSPR, 1, 1, {A_Pain}, 0, 0, S_BDIAG3}, // S_BDIAG2 - {SPR_BSPR, 2, 1, {NULL}, 0, 0, S_BDIAG4}, // S_BDIAG3 - {SPR_BSPR, 3, 1, {NULL}, 0, 0, S_BDIAG5}, // S_BDIAG4 - {SPR_BSPR, 4, 1, {NULL}, 0, 0, S_BDIAG6}, // S_BDIAG5 - {SPR_BSPR, 3, 1, {NULL}, 0, 0, S_BDIAG7}, // S_BDIAG6 - {SPR_BSPR, 2, 1, {NULL}, 0, 0, S_BDIAG8}, // S_BDIAG7 - {SPR_BSPR, 1, 1, {NULL}, 0, 0, S_BDIAG1}, // S_BDIAG8 - {SPR_RNDM, 0|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_RANDOMITEM2}, // S_RANDOMITEM1 {SPR_RNDM, 1|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_RANDOMITEM3}, // S_RANDOMITEM2 {SPR_RNDM, 2|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_RANDOMITEM4}, // S_RANDOMITEM3 @@ -4237,7 +4241,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // attacksound S_NULL, // painstate 0, // painchance - sfx_spring, // painsound + sfx_s3kb1, // painsound S_NULL, // meleestate S_NULL, // missilestate S_XPLD1, // deathstate @@ -4264,7 +4268,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // attacksound S_NULL, // painstate 0, // painchance - sfx_spring, // painsound + sfx_s3kb1, // painsound S_NULL, // meleestate S_NULL, // missilestate S_XPLD1, // deathstate @@ -4681,7 +4685,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // display offset 0, // mass 0, // damage - sfx_spring, // activesound + sfx_s3kb1, // activesound MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOCLIPTHING, // flags S_EGGMOBILE2_POGO5 // raisestate }, @@ -6058,36 +6062,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_BLUESPRING - 552, // doomednum - S_BLUESPRING, // spawnstate - 1000, // spawnhealth - S_BLUESPRING2, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_None, // attacksound - S_NULL, // painstate - 0, // painchance - sfx_spring, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_NULL, // deathstate - S_NULL, // xdeathstate - sfx_None, // deathsound - 0, // speed - 20*FRACUNIT, // radius - 16*FRACUNIT, // height - 0, // display offset - 14*FRACUNIT, // mass - 0, // damage - sfx_None, // activesound - MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags - S_BLUESPRING2 // raisestate - }, - { // MT_YELLOWSPRING 550, // doomednum - S_YELLOWSPRING, // spawnstate + S_YELLOWSPRING1,// spawnstate 1000, // spawnhealth S_YELLOWSPRING2,// seestate sfx_None, // seesound @@ -6095,15 +6072,15 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // attacksound S_NULL, // painstate 0, // painchance - sfx_spring, // painsound + sfx_s3kb1, // painsound S_NULL, // meleestate S_NULL, // missilestate S_NULL, // deathstate S_NULL, // xdeathstate sfx_None, // deathsound 0, // speed - 20*FRACUNIT, // radius - 16*FRACUNIT, // height + 48*FRACUNIT, // radius + 32*FRACUNIT, // height 0, // display offset 26*FRACUNIT, // mass 0, // damage @@ -6114,7 +6091,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { // MT_REDSPRING 551, // doomednum - S_REDSPRING, // spawnstate + S_REDSPRING1, // spawnstate 1000, // spawnhealth S_REDSPRING2, // seestate sfx_None, // seesound @@ -6122,15 +6099,15 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // attacksound S_NULL, // painstate 0, // painchance - sfx_spring, // painsound + sfx_s3kb1, // painsound S_NULL, // meleestate S_NULL, // missilestate S_NULL, // deathstate S_NULL, // xdeathstate sfx_None, // deathsound 0, // speed - 20*FRACUNIT, // radius - 16*FRACUNIT, // height + 48*FRACUNIT, // radius + 32*FRACUNIT, // height 0, // display offset 40*FRACUNIT, // mass 0, // damage @@ -6139,6 +6116,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_REDSPRING2 // raisestate }, + { // MT_BLUESPRING + 552, // doomednum + S_BLUESPRING1, // spawnstate + 1000, // spawnhealth + S_BLUESPRING2, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_s3kb1, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 48*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 14*FRACUNIT, // mass + 0, // damage + sfx_None, // activesound + MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags + S_BLUESPRING2 // raisestate + }, + { // MT_YELLOWDIAG 555, // doomednum S_YDIAG1, // spawnstate @@ -6149,15 +6153,15 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // attacksound S_NULL, // painstate 0, // painchance - sfx_spring, // painsound + sfx_s3kb1, // painsound S_NULL, // meleestate S_NULL, // missilestate S_NULL, // deathstate S_NULL, // xdeathstate sfx_None, // deathsound 0, // speed - 16*FRACUNIT, // radius - 16*FRACUNIT, // height + 48*FRACUNIT, // radius + 56*FRACUNIT, // height 0, // display offset 26*FRACUNIT, // mass 26*FRACUNIT, // damage @@ -6176,15 +6180,15 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // attacksound S_NULL, // painstate 0, // painchance - sfx_spring, // painsound + sfx_s3kb1, // painsound S_NULL, // meleestate S_NULL, // missilestate S_NULL, // deathstate S_NULL, // xdeathstate sfx_None, // deathsound 0, // speed - 16*FRACUNIT, // radius - 16*FRACUNIT, // height + 48*FRACUNIT, // radius + 56*FRACUNIT, // height 0, // display offset 40*FRACUNIT, // mass 40*FRACUNIT, // damage @@ -6193,6 +6197,114 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_RDIAG2 // raisestate }, + { // MT_BLUEDIAG + 557, // doomednum + S_BDIAG1, // spawnstate + 1, // spawnhealth + S_BDIAG2, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_s3kb1, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 48*FRACUNIT, // radius + 56*FRACUNIT, // height + 0, // display offset + 14*FRACUNIT, // mass + 14*FRACUNIT, // damage + sfx_None, // activesound + MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags + S_BDIAG2 // raisestate + }, + + { // MT_YELLOWHORIZ + 558, // doomednum + S_YHORIZ1, // spawnstate + 1, // spawnhealth + S_YHORIZ2, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_s3kb1, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 48*FRACUNIT, // radius + 56*FRACUNIT, // height + 0, // display offset + 0, // mass + 36*FRACUNIT, // damage + sfx_None, // activesound + MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags + S_YHORIZ2 // raisestate + }, + + { // MT_REDHORIZ + 559, // doomednum + S_RHORIZ1, // spawnstate + 1, // spawnhealth + S_RHORIZ2, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_s3kb1, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 48*FRACUNIT, // radius + 56*FRACUNIT, // height + 0, // display offset + 0, // mass + 72*FRACUNIT, // damage + sfx_None, // activesound + MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags + S_RHORIZ2 // raisestate + }, + + { // MT_BLUEHORIZ + 560, // doomednum + S_BHORIZ1, // spawnstate + 1, // spawnhealth + S_BHORIZ2, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_s3kb1, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 48*FRACUNIT, // radius + 56*FRACUNIT, // height + 0, // display offset + 0, // mass + 18*FRACUNIT, // damage + sfx_None, // activesound + MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags + S_BHORIZ2 // raisestate + }, + { // MT_BUBBLES 500, // doomednum S_BUBBLES1, // spawnstate @@ -14811,7 +14923,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // attacksound S_NULL, // painstate 0, // painchance - sfx_spring, // painsound + sfx_s3kb1, // painsound S_NULL, // meleestate S_NULL, // missilestate S_NULL, // deathstate @@ -14838,7 +14950,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // attacksound S_NULL, // painstate 0, // painchance - sfx_spring, // painsound + sfx_s3kb1, // painsound S_NULL, // meleestate S_NULL, // missilestate S_NULL, // deathstate @@ -14855,33 +14967,6 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_INVISSPRING // raisestate }, - { // MT_BLUEDIAG - 557, // doomednum - S_BDIAG1, // spawnstate - 1, // spawnhealth - S_BDIAG2, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_None, // attacksound - S_NULL, // painstate - 0, // painchance - sfx_spring, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_NULL, // deathstate - S_NULL, // xdeathstate - sfx_None, // deathsound - 0, // speed - 16*FRACUNIT, // radius - 16*FRACUNIT, // height - 0, // display offset - 14*FRACUNIT, // mass - 14*FRACUNIT, // damage - sfx_None, // activesound - MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags - S_BDIAG2 // raisestate - }, - { // MT_RANDOMITEM 2000, // doomednum S_RANDOMITEM1, // spawnstate diff --git a/src/info.h b/src/info.h index e2a60e131..755b2f76b 100644 --- a/src/info.h +++ b/src/info.h @@ -459,11 +459,15 @@ typedef enum sprite SPR_RBRD, // Red Birdie in Bubble // Springs - SPR_SPRY, // yellow spring - SPR_SPRR, // red spring - SPR_SPRB, // Blue springs - SPR_YSPR, // Yellow Diagonal Spring - SPR_RSPR, // Red Diagonal Spring + SPR_SPVY, // Yellow Vertical Spring + SPR_SPVR, // Red Vertical Spring + SPR_SPVB, // Blue Vertical Spring + SPR_SPDY, // Yellow Diagonal Spring + SPR_SPDR, // Red Diagonal Spring + SPR_SPDB, // Blue Diagonal Spring + SPR_SPHY, // Yellow Horizontal Spring + SPR_SPHR, // Red Horizontal Spring + SPR_SPHB, // Blue Horizontal Spring // Environmental Effects SPR_RAIN, // Rain @@ -588,7 +592,6 @@ typedef enum sprite // Springs SPR_SPRG, // Gray Spring - SPR_BSPR, // Blue Diagonal Spring SPR_RNDM, // Random Item Box SPR_RPOP, // Random Item Box Pop @@ -2491,44 +2494,59 @@ typedef enum state S_RBIRD2, S_RBIRD3, - S_YELLOWSPRING, + // Yellow Spring + S_YELLOWSPRING1, S_YELLOWSPRING2, S_YELLOWSPRING3, S_YELLOWSPRING4, - S_YELLOWSPRING5, - S_REDSPRING, + // Red Spring + S_REDSPRING1, S_REDSPRING2, S_REDSPRING3, S_REDSPRING4, - S_REDSPRING5, - // Blue Springs - S_BLUESPRING, + // Blue Spring + S_BLUESPRING1, S_BLUESPRING2, S_BLUESPRING3, S_BLUESPRING4, - S_BLUESPRING5, // Yellow Diagonal Spring S_YDIAG1, S_YDIAG2, S_YDIAG3, S_YDIAG4, - S_YDIAG5, - S_YDIAG6, - S_YDIAG7, - S_YDIAG8, // Red Diagonal Spring S_RDIAG1, S_RDIAG2, S_RDIAG3, S_RDIAG4, - S_RDIAG5, - S_RDIAG6, - S_RDIAG7, - S_RDIAG8, + + // Blue Diagonal Spring + S_BDIAG1, + S_BDIAG2, + S_BDIAG3, + S_BDIAG4, + + // Yellow Horizontal Spring + S_YHORIZ1, + S_YHORIZ2, + S_YHORIZ3, + S_YHORIZ4, + + // Red Horizontal Spring + S_RHORIZ1, + S_RHORIZ2, + S_RHORIZ3, + S_RHORIZ4, + + // Blue Horizontal Spring + S_BHORIZ1, + S_BHORIZ2, + S_BHORIZ3, + S_BHORIZ4, // Rain S_RAIN1, @@ -3163,16 +3181,6 @@ typedef enum state // Invis-spring - this is used just for the sproing sound. S_INVISSPRING, - // Blue Diagonal Spring - S_BDIAG1, - S_BDIAG2, - S_BDIAG3, - S_BDIAG4, - S_BDIAG5, - S_BDIAG6, - S_BDIAG7, - S_BDIAG8, - //{ Random Item Box S_RANDOMITEM1, S_RANDOMITEM2, @@ -4242,11 +4250,15 @@ typedef enum mobj_type // Springs and others MT_FAN, MT_STEAM, // Steam riser - MT_BLUESPRING, MT_YELLOWSPRING, MT_REDSPRING, + MT_BLUESPRING, MT_YELLOWDIAG, // Yellow Diagonal Spring MT_REDDIAG, // Red Diagonal Spring + MT_BLUEDIAG, // Blue Diagonal Spring + MT_YELLOWHORIZ, // Yellow Horizontal Spring + MT_REDHORIZ, // Red Horizontal Spring + MT_BLUEHORIZ, // Blue Horizontal Spring // Interactive Objects MT_BUBBLES, // Bubble source @@ -4630,7 +4642,6 @@ typedef enum mobj_type // SRB2kart MT_GRAYSPRING, MT_INVISSPRING, - MT_BLUEDIAG, MT_RANDOMITEM, MT_RANDOMITEMPOP, MT_FLOATINGITEM, diff --git a/src/k_kart.c b/src/k_kart.c index c56c7c982..a2f0c5ac9 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -5300,17 +5300,6 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) } } - // ??? - /* - if (player->kartstuff[k_jmp] > 1 && onground) - { - S_StartSound(player->mo, sfx_spring); - P_DoJump(player, false); - player->mo->momz *= player->kartstuff[k_jmp]; - player->kartstuff[k_jmp] = 0; - } - */ - if (player->kartstuff[k_comebacktimer]) player->kartstuff[k_comebackmode] = 0; From abfc1915c5460a7d846d04e905c449ea471c1d68 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 12 Sep 2019 00:10:06 -0400 Subject: [PATCH 24/49] Fixed horizontal springs having gravity --- src/info.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/info.c b/src/info.c index c7a826372..0a9c0cced 100644 --- a/src/info.c +++ b/src/info.c @@ -6247,7 +6247,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // mass 36*FRACUNIT, // damage sfx_None, // activesound - MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags + MF_SOLID|MF_SPRING|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags S_YHORIZ2 // raisestate }, @@ -6274,7 +6274,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // mass 72*FRACUNIT, // damage sfx_None, // activesound - MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags + MF_SOLID|MF_SPRING|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags S_RHORIZ2 // raisestate }, @@ -6301,7 +6301,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // mass 18*FRACUNIT, // damage sfx_None, // activesound - MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags + MF_SOLID|MF_SPRING|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags S_BHORIZ2 // raisestate }, From 55caae6d1aee185e8c6b0259043e0967a20eb0c8 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 12 Sep 2019 00:31:51 -0400 Subject: [PATCH 25/49] Remove teleporting jank from springs, set angle when going directly against a horizontal/diagonal spring --- src/p_map.c | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index d99105005..d5b447cf3 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -113,12 +113,13 @@ boolean P_TeleportMove(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z) // MOVEMENT ITERATOR FUNCTIONS // ========================================================================= +//#define TELEPORTJANK + boolean P_DoSpring(mobj_t *spring, mobj_t *object) { //INT32 pflags; const fixed_t hscale = mapobjectscale + (mapobjectscale - object->scale); const fixed_t vscale = mapobjectscale + (object->scale - mapobjectscale); - fixed_t offx, offy; fixed_t vertispeed = spring->info->mass; fixed_t horizspeed = spring->info->damage; @@ -142,11 +143,13 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) object->eflags |= MFE_SPRUNG; // apply this flag asap! spring->flags &= ~(MF_SOLID|MF_SPECIAL); // De-solidify +#ifdef TELEPORTJANK if (horizspeed && vertispeed) // Mimic SA { object->momx = object->momy = 0; P_TryMove(object, spring->x, spring->y, true); } +#endif if (spring->eflags & MFE_VERTICALFLIP) vertispeed *= -1; @@ -155,8 +158,11 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) object->z = spring->z + spring->height + 1; else if (vertispeed < 0) object->z = spring->z - object->height - 1; +#ifdef TELEPORTJANK else { + fixed_t offx, offy; + // Horizontal springs teleport you in FRONT of them. object->momx = object->momy = 0; @@ -178,6 +184,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) // Set position! P_TryMove(object, spring->x + offx, spring->y + offy, true); } +#endif if (vertispeed) object->momz = FixedMul(vertispeed,FixedSqrt(FixedMul(vscale, spring->scale))); @@ -208,20 +215,28 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) if (spring->flags & MF_ENEMY) // Spring shells P_SetTarget(&spring->target, object); - if (horizspeed && object->player->cmd.forwardmove == 0 && object->player->cmd.sidemove == 0) + if (horizspeed) { - object->angle = spring->angle; + const angle_t turnabout = ANGLE_90+ANGLE_45; + angle_t dangle = object->angle - spring->angle; + if (dangle > ANGLE_180) + dangle = InvAngle(dangle); - if (!demo.playback || P_AnalogMove(object->player)) + if (dangle > turnabout || (object->player->cmd.forwardmove == 0 && object->player->cmd.sidemove == 0)) { - if (object->player == &players[consoleplayer]) - localangle[0] = spring->angle; - else if (object->player == &players[displayplayers[1]]) - localangle[1] = spring->angle; - else if (object->player == &players[displayplayers[2]]) - localangle[2] = spring->angle; - else if (object->player == &players[displayplayers[3]]) - localangle[3] = spring->angle; + object->angle = spring->angle; + + if (!demo.playback || P_AnalogMove(object->player)) + { + if (object->player == &players[consoleplayer]) + localangle[0] = spring->angle; + else if (object->player == &players[displayplayers[1]]) + localangle[1] = spring->angle; + else if (object->player == &players[displayplayers[2]]) + localangle[2] = spring->angle; + else if (object->player == &players[displayplayers[3]]) + localangle[3] = spring->angle; + } } } From d4d03f907bbf299f591ec3cf13a78cc611c203fc Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 12 Sep 2019 00:32:47 -0400 Subject: [PATCH 26/49] Remove commented out code --- src/p_map.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index d5b447cf3..7487a7907 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -240,28 +240,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) } } - //pflags = object->player->pflags & (PF_JUMPED|PF_SPINNING|PF_THOKKED); // I still need these. P_ResetPlayer(object->player); - - /* // SRB2kart - Springs don't need to change player state in kart. - if (P_MobjFlip(object)*vertispeed > 0) - P_SetPlayerMobjState(object, S_PLAY_SPRING); - else if (P_MobjFlip(object)*vertispeed < 0) - P_SetPlayerMobjState(object, S_PLAY_FALL1); - else // horizontal spring - { - if (pflags & (PF_JUMPED|PF_SPINNING) && object->player->panim == PA_ROLL) - object->player->pflags = pflags; - else - P_SetPlayerMobjState(object, S_PLAY_RUN1); - } - - if (spring->info->painchance) - { - object->player->pflags |= PF_JUMPED; - P_SetPlayerMobjState(object, S_PLAY_ATK1); - } - */ } return true; } From d3f1b4f82c8adad79f450e267a6ac92702ee647a Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 12 Sep 2019 02:01:30 -0400 Subject: [PATCH 27/49] Greased horizontals --- src/d_player.h | 1 + src/dehacked.c | 3 ++- src/doomstat.h | 1 + src/g_game.c | 1 + src/info.c | 6 +++--- src/k_kart.c | 33 ++++++++++++++++++++++----------- src/p_map.c | 36 ++++++++++++++++++++++++------------ 7 files changed, 54 insertions(+), 27 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index d2ed296ce..aced985c8 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -327,6 +327,7 @@ typedef enum k_jawztargetdelay, // Delay for Jawz target switching, to make it less twitchy k_spectatewait, // How long have you been waiting as a spectator k_growcancel, // Hold the item button down to cancel Grow + k_tiregrease, // Reduced friction timer after hitting a horizontal spring NUMKARTSTUFF } kartstufftype_t; diff --git a/src/dehacked.c b/src/dehacked.c index b8f2ecdec..51eb820bb 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -8481,7 +8481,8 @@ static const char *const KARTSTUFF_LIST[] = { "GETSPARKS", "JAWZTARGETDELAY", "SPECTATEWAIT", - "GROWCANCEL" + "GROWCANCEL", + "TIREGREASE" }; #endif diff --git a/src/doomstat.h b/src/doomstat.h index 1f855da27..2299e8e87 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -435,6 +435,7 @@ extern INT32 sneakertime; extern INT32 itemtime; extern INT32 comebacktime; extern INT32 bumptime; +extern INT32 greasetics; extern INT32 wipeoutslowtime; extern INT32 wantedreduce; extern INT32 wantedfrequency; diff --git a/src/g_game.c b/src/g_game.c index e406e29d1..f4711592d 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -216,6 +216,7 @@ INT32 sneakertime = TICRATE + (TICRATE/3); INT32 itemtime = 8*TICRATE; INT32 comebacktime = 10*TICRATE; INT32 bumptime = 6; +INT32 greasetics = 2*TICRATE; INT32 wipeoutslowtime = 20; INT32 wantedreduce = 5*TICRATE; INT32 wantedfrequency = 10*TICRATE; diff --git a/src/info.c b/src/info.c index 0a9c0cced..0579bf6d4 100644 --- a/src/info.c +++ b/src/info.c @@ -6245,7 +6245,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 56*FRACUNIT, // height 0, // display offset 0, // mass - 36*FRACUNIT, // damage + 40*FRACUNIT, // damage sfx_None, // activesound MF_SOLID|MF_SPRING|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags S_YHORIZ2 // raisestate @@ -6272,7 +6272,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 56*FRACUNIT, // height 0, // display offset 0, // mass - 72*FRACUNIT, // damage + 80*FRACUNIT, // damage sfx_None, // activesound MF_SOLID|MF_SPRING|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags S_RHORIZ2 // raisestate @@ -6299,7 +6299,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 56*FRACUNIT, // height 0, // display offset 0, // mass - 18*FRACUNIT, // damage + 20*FRACUNIT, // damage sfx_None, // activesound MF_SOLID|MF_SPRING|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags S_BHORIZ2 // raisestate diff --git a/src/k_kart.c b/src/k_kart.c index a2f0c5ac9..79250d9fc 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -5260,6 +5260,9 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) if (player->kartstuff[k_justbumped]) player->kartstuff[k_justbumped]--; + if (player->kartstuff[k_tiregrease]) + player->kartstuff[k_tiregrease]--; + // This doesn't go in HUD update because it has potential gameplay ramifications if (player->karthud[khud_itemblink] && player->karthud[khud_itemblink]-- <= 0) { @@ -6479,6 +6482,12 @@ void K_MoveKartPlayer(player_t *player, boolean onground) if (onground) { + fixed_t prevfriction = player->mo->friction; + + // Reduce friction after hitting a horizontal spring + if (player->kartstuff[k_tiregrease]) + player->mo->friction += ((FRACUNIT - prevfriction) / greasetics) * player->kartstuff[k_tiregrease]; + // Friction if (!player->kartstuff[k_offroad]) { @@ -6491,9 +6500,20 @@ void K_MoveKartPlayer(player_t *player, boolean onground) // Karma ice physics if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0) - { player->mo->friction += 1228; + // Wipeout slowdown + if (player->kartstuff[k_spinouttimer] && player->kartstuff[k_wipeoutslow]) + { + if (player->kartstuff[k_offroad]) + player->mo->friction -= 4912; + if (player->kartstuff[k_wipeoutslow] == 1) + player->mo->friction -= 9824; + } + + // Friction was changed, so we must recalculate a bunch of stuff + if (player->mo->friction != prevfriction) + { if (player->mo->friction > FRACUNIT) player->mo->friction = FRACUNIT; if (player->mo->friction < 0) @@ -6504,20 +6524,11 @@ void K_MoveKartPlayer(player_t *player, boolean onground) if (player->mo->movefactor < FRACUNIT) player->mo->movefactor = 19*player->mo->movefactor - 18*FRACUNIT; else - player->mo->movefactor = FRACUNIT; //player->mo->movefactor = ((player->mo->friction - 0xDB34)*(0xA))/0x80; + player->mo->movefactor = FRACUNIT; if (player->mo->movefactor < 32) player->mo->movefactor = 32; } - - // Wipeout slowdown - if (player->kartstuff[k_spinouttimer] && player->kartstuff[k_wipeoutslow]) - { - if (player->kartstuff[k_offroad]) - player->mo->friction -= 4912; - if (player->kartstuff[k_wipeoutslow] == 1) - player->mo->friction -= 9824; - } } K_KartDrift(player, onground); diff --git a/src/p_map.c b/src/p_map.c index 7487a7907..fbee5abf0 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -158,7 +158,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) object->z = spring->z + spring->height + 1; else if (vertispeed < 0) object->z = spring->z - object->height - 1; -#ifdef TELEPORTJANK +//#ifdef TELEPORTJANK else { fixed_t offx, offy; @@ -184,26 +184,35 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) // Set position! P_TryMove(object, spring->x + offx, spring->y + offy, true); } -#endif +//#endif if (vertispeed) + { + // Vertical springs object->momz = FixedMul(vertispeed,FixedSqrt(FixedMul(vscale, spring->scale))); - if (horizspeed) - { - if (!object->player) - P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(horizspeed,FixedSqrt(FixedMul(hscale, spring->scale)))); - else + // Diagonal springs + if (horizspeed) { - fixed_t finalSpeed = FixedDiv(horizspeed, hscale); - fixed_t pSpeed = object->player->speed; + if (!object->player) + P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(horizspeed,FixedSqrt(FixedMul(hscale, spring->scale)))); + else + { + fixed_t finalSpeed = FixedDiv(horizspeed, hscale); + fixed_t pSpeed = object->player->speed; - if (pSpeed > finalSpeed) - finalSpeed = pSpeed; + if (pSpeed > finalSpeed) + finalSpeed = pSpeed; - P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(finalSpeed,FixedSqrt(FixedMul(hscale, spring->scale)))); + P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(finalSpeed,FixedSqrt(FixedMul(hscale, spring->scale)))); + } } } + else if (horizspeed) + { + // Horizontal springs + P_Thrust(object, spring->angle, FixedMul(FixedDiv(horizspeed, hscale), FixedSqrt(FixedMul(hscale, spring->scale)))); + } // Re-solidify spring->flags |= (spring->info->flags & (MF_SPECIAL|MF_SOLID)); @@ -238,6 +247,9 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) localangle[3] = spring->angle; } } + + if (!vertispeed) // Less friction when hitting horizontal springs + object->player->kartstuff[k_tiregrease] = greasetics; } P_ResetPlayer(object->player); From 56c9641488a19edc279c0fe439d482d08ff34aee Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 12 Sep 2019 02:18:07 -0400 Subject: [PATCH 28/49] Back to old thrusts --- src/info.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/info.c b/src/info.c index 0579bf6d4..0a9c0cced 100644 --- a/src/info.c +++ b/src/info.c @@ -6245,7 +6245,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 56*FRACUNIT, // height 0, // display offset 0, // mass - 40*FRACUNIT, // damage + 36*FRACUNIT, // damage sfx_None, // activesound MF_SOLID|MF_SPRING|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags S_YHORIZ2 // raisestate @@ -6272,7 +6272,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 56*FRACUNIT, // height 0, // display offset 0, // mass - 80*FRACUNIT, // damage + 72*FRACUNIT, // damage sfx_None, // activesound MF_SOLID|MF_SPRING|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags S_RHORIZ2 // raisestate @@ -6299,7 +6299,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 56*FRACUNIT, // height 0, // display offset 0, // mass - 20*FRACUNIT, // damage + 18*FRACUNIT, // damage sfx_None, // activesound MF_SOLID|MF_SPRING|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags S_BHORIZ2 // raisestate From 97b09ba9c1a736efc92c02b761299001d329b603 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 12 Sep 2019 14:23:45 -0400 Subject: [PATCH 29/49] Grease part 2 --- src/g_game.c | 2 +- src/info.c | 6 +++--- src/p_map.c | 55 ++++++++++++++++++++-------------------------------- 3 files changed, 25 insertions(+), 38 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index f4711592d..e890627aa 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -216,7 +216,7 @@ INT32 sneakertime = TICRATE + (TICRATE/3); INT32 itemtime = 8*TICRATE; INT32 comebacktime = 10*TICRATE; INT32 bumptime = 6; -INT32 greasetics = 2*TICRATE; +INT32 greasetics = 3*TICRATE; INT32 wipeoutslowtime = 20; INT32 wantedreduce = 5*TICRATE; INT32 wantedfrequency = 10*TICRATE; diff --git a/src/info.c b/src/info.c index 0a9c0cced..9e949d24c 100644 --- a/src/info.c +++ b/src/info.c @@ -6245,7 +6245,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 56*FRACUNIT, // height 0, // display offset 0, // mass - 36*FRACUNIT, // damage + 18*FRACUNIT, // damage sfx_None, // activesound MF_SOLID|MF_SPRING|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags S_YHORIZ2 // raisestate @@ -6272,7 +6272,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 56*FRACUNIT, // height 0, // display offset 0, // mass - 72*FRACUNIT, // damage + 36*FRACUNIT, // damage sfx_None, // activesound MF_SOLID|MF_SPRING|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags S_RHORIZ2 // raisestate @@ -6299,7 +6299,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 56*FRACUNIT, // height 0, // display offset 0, // mass - 18*FRACUNIT, // damage + 9*FRACUNIT, // damage sfx_None, // activesound MF_SOLID|MF_SPRING|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags S_BHORIZ2 // raisestate diff --git a/src/p_map.c b/src/p_map.c index fbee5abf0..eb9ff8cc8 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -158,60 +158,50 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) object->z = spring->z + spring->height + 1; else if (vertispeed < 0) object->z = spring->z - object->height - 1; -//#ifdef TELEPORTJANK else { fixed_t offx, offy; - // Horizontal springs teleport you in FRONT of them. - object->momx = object->momy = 0; - // Overestimate the distance to position you at - offx = P_ReturnThrustX(spring, spring->angle, (spring->radius + object->radius + 1) * 2); - offy = P_ReturnThrustY(spring, spring->angle, (spring->radius + object->radius + 1) * 2); - - // Make it square by clipping - if (offx > (spring->radius + object->radius + 1)) - offx = spring->radius + object->radius + 1; - else if (offx < -(spring->radius + object->radius + 1)) - offx = -(spring->radius + object->radius + 1); - - if (offy > (spring->radius + object->radius + 1)) - offy = spring->radius + object->radius + 1; - else if (offy < -(spring->radius + object->radius + 1)) - offy = -(spring->radius + object->radius + 1); + offx = P_ReturnThrustX(spring, spring->angle, spring->radius + object->radius + 1); + offy = P_ReturnThrustY(spring, spring->angle, spring->radius + object->radius + 1); // Set position! P_TryMove(object, spring->x + offx, spring->y + offy, true); } -//#endif if (vertispeed) { // Vertical springs - object->momz = FixedMul(vertispeed,FixedSqrt(FixedMul(vscale, spring->scale))); + object->momz = FixedMul(vertispeed, FixedSqrt(FixedMul(vscale, spring->scale))); // Diagonal springs if (horizspeed) { - if (!object->player) - P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(horizspeed,FixedSqrt(FixedMul(hscale, spring->scale)))); - else + fixed_t finalSpeed = horizspeed; + + if (object->player) { - fixed_t finalSpeed = FixedDiv(horizspeed, hscale); - fixed_t pSpeed = object->player->speed; - - if (pSpeed > finalSpeed) - finalSpeed = pSpeed; - - P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(finalSpeed,FixedSqrt(FixedMul(hscale, spring->scale)))); + if (object->player->speed > finalSpeed) + finalSpeed = object->player->speed; } + + P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(finalSpeed, FixedSqrt(FixedMul(hscale, spring->scale)))); } } else if (horizspeed) { - // Horizontal springs - P_Thrust(object, spring->angle, FixedMul(FixedDiv(horizspeed, hscale), FixedSqrt(FixedMul(hscale, spring->scale)))); + fixed_t finalSpeed = horizspeed; + + if (object->player) + { + finalSpeed += object->player->speed; + // Less friction when hitting horizontal springs + object->player->kartstuff[k_tiregrease] = greasetics; + } + + // Add speed + P_Thrust(object, spring->angle, FixedMul(finalSpeed, FixedSqrt(FixedMul(hscale, spring->scale)))); } // Re-solidify @@ -247,9 +237,6 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) localangle[3] = spring->angle; } } - - if (!vertispeed) // Less friction when hitting horizontal springs - object->player->kartstuff[k_tiregrease] = greasetics; } P_ResetPlayer(object->player); From 40c8081a1ba2d19c7a26ae63cc698369fee42537 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 12 Sep 2019 19:26:00 -0400 Subject: [PATCH 30/49] Grease part 3 --- src/info.c | 6 ++-- src/p_map.c | 84 ++++++++++++++++++++++++++++++----------------------- 2 files changed, 50 insertions(+), 40 deletions(-) diff --git a/src/info.c b/src/info.c index 9e949d24c..a7fad9d76 100644 --- a/src/info.c +++ b/src/info.c @@ -6245,7 +6245,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 56*FRACUNIT, // height 0, // display offset 0, // mass - 18*FRACUNIT, // damage + 48*FRACUNIT, // damage sfx_None, // activesound MF_SOLID|MF_SPRING|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags S_YHORIZ2 // raisestate @@ -6272,7 +6272,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 56*FRACUNIT, // height 0, // display offset 0, // mass - 36*FRACUNIT, // damage + 72*FRACUNIT, // damage sfx_None, // activesound MF_SOLID|MF_SPRING|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags S_RHORIZ2 // raisestate @@ -6299,7 +6299,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 56*FRACUNIT, // height 0, // display offset 0, // mass - 9*FRACUNIT, // damage + 24*FRACUNIT, // damage sfx_None, // activesound MF_SOLID|MF_SPRING|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags S_BHORIZ2 // raisestate diff --git a/src/p_map.c b/src/p_map.c index eb9ff8cc8..9610aa7fb 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -122,6 +122,8 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) const fixed_t vscale = mapobjectscale + (object->scale - mapobjectscale); fixed_t vertispeed = spring->info->mass; fixed_t horizspeed = spring->info->damage; + fixed_t savemomx = 0; + fixed_t savemomy = 0; if (object->eflags & MFE_SPRUNG) // Object was already sprung this tic return false; @@ -154,6 +156,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) if (spring->eflags & MFE_VERTICALFLIP) vertispeed *= -1; + // Vertical springs teleport you on TOP of them. if (vertispeed > 0) object->z = spring->z + spring->height + 1; else if (vertispeed < 0) @@ -162,11 +165,26 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) { fixed_t offx, offy; - // Overestimate the distance to position you at - offx = P_ReturnThrustX(spring, spring->angle, spring->radius + object->radius + 1); - offy = P_ReturnThrustY(spring, spring->angle, spring->radius + object->radius + 1); + // Horizontal springs teleport you in FRONT of them. + savemomx = object->momx; + savemomy = object->momy; + object->momx = object->momy = 0; + + // Overestimate the distance to position you at + offx = P_ReturnThrustX(spring, spring->angle, (spring->radius + object->radius + 1) * 2); + offy = P_ReturnThrustY(spring, spring->angle, (spring->radius + object->radius + 1) * 2); + + // Then clip it down to a square, so it matches the hitbox size. + if (offx > (spring->radius + object->radius + 1)) + offx = spring->radius + object->radius + 1; + else if (offx < -(spring->radius + object->radius + 1)) + offx = -(spring->radius + object->radius + 1); + + if (offy > (spring->radius + object->radius + 1)) + offy = spring->radius + object->radius + 1; + else if (offy < -(spring->radius + object->radius + 1)) + offy = -(spring->radius + object->radius + 1); - // Set position! P_TryMove(object, spring->x + offx, spring->y + offy, true); } @@ -181,27 +199,44 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) fixed_t finalSpeed = horizspeed; if (object->player) - { - if (object->player->speed > finalSpeed) - finalSpeed = object->player->speed; - } + finalSpeed = max(object->player->speed, finalSpeed); // Horizontal speed is a minimum P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(finalSpeed, FixedSqrt(FixedMul(hscale, spring->scale)))); } } else if (horizspeed) { + angle_t reflect = spring->angle; fixed_t finalSpeed = horizspeed; + if (savemomx || savemomy) + { + angle_t momang, diff; + + momang = R_PointToAngle2(0, 0, savemomx, savemomy); + diff = (signed)(momang - spring->angle); + + reflect = (signed)(spring->angle - (diff*2)); + + if ((signed)reflect > (signed)(spring->angle + ANGLE_45)) + reflect = (spring->angle + ANGLE_45); + + if ((signed)reflect < (signed)(spring->angle - ANGLE_45)) + reflect = (spring->angle - ANGLE_45); + } + + // Scale to gamespeed + finalSpeed = FixedMul(finalSpeed, K_GetKartGameSpeedScalar(gamespeed)); + if (object->player) { - finalSpeed += object->player->speed; + // Horizontal speed is a minimum + finalSpeed = max(object->player->speed, finalSpeed); // Less friction when hitting horizontal springs - object->player->kartstuff[k_tiregrease] = greasetics; + object->player->kartstuff[k_tiregrease] = greasetics; //FixedMul(greasetics << FRACBITS, finalSpeed/72) >> FRACBITS } - // Add speed - P_Thrust(object, spring->angle, FixedMul(finalSpeed, FixedSqrt(FixedMul(hscale, spring->scale)))); + P_InstaThrustEvenIn2D(object, reflect, FixedMul(finalSpeed, FixedSqrt(FixedMul(hscale, spring->scale)))); } // Re-solidify @@ -214,31 +249,6 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) if (spring->flags & MF_ENEMY) // Spring shells P_SetTarget(&spring->target, object); - if (horizspeed) - { - const angle_t turnabout = ANGLE_90+ANGLE_45; - angle_t dangle = object->angle - spring->angle; - if (dangle > ANGLE_180) - dangle = InvAngle(dangle); - - if (dangle > turnabout || (object->player->cmd.forwardmove == 0 && object->player->cmd.sidemove == 0)) - { - object->angle = spring->angle; - - if (!demo.playback || P_AnalogMove(object->player)) - { - if (object->player == &players[consoleplayer]) - localangle[0] = spring->angle; - else if (object->player == &players[displayplayers[1]]) - localangle[1] = spring->angle; - else if (object->player == &players[displayplayers[2]]) - localangle[2] = spring->angle; - else if (object->player == &players[displayplayers[3]]) - localangle[3] = spring->angle; - } - } - } - P_ResetPlayer(object->player); } return true; From 0e35b65caaaebd5cd7a86f3a9c3a53d62b209990 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sat, 14 Sep 2019 23:47:08 -0400 Subject: [PATCH 31/49] Spring Bullshit, part (?) Who knows how many times I've had to rewrite this part but it FINALLY works properly for everything... --- src/p_map.c | 58 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 9610aa7fb..b934fe8e7 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -189,40 +189,45 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) } if (vertispeed) - { - // Vertical springs object->momz = FixedMul(vertispeed, FixedSqrt(FixedMul(vscale, spring->scale))); - // Diagonal springs - if (horizspeed) - { - fixed_t finalSpeed = horizspeed; - - if (object->player) - finalSpeed = max(object->player->speed, finalSpeed); // Horizontal speed is a minimum - - P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(finalSpeed, FixedSqrt(FixedMul(hscale, spring->scale)))); - } - } - else if (horizspeed) + if (horizspeed) { - angle_t reflect = spring->angle; + angle_t finalAngle = spring->angle; fixed_t finalSpeed = horizspeed; - if (savemomx || savemomy) + // Reflect your momentum angle against the surface of horizontal springs. + // This makes it a bit more interesting & unique than just being a speed boost in a pre-defined direction + if ((!vertispeed) && (savemomx || savemomy)) { - angle_t momang, diff; + angle_t momang; + INT32 angoffset; + boolean subtract = false; momang = R_PointToAngle2(0, 0, savemomx, savemomy); - diff = (signed)(momang - spring->angle); - reflect = (signed)(spring->angle - (diff*2)); + angoffset = momang; + angoffset -= spring->angle; // Subtract - if ((signed)reflect > (signed)(spring->angle + ANGLE_45)) - reflect = (spring->angle + ANGLE_45); + // Flip on wrong side + if ((angle_t)angoffset > ANGLE_180) + { + angoffset = InvAngle((angle_t)angoffset); + subtract = !subtract; + } - if ((signed)reflect < (signed)(spring->angle - ANGLE_45)) - reflect = (spring->angle - ANGLE_45); + // Fix going directly against the spring's angle sending you the wrong way + if ((spring->angle - momang) > ANGLE_90) + angoffset = ANGLE_180 - angoffset; + + angoffset /= 4; // Reduce amount so it feels more natural + + if (subtract) + angoffset = (signed)(spring->angle) - angoffset; + else + angoffset = (signed)(spring->angle) + angoffset; + + finalAngle = angoffset; } // Scale to gamespeed @@ -232,11 +237,13 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) { // Horizontal speed is a minimum finalSpeed = max(object->player->speed, finalSpeed); + // Less friction when hitting horizontal springs - object->player->kartstuff[k_tiregrease] = greasetics; //FixedMul(greasetics << FRACBITS, finalSpeed/72) >> FRACBITS + if (!vertispeed) + object->player->kartstuff[k_tiregrease] = greasetics; //FixedMul(greasetics << FRACBITS, finalSpeed/72) >> FRACBITS } - P_InstaThrustEvenIn2D(object, reflect, FixedMul(finalSpeed, FixedSqrt(FixedMul(hscale, spring->scale)))); + P_InstaThrustEvenIn2D(object, finalAngle, FixedMul(finalSpeed, FixedSqrt(FixedMul(hscale, spring->scale)))); } // Re-solidify @@ -251,6 +258,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) P_ResetPlayer(object->player); } + return true; } From 004bae45c5cd6e800eb0ea94c67bf9c158f9dc74 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 15 Sep 2019 00:27:28 -0400 Subject: [PATCH 32/49] Buff drift-steering during the grease period --- src/k_kart.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 0555504af..5f3b778fa 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -5435,15 +5435,16 @@ static INT16 K_GetKartDriftValue(player_t *player, fixed_t countersteer) return 0; if (player->kartstuff[k_driftend] != 0) - { return -266*player->kartstuff[k_drift]; // Drift has ended and we are tweaking their angle back a bit - } //basedrift = 90*player->kartstuff[k_drift]; // 450 //basedrift = 93*player->kartstuff[k_drift] - driftweight*3*player->kartstuff[k_drift]/10; // 447 - 303 basedrift = 83*player->kartstuff[k_drift] - (driftweight - 14)*player->kartstuff[k_drift]/5; // 415 - 303 driftangle = abs((252 - driftweight)*player->kartstuff[k_drift]/5); + if (player->kartstuff[k_tiregrease] > 0) // Buff drift-steering while in greasemode + turnvalue += (turnvalue / greasetics) * player->kartstuff[k_tiregrease]; + return basedrift + FixedMul(driftangle, countersteer); } From 16bd11f53f90a993983b3e58ea421792e17bd24f Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 15 Sep 2019 00:32:58 -0400 Subject: [PATCH 33/49] Wrong var name --- src/k_kart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index 5f3b778fa..b3848837f 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -5443,7 +5443,7 @@ static INT16 K_GetKartDriftValue(player_t *player, fixed_t countersteer) driftangle = abs((252 - driftweight)*player->kartstuff[k_drift]/5); if (player->kartstuff[k_tiregrease] > 0) // Buff drift-steering while in greasemode - turnvalue += (turnvalue / greasetics) * player->kartstuff[k_tiregrease]; + basedrift += (basedrift / greasetics) * player->kartstuff[k_tiregrease]; return basedrift + FixedMul(driftangle, countersteer); } From 57380711000e7c5836c2f9d93bab420c24108eef Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 15 Sep 2019 00:49:10 -0400 Subject: [PATCH 34/49] Horizontal/diagonal springs use all object's speed, instead of only players --- src/p_map.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index b934fe8e7..2aaa9df63 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -195,6 +195,12 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) { angle_t finalAngle = spring->angle; fixed_t finalSpeed = horizspeed; + fixed_t objectSpeed; + + if (object->player) + objectSpeed = object->player->speed; + else + objectSpeed = R_PointToDist2(0, 0, savemomx, savemomy); // Reflect your momentum angle against the surface of horizontal springs. // This makes it a bit more interesting & unique than just being a speed boost in a pre-defined direction @@ -220,7 +226,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) if ((spring->angle - momang) > ANGLE_90) angoffset = ANGLE_180 - angoffset; - angoffset /= 4; // Reduce amount so it feels more natural + angoffset /= 6; // Reduce amount so it feels more natural if (subtract) angoffset = (signed)(spring->angle) - angoffset; @@ -232,12 +238,11 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) // Scale to gamespeed finalSpeed = FixedMul(finalSpeed, K_GetKartGameSpeedScalar(gamespeed)); + // Horizontal speed is used as a minimum thrust, not a direct replacement + finalSpeed = max(objectSpeed, finalSpeed); if (object->player) { - // Horizontal speed is a minimum - finalSpeed = max(object->player->speed, finalSpeed); - // Less friction when hitting horizontal springs if (!vertispeed) object->player->kartstuff[k_tiregrease] = greasetics; //FixedMul(greasetics << FRACBITS, finalSpeed/72) >> FRACBITS From 26e34a1fa15849f2512beb083b39b0a374005f2e Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 16 Sep 2019 03:04:26 -0400 Subject: [PATCH 35/49] Use maps.pk3 --- assets/CMakeLists.txt | 2 +- src/config.h.in | 4 ++-- src/d_main.c | 14 +++++++++++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/assets/CMakeLists.txt b/assets/CMakeLists.txt index 89be796ad..e5cfa5ca2 100644 --- a/assets/CMakeLists.txt +++ b/assets/CMakeLists.txt @@ -17,7 +17,7 @@ set(SRB2_ASSET_HASHED gfx.pk3;\ textures.pk3;\ chars.pk3;\ -maps.wad;\ +maps.pk3;\ patch.pk3" CACHE STRING "Asset filenames to apply MD5 checks. No spaces between entries!" ) diff --git a/src/config.h.in b/src/config.h.in index 4bf84ff1d..964207e34 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -15,7 +15,7 @@ #define ASSET_HASH_GFX_PK3 "${SRB2_ASSET_gfx.pk3_HASH}" #define ASSET_HASH_TEXTURES_PK3 "${SRB2_ASSET_textures.pk3_HASH}" #define ASSET_HASH_CHARS_PK3 "${SRB2_ASSET_chars.pk3_HASH}" -#define ASSET_HASH_MAPS_WAD "${SRB2_ASSET_maps.wad_HASH}" +#define ASSET_HASH_MAPS_PK3 "${SRB2_ASSET_maps.pk3_HASH}" #ifdef USE_PATCH_FILE #define ASSET_HASH_PATCH_PK3 "${SRB2_ASSET_patch.pk3_HASH}" #endif @@ -36,7 +36,7 @@ #define ASSET_HASH_GFX_PK3 "00000000000000000000000000000000" #define ASSET_HASH_TEXTURES_PK3 "00000000000000000000000000000000" #define ASSET_HASH_CHARS_PK3 "00000000000000000000000000000000" -#define ASSET_HASH_MAPS_WAD "00000000000000000000000000000000" +#define ASSET_HASH_MAPS_PK3 "00000000000000000000000000000000" #ifdef USE_PATCH_FILE #define ASSET_HASH_PATCH_PK3 "00000000000000000000000000000000" #endif diff --git a/src/d_main.c b/src/d_main.c index 1404a5e61..5c8e34bde 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -896,11 +896,18 @@ static void IdentifyVersion(void) D_AddFile(va(pandf,srb2waddir,"gfx.pk3"), startupwadfiles); D_AddFile(va(pandf,srb2waddir,"textures.pk3"), startupwadfiles); D_AddFile(va(pandf,srb2waddir,"chars.pk3"), startupwadfiles); - D_AddFile(va(pandf,srb2waddir,"maps.wad"), startupwadfiles); // TODO: make this a pk3 too! + D_AddFile(va(pandf,srb2waddir,"maps.pk3"), startupwadfiles); #ifdef USE_PATCH_FILE D_AddFile(va(pandf,srb2waddir,"patch.pk3"), startupwadfiles); #endif +#if 0 + // TODO: pk3 doesn't support music replacement IIRC + // music barely benefits from the compression anyway + // would be nice for the folders, though + D_AddFile(va(pandf,srb2waddir,"sounds.pk3"), startupwadfiles); + D_AddFile(va(pandf,srb2waddir,"music.pk3"), startupwadfiles); +#else #if !defined (HAVE_SDL) || defined (HAVE_MIXER) #define MUSICTEST(str) \ {\ @@ -915,6 +922,7 @@ static void IdentifyVersion(void) MUSICTEST("music.wad") #undef MUSICTEST #endif +#endif } /* ======================================================================== */ @@ -1200,7 +1208,7 @@ void D_SRB2Main(void) mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_GFX_PK3); // gfx.pk3 mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_TEXTURES_PK3); // textures.pk3 mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_CHARS_PK3); // chars.pk3 - mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_MAPS_WAD); // maps.wad -- 4 - If you touch this, make sure to touch up the majormods stuff below. + mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_MAPS_PK3); // maps.pk3 -- 4 - If you touch this, make sure to touch up the majormods stuff below. #ifdef USE_PATCH_FILE mainwads++; W_VerifyFileMD5(mainwads, ASSET_HASH_PATCH_PK3); // patch.pk3 #endif @@ -1208,7 +1216,7 @@ void D_SRB2Main(void) mainwads++; // gfx.pk3 mainwads++; // textures.pk3 mainwads++; // chars.pk3 - mainwads++; // maps.wad + mainwads++; // maps.pk3 #ifdef USE_PATCH_FILE mainwads++; // patch.pk3 #endif From 22ccce6f24e84c897b4c68905bf58634bd276562 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 16 Sep 2019 20:47:13 -0400 Subject: [PATCH 36/49] Modify angle offset with your speed vs the spring's speed Blue springs will send you more at a reflected momentum angle, while red springs will send you more straight --- src/p_map.c | 75 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 42 insertions(+), 33 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 2aaa9df63..22c6755e7 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -202,45 +202,51 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) else objectSpeed = R_PointToDist2(0, 0, savemomx, savemomy); - // Reflect your momentum angle against the surface of horizontal springs. - // This makes it a bit more interesting & unique than just being a speed boost in a pre-defined direction - if ((!vertispeed) && (savemomx || savemomy)) + if (!vertispeed) { - angle_t momang; - INT32 angoffset; - boolean subtract = false; + // Scale to gamespeed + finalSpeed = FixedMul(finalSpeed, K_GetKartGameSpeedScalar(gamespeed)); - momang = R_PointToAngle2(0, 0, savemomx, savemomy); - - angoffset = momang; - angoffset -= spring->angle; // Subtract - - // Flip on wrong side - if ((angle_t)angoffset > ANGLE_180) + // Reflect your momentum angle against the surface of horizontal springs. + // This makes it a bit more interesting & unique than just being a speed boost in a pre-defined direction + if (savemomx || savemomy) { - angoffset = InvAngle((angle_t)angoffset); - subtract = !subtract; + angle_t momang; + INT32 angoffset; + boolean subtract = false; + + momang = R_PointToAngle2(0, 0, savemomx, savemomy); + + angoffset = momang; + angoffset -= spring->angle; // Subtract + + // Flip on wrong side + if ((angle_t)angoffset > ANGLE_180) + { + angoffset = InvAngle((angle_t)angoffset); + subtract = !subtract; + } + + // Fix going directly against the spring's angle sending you the wrong way + if ((spring->angle - momang) > ANGLE_90) + angoffset = ANGLE_180 - angoffset; + + // Offset is reduced to cap it (90 / 2 = max of 45 degrees) + angoffset /= 2; + + // Reduce further based on how slow your speed is compared to the spring's speed + if (finalSpeed > objectSpeed) + angoffset = FixedDiv(angoffset, FixedDiv(finalSpeed, objectSpeed)); + + if (subtract) + angoffset = (signed)(spring->angle) - angoffset; + else + angoffset = (signed)(spring->angle) + angoffset; + + finalAngle = angoffset; } - - // Fix going directly against the spring's angle sending you the wrong way - if ((spring->angle - momang) > ANGLE_90) - angoffset = ANGLE_180 - angoffset; - - angoffset /= 6; // Reduce amount so it feels more natural - - if (subtract) - angoffset = (signed)(spring->angle) - angoffset; - else - angoffset = (signed)(spring->angle) + angoffset; - - finalAngle = angoffset; } - // Scale to gamespeed - finalSpeed = FixedMul(finalSpeed, K_GetKartGameSpeedScalar(gamespeed)); - // Horizontal speed is used as a minimum thrust, not a direct replacement - finalSpeed = max(objectSpeed, finalSpeed); - if (object->player) { // Less friction when hitting horizontal springs @@ -248,6 +254,9 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) object->player->kartstuff[k_tiregrease] = greasetics; //FixedMul(greasetics << FRACBITS, finalSpeed/72) >> FRACBITS } + // Horizontal speed is used as a minimum thrust, not a direct replacement + finalSpeed = max(objectSpeed, finalSpeed); + P_InstaThrustEvenIn2D(object, finalAngle, FixedMul(finalSpeed, FixedSqrt(FixedMul(hscale, spring->scale)))); } From 5023abd279e1b745856f56288524b3cfaadca7f5 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 18 Sep 2019 02:26:14 -0400 Subject: [PATCH 37/49] Blue springs are Chaotix strong, grey springs are stronger & have diagonal/horizontal types, spring doomednums are reorganized --- src/dehacked.c | 33 ++++--- src/info.c | 237 ++++++++++++++++++++++++++++--------------------- src/info.h | 38 +++++--- 3 files changed, 182 insertions(+), 126 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 51eb820bb..616a81ee9 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -5627,6 +5627,12 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_BLUESPRING3", "S_BLUESPRING4", + // Grey Spring + "S_GREYSPRING1", + "S_GREYSPRING2", + "S_GREYSPRING3", + "S_GREYSPRING4", + // Yellow Diagonal Spring "S_YDIAG1", "S_YDIAG2", @@ -5645,6 +5651,12 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_BDIAG3", "S_BDIAG4", + // Grey Diagonal Spring + "S_GDIAG1", + "S_GDIAG2", + "S_GDIAG3", + "S_GDIAG4", + // Yellow Horizontal Spring "S_YHORIZ1", "S_YHORIZ2", @@ -5663,6 +5675,12 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_BHORIZ3", "S_BHORIZ4", + // Grey Horizontal Spring + "S_GHORIZ1", + "S_GHORIZ2", + "S_GHORIZ3", + "S_GHORIZ4", + // Rain "S_RAIN1", "S_RAINRETURN", @@ -6286,16 +6304,6 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_SRB1_GENREX1", "S_SRB1_GENREX2", - // Gray Springs - "S_GRAYSPRING", - "S_GRAYSPRING2", - "S_GRAYSPRING3", - "S_GRAYSPRING4", - "S_GRAYSPRING5", - - // Invis-spring - this is used just for the sproing sound. - "S_INVISSPRING", - //{ Random Item Box "S_RANDOMITEM1", "S_RANDOMITEM2", @@ -7336,12 +7344,15 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_YELLOWSPRING", "MT_REDSPRING", "MT_BLUESPRING", + "MT_GREYSPRING", "MT_YELLOWDIAG", // Yellow Diagonal Spring "MT_REDDIAG", // Red Diagonal Spring "MT_BLUEDIAG", // Blue Diagonal Spring + "MT_GREYDIAG", // Grey Diagonal Spring "MT_YELLOWHORIZ", // Yellow Horizontal Spring "MT_REDHORIZ", // Red Horizontal Spring "MT_BLUEHORIZ", // Blue Horizontal Spring + "MT_GREYHORIZ", // Grey Horizontal Spring // Interactive Objects "MT_BUBBLES", // Bubble source @@ -7723,8 +7734,6 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_SRB1_GENREX", // SRB2kart - "MT_GRAYSPRING", - "MT_INVISSPRING", "MT_RANDOMITEM", "MT_RANDOMITEMPOP", "MT_FLOATINGITEM", diff --git a/src/info.c b/src/info.c index a7fad9d76..274cee440 100644 --- a/src/info.c +++ b/src/info.c @@ -43,33 +43,34 @@ char sprnames[NUMSPRITES + 1][5] = "DFLM","XMS1","XMS2","XMS3","BSZ1","BSZ2","BSZ3","BSZ4","BSZ5","BSZ6", "BSZ7","BSZ8","STLG","DBAL","RCRY","ARMA","ARMF","ARMB","WIND","MAGN", "ELEM","FORC","PITY","IVSP","SSPK","GOAL","BIRD","BUNY","MOUS","CHIC", - "COWZ","RBRD","SPVY","SPVR","SPVB","SPDY","SPDR","SPDB","SPHY","SPHR", - "SPHB","RAIN","SNO1","SPLH","SPLA","SMOK","BUBP","BUBO","BUBN","BUBM", - "POPP","TFOG","SEED","PRTL","SCOR","DRWN","TTAG","GFLG","RRNG","RNGB", - "RNGR","RNGI","RNGA","RNGE","RNGS","RNGG","PIKB","PIKR","PIKA","PIKE", - "PIKS","PIKG","TAUT","TGRE","TSCR","COIN","CPRK","GOOM","BGOM","FFWR", - "FBLL","SHLL","PUMA","HAMM","KOOP","BFLM","MAXE","MUS1","MUS2","TOAD", - "NDRN","SUPE","SUPZ","NDRL","NSPK","NBMP","HOOP","NSCR","NPRU","CAPS", - "SUPT","SPRK","BOM1","BOM2","BOM3","BOM4","ROIA","ROIB","ROIC","ROID", - "ROIE","ROIF","ROIG","ROIH","ROII","ROIJ","ROIK","ROIL","ROIM","ROIN", - "ROIO","ROIP","BBAL","GWLG","GWLR","SRBA","SRBB","SRBC","SRBD","SRBE", - "SRBF","SRBG","SRBH","SRBI","SRBJ","SRBK","SRBL","SRBM","SRBN","SRBO", + "COWZ","RBRD","SPVY","SPVR","SPVB","SPVG","SPDY","SPDR","SPDB","SPDG", + "SPHY","SPHR","SPHB","SPHG","RAIN","SNO1","SPLH","SPLA","SMOK","BUBP", + "BUBO","BUBN","BUBM","POPP","TFOG","SEED","PRTL","SCOR","DRWN","TTAG", + "GFLG","RRNG","RNGB","RNGR","RNGI","RNGA","RNGE","RNGS","RNGG","PIKB", + "PIKR","PIKA","PIKE","PIKS","PIKG","TAUT","TGRE","TSCR","COIN","CPRK", + "GOOM","BGOM","FFWR","FBLL","SHLL","PUMA","HAMM","KOOP","BFLM","MAXE", + "MUS1","MUS2","TOAD","NDRN","SUPE","SUPZ","NDRL","NSPK","NBMP","HOOP", + "NSCR","NPRU","CAPS","SUPT","SPRK","BOM1","BOM2","BOM3","BOM4","ROIA", + "ROIB","ROIC","ROID","ROIE","ROIF","ROIG","ROIH","ROII","ROIJ","ROIK", + "ROIL","ROIM","ROIN","ROIO","ROIP","BBAL","GWLG","GWLR","SRBA","SRBB", + "SRBC","SRBD","SRBE","SRBF","SRBG","SRBH","SRBI","SRBJ","SRBK","SRBL", + "SRBM","SRBN","SRBO", //SRB2kart Sprites - "SPRG","RNDM","RPOP","SGNS","FAST","DSHR","BOST","BOSM","KFRE","KINV", - "KINF","WIPD","DRIF","BDRF","DUST","RSHE","FITM","BANA","ORBN","JAWZ", - "SSMN","KRBM","BHOG","BHBM","SPBM","THNS","SINK","SITR","KBLN","DEZL", - "POKE","AUDI","DECO","DOOD","SNES","GBAS","SPRS","BUZB","CHOM","SACO", - "CRAB","SHAD","BRNG","BUMP","FLEN","CLAS","PSHW","ISTA","ISTB","ARRO", - "ITEM","ITMO","ITMI","ITMN","WANT","PBOM","HIT1","HIT2","HIT3","RETI", - "AIDU","KSPK","LZI1","LZI2","KLIT","FZSM","FZBM","FPRT","SBUS","MARB", - "FUFO","RUST","BLON","VAPE","HTZA","HTZB","SGVA","SGVB","SGVC","PGTR", - "PGF1","PGF2","PGF3","PGBH","DPLR","SPTL","ENM1","GARU","MARR","REAP", - "JITB","CDMO","CDBU","PINE","PPLR","DPPT","AATR","COCO","BDST","FROG", - "CBRA","HOLE","BBRA","EGFG","SMKP","MTYM","THWP","SNOB","ICEB","CNDL", - "DOCH","DUCK","GTRE","CHES","CHIM","DRGN","LZMN","PGSS","ZTCH","MKMA", - "MKMP","RTCH","BOWL","BOWH","BRRL","BRRR","HRSE","TOAH","BFRT","OFRT", - "RFRT","PFRT","ASPK","HBST","HBSO","HBSF","WBLZ","WBLN","FWRK","MXCL", - "RGSP","DRAF","XMS4","XMS5","VIEW" + "RNDM","RPOP","SGNS","FAST","DSHR","BOST","BOSM","KFRE","KINV","KINF", + "WIPD","DRIF","BDRF","DUST","RSHE","FITM","BANA","ORBN","JAWZ","SSMN", + "KRBM","BHOG","BHBM","SPBM","THNS","SINK","SITR","KBLN","DEZL","POKE", + "AUDI","DECO","DOOD","SNES","GBAS","SPRS","BUZB","CHOM","SACO","CRAB", + "SHAD","BRNG","BUMP","FLEN","CLAS","PSHW","ISTA","ISTB","ARRO","ITEM", + "ITMO","ITMI","ITMN","WANT","PBOM","HIT1","HIT2","HIT3","RETI","AIDU", + "KSPK","LZI1","LZI2","KLIT","FZSM","FZBM","FPRT","SBUS","MARB","FUFO", + "RUST","BLON","VAPE","HTZA","HTZB","SGVA","SGVB","SGVC","PGTR","PGF1", + "PGF2","PGF3","PGBH","DPLR","SPTL","ENM1","GARU","MARR","REAP","JITB", + "CDMO","CDBU","PINE","PPLR","DPPT","AATR","COCO","BDST","FROG","CBRA", + "HOLE","BBRA","EGFG","SMKP","MTYM","THWP","SNOB","ICEB","CNDL","DOCH", + "DUCK","GTRE","CHES","CHIM","DRGN","LZMN","PGSS","ZTCH","MKMA","MKMP", + "RTCH","BOWL","BOWH","BRRL","BRRR","HRSE","TOAH","BFRT","OFRT","RFRT", + "PFRT","ASPK","HBST","HBSO","HBSF","WBLZ","WBLN","FWRK","MXCL","RGSP", + "DRAF","XMS4","XMS5","VIEW" }; // Doesn't work with g++, needs actionf_p1 (don't modify this comment) @@ -1812,6 +1813,12 @@ state_t states[NUMSTATES] = {SPR_SPVB, 0, 1, {NULL}, 0, 0, S_BLUESPRING4}, // S_BLUESPRING3 {SPR_SPVB, 2, 4, {NULL}, 0, 0, S_BLUESPRING1}, // S_BLUESPRING4 + // Grey Spring + {SPR_SPVG, 0, -1, {NULL}, 0, 0, S_NULL}, // S_GREYSPRING1 + {SPR_SPVG, 1, 1, {A_Pain}, 0, 0, S_GREYSPRING3}, // S_GREYSPRING2 + {SPR_SPVG, 0, 1, {NULL}, 0, 0, S_GREYSPRING4}, // S_GREYSPRING3 + {SPR_SPVG, 2, 4, {NULL}, 0, 0, S_GREYSPRING1}, // S_GREYSPRING4 + // Yellow Diagonal Spring {SPR_SPDY, 0, -1, {NULL}, 0, 0, S_NULL}, // S_YDIAG1 {SPR_SPDY, 1, 1, {A_Pain}, 0, 0, S_YDIAG3}, // S_YDIAG2 @@ -1830,6 +1837,12 @@ state_t states[NUMSTATES] = {SPR_SPDB, 0, 1, {NULL}, 0, 0, S_BDIAG4}, // S_BDIAG3 {SPR_SPDB, 2, 4, {NULL}, 0, 0, S_BDIAG1}, // S_BDIAG4 + // Grey Diagonal Spring + {SPR_SPDG, 0, -1, {NULL}, 0, 0, S_NULL}, // S_GDIAG1 + {SPR_SPDG, 1, 1, {A_Pain}, 0, 0, S_GDIAG3}, // S_GDIAG2 + {SPR_SPDG, 0, 1, {NULL}, 0, 0, S_GDIAG4}, // S_GDIAG3 + {SPR_SPDG, 2, 4, {NULL}, 0, 0, S_GDIAG1}, // S_GDIAG4 + // Yellow Horizontal Spring {SPR_SPHY, 0, -1, {NULL}, 0, 0, S_NULL}, // S_YHORIZ1 {SPR_SPHY, 1, 1, {A_Pain}, 0, 0, S_YHORIZ3}, // S_YHORIZ2 @@ -1848,6 +1861,12 @@ state_t states[NUMSTATES] = {SPR_SPHB, 0, 1, {NULL}, 0, 0, S_BHORIZ4}, // S_BHORIZ3 {SPR_SPHB, 2, 4, {NULL}, 0, 0, S_BHORIZ1}, // S_BHORIZ4 + // Grey Horizontal Spring + {SPR_SPHG, 0, -1, {NULL}, 0, 0, S_NULL}, // S_GHORIZ1 + {SPR_SPHG, 1, 1, {A_Pain}, 0, 0, S_GHORIZ3}, // S_GHORIZ2 + {SPR_SPHG, 0, 1, {NULL}, 0, 0, S_GHORIZ4}, // S_GHORIZ3 + {SPR_SPHG, 2, 4, {NULL}, 0, 0, S_GHORIZ1}, // S_GHORIZ4 + // Rain {SPR_RAIN, FF_TRANS50, -1, {NULL}, 0, 0, S_NULL}, // S_RAIN1 {SPR_RAIN, FF_TRANS50, 1, {NULL}, 0, 0, S_RAIN1}, // S_RAINRETURN @@ -2525,14 +2544,6 @@ state_t states[NUMSTATES] = {SPR_SRBO, 0, 2, {A_BuzzFly}, 0, 0, S_SRB1_GENREX2}, // S_SRB1_GENREX2 // SRB2kart - {SPR_SPRG, 0, -1, {NULL}, 0, 0, S_NULL}, // S_GRAYSPRING - {SPR_SPRG, 4, 4, {A_Pain}, 0, 0, S_GRAYSPRING3}, // S_GRAYSPRING2 - {SPR_SPRG, 3, 1, {NULL}, 0, 0, S_GRAYSPRING4}, // S_GRAYSPRING3 - {SPR_SPRG, 2, 1, {NULL}, 0, 0, S_GRAYSPRING5}, // S_GRAYSPRING4 - {SPR_SPRG, 1, 1, {NULL}, 0, 0, S_GRAYSPRING}, // S_GRAYSPRING5 - - {SPR_NULL, 0, 1, {A_Pain}, 0, 0, S_INVISIBLE}, // S_INVISSPRING - {SPR_RNDM, 0|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_RANDOMITEM2}, // S_RANDOMITEM1 {SPR_RNDM, 1|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_RANDOMITEM3}, // S_RANDOMITEM2 {SPR_RNDM, 2|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_RANDOMITEM4}, // S_RANDOMITEM3 @@ -6082,7 +6093,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 48*FRACUNIT, // radius 32*FRACUNIT, // height 0, // display offset - 26*FRACUNIT, // mass + 25*FRACUNIT, // mass 0, // damage sfx_None, // activesound MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags @@ -6136,15 +6147,42 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 48*FRACUNIT, // radius 32*FRACUNIT, // height 0, // display offset - 14*FRACUNIT, // mass + 64*FRACUNIT, // mass 0, // damage sfx_None, // activesound MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags S_BLUESPRING2 // raisestate }, + { // MT_GREYSPRING + 553, // doomednum + S_GREYSPRING1, // spawnstate + 1000, // spawnhealth + S_GREYSPRING2, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_s3kb1, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 48*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 15*FRACUNIT, // mass + 0, // damage + sfx_None, // activesound + MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags + S_GREYSPRING2 // raisestate + }, + { // MT_YELLOWDIAG - 555, // doomednum + 554, // doomednum S_YDIAG1, // spawnstate 1, // spawnhealth S_YDIAG2, // seestate @@ -6163,15 +6201,15 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 48*FRACUNIT, // radius 56*FRACUNIT, // height 0, // display offset - 26*FRACUNIT, // mass - 26*FRACUNIT, // damage + 25*FRACUNIT, // mass + 25*FRACUNIT, // damage sfx_None, // activesound MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags S_YDIAG2 // raisestate }, { // MT_REDDIAG - 556, // doomednum + 555, // doomednum S_RDIAG1, // spawnstate 1, // spawnhealth S_RDIAG2, // seestate @@ -6198,7 +6236,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_BLUEDIAG - 557, // doomednum + 556, // doomednum S_BDIAG1, // spawnstate 1, // spawnhealth S_BDIAG2, // seestate @@ -6217,13 +6255,40 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 48*FRACUNIT, // radius 56*FRACUNIT, // height 0, // display offset - 14*FRACUNIT, // mass - 14*FRACUNIT, // damage + 64*FRACUNIT, // mass + 64*FRACUNIT, // damage sfx_None, // activesound MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags S_BDIAG2 // raisestate }, + { // MT_GREYDIAG + 557, // doomednum + S_GDIAG1, // spawnstate + 1, // spawnhealth + S_GDIAG2, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_s3kb1, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 48*FRACUNIT, // radius + 56*FRACUNIT, // height + 0, // display offset + 15*FRACUNIT, // mass + 15*FRACUNIT, // damage + sfx_None, // activesound + MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags + S_GDIAG2 // raisestate + }, + { // MT_YELLOWHORIZ 558, // doomednum S_YHORIZ1, // spawnstate @@ -6245,7 +6310,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 56*FRACUNIT, // height 0, // display offset 0, // mass - 48*FRACUNIT, // damage + 45*FRACUNIT, // damage sfx_None, // activesound MF_SOLID|MF_SPRING|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags S_YHORIZ2 // raisestate @@ -6299,12 +6364,39 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 56*FRACUNIT, // height 0, // display offset 0, // mass - 24*FRACUNIT, // damage + 115*FRACUNIT, // damage sfx_None, // activesound MF_SOLID|MF_SPRING|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags S_BHORIZ2 // raisestate }, + { // MT_GREYHORIZ + 561, // doomednum + S_GHORIZ1, // spawnstate + 1, // spawnhealth + S_GHORIZ2, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_s3kb1, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 48*FRACUNIT, // radius + 56*FRACUNIT, // height + 0, // display offset + 0, // mass + 27*FRACUNIT, // damage + sfx_None, // activesound + MF_SOLID|MF_SPRING|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags + S_GHORIZ2 // raisestate + }, + { // MT_BUBBLES 500, // doomednum S_BUBBLES1, // spawnstate @@ -14912,61 +15004,6 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, // SRB2kart MT's - - { // MT_GRAYSPRING - 553, // doomednum - S_GRAYSPRING, // spawnstate - 100, // spawnhealth - S_GRAYSPRING2, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_None, // attacksound - S_NULL, // painstate - 0, // painchance - sfx_s3kb1, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_NULL, // deathstate - S_NULL, // xdeathstate - sfx_None, // deathsound - 0, // speed - 20*FRACUNIT, // radius - 16*FRACUNIT, // height - 0, // display offset - 6*FRACUNIT, // mass - 0, // damage - sfx_None, // activesound - MF_SOLID|MF_SPRING|MF_DONTENCOREMAP, // flags - S_GRAYSPRING2 // raisestate - }, - - { // MT_INVISSPRING - 554, // doomednum - S_INVISIBLE, // spawnstate - 100, // spawnhealth - S_INVISSPRING, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_None, // attacksound - S_NULL, // painstate - 0, // painchance - sfx_s3kb1, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_NULL, // deathstate - S_NULL, // xdeathstate - sfx_None, // deathsound - 0, // speed - 20*FRACUNIT, // radius - 16*FRACUNIT, // height - 0, // display offset - 6*FRACUNIT, // mass - 0, // damage - sfx_None, // activesound - MF_SOLID|MF_SPRING, // flags - S_INVISSPRING // raisestate - }, - { // MT_RANDOMITEM 2000, // doomednum S_RANDOMITEM1, // spawnstate diff --git a/src/info.h b/src/info.h index 755b2f76b..d4291f9d0 100644 --- a/src/info.h +++ b/src/info.h @@ -462,12 +462,15 @@ typedef enum sprite SPR_SPVY, // Yellow Vertical Spring SPR_SPVR, // Red Vertical Spring SPR_SPVB, // Blue Vertical Spring + SPR_SPVG, // Grey Vertical Spring SPR_SPDY, // Yellow Diagonal Spring SPR_SPDR, // Red Diagonal Spring SPR_SPDB, // Blue Diagonal Spring + SPR_SPDG, // Grey Diagonal Spring SPR_SPHY, // Yellow Horizontal Spring SPR_SPHR, // Red Horizontal Spring SPR_SPHB, // Blue Horizontal Spring + SPR_SPHG, // Grey Horizontal Spring // Environmental Effects SPR_RAIN, // Rain @@ -591,8 +594,6 @@ typedef enum sprite SPR_SRBO, // Springs - SPR_SPRG, // Gray Spring - SPR_RNDM, // Random Item Box SPR_RPOP, // Random Item Box Pop SPR_SGNS, // Signpost sparkle @@ -2512,6 +2513,12 @@ typedef enum state S_BLUESPRING3, S_BLUESPRING4, + // Grey Spring + S_GREYSPRING1, + S_GREYSPRING2, + S_GREYSPRING3, + S_GREYSPRING4, + // Yellow Diagonal Spring S_YDIAG1, S_YDIAG2, @@ -2530,6 +2537,12 @@ typedef enum state S_BDIAG3, S_BDIAG4, + // Grey Diagonal Spring + S_GDIAG1, + S_GDIAG2, + S_GDIAG3, + S_GDIAG4, + // Yellow Horizontal Spring S_YHORIZ1, S_YHORIZ2, @@ -2548,6 +2561,12 @@ typedef enum state S_BHORIZ3, S_BHORIZ4, + // Grey Horizontal Spring + S_GHORIZ1, + S_GHORIZ2, + S_GHORIZ3, + S_GHORIZ4, + // Rain S_RAIN1, S_RAINRETURN, @@ -3171,16 +3190,6 @@ typedef enum state S_SRB1_GENREX1, S_SRB1_GENREX2, - // Gray Springs - S_GRAYSPRING, - S_GRAYSPRING2, - S_GRAYSPRING3, - S_GRAYSPRING4, - S_GRAYSPRING5, - - // Invis-spring - this is used just for the sproing sound. - S_INVISSPRING, - //{ Random Item Box S_RANDOMITEM1, S_RANDOMITEM2, @@ -4253,12 +4262,15 @@ typedef enum mobj_type MT_YELLOWSPRING, MT_REDSPRING, MT_BLUESPRING, + MT_GREYSPRING, MT_YELLOWDIAG, // Yellow Diagonal Spring MT_REDDIAG, // Red Diagonal Spring MT_BLUEDIAG, // Blue Diagonal Spring + MT_GREYDIAG, // Grey Diagonal Spring MT_YELLOWHORIZ, // Yellow Horizontal Spring MT_REDHORIZ, // Red Horizontal Spring MT_BLUEHORIZ, // Blue Horizontal Spring + MT_GREYHORIZ, // Grey Horizontal Spring // Interactive Objects MT_BUBBLES, // Bubble source @@ -4640,8 +4652,6 @@ typedef enum mobj_type MT_SRB1_GENREX, // SRB2kart - MT_GRAYSPRING, - MT_INVISSPRING, MT_RANDOMITEM, MT_RANDOMITEMPOP, MT_FLOATINGITEM, From 47da5263131efee2923223586ce49f4651b9b841 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 18 Sep 2019 19:29:28 -0400 Subject: [PATCH 38/49] Use texture names instead of predesignated sky numbers --- src/dehacked.c | 13 +++++++------ src/doomstat.h | 2 +- src/lua_baselib.c | 6 +++--- src/lua_maplib.c | 4 ++-- src/m_cheat.c | 6 +++--- src/p_saveg.c | 10 +++++----- src/p_setup.c | 20 +++++++++++--------- src/p_setup.h | 2 +- src/p_spec.c | 2 +- src/r_data.c | 2 +- src/r_sky.c | 4 ++-- src/r_sky.h | 4 ++-- 12 files changed, 39 insertions(+), 36 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index be45f3f0f..e9e083814 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1230,8 +1230,9 @@ static void readlevelheader(MYFILE *f, INT32 num) } else if (fastcmp(word, "WEATHER")) mapheaderinfo[num-1]->weather = (UINT8)get_number(word2); - else if (fastcmp(word, "SKYNUM")) - mapheaderinfo[num-1]->skynum = (INT16)i; + else if (fastcmp(word, "SKYTEXTURE")) + deh_strlcpy(mapheaderinfo[num-1]->skytexture, word2, + sizeof(mapheaderinfo[num-1]->skytexture), va("Level header %d: sky texture", num)); else if (fastcmp(word, "INTERSCREEN")) strncpy(mapheaderinfo[num-1]->interscreen, word2, 8); else if (fastcmp(word, "PRECUTSCENENUM")) @@ -9903,11 +9904,11 @@ static inline int lib_getenum(lua_State *L) } else if (fastcmp(word,"globalweather")) { lua_pushinteger(L, globalweather); return 1; - } else if (fastcmp(word,"levelskynum")) { - lua_pushinteger(L, levelskynum); + } else if (fastcmp(word,"levelskytexture")) { + lua_pushstring(L, levelskytexture); return 1; - } else if (fastcmp(word,"globallevelskynum")) { - lua_pushinteger(L, globallevelskynum); + } else if (fastcmp(word,"globallevelskytexture")) { + lua_pushstring(L, globallevelskytexture); return 1; } else if (fastcmp(word,"mapmusname")) { lua_pushstring(L, mapmusname); diff --git a/src/doomstat.h b/src/doomstat.h index 1f855da27..8b71e2d86 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -227,7 +227,7 @@ typedef struct UINT32 muspos; ///< Music position to jump to. char forcecharacter[17]; ///< (SKINNAMESIZE+1) Skin to switch to or "" to disable. UINT8 weather; ///< 0 = sunny day, 1 = storm, 2 = snow, 3 = rain, 4 = blank, 5 = thunder w/o rain, 6 = rain w/o lightning, 7 = heat wave. - INT16 skynum; ///< Sky number to use. + char skytexture[9]; ///< Sky texture to use. INT16 skybox_scalex; ///< Skybox X axis scale. (0 = no movement, 1 = 1:1 movement, 16 = 16:1 slow movement, -4 = 1:4 fast movement, etc.) INT16 skybox_scaley; ///< Skybox Y axis scale. INT16 skybox_scalez; ///< Skybox Z axis scale. diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 38af4d2e9..7464743c3 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -1405,15 +1405,15 @@ static int lib_pIsFlagAtBase(lua_State *L) static int lib_pSetupLevelSky(lua_State *L) { - INT32 skynum = (INT32)luaL_checkinteger(L, 1); + const char *skytexname = luaL_checkstring(L, 1); player_t *user = NULL; NOHUD if (!lua_isnone(L, 2) && lua_isuserdata(L, 2)) // if a player, setup sky for only the player, otherwise setup sky for all players user = *((player_t **)luaL_checkudata(L, 2, META_PLAYER)); if (!user) // global - P_SetupLevelSky(skynum, true); + P_SetupLevelSky(skytexname, true); else if (P_IsLocalPlayer(user)) - P_SetupLevelSky(skynum, false); + P_SetupLevelSky(skytexname, false); return 0; } diff --git a/src/lua_maplib.c b/src/lua_maplib.c index 19292b3d6..0522cb737 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -1487,8 +1487,8 @@ static int mapheaderinfo_get(lua_State *L) lua_pushstring(L, header->forcecharacter); else if (fastcmp(field,"weather")) lua_pushinteger(L, header->weather); - else if (fastcmp(field,"skynum")) - lua_pushinteger(L, header->skynum); + else if (fastcmp(field,"skytexture")) + lua_pushstring(L, header->skytexture); else if (fastcmp(field,"skybox_scalex")) lua_pushinteger(L, header->skybox_scalex); else if (fastcmp(field,"skybox_scaley")) diff --git a/src/m_cheat.c b/src/m_cheat.c index e7e877ada..c24a8014b 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -577,14 +577,14 @@ void Command_Skynum_f(void) if (COM_Argc() != 2) { - CONS_Printf(M_GetText("skynum : change the sky\n")); - CONS_Printf(M_GetText("Current sky is %d\n"), levelskynum); + CONS_Printf(M_GetText("skynum : change the sky\n")); + CONS_Printf(M_GetText("Current sky is %s\n"), levelskytexture); return; } CONS_Printf(M_GetText("Previewing sky %s...\n"), COM_Argv(1)); - P_SetupLevelSky(atoi(COM_Argv(1)), false); + P_SetupLevelSky(COM_Argv(1), false); } void Command_Weather_f(void) diff --git a/src/p_saveg.c b/src/p_saveg.c index 7d2e9a307..2e794e926 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -3091,7 +3091,7 @@ static inline void P_NetArchiveSpecials(void) WRITEUINT32(save_p, 0xffffffff); // Sky number - WRITEINT32(save_p, globallevelskynum); + WRITESTRINGN(save_p, globallevelskytexture, 9); // Current global weather type WRITEUINT8(save_p, globalweather); @@ -3110,8 +3110,8 @@ static inline void P_NetArchiveSpecials(void) // static void P_NetUnArchiveSpecials(void) { + char skytex[9]; size_t i; - INT32 j; if (READUINT32(save_p) != ARCHIVEBLOCK_SPECIALS) I_Error("Bad $$$.sav at archive block Specials"); @@ -3124,9 +3124,9 @@ static void P_NetUnArchiveSpecials(void) itemrespawntime[iquehead++] = READINT32(save_p); } - j = READINT32(save_p); - if (j != globallevelskynum) - P_SetupLevelSky(j, true); + READSTRINGN(save_p, skytex, sizeof(skytex)); + if (strcmp(skytex, globallevelskytexture)) + P_SetupLevelSky(skytex, true); globalweather = READUINT8(save_p); diff --git a/src/p_setup.c b/src/p_setup.c index d1ef91705..b7a482ce9 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -207,8 +207,9 @@ static void P_ClearSingleMapHeaderInfo(INT16 i) mapheaderinfo[num]->forcecharacter[0] = '\0'; DEH_WriteUndoline("WEATHER", va("%d", mapheaderinfo[num]->weather), UNDO_NONE); mapheaderinfo[num]->weather = 0; - DEH_WriteUndoline("SKYNUM", va("%d", mapheaderinfo[num]->skynum), UNDO_NONE); - mapheaderinfo[num]->skynum = 1; + DEH_WriteUndoline("SKYTEXTURE", va("%d", mapheaderinfo[num]->skytexture), UNDO_NONE); + snprintf(mapheaderinfo[num]->skytexture, 9, "SKY1"); + mapheaderinfo[num]->skytexture[8] = 0; DEH_WriteUndoline("SKYBOXSCALEX", va("%d", mapheaderinfo[num]->skybox_scalex), UNDO_NONE); mapheaderinfo[num]->skybox_scalex = 16; DEH_WriteUndoline("SKYBOXSCALEY", va("%d", mapheaderinfo[num]->skybox_scaley), UNDO_NONE); @@ -2255,17 +2256,18 @@ static inline boolean P_CheckLevel(lumpnum_t lumpnum) /** Sets up a sky texture to use for the level. * The sky texture is used instead of F_SKY1. */ -void P_SetupLevelSky(INT32 skynum, boolean global) +void P_SetupLevelSky(const char *skytexname, boolean global) { - char skytexname[12]; + char tex[9]; + strncpy(tex, skytexname, 9); + tex[8] = 0; - sprintf(skytexname, "SKY%d", skynum); - skytexture = R_TextureNumForName(skytexname); - levelskynum = skynum; + skytexture = R_TextureNumForName(tex); + strncpy(levelskytexture, tex, 9); // Global change if (global) - globallevelskynum = levelskynum; + strncpy(globallevelskytexture, tex, 9); // Don't go beyond for dedicated servers if (dedicated) @@ -2973,7 +2975,7 @@ boolean P_SetupLevel(boolean skipprecip) CON_SetupBackColormap(); // SRB2 determines the sky texture to be used depending on the map header. - P_SetupLevelSky(mapheaderinfo[gamemap-1]->skynum, true); + P_SetupLevelSky(mapheaderinfo[gamemap-1]->skytexture, true); P_MakeMapMD5(lastloadedmaplumpnum, &mapmd5); diff --git a/src/p_setup.h b/src/p_setup.h index c4a3aab9a..9abcfe5f6 100644 --- a/src/p_setup.h +++ b/src/p_setup.h @@ -54,7 +54,7 @@ INT32 P_CheckLevelFlat(const char *flatname); extern size_t nummapthings; extern mapthing_t *mapthings; -void P_SetupLevelSky(INT32 skynum, boolean global); +void P_SetupLevelSky(const char *skytexname, boolean global); #ifdef SCANTHINGS void P_ScanThings(INT16 mapnum, INT16 wadnum, INT16 lumpnum); #endif diff --git a/src/p_spec.c b/src/p_spec.c index ec5de3224..daef60a09 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2802,7 +2802,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) case 423: // Change Sky if ((mo && mo->player && P_IsLocalPlayer(mo->player)) || (line->flags & ML_NOCLIMB)) - P_SetupLevelSky(sides[line->sidenum[0]].textureoffset>>FRACBITS, (line->flags & ML_NOCLIMB)); + P_SetupLevelSky(sides[line->sidenum[0]].text, (line->flags & ML_NOCLIMB)); break; case 424: // Change Weather diff --git a/src/r_data.c b/src/r_data.c index 7fb11855f..d710359d1 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -1631,7 +1631,7 @@ void R_PrecacheLevel(void) // Sky texture is always present. // Note that F_SKY1 is the name used to indicate a sky floor/ceiling as a flat, - // while the sky texture is stored like a wall texture, with a skynum dependent name. + // while the sky texture is stored like a wall texture, with a texture name set by the map. texturepresent[skytexture] = 1; texturememory = 0; diff --git a/src/r_sky.c b/src/r_sky.c index fe1630e90..1fe0fe0e6 100644 --- a/src/r_sky.c +++ b/src/r_sky.c @@ -47,8 +47,8 @@ fixed_t skyscale; /** \brief used for keeping track of the current sky */ -INT32 levelskynum; -INT32 globallevelskynum; +char levelskytexture[9]; +char globallevelskytexture[9]; /** \brief The R_SetupSkyDraw function diff --git a/src/r_sky.h b/src/r_sky.h index 86b615595..a41b24463 100644 --- a/src/r_sky.h +++ b/src/r_sky.h @@ -30,8 +30,8 @@ extern INT32 skytexture, skytexturemid; extern fixed_t skyscale; extern INT32 skyflatnum; -extern INT32 levelskynum; -extern INT32 globallevelskynum; +extern char levelskytexture[9]; +extern char globallevelskytexture[9]; // call after skytexture is set to adapt for old/new skies void R_SetupSkyDraw(void); From 20663affc0460a07629a51a282a22c359393e8b8 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 18 Sep 2019 19:46:59 -0400 Subject: [PATCH 39/49] Flip sky direction --- src/r_plane.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_plane.c b/src/r_plane.c index db5bfbda2..ec105bf75 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -734,7 +734,7 @@ void R_DrawPlanes(void) dc_x = x; dc_source = R_GetColumn(texturetranslation[skytexture], - angle); + -angle); // Negative because skies were being drawn horizontally flipped wallcolfunc(); } } From 9e17484c7f93521e6a17d34d88fc790f1c8e303e Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 18 Sep 2019 21:22:50 -0400 Subject: [PATCH 40/49] OGL flipped skies --- src/hardware/hw_main.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 0d024dc65..659af386d 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -5922,13 +5922,15 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing) static void HWR_DrawSkyBackground(void) { FOutVector v[4]; + texture_t *tex; angle_t angle; float dimensionmultiply; float aspectratio; float angleturn; + tex = textures[texturetranslation[skytexture]]; HWR_GetTexture(texturetranslation[skytexture]); - aspectratio = (float)vid.width/(float)vid.height; + aspectratio = (float)vid.width / (float)vid.height; //Hurdler: the sky is the only texture who need 4.0f instead of 1.0 // because it's called just after clearing the screen @@ -5952,22 +5954,22 @@ static void HWR_DrawSkyBackground(void) // software doesn't draw any further than 1024 for skies anyway, but this doesn't overlap properly // The only time this will probably be an issue is when a sky wider than 1024 is used as a sky AND a regular wall texture - angle = (dup_viewangle + gr_xtoviewangle[0]); - dimensionmultiply = ((float)textures[texturetranslation[skytexture]]->width/256.0f); + angle = -(dup_viewangle + gr_xtoviewangle[0]); + dimensionmultiply = ((float)tex->width/256.0f); if (atransform.mirror) { angle = InvAngle(angle); - dimensionmultiply *= -1; + dimensionmultiply = -dimensionmultiply; } v[0].sow = v[3].sow = ((float) angle / ((ANGLE_90-1)*dimensionmultiply)); - v[2].sow = v[1].sow = (-1.0f/dimensionmultiply)+((float) angle / ((ANGLE_90-1)*dimensionmultiply)); + v[2].sow = v[1].sow = (1.0f/dimensionmultiply)+((float) angle / ((ANGLE_90-1)*dimensionmultiply)); // Y angle = aimingangle; - dimensionmultiply = ((float)textures[texturetranslation[skytexture]]->height/(128.0f*aspectratio)); + dimensionmultiply = ((float)tex->height/(128.0f*aspectratio)); if (splitscreen == 1) { From 9d8cb5247a9dcaef214686b0333b01b954f621a0 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 23 Sep 2019 03:15:08 -0400 Subject: [PATCH 41/49] Special effects! Tire grease waves, colored stars --- src/d_player.h | 2 ++ src/dehacked.c | 7 ++++++- src/info.c | 55 ++++++++++++++++++++++++++++++++++++++------------ src/info.h | 4 ++++ src/k_kart.c | 23 +++++++++++++++++++++ src/p_map.c | 19 +++++++++++++++++ src/p_mobj.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 149 insertions(+), 14 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index aced985c8..de6cbc46c 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -328,6 +328,8 @@ typedef enum k_spectatewait, // How long have you been waiting as a spectator k_growcancel, // Hold the item button down to cancel Grow k_tiregrease, // Reduced friction timer after hitting a horizontal spring + k_springstars, // Spawn stars around a player when they hit a spring + k_springcolor, // Color of spring stars NUMKARTSTUFF } kartstufftype_t; diff --git a/src/dehacked.c b/src/dehacked.c index 616a81ee9..0e7ddb7e5 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7212,6 +7212,8 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_DRAFTDUST4", "S_DRAFTDUST5", + "S_TIREGREASE", + #ifdef SEENAMES "S_NAMECHECK", #endif @@ -8004,6 +8006,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_KARMAFIREWORK", "MT_RINGSPARKS", "MT_DRAFTDUST", + "MT_TIREGREASE", #ifdef SEENAMES "MT_NAMECHECK", @@ -8491,7 +8494,9 @@ static const char *const KARTSTUFF_LIST[] = { "JAWZTARGETDELAY", "SPECTATEWAIT", "GROWCANCEL", - "TIREGREASE" + "TIREGREASE", + "SPRINGSTARS", + "SPRINGCOLOR" }; #endif diff --git a/src/info.c b/src/info.c index 274cee440..be32f3ebd 100644 --- a/src/info.c +++ b/src/info.c @@ -70,7 +70,7 @@ char sprnames[NUMSPRITES + 1][5] = "DUCK","GTRE","CHES","CHIM","DRGN","LZMN","PGSS","ZTCH","MKMA","MKMP", "RTCH","BOWL","BOWH","BRRL","BRRR","HRSE","TOAH","BFRT","OFRT","RFRT", "PFRT","ASPK","HBST","HBSO","HBSF","WBLZ","WBLN","FWRK","MXCL","RGSP", - "DRAF","XMS4","XMS5","VIEW" + "DRAF","GRES","XMS4","XMS5","VIEW" }; // Doesn't work with g++, needs actionf_p1 (don't modify this comment) @@ -3452,6 +3452,8 @@ state_t states[NUMSTATES] = {SPR_DRAF, 3, 1, {NULL}, 0, 0, S_DRAFTDUST5}, // S_DRAFTDUST4 {SPR_DRAF, 4, 1, {NULL}, 0, 0, S_NULL}, // S_DRAFTDUST5 + {SPR_GRES, FF_ANIMATE|FF_PAPERSPRITE, -1, {NULL}, 2, 4, S_NULL}, // S_TIREGREASE + #ifdef SEENAMES {SPR_NULL, 0, 1, {NULL}, 0, 0, S_NULL}, // S_NAMECHECK #endif @@ -6082,7 +6084,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate - 0, // painchance + SKINCOLOR_YELLOW, // painchance sfx_s3kb1, // painsound S_NULL, // meleestate S_NULL, // missilestate @@ -6109,7 +6111,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate - 0, // painchance + SKINCOLOR_SALMON, // painchance sfx_s3kb1, // painsound S_NULL, // meleestate S_NULL, // missilestate @@ -6136,7 +6138,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate - 0, // painchance + SKINCOLOR_PASTEL, // painchance sfx_s3kb1, // painsound S_NULL, // meleestate S_NULL, // missilestate @@ -6163,7 +6165,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate - 0, // painchance + SKINCOLOR_POPCORN, // painchance sfx_s3kb1, // painsound S_NULL, // meleestate S_NULL, // missilestate @@ -6190,7 +6192,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate - 0, // painchance + SKINCOLOR_YELLOW, // painchance sfx_s3kb1, // painsound S_NULL, // meleestate S_NULL, // missilestate @@ -6217,7 +6219,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate - 0, // painchance + SKINCOLOR_SALMON, // painchance sfx_s3kb1, // painsound S_NULL, // meleestate S_NULL, // missilestate @@ -6244,7 +6246,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate - 0, // painchance + SKINCOLOR_PASTEL, // painchance sfx_s3kb1, // painsound S_NULL, // meleestate S_NULL, // missilestate @@ -6271,7 +6273,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate - 0, // painchance + SKINCOLOR_POPCORN, // painchance sfx_s3kb1, // painsound S_NULL, // meleestate S_NULL, // missilestate @@ -6298,7 +6300,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate - 0, // painchance + SKINCOLOR_YELLOW, // painchance sfx_s3kb1, // painsound S_NULL, // meleestate S_NULL, // missilestate @@ -6325,7 +6327,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate - 0, // painchance + SKINCOLOR_SALMON, // painchance sfx_s3kb1, // painsound S_NULL, // meleestate S_NULL, // missilestate @@ -6352,7 +6354,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate - 0, // painchance + SKINCOLOR_PASTEL, // painchance sfx_s3kb1, // painsound S_NULL, // meleestate S_NULL, // missilestate @@ -6379,7 +6381,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate - 0, // painchance + SKINCOLOR_POPCORN, // painchance sfx_s3kb1, // painsound S_NULL, // meleestate S_NULL, // missilestate @@ -20271,6 +20273,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_TIREGREASE + -1, // doomednum + S_TIREGREASE, // spawnstate + 1000, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 8<flags2 |= MF2_DONTDRAW; } + + if (player->kartstuff[k_springstars] && (leveltime & 1)) + { + fixed_t randx = P_RandomRange(-40, 40) * player->mo->scale; + fixed_t randy = P_RandomRange(-40, 40) * player->mo->scale; + fixed_t randz = P_RandomRange(0, player->mo->height >> FRACBITS) << FRACBITS; + mobj_t *star = P_SpawnMobj( + player->mo->x + randx, + player->mo->y + randy, + player->mo->z + randz, + MT_KARMAFIREWORK); + + star->color = player->kartstuff[k_springcolor]; + star->flags |= MF_NOGRAVITY; + star->momx = player->mo->momx / 2; + star->momy = player->mo->momy / 2; + star->momz = player->mo->momz / 2; + star->fuse = 12; + star->scale = player->mo->scale; + star->destscale = star->scale / 2; + + player->kartstuff[k_springstars]--; + } } if (player->playerstate == PST_DEAD || player->kartstuff[k_respawn] > 1) // Ensure these are set correctly here diff --git a/src/p_map.c b/src/p_map.c index 22c6755e7..fbf5b4b06 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -122,6 +122,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) const fixed_t vscale = mapobjectscale + (object->scale - mapobjectscale); fixed_t vertispeed = spring->info->mass; fixed_t horizspeed = spring->info->damage; + UINT8 starcolor = spring->info->painchance; fixed_t savemomx = 0; fixed_t savemomy = 0; @@ -251,7 +252,22 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) { // Less friction when hitting horizontal springs if (!vertispeed) + { + if (!object->player->kartstuff[k_tiregrease]) + { + UINT8 i; + for (i = 0; i < 2; i++) + { + mobj_t *grease; + grease = P_SpawnMobj(object->x, object->y, object->z, MT_TIREGREASE); + P_SetTarget(&grease->target, object); + grease->angle = R_PointToAngle2(0, 0, object->momx, object->momy); + grease->extravalue1 = i; + } + } + object->player->kartstuff[k_tiregrease] = greasetics; //FixedMul(greasetics << FRACBITS, finalSpeed/72) >> FRACBITS + } } // Horizontal speed is used as a minimum thrust, not a direct replacement @@ -271,6 +287,9 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) P_SetTarget(&spring->target, object); P_ResetPlayer(object->player); + + object->player->kartstuff[k_springstars] = max(vertispeed, horizspeed) / FRACUNIT / 2; + object->player->kartstuff[k_springcolor] = starcolor; } return true; diff --git a/src/p_mobj.c b/src/p_mobj.c index e8880f07b..2dda7cb4f 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8368,6 +8368,56 @@ void P_MobjThinker(mobj_t *mobj) z); } break; + case MT_TIREGREASE: + if (!mobj->target || P_MobjWasRemoved(mobj->target) || !mobj->target->player + || !mobj->target->player->kartstuff[k_tiregrease]) + { + P_RemoveMobj(mobj); + return; + } + + K_MatchGenericExtraFlags(mobj, mobj->target); + + { + const angle_t off = FixedAngle(40*FRACUNIT); + angle_t ang = mobj->target->angle; + fixed_t z; + UINT8 trans = (mobj->target->player->kartstuff[k_tiregrease] * (NUMTRANSMAPS+1)) / greasetics; + + if (trans > NUMTRANSMAPS) + trans = NUMTRANSMAPS; + + trans = NUMTRANSMAPS - trans; + + z = mobj->target->z; + if (mobj->eflags & MFE_VERTICALFLIP) + z += mobj->target->height; + + if (mobj->target->momx || mobj->target->momy) + ang = R_PointToAngle2(0, 0, mobj->target->momx, mobj->target->momy); + + if (mobj->extravalue1) + ang = (signed)(ang - off); + else + ang = (signed)(ang + off); + + P_TeleportMove(mobj, + mobj->target->x - FixedMul(mobj->target->radius, FINECOSINE(ang >> ANGLETOFINESHIFT)), + mobj->target->y - FixedMul(mobj->target->radius, FINESINE(ang >> ANGLETOFINESHIFT)), + z); + mobj->angle = ang; + + if (leveltime & 1) + mobj->flags2 |= MF2_DONTDRAW; + + if (trans >= NUMTRANSMAPS) + mobj->flags2 |= MF2_DONTDRAW; + else if (trans == 0) + mobj->frame = (mobj->frame & ~FF_TRANSMASK); + else + mobj->frame = (mobj->frame & ~FF_TRANSMASK)|(trans << FF_TRANSSHIFT); + } + break; case MT_THUNDERSHIELD: { fixed_t destx, desty; @@ -9070,6 +9120,9 @@ void P_MobjThinker(mobj_t *mobj) } break; case MT_KARMAFIREWORK: + if (mobj->flags & MF_NOGRAVITY) + break; + if (mobj->momz == 0) { P_RemoveMobj(mobj); From 594e1cb41a3d93c6cc563fb2f4699f1bda2aadb1 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 23 Sep 2019 03:48:50 -0400 Subject: [PATCH 42/49] rotate flag applies to all springs --- src/p_mobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 2dda7cb4f..ecb92a06e 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -12064,7 +12064,7 @@ ML_NOCLIMB : Direction not controllable { if (mthing->options & MTF_AMBUSH) { - if (i == MT_YELLOWDIAG || i == MT_REDDIAG) + if (mobj->flags & MF_SPRING) mobj->angle += ANGLE_22h; if (mobj->flags & MF_NIGHTSITEM) From bc7673f2dad8d434ac389725737ebe7e05527bd6 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 23 Sep 2019 06:29:30 -0400 Subject: [PATCH 43/49] Update Spring Shells, add color modulo check --- src/info.c | 8 ++++---- src/p_map.c | 3 ++- src/p_mobj.c | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/info.c b/src/info.c index be32f3ebd..cb478b3d8 100644 --- a/src/info.c +++ b/src/info.c @@ -4253,7 +4253,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 32, // reactiontime sfx_None, // attacksound S_NULL, // painstate - 0, // painchance + SKINCOLOR_TEA, // painchance sfx_s3kb1, // painsound S_NULL, // meleestate S_NULL, // missilestate @@ -4264,7 +4264,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 24*FRACUNIT, // radius 40*FRACUNIT, // height 0, // display offset - 13*FRACUNIT, // mass + 15*FRACUNIT, // mass 0, // damage sfx_None, // activesound MF_ENEMY|MF_SPECIAL|MF_SHOOTABLE, // flags @@ -4280,7 +4280,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 32, // reactiontime sfx_None, // attacksound S_NULL, // painstate - 0, // painchance + SKINCOLOR_YELLOW, // painchance sfx_s3kb1, // painsound S_NULL, // meleestate S_NULL, // missilestate @@ -4291,7 +4291,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 24*FRACUNIT, // radius 40*FRACUNIT, // height 0, // display offset - 26*FRACUNIT, // mass + 25*FRACUNIT, // mass 0, // damage sfx_None, // activesound MF_ENEMY|MF_SPECIAL|MF_SHOOTABLE, // flags diff --git a/src/p_map.c b/src/p_map.c index fbf5b4b06..36b5af70e 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -122,7 +122,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) const fixed_t vscale = mapobjectscale + (object->scale - mapobjectscale); fixed_t vertispeed = spring->info->mass; fixed_t horizspeed = spring->info->damage; - UINT8 starcolor = spring->info->painchance; + UINT8 starcolor = (spring->info->painchance % MAXTRANSLATIONS); fixed_t savemomx = 0; fixed_t savemomy = 0; @@ -1207,6 +1207,7 @@ static boolean PIT_CheckThing(mobj_t *thing) //else if (tmz > thzh - sprarea && tmz < thzh) // Don't damage people springing up / down return true; } + // missiles can hit other things if (tmthing->flags & MF_MISSILE || tmthing->type == MT_SHELL) { diff --git a/src/p_mobj.c b/src/p_mobj.c index ecb92a06e..de86bfb89 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -12064,7 +12064,7 @@ ML_NOCLIMB : Direction not controllable { if (mthing->options & MTF_AMBUSH) { - if (mobj->flags & MF_SPRING) + if (mobj->flags & MF_SPRING && mobj->info->damage) mobj->angle += ANGLE_22h; if (mobj->flags & MF_NIGHTSITEM) From 7a6a2f248e54615b024c4e77365453862be72990 Mon Sep 17 00:00:00 2001 From: James R Date: Thu, 26 Sep 2019 14:32:25 -0700 Subject: [PATCH 44/49] Remove trailing whitespace --- src/k_kart.c | 2 +- src/p_map.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index b1a28f683..670af73ff 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -6539,7 +6539,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) } // Friction was changed, so we must recalculate a bunch of stuff - if (player->mo->friction != prevfriction) + if (player->mo->friction != prevfriction) { if (player->mo->friction > FRACUNIT) player->mo->friction = FRACUNIT; diff --git a/src/p_map.c b/src/p_map.c index 36b5af70e..b9030fd00 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -219,7 +219,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) momang = R_PointToAngle2(0, 0, savemomx, savemomy); angoffset = momang; - angoffset -= spring->angle; // Subtract + angoffset -= spring->angle; // Subtract // Flip on wrong side if ((angle_t)angoffset > ANGLE_180) From 1d59d8305d4b57a4527e7329732918c64fb38e26 Mon Sep 17 00:00:00 2001 From: James R Date: Thu, 26 Sep 2019 14:39:23 -0700 Subject: [PATCH 45/49] Remove trailing whitespace --- src/d_main.c | 2 +- src/p_inter.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 5c8e34bde..8388c50cd 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -447,7 +447,7 @@ static void D_Display(void) { if (i > 0) // Splitscreen-specific { - switch (i) + switch (i) { case 1: if (splitscreen > 1) diff --git a/src/p_inter.c b/src/p_inter.c index de14b3db9..8cf9703d0 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -3306,12 +3306,12 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings) // 20 is the ring cap in kart if (num_rings > 20) - num_rings = 20; + num_rings = 20; else if (num_rings <= 0) return; // Cap the maximum loss automatically to 2 in ring debt - if (player->kartstuff[k_rings] <= 0 && num_rings > 2) + if (player->kartstuff[k_rings] <= 0 && num_rings > 2) num_rings = 2; P_GivePlayerRings(player, -num_rings); From 971eed8d9726ca037f48ebca7d6c0909618549c5 Mon Sep 17 00:00:00 2001 From: James R Date: Thu, 26 Sep 2019 16:35:41 -0700 Subject: [PATCH 46/49] abs is unnecessary on unsigned types --- src/k_kart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index fce8b4ff6..fe8902257 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1623,7 +1623,7 @@ static void K_DrawDraftCombiring(player_t *player, player_t *victim, fixed_t cur cury + (P_RandomRange(-12,12)*mapobjectscale), curz + (P_RandomRange(24,48)*mapobjectscale), MT_SIGNSPARKLE); - P_SetMobjState(band, S_SIGNSPARK1 + (abs(leveltime+offset) % 11)); + P_SetMobjState(band, S_SIGNSPARK1 + ((leveltime+offset) % 11)); P_SetScale(band, (band->destscale = (3*player->mo->scale)/2)); band->color = colors[c]; band->colorized = true; From 739d602c84ca79cf972a76b07aed0830109a8055 Mon Sep 17 00:00:00 2001 From: James R Date: Thu, 26 Sep 2019 16:41:02 -0700 Subject: [PATCH 47/49] Addition unecessary as ruled out by if condition --- src/k_kart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index fe8902257..2015cbf39 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1623,7 +1623,7 @@ static void K_DrawDraftCombiring(player_t *player, player_t *victim, fixed_t cur cury + (P_RandomRange(-12,12)*mapobjectscale), curz + (P_RandomRange(24,48)*mapobjectscale), MT_SIGNSPARKLE); - P_SetMobjState(band, S_SIGNSPARK1 + ((leveltime+offset) % 11)); + P_SetMobjState(band, S_SIGNSPARK1 + (leveltime % 11)); P_SetScale(band, (band->destscale = (3*player->mo->scale)/2)); band->color = colors[c]; band->colorized = true; From 92022be2542d824313854973b1849305367618bf Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Fri, 27 Sep 2019 06:28:26 -0400 Subject: [PATCH 48/49] Don't crash if you can't find a pwad or it's already loaded or etc --- src/d_main.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 5c8e34bde..a89fe4340 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1190,12 +1190,12 @@ void D_SRB2Main(void) M_InitCharacterTables(); // load wad, including the main wad file - CONS_Printf("W_InitMultipleFiles(): Adding IWAD and main PWADs.\n"); + CONS_Printf("W_InitMultipleFiles(): Adding main IWAD and PWADs.\n"); if (!W_InitMultipleFiles(startupwadfiles, false)) #ifdef _DEBUG - CONS_Error("A WAD file was not found or not valid.\nCheck the log to see which ones.\n"); + CONS_Error("A main WAD file was not found or not valid.\nCheck the log to see which ones.\n"); #else - I_Error("A WAD file was not found or not valid.\nCheck the log to see which ones.\n"); + I_Error("A main WAD file was not found or not valid.\nCheck the log to see which ones.\n"); #endif D_CleanFile(startupwadfiles); @@ -1249,8 +1249,9 @@ void D_SRB2Main(void) } } + CONS_Printf("W_InitMultipleFiles(): Adding external PWADs.\n"); if (!W_InitMultipleFiles(startuppwads, true)) - CONS_Error("A PWAD file was not found or not valid.\nCheck the log to see which ones.\n"); + M_StartMessage(M_GetText("A PWAD file was not found or not valid.\nCheck log.txt to see which ones.\n\nPress ESC\n"), NULL, MM_NOTHING); D_CleanFile(startuppwads); // From 6a1e49a91c79ed118b1497d23bb387e2cbb901fd Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Fri, 27 Sep 2019 14:34:17 -0400 Subject: [PATCH 49/49] Fixed some instances that weren't writing TRANSPARENTPIXEL --- src/m_anigif.c | 2 +- src/r_data.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/m_anigif.c b/src/m_anigif.c index 4e68819bc..4dfc77cb3 100644 --- a/src/m_anigif.c +++ b/src/m_anigif.c @@ -422,7 +422,7 @@ static void GIF_headwrite(void) WRITEUINT16(p, rheight); // colors, aspect, etc - WRITEUINT8(p, 0xF7); + WRITEUINT8(p, 0xFF); // TRANSPARENTPIXEL WRITEUINT8(p, 0x00); WRITEUINT8(p, 0x00); diff --git a/src/r_data.c b/src/r_data.c index d710359d1..6aebf5a4a 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -267,7 +267,7 @@ static UINT8 *R_GenerateTexture(size_t texnum) texturememory += blocksize; block = Z_Malloc(blocksize+1, PU_STATIC, &texturecache[texnum]); - memset(block, 0xF7, blocksize+1); // Transparency hack + memset(block, 0xFF, blocksize+1); // TRANSPARENTPIXEL // columns lookup table colofs = (UINT32 *)(void *)block;