From 6627483e37eeb14aa171597299b8a220c86171ef Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Fri, 6 Jul 2018 14:22:48 -0400 Subject: [PATCH] Misc tweaks (mostly color related) - Smoothed out Ruby & Sepia - Made Sapphire more distinct from Blue - Made Navy more distinct from Jet - MD2 colors weight a few colors even more heavily - Revised ColorOpposite table - Fix Wanted not updating on hit - Very minor item odds adjustment for Battle --- src/hardware/hw_md2.c | 34 +++++++----- src/k_kart.c | 118 +++++++++++++++++++++--------------------- src/p_inter.c | 2 +- 3 files changed, 82 insertions(+), 72 deletions(-) diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index 2519a1ed..f8bca56e 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -968,6 +968,7 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, // Average all of the translation's colors { UINT16 r, g, b; + UINT8 div = 0; blendcolor = V_GetColor(colortranslations[color][0]); r = (UINT16)blendcolor.s.red; @@ -977,20 +978,29 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, for (i = 1; i < 16; i++) { RGBA_t nextcolor = V_GetColor(colortranslations[color][i]); - r += (UINT16)nextcolor.s.red; - g += (UINT16)nextcolor.s.green; - b += (UINT16)nextcolor.s.blue; - if (i >= 4 && i <= 9) // Weight these shades more. Indices 4-9 weren't randomly picked, they are commonly used on sprites and are generally what the colors "look" like - { - r += (UINT16)nextcolor.s.red; - g += (UINT16)nextcolor.s.green; - b += (UINT16)nextcolor.s.blue; - } + UINT8 mul = 1; + // Weight these shades more. Indices 1-9 weren't randomly picked, they are commonly used on sprites and are generally what the colors "look" like + if (i >= 1 && i <= 9) + mul++; + // The mid & dark tons on the minimap icons get weighted even harder + if (i == 4 || i == 6) + mul += 2; + // And the shade between them, why not + if (i == 5) + mul++; + r += (UINT16)(nextcolor.s.red)*mul; + g += (UINT16)(nextcolor.s.green)*mul; + b += (UINT16)(nextcolor.s.blue)*mul; + div += mul; } - blendcolor.s.red = (UINT8)(r/22); - blendcolor.s.green = (UINT8)(g/22); - blendcolor.s.blue = (UINT8)(b/22); + // This shouldn't happen. + if (div < 1) + div = 1; + + blendcolor.s.red = (UINT8)(r/div); + blendcolor.s.green = (UINT8)(g/div); + blendcolor.s.blue = (UINT8)(b/div); } // rainbow support, could theoretically support boss ones too diff --git a/src/k_kart.c b/src/k_kart.c index 6c758c0d..72099614 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -111,68 +111,68 @@ const UINT8 KartColor_Opposite[MAXSKINCOLORS*2] = { SKINCOLOR_NONE,8, // 00 // SKINCOLOR_NONE SKINCOLOR_BLACK,8, // 01 // SKINCOLOR_IVORY - SKINCOLOR_BLACK,8, // 02 // SKINCOLOR_WHITE - SKINCOLOR_NICKEL,8, // 03 // SKINCOLOR_SILVER + SKINCOLOR_NICKEL,8, // 02 // SKINCOLOR_WHITE + SKINCOLOR_GREY,8, // 03 // SKINCOLOR_SILVER SKINCOLOR_CLOUDY,8, // 04 // SKINCOLOR_CLOUDY - SKINCOLOR_GREY,8, // 05 // SKINCOLOR_GREY - SKINCOLOR_SILVER,8, // 06 // SKINCOLOR_NICKEL - SKINCOLOR_WHITE,8, // 07 // SKINCOLOR_BLACK - SKINCOLOR_SWAMP,8, // 08 // SKINCOLOR_SALMON + SKINCOLOR_SILVER,8, // 05 // SKINCOLOR_GREY + SKINCOLOR_WHITE,8, // 06 // SKINCOLOR_NICKEL + SKINCOLOR_IVORY,8, // 07 // SKINCOLOR_BLACK + SKINCOLOR_TEA,8, // 08 // SKINCOLOR_SALMON SKINCOLOR_ARMY,8, // 09 // SKINCOLOR_PINK - SKINCOLOR_PINETREE,8, // 10 // SKINCOLOR_RASPBERRY - SKINCOLOR_EMERALD,8, // 11 // SKINCOLOR_RUBY + SKINCOLOR_MINT,10, // 10 // SKINCOLOR_RASPBERRY + SKINCOLOR_EMERALD,6, // 11 // SKINCOLOR_RUBY SKINCOLOR_GREEN,8, // 12 // SKINCOLOR_RED SKINCOLOR_MOSS,8, // 13 // SKINCOLOR_ROSE - SKINCOLOR_MINT,8, // 14 // SKINCOLOR_CRIMSON - SKINCOLOR_NAVY,8, // 15 // SKINCOLOR_DAWN + SKINCOLOR_PINETREE,6, // 14 // SKINCOLOR_CRIMSON + SKINCOLOR_DUSK,8, // 15 // SKINCOLOR_DAWN SKINCOLOR_BLUE,8, // 16 // SKINCOLOR_ORANGE - SKINCOLOR_PERIWINKLE,8, // 17 // SKINCOLOR_PUMPKIN + SKINCOLOR_BLUEBERRY,8, // 17 // SKINCOLOR_PUMPKIN SKINCOLOR_STEEL,8, // 18 // SKINCOLOR_BRONZE - SKINCOLOR_STEEL,8, // 19 // SKINCOLOR_ROSEWOOD - SKINCOLOR_SLATE,8, // 20 // SKINCOLOR_BURGUNDY - SKINCOLOR_LEATHER,8, // 21 // SKINCOLOR_SEPIA - SKINCOLOR_BROWN,8, // 22 // SKINCOLOR_BEIGE + SKINCOLOR_NAVY,8, // 19 // SKINCOLOR_ROSEWOOD + SKINCOLOR_JET,8, // 20 // SKINCOLOR_BURGUNDY + SKINCOLOR_LEATHER,6, // 21 // SKINCOLOR_SEPIA + SKINCOLOR_BROWN,2, // 22 // SKINCOLOR_BEIGE SKINCOLOR_BEIGE,8, // 23 // SKINCOLOR_BROWN SKINCOLOR_SEPIA,8, // 24 // SKINCOLOR_LEATHER - SKINCOLOR_INDIGO,8, // 25 // SKINCOLOR_TANGERINE - SKINCOLOR_INDIGO,8, // 26 // SKINCOLOR_YELLOW - SKINCOLOR_INDIGO,8, // 27 // SKINCOLOR_CANARY - SKINCOLOR_BROWN,8, // 28 // SKINCOLOR_PEACH - SKINCOLOR_BLUEBERRY,8, // 29 // SKINCOLOR_CREAMSICLE - SKINCOLOR_LAVENDER,8, // 30 // SKINCOLOR_GOLD - SKINCOLOR_BEIGE,8, // 31 // SKINCOLOR_CARAMEL - SKINCOLOR_PURPLE,8, // 32 // SKINCOLOR_VOMIT - SKINCOLOR_PURPLE,8, // 33 // SKINCOLOR_LIME - SKINCOLOR_BYZANTIUM,8, // 34 // SKINCOLOR_GARDEN - SKINCOLOR_LAVENDER,8, // 35 // SKINCOLOR_TEA - SKINCOLOR_LAVENDER,8, // 36 // SKINCOLOR_ARMY - SKINCOLOR_PURPLE,8, // 37 // SKINCOLOR_PISTACHIO - SKINCOLOR_LILAC,8, // 38 // SKINCOLOR_ROBOHOOD - SKINCOLOR_LILAC,8, // 39 // SKINCOLOR_OLIVE - SKINCOLOR_LAVENDER,8, // 40 // SKINCOLOR_MOSS - SKINCOLOR_CRIMSON,8, // 41 // SKINCOLOR_MINT + SKINCOLOR_LIME,8, // 25 // SKINCOLOR_TANGERINE + SKINCOLOR_BYZANTIUM,8, // 26 // SKINCOLOR_YELLOW + SKINCOLOR_PURPLE,8, // 27 // SKINCOLOR_CANARY + SKINCOLOR_SLATE,8, // 28 // SKINCOLOR_PEACH + SKINCOLOR_PERIWINKLE,8, // 29 // SKINCOLOR_CREAMSICLE + SKINCOLOR_LAVENDER,6, // 30 // SKINCOLOR_GOLD + SKINCOLOR_TEAL,8, // 31 // SKINCOLOR_CARAMEL + SKINCOLOR_ROBOHOOD,8, // 32 // SKINCOLOR_VOMIT + SKINCOLOR_TANGERINE,8, // 33 // SKINCOLOR_LIME + SKINCOLOR_AQUA,8, // 34 // SKINCOLOR_GARDEN + SKINCOLOR_SALMON,8, // 35 // SKINCOLOR_TEA + SKINCOLOR_PINK,6, // 36 // SKINCOLOR_ARMY + SKINCOLOR_CYAN,8, // 37 // SKINCOLOR_PISTACHIO + SKINCOLOR_VOMIT,8, // 38 // SKINCOLOR_ROBOHOOD + SKINCOLOR_INDIGO,8, // 39 // SKINCOLOR_OLIVE + SKINCOLOR_ROSE,8, // 40 // SKINCOLOR_MOSS + SKINCOLOR_RASPBERRY,6, // 41 // SKINCOLOR_MINT SKINCOLOR_RUBY,8, // 42 // SKINCOLOR_EMERALD SKINCOLOR_RED,8, // 43 // SKINCOLOR_GREEN - SKINCOLOR_RASPBERRY,8, // 44 // SKINCOLOR_PINETREE - SKINCOLOR_SALMON,8, // 45 // SKINCOLOR_SWAMP - SKINCOLOR_PINK,8, // 46 // SKINCOLOR_SLATE + SKINCOLOR_CRIMSON,8, // 44 // SKINCOLOR_PINETREE + SKINCOLOR_SAPPHIRE,8, // 45 // SKINCOLOR_SWAMP + SKINCOLOR_PEACH,8, // 46 // SKINCOLOR_SLATE SKINCOLOR_CREAMSICLE,8, // 47 // SKINCOLOR_PERIWINKLE - SKINCOLOR_CARAMEL,8, // 48 // SKINCOLOR_CYAN - SKINCOLOR_GOLD,8, // 49 // SKINCOLOR_CERULEAN - SKINCOLOR_CRIMSON,8, // 50 // SKINCOLOR_AQUA - SKINCOLOR_RED,8, // 51 // SKINCOLOR_TEAL - SKINCOLOR_PEACH,8, // 52 // SKINCOLOR_STEEL + SKINCOLOR_PISTACHIO,6, // 48 // SKINCOLOR_CYAN + SKINCOLOR_LILAC,8, // 49 // SKINCOLOR_CERULEAN + SKINCOLOR_GARDEN,10, // 50 // SKINCOLOR_AQUA + SKINCOLOR_CARAMEL,8, // 51 // SKINCOLOR_TEAL + SKINCOLOR_BRONZE,10, // 52 // SKINCOLOR_STEEL SKINCOLOR_ORANGE,8, // 53 // SKINCOLOR_BLUE - SKINCOLOR_ORANGE,8, // 54 // SKINCOLOR_SAPPHIRE - SKINCOLOR_DAWN,8, // 55 // SKINCOLOR_NAVY - SKINCOLOR_CREAMSICLE,8, // 56 // SKINCOLOR_BLUEBERRY - SKINCOLOR_SLATE,8, // 57 // SKINCOLOR_JET - SKINCOLOR_YELLOW,8, // 58 // SKINCOLOR_LILAC - SKINCOLOR_YELLOW,8, // 59 // SKINCOLOR_DUSK - SKINCOLOR_YELLOW,8, // 60 // SKINCOLOR_PURPLE - SKINCOLOR_GOLD,8, // 61 // SKINCOLOR_LAVENDER - SKINCOLOR_GARDEN,8, // 62 // SKINCOLOR_BYZANTIUM - SKINCOLOR_YELLOW,8 // 63 // SKINCOLOR_INDIGO + SKINCOLOR_SWAMP,8, // 54 // SKINCOLOR_SAPPHIRE + SKINCOLOR_ROSEWOOD,8, // 55 // SKINCOLOR_NAVY + SKINCOLOR_PUMPKIN,8, // 56 // SKINCOLOR_BLUEBERRY + SKINCOLOR_BURGUNDY,6, // 57 // SKINCOLOR_JET + SKINCOLOR_CERULEAN,8, // 58 // SKINCOLOR_LILAC + SKINCOLOR_DAWN,8, // 59 // SKINCOLOR_DUSK + SKINCOLOR_CANARY,8, // 60 // SKINCOLOR_PURPLE + SKINCOLOR_GOLD,10, // 61 // SKINCOLOR_LAVENDER + SKINCOLOR_YELLOW,8, // 62 // SKINCOLOR_BYZANTIUM + SKINCOLOR_OLIVE,8 // 63 // SKINCOLOR_INDIGO }; UINT8 colortranslations[MAXSKINCOLORS][16] = { @@ -187,7 +187,7 @@ UINT8 colortranslations[MAXSKINCOLORS][16] = { {120, 120, 120, 121, 121, 122, 122, 123, 124, 125, 126, 128, 129, 131, 133, 135}, // SKINCOLOR_SALMON {121, 121, 121, 121, 121, 122, 144, 145, 146, 147, 148, 149, 150, 150, 150, 151}, // SKINCOLOR_PINK {120, 121, 122, 123, 124, 125, 126, 127, 128, 130, 131, 133, 134, 136, 137, 139}, // SKINCOLOR_RASPBERRY - {120, 0, 144, 146, 149, 131, 132, 133, 134, 135, 197, 197, 198, 198, 199, 241}, // SKINCOLOR_RUBY + {120, 121, 144, 146, 149, 132, 132, 133, 134, 135, 197, 197, 198, 198, 199, 255}, // SKINCOLOR_RUBY {125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140}, // SKINCOLOR_RED {144, 145, 146, 147, 148, 149, 150, 151, 134, 135, 136, 137, 138, 139, 140, 141}, // SKINCOLOR_ROSE {130, 131, 132, 133, 134, 136, 137, 138, 139, 139, 140, 140, 141, 141, 142, 143}, // SKINCOLOR_CRIMSON @@ -197,7 +197,7 @@ UINT8 colortranslations[MAXSKINCOLORS][16] = { {112, 113, 114, 115, 116, 117, 118, 119, 156, 157, 158, 159, 141, 141, 142, 143}, // SKINCOLOR_BRONZE { 90, 91, 92, 93, 94, 152, 153, 154, 155, 156, 157, 158, 159, 139, 141, 143}, // SKINCOLOR_ROSEWOOD { 94, 95, 152, 153, 154, 156, 157, 159, 141, 141, 141, 142, 142, 143, 143, 31}, // SKINCOLOR_BURGUNDY - { 3, 5, 7, 32, 9, 34, 36, 37, 39, 42, 45, 59, 60, 61, 62, 63}, // SKINCOLOR_SEPIA + { 0, 1, 3, 5, 7, 9, 34, 36, 38, 40, 42, 44, 60, 61, 62, 63}, // SKINCOLOR_SEPIA { 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}, // SKINCOLOR_BEIGE { 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63}, // SKINCOLOR_BROWN { 51, 52, 53, 55, 56, 57, 58, 60, 61, 63, 28, 28, 29, 29, 30, 31}, // SKINCOLOR_LEATHER @@ -230,8 +230,8 @@ UINT8 colortranslations[MAXSKINCOLORS][16] = { {210, 213, 220, 220, 220, 221, 221, 221, 221, 222, 222, 222, 223, 223, 191, 31}, // SKINCOLOR_TEAL {120, 200, 200, 201, 201, 202, 202, 203, 203, 204, 204, 205, 205, 206, 207, 31}, // SKINCOLOR_STEEL {224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239}, // SKINCOLOR_BLUE - {208, 210, 212, 214, 216, 229, 231, 232, 233, 235, 236, 237, 238, 239, 241, 244}, // SKINCOLOR_SAPPHIRE - {200, 201, 202, 203, 204, 205, 206, 238, 239, 240, 241, 242, 243, 244, 245, 246}, // SKINCOLOR_NAVY + {208, 209, 211, 213, 215, 217, 229, 230, 232, 234, 236, 238, 240, 242, 244, 246}, // SKINCOLOR_SAPPHIRE + {215, 216, 217, 218, 204, 205, 206, 237, 238, 239, 240, 241, 242, 243, 244, 245}, // SKINCOLOR_NAVY {228, 229, 230, 231, 232, 233, 234, 235, 237, 238, 239, 240, 242, 243, 244, 245}, // SKINCOLOR_BLUEBERRY {200, 201, 202, 203, 204, 205, 206, 207, 28, 28, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_JET {120, 120, 120, 121, 121, 122, 122, 123, 192, 248, 249, 250, 251, 252, 253, 254}, // SKINCOLOR_LILAC @@ -488,12 +488,12 @@ static INT32 K_KartItemOddsBattle[NUMKARTRESULTS][6] = /*Invincibility*/ { 4, 2, 1, 2 }, // Invincibility /*Banana*/ { 0, 0, 2, 0 }, // Banana /*Eggman Monitor*/ { 0, 0, 1, 0 }, // Eggman Monitor - /*Orbinaut*/ { 0, 1, 3, 0 }, // Orbinaut + /*Orbinaut*/ { 0, 1, 4, 0 }, // Orbinaut /*Jawz*/ { 1, 3, 2, 2 }, // Jawz /*Mine*/ { 1, 3, 2, 2 }, // Mine /*Ballhog*/ { 1, 2, 2, 2 }, // Ballhog /*Self-Propelled Bomb*/ { 0, 0, 0, 0 }, // Self-Propelled Bomb - /*Grow*/ { 4, 2, 1, 2 }, // Grow + /*Grow*/ { 4, 2, 0, 2 }, // Grow /*Shrink*/ { 0, 0, 0, 0 }, // Shrink /*Lightning Shield*/ { 0, 0, 0, 0 }, // Lightning Shield /*Hyudoro*/ { 0, 0, 1, 0 }, // Hyudoro @@ -1502,9 +1502,9 @@ void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, boolean trapitem P_SetScale(karmahitbox, player->mo->scale); CONS_Printf(M_GetText("%s lost all of their bumpers!\n"), player_names[player-players]); } + player->kartstuff[k_bumper]--; if (K_IsPlayerWanted(player)) K_CalculateBattleWanted(); - player->kartstuff[k_bumper]--; } K_CheckBumpers(); @@ -1569,9 +1569,9 @@ void K_SquishPlayer(player_t *player, mobj_t *source) P_SetScale(karmahitbox, player->mo->scale); CONS_Printf(M_GetText("%s lost all of their bumpers!\n"), player_names[player-players]); } + player->kartstuff[k_bumper]--; if (K_IsPlayerWanted(player)) K_CalculateBattleWanted(); - player->kartstuff[k_bumper]--; } K_CheckBumpers(); @@ -1630,9 +1630,9 @@ void K_ExplodePlayer(player_t *player, mobj_t *source) // A bit of a hack, we ju P_SetScale(karmahitbox, player->mo->scale); CONS_Printf(M_GetText("%s lost all of their bumpers!\n"), player_names[player-players]); } + player->kartstuff[k_bumper]--; if (K_IsPlayerWanted(player)) K_CalculateBattleWanted(); - player->kartstuff[k_bumper]--; } K_CheckBumpers(); diff --git a/src/p_inter.c b/src/p_inter.c index 3fafa0cd..d275b83e 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2840,9 +2840,9 @@ static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage) P_SetScale(karmahitbox, player->mo->scale); CONS_Printf(M_GetText("%s lost all of their bumpers!\n"), player_names[player-players]); } + player->kartstuff[k_bumper]--; if (K_IsPlayerWanted(player)) K_CalculateBattleWanted(); - player->kartstuff[k_bumper]--; } K_CheckBumpers();