Banana drag slowdown, diagonal springs scale to map scale instead of object's scale, OGL skincolors average all colors

This commit is contained in:
TehRealSalt 2018-07-04 19:06:45 -04:00
parent 327446e367
commit 82734fcf94
5 changed files with 36 additions and 244 deletions

View file

@ -269,7 +269,7 @@ typedef enum
// Basic gameplay things // Basic gameplay things
k_position, // Used for Kart positions, mostly for deterministic stuff k_position, // Used for Kart positions, mostly for deterministic stuff
k_oldposition, // Used for taunting when you pass someone k_oldposition, // Used for taunting when you pass someone
k_positiondelay, // Prevents player from taunting continuously if two people were neck-and-neck k_positiondelay, // Used for position number, so it can grow when passing/being passed
k_prevcheck, // Previous checkpoint distance; for p_user.c (was "pw_pcd") k_prevcheck, // Previous checkpoint distance; for p_user.c (was "pw_pcd")
k_nextcheck, // Next checkpoint distance; for p_user.c (was "pw_ncd") k_nextcheck, // Next checkpoint distance; for p_user.c (was "pw_ncd")
k_waypoint, // Waypoints. k_waypoint, // Waypoints.
@ -315,6 +315,7 @@ typedef enum
k_invincibilitytimer, // Invincibility timer k_invincibilitytimer, // Invincibility timer
k_deathsentence, // 30 seconds to live... (SPB murder timer (not actually 30 sec, I just couldn't help the FF reference :p)) k_deathsentence, // 30 seconds to live... (SPB murder timer (not actually 30 sec, I just couldn't help the FF reference :p))
k_eggmanheld, // Eggman monitor held, separate from k_itemheld so it doesn't stop you from getting items k_eggmanheld, // Eggman monitor held, separate from k_itemheld so it doesn't stop you from getting items
k_bananadrag, // After a second of holding a banana behind you, you start to slow down
k_spinouttimer, // Spin-out from a banana peel or oil slick (was "pw_bananacam") k_spinouttimer, // Spin-out from a banana peel or oil slick (was "pw_bananacam")
k_justbumped, // Prevent players from endlessly bumping into each other k_justbumped, // Prevent players from endlessly bumping into each other
k_comebacktimer, // Battle mode, how long before you become a bomb after death k_comebacktimer, // Battle mode, how long before you become a bomb after death

View file

@ -7615,6 +7615,7 @@ static const char *const KARTSTUFF_LIST[] = {
"INVINCIBILITYTIMER", "INVINCIBILITYTIMER",
"DEATHSENTENCE", "DEATHSENTENCE",
"EGGMANHELD", "EGGMANHELD",
"BANANADRAG",
"SPINOUTTIMER", "SPINOUTTIMER",
"JUSTBUMPED", "JUSTBUMPED",
"COMEBACKTIMER", "COMEBACKTIMER",
@ -7624,6 +7625,7 @@ static const char *const KARTSTUFF_LIST[] = {
"BUMPER", "BUMPER",
"COMEBACKPOINTS", "COMEBACKPOINTS",
"COMEBACKMODE", "COMEBACKMODE",
"WANTED",
}; };
static const char *const HUDITEMS_LIST[] = { static const char *const HUDITEMS_LIST[] = {

View file

@ -41,6 +41,7 @@
#include "../r_things.h" #include "../r_things.h"
#include "../r_draw.h" #include "../r_draw.h"
#include "../p_tick.h" #include "../p_tick.h"
#include "../k_kart.h" // colortranslations
#include "hw_main.h" #include "hw_main.h"
#include "../v_video.h" #include "../v_video.h"
@ -938,6 +939,7 @@ spritemd2found:
static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, GLMipmap_t *grmip, INT32 skinnum, skincolors_t color) 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; UINT16 w = gpatch->width, h = gpatch->height;
UINT32 size = w*h; UINT32 size = w*h;
RGBA_t *image, *blendimage, *cur, blendcolor; RGBA_t *image, *blendimage, *cur, blendcolor;
@ -963,248 +965,25 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch,
image = gpatch->mipmap.grInfo.data; image = gpatch->mipmap.grInfo.data;
blendimage = blendgpatch->mipmap.grInfo.data; blendimage = blendgpatch->mipmap.grInfo.data;
switch (color) // Average all of the translation's colors
{ {
case SKINCOLOR_IVORY: UINT16 r, g, b;
blendcolor = V_GetColor(0);
break;
case SKINCOLOR_WHITE:
blendcolor = V_GetColor(3);
break;
case SKINCOLOR_SILVER:
blendcolor = V_GetColor(7);
break;
case SKINCOLOR_CLOUDY:
blendcolor = V_GetColor(13);
break;
case SKINCOLOR_GREY:
blendcolor = V_GetColor(15);
break;
case SKINCOLOR_NICKEL:
blendcolor = V_GetColor(23);
break;
case SKINCOLOR_BLACK:
blendcolor = V_GetColor(27);
break;
case SKINCOLOR_SALMON:
blendcolor = V_GetColor(123);
break;
case SKINCOLOR_PINK:
blendcolor = V_GetColor(147);
break;
case SKINCOLOR_RASPBERRY:
blendcolor = V_GetColor(127);
break;
case SKINCOLOR_RUBY:
blendcolor = V_GetColor(130);
break;
case SKINCOLOR_RED:
blendcolor = V_GetColor(132);
break;
case SKINCOLOR_ROSE:
blendcolor = V_GetColor(151);
break;
case SKINCOLOR_CRIMSON:
blendcolor = V_GetColor(139);
break;
case SKINCOLOR_DAWN:
blendcolor = V_GetColor(89);
break;
case SKINCOLOR_ORANGE:
blendcolor = V_GetColor(87);
break;
case SKINCOLOR_PUMPKIN:
blendcolor = V_GetColor(95);
break;
case SKINCOLOR_BRONZE:
blendcolor = V_GetColor(119);
break;
case SKINCOLOR_ROSEWOOD:
blendcolor = V_GetColor(155);
break;
case SKINCOLOR_BURGUNDY:
blendcolor = V_GetColor(159);
break;
case SKINCOLOR_SEPIA:
blendcolor = V_GetColor(37);
break;
case SKINCOLOR_BEIGE:
blendcolor = V_GetColor(39);
break;
case SKINCOLOR_BROWN:
blendcolor = V_GetColor(55);
break;
case SKINCOLOR_LEATHER:
blendcolor = V_GetColor(61);
break;
case SKINCOLOR_TANGERINE:
blendcolor = V_GetColor(85);
break;
case SKINCOLOR_YELLOW:
blendcolor = V_GetColor(104);
break;
case SKINCOLOR_CANARY:
blendcolor = V_GetColor(91);
break;
case SKINCOLOR_PEACH:
blendcolor = V_GetColor(71);
break;
case SKINCOLOR_CREAMSICLE:
blendcolor = V_GetColor(83);
break;
case SKINCOLOR_GOLD:
blendcolor = V_GetColor(115);
break;
case SKINCOLOR_CARAMEL:
blendcolor = V_GetColor(78);
break;
case SKINCOLOR_VOMIT:
blendcolor = V_GetColor(114);
break;
case SKINCOLOR_LIME:
blendcolor = V_GetColor(114);
break;
case SKINCOLOR_GARDEN:
blendcolor = V_GetColor(179);
break;
case SKINCOLOR_TEA:
blendcolor = V_GetColor(177);
break;
case SKINCOLOR_ARMY:
blendcolor = V_GetColor(179);
break;
case SKINCOLOR_PISTACHIO:
blendcolor = V_GetColor(166);
break;
case SKINCOLOR_ROBOHOOD:
blendcolor = V_GetColor(182);
break;
case SKINCOLOR_OLIVE:
blendcolor = V_GetColor(108);
break;
case SKINCOLOR_MOSS:
blendcolor = V_GetColor(183);
break;
case SKINCOLOR_MINT:
blendcolor = V_GetColor(163);
break;
case SKINCOLOR_EMERALD:
blendcolor = V_GetColor(187);
break;
case SKINCOLOR_GREEN:
blendcolor = V_GetColor(167);
break;
case SKINCOLOR_PINETREE:
blendcolor = V_GetColor(171);
break;
case SKINCOLOR_SWAMP:
blendcolor = V_GetColor(190);
break;
case SKINCOLOR_SLATE:
blendcolor = V_GetColor(201);
break;
case SKINCOLOR_PERIWINKLE:
blendcolor = V_GetColor(227);
break;
case SKINCOLOR_CYAN:
blendcolor = V_GetColor(213);
break;
case SKINCOLOR_CERULEAN:
blendcolor = V_GetColor(217);
break;
case SKINCOLOR_AQUA:
blendcolor = V_GetColor(215);
break;
case SKINCOLOR_TEAL:
blendcolor = V_GetColor(221);
break;
case SKINCOLOR_STEEL:
blendcolor = V_GetColor(203);
break;
case SKINCOLOR_BLUE:
blendcolor = V_GetColor(231);
break;
case SKINCOLOR_SAPPHIRE:
blendcolor = V_GetColor(234);
break;
case SKINCOLOR_NAVY:
blendcolor = V_GetColor(206);
break;
case SKINCOLOR_BLUEBERRY:
blendcolor = V_GetColor(238);
break;
case SKINCOLOR_JET:
blendcolor = V_GetColor(207);
break;
case SKINCOLOR_LILAC:
blendcolor = V_GetColor(123);
break;
case SKINCOLOR_DUSK:
blendcolor = V_GetColor(253);
break;
case SKINCOLOR_PURPLE:
blendcolor = V_GetColor(195);
break;
case SKINCOLOR_LAVENDER:
blendcolor = V_GetColor(251);
break;
case SKINCOLOR_BYZANTIUM:
blendcolor = V_GetColor(254);
break;
case SKINCOLOR_INDIGO:
blendcolor = V_GetColor(199);
break;
case SKINCOLOR_SUPER1: r = (UINT16)V_GetColor(colortranslations[color][0]).s.red;
blendcolor = V_GetColor(97); g = (UINT16)V_GetColor(colortranslations[color][0]).s.green;
break; b = (UINT16)V_GetColor(colortranslations[color][0]).s.blue;
case SKINCOLOR_SUPER2:
blendcolor = V_GetColor(100);
break;
case SKINCOLOR_SUPER3:
blendcolor = V_GetColor(103);
break;
case SKINCOLOR_SUPER4:
blendcolor = V_GetColor(113);
break;
case SKINCOLOR_SUPER5:
blendcolor = V_GetColor(116);
break;
case SKINCOLOR_TSUPER1: for (i = 1; i < 16; i++)
blendcolor = V_GetColor(81); {
break; RGBA_t nextcolor = V_GetColor(colortranslations[color][i]);
case SKINCOLOR_TSUPER2: r += (UINT16)nextcolor.s.red;
blendcolor = V_GetColor(82); g += (UINT16)nextcolor.s.green;
break; b += (UINT16)nextcolor.s.blue;
case SKINCOLOR_TSUPER3: }
blendcolor = V_GetColor(84);
break;
case SKINCOLOR_TSUPER4:
blendcolor = V_GetColor(85);
break;
case SKINCOLOR_TSUPER5:
blendcolor = V_GetColor(87);
break;
case SKINCOLOR_KSUPER1: blendcolor.s.red = (UINT8)(r/16);
blendcolor = V_GetColor(122); blendcolor.s.green = (UINT8)(g/16);
break; blendcolor.s.blue = (UINT8)(b/16);
case SKINCOLOR_KSUPER2:
blendcolor = V_GetColor(123);
break;
case SKINCOLOR_KSUPER3:
blendcolor = V_GetColor(124);
break;
case SKINCOLOR_KSUPER4:
blendcolor = V_GetColor(125);
break;
case SKINCOLOR_KSUPER5:
blendcolor = V_GetColor(126);
break;
default:
blendcolor = V_GetColor(247);
break;
} }
// rainbow support, could theoretically support boss ones too // rainbow support, could theoretically support boss ones too

View file

@ -1318,6 +1318,9 @@ static fixed_t K_GetKartBoostPower(player_t *player, boolean speed)
&& player->kartstuff[k_offroad] >= 0 && speed) && player->kartstuff[k_offroad] >= 0 && speed)
boostpower = FixedDiv(boostpower, player->kartstuff[k_offroad] + FRACUNIT); boostpower = FixedDiv(boostpower, player->kartstuff[k_offroad] + FRACUNIT);
if (player->kartstuff[k_bananadrag] > TICRATE) // Avoid making x10 banana a hassle to use
boostpower = 4*boostpower/5;
if (player->kartstuff[k_growshrinktimer] > 0) if (player->kartstuff[k_growshrinktimer] > 0)
{ // Grow { // Grow
if (speed) if (speed)
@ -2569,7 +2572,10 @@ static void K_MoveHeldObjects(player_t *player)
return; return;
if (!player->mo->hnext) if (!player->mo->hnext)
{
player->kartstuff[k_bananadrag] = 0;
return; return;
}
switch (player->mo->hnext->type) switch (player->mo->hnext->type)
{ {
@ -2578,6 +2584,8 @@ static void K_MoveHeldObjects(player_t *player)
{ {
mobj_t *cur = player->mo->hnext; mobj_t *cur = player->mo->hnext;
player->kartstuff[k_bananadrag] = 0; // Just to make sure
while (cur && !P_MobjWasRemoved(cur)) while (cur && !P_MobjWasRemoved(cur))
{ {
const fixed_t radius = FixedHypot(player->mo->radius, player->mo->radius) + FixedHypot(cur->radius, cur->radius); // mobj's distance from its Target, or Radius. const fixed_t radius = FixedHypot(player->mo->radius, player->mo->radius) + FixedHypot(cur->radius, cur->radius); // mobj's distance from its Target, or Radius.
@ -2641,6 +2649,8 @@ static void K_MoveHeldObjects(player_t *player)
mobj_t *cur = player->mo->hnext; mobj_t *cur = player->mo->hnext;
mobj_t *targ = player->mo; mobj_t *targ = player->mo;
player->kartstuff[k_bananadrag]++;
while (cur && !P_MobjWasRemoved(cur)) while (cur && !P_MobjWasRemoved(cur))
{ {
const fixed_t radius = FixedHypot(targ->radius, targ->radius) + FixedHypot(cur->radius, cur->radius); const fixed_t radius = FixedHypot(targ->radius, targ->radius) + FixedHypot(cur->radius, cur->radius);
@ -2679,7 +2689,7 @@ static void K_MoveHeldObjects(player_t *player)
if (speed > dist) if (speed > dist)
P_InstaThrust(cur, cur->angle, speed-dist); P_InstaThrust(cur, cur->angle, speed-dist);
P_SetObjectMomZ(cur, FixedMul(targz - cur->z, 3*FRACUNIT/4) - gravity, false); P_SetObjectMomZ(cur, FixedMul(targz - cur->z, 7*FRACUNIT/8) - gravity, false);
if (R_PointToDist2(cur->x, cur->y, targx, targy) > 768*FRACUNIT) if (R_PointToDist2(cur->x, cur->y, targx, targy) > 768*FRACUNIT)
P_TeleportMove(cur, targx, targy, cur->z); P_TeleportMove(cur, targx, targy, cur->z);
@ -3217,7 +3227,7 @@ static void K_KartUpdatePosition(player_t *player)
oldposition = position; oldposition = position;
if (oldposition != position) // Changed places? if (oldposition != position) // Changed places?
player->kartstuff[k_positiondelay] = 10; // and set up the timer. player->kartstuff[k_positiondelay] = 10; // Position number growth
player->kartstuff[k_position] = position; player->kartstuff[k_position] = position;
} }

View file

@ -178,12 +178,12 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
} }
if (vertispeed) if (vertispeed)
object->momz = FixedMul(vertispeed,FixedSqrt(FixedMul(object->scale, spring->scale))); object->momz = FixedMul(vertispeed,FixedSqrt(FixedMul(mapheaderinfo[gamemap-1]->mobj_scale, spring->scale)));
if (horizspeed) if (horizspeed)
{ {
if (!object->player) if (!object->player)
P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(horizspeed,FixedSqrt(FixedMul(object->scale, spring->scale)))); P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(horizspeed,FixedSqrt(FixedMul(mapheaderinfo[gamemap-1]->mobj_scale, spring->scale))));
else else
{ {
fixed_t finalSpeed = horizspeed; fixed_t finalSpeed = horizspeed;
@ -192,7 +192,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
if (pSpeed > finalSpeed) if (pSpeed > finalSpeed)
finalSpeed = pSpeed; finalSpeed = pSpeed;
P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(finalSpeed,FixedSqrt(FixedMul(object->scale, spring->scale)))); P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(finalSpeed,FixedSqrt(FixedMul(mapheaderinfo[gamemap-1]->mobj_scale, spring->scale))));
} }
} }