diff --git a/src/command.c b/src/command.c index 03c8869d..df5ffa4f 100644 --- a/src/command.c +++ b/src/command.c @@ -64,9 +64,6 @@ CV_PossibleValue_t CV_Unsigned[] = {{0, "MIN"}, {999999999, "MAX"}, {0, NULL}}; CV_PossibleValue_t CV_Natural[] = {{1, "MIN"}, {999999999, "MAX"}, {0, NULL}}; //SRB2kart -CV_PossibleValue_t karthud_cons_t[] = { - {0, "Off"}, {1, "Default"}, {2, "SNES"}, {3, "MK64"}, - {0, NULL}}; CV_PossibleValue_t kartspeed_cons_t[] = { {0, "Easy"}, {1, "Normal"}, {2, "Hard"}, {0, NULL}}; diff --git a/src/command.h b/src/command.h index 513883d4..dbac8bd8 100644 --- a/src/command.h +++ b/src/command.h @@ -127,7 +127,6 @@ extern CV_PossibleValue_t CV_Unsigned[]; extern CV_PossibleValue_t CV_Natural[]; // SRB2kart -extern CV_PossibleValue_t karthud_cons_t[]; extern CV_PossibleValue_t kartspeed_cons_t[]; // register a variable for use at the console diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 5f5e7e30..72ea1588 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -247,7 +247,7 @@ consvar_t cv_competitionboxes = {"competitionboxes", "Random", CV_NETVAR|CV_CHEA #ifdef SEENAMES static CV_PossibleValue_t seenames_cons_t[] = {{0, "Off"}, {1, "Colorless"}, {2, "Team"}, {3, "Ally/Foe"}, {0, NULL}}; consvar_t cv_seenames = {"seenames", "Off", CV_SAVE, seenames_cons_t, 0, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_allowseenames = {"allowseenames", "Yes", CV_NETVAR, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_allowseenames = {"allowseenames", "No", CV_NETVAR, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; #endif // these are just meant to be saved to the config @@ -335,13 +335,15 @@ consvar_t cv_shrink = {"shrink", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NUL consvar_t cv_thundershield = {"thundershield", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_hyudoro = {"hyudoro", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_pogospring = {"pogospring", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_kitchensink = {"kitchensink", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_triplesneaker = {"triplesneaker", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_triplebanana = {"triplebanana", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_decabanana = {"decabanana", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_tripleorbinaut = {"tripleorbinaut", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_quadorbinaut = {"quadorbinaut", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_dualjawz = {"dualjawz", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_karthud = {"karthud", "Default", CV_SAVE|CV_CALL, karthud_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t kartminimap_cons_t[] = {{0, "MIN"}, {10, "MAX"}, {0, NULL}}; consvar_t cv_kartminimap = {"kartminimap", "4", CV_SAVE, kartminimap_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_kartcheck = {"kartcheck", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -367,8 +369,10 @@ static CV_PossibleValue_t kartdebugitem_cons_t[] = {{-1, "MIN"}, {NUMKARTITEMS-1 consvar_t cv_kartdebugitem = {"kartdebugitem", "0", CV_NETVAR|CV_CHEAT, kartdebugitem_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t kartdebugamount_cons_t[] = {{1, "MIN"}, {255, "MAX"}, {0, NULL}}; consvar_t cv_kartdebugamount = {"kartdebugamount", "1", CV_NETVAR|CV_CHEAT, kartdebugamount_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_kartdebugcheckpoint = {"kartdebugcheckpoint", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_kartdebugshrink = {"kartdebugshrink", "Off", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_kartdebugdistribution = {"kartdebugdistribution", "Off", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; + +consvar_t cv_kartdebugcheckpoint = {"kartdebugcheckpoint", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t votetime_cons_t[] = {{10, "MIN"}, {3600, "MAX"}, {0, NULL}}; consvar_t cv_votetime = {"votetime", "20", CV_NETVAR, votetime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -380,7 +384,7 @@ consvar_t cv_gravity = {"gravity", "0.8", CV_RESTRICT|CV_FLOAT|CV_CALL, NULL, Gr consvar_t cv_soundtest = {"soundtest", "0", CV_CALL, NULL, SoundTest_OnChange, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t minitimelimit_cons_t[] = {{15, "MIN"}, {9999, "MAX"}, {0, NULL}}; -consvar_t cv_countdowntime = {"countdowntime", "60", CV_NETVAR|CV_CHEAT, minitimelimit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_countdowntime = {"countdowntime", "30", CV_NETVAR|CV_CHEAT, minitimelimit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_touchtag = {"touchtag", "Off", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_hidetime = {"hidetime", "30", CV_NETVAR|CV_CALL, minitimelimit_cons_t, Hidetime_OnChange, 0, NULL, NULL, 0, 0, NULL}; diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 5814f2ae..40ec3fc3 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -112,11 +112,11 @@ extern consvar_t cv_recycler;*/ extern consvar_t cv_sneaker, cv_rocketsneaker, cv_invincibility, cv_banana; extern consvar_t cv_eggmanmonitor, cv_orbinaut, cv_jawz, cv_mine; extern consvar_t cv_ballhog, cv_selfpropelledbomb, cv_grow, cv_shrink; -extern consvar_t cv_thundershield, cv_hyudoro, cv_pogospring; +extern consvar_t cv_thundershield, cv_hyudoro, cv_pogospring, cv_kitchensink; -extern consvar_t cv_triplesneaker, cv_triplebanana, cv_tripleorbinaut, cv_dualjawz; +extern consvar_t cv_triplesneaker, cv_triplebanana, cv_decabanana; +extern consvar_t cv_tripleorbinaut, cv_quadorbinaut, cv_dualjawz; -extern consvar_t cv_karthud; extern consvar_t cv_kartminimap; extern consvar_t cv_kartcheck; extern consvar_t cv_kartinvinsfx; @@ -133,7 +133,8 @@ extern consvar_t cv_karteliminatelast; extern consvar_t cv_votetime; -extern consvar_t cv_kartdebugitem, cv_kartdebugamount, cv_kartdebugcheckpoint, cv_kartdebugshrink; +extern consvar_t cv_kartdebugitem, cv_kartdebugamount, cv_kartdebugshrink, cv_kartdebugdistribution; +extern consvar_t cv_kartdebugcheckpoint; extern consvar_t cv_itemfinder; diff --git a/src/d_player.h b/src/d_player.h index 95d703ef..822ea305 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -276,6 +276,7 @@ typedef enum k_waypoint, // Waypoints. k_starpostwp, // Temporarily stores player waypoint for... some reason. Used when respawning and finishing. k_respawn, // Timer for the DEZ laser respawn effect + k_dropdash, // Charge up for respawn Drop Dash k_throwdir, // Held dir of controls; 1 = forward, 0 = none, -1 = backward (was "player->heldDir") k_lapanimation, // Used to show the lap start wing logo animation @@ -291,12 +292,19 @@ typedef enum k_driftend, // Drift has ended, used to adjust character angle after drift k_driftcharge, // Charge your drift so you can release a burst of speed k_driftboost, // Boost you get from drifting - k_boostcharge, // Charge-up for boosting at the start of the race, or when dropping from respawn + k_boostcharge, // Charge-up for boosting at the start of the race + k_startboost, // Boost you get from start of race or respawn drop dash k_jmp, // In Mario Kart, letting go of the jump button stops the drift k_offroad, // In Super Mario Kart, going offroad has lee-way of about 1 second before you start losing speed k_pogospring, // Pogo spring bounce effect k_brakestop, // Wait until you've made a complete stop for a few tics before letting brake go in reverse. k_waterskip, // Water skipping counter + k_dashpadcooldown, // Separate the vanilla SA-style dash pads from using pw_flashing + k_boostpower, // Base boost value, for offroad + k_speedboost, // Boost value smoothing for max speed + k_accelboost, // Boost value smoothing for acceleration + k_boostcam, // Camera push forward on boost + k_destboostcam, // Ditto k_itemroulette, // Used for the roulette when deciding what item to give you (was "pw_kartitem") k_roulettetype, // Used for the roulette, for deciding type (currently only used for Battle, to give you better items from Karma items) @@ -321,7 +329,8 @@ typedef enum k_eggmanheld, // Eggman monitor held, separate from k_itemheld so it doesn't stop you from getting items k_eggmanexplode, // Fake item recieved, explode in a few seconds k_eggmanblame, // Fake item recieved, who set this fake - k_bananadrag, // After a second of holding a banana behind you, you start to slow down + k_lastjawztarget, // Last person you target with jawz, for playing the target switch sfx + 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_wipeoutslow, // Timer before you slowdown when getting wiped out k_justbumped, // Prevent players from endlessly bumping into each other diff --git a/src/dehacked.c b/src/dehacked.c index 785df9cc..3dab690e 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6238,12 +6238,12 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit //} // Drift Sparks - "S_DRIFTSPARK1", - "S_DRIFTSPARK2", - "S_DRIFTSPARK3", - "S_DRIFTSPARK4", - "S_DRIFTSPARK5", - "S_DRIFTSPARK6", + "S_DRIFTSPARK_A1", + "S_DRIFTSPARK_A2", + "S_DRIFTSPARK_A3", + "S_DRIFTSPARK_B1", + "S_DRIFTSPARK_C1", + "S_DRIFTSPARK_C2", // Drift Smoke "S_DRIFTDUST1", @@ -6251,8 +6251,34 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_DRIFTDUST3", "S_DRIFTDUST4", + // Fast lines + "S_FASTLINE1", + "S_FASTLINE2", + "S_FASTLINE3", + "S_FASTLINE4", + "S_FASTLINE5", + + // Fast dust release + "S_FASTDUST1", + "S_FASTDUST2", + "S_FASTDUST3", + "S_FASTDUST4", + "S_FASTDUST5", + "S_FASTDUST6", + "S_FASTDUST7", + // Thunder Shield Burst + // Sneaker boost effect + "S_BOOSTFLAME", + "S_BOOSTSMOKESPAWNER", + "S_BOOSTSMOKE1", + "S_BOOSTSMOKE2", + "S_BOOSTSMOKE3", + "S_BOOSTSMOKE4", + "S_BOOSTSMOKE5", + "S_BOOSTSMOKE6", + // Sneaker Fire Trail "S_KARTFIRE1", "S_KARTFIRE2", @@ -6366,6 +6392,8 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_JAWZ_DEAD2", //} + "S_PLAYERRETICULE", // Player reticule + // Special Stage Mine "S_SSMINE1", "S_SSMINE2", @@ -6483,6 +6511,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit // The legend "S_SINK", + "S_SINK_SHIELD", "S_SINKTRAIL1", "S_SINKTRAIL2", "S_SINKTRAIL3", @@ -7210,11 +7239,15 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_RANDOMITEM", "MT_RANDOMITEMPOP", + "MT_FASTLINE", + "MT_FASTDUST", + "MT_BOOSTFLAME", + "MT_BOOSTSMOKE", "MT_SNEAKERTRAIL", "MT_SPARKLETRAIL", "MT_INVULNFLASH", "MT_WIPEOUTTRAIL", - "MT_DRIFT", + "MT_DRIFTSPARK", "MT_DRIFTDUST", "MT_FAKESHIELD", @@ -7230,6 +7263,8 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_JAWZ_DUD", "MT_JAWZ_SHIELD", + "MT_PLAYERRETICULE", // Jawz reticule + "MT_SSMINE_SHIELD", // Special Stage Mine stuff "MT_SSMINE", "MT_MINEEXPLOSION", @@ -7249,6 +7284,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_THUNDERSHIELD", // Thunder Shield stuff "MT_SINK", // Kitchen Sink Stuff + "MT_SINK_SHIELD", "MT_SINKTRAIL", "MT_BATTLEBUMPER", // Battle Mode bumper @@ -7531,68 +7567,68 @@ static const char *const ML_LIST[16] = { // Also includes Super colors static const char *COLOR_ENUMS[] = { // Rejigged for Kart. "NONE", // 00 // SKINCOLOR_NONE - "IVORY", // 01 // SKINCOLOR_IVORY - "WHITE", // 02 // SKINCOLOR_WHITE - "SILVER", // 03 // SKINCOLOR_SILVER - "CLOUDY", // 04 // SKINCOLOR_CLOUDY - "GREY", // 05 // SKINCOLOR_GREY - "NICKEL", // 06 // SKINCOLOR_NICKEL - "BLACK", // 07 // SKINCOLOR_BLACK - "SALMON", // 08 // SKINCOLOR_SALMON - "PINK", // 09 // SKINCOLOR_PINK - "ROSE", // 10 // SKINCOLOR_ROSE - "RASPBERRY", // 11 // SKINCOLOR_RASPBERRY - "RED", // 12 // SKINCOLOR_RED - "RUBY", // 13 // SKINCOLOR_RUBY - "CRIMSON", // 14 // SKINCOLOR_CRIMSON - "DAWN", // 15 // SKINCOLOR_DAWN - "CREAMSICLE", // 16 // SKINCOLOR_CREAMSICLE - "ORANGE", // 17 // SKINCOLOR_ORANGE - "PUMPKIN", // 18 // SKINCOLOR_PUMPKIN - "ROSEWOOD", // 19 // SKINCOLOR_ROSEWOOD - "BURGUNDY", // 20 // SKINCOLOR_BURGUNDY - "BRONZE", // 21 // SKINCOLOR_BRONZE - "SEPIA", // 22 // SKINCOLOR_SEPIA - "BEIGE", // 23 // SKINCOLOR_BEIGE - "BROWN", // 24 // SKINCOLOR_BROWN - "LEATHER", // 25 // SKINCOLOR_LEATHER - "PEACH", // 26 // SKINCOLOR_PEACH - "CARAMEL", // 27 // SKINCOLOR_CARAMEL - "TANGERINE", // 28 // SKINCOLOR_TANGERINE - "GOLD", // 29 // SKINCOLOR_GOLD - "VOMIT", // 30 // SKINCOLOR_VOMIT - "YELLOW", // 31 // SKINCOLOR_YELLOW - "CANARY", // 32 // SKINCOLOR_CANARY - "OLIVE", // 33 // SKINCOLOR_OLIVE - "GARDEN", // 34 // SKINCOLOR_GARDEN - "LIME", // 35 // SKINCOLOR_LIME + "WHITE", // 01 // SKINCOLOR_WHITE + "SILVER", // 02 // SKINCOLOR_SILVER + "GREY", // 03 // SKINCOLOR_GREY + "NICKEL", // 04 // SKINCOLOR_NICKEL + "BLACK", // 05 // SKINCOLOR_BLACK + "SEPIA", // 06 // SKINCOLOR_SEPIA + "BEIGE", // 07 // SKINCOLOR_BEIGE + "BROWN", // 08 // SKINCOLOR_BROWN + "LEATHER", // 09 // SKINCOLOR_LEATHER + "SALMON", // 10 // SKINCOLOR_SALMON + "PINK", // 11 // SKINCOLOR_PINK + "ROSE", // 12 // SKINCOLOR_ROSE + "RASPBERRY", // 13 // SKINCOLOR_RASPBERRY + "RED", // 14 // SKINCOLOR_RED + "RUBY", // 15 // SKINCOLOR_RUBY + "CRIMSON", // 16 // SKINCOLOR_CRIMSON + "KETCHUP", // 17 // SKINCOLOR_KETCHUP + "DAWN", // 18 // SKINCOLOR_DAWN + "CREAMSICLE", // 19 // SKINCOLOR_CREAMSICLE + "ORANGE", // 20 // SKINCOLOR_ORANGE + "PUMPKIN", // 21 // SKINCOLOR_PUMPKIN + "ROSEWOOD", // 22 // SKINCOLOR_ROSEWOOD + "BURGUNDY", // 23 // SKINCOLOR_BURGUNDY + "TANGERINE", // 24 // SKINCOLOR_TANGERINE + "PEACH", // 25 // SKINCOLOR_PEACH + "CARAMEL", // 26 // SKINCOLOR_CARAMEL + "GOLD", // 27 // SKINCOLOR_GOLD + "BRONZE", // 28 // SKINCOLOR_BRONZE + "YELLOW", // 29 // SKINCOLOR_YELLOW + "MUSTARD", // 30 // SKINCOLOR_MUSTARD + "OLIVE", // 31 // SKINCOLOR_OLIVE + "VOMIT", // 32 // SKINCOLOR_VOMIT + "GARDEN", // 33 // SKINCOLOR_GARDEN + "LIME", // 34 // SKINCOLOR_LIME + "DREAM", // 35 // SKINCOLOR_DREAM "TEA", // 36 // SKINCOLOR_TEA - "ARMY", // 37 // SKINCOLOR_ARMY - "PISTACHIO", // 38 // SKINCOLOR_PISTACHIO + "PISTACHIO", // 37 // SKINCOLOR_PISTACHIO + "ROBOHOOD", // 38 // SKINCOLOR_ROBOHOOD "MOSS", // 39 // SKINCOLOR_MOSS "MINT", // 40 // SKINCOLOR_MINT "GREEN", // 41 // SKINCOLOR_GREEN - "ROBOHOOD", // 42 // SKINCOLOR_ROBOHOOD - "PINETREE", // 43 // SKINCOLOR_PINETREE - "EMERALD", // 44 // SKINCOLOR_EMERALD - "SWAMP", // 45 // SKINCOLOR_SWAMP - "AQUA", // 46 // SKINCOLOR_AQUA - "TEAL", // 47 // SKINCOLOR_TEAL - "CYAN", // 48 // SKINCOLOR_CYAN + "PINETREE", // 42 // SKINCOLOR_PINETREE + "EMERALD", // 43 // SKINCOLOR_EMERALD + "SWAMP", // 44 // SKINCOLOR_SWAMP + "AQUA", // 45 // SKINCOLOR_AQUA + "TEAL", // 46 // SKINCOLOR_TEAL + "CYAN", // 47 // SKINCOLOR_CYAN + "JAWZ", // 48 // SKINCOLOR_JAWZ "CERULEAN", // 49 // SKINCOLOR_CERULEAN - "SLATE", // 50 // SKINCOLOR_SLATE - "STEEL", // 51 // SKINCOLOR_STEEL - "PERIWINKLE", // 52 // SKINCOLOR_PERIWINKLE - "BLUE", // 53 // SKINCOLOR_BLUE - "SAPPHIRE", // 54 // SKINCOLOR_SAPPHIRE - "BLUEBERRY", // 55 // SKINCOLOR_BLUEBERRY - "NAVY", // 56 // SKINCOLOR_NAVY - "JET", // 57 // SKINCOLOR_JET + "NAVY", // 50 // SKINCOLOR_NAVY + "SLATE", // 51 // SKINCOLOR_SLATE + "STEEL", // 52 // SKINCOLOR_STEEL + "JET", // 53 // SKINCOLOR_JET + "PERIWINKLE", // 54 // SKINCOLOR_PERIWINKLE + "BLUE", // 55 // SKINCOLOR_BLUE + "SAPPHIRE", // 56 // SKINCOLOR_SAPPHIRE + "BLUEBERRY", // 57 // SKINCOLOR_BLUEBERRY "DUSK", // 58 // SKINCOLOR_DUSK "PURPLE", // 59 // SKINCOLOR_PURPLE "LAVENDER", // 60 // SKINCOLOR_LAVENDER - "INDIGO", // 61 // SKINCOLOR_INDIGO - "BYZANTIUM", // 62 // SKINCOLOR_BYZANTIUM + "BYZANTIUM", // 61 // SKINCOLOR_BYZANTIUM + "POMEGRANATE", // 62 // SKINCOLOR_POMEGRANATE "LILAC", // 63 // SKINCOLOR_LILAC // Super special awesome Super flashing colors! @@ -7659,6 +7695,7 @@ static const char *const KARTSTUFF_LIST[] = { "WAYPOINT", "STARPOSTWP", "RESPAWN", + "DROPDASH", "THROWDIR", "LAPANIMATION", @@ -7675,11 +7712,18 @@ static const char *const KARTSTUFF_LIST[] = { "DRIFTCHARGE", "DRIFTBOOST", "BOOSTCHARGE", + "STARTBOOST", "JMP", "OFFROAD", "POGOSPRING", "BRAKESTOP", "WATERSKIP", + "DASHPADCOOLDOWN", + "BOOSTPOWER", + "SPEEDBOOST", + "ACCELBOOST", + "BOOSTCAM", + "DESTBOOSTCAM", "ITEMROULETTE", "ROULETTETYPE", @@ -7688,7 +7732,6 @@ static const char *const KARTSTUFF_LIST[] = { "ITEMAMOUNT", "ITEMHELD", - //"THUNDERANIM", "CURSHIELD", "HYUDOROTIMER", "STEALINGTIMER", @@ -7702,6 +7745,7 @@ static const char *const KARTSTUFF_LIST[] = { "EGGMANHELD", "EGGMANEXPLODE", "EGGMANBLAME", + "LASTJAWZTARGET", "BANANADRAG", "SPINOUTTIMER", "WIPEOUTSLOW", diff --git a/src/doomdef.h b/src/doomdef.h index 2e4f45b2..b5519f6f 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -232,13 +232,15 @@ extern FILE *logstream; typedef enum { SKINCOLOR_NONE = 0, - SKINCOLOR_IVORY, SKINCOLOR_WHITE, SKINCOLOR_SILVER, - SKINCOLOR_CLOUDY, SKINCOLOR_GREY, SKINCOLOR_NICKEL, SKINCOLOR_BLACK, + SKINCOLOR_SEPIA, + SKINCOLOR_BEIGE, + SKINCOLOR_BROWN, + SKINCOLOR_LEATHER, SKINCOLOR_SALMON, SKINCOLOR_PINK, SKINCOLOR_ROSE, @@ -246,54 +248,52 @@ typedef enum SKINCOLOR_RED, SKINCOLOR_RUBY, SKINCOLOR_CRIMSON, + SKINCOLOR_KETCHUP, SKINCOLOR_DAWN, SKINCOLOR_CREAMSICLE, SKINCOLOR_ORANGE, SKINCOLOR_PUMPKIN, SKINCOLOR_ROSEWOOD, SKINCOLOR_BURGUNDY, - SKINCOLOR_BRONZE, - SKINCOLOR_SEPIA, - SKINCOLOR_BEIGE, - SKINCOLOR_BROWN, - SKINCOLOR_LEATHER, + SKINCOLOR_TANGERINE, SKINCOLOR_PEACH, SKINCOLOR_CARAMEL, - SKINCOLOR_TANGERINE, SKINCOLOR_GOLD, - SKINCOLOR_VOMIT, + SKINCOLOR_BRONZE, SKINCOLOR_YELLOW, - SKINCOLOR_CANARY, + SKINCOLOR_MUSTARD, SKINCOLOR_OLIVE, + SKINCOLOR_VOMIT, SKINCOLOR_GARDEN, SKINCOLOR_LIME, + SKINCOLOR_DREAM, SKINCOLOR_TEA, - SKINCOLOR_ARMY, SKINCOLOR_PISTACHIO, + SKINCOLOR_ROBOHOOD, SKINCOLOR_MOSS, SKINCOLOR_MINT, SKINCOLOR_GREEN, - SKINCOLOR_ROBOHOOD, SKINCOLOR_PINETREE, SKINCOLOR_EMERALD, SKINCOLOR_SWAMP, SKINCOLOR_AQUA, SKINCOLOR_TEAL, SKINCOLOR_CYAN, + SKINCOLOR_JAWZ, // Oni's torment SKINCOLOR_CERULEAN, + SKINCOLOR_NAVY, SKINCOLOR_SLATE, SKINCOLOR_STEEL, + SKINCOLOR_JET, SKINCOLOR_PERIWINKLE, SKINCOLOR_BLUE, SKINCOLOR_SAPPHIRE, // sweet mother, i cannot weave – slender aphrodite has overcome me with longing for a girl SKINCOLOR_BLUEBERRY, - SKINCOLOR_NAVY, - SKINCOLOR_JET, SKINCOLOR_DUSK, SKINCOLOR_PURPLE, SKINCOLOR_LAVENDER, - SKINCOLOR_INDIGO, SKINCOLOR_BYZANTIUM, + SKINCOLOR_POMEGRANATE, SKINCOLOR_LILAC, // Careful! MAXSKINCOLORS cannot be greater than 0x40 -- Which it is now. diff --git a/src/g_game.c b/src/g_game.c index 00a2828d..79fb89f1 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1869,6 +1869,7 @@ boolean G_Responder(event_t *ev) // tell who's the view CONS_Printf(M_GetText("Viewpoint: %s\n"), player_names[displayplayer]); + P_ResetCamera(&players[displayplayer], &camera); return true; } @@ -2358,6 +2359,10 @@ void G_PlayerReborn(INT32 player) // SRB2kart INT32 starpostwp; + INT32 itemtype; + INT32 itemamount; + INT32 itemroulette; + INT32 roulettetype; INT32 bumper; INT32 comebackpoints; INT32 wanted; @@ -2415,10 +2420,39 @@ void G_PlayerReborn(INT32 player) pity = players[player].pity; // SRB2kart - starpostwp = players[player].kartstuff[k_starpostwp]; - bumper = players[player].kartstuff[k_bumper]; - comebackpoints = players[player].kartstuff[k_comebackpoints]; - wanted = players[player].kartstuff[k_wanted]; + if (leveltime <= starttime) + { + itemroulette = 0; + roulettetype = 0; + itemtype = 0; + itemamount = 0; + bumper = (G_BattleGametype() ? cv_kartbumpers.value : 0); + comebackpoints = 0; + wanted = 0; + starpostwp = 0; + } + else + { + starpostwp = players[player].kartstuff[k_starpostwp]; + + itemroulette = (players[player].kartstuff[k_itemroulette] > 0 ? 1 : 0); + roulettetype = players[player].kartstuff[k_roulettetype]; + + if (players[player].kartstuff[k_itemheld]) + { + itemtype = 0; + itemamount = 0; + } + else + { + itemtype = players[player].kartstuff[k_itemtype]; + itemamount = players[player].kartstuff[k_itemamount]; + } + + bumper = players[player].kartstuff[k_bumper]; + comebackpoints = players[player].kartstuff[k_comebackpoints]; + wanted = players[player].kartstuff[k_wanted]; + } p = &players[player]; memset(p, 0, sizeof (*p)); @@ -2475,6 +2509,10 @@ void G_PlayerReborn(INT32 player) // SRB2kart p->kartstuff[k_starpostwp] = starpostwp; // TODO: get these out of kartstuff, it causes desync + p->kartstuff[k_itemroulette] = itemroulette; + p->kartstuff[k_roulettetype] = roulettetype; + p->kartstuff[k_itemtype] = itemtype; + p->kartstuff[k_itemamount] = itemamount; p->kartstuff[k_bumper] = bumper; p->kartstuff[k_comebackpoints] = comebackpoints; p->kartstuff[k_comebacktimer] = comebacktime; diff --git a/src/g_input.c b/src/g_input.c index 2822cc29..279ee56b 100644 --- a/src/g_input.c +++ b/src/g_input.c @@ -29,7 +29,7 @@ consvar_t cv_mousesens = {"mousesens", "35", CV_SAVE, mousesens_cons_t, NULL, 0, consvar_t cv_mousesens2 = {"mousesens2", "35", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_mouseysens = {"mouseysens", "35", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_mouseysens2 = {"mouseysens2", "35", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_controlperkey = {"controlperkey", "One", CV_SAVE, onecontrolperkey_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_controlperkey = {"controlperkey", "Several", CV_SAVE, onecontrolperkey_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; INT32 mousex, mousey; INT32 mlooky; // like mousey but with a custom sensitivity for mlook @@ -1208,6 +1208,7 @@ static const char *gamecontrolname[num_gamecontrols] = "scores", "console", "pause", + "systemmenu", "custom1", "custom2", "custom3", @@ -1283,68 +1284,53 @@ void G_Controldefault(void) gamecontrol[gc_fire ][0] = KEY_SPACE; gamecontrol[gc_lookback ][0] = KEY_LSHIFT; - gamecontrol[gc_aimforward ][1] = KEY_HAT1+0; - gamecontrol[gc_aimbackward][1] = KEY_HAT1+1; - gamecontrol[gc_turnleft ][1] = KEY_HAT1+2; - gamecontrol[gc_turnright ][1] = KEY_HAT1+3; gamecontrol[gc_accelerate ][1] = KEY_JOY1+0; // A - gamecontrol[gc_drift ][1] = KEY_JOY1+1; // X + gamecontrol[gc_lookback ][1] = KEY_JOY1+1; // X gamecontrol[gc_brake ][1] = KEY_JOY1+2; // B - gamecontrol[gc_fire ][1] = KEY_JOY1+4; // LB - gamecontrol[gc_lookback ][1] = KEY_JOY1+5; // RB + gamecontrol[gc_fire ][1] = KEY_JOY1+4; // LB + gamecontrol[gc_drift ][1] = KEY_JOY1+5; // RB // Extra controls gamecontrol[gc_pause ][0] = KEY_PAUSE; gamecontrol[gc_console ][0] = KEY_CONSOLE; gamecontrol[gc_talkkey ][0] = 't'; - gamecontrol[gc_teamkey ][0] = 'y'; + //gamecontrol[gc_teamkey ][0] = 'y'; gamecontrol[gc_scores ][0] = KEY_TAB; gamecontrol[gc_spectate ][0] = '\''; - - gamecontrol[gc_scores ][1] = KEY_JOY1+6; // Back - gamecontrol[gc_spectate ][1] = KEY_JOY1+7; // Start (This is sort of like MP's pause...?) - gamecontrol[gc_lookup ][0] = KEY_PGUP; gamecontrol[gc_lookdown ][0] = KEY_PGDN; gamecontrol[gc_centerview ][0] = KEY_END; gamecontrol[gc_camreset ][0] = KEY_HOME; gamecontrol[gc_camtoggle ][0] = KEY_BACKSPACE; + //gamecontrol[gc_viewpoint ][1] = KEY_JOY1+3; // Y + gamecontrol[gc_pause ][1] = KEY_JOY1+6; // Back + gamecontrol[gc_systemmenu ][0] = KEY_JOY1+7; // Start + gamecontrol[gc_camtoggle ][1] = KEY_HAT1+0; // D-Pad Up + //gamecontrol[gc_screenshot ][1] = KEY_HAT1+1; // D-Pad Down + gamecontrol[gc_talkkey ][1] = KEY_HAT1+2; // D-Pad Left + gamecontrol[gc_scores ][1] = KEY_HAT1+3; // D-Pad Right + // Player 2 controls - gamecontrolbis[gc_aimforward ][0] = KEY_2HAT1+0; - gamecontrolbis[gc_aimbackward][0] = KEY_2HAT1+1; - gamecontrolbis[gc_turnleft ][0] = KEY_2HAT1+2; - gamecontrolbis[gc_turnright ][0] = KEY_2HAT1+3; gamecontrolbis[gc_accelerate ][0] = KEY_2JOY1+0; // A - gamecontrolbis[gc_drift ][0] = KEY_2JOY1+1; // X + gamecontrolbis[gc_lookback ][0] = KEY_2JOY1+1; // X gamecontrolbis[gc_brake ][0] = KEY_2JOY1+2; // B gamecontrolbis[gc_fire ][0] = KEY_2JOY1+4; // LB - gamecontrolbis[gc_lookback ][0] = KEY_2JOY1+5; // RB - gamecontrolbis[gc_spectate ][0] = KEY_2JOY1+7; // Start + gamecontrolbis[gc_drift ][0] = KEY_2JOY1+5; // RB // Player 3 controls - gamecontrol3[gc_aimforward ][0] = KEY_3HAT1+0; - gamecontrol3[gc_aimbackward][0] = KEY_3HAT1+1; - gamecontrol3[gc_turnleft ][0] = KEY_3HAT1+2; - gamecontrol3[gc_turnright ][0] = KEY_3HAT1+3; gamecontrol3[gc_accelerate ][0] = KEY_3JOY1+0; // A - gamecontrol3[gc_drift ][0] = KEY_3JOY1+1; // X + gamecontrol3[gc_lookback ][0] = KEY_3JOY1+1; // X gamecontrol3[gc_brake ][0] = KEY_3JOY1+2; // B gamecontrol3[gc_fire ][0] = KEY_3JOY1+4; // LB - gamecontrol3[gc_lookback ][0] = KEY_3JOY1+5; // RB - gamecontrol3[gc_spectate ][0] = KEY_3JOY1+7; // Start + gamecontrol3[gc_drift ][0] = KEY_3JOY1+5; // RB // Player 4 controls - gamecontrol4[gc_aimforward ][0] = KEY_4HAT1+0; - gamecontrol4[gc_aimbackward][0] = KEY_4HAT1+1; - gamecontrol4[gc_turnleft ][0] = KEY_4HAT1+2; - gamecontrol4[gc_turnright ][0] = KEY_4HAT1+3; gamecontrol4[gc_accelerate ][0] = KEY_4JOY1+0; // A - gamecontrol4[gc_drift ][0] = KEY_4JOY1+1; // X + gamecontrol4[gc_lookback ][0] = KEY_4JOY1+1; // X gamecontrol4[gc_brake ][0] = KEY_4JOY1+2; // B gamecontrol4[gc_fire ][0] = KEY_4JOY1+4; // LB - gamecontrol4[gc_lookback ][0] = KEY_4JOY1+5; // RB - gamecontrol4[gc_spectate ][0] = KEY_4JOY1+7; // Start + gamecontrol4[gc_drift ][0] = KEY_4JOY1+5; // RB } //#endif diff --git a/src/g_input.h b/src/g_input.h index 7e49fff3..6bbadf3e 100644 --- a/src/g_input.h +++ b/src/g_input.h @@ -114,6 +114,7 @@ typedef enum gc_scores, gc_console, gc_pause, + gc_systemmenu, gc_custom1, // Lua scriptable gc_custom2, // Lua scriptable gc_custom3, // Lua scriptable diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 4c206337..6a664d39 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -2041,7 +2041,8 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) { // Single sided line... Deal only with the middletexture (if one exists) gr_midtexture = R_GetTextureNum(gr_sidedef->midtexture); - if (gr_midtexture) + if (gr_midtexture + && gr_linedef->special != 41) // Ignore horizon line for OGL { if (drawtextured) { @@ -5589,7 +5590,7 @@ static void HWR_DrawSkyBackground(player_t *player) // 0--1 (void)player; - HWR_GetTexture(skytexture); + HWR_GetTexture(texturetranslation[skytexture]); //Hurdler: the sky is the only texture who need 4.0f instead of 1.0 // because it's called just after clearing the screen @@ -5609,7 +5610,7 @@ static void HWR_DrawSkyBackground(player_t *player) // 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[skytexture]->width/256.0f); + dimensionmultiply = ((float)textures[texturetranslation[skytexture]]->width/256.0f); if (atransform.mirror) { @@ -5624,7 +5625,7 @@ static void HWR_DrawSkyBackground(player_t *player) angle = aimingangle; aspectratio = (float)vid.width/(float)vid.height; - dimensionmultiply = ((float)textures[skytexture]->height/(128.0f*aspectratio)); + dimensionmultiply = ((float)textures[texturetranslation[skytexture]]->height/(128.0f*aspectratio)); angleturn = (((float)ANGLE_45-1.0f)*aspectratio)*dimensionmultiply; // Middle of the sky should always be at angle 0 diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index 2446b023..145a0150 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -948,6 +948,15 @@ spritemd2found: fclose(f); } +// Define for getting accurate color brightness readings according to how the human eye sees them. +// https://en.wikipedia.org/wiki/Relative_luminance +// 0.2126 to red +// 0.7152 to green +// 0.0722 to blue +// (See this same define in k_kart.c!) +#define SETBRIGHTNESS(brightness,r,g,b) \ + brightness = (UINT8)(((1063*((UINT16)r)/5000) + (3576*((UINT16)g)/5000) + (361*((UINT16)b)/5000)) / 3) + static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, GLMipmap_t *grmip, INT32 skinnum, skincolors_t color) { UINT8 i; @@ -978,40 +987,26 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, // Average all of the translation's colors { - UINT16 r, g, b; - UINT8 div = 0; + const UINT8 div = 6; + const UINT8 start = 4; + UINT32 r, g, b; - blendcolor = V_GetColor(colortranslations[color][0]); - r = (UINT16)blendcolor.s.red; - g = (UINT16)blendcolor.s.green; - b = (UINT16)blendcolor.s.blue; + 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 < 16; i++) + for (i = 1; i < div; i++) { - RGBA_t nextcolor = V_GetColor(colortranslations[color][i]); - 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; + 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); } - // 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); + 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 @@ -1028,11 +1023,11 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, { UINT32 tempcolor; UINT16 imagebright, blendbright, finalbright, colorbright; - imagebright = (image->s.red+image->s.green+image->s.blue)/3; - blendbright = (blendimage->s.red+blendimage->s.green+blendimage->s.blue)/3; + 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; - colorbright = (blendcolor.s.red+blendcolor.s.green+blendcolor.s.blue)/3; + SETBRIGHTNESS(colorbright,blendcolor.s.red,blendcolor.s.green,blendcolor.s.blue); tempcolor = (finalbright*blendcolor.s.red)/colorbright; tempcolor = min(255, tempcolor); @@ -1090,6 +1085,8 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, return; } +#undef SETBRIGHTNESS + static void HWR_GetBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, INT32 skinnum, const UINT8 *colormap, skincolors_t color) { // mostly copied from HWR_GetMappedPatch, hence the similarities and comment diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 36b2812e..36e4621b 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -1366,54 +1366,24 @@ static void HU_drawMiniChat(void) } -// HU_DrawUpArrow -// You see, we don't have arrow graphics in 2.1 and I'm too lazy to include a 2 bytes file for it. - -static void HU_DrawUpArrow(INT32 x, INT32 y, INT32 options) -{ - // Ok I'm super lazy so let's make this as the worst draw function: - V_DrawFill(x+2, y, 1, 1, 103|options); - V_DrawFill(x+1, y+1, 3, 1, 103|options); - V_DrawFill(x, y+2, 5, 1, 103|options); // that's the yellow part, I swear - - V_DrawFill(x+3, y, 1, 1, 26|options); - V_DrawFill(x+4, y+1, 1, 1, 26|options); - V_DrawFill(x+5, y+2, 1, 1, 26|options); - V_DrawFill(x, y+3, 6, 1, 26|options); // that's the black part. no racism intended. i swear. -} - -// HU_DrawDownArrow -// Should we talk about anime waifus to pass the time? This feels retarded. - -static void HU_DrawDownArrow(INT32 x, INT32 y, INT32 options) -{ - // Ok I'm super lazy so let's make this as the worst draw function: - V_DrawFill(x, y, 6, 1, 26|options); - V_DrawFill(x, y+1, 5, 1, 26|options); - V_DrawFill(x+1, y+2, 3, 1, 26|options); - V_DrawFill(x+2, y+3, 1, 1, 26|options); // that's the black part. no racism intended. i swear. - - V_DrawFill(x, y, 5, 1, 103|options); - V_DrawFill(x+1, y+1, 3, 1, 103|options); - V_DrawFill(x+2, y+2, 1, 1, 103|options); // that's the yellow part, I swear -} - // HU_DrawChatLog // TODO: fix dumb word wrapping issues static void HU_drawChatLog(INT32 offset) { + INT32 charwidth = 4, charheight = 6; + INT32 x = chatx+2, y, dx = 0, dy = 0; + UINT32 i = 0; + INT32 chat_topy, chat_bottomy; + boolean atbottom = false; - // before we do anything, make sure that our scroll position isn't "illegal"; + // make sure that our scroll position isn't "illegal"; if (chat_scroll > chat_maxscroll) chat_scroll = chat_maxscroll; - INT32 charwidth = 4, charheight = 6; - INT32 x = chatx+2, y = chaty - offset*charheight - (chat_scroll*charheight) - cv_chatheight.value*charheight - 12 - (cv_kartspeedometer.value ? 16 : 0), dx = 0, dy = 0; - UINT32 i = 0; - INT32 chat_topy = y + chat_scroll*charheight; - INT32 chat_bottomy = chat_topy + cv_chatheight.value*charheight; - boolean atbottom = false; + y = chaty - offset*charheight - (chat_scroll*charheight) - cv_chatheight.value*charheight - 12 - (cv_kartspeedometer.value ? 16 : 0); + chat_topy = y + chat_scroll*charheight; + chat_bottomy = chat_topy + cv_chatheight.value*charheight; V_DrawFillConsoleMap(chatx, chat_topy, cv_chatwidth.value, cv_chatheight.value*charheight +2, 239|V_SNAPTOBOTTOM|V_SNAPTOLEFT); // log box @@ -1484,9 +1454,15 @@ static void HU_drawChatLog(INT32 offset) // draw arrows to indicate that we can (or not) scroll. if (chat_scroll > 0) - HU_DrawUpArrow(chatx-8, ((justscrolledup) ? (chat_topy-1) : (chat_topy)), V_SNAPTOBOTTOM | V_SNAPTOLEFT); + { + V_DrawCharacter(chatx-9, ((justscrolledup) ? (chat_topy-1) : (chat_topy)), + '\x1A' | V_SNAPTOBOTTOM | V_SNAPTOLEFT, false); // up arrow + } if (chat_scroll < chat_maxscroll) - HU_DrawDownArrow(chatx-8, chat_bottomy-((justscrolleddown) ? 3 : 4), V_SNAPTOBOTTOM | V_SNAPTOLEFT); + { + V_DrawCharacter(chatx-9, chat_bottomy-((justscrolleddown) ? 5 : 6), + '\x1B' | V_SNAPTOBOTTOM | V_SNAPTOLEFT, false); // down arrow + } justscrolleddown = false; justscrolledup = false; diff --git a/src/info.c b/src/info.c index 0e6d5abd..c6c67e8c 100644 --- a/src/info.c +++ b/src/info.c @@ -55,12 +55,12 @@ char sprnames[NUMSPRITES + 1][5] = "GWLR","SRBA","SRBB","SRBC","SRBD","SRBE","SRBF","SRBG","SRBH","SRBI", "SRBJ","SRBK","SRBL","SRBM","SRBN","SRBO", //SRB2kart Sprites - "SPRG","BSPR","RNDM","RPOP","KFRE","KINV","KINF","WIPD","DRIF","DUST", - "FITM","BANA","ORBN","JAWZ","SSMN","KRBM","BHOG","BHBM","BLIG","LIGH", - "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","VIEW" + "SPRG","BSPR","RNDM","RPOP","FAST","DSHR","BOST","BOSM","KFRE","KINV", + "KINF","WIPD","DRIF","DUST","FITM","BANA","ORBN","JAWZ","SSMN","KRBM", + "BHOG","BHBM","BLIG","LIGH","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","RETI","VIEW" }; // Doesn't work with g++, needs actionf_p1 (don't modify this comment) @@ -2566,18 +2566,44 @@ state_t states[NUMSTATES] = {SPR_RPOP, FF_FULLBRIGHT|2, 5, {NULL}, 0, 0, S_RANDOMITEMPOP4}, // S_RANDOMITEMPOP3 {SPR_RPOP, FF_FULLBRIGHT|3, 5, {NULL}, 0, 0, S_NULL}, // S_RANDOMITEMPOP4 - {SPR_DRIF, 0|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_DRIFTSPARK2}, // S_DRIFTSPARK1 - {SPR_DRIF, 1|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_DRIFTSPARK3}, // S_DRIFTSPARK2 - {SPR_DRIF, 2|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_DRIFTSPARK1}, // S_DRIFTSPARK3 - {SPR_DRIF, 3|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_DRIFTSPARK5}, // S_DRIFTSPARK4 - {SPR_DRIF, 4|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_DRIFTSPARK6}, // S_DRIFTSPARK5 - {SPR_DRIF, 5|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_DRIFTSPARK4}, // S_DRIFTSPARK6 + {SPR_DRIF, FF_FULLBRIGHT|2, 2, {NULL}, 0, 0, S_DRIFTSPARK_A2}, // S_DRIFTSPARK_A1 + {SPR_DRIF, FF_FULLBRIGHT|FF_TRANS20|1, 1, {NULL}, 0, 0, S_DRIFTSPARK_A3}, // S_DRIFTSPARK_A2 + {SPR_DRIF, FF_FULLBRIGHT|FF_TRANS50, 1, {NULL}, 0, 0, S_NULL}, // S_DRIFTSPARK_A3 + + {SPR_DRIF, FF_FULLBRIGHT|1, 2, {NULL}, 0, 0, S_DRIFTSPARK_A2}, // S_DRIFTSPARK_B1 (Loop back to A2) + + {SPR_DRIF, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_DRIFTSPARK_C2}, // S_DRIFTSPARK_C1 + {SPR_DRIF, FF_FULLBRIGHT|FF_TRANS20, 1, {NULL}, 0, 0, S_DRIFTSPARK_A3}, // S_DRIFTSPARK_C2 (Loop back to A3) {SPR_DUST, 0, 3, {NULL}, 0, 0, S_DRIFTDUST2}, // S_DRIFTDUST1 {SPR_DUST, 1, 3, {NULL}, 0, 0, S_DRIFTDUST3}, // S_DRIFTDUST2 {SPR_DUST, FF_TRANS20|2, 3, {NULL}, 0, 0, S_DRIFTDUST4}, // S_DRIFTDUST3 {SPR_DUST, FF_TRANS20|3, 3, {NULL}, 0, 0, S_NULL}, // S_DRIFTDUST4 + {SPR_FAST, FF_PAPERSPRITE|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_FASTLINE2}, // S_FASTLINE1 + {SPR_FAST, FF_PAPERSPRITE|FF_FULLBRIGHT|1, 1, {NULL}, 0, 0, S_FASTLINE3}, // S_FASTLINE2 + {SPR_FAST, FF_PAPERSPRITE|FF_FULLBRIGHT|2, 1, {NULL}, 0, 0, S_FASTLINE4}, // S_FASTLINE3 + {SPR_FAST, FF_PAPERSPRITE|FF_FULLBRIGHT|3, 1, {NULL}, 0, 0, S_FASTLINE5}, // S_FASTLINE4 + {SPR_FAST, FF_PAPERSPRITE|FF_FULLBRIGHT|4, 1, {NULL}, 0, 0, S_NULL}, // S_FASTLINE5 + + {SPR_DSHR, FF_PAPERSPRITE, 1, {NULL}, 0, 0, S_FASTDUST2}, // S_FASTDUST1 + {SPR_DSHR, FF_PAPERSPRITE|1, 1, {NULL}, 0, 0, S_FASTDUST3}, // S_FASTDUST2 + {SPR_DSHR, FF_PAPERSPRITE|2, 1, {NULL}, 0, 0, S_FASTDUST4}, // S_FASTDUST3 + {SPR_DSHR, FF_PAPERSPRITE|3, 1, {NULL}, 0, 0, S_FASTDUST5}, // S_FASTDUST4 + {SPR_DSHR, FF_PAPERSPRITE|4, 1, {NULL}, 0, 0, S_FASTDUST6}, // S_FASTDUST5 + {SPR_DSHR, FF_PAPERSPRITE|5, 1, {NULL}, 0, 0, S_FASTDUST7}, // S_FASTDUST6 + {SPR_DSHR, FF_PAPERSPRITE|6, 1, {NULL}, 0, 0, S_NULL}, // S_FASTDUST7 + + {SPR_BOST, FF_FULLBRIGHT|FF_ANIMATE, TICRATE, {NULL}, 6, 1, S_BOOSTSMOKESPAWNER}, // S_BOOSTFLAME + {SPR_NULL, 0, TICRATE/2, {NULL}, 0, 0, S_NULL}, // S_BOOSTSMOKESPAWNER + + {SPR_BOSM, FF_TRANS50, 3, {NULL}, 0, 0, S_BOOSTSMOKE2}, // S_BOOSTSMOKE1 + {SPR_BOSM, FF_TRANS50|1, 3, {NULL}, 0, 0, S_BOOSTSMOKE3}, // S_BOOSTSMOKE2 + {SPR_BOSM, FF_TRANS50|2, 3, {NULL}, 0, 0, S_BOOSTSMOKE4}, // S_BOOSTSMOKE3 + {SPR_BOSM, FF_TRANS50|3, 3, {NULL}, 0, 0, S_BOOSTSMOKE5}, // S_BOOSTSMOKE4 + {SPR_BOSM, FF_TRANS50|4, 3, {NULL}, 0, 0, S_BOOSTSMOKE6}, // S_BOOSTSMOKE5 + {SPR_BOSM, FF_TRANS50|5, 3, {NULL}, 0, 0, S_NULL}, // S_BOOSTSMOKE6 + {SPR_NULL, 0, 10, {NULL}, 0, 0, S_KARTFIRE2}, // S_KARTFIRE1 {SPR_KFRE, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_KARTFIRE3}, // S_KARTFIRE2 {SPR_KFRE, FF_FULLBRIGHT|1, 2, {NULL}, 0, 0, S_KARTFIRE4}, // S_KARTFIRE3 @@ -2684,6 +2710,8 @@ state_t states[NUMSTATES] = {SPR_JAWZ, 5, 175, {NULL}, 0, 0, S_JAWZ_DEAD2}, // S_JAWZ_DEAD1 {SPR_NULL, 0, 1, {A_JawzExplode}, 0, 0, S_NULL}, // S_JAWZ_DEAD2 + {SPR_RETI, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_NULL}, // S_PLAYERRETICULE + {SPR_SSMN, 0, 30, {NULL}, 0, 0, S_SSMINE2}, // S_SSMINE1 {SPR_SSMN, 3, 3, {NULL}, 0, 0, S_SSMINE3}, // S_SSMINE2 {SPR_SSMN, 2, 3, {NULL}, 0, 0, S_SSMINE4}, // S_SSMINE3 @@ -2768,35 +2796,36 @@ state_t states[NUMSTATES] = {SPR_LIGH, 2, 2, {NULL}, 0, 0, S_LIGHTNING4}, // S_LIGHTNING3 {SPR_LIGH, 3, 2, {NULL}, 0, 0, S_NULL}, // S_LIGHTNING4 - {SPR_THNS, 0, 2, {NULL}, 0, 0, S_THUNDERSHIELD2}, // S_THUNDERSHIELD1 - {SPR_THNS, 1, 2, {NULL}, 0, 0, S_THUNDERSHIELD3}, // S_THUNDERSHIELD2 - {SPR_THNS, 2, 2, {NULL}, 0, 0, S_THUNDERSHIELD4}, // S_THUNDERSHIELD3 - {SPR_THNS, 3, 2, {NULL}, 0, 0, S_THUNDERSHIELD5}, // S_THUNDERSHIELD4 - {SPR_THNS, 4, 2, {NULL}, 0, 0, S_THUNDERSHIELD6}, // S_THUNDERSHIELD5 - {SPR_THNS, 5, 2, {NULL}, 0, 0, S_THUNDERSHIELD7}, // S_THUNDERSHIELD6 - {SPR_THNS, 6, 2, {NULL}, 0, 0, S_THUNDERSHIELD8}, // S_THUNDERSHIELD7 - {SPR_THNS, 7, 2, {NULL}, 0, 0, S_THUNDERSHIELD9}, // S_THUNDERSHIELD8 - {SPR_THNS, 8, 2, {NULL}, 0, 0, S_THUNDERSHIELD10}, // S_THUNDERSHIELD9 - {SPR_THNS, 9, 2, {NULL}, 0, 0, S_THUNDERSHIELD11}, // S_THUNDERSHIELD10 - {SPR_THNS, 10, 2, {NULL}, 0, 0, S_THUNDERSHIELD12}, // S_THUNDERSHIELD11 - {SPR_THNS, 11, 2, {NULL}, 0, 0, S_THUNDERSHIELD13}, // S_THUNDERSHIELD12 - {SPR_THNS, 8, 2, {NULL}, 0, 0, S_THUNDERSHIELD14}, // S_THUNDERSHIELD13 - {SPR_THNS, 7, 2, {NULL}, 0, 0, S_THUNDERSHIELD15}, // S_THUNDERSHIELD14 - {SPR_THNS, 6, 2, {NULL}, 0, 0, S_THUNDERSHIELD16}, // S_THUNDERSHIELD15 - {SPR_THNS, 5, 2, {NULL}, 0, 0, S_THUNDERSHIELD17}, // S_THUNDERSHIELD16 - {SPR_THNS, 4, 2, {NULL}, 0, 0, S_THUNDERSHIELD18}, // S_THUNDERSHIELD17 - {SPR_THNS, 3, 2, {NULL}, 0, 0, S_THUNDERSHIELD19}, // S_THUNDERSHIELD18 - {SPR_THNS, 2, 2, {NULL}, 0, 0, S_THUNDERSHIELD20}, // S_THUNDERSHIELD19 - {SPR_THNS, 1, 2, {NULL}, 0, 0, S_THUNDERSHIELD21}, // S_THUNDERSHIELD20 - {SPR_THNS, 0, 2, {NULL}, 0, 0, S_THUNDERSHIELD22}, // S_THUNDERSHIELD21 - {SPR_THNS, 9, 2, {NULL}, 0, 0, S_THUNDERSHIELD23}, // S_THUNDERSHIELD22 - {SPR_THNS, 10, 2, {NULL}, 0, 0, S_THUNDERSHIELD24}, // S_THUNDERSHIELD23 - {SPR_THNS, 11, 2, {NULL}, 0, 0, S_THUNDERSHIELD1}, // S_THUNDERSHIELD24 + {SPR_THNS, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_THUNDERSHIELD2}, // S_THUNDERSHIELD1 + {SPR_THNS, FF_FULLBRIGHT|1, 2, {NULL}, 0, 0, S_THUNDERSHIELD3}, // S_THUNDERSHIELD2 + {SPR_THNS, FF_FULLBRIGHT|2, 2, {NULL}, 0, 0, S_THUNDERSHIELD4}, // S_THUNDERSHIELD3 + {SPR_THNS, FF_FULLBRIGHT|3, 2, {NULL}, 0, 0, S_THUNDERSHIELD5}, // S_THUNDERSHIELD4 + {SPR_THNS, FF_FULLBRIGHT|4, 2, {NULL}, 0, 0, S_THUNDERSHIELD6}, // S_THUNDERSHIELD5 + {SPR_THNS, FF_FULLBRIGHT|5, 2, {NULL}, 0, 0, S_THUNDERSHIELD7}, // S_THUNDERSHIELD6 + {SPR_THNS, FF_FULLBRIGHT|6, 2, {NULL}, 0, 0, S_THUNDERSHIELD8}, // S_THUNDERSHIELD7 + {SPR_THNS, FF_FULLBRIGHT|7, 2, {NULL}, 0, 0, S_THUNDERSHIELD9}, // S_THUNDERSHIELD8 + {SPR_THNS, FF_FULLBRIGHT|8, 2, {NULL}, 0, 0, S_THUNDERSHIELD10}, // S_THUNDERSHIELD9 + {SPR_THNS, FF_FULLBRIGHT|9, 2, {NULL}, 0, 0, S_THUNDERSHIELD11}, // S_THUNDERSHIELD10 + {SPR_THNS, FF_FULLBRIGHT|10, 2, {NULL}, 0, 0, S_THUNDERSHIELD12}, // S_THUNDERSHIELD11 + {SPR_THNS, FF_FULLBRIGHT|11, 2, {NULL}, 0, 0, S_THUNDERSHIELD13}, // S_THUNDERSHIELD12 + {SPR_THNS, FF_FULLBRIGHT|8, 2, {NULL}, 0, 0, S_THUNDERSHIELD14}, // S_THUNDERSHIELD13 + {SPR_THNS, FF_FULLBRIGHT|7, 2, {NULL}, 0, 0, S_THUNDERSHIELD15}, // S_THUNDERSHIELD14 + {SPR_THNS, FF_FULLBRIGHT|6, 2, {NULL}, 0, 0, S_THUNDERSHIELD16}, // S_THUNDERSHIELD15 + {SPR_THNS, FF_FULLBRIGHT|5, 2, {NULL}, 0, 0, S_THUNDERSHIELD17}, // S_THUNDERSHIELD16 + {SPR_THNS, FF_FULLBRIGHT|4, 2, {NULL}, 0, 0, S_THUNDERSHIELD18}, // S_THUNDERSHIELD17 + {SPR_THNS, FF_FULLBRIGHT|3, 2, {NULL}, 0, 0, S_THUNDERSHIELD19}, // S_THUNDERSHIELD18 + {SPR_THNS, FF_FULLBRIGHT|2, 2, {NULL}, 0, 0, S_THUNDERSHIELD20}, // S_THUNDERSHIELD19 + {SPR_THNS, FF_FULLBRIGHT|1, 2, {NULL}, 0, 0, S_THUNDERSHIELD21}, // S_THUNDERSHIELD20 + {SPR_THNS, FF_FULLBRIGHT|0, 2, {NULL}, 0, 0, S_THUNDERSHIELD22}, // S_THUNDERSHIELD21 + {SPR_THNS, FF_FULLBRIGHT|9, 2, {NULL}, 0, 0, S_THUNDERSHIELD23}, // S_THUNDERSHIELD22 + {SPR_THNS, FF_FULLBRIGHT|10, 2, {NULL}, 0, 0, S_THUNDERSHIELD24}, // S_THUNDERSHIELD23 + {SPR_THNS, FF_FULLBRIGHT|11, 2, {NULL}, 0, 0, S_THUNDERSHIELD1}, // S_THUNDERSHIELD24 - {SPR_SINK, 0, 4, {A_SmokeTrailer}, MT_SINKTRAIL, 0, S_SINK}, // S_SINK - {SPR_SITR, 0, 1, {NULL}, 0, 0, S_SINKTRAIL2}, // S_SINKTRAIL1 - {SPR_SITR, 1, 5, {NULL}, 0, 0, S_SINKTRAIL3}, // S_SINKTRAIL2 - {SPR_SITR, 2, 3, {NULL}, 0, 0, S_NULL}, // S_SINKTRAIL3 + {SPR_SINK, 0, 1, {A_SmokeTrailer}, MT_SINKTRAIL, 0, S_SINK}, // S_SINK + {SPR_SINK, 0|FF_TRANS80|FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_SINK_SHIELD}, // S_SINK_SHIELD + {SPR_SITR, 0, 1, {NULL}, 0, 0, S_SINKTRAIL2}, // S_SINKTRAIL1 + {SPR_SITR, 1, 5, {NULL}, 0, 0, S_SINKTRAIL3}, // S_SINKTRAIL2 + {SPR_SITR, 2, 3, {NULL}, 0, 0, S_NULL}, // S_SINKTRAIL3 {SPR_KBLN, FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_BATTLEBUMPER1}, // S_BATTLEBUMPER1 {SPR_KBLN, FF_FULLBRIGHT|1, -1, {NULL}, 0, 0, S_BATTLEBUMPER2}, // S_BATTLEBUMPER2 @@ -2894,7 +2923,6 @@ state_t states[NUMSTATES] = {SPR_BRNG, 10, 2, {NULL}, 0, 0, S_BIGRING12}, // S_BIGRING11 {SPR_BRNG, 11, 2, {NULL}, 0, 0, S_BIGRING01}, // S_BIGRING12 - {SPR_SNES, 0, -1, {NULL}, 0, 0, S_NULL}, // S_SNES_DONUTBUSH1 {SPR_SNES, 1, -1, {NULL}, 0, 0, S_NULL}, // S_SNES_DONUTBUSH2 {SPR_SNES, 2, -1, {NULL}, 0, 0, S_NULL}, // S_SNES_DONUTBUSH3 @@ -2983,7 +3011,7 @@ state_t states[NUMSTATES] = {SPR_ARRO, FF_FULLBRIGHT|1, -1, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_BOX {SPR_ITEM, FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_ITEM {SPR_ITMN, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_NUMBER - {SPR_ITMN, FF_FULLBRIGHT|10, 2, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_X + {SPR_ITMN, FF_FULLBRIGHT|11, 2, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_X {SPR_WANT, FF_FULLBRIGHT, 5, {NULL}, 0, 0, S_PLAYERARROW_WANTED2}, // S_PLAYERARROW_WANTED1 {SPR_WANT, FF_FULLBRIGHT|1, 1, {NULL}, 0, 0, S_PLAYERARROW_WANTED3}, // S_PLAYERARROW_WANTED2 {SPR_WANT, FF_FULLBRIGHT|2, 3, {NULL}, 0, 0, S_PLAYERARROW_WANTED4}, // S_PLAYERARROW_WANTED3 @@ -2991,7 +3019,6 @@ state_t states[NUMSTATES] = {SPR_WANT, FF_FULLBRIGHT|4, 3, {NULL}, 0, 0, S_PLAYERARROW_WANTED6}, // S_PLAYERARROW_WANTED5 {SPR_WANT, FF_FULLBRIGHT|5, 1, {NULL}, 0, 0, S_PLAYERARROW_WANTED7}, // S_PLAYERARROW_WANTED6 {SPR_WANT, FF_FULLBRIGHT|6, 3, {NULL}, 0, 0, S_PLAYERARROW_WANTED1}, // S_PLAYERARROW_WANTED7 - {SPR_PBOM, FF_ANIMATE, -1, {NULL}, 3, 3, S_NULL}, // S_PLAYERBOMB {SPR_RNDM, FF_ANIMATE, -1, {NULL}, 23, 3, S_NULL}, // S_PLAYERITEM @@ -14389,6 +14416,114 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_FASTLINE + -1, // doomednum + S_FASTLINE1, // 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 + 8, // speed + 14*FRACUNIT, // radius + 14*FRACUNIT, // height + 0, // display offset + 100, // mass + 0, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags + S_NULL // raisestate + }, + + { // MT_FASTDUST + -1, // doomednum + S_FASTDUST1, // 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 + 8, // speed + 14*FRACUNIT, // radius + 14*FRACUNIT, // height + 0, // display offset + 100, // mass + 0, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags + S_NULL // raisestate + }, + + { // MT_BOOSTFLAME + -1, // doomednum + S_BOOSTFLAME, // 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 + 8, // speed + 8*FRACUNIT, // radius + 8*FRACUNIT, // height + 1, // display offset + 100, // mass + 0, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags + S_NULL // raisestate + }, + + { // MT_BOOSTSMOKE + -1, // doomednum + S_BOOSTSMOKE1, // 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 + 8, // speed + 8*FRACUNIT, // radius + 8*FRACUNIT, // height + 1, // display offset + 100, // mass + 0, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags + S_NULL // raisestate + }, + { // MT_SNEAKERTRAIL -1, // doomednum S_KARTFIRE1, // spawnstate @@ -14497,9 +14632,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_DRIFT + { // MT_DRIFTSPARK -1, // doomednum - S_DRIFTSPARK1, // spawnstate + S_DRIFTSPARK_B1,// spawnstate 1000, // spawnhealth S_NULL, // seestate sfx_None, // seesound @@ -14514,13 +14649,13 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL, // xdeathstate sfx_None, // deathsound 8, // speed - 64*FRACUNIT, // radius - 64*FRACUNIT, // height + 14*FRACUNIT, // radius + 14*FRACUNIT, // height 0, // display offset 16, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags S_NULL // raisestate }, @@ -14794,6 +14929,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_PLAYERRETICULE + -1, // doomednum + S_PLAYERRETICULE, // 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 + 8, // speed + 16*FRACUNIT, // radius + 56*FRACUNIT, // height + 2, // display offset + 16, // mass + 0, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags + S_NULL // raisestate + }, + { // MT_SSMINE -1, // doomednum S_SSMINE_AIR1, // spawnstate @@ -15172,6 +15334,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_SINK_SHIELD + -1, // doomednum + S_SINK_SHIELD, // spawnstate + 1000, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 100, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 24*FRACUNIT, // height + 0, // display offset + 100, // mass + 1, // damage + sfx_None, // activesound + MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags + S_NULL // raisestate + }, + { // MT_SINKTRAIL -1, // doomednum S_SINKTRAIL1, // spawnstate @@ -16215,8 +16404,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL, // xdeathstate sfx_pop, // deathsound 6, // speed - 3145728, // radius - 3145728, // height + 24*FRACUNIT, // radius + 48*FRACUNIT, // height 0, // display offset 100, // mass 0, // damage diff --git a/src/info.h b/src/info.h index 98d628b3..8a242c43 100644 --- a/src/info.h +++ b/src/info.h @@ -582,6 +582,10 @@ typedef enum sprite SPR_RNDM, // Random Item Box SPR_RPOP, // Random Item Box Pop + SPR_FAST, // Speed boost trail + SPR_DSHR, // Speed boost dust release + SPR_BOST, // Sneaker booster flame + SPR_BOSM, // Sneaker booster smoke SPR_KFRE, // Sneaker fire trail SPR_KINV, // Invincibility sparkle trail SPR_KINF, // Invincibility flash @@ -637,6 +641,7 @@ typedef enum sprite SPR_WANT, SPR_PBOM, // player bomb + SPR_RETI, // player reticule SPR_VIEW, // First person view sprites; this is a sprite so that it can be replaced by a specialized MD2 draw! @@ -3078,12 +3083,12 @@ typedef enum state //} // Drift Sparks - S_DRIFTSPARK1, - S_DRIFTSPARK2, - S_DRIFTSPARK3, - S_DRIFTSPARK4, - S_DRIFTSPARK5, - S_DRIFTSPARK6, + S_DRIFTSPARK_A1, + S_DRIFTSPARK_A2, + S_DRIFTSPARK_A3, + S_DRIFTSPARK_B1, + S_DRIFTSPARK_C1, + S_DRIFTSPARK_C2, // Drift Smoke S_DRIFTDUST1, @@ -3091,8 +3096,34 @@ typedef enum state S_DRIFTDUST3, S_DRIFTDUST4, + // Fast lines + S_FASTLINE1, + S_FASTLINE2, + S_FASTLINE3, + S_FASTLINE4, + S_FASTLINE5, + + // Fast dust release + S_FASTDUST1, + S_FASTDUST2, + S_FASTDUST3, + S_FASTDUST4, + S_FASTDUST5, + S_FASTDUST6, + S_FASTDUST7, + // Magnet Burst + // Sneaker boost effect + S_BOOSTFLAME, + S_BOOSTSMOKESPAWNER, + S_BOOSTSMOKE1, + S_BOOSTSMOKE2, + S_BOOSTSMOKE3, + S_BOOSTSMOKE4, + S_BOOSTSMOKE5, + S_BOOSTSMOKE6, + // Sneaker Fire Trail S_KARTFIRE1, S_KARTFIRE2, @@ -3206,6 +3237,8 @@ typedef enum state S_JAWZ_DEAD2, //} + S_PLAYERRETICULE, // Player reticule + // Special Stage Mine S_SSMINE1, S_SSMINE2, @@ -3323,6 +3356,7 @@ typedef enum state // The legend S_SINK, + S_SINK_SHIELD, S_SINKTRAIL1, S_SINKTRAIL2, S_SINKTRAIL3, @@ -4067,11 +4101,15 @@ typedef enum mobj_type MT_RANDOMITEM, MT_RANDOMITEMPOP, + MT_FASTLINE, + MT_FASTDUST, + MT_BOOSTFLAME, + MT_BOOSTSMOKE, MT_SNEAKERTRAIL, MT_SPARKLETRAIL, MT_INVULNFLASH, MT_WIPEOUTTRAIL, - MT_DRIFT, + MT_DRIFTSPARK, MT_DRIFTDUST, MT_FAKESHIELD, @@ -4087,6 +4125,8 @@ typedef enum mobj_type MT_JAWZ_DUD, MT_JAWZ_SHIELD, + MT_PLAYERRETICULE, // Jawz reticule + MT_SSMINE, // Mine stuff MT_SSMINE_SHIELD, MT_MINEEXPLOSION, @@ -4106,6 +4146,7 @@ typedef enum mobj_type MT_THUNDERSHIELD, // Thunder Shield stuff MT_SINK, // Kitchen Sink Stuff + MT_SINK_SHIELD, MT_SINKTRAIL, MT_BATTLEBUMPER, // Battle Mode bumpers diff --git a/src/k_kart.c b/src/k_kart.c index ae09c3ba..a84052a0 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -43,216 +43,230 @@ const char *KartColor_Names[MAXSKINCOLORS] = { "None", // 00 // SKINCOLOR_NONE - "Ivory", // 01 // SKINCOLOR_IVORY - "White", // 02 // SKINCOLOR_WHITE - "Silver", // 03 // SKINCOLOR_SILVER - "Cloudy", // 04 // SKINCOLOR_CLOUDY - "Grey", // 05 // SKINCOLOR_GREY - "Nickel", // 06 // SKINCOLOR_NICKEL - "Black", // 07 // SKINCOLOR_BLACK - "Salmon", // 08 // SKINCOLOR_SALMON - "Pink", // 09 // SKINCOLOR_PINK - "Rose", // 10 // SKINCOLOR_ROSE - "Raspberry", // 11 // SKINCOLOR_RASPBERRY - "Red", // 12 // SKINCOLOR_RED - "Ruby", // 13 // SKINCOLOR_RUBY - "Crimson", // 14 // SKINCOLOR_CRIMSON - "Dawn", // 15 // SKINCOLOR_DAWN - "Creamsicle", // 16 // SKINCOLOR_CREAMSICLE - "Orange", // 17 // SKINCOLOR_ORANGE - "Pumpkin", // 18 // SKINCOLOR_PUMPKIN - "Rosewood", // 19 // SKINCOLOR_ROSEWOOD - "Burgundy", // 20 // SKINCOLOR_BURGUNDY - "Bronze", // 21 // SKINCOLOR_BRONZE - "Sepia", // 22 // SKINCOLOR_SEPIA - "Beige", // 23 // SKINCOLOR_BEIGE - "Brown", // 24 // SKINCOLOR_BROWN - "Leather", // 25 // SKINCOLOR_LEATHER - "Peach", // 26 // SKINCOLOR_PEACH - "Caramel", // 27 // SKINCOLOR_CARAMEL - "Tangerine", // 28 // SKINCOLOR_TANGERINE - "Gold", // 29 // SKINCOLOR_GOLD - "Vomit", // 30 // SKINCOLOR_VOMIT - "Yellow", // 31 // SKINCOLOR_YELLOW - "Canary", // 32 // SKINCOLOR_CANARY - "Olive", // 33 // SKINCOLOR_OLIVE - "Garden", // 34 // SKINCOLOR_GARDEN - "Lime", // 35 // SKINCOLOR_LIME + "White", // 01 // SKINCOLOR_WHITE + "Silver", // 02 // SKINCOLOR_SILVER + "Grey", // 03 // SKINCOLOR_GREY + "Nickel", // 04 // SKINCOLOR_NICKEL + "Black", // 05 // SKINCOLOR_BLACK + "Sepia", // 06 // SKINCOLOR_SEPIA + "Beige", // 07 // SKINCOLOR_BEIGE + "Brown", // 08 // SKINCOLOR_BROWN + "Leather", // 09 // SKINCOLOR_LEATHER + "Salmon", // 10 // SKINCOLOR_SALMON + "Pink", // 11 // SKINCOLOR_PINK + "Rose", // 12 // SKINCOLOR_ROSE + "Raspberry", // 13 // SKINCOLOR_RASPBERRY + "Red", // 14 // SKINCOLOR_RED + "Ruby", // 15 // SKINCOLOR_RUBY + "Crimson", // 16 // SKINCOLOR_CRIMSON + "Ketchup", // 17 // SKINCOLOR_KETCHUP + "Dawn", // 18 // SKINCOLOR_DAWN + "Creamsicle", // 19 // SKINCOLOR_CREAMSICLE + "Orange", // 20 // SKINCOLOR_ORANGE + "Pumpkin", // 21 // SKINCOLOR_PUMPKIN + "Rosewood", // 22 // SKINCOLOR_ROSEWOOD + "Burgundy", // 23 // SKINCOLOR_BURGUNDY + "Tangerine", // 24 // SKINCOLOR_TANGERINE + "Peach", // 25 // SKINCOLOR_PEACH + "Caramel", // 26 // SKINCOLOR_CARAMEL + "Gold", // 27 // SKINCOLOR_GOLD + "Bronze", // 28 // SKINCOLOR_BRONZE + "Yellow", // 29 // SKINCOLOR_YELLOW + "Mustard", // 30 // SKINCOLOR_MUSTARD + "Olive", // 31 // SKINCOLOR_OLIVE + "Vomit", // 32 // SKINCOLOR_VOMIT + "Garden", // 33 // SKINCOLOR_GARDEN + "Lime", // 34 // SKINCOLOR_LIME + "Dream", // 35 // SKINCOLOR_DREAM "Tea", // 36 // SKINCOLOR_TEA - "Army", // 37 // SKINCOLOR_ARMY - "Pistachio", // 38 // SKINCOLOR_PISTACHIO + "Pistachio", // 37 // SKINCOLOR_PISTACHIO + "Robo-Hood", // 38 // SKINCOLOR_ROBOHOOD "Moss", // 39 // SKINCOLOR_MOSS "Mint", // 40 // SKINCOLOR_MINT "Green", // 41 // SKINCOLOR_GREEN - "Robo-Hood", // 42 // SKINCOLOR_ROBOHOOD - "Pinetree", // 43 // SKINCOLOR_PINETREE - "Emerald", // 44 // SKINCOLOR_EMERALD - "Swamp", // 45 // SKINCOLOR_SWAMP - "Aqua", // 46 // SKINCOLOR_AQUA - "Teal", // 47 // SKINCOLOR_TEAL - "Cyan", // 48 // SKINCOLOR_CYAN + "Pinetree", // 42 // SKINCOLOR_PINETREE + "Emerald", // 43 // SKINCOLOR_EMERALD + "Swamp", // 44 // SKINCOLOR_SWAMP + "Aqua", // 45 // SKINCOLOR_AQUA + "Teal", // 46 // SKINCOLOR_TEAL + "Cyan", // 47 // SKINCOLOR_CYAN + "Jawz", // 48 // SKINCOLOR_JAWZ "Cerulean", // 49 // SKINCOLOR_CERULEAN - "Slate", // 50 // SKINCOLOR_SLATE - "Steel", // 51 // SKINCOLOR_STEEL - "Periwinkle", // 52 // SKINCOLOR_PERIWINKLE - "Blue", // 53 // SKINCOLOR_BLUE - "Sapphire", // 54 // SKINCOLOR_SAPPHIRE - "Blueberry", // 55 // SKINCOLOR_BLUEBERRY - "Navy", // 56 // SKINCOLOR_NAVY - "Jet", // 57 // SKINCOLOR_JET + "Navy", // 50 // SKINCOLOR_NAVY + "Slate", // 51 // SKINCOLOR_SLATE + "Steel", // 52 // SKINCOLOR_STEEL + "Jet", // 53 // SKINCOLOR_JET + "Periwinkle", // 54 // SKINCOLOR_PERIWINKLE + "Blue", // 55 // SKINCOLOR_BLUE + "Sapphire", // 56 // SKINCOLOR_SAPPHIRE + "Blueberry", // 57 // SKINCOLOR_BLUEBERRY "Dusk", // 58 // SKINCOLOR_DUSK "Purple", // 59 // SKINCOLOR_PURPLE "Lavender", // 60 // SKINCOLOR_LAVENDER - "Indigo", // 61 // SKINCOLOR_INDIGO - "Byzantium", // 62 // SKINCOLOR_BYZANTIUM + "Byzantium", // 61 // SKINCOLOR_BYZANTIUM + "Pomegranate", // 62 // SKINCOLOR_POMEGRANATE "Lilac" // 63 // SKINCOLOR_LILAC }; // Color_Opposite replacement; frame setting has not been changed from 8 for most, should be done later const UINT8 KartColor_Opposite[MAXSKINCOLORS*2] = { - SKINCOLOR_NONE,8, // 00 // SKINCOLOR_NONE - SKINCOLOR_BLACK,8, // 01 // SKINCOLOR_IVORY - SKINCOLOR_NICKEL,8, // 02 // SKINCOLOR_WHITE - SKINCOLOR_GREY,8, // 03 // SKINCOLOR_SILVER - SKINCOLOR_CLOUDY,8, // 04 // SKINCOLOR_CLOUDY - 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_MOSS,8, // 10 // SKINCOLOR_ROSE - SKINCOLOR_MINT,10, // 11 // SKINCOLOR_RASPBERRY - SKINCOLOR_GREEN,8, // 12 // SKINCOLOR_RED - SKINCOLOR_EMERALD,6, // 13 // SKINCOLOR_RUBY - SKINCOLOR_PINETREE,6, // 14 // SKINCOLOR_CRIMSON - SKINCOLOR_DUSK,8, // 15 // SKINCOLOR_DAWN - SKINCOLOR_PERIWINKLE,8, // 16 // SKINCOLOR_CREAMSICLE - SKINCOLOR_BLUE,8, // 17 // SKINCOLOR_ORANGE - SKINCOLOR_BLUEBERRY,8, // 18 // SKINCOLOR_PUMPKIN - SKINCOLOR_NAVY,8, // 19 // SKINCOLOR_ROSEWOOD - SKINCOLOR_JET,8, // 20 // SKINCOLOR_BURGUNDY - SKINCOLOR_STEEL,8, // 21 // SKINCOLOR_BRONZE - SKINCOLOR_LEATHER,6, // 22 // SKINCOLOR_SEPIA - SKINCOLOR_BROWN,2, // 23 // SKINCOLOR_BEIGE - SKINCOLOR_BEIGE,8, // 24 // SKINCOLOR_BROWN - SKINCOLOR_SEPIA,8, // 25 // SKINCOLOR_LEATHER - SKINCOLOR_SLATE,8, // 26 // SKINCOLOR_PEACH - SKINCOLOR_TEAL,8, // 27 // SKINCOLOR_CARAMEL - SKINCOLOR_LIME,8, // 28 // SKINCOLOR_TANGERINE - SKINCOLOR_LAVENDER,6, // 29 // SKINCOLOR_GOLD - SKINCOLOR_ROBOHOOD,8, // 30 // SKINCOLOR_VOMIT - SKINCOLOR_BYZANTIUM,8, // 31 // SKINCOLOR_YELLOW - SKINCOLOR_PURPLE,8, // 32 // SKINCOLOR_CANARY - SKINCOLOR_INDIGO,8, // 33 // SKINCOLOR_OLIVE - SKINCOLOR_AQUA,8, // 34 // SKINCOLOR_GARDEN - SKINCOLOR_TANGERINE,8, // 35 // SKINCOLOR_LIME - SKINCOLOR_SALMON,8, // 36 // SKINCOLOR_TEA - SKINCOLOR_PINK,6, // 37 // SKINCOLOR_ARMY - SKINCOLOR_CYAN,8, // 38 // SKINCOLOR_PISTACHIO - SKINCOLOR_ROSE,8, // 39 // SKINCOLOR_MOSS - SKINCOLOR_RASPBERRY,6, // 40 // SKINCOLOR_MINT - SKINCOLOR_RED,8, // 41 // SKINCOLOR_GREEN - SKINCOLOR_VOMIT,8, // 42 // SKINCOLOR_ROBOHOOD - SKINCOLOR_CRIMSON,8, // 43 // SKINCOLOR_PINETREE - SKINCOLOR_RUBY,8, // 44 // SKINCOLOR_EMERALD - SKINCOLOR_SAPPHIRE,8, // 45 // SKINCOLOR_SWAMP - SKINCOLOR_GARDEN,10, // 46 // SKINCOLOR_AQUA - SKINCOLOR_CARAMEL,8, // 47 // SKINCOLOR_TEAL - SKINCOLOR_PISTACHIO,6, // 48 // SKINCOLOR_CYAN - SKINCOLOR_LILAC,8, // 49 // SKINCOLOR_CERULEAN - SKINCOLOR_PEACH,8, // 50 // SKINCOLOR_SLATE - SKINCOLOR_BRONZE,10, // 51 // SKINCOLOR_STEEL - SKINCOLOR_CREAMSICLE,8, // 52 // SKINCOLOR_PERIWINKLE - SKINCOLOR_ORANGE,8, // 53 // SKINCOLOR_BLUE - SKINCOLOR_SWAMP,8, // 54 // SKINCOLOR_SAPPHIRE - SKINCOLOR_PUMPKIN,8, // 55 // SKINCOLOR_BLUEBERRY - SKINCOLOR_ROSEWOOD,8, // 56 // SKINCOLOR_NAVY - SKINCOLOR_BURGUNDY,6, // 57 // SKINCOLOR_JET - SKINCOLOR_DAWN,8, // 58 // SKINCOLOR_DUSK - SKINCOLOR_CANARY,8, // 59 // SKINCOLOR_PURPLE - SKINCOLOR_GOLD,10, // 60 // SKINCOLOR_LAVENDER - SKINCOLOR_OLIVE,8, // 61 // SKINCOLOR_INDIGO - SKINCOLOR_YELLOW,8, // 62 // SKINCOLOR_BYZANTIUM - SKINCOLOR_CERULEAN,8 // 63 // SKINCOLOR_LILAC + SKINCOLOR_NONE,8, // 00 // SKINCOLOR_NONE + SKINCOLOR_BLACK,8, // 01 // SKINCOLOR_WHITE + SKINCOLOR_NICKEL,8, // 02 // SKINCOLOR_SILVER + SKINCOLOR_GREY,8, // 03 // SKINCOLOR_GREY + SKINCOLOR_SILVER,8, // 04 // SKINCOLOR_NICKEL + SKINCOLOR_WHITE,8, // 05 // SKINCOLOR_BLACK + SKINCOLOR_LEATHER,6, // 06 // SKINCOLOR_SEPIA + SKINCOLOR_BROWN,2, // 07 // SKINCOLOR_BEIGE + SKINCOLOR_BEIGE,8, // 08 // SKINCOLOR_BROWN + SKINCOLOR_SEPIA,8, // 09 // SKINCOLOR_LEATHER + SKINCOLOR_TEA,8, // 10 // SKINCOLOR_SALMON + SKINCOLOR_PISTACHIO,8, // 11 // SKINCOLOR_PINK + SKINCOLOR_MOSS,8, // 12 // SKINCOLOR_ROSE + SKINCOLOR_MINT,10, // 13 // SKINCOLOR_RASPBERRY + SKINCOLOR_GREEN,8, // 14 // SKINCOLOR_RED + SKINCOLOR_SAPPHIRE,8, // 15 // SKINCOLOR_RUBY + SKINCOLOR_PINETREE,6, // 16 // SKINCOLOR_CRIMSON + SKINCOLOR_MUSTARD,6, // 17 // SKINCOLOR_KETCHUP + SKINCOLOR_DUSK,8, // 18 // SKINCOLOR_DAWN + SKINCOLOR_PERIWINKLE,8, // 19 // SKINCOLOR_CREAMSICLE + SKINCOLOR_BLUE,8, // 20 // SKINCOLOR_ORANGE + SKINCOLOR_BLUEBERRY,8, // 21 // SKINCOLOR_PUMPKIN + SKINCOLOR_NAVY,8, // 22 // SKINCOLOR_ROSEWOOD + SKINCOLOR_JET,6, // 23 // SKINCOLOR_BURGUNDY + SKINCOLOR_LIME,8, // 24 // SKINCOLOR_TANGERINE + SKINCOLOR_CYAN,8, // 25 // SKINCOLOR_PEACH + SKINCOLOR_CERULEAN,8, // 26 // SKINCOLOR_CARAMEL + SKINCOLOR_SLATE,8, // 27 // SKINCOLOR_GOLD + SKINCOLOR_STEEL,8, // 28 // SKINCOLOR_BRONZE + SKINCOLOR_AQUA,8, // 29 // SKINCOLOR_YELLOW + SKINCOLOR_KETCHUP,8, // 30 // SKINCOLOR_MUSTARD + SKINCOLOR_TEAL,8, // 31 // SKINCOLOR_OLIVE + SKINCOLOR_ROBOHOOD,8, // 32 // SKINCOLOR_VOMIT + SKINCOLOR_LAVENDER,8, // 33 // SKINCOLOR_GARDEN + SKINCOLOR_TANGERINE,8, // 34 // SKINCOLOR_LIME + SKINCOLOR_POMEGRANATE,8, // 35 // SKINCOLOR_DREAM + SKINCOLOR_SALMON,8, // 36 // SKINCOLOR_TEA + SKINCOLOR_PINK,8, // 37 // SKINCOLOR_PISTACHIO + SKINCOLOR_VOMIT,8, // 38 // SKINCOLOR_ROBOHOOD + SKINCOLOR_ROSE,8, // 39 // SKINCOLOR_MOSS + SKINCOLOR_RASPBERRY,6, // 40 // SKINCOLOR_MINT + SKINCOLOR_RED,8, // 41 // SKINCOLOR_GREEN + SKINCOLOR_CRIMSON,8, // 42 // SKINCOLOR_PINETREE + SKINCOLOR_PURPLE,8, // 43 // SKINCOLOR_EMERALD + SKINCOLOR_BYZANTIUM,6, // 44 // SKINCOLOR_SWAMP + SKINCOLOR_YELLOW,8, // 45 // SKINCOLOR_AQUA + SKINCOLOR_OLIVE,8, // 46 // SKINCOLOR_TEAL + SKINCOLOR_PEACH,8, // 47 // SKINCOLOR_CYAN + SKINCOLOR_LILAC,6, // 48 // SKINCOLOR_JAWZ + SKINCOLOR_CARAMEL,8, // 49 // SKINCOLOR_CERULEAN + SKINCOLOR_ROSEWOOD,8, // 50 // SKINCOLOR_NAVY + SKINCOLOR_GOLD,8, // 51 // SKINCOLOR_SLATE + SKINCOLOR_BRONZE,8, // 52 // SKINCOLOR_STEEL + SKINCOLOR_BURGUNDY,6, // 53 // SKINCOLOR_JET + SKINCOLOR_CREAMSICLE,8, // 54 // SKINCOLOR_PERIWINKLE + SKINCOLOR_ORANGE,8, // 55 // SKINCOLOR_BLUE + SKINCOLOR_RUBY,8, // 56 // SKINCOLOR_SAPPHIRE + SKINCOLOR_PUMPKIN,8, // 57 // SKINCOLOR_BLUEBERRY + SKINCOLOR_DAWN,8, // 58 // SKINCOLOR_DUSK + SKINCOLOR_EMERALD,8, // 59 // SKINCOLOR_PURPLE + SKINCOLOR_GARDEN,8, // 60 // SKINCOLOR_LAVENDER + SKINCOLOR_SWAMP,8, // 61 // SKINCOLOR_BYZANTIUM + SKINCOLOR_DREAM,6, // 62 // SKINCOLOR_POMEGRANATE + SKINCOLOR_JAWZ,6 // 63 // SKINCOLOR_LILAC }; UINT8 colortranslations[MAXSKINCOLORS][16] = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // SKINCOLOR_NONE - {120, 120, 120, 120, 0, 1, 3, 4, 6, 7, 10, 14, 18, 22, 25, 28}, // SKINCOLOR_IVORY - {120, 120, 0, 1, 3, 4, 6, 7, 9, 11, 13, 16, 19, 23, 26, 29}, // SKINCOLOR_WHITE - { 0, 1, 3, 5, 6, 8, 10, 11, 13, 15, 16, 18, 20, 24, 27, 30}, // SKINCOLOR_SILVER - { 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31}, // SKINCOLOR_CLOUDY - { 8, 9, 10, 12, 13, 15, 16, 19, 19, 20, 21, 23, 25, 27, 29, 31}, // SKINCOLOR_GREY - { 16, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27, 28, 29, 30, 31}, // SKINCOLOR_NICKEL + {120, 120, 120, 120, 0, 1, 3, 4, 6, 7, 10, 14, 18, 22, 25, 28}, // SKINCOLOR_WHITE + { 0, 1, 2, 4, 5, 7, 8, 10, 13, 15, 18, 20, 23, 25, 28, 30}, // SKINCOLOR_SILVER + { 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31}, // SKINCOLOR_GREY + { 12, 14, 16, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}, // SKINCOLOR_NICKEL { 16, 17, 19, 21, 22, 24, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31}, // SKINCOLOR_BLACK + { 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 {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 + {121, 121, 144, 144, 145, 145, 146, 146, 147, 148, 149, 150, 151, 134, 136, 138}, // SKINCOLOR_PINK {144, 145, 146, 147, 148, 149, 150, 151, 134, 135, 136, 137, 138, 139, 140, 141}, // SKINCOLOR_ROSE {120, 121, 122, 123, 124, 125, 126, 127, 128, 130, 131, 133, 134, 136, 137, 139}, // SKINCOLOR_RASPBERRY {125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140}, // SKINCOLOR_RED - {120, 121, 144, 146, 149, 132, 132, 133, 134, 135, 197, 197, 198, 198, 199, 255}, // SKINCOLOR_RUBY + {121, 122, 145, 146, 147, 149, 131, 132, 133, 134, 135, 197, 197, 198, 199, 255}, // SKINCOLOR_RUBY {130, 131, 132, 133, 134, 136, 137, 138, 139, 139, 140, 140, 141, 141, 142, 143}, // SKINCOLOR_CRIMSON + {104, 113, 113, 85, 86, 88, 128, 129, 131, 133, 134, 136, 138, 139, 141, 143}, // SKINCOLOR_KETCHUP {120, 121, 122, 123, 124, 147, 147, 148, 90, 91, 92, 93, 94, 95, 152, 154}, // SKINCOLOR_DAWN {120, 120, 80, 80, 81, 82, 83, 83, 84, 85, 86, 88, 89, 91, 93, 95}, // SKINCOLOR_CREAMSICLE { 80, 81, 82, 83, 84, 85, 86, 88, 89, 91, 94, 95, 154, 156, 158, 159}, // SKINCOLOR_ORANGE { 84, 85, 86, 87, 88, 90, 92, 93, 94, 95, 152, 153, 154, 156, 157, 159}, // SKINCOLOR_PUMPKIN { 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 - {112, 113, 114, 115, 116, 117, 118, 119, 156, 157, 158, 159, 141, 141, 142, 143}, // SKINCOLOR_BRONZE - { 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 + { 98, 98, 112, 112, 113, 113, 84, 85, 87, 89, 91, 93, 95, 153, 156, 159}, // SKINCOLOR_TANGERINE { 64, 65, 67, 68, 70, 71, 73, 74, 76, 77, 79, 48, 50, 53, 56, 59}, // SKINCOLOR_PEACH { 64, 66, 68, 70, 72, 74, 76, 78, 48, 50, 52, 54, 56, 58, 60, 62}, // SKINCOLOR_CARAMEL - { 98, 98, 112, 112, 113, 113, 84, 85, 87, 89, 91, 93, 95, 153, 156, 159}, // SKINCOLOR_TANGERINE {112, 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119}, // SKINCOLOR_GOLD - {121, 144, 145, 72, 73, 84, 114, 115, 107, 108, 109, 183, 223, 207, 30, 246}, // SKINCOLOR_VOMIT + {112, 113, 114, 115, 116, 117, 118, 119, 156, 157, 158, 159, 141, 141, 142, 143}, // SKINCOLOR_BRONZE { 96, 97, 98, 100, 101, 102, 104, 113, 114, 115, 116, 117, 118, 119, 156, 159}, // SKINCOLOR_YELLOW - { 96, 97, 99, 100, 102, 104, 105, 105, 106, 107, 107, 108, 109, 109, 110, 111}, // SKINCOLOR_CANARY + { 96, 98, 99, 112, 113, 114, 114, 106, 106, 107, 107, 108, 108, 109, 110, 111}, // SKINCOLOR_MUSTARD {105, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 31}, // SKINCOLOR_OLIVE + {121, 144, 145, 72, 73, 84, 114, 115, 107, 108, 109, 183, 223, 207, 30, 246}, // SKINCOLOR_VOMIT { 98, 99, 112, 101, 113, 114, 106, 179, 180, 180, 181, 182, 183, 173, 174, 175}, // SKINCOLOR_GARDEN { 96, 97, 99, 100, 102, 104, 160, 162, 164, 166, 168, 171, 223, 223, 207, 31}, // SKINCOLOR_LIME - {120, 120, 176, 176, 176, 177, 177, 178, 178, 179, 180, 180, 181, 181, 182, 183}, // SKINCOLOR_TEA - {176, 176, 176, 177, 177, 178, 178, 179, 179, 180, 180, 181, 181, 182, 182, 183}, // SKINCOLOR_ARMY + {120, 120, 80, 80, 81, 177, 162, 164, 228, 228, 204, 204, 205, 205, 206, 207}, // SKINCOLOR_DREAM + {120, 120, 176, 176, 176, 177, 177, 178, 178, 179, 179, 180, 180, 181, 182, 183}, // SKINCOLOR_TEA {120, 120, 176, 176, 177, 177, 178, 179, 165, 166, 167, 168, 169, 170, 171, 172}, // SKINCOLOR_PISTACHIO + {176, 176, 177, 178, 165, 166, 167, 167, 168, 169, 182, 182, 182, 183, 183, 183}, // SKINCOLOR_ROBOHOOD {178, 178, 178, 179, 179, 180, 181, 182, 183, 172, 172, 173, 173, 174, 174, 175}, // SKINCOLOR_MOSS {120, 176, 176, 176, 177, 163, 164, 165, 167, 221, 221, 222, 223, 207, 207, 31}, // SKINCOLOR_MINT {160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175}, // SKINCOLOR_GREEN - {176, 176, 177, 178, 165, 166, 167, 167, 168, 169, 182, 182, 182, 183, 183, 183}, // SKINCOLOR_ROBOHOOD {160, 161, 162, 164, 165, 167, 169, 170, 171, 171, 172, 173, 174, 175, 30, 31}, // SKINCOLOR_PINETREE {160, 184, 184, 185, 185, 186, 186, 187, 187, 188, 188, 189, 189, 190, 191, 175}, // SKINCOLOR_EMERALD {186, 187, 188, 188, 188, 189, 189, 190, 190, 191, 175, 175, 30, 30, 31, 31}, // SKINCOLOR_SWAMP {120, 208, 208, 210, 212, 214, 220, 220, 220, 221, 221, 222, 222, 223, 223, 191}, // SKINCOLOR_AQUA - {210, 213, 220, 220, 220, 221, 221, 221, 221, 222, 222, 222, 223, 223, 191, 31}, // SKINCOLOR_TEAL - {120, 208, 209, 210, 211, 212, 213, 215, 216, 216, 216, 217, 217, 218, 218, 219}, // SKINCOLOR_CYAN + {210, 213, 220, 220, 220, 216, 216, 221, 221, 221, 222, 222, 223, 223, 191, 31}, // SKINCOLOR_TEAL + {120, 120, 208, 208, 209, 210, 211, 212, 213, 215, 216, 217, 218, 219, 222, 223}, // SKINCOLOR_CYAN + {120, 120, 208, 209, 210, 226, 215, 216, 217, 229, 229, 205, 205, 206, 207, 31}, // SKINCOLOR_JAWZ {208, 209, 211, 213, 215, 216, 216, 217, 217, 218, 218, 219, 205, 206, 207, 207}, // SKINCOLOR_CERULEAN + {215, 215, 215, 216, 216, 217, 218, 204, 204, 205, 205, 206, 207, 29, 30, 31}, // SKINCOLOR_NAVY {120, 120, 200, 200, 200, 201, 201, 201, 202, 202, 202, 203, 204, 205, 206, 207}, // SKINCOLOR_SLATE {120, 200, 200, 201, 201, 202, 202, 203, 203, 204, 204, 205, 205, 206, 207, 31}, // SKINCOLOR_STEEL + {200, 201, 202, 203, 204, 205, 206, 207, 28, 28, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_JET {120, 224, 225, 226, 226, 227, 228, 228, 229, 230, 231, 234, 235, 237, 239, 241}, // SKINCOLOR_PERIWINKLE {224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239}, // SKINCOLOR_BLUE {208, 209, 211, 213, 215, 217, 229, 230, 232, 234, 236, 238, 240, 242, 244, 246}, // SKINCOLOR_SAPPHIRE {228, 229, 230, 231, 232, 233, 234, 235, 237, 238, 239, 240, 242, 243, 244, 245}, // SKINCOLOR_BLUEBERRY - {215, 216, 217, 218, 204, 205, 206, 237, 238, 239, 240, 241, 242, 243, 244, 245}, // SKINCOLOR_NAVY - {200, 201, 202, 203, 204, 205, 206, 207, 28, 28, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_JET {192, 192, 248, 249, 250, 251, 204, 204, 205, 205, 206, 206, 207, 29, 30, 31}, // SKINCOLOR_DUSK {192, 192, 192, 193, 193, 194, 194, 195, 195, 196, 196, 197, 197, 198, 198, 199}, // SKINCOLOR_PURPLE {248, 248, 248, 249, 249, 250, 250, 251, 251, 252, 252, 253, 253, 254, 254, 255}, // SKINCOLOR_LAVENDER - {192, 193, 194, 195, 196, 197, 198, 199, 255, 255, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_INDIGO {192, 248, 249, 250, 251, 252, 253, 254, 255, 255, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_BYZANTIUM + {144, 145, 146, 147, 148, 149, 150, 251, 251, 252, 252, 253, 254, 255, 29, 30}, // SKINCOLOR_POMEGRANATE {120, 120, 120, 121, 121, 122, 122, 123, 192, 248, 249, 250, 251, 252, 253, 254}, // SKINCOLOR_LILAC /* Removed Colours - {120, 121, 123, 124, 126, 127, 129, 130, 132, 133, 135, 136, 138, 139, 141, 143}, // SKINCOLOR_RUBY, removed for other colors + {120, 121, 123, 124, 126, 127, 129, 130, 132, 133, 135, 136, 138, 139, 141, 143}, // old SKINCOLOR_RUBY, removed for other colors + {224, 225, 226, 228, 229, 231, 232, 234, 235, 237, 238, 240, 241, 243, 244, 246}, // old SKINCOLOR_SAPPHIRE, removed for other colors + { 72, 73, 74, 75, 76, 77, 78, 79, 48, 49, 50, 51, 52, 53, 54, 55}, // old SKINCOLOR_CARAMEL, new Caramel was previously Shiny Caramel + {215, 216, 217, 218, 204, 205, 206, 237, 238, 239, 240, 241, 242, 243, 244, 245}, // old SKINCOLOR_NAVY, too similar to Jet { 80, 81, 83, 85, 86, 88, 90, 91, 93, 95, 152, 153, 154, 156, 157, 159}, // SKINCOLOR_AMBER, removed for other colors - {224, 225, 226, 228, 229, 231, 232, 234, 235, 237, 238, 240, 241, 243, 244, 246}, // SKINCOLOR_SAPPHIRE, removed for other colors {160, 160, 160, 184, 184, 184, 185, 185, 185, 186, 187, 187, 188, 188, 189, 190}, // SKINCOLOR_JADE, removed for other colors {224, 225, 226, 212, 213, 213, 214, 215, 220, 221, 172, 222, 173, 223, 174, 175}, // SKINCOLOR_FROST, merged into Aqua - { 72, 73, 74, 75, 76, 77, 78, 79, 48, 49, 50, 51, 52, 53, 54, 55}, // SKINCOLOR_CARAMEL, new Caramel was previously Shiny Caramel + { 96, 97, 99, 100, 102, 104, 105, 105, 106, 107, 107, 108, 109, 109, 110, 111}, // SKINCOLOR_CANARY, replaced with Mustard + {192, 193, 194, 195, 196, 197, 198, 199, 255, 255, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_INDIGO, too similar to Byzantium { 1, 145, 125, 73, 83, 114, 106, 180, 187, 168, 219, 205, 236, 206, 199, 255}, // SKINCOLOR_RAINBOW, is Vomit 2.0 */ }; +//#define SALLYALTRAINBOW // Sal's edited version of the below, which keeps a colors' lightness, and looks better with hue-shifted colors like Ruby & Dream. Not strictly *better*, just different... + +// Define for getting accurate color brightness readings according to how the human eye sees them. +// https://en.wikipedia.org/wiki/Relative_luminance +// 0.2126 to red +// 0.7152 to green +// 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) + /** \brief Generates the rainbow colourmaps that are used when a player has the invincibility power \param dest_colormap colormap to populate @@ -260,10 +274,12 @@ UINT8 colortranslations[MAXSKINCOLORS][16] = { */ void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor) { - INT32 i, j; + INT32 i; RGBA_t color; - UINT8 colorbrightnesses[16]; UINT8 brightness; +#ifndef SALLYALTRAINBOW + INT32 j; + UINT8 colorbrightnesses[16]; UINT16 brightdif; INT32 temp; @@ -271,8 +287,9 @@ void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor) for (i = 0; i < 16; i++) { color = V_GetColor(colortranslations[skincolor][i]); - colorbrightnesses[i] = (UINT8)(((UINT16)color.s.red + (UINT16)color.s.green + (UINT16)color.s.blue)/3); + SETBRIGHTNESS(colorbrightnesses[i], color.s.red, color.s.green, color.s.blue); } +#endif // next, for every colour in the palette, choose the transcolor that has the closest brightness for (i = 0; i < NUM_PALETTE_ENTRIES; i++) @@ -283,7 +300,11 @@ void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor) continue; } color = V_GetColor(i); - brightness = (UINT8)(((UINT16)color.s.red + (UINT16)color.s.green + (UINT16)color.s.blue)/3); + SETBRIGHTNESS(brightness, color.s.red, color.s.green, color.s.blue); +#ifdef SALLYALTRAINBOW + brightness = 15-(brightness/16); // Yes, 15. + dest_colormap[i] = colortranslations[skincolor][brightness]; +#else brightdif = 256; for (j = 0; j < 16; j++) { @@ -294,9 +315,12 @@ void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor) dest_colormap[i] = colortranslations[skincolor][j]; } } +#endif } } +#undef SETBRIGHTNESS + /** \brief Generates a translation colormap for Kart, to replace R_GenerateTranslationColormap in r_draw.c \param dest_colormap colormap to populate @@ -388,10 +412,13 @@ void K_RegisterKartStuff(void) CV_RegisterVar(&cv_thundershield); CV_RegisterVar(&cv_hyudoro); CV_RegisterVar(&cv_pogospring); + CV_RegisterVar(&cv_kitchensink); CV_RegisterVar(&cv_triplesneaker); CV_RegisterVar(&cv_triplebanana); + CV_RegisterVar(&cv_decabanana); CV_RegisterVar(&cv_tripleorbinaut); + CV_RegisterVar(&cv_quadorbinaut); CV_RegisterVar(&cv_dualjawz); CV_RegisterVar(&cv_kartminimap); @@ -410,8 +437,10 @@ void K_RegisterKartStuff(void) CV_RegisterVar(&cv_kartdebugitem); CV_RegisterVar(&cv_kartdebugamount); - CV_RegisterVar(&cv_kartdebugcheckpoint); CV_RegisterVar(&cv_kartdebugshrink); + CV_RegisterVar(&cv_kartdebugdistribution); + + CV_RegisterVar(&cv_kartdebugcheckpoint); } //} @@ -491,29 +520,29 @@ static INT32 K_KartItemOddsRace[NUMKARTRESULTS][9] = static INT32 K_KartItemOddsBattle[NUMKARTRESULTS][6] = { - //P-Odds 0 1 2 3 - /*Sneaker*/ { 2, 2, 2, 2 }, // Sneaker - /*Rocket Sneaker*/ { 0, 0, 0, 0 }, // Rocket Sneaker - /*Invincibility*/ { 4, 2, 1, 2 }, // Invincibility - /*Banana*/ { 0, 0, 2, 0 }, // Banana - /*Eggman Monitor*/ { 0, 0, 1, 0 }, // Eggman Monitor - /*Orbinaut*/ { 0, 1, 5, 0 }, // Orbinaut - /*Jawz*/ { 1, 3, 2, 2 }, // Jawz - /*Mine*/ { 1, 3, 2, 2 }, // Mine - /*Ballhog*/ { 1, 2, 1, 2 }, // Ballhog - /*Self-Propelled Bomb*/ { 0, 0, 0, 0 }, // Self-Propelled Bomb - /*Grow*/ { 4, 2, 0, 2 }, // Grow - /*Shrink*/ { 0, 0, 0, 0 }, // Shrink - /*Thunder Shield*/ { 0, 0, 0, 0 }, // Thunder Shield - /*Hyudoro*/ { 0, 0, 1, 0 }, // Hyudoro - /*Pogo Spring*/ { 0, 0, 1, 0 }, // Pogo Spring - /*Kitchen Sink*/ { 0, 0, 0, 0 }, // Kitchen Sink - /*Sneaker x3*/ { 2, 0, 0, 2 }, // Sneaker x3 - /*Banana x3*/ { 0, 1, 1, 1 }, // Banana x3 - /*Banana x10*/ { 1, 0, 0, 1 }, // Banana x10 - /*Orbinaut x3*/ { 0, 1, 1, 1 }, // Orbinaut x3 - /*Orbinaut x4*/ { 1, 1, 0, 1 }, // Orbinaut x4 - /*Jawz x2*/ { 3, 2, 0, 2 } // Jawz x2 + //P-Odds 0 1 2 3 4 5 + /*Sneaker*/ { 3, 2, 2, 2, 0, 2 }, // Sneaker + /*Rocket Sneaker*/ { 0, 0, 0, 0, 0, 0 }, // Rocket Sneaker + /*Invincibility*/ { 0, 1, 2, 3, 4, 2 }, // Invincibility + /*Banana*/ { 2, 1, 0, 0, 0, 0 }, // Banana + /*Eggman Monitor*/ { 1, 1, 0, 0, 0, 0 }, // Eggman Monitor + /*Orbinaut*/ { 6, 2, 1, 0, 0, 0 }, // Orbinaut + /*Jawz*/ { 3, 3, 3, 2, 0, 2 }, // Jawz + /*Mine*/ { 2, 3, 3, 1, 0, 2 }, // Mine + /*Ballhog*/ { 0, 1, 2, 1, 0, 2 }, // Ballhog + /*Self-Propelled Bomb*/ { 0, 0, 0, 0, 0, 0 }, // Self-Propelled Bomb + /*Grow*/ { 0, 0, 1, 2, 4, 2 }, // Grow + /*Shrink*/ { 0, 0, 0, 0, 0, 0 }, // Shrink + /*Thunder Shield*/ { 0, 0, 0, 0, 0, 0 }, // Thunder Shield + /*Hyudoro*/ { 1, 1, 0, 0, 0, 0 }, // Hyudoro + /*Pogo Spring*/ { 1, 1, 0, 0, 0, 0 }, // Pogo Spring + /*Kitchen Sink*/ { 0, 0, 0, 0, 0, 0 }, // Kitchen Sink + /*Sneaker x3*/ { 0, 0, 0, 2, 4, 2 }, // Sneaker x3 + /*Banana x3*/ { 1, 2, 1, 0, 0, 0 }, // Banana x3 + /*Banana x10*/ { 0, 0, 1, 1, 0, 2 }, // Banana x10 + /*Orbinaut x3*/ { 0, 1, 2, 1, 0, 0 }, // Orbinaut x3 + /*Orbinaut x4*/ { 0, 0, 1, 3, 4, 2 }, // Orbinaut x4 + /*Jawz x2*/ { 0, 0, 1, 2, 4, 2 } // Jawz x2 }; /** \brief Item Roulette for Kart @@ -616,8 +645,8 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed) players[first].mo->z - players[second].mo->z) / mapheaderinfo[gamemap-1]->mobj_scale; if (franticitems) secondist = (15*secondist/14); - if (pingame < 6 && !G_BattleGametype()) - secondist = ((28+(6-pingame))*secondist/28); + if (pingame < 8 && !G_BattleGametype()) + secondist = ((28+(8-pingame))*secondist/28); } // POWERITEMODDS handles all of the "frantic item" related functionality, for all of our powerful items. @@ -629,8 +658,8 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed) #define POWERITEMODDS(odds) \ if (franticitems) \ odds *= 2; \ - if (pingame < 6 && !G_BattleGametype()) \ - odds = FixedMul(odds*FRACUNIT, FRACUNIT+min((6-pingame)*(FRACUNIT/25), FRACUNIT))/FRACUNIT; \ + if (pingame < 8 && !G_BattleGametype()) \ + odds = FixedMul(odds*FRACUNIT, FRACUNIT+min((8-pingame)*(FRACUNIT/25), FRACUNIT))/FRACUNIT; \ if (mashed > 0) \ odds = FixedDiv(odds*FRACUNIT, mashed+FRACUNIT)/FRACUNIT \ @@ -669,7 +698,7 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed) if (!cv_ballhog.value) newodds = 0; break; case KITEM_SPB: - POWERITEMODDS(newodds); + //POWERITEMODDS(newodds); if ((!cv_selfpropelledbomb.value) || (indirectitemcooldown > 0) || (pexiting > 0) @@ -710,7 +739,7 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed) break; case KRITEM_TENFOLDBANANA: POWERITEMODDS(newodds); - if (!cv_triplebanana.value) newodds = 0; + if (!cv_decabanana.value) newodds = 0; break; case KRITEM_TRIPLEORBINAUT: POWERITEMODDS(newodds); @@ -718,7 +747,7 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed) break; case KRITEM_QUADORBINAUT: POWERITEMODDS(newodds); - if (!cv_tripleorbinaut.value) newodds = 0; + if (!cv_quadorbinaut.value) newodds = 0; break; case KRITEM_DUALJAWZ: POWERITEMODDS(newodds); @@ -734,19 +763,125 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed) //{ SRB2kart Roulette Code - Distance Based, no waypoints -static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd) +static INT32 K_FindUseodds(player_t *player, fixed_t mashed, INT32 pingame, INT32 bestbumper) { const INT32 distvar = (64*14); + INT32 i; + INT32 pdis = 0, useodds = 0; + UINT8 disttable[14]; + UINT8 distlen = 0; + boolean oddsvalid[9]; + + for (i = 0; i < 9; i++) + { + INT32 j; + boolean available = false; + + if (G_BattleGametype() && i > 5) + { + oddsvalid[i] = false; + break; + } + + for (j = 0; j < NUMKARTRESULTS; j++) + { + if (K_KartGetItemOdds(i, j, mashed) > 0) + { + available = true; + break; + } + } + + oddsvalid[i] = available; + } + + for (i = 0; i < MAXPLAYERS; i++) + { + if (playeringame[i] && !players[i].spectator && players[i].mo + && players[i].kartstuff[k_position] < player->kartstuff[k_position]) + pdis += P_AproxDistance(P_AproxDistance(players[i].mo->x - player->mo->x, + players[i].mo->y - player->mo->y), + players[i].mo->z - player->mo->z) / mapheaderinfo[gamemap-1]->mobj_scale + * (pingame - players[i].kartstuff[k_position]) + / ((pingame - 1) * (pingame + 1) / 3); + } + +#define SETUPDISTTABLE(odds, num) \ + for (i = num; i; --i) disttable[distlen++] = odds + + if (G_BattleGametype()) // Battle Mode + { + if (oddsvalid[0]) SETUPDISTTABLE(0,1); + if (oddsvalid[1]) SETUPDISTTABLE(1,1); + if (oddsvalid[2]) SETUPDISTTABLE(2,1); + if (oddsvalid[3]) SETUPDISTTABLE(3,1); + if (oddsvalid[4]) SETUPDISTTABLE(4,1); + + if (player->kartstuff[k_roulettetype] == 1 && oddsvalid[5]) // 5 is the extreme odds of player-controlled "Karma" items + useodds = 5; + else + { + SINT8 wantedpos = (bestbumper-player->kartstuff[k_bumper]); // 0 is the best player's bumper count, 1 is a bumper below best, 2 is two bumpers below, etc + if (K_IsPlayerWanted(player)) + wantedpos++; + if (wantedpos > 4) // Don't run off into karma items + wantedpos = 4; + if (wantedpos < 0) // Don't go below somehow + wantedpos = 0; + useodds = disttable[(wantedpos * distlen) / 5]; + } + } + else + { + if (oddsvalid[1]) SETUPDISTTABLE(1,1); + if (oddsvalid[2]) SETUPDISTTABLE(2,1); + if (oddsvalid[3]) SETUPDISTTABLE(3,1); + if (oddsvalid[4]) SETUPDISTTABLE(4,2); + if (oddsvalid[5]) SETUPDISTTABLE(5,2); + if (oddsvalid[6]) SETUPDISTTABLE(6,3); + if (oddsvalid[7]) SETUPDISTTABLE(7,3); + if (oddsvalid[8]) SETUPDISTTABLE(8,1); + + if (franticitems) // Frantic items make the distances between everyone artifically higher, for crazier items + pdis = (15*pdis/14); + if (pingame < 8 && !G_BattleGametype()) + pdis = ((28+(8-pingame))*pdis/28); + + if (pingame == 1 && oddsvalid[0]) // Record Attack, or just alone + useodds = 0; + else if (pdis <= 0) // (64*14) * 0 = 0 + useodds = disttable[0]; + else if (pdis > distvar * ((12 * distlen) / 14)) // (64*14) * 12 = 10752 + useodds = disttable[distlen-1]; + else + { + for (i = 1; i < 13; i++) + { + if (pdis <= distvar * ((i * distlen) / 14)) + { + useodds = disttable[((i * distlen) / 14)]; + break; + } + } + } + } + +#undef SETUPDISTTABLE + + //CONS_Printf("Got useodds %d. (position: %d, distance: %d)\n", useodds, player->kartstuff[k_position], pdis); + + return useodds; +} + +static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd) +{ INT32 i; UINT8 pingame = 0; UINT8 roulettestop; - INT32 pdis = 0, useodds = 0; + INT32 useodds = 0; INT32 spawnchance[NUMKARTRESULTS * NUMKARTODDS]; INT32 chance = 0, numchoices = 0; INT32 bestbumper = 0; - boolean oddsvalid[9]; - UINT8 disttable[14]; - UINT8 distlen = 0; fixed_t mashed = 0; // This makes the roulette cycle through items - if this is 0, you shouldn't be here. @@ -810,129 +945,15 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd) for (i = 0; i < (NUMKARTRESULTS * NUMKARTODDS); i++) spawnchance[i] = 0; - for (i = 0; i < 9; i++) - { - INT32 j; - boolean available = false; + // Split into another function for a debug function below + useodds = K_FindUseodds(player, mashed, pingame, bestbumper); - if (G_BattleGametype() && i > 5) - { - oddsvalid[i] = false; - break; - } - - for (j = 0; j < NUMKARTRESULTS; j++) - { - if (K_KartGetItemOdds(i, j, mashed) > 0) - { - available = true; - break; - } - } - - oddsvalid[i] = available; - } - - for (i = 0; i < MAXPLAYERS; i++) - { - if (playeringame[i] && !players[i].spectator && players[i].mo - && players[i].kartstuff[k_position] < player->kartstuff[k_position]) - pdis += P_AproxDistance(P_AproxDistance(players[i].mo->x - player->mo->x, - players[i].mo->y - player->mo->y), - players[i].mo->z - player->mo->z) / mapheaderinfo[gamemap-1]->mobj_scale - * (pingame - players[i].kartstuff[k_position]) - / ((pingame - 1) * (pingame + 1) / 3); - } - -#define SETUPDISTTABLE(odds, num) \ - for (i = num; i; --i) disttable[distlen++] = odds - - if (G_BattleGametype()) // Battle Mode - { - if (oddsvalid[0]) SETUPDISTTABLE(0,1); - if (oddsvalid[1]) SETUPDISTTABLE(1,1); - if (oddsvalid[2]) SETUPDISTTABLE(2,1); - - if (player->kartstuff[k_roulettetype] == 1 && oddsvalid[3]) // Player-controlled "Karma" items - useodds = 3; - else - { - SINT8 wantedpos = (player->kartstuff[k_bumper]-bestbumper)+2; // 0 is two bumpers below best player's bumper count, 2 is best player's bumper count - if (K_IsPlayerWanted(player)) - wantedpos--; - if (wantedpos > 2) - wantedpos = 2; - if (wantedpos < 0) - wantedpos = 0; - useodds = disttable[(wantedpos * distlen) / 3]; - } - } - else - { - if (oddsvalid[1]) SETUPDISTTABLE(1,1); - if (oddsvalid[2]) SETUPDISTTABLE(2,1); - if (oddsvalid[3]) SETUPDISTTABLE(3,1); - if (oddsvalid[4]) SETUPDISTTABLE(4,2); - if (oddsvalid[5]) SETUPDISTTABLE(5,2); - if (oddsvalid[6]) SETUPDISTTABLE(6,3); - if (oddsvalid[7]) SETUPDISTTABLE(7,3); - if (oddsvalid[8]) SETUPDISTTABLE(8,1); - - if (franticitems) // Frantic items make the distances between everyone artifically higher, for crazier items - pdis = (15*pdis/14); - if (pingame < 6 && !G_BattleGametype()) - pdis = ((28+(6-pingame))*pdis/28); - - if (pingame == 1 && oddsvalid[0]) // Record Attack, or just alone - useodds = 0; - else if (pdis <= 0) // (64*14) * 0 = 0 - useodds = disttable[0]; - else if (pdis > distvar * ((12 * distlen) / 14)) // (64*14) * 12 = 10752 - useodds = disttable[distlen-1]; - else - { - for (i = 1; i < 12; i++) - { - if (pdis <= distvar * ((i * distlen) / 14)) - { - useodds = disttable[((i * distlen) / 14)]; - break; - } - } - } - } - -#undef SETUPDISTTABLE - - //CONS_Printf("Got useodds %d. (position: %d, distance: %d)\n", useodds, player->kartstuff[k_position], pdis); - -#define SETITEMRESULT(pos, itemnum) \ - for (chance = 0; chance < K_KartGetItemOdds(pos, itemnum, mashed); chance++) \ +#define SETITEMRESULT(itemnum) \ + for (chance = 0; chance < K_KartGetItemOdds(useodds, itemnum, mashed); chance++) \ spawnchance[numchoices++] = itemnum - SETITEMRESULT(useodds, KITEM_SNEAKER); // Sneaker - SETITEMRESULT(useodds, KITEM_ROCKETSNEAKER); // Rocket Sneaker - SETITEMRESULT(useodds, KITEM_INVINCIBILITY); // Invincibility - SETITEMRESULT(useodds, KITEM_BANANA); // Banana - SETITEMRESULT(useodds, KITEM_EGGMAN); // Eggman Monitor - SETITEMRESULT(useodds, KITEM_ORBINAUT); // Orbinaut - SETITEMRESULT(useodds, KITEM_JAWZ); // Jawz - SETITEMRESULT(useodds, KITEM_MINE); // Mine - SETITEMRESULT(useodds, KITEM_BALLHOG); // Ballhog - SETITEMRESULT(useodds, KITEM_SPB); // Self-Propelled Bomb - SETITEMRESULT(useodds, KITEM_GROW); // Grow - SETITEMRESULT(useodds, KITEM_SHRINK); // Shrink - SETITEMRESULT(useodds, KITEM_THUNDERSHIELD); // Thunder Shield - SETITEMRESULT(useodds, KITEM_HYUDORO); // Hyudoro - SETITEMRESULT(useodds, KITEM_POGOSPRING); // Pogo Spring - //SETITEMRESULT(useodds, KITEM_KITCHENSINK); // Kitchen Sink - - SETITEMRESULT(useodds, KRITEM_TRIPLESNEAKER); // Sneaker x3 - SETITEMRESULT(useodds, KRITEM_TRIPLEBANANA); // Banana x3 - SETITEMRESULT(useodds, KRITEM_TENFOLDBANANA); // Banana x10 - SETITEMRESULT(useodds, KRITEM_TRIPLEORBINAUT); // Orbinaut x3 - SETITEMRESULT(useodds, KRITEM_QUADORBINAUT); // Orbinaut x4 - SETITEMRESULT(useodds, KRITEM_DUALJAWZ); // Jawz x2 + for (i = 1; i < NUMKARTRESULTS; i++) + SETITEMRESULT(i); #undef SETITEMRESULT @@ -968,7 +989,21 @@ static fixed_t K_GetMobjWeight(mobj_t *mobj, mobj_t *against) if (against->player && !against->player->kartstuff[k_spinouttimer] && mobj->player->kartstuff[k_spinouttimer]) weight = 0; // Do not bump else + { weight = (mobj->player->kartweight)<player->speed > K_GetKartSpeed(mobj->player, false)) + weight += (mobj->player->speed - K_GetKartSpeed(mobj->player, false))/8; + } + break; + case MT_FALLINGROCK: + if (against->player) + { + if (against->player->kartstuff[k_invincibilitytimer] + || against->player->kartstuff[k_growshrinktimer] > 0) + weight = 0; + else + weight = (against->player->kartweight)<kartstuff[k_offroad] = 0; } +// These have to go earlier than its sisters because of K_RespawnChecker... +static void K_MatchGenericExtraFlags(mobj_t *mo, mobj_t *master) +{ + // flipping + mo->eflags = (mo->eflags & ~MFE_VERTICALFLIP)|(master->eflags & MFE_VERTICALFLIP); + // visibility (usually for hyudoro) + mo->flags2 = (mo->flags2 & ~MF2_DONTDRAW)|(master->flags2 & MF2_DONTDRAW); + mo->eflags = (mo->eflags & ~MFE_DRAWONLYFORP1)|(master->eflags & MFE_DRAWONLYFORP1); + mo->eflags = (mo->eflags & ~MFE_DRAWONLYFORP2)|(master->eflags & MFE_DRAWONLYFORP2); + mo->eflags = (mo->eflags & ~MFE_DRAWONLYFORP3)|(master->eflags & MFE_DRAWONLYFORP3); + mo->eflags = (mo->eflags & ~MFE_DRAWONLYFORP4)|(master->eflags & MFE_DRAWONLYFORP4); +} + +static void K_SpawnDashDustRelease(player_t *player) +{ + fixed_t newx; + fixed_t newy; + mobj_t *dust; + angle_t travelangle; + INT32 i; + + I_Assert(player != NULL); + I_Assert(player->mo != NULL); + I_Assert(!P_MobjWasRemoved(player->mo)); + + if (!P_IsObjectOnGround(player->mo)) + return; + + if (player->speed == 0) + return; + + travelangle = player->mo->angle; + + if (player->kartstuff[k_drift] || player->kartstuff[k_driftend]) + travelangle -= (ANGLE_45/5)*player->kartstuff[k_drift]; + + for (i = 0; i < 2; i++) + { + newx = player->mo->x + P_ReturnThrustX(player->mo, travelangle + ((i&1) ? -1 : 1)*ANGLE_90, FixedMul(48*FRACUNIT, player->mo->scale)); + newy = player->mo->y + P_ReturnThrustY(player->mo, travelangle + ((i&1) ? -1 : 1)*ANGLE_90, FixedMul(48*FRACUNIT, player->mo->scale)); + dust = P_SpawnMobj(newx, newy, player->mo->z, MT_FASTDUST); + + P_SetTarget(&dust->target, player->mo); + dust->angle = travelangle - ((i&1) ? -1 : 1)*ANGLE_45; + dust->destscale = player->mo->scale; + P_SetScale(dust, player->mo->scale); + + dust->momx = 3*player->mo->momx/5; + dust->momy = 3*player->mo->momy/5; + //dust->momz = 3*player->mo->momz/5; + + K_MatchGenericExtraFlags(dust, player->mo); + } +} + /** \brief Calculates the respawn timer and drop-boosting \param player player object passed from K_KartPlayerThink @@ -1226,7 +1316,7 @@ void K_RespawnChecker(player_t *player) if (player->spectator) return; - if (player->kartstuff[k_respawn] > 3) + if (player->kartstuff[k_respawn] > 1) { player->kartstuff[k_respawn]--; player->mo->momz = 0; @@ -1264,26 +1354,40 @@ void K_RespawnChecker(player_t *player) } } } - - if (player->kartstuff[k_respawn] > 0 && player->kartstuff[k_respawn] <= 3) + else if (player->kartstuff[k_respawn] == 1) { if (!P_IsObjectOnGround(player->mo)) { player->powers[pw_flashing] = 2; - // If you tried to boost while in the air, - // you lose your chance of boosting at all. + + // Sal: That's stupid and prone to accidental usage. + // Let's rip off Mania instead, and turn this into a Drop Dash! + if (cmd->buttons & BT_ACCELERATE) - { - player->powers[pw_flashing] = 0; - player->kartstuff[k_respawn] = 0; - } + player->kartstuff[k_dropdash]++; + else + player->kartstuff[k_dropdash] = 0; + + if (player->kartstuff[k_dropdash] == TICRATE/4) + S_StartSound(player->mo, sfx_ddash); + + if ((player->kartstuff[k_dropdash] >= TICRATE/4) + && (player->kartstuff[k_dropdash] & 1)) + player->mo->colorized = true; + else + player->mo->colorized = false; } else { - player->kartstuff[k_respawn]--; - // Quick! You only have three tics to boost! - if (cmd->buttons & BT_ACCELERATE) - K_DoSneaker(player, true); + if ((cmd->buttons & BT_ACCELERATE) && (player->kartstuff[k_dropdash] >= TICRATE/4)) + { + S_StartSound(player->mo, sfx_s23c); + player->kartstuff[k_startboost] = 50; + K_SpawnDashDustRelease(player); + } + player->mo->colorized = false; + player->kartstuff[k_dropdash] = 0; + player->kartstuff[k_respawn] = 0; } } } @@ -1446,68 +1550,80 @@ void K_MomentumToFacing(player_t *player) player->mo->momy = FixedMul(player->mo->momy - player->cmomy, player->mo->friction) + player->cmomy; } -// if speed is true it gets the speed boost power, otherwise it gets the acceleration -static fixed_t K_GetKartBoostPower(player_t *player, boolean speed) +// sets k_boostpower, k_speedboost, and k_accelboost to whatever we need it to be +static void K_GetKartBoostPower(player_t *player) { fixed_t boostpower = FRACUNIT; - fixed_t boostvalue = 0; + fixed_t speedboost = 0, accelboost = 0; if (player->kartstuff[k_spinouttimer] && player->kartstuff[k_wipeoutslow] == 1) // Slow down after you've been bumped - return 0; + { + player->kartstuff[k_boostpower] = player->kartstuff[k_speedboost] = player->kartstuff[k_accelboost] = 0; + return; + } // Offroad is separate, it's difficult to factor it in with a variable value anyway. if (!(player->kartstuff[k_invincibilitytimer] || player->kartstuff[k_hyudorotimer] || player->kartstuff[k_sneakertimer]) - && player->kartstuff[k_offroad] >= 0 && speed) + && player->kartstuff[k_offroad] >= 0) boostpower = FixedDiv(boostpower, player->kartstuff[k_offroad] + FRACUNIT); - if (player->kartstuff[k_bananadrag] > TICRATE) + if (player->kartstuff[k_itemtype] == KITEM_KITCHENSINK) + boostpower = max((TICRATE/2), (5*TICRATE)-(player->kartstuff[k_bananadrag]/2))*boostpower/(5*TICRATE); + else if (player->kartstuff[k_bananadrag] > TICRATE) boostpower = 4*boostpower/5; - if (player->kartstuff[k_growshrinktimer] > 0) - { // Grow - if (speed) + if (player->kartstuff[k_sneakertimer]) // Sneaker + { + switch (gamespeed) { - boostvalue = max(boostvalue, FRACUNIT/5); // + 20% + case 0: + speedboost = max(speedboost, 53740+768); + break; + case 2: + speedboost = max(speedboost, 17294+768); + break; + default: + speedboost = max(speedboost, 32768); + break; } + accelboost = max(accelboost, 8*FRACUNIT); // + 800% } - if (player->kartstuff[k_invincibilitytimer]) - { // Invincibility - if (speed) - boostvalue = max(boostvalue, 3*(FRACUNIT/8)); // + 37.5% - else - boostvalue = max(boostvalue, 3*FRACUNIT); // + 600% + + if (player->kartstuff[k_invincibilitytimer]) // Invincibility + { + speedboost = max(speedboost, 3*FRACUNIT/8); // + 37.5% + accelboost = max(accelboost, 3*FRACUNIT); // + 300% } - if (player->kartstuff[k_driftboost]) - { // Drift Boost - if (speed) - boostvalue = max(boostvalue, FRACUNIT/4); // + 25% - else - boostvalue = max(boostvalue, 4*FRACUNIT); // + 400% + + if (player->kartstuff[k_growshrinktimer] > 0) // Grow + { + speedboost = max(speedboost, FRACUNIT/5); // + 20% } - if (player->kartstuff[k_sneakertimer]) - { // Sneaker - if (speed) - { - switch (gamespeed) - { - case 0: - boostvalue = max(boostvalue, 53740+768); - break; - case 2: - boostvalue = max(boostvalue, 17294+768); - break; - default: - boostvalue = max(boostvalue, 32768); - break; - } - } - else - boostvalue = max(boostvalue, 8*FRACUNIT); // + 800% + + if (player->kartstuff[k_driftboost]) // Drift Boost + { + speedboost = max(speedboost, FRACUNIT/4); // + 25% + accelboost = max(accelboost, 4*FRACUNIT); // + 400% } + + if (player->kartstuff[k_startboost]) // Startup Boost + { + speedboost = max(speedboost, FRACUNIT/4); // + 25% + accelboost = max(accelboost, 6*FRACUNIT); // + 300% + } + // don't average them anymore, this would make a small boost and a high boost less useful // just take the highest we want instead - return boostpower + boostvalue; + player->kartstuff[k_boostpower] = boostpower; + + // value smoothing + if (speedboost > player->kartstuff[k_speedboost]) + player->kartstuff[k_speedboost] = speedboost; + else + player->kartstuff[k_speedboost] += (speedboost - player->kartstuff[k_speedboost])/(TICRATE/2); + + player->kartstuff[k_accelboost] = accelboost; } fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower) @@ -1542,7 +1658,7 @@ fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower) finalspeed = FixedMul(FixedMul(k_speed<<14, g_cc), player->mo->scale); if (doboostpower) - return FixedMul(finalspeed, K_GetKartBoostPower(player, true)); + return FixedMul(finalspeed, player->kartstuff[k_boostpower]+player->kartstuff[k_speedboost]); return finalspeed; } @@ -1557,7 +1673,7 @@ fixed_t K_GetKartAccel(player_t *player) //k_accel += 3 * (9 - kartspeed); // 36 - 60 k_accel += 4 * (9 - kartspeed); // 32 - 64 - return FixedMul(k_accel, K_GetKartBoostPower(player, false)); + return FixedMul(k_accel, FRACUNIT+player->kartstuff[k_accelboost]); } UINT16 K_GetKartFlashing(player_t *player) @@ -1584,9 +1700,9 @@ fixed_t K_3dKartMovement(player_t *player, boolean onground, fixed_t forwardmove if (player->kartstuff[k_pogospring]) // Pogo Spring minimum/maximum thrust { - const fixed_t hscale = mapheaderinfo[gamemap-1]->mobj_scale + (mapheaderinfo[gamemap-1]->mobj_scale - player->mo->scale); + const fixed_t hscale = mapheaderinfo[gamemap-1]->mobj_scale /*+ (mapheaderinfo[gamemap-1]->mobj_scale - player->mo->scale)*/; const fixed_t minspeed = 24*hscale; - const fixed_t maxspeed = 36*hscale; + const fixed_t maxspeed = 28*hscale; if (newspeed > maxspeed && player->kartstuff[k_pogospring] == 2) newspeed = maxspeed; @@ -2154,16 +2270,25 @@ static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t angle th->momx = FixedMul(finalspeed, FINECOSINE(an>>ANGLETOFINESHIFT)); th->momy = FixedMul(finalspeed, FINESINE(an>>ANGLETOFINESHIFT)); - if (type == MT_ORBINAUT) + switch (type) { - if (source && source->player) - th->color = source->player->skincolor; - else - th->color = SKINCOLOR_CLOUDY; - } - else if (type == MT_JAWZ || type == MT_JAWZ_DUD) - { - S_StartSound(th, th->info->activesound); + case MT_ORBINAUT: + if (source && source->player) + th->color = source->player->skincolor; + else + th->color = SKINCOLOR_GREY; + break; + case MT_JAWZ: + if (source && source->player) + th->cvmem = source->player->skincolor; + else + th->cvmem = SKINCOLOR_RED; + //fallthrough + case MT_JAWZ_DUD: + S_StartSound(th, th->info->activesound); + break; + default: + break; } x = x + P_ReturnThrustX(source, an, source->radius + th->radius); @@ -2176,6 +2301,83 @@ static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t angle return NULL; } +static void K_SpawnDriftSparks(player_t *player) +{ + fixed_t newx; + fixed_t newy; + mobj_t *spark; + angle_t travelangle; + INT32 i; + + I_Assert(player != NULL); + I_Assert(player->mo != NULL); + I_Assert(!P_MobjWasRemoved(player->mo)); + + if (leveltime % 2 == 1) + return; + + if (!P_IsObjectOnGround(player->mo)) + return; + + if (!player->kartstuff[k_drift] || player->kartstuff[k_driftcharge] < K_GetKartDriftSparkValue(player)) + return; + + travelangle = player->mo->angle-(ANGLE_45/5)*player->kartstuff[k_drift]; + + for (i = 0; i < 2; i++) + { + newx = player->mo->x + P_ReturnThrustX(player->mo, travelangle + ((i&1) ? -1 : 1)*ANGLE_135, FixedMul(32*FRACUNIT, player->mo->scale)); + newy = player->mo->y + P_ReturnThrustY(player->mo, travelangle + ((i&1) ? -1 : 1)*ANGLE_135, FixedMul(32*FRACUNIT, player->mo->scale)); + spark = P_SpawnMobj(newx, newy, player->mo->z, MT_DRIFTSPARK); + + P_SetTarget(&spark->target, player->mo); + spark->angle = travelangle-(ANGLE_45/5)*player->kartstuff[k_drift]; + spark->destscale = player->mo->scale; + P_SetScale(spark, player->mo->scale); + + spark->momx = player->mo->momx/2; + spark->momy = player->mo->momy/2; + //spark->momz = player->mo->momz/2; + + if (player->kartstuff[k_driftcharge] >= K_GetKartDriftSparkValue(player)*4) + { + spark->color = (UINT8)(1 + (leveltime % (MAXSKINCOLORS-1))); + } + else if (player->kartstuff[k_driftcharge] >= K_GetKartDriftSparkValue(player)*2) + { + if (player->kartstuff[k_driftcharge] <= (K_GetKartDriftSparkValue(player)*2)+(24*3)) + spark->color = SKINCOLOR_RASPBERRY; // transition + else + spark->color = SKINCOLOR_KETCHUP; + } + else + spark->color = SKINCOLOR_SAPPHIRE; + + if ((player->kartstuff[k_drift] > 0 && player->cmd.driftturn > 0) // Inward drifts + || (player->kartstuff[k_drift] < 0 && player->cmd.driftturn < 0)) + { + if ((player->kartstuff[k_drift] < 0 && (i & 1)) + || (player->kartstuff[k_drift] > 0 && !(i & 1))) + P_SetMobjState(spark, S_DRIFTSPARK_A1); + else if ((player->kartstuff[k_drift] < 0 && !(i & 1)) + || (player->kartstuff[k_drift] > 0 && (i & 1))) + P_SetMobjState(spark, S_DRIFTSPARK_C1); + } + else if ((player->kartstuff[k_drift] > 0 && player->cmd.driftturn < 0) // Outward drifts + || (player->kartstuff[k_drift] < 0 && player->cmd.driftturn > 0)) + { + if ((player->kartstuff[k_drift] < 0 && (i & 1)) + || (player->kartstuff[k_drift] > 0 && !(i & 1))) + P_SetMobjState(spark, S_DRIFTSPARK_C1); + else if ((player->kartstuff[k_drift] < 0 && !(i & 1)) + || (player->kartstuff[k_drift] > 0 && (i & 1))) + P_SetMobjState(spark, S_DRIFTSPARK_A1); + } + + K_MatchGenericExtraFlags(spark, player->mo); + } +} + void K_SpawnBoostTrail(player_t *player) { fixed_t newx; @@ -2223,7 +2425,7 @@ void K_SpawnBoostTrail(player_t *player) flame->fuse = TICRATE*2; flame->destscale = player->mo->scale; P_SetScale(flame, player->mo->scale); - flame->eflags = (flame->eflags & ~MFE_VERTICALFLIP)|(player->mo->eflags & MFE_VERTICALFLIP); + flame->eflags = (flame->eflags & ~MFE_VERTICALFLIP)|(player->mo->eflags & MFE_VERTICALFLIP); // not K_MatchGenericExtraFlags so that a stolen sneaker can be seen flame->momx = 8; P_XYMovement(flame); @@ -2263,7 +2465,7 @@ void K_SpawnSparkleTrail(mobj_t *mo) P_SetTarget(&sparkle->target, mo); sparkle->destscale = mo->destscale; P_SetScale(sparkle, mo->scale); - sparkle->eflags = (sparkle->eflags & ~MFE_VERTICALFLIP)|(mo->eflags & MFE_VERTICALFLIP); + sparkle->eflags = (sparkle->eflags & ~MFE_VERTICALFLIP)|(mo->eflags & MFE_VERTICALFLIP); // not K_MatchGenericExtraFlags so that a stolen invincibility can be seen sparkle->color = mo->color; //sparkle->colorized = mo->colorized; } @@ -2284,7 +2486,7 @@ void K_SpawnWipeoutTrail(mobj_t *mo, boolean translucent) dust->angle = R_PointToAngle2(0,0,mo->momx,mo->momy); dust->destscale = mo->scale; P_SetScale(dust, mo->scale); - dust->eflags = (dust->eflags & ~MFE_VERTICALFLIP)|(mo->eflags & MFE_VERTICALFLIP); + dust->eflags = (dust->eflags & ~MFE_VERTICALFLIP)|(mo->eflags & MFE_VERTICALFLIP); // not K_MatchGenericExtraFlags because hyudoro shouldn't be able to wipeout if (translucent) dust->flags2 |= MF2_SHADOW; @@ -2404,7 +2606,7 @@ static mobj_t *K_FindLastTrailMobj(player_t *player) return trail; } -static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t mapthing, INT32 defaultDir, boolean minethrow) +static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t mapthing, INT32 defaultDir, INT32 altthrow) { mobj_t *mo; INT32 dir, PROJSPEED; @@ -2429,14 +2631,26 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map break; } - if (minethrow) + if (altthrow) { - if (player->kartstuff[k_throwdir] == 1) - dir = 2; - else if (player->kartstuff[k_throwdir] == -1 && mapthing != MT_SINK) - dir = -1; + if (altthrow == 2) // Kitchen sink throwing + { + if (player->kartstuff[k_throwdir] == 1) + dir = 3; + else if (player->kartstuff[k_throwdir] == -1) + dir = 1; + else + dir = 2; + } else - dir = 1; + { + if (player->kartstuff[k_throwdir] == 1) + dir = 2; + else if (player->kartstuff[k_throwdir] == -1) + dir = -1; + else + dir = 1; + } } else { @@ -2453,11 +2667,11 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map if (dir == -1) { // Shoot backward - mo = K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + ANGLE_180 - 0x06000000, 0, PROJSPEED/2); - K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + ANGLE_180 - 0x03000000, 0, PROJSPEED/2); - K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + ANGLE_180, 0, PROJSPEED/2); - K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + ANGLE_180 + 0x03000000, 0, PROJSPEED/2); - K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + ANGLE_180 + 0x06000000, 0, PROJSPEED/2); + mo = K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + ANGLE_180 - 0x06000000, 0, PROJSPEED/4); + K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + ANGLE_180 - 0x03000000, 0, PROJSPEED/4); + K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + ANGLE_180, 0, PROJSPEED/4); + K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + ANGLE_180 + 0x03000000, 0, PROJSPEED/4); + K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + ANGLE_180 + 0x06000000, 0, PROJSPEED/4); } else { @@ -2474,7 +2688,7 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map if (dir == -1) { // Shoot backward - mo = K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + ANGLE_180, 0, PROJSPEED/2); + mo = K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + ANGLE_180, 0, PROJSPEED/4); } else { @@ -2487,7 +2701,7 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map { player->kartstuff[k_bananadrag] = 0; // RESET timer, for multiple bananas - if (dir == 1 || dir == 2) + if (dir > 0) { // Shoot forward mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z + player->mo->height/2, mapthing); @@ -2500,15 +2714,10 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map if (mo) { angle_t fa = player->mo->angle>>ANGLETOFINESHIFT; - INT32 HEIGHT; + INT32 HEIGHT = (20 + (dir*10))*(mapheaderinfo[gamemap-1]->mobj_scale) + player->mo->momz; - if (dir == 2) - HEIGHT = 40*(mapheaderinfo[gamemap-1]->mobj_scale) + player->mo->momz; - else - HEIGHT = 30*(mapheaderinfo[gamemap-1]->mobj_scale) + player->mo->momz; - - mo->momx = player->mo->momx + FixedMul(FINECOSINE(fa), PROJSPEED); - mo->momy = player->mo->momy + FixedMul(FINESINE(fa), PROJSPEED); + mo->momx = player->mo->momx + FixedMul(FINECOSINE(fa), (altthrow == 2 ? 2*PROJSPEED/3 : PROJSPEED)); + mo->momy = player->mo->momy + FixedMul(FINESINE(fa), (altthrow == 2 ? 2*PROJSPEED/3 : PROJSPEED)); mo->momz = P_MobjFlip(player->mo) * HEIGHT; if (player->mo->eflags & MFE_VERTICALFLIP) @@ -2619,7 +2828,7 @@ static void K_DoHyudoroSteal(player_t *player) prandom = P_RandomFixed(); S_StartSound(player->mo, sfx_s3k92); - if (sink && numplayers > 0) // BEHOLD THE KITCHEN SINK + if (sink && numplayers > 0 && cv_kitchensink.value) // BEHOLD THE KITCHEN SINK { player->kartstuff[k_hyudorotimer] = hyudorotime; player->kartstuff[k_stealingtimer] = stealtime; @@ -2665,15 +2874,31 @@ static void K_DoHyudoroSteal(player_t *player) void K_DoSneaker(player_t *player, boolean doPFlag) { + const fixed_t prevboost = player->kartstuff[k_speedboost]; + if (!player->kartstuff[k_floorboost] || player->kartstuff[k_floorboost] == 3) S_StartSound(player->mo, sfx_cdfm01); + if (!player->kartstuff[k_sneakertimer]) + { + mobj_t *overlay = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_BOOSTFLAME); + P_SetTarget(&overlay->target, player->mo); + overlay->destscale = player->mo->scale; + P_SetScale(overlay, player->mo->scale); + } + player->kartstuff[k_sneakertimer] = sneakertime; + K_SpawnDashDustRelease(player); if (doPFlag) + { player->pflags |= PF_ATTACKDOWN; + K_PlayTauntSound(player->mo); + } - K_PlayTauntSound(player->mo); + K_GetKartBoostPower(player); + if (player->kartstuff[k_speedboost] > prevboost) + player->kartstuff[k_destboostcam] = FRACUNIT; } static void K_DoShrink(player_t *player) @@ -2764,7 +2989,7 @@ void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, boolean mute) mo->momz = FixedMul(vertispeed, vscale); if (!mute) - S_StartSound(mo, sfx_kc2f); + S_StartSound(mo, sfx_kpogos); } void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source) @@ -2934,6 +3159,11 @@ static void K_MoveHeldObjects(player_t *player) cur->angle -= ANGLE_90; cur->angle += FixedAngle(cur->info->speed); + if (cur->extravalue1 < radius) + cur->extravalue1 += FixedMul(P_AproxDistance(cur->extravalue1, radius), FRACUNIT/12); + if (cur->extravalue1 > radius) + cur->extravalue1 = radius; + // If the player is on the ceiling, then flip your items as well. if (player && player->mo->eflags & MFE_VERTICALFLIP) cur->eflags |= MFE_VERTICALFLIP; @@ -2941,7 +3171,7 @@ static void K_MoveHeldObjects(player_t *player) cur->eflags &= ~MFE_VERTICALFLIP; // Shrink your items if the player shrunk too. - P_SetScale(cur, (cur->destscale = player->mo->scale)); + P_SetScale(cur, (cur->destscale = FixedMul(FixedDiv(cur->extravalue1, radius), player->mo->scale))); if (P_MobjFlip(cur) > 0) z = player->mo->z; @@ -2950,8 +3180,8 @@ static void K_MoveHeldObjects(player_t *player) cur->flags |= MF_NOCLIPTHING; // temporarily make them noclip other objects so they can't hit anyone while in the player P_TeleportMove(cur, player->mo->x, player->mo->y, z); - cur->momx = FixedMul(FINECOSINE(cur->angle>>ANGLETOFINESHIFT), radius); - cur->momy = FixedMul(FINESINE(cur->angle>>ANGLETOFINESHIFT), radius); + cur->momx = FixedMul(FINECOSINE(cur->angle>>ANGLETOFINESHIFT), cur->extravalue1); + cur->momy = FixedMul(FINESINE(cur->angle>>ANGLETOFINESHIFT), cur->extravalue1); cur->flags &= ~MF_NOCLIPTHING; if (!P_TryMove(cur, player->mo->x + cur->momx, player->mo->y + cur->momy, true)) P_SlideMove(cur, true); @@ -2968,6 +3198,10 @@ static void K_MoveHeldObjects(player_t *player) z = cur->ceilingz - cur->height; } } + + // Center it during the scale up animation + z += (FixedMul(mobjinfo[cur->type].height, player->mo->scale - cur->scale)>>1) * P_MobjFlip(cur); + cur->z = z; cur->momx = cur->momy = 0; cur->angle += ANGLE_90; @@ -2979,6 +3213,7 @@ static void K_MoveHeldObjects(player_t *player) case MT_BANANA_SHIELD: // Kart trailing items case MT_SSMINE_SHIELD: case MT_FAKESHIELD: + case MT_SINK_SHIELD: { mobj_t *cur = player->mo->hnext; mobj_t *targ = player->mo; @@ -2998,11 +3233,8 @@ static void K_MoveHeldObjects(player_t *player) { const fixed_t radius = FixedHypot(targ->radius, targ->radius) + FixedHypot(cur->radius, cur->radius); angle_t ang; - fixed_t targx; - fixed_t targy; - fixed_t targz; - fixed_t speed; - fixed_t dist = radius/2; + fixed_t targx, targy, targz; + fixed_t speed, dist; cur->flags &= ~MF_NOCLIPTHING; @@ -3012,15 +3244,25 @@ static void K_MoveHeldObjects(player_t *player) continue; } + if (cur->extravalue1 < radius) + cur->extravalue1 += FixedMul(P_AproxDistance(cur->extravalue1, radius), FRACUNIT/12); + if (cur->extravalue1 > radius) + cur->extravalue1 = radius; + if (cur != player->mo->hnext) { targ = cur->hprev; - dist = radius/4; + dist = cur->extravalue1/4; } + else + dist = cur->extravalue1/2; if (!targ || P_MobjWasRemoved(targ)) continue; + // Shrink your items if the player shrunk too. + P_SetScale(cur, (cur->destscale = FixedMul(FixedDiv(cur->extravalue1, radius), player->mo->scale))); + ang = targ->angle; targx = targ->x + P_ReturnThrustX(cur, ang + ANGLE_180, dist); targy = targ->y + P_ReturnThrustY(cur, ang + ANGLE_180, dist); @@ -3057,6 +3299,94 @@ static void K_MoveHeldObjects(player_t *player) } } +player_t *K_FindJawzTarget(mobj_t *actor, player_t *source) +{ + fixed_t best = -1; + player_t *wtarg = NULL; + INT32 i; + + for (i = 0; i < MAXPLAYERS; i++) + { + angle_t thisang; + player_t *player; + + if (!playeringame[i]) + continue; + + player = &players[i]; + + if (player->spectator) + continue; // spectator + + if (!player->mo) + continue; + + if (player->mo->health <= 0) + continue; // dead + + // Don't target yourself, stupid. + if (player == source) + continue; + + // Don't home in on teammates. + if (G_GametypeHasTeams() && source->ctfteam == player->ctfteam) + continue; + + // Invisible, don't bother + if (player->kartstuff[k_hyudorotimer]) + continue; + + // Find the angle, see who's got the best. + thisang = actor->angle - R_PointToAngle2(actor->x, actor->y, player->mo->x, player->mo->y); + if (thisang > ANGLE_180) + thisang = InvAngle(thisang); + + if (thisang > ANGLE_45) // Don't go for people who are behind you + continue; + + // Jawz only go after the person directly ahead of you in race... sort of literally now! + if (G_RaceGametype()) + { + if (player->kartstuff[k_position] >= source->kartstuff[k_position]) // Don't pay attention to people behind you + continue; + if ((best == -1) || (player->kartstuff[k_position] > best)) + { + wtarg = player; + best = player->kartstuff[k_position]; + } + } + else + { + fixed_t thisdist; + fixed_t thisavg; + + if (player->kartstuff[k_bumper] <= 0) + continue; + + // Z pos too high/low + if (abs(player->mo->z - (actor->z + actor->momz)) > RING_DIST/8) + continue; + + thisdist = P_AproxDistance(player->mo->x - (actor->x + actor->momx), player->mo->y - (actor->y + actor->momy)); + + if (thisdist > 2*RING_DIST) // Don't go for people who are too far away + continue; + + thisavg = (AngleFixed(thisang) + thisdist) / 2; + + //CONS_Printf("got avg %d from player # %d\n", thisavg>>FRACBITS, i); + + if ((best == -1) || (thisavg < best)) + { + wtarg = player; + best = thisavg; + } + } + } + + return wtarg; +} + /** \brief Decreases various kart timers and powers per frame. Called in P_PlayerThink in p_user.c \param player player object passed from P_PlayerThink @@ -3067,17 +3397,22 @@ static void K_MoveHeldObjects(player_t *player) void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) { K_UpdateOffroad(player); + K_GetKartBoostPower(player); - // setting players to use the star colormap and spawning afterimages - if (player->kartstuff[k_invincibilitytimer]) + // Speed lines + if ((player->kartstuff[k_sneakertimer] || player->kartstuff[k_driftboost] || player->kartstuff[k_startboost]) && player->speed > 0) { - mobj_t *ghost; - player->mo->colorized = true; - ghost = P_SpawnGhostMobj(player->mo); - ghost->fuse = 4; - ghost->frame |= FF_FULLBRIGHT; + mobj_t *fast = P_SpawnMobj(player->mo->x + (P_RandomRange(-36,36)<mo->y + (P_RandomRange(-36,36)<mo->z + (player->mo->height/2) + (P_RandomRange(-20,20)<angle = R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy); + fast->momx = 3*player->mo->momx/4; + fast->momy = 3*player->mo->momy/4; + fast->momz = 3*player->mo->momz/4; } - else if (player->kartstuff[k_eggmanexplode]) + + if (player->kartstuff[k_eggmanexplode]) // You're gonna diiiiie { const INT32 flashtime = 4<<(player->kartstuff[k_eggmanexplode]/TICRATE); if (player->kartstuff[k_eggmanexplode] == 1 || (player->kartstuff[k_eggmanexplode] % (flashtime/2) != 0)) @@ -3096,7 +3431,15 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) player->mo->color = SKINCOLOR_CRIMSON; } } - else if (player->kartstuff[k_growshrinktimer]) + else if (player->kartstuff[k_invincibilitytimer]) // setting players to use the star colormap and spawning afterimages + { + mobj_t *ghost; + player->mo->colorized = true; + ghost = P_SpawnGhostMobj(player->mo); + ghost->fuse = 4; + ghost->frame |= FF_FULLBRIGHT; + } + else if (player->kartstuff[k_growshrinktimer]) // Ditto, for grow/shrink { if (player->kartstuff[k_growshrinktimer] % 5 == 0) { @@ -3114,6 +3457,36 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) player->mo->colorized = false; } + if (player->kartstuff[k_dashpadcooldown]) // Twinkle Circuit inspired afterimages + { + mobj_t *ghost; + ghost = P_SpawnGhostMobj(player->mo); + ghost->fuse = player->kartstuff[k_dashpadcooldown]+1; + ghost->momx = player->mo->momx / (player->kartstuff[k_dashpadcooldown]+1); + ghost->momy = player->mo->momy / (player->kartstuff[k_dashpadcooldown]+1); + ghost->momz = player->mo->momz / (player->kartstuff[k_dashpadcooldown]+1); + player->kartstuff[k_dashpadcooldown]--; + } + + // DKR style camera for boosting + if (player->kartstuff[k_boostcam] != 0 || player->kartstuff[k_destboostcam] != 0) + { + if (player->kartstuff[k_boostcam] < player->kartstuff[k_destboostcam] + && player->kartstuff[k_destboostcam] != 0) + { + player->kartstuff[k_boostcam] += FRACUNIT/(TICRATE/4); + if (player->kartstuff[k_boostcam] >= player->kartstuff[k_destboostcam]) + player->kartstuff[k_destboostcam] = 0; + } + else + { + player->kartstuff[k_boostcam] -= FRACUNIT/TICRATE; + if (player->kartstuff[k_boostcam] < player->kartstuff[k_destboostcam]) + player->kartstuff[k_boostcam] = player->kartstuff[k_destboostcam] = 0; + } + //CONS_Printf("cam: %d, dest: %d\n", player->kartstuff[k_boostcam], player->kartstuff[k_destboostcam]); + } + if (player->kartstuff[k_spinouttimer]) { if ((P_IsObjectOnGround(player->mo) || player->kartstuff[k_spinouttype] == 1) @@ -3148,7 +3521,11 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) player->kartstuff[k_thunderanim]--;*/ if (player->kartstuff[k_sneakertimer]) + { player->kartstuff[k_sneakertimer]--; + if (player->kartstuff[k_wipeoutslow] > 0 && player->kartstuff[k_wipeoutslow] < wipeoutslowtime+1) + player->kartstuff[k_wipeoutslow] = wipeoutslowtime+1; + } if (player->kartstuff[k_floorboost]) player->kartstuff[k_floorboost]--; @@ -3156,6 +3533,9 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) if (player->kartstuff[k_driftboost]) player->kartstuff[k_driftboost]--; + if (player->kartstuff[k_startboost]) + player->kartstuff[k_startboost]--; + if (player->kartstuff[k_invincibilitytimer]) player->kartstuff[k_invincibilitytimer]--; @@ -3350,6 +3730,39 @@ void K_KartPlayerAfterThink(player_t *player) // Move held objects (Bananas, Orbinaut, etc) K_MoveHeldObjects(player); + + // Jawz reticule (seeking) + if (player->kartstuff[k_itemtype] == KITEM_JAWZ && player->kartstuff[k_itemheld]) + { + player_t *targ = K_FindJawzTarget(player->mo, player); + mobj_t *ret; + + if (!targ) + { + player->kartstuff[k_lastjawztarget] = -1; + return; + } + + ret = P_SpawnMobj(targ->mo->x, targ->mo->y, targ->mo->z, MT_PLAYERRETICULE); + P_SetTarget(&ret->target, targ->mo); + ret->frame |= ((leveltime % 10) / 2); + ret->tics = 1; + ret->color = player->skincolor; + + if (targ-players != player->kartstuff[k_lastjawztarget]) + { + if (P_IsLocalPlayer(player) || P_IsLocalPlayer(targ)) + S_StartSound(NULL, sfx_s3k89); + else + S_StartSound(targ->mo, sfx_s3k89); + + player->kartstuff[k_lastjawztarget] = targ-players; + } + } + else + { + player->kartstuff[k_lastjawztarget] = -1; + } } // Returns false if this player being placed here causes them to collide with any other player @@ -3441,6 +3854,7 @@ static void K_KartDrift(player_t *player, boolean onground) { fixed_t dsone = K_GetKartDriftSparkValue(player); fixed_t dstwo = dsone*2; + fixed_t dsthree = dstwo*2; // Drifting is actually straffing + automatic turning. // Holding the Jump button will enable drifting. @@ -3460,15 +3874,27 @@ static void K_KartDrift(player_t *player, boolean onground) { player->kartstuff[k_driftboost] = 20; S_StartSound(player->mo, sfx_s23c); + //K_SpawnDashDustRelease(player); player->kartstuff[k_driftcharge] = 0; } else if ((player->kartstuff[k_drift] != -5 && player->kartstuff[k_drift] != 5) // || (player->kartstuff[k_drift] >= 1 && player->kartstuff[k_turndir] != 1) || (player->kartstuff[k_drift] <= -1 && player->kartstuff[k_turndir] != -1)) - && player->kartstuff[k_driftcharge] >= dstwo + && player->kartstuff[k_driftcharge] < dsthree && onground) { player->kartstuff[k_driftboost] = 50; S_StartSound(player->mo, sfx_s23c); + //K_SpawnDashDustRelease(player); + player->kartstuff[k_driftcharge] = 0; + } + else if ((player->kartstuff[k_drift] != -5 && player->kartstuff[k_drift] != 5) + // || (player->kartstuff[k_drift] >= 1 && player->kartstuff[k_turndir] != 1) || (player->kartstuff[k_drift] <= -1 && player->kartstuff[k_turndir] != -1)) + && player->kartstuff[k_driftcharge] >= dsthree + && onground) + { + player->kartstuff[k_driftboost] = 125; + S_StartSound(player->mo, sfx_s23c); + //K_SpawnDashDustRelease(player); player->kartstuff[k_driftcharge] = 0; } @@ -3518,9 +3944,9 @@ static void K_KartDrift(player_t *player, boolean onground) player->kartstuff[k_drift] = 5; if (player->cmd.driftturn > 0) // Inward - driftadditive += (player->cmd.driftturn/800)/8; + driftadditive += abs(player->cmd.driftturn)/100; if (player->cmd.driftturn < 0) // Outward - driftadditive -= (player->cmd.driftturn/800)/8; + driftadditive -= abs(player->cmd.driftturn)/75; } else if (player->kartstuff[k_drift] <= -1) // Drifting to the right { @@ -3529,14 +3955,14 @@ static void K_KartDrift(player_t *player, boolean onground) player->kartstuff[k_drift] = -5; if (player->cmd.driftturn < 0) // Inward - driftadditive += (player->cmd.driftturn/800)/4; + driftadditive += abs(player->cmd.driftturn)/100; if (player->cmd.driftturn > 0) // Outward - driftadditive -= (player->cmd.driftturn/800)/4; + driftadditive -= abs(player->cmd.driftturn)/75; } // This spawns the drift sparks - if (player->kartstuff[k_driftcharge] < dsone && player->kartstuff[k_driftcharge] + driftadditive >= dsone) - P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_DRIFT)->target = player->mo; + if (player->kartstuff[k_driftcharge] + driftadditive >= dsone) + K_SpawnDriftSparks(player); player->kartstuff[k_driftcharge] += driftadditive; player->kartstuff[k_driftend] = 0; @@ -3765,7 +4191,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) // Eggman Monitor throwing else if (ATTACK_IS_DOWN && player->kartstuff[k_eggmanheld]) { - K_ThrowKartItem(player, false, MT_FAKEITEM, -1, false); + K_ThrowKartItem(player, false, MT_FAKEITEM, -1, 0); K_PlayTauntSound(player->mo); player->kartstuff[k_eggmanheld] = 0; K_CleanHnextList(player->mo); @@ -3852,7 +4278,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) } else if (ATTACK_IS_DOWN && player->kartstuff[k_itemheld]) // Banana x3 thrown { - K_ThrowKartItem(player, false, MT_BANANA, -1, false); + K_ThrowKartItem(player, false, MT_BANANA, -1, 0); K_PlayTauntSound(player->mo); player->kartstuff[k_itemamount]--; K_UpdateHnextList(player); @@ -3881,8 +4307,6 @@ void K_MoveKartPlayer(player_t *player, boolean onground) if (ATTACK_IS_DOWN && !HOLDING_ITEM && NO_HYUDORO) { angle_t newangle; - fixed_t newx; - fixed_t newy; INT32 moloop; mobj_t *mo = NULL; mobj_t *prev = player->mo; @@ -3894,9 +4318,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) for (moloop = 0; moloop < player->kartstuff[k_itemamount]; moloop++) { newangle = FixedAngle(((360/player->kartstuff[k_itemamount])*moloop)*FRACUNIT) + ANGLE_90; - newx = player->mo->x + P_ReturnThrustX(player->mo, newangle, 64*FRACUNIT); - newy = player->mo->y + P_ReturnThrustY(player->mo, newangle, 64*FRACUNIT); - mo = P_SpawnMobj(newx, newy, player->mo->z, MT_ORBINAUT_SHIELD); + mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_ORBINAUT_SHIELD); if (!mo) { player->kartstuff[k_itemamount] = moloop; @@ -3916,7 +4338,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) } else if (ATTACK_IS_DOWN && player->kartstuff[k_itemheld]) // Orbinaut x3 thrown { - K_ThrowKartItem(player, true, MT_ORBINAUT, 1, false); + K_ThrowKartItem(player, true, MT_ORBINAUT, 1, 0); K_PlayTauntSound(player->mo); player->kartstuff[k_itemamount]--; K_UpdateHnextList(player); @@ -3926,8 +4348,6 @@ void K_MoveKartPlayer(player_t *player, boolean onground) if (ATTACK_IS_DOWN && !HOLDING_ITEM && NO_HYUDORO) { angle_t newangle; - fixed_t newx; - fixed_t newy; INT32 moloop; mobj_t *mo = NULL; mobj_t *prev = player->mo; @@ -3939,9 +4359,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) for (moloop = 0; moloop < player->kartstuff[k_itemamount]; moloop++) { newangle = FixedAngle(((360/player->kartstuff[k_itemamount])*moloop)*FRACUNIT) + ANGLE_90; - newx = player->mo->x + P_ReturnThrustX(player->mo, newangle, 64*FRACUNIT); - newy = player->mo->y + P_ReturnThrustY(player->mo, newangle, 64*FRACUNIT); - mo = P_SpawnMobj(newx, newy, player->mo->z, MT_JAWZ_SHIELD); + mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_JAWZ_SHIELD); if (!mo) { player->kartstuff[k_itemamount] = moloop; @@ -3961,9 +4379,9 @@ void K_MoveKartPlayer(player_t *player, boolean onground) else if (ATTACK_IS_DOWN && HOLDING_ITEM && player->kartstuff[k_itemheld]) // Jawz thrown { if (player->kartstuff[k_throwdir] == 1 || player->kartstuff[k_throwdir] == 0) - K_ThrowKartItem(player, true, MT_JAWZ, 1, false); + K_ThrowKartItem(player, true, MT_JAWZ, 1, 0); else if (player->kartstuff[k_throwdir] == -1) // Throwing backward gives you a dud that doesn't home in - K_ThrowKartItem(player, true, MT_JAWZ_DUD, -1, false); + K_ThrowKartItem(player, true, MT_JAWZ_DUD, -1, 0); K_PlayTauntSound(player->mo); player->kartstuff[k_itemamount]--; K_UpdateHnextList(player); @@ -3988,7 +4406,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) } else if (ATTACK_IS_DOWN && player->kartstuff[k_itemheld]) { - K_ThrowKartItem(player, false, MT_SSMINE, 1, true); + K_ThrowKartItem(player, false, MT_SSMINE, 1, 1); K_PlayTauntSound(player->mo); player->kartstuff[k_itemamount]--; player->kartstuff[k_itemheld] = 0; @@ -3999,7 +4417,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) if (ATTACK_IS_DOWN && !HOLDING_ITEM && NO_HYUDORO) { player->kartstuff[k_itemamount]--; - K_ThrowKartItem(player, true, MT_BALLHOG, 1, false); + K_ThrowKartItem(player, true, MT_BALLHOG, 1, 0); S_StartSound(player->mo, sfx_mario7); K_PlayTauntSound(player->mo); } @@ -4099,10 +4517,27 @@ void K_MoveKartPlayer(player_t *player, boolean onground) case KITEM_KITCHENSINK: if (ATTACK_IS_DOWN && !HOLDING_ITEM && NO_HYUDORO) { - K_ThrowKartItem(player, false, MT_SINK, 1, true); + mobj_t *mo; + player->kartstuff[k_itemheld] = 1; + S_StartSound(player->mo, sfx_s254); + mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_SINK_SHIELD); + if (mo) + { + mo->flags |= MF_NOCLIPTHING; + mo->threshold = 10; + mo->movecount = 1; + mo->movedir = 1; + P_SetTarget(&mo->target, player->mo); + P_SetTarget(&player->mo->hnext, mo); + } + } + else if (ATTACK_IS_DOWN && HOLDING_ITEM && player->kartstuff[k_itemheld]) // Sink thrown + { + K_ThrowKartItem(player, false, MT_SINK, 1, 2); K_PlayTauntSound(player->mo); player->kartstuff[k_itemamount]--; player->kartstuff[k_itemheld] = 0; + K_CleanHnextList(player->mo); } break; case KITEM_SAD: @@ -4191,9 +4626,6 @@ void K_MoveKartPlayer(player_t *player, boolean onground) } } - if (player->kartstuff[k_growshrinktimer] > 1) - player->powers[pw_flashing] = 2; - // Friction if (player->speed > 0 && cmd->forwardmove == 0 && player->mo->friction == 59392) player->mo->friction += 4608; @@ -4291,15 +4723,27 @@ void K_MoveKartPlayer(player_t *player, boolean onground) // Get an instant boost! else if (player->kartstuff[k_boostcharge] <= 50) { - player->kartstuff[k_sneakertimer] = -((21*(player->kartstuff[k_boostcharge]*player->kartstuff[k_boostcharge]))/425)+131; // max time is 70, min time is 7; yay parabooolas - if (!player->kartstuff[k_floorboost] || player->kartstuff[k_floorboost] == 3) + player->kartstuff[k_startboost] = (50-player->kartstuff[k_boostcharge])+20; + + if (player->kartstuff[k_boostcharge] <= 36) { - if (player->kartstuff[k_sneakertimer] >= 70) - S_StartSound(player->mo, sfx_s25f); // Special sound for the perfect start boost! - else if (player->kartstuff[k_sneakertimer] >= sneakertime) - S_StartSound(player->mo, sfx_cdfm01); // Sneaker boost sound for big boost - else - S_StartSound(player->mo, sfx_s23c); // Drift boost sound for small boost + player->kartstuff[k_startboost] = 0; + K_DoSneaker(player, false); + player->kartstuff[k_sneakertimer] = 70; // PERFECT BOOST!! + + if (!player->kartstuff[k_floorboost] || player->kartstuff[k_floorboost] == 3) // Let everyone hear this one + S_StartSound(player->mo, sfx_s25f); + } + else + { + K_SpawnDashDustRelease(player); // already handled for perfect boosts by K_DoSneaker + if ((!player->kartstuff[k_floorboost] || player->kartstuff[k_floorboost] == 3) && P_IsLocalPlayer(player)) + { + if (player->kartstuff[k_boostcharge] <= 40) + S_StartSound(player->mo, sfx_cdfm01); // You were almost there! + else + S_StartSound(player->mo, sfx_s23c); // Nope, better luck next time. + } } } // You overcharged your engine? Those things are expensive!!! @@ -4317,7 +4761,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) void K_CalculateBattleWanted(void) { - UINT8 numingame = 0, numwanted = 0; + UINT8 numingame = 0, numplaying = 0, numwanted = 0; SINT8 bestbumperplayer = -1, bestbumper = -1; SINT8 camppos[MAXPLAYERS]; // who is the biggest camper UINT8 ties = 0, nextcamppos = 0; @@ -4346,6 +4790,8 @@ void K_CalculateBattleWanted(void) if (players[i].exiting) // We're done, don't calculate. return; + numplaying++; + if (players[i].kartstuff[k_bumper] <= 0) // Not alive, so don't do anything else continue; @@ -4381,7 +4827,7 @@ void K_CalculateBattleWanted(void) camppos[position] = i; } - if (numingame <= 2) + if (numplaying <= 2 || (numingame <= 2 && bestbumper == 1)) // In 1v1s then there's no need for WANTED. In bigger netgames, don't show anyone as WANTED when they're equally matched. numwanted = 0; else numwanted = min(4, 1 + ((numingame-2) / 4)); @@ -4508,6 +4954,8 @@ void K_CheckSpectateStatus(void) return; if (numingame < 2 || leveltime < starttime || mapreset) // Allow if the match hasn't started yet continue; + if (leveltime > 20*TICRATE) // DON'T allow if the match is 20 seconds in + return; if (G_RaceGametype() && players[i].laps) // DON'T allow if the race is at 2 laps return; continue; @@ -4824,6 +5272,56 @@ void K_LoadKartHUDGraphics(void) kp_lapanim_emblem = (patch_t *) W_CachePatchName("K_LAPE00", PU_HUDGFX); } +// For the item toggle menu +const char *K_GetItemPatch(UINT8 item, boolean small) +{ + switch (item) + { + case KITEM_SNEAKER: + case KRITEM_TRIPLESNEAKER: + return (small ? "K_ISSHOE" : "K_ITSHOE"); + case KITEM_ROCKETSNEAKER: + return (small ? "K_ISRSHE" : "K_ITRSHE"); + case KITEM_INVINCIBILITY: + return (small ? "K_ISINV1" : "K_ITINV1"); + case KITEM_BANANA: + case KRITEM_TRIPLEBANANA: + case KRITEM_TENFOLDBANANA: + return (small ? "K_ISBANA" : "K_ITBANA"); + case KITEM_EGGMAN: + return (small ? "K_ISEGGM" : "K_ITEGGM"); + case KITEM_ORBINAUT: + return (small ? "K_ISORBN" : "K_ITORB1"); + case KITEM_JAWZ: + case KRITEM_DUALJAWZ: + return (small ? "K_ISJAWZ" : "K_ITJAWZ"); + case KITEM_MINE: + return (small ? "K_ISMINE" : "K_ITMINE"); + case KITEM_BALLHOG: + return (small ? "K_ISBHOG" : "K_ITBHOG"); + case KITEM_SPB: + return (small ? "K_ISSPB" : "K_ITSPB"); + case KITEM_GROW: + return (small ? "K_ISGROW" : "K_ITGROW"); + case KITEM_SHRINK: + return (small ? "K_ISSHRK" : "K_ITSHRK"); + case KITEM_THUNDERSHIELD: + return (small ? "K_ISTHNS" : "K_ITTHNS"); + case KITEM_HYUDORO: + return (small ? "K_ISHYUD" : "K_ITHYUD"); + case KITEM_POGOSPRING: + return (small ? "K_ISPOGO" : "K_ITPOGO"); + case KITEM_KITCHENSINK: + return (small ? "K_ISSINK" : "K_ITSINK"); + case KRITEM_TRIPLEORBINAUT: + return (small ? "K_ISORBN" : "K_ITORB3"); + case KRITEM_QUADORBINAUT: + return (small ? "K_ISORBN" : "K_ITORB4"); + default: + return (small ? "K_ISSAD" : "K_ITSAD"); + } +} + //} INT32 ITEM_X, ITEM_Y; // Item Window @@ -5113,6 +5611,9 @@ static void K_drawKartItem(void) case KITEM_SAD: localpatch = kp_sadface[offset]; break; default: return; } + + if (stplyr->kartstuff[k_itemheld] && !(leveltime & 1)) + localpatch = kp_nodraw; } } @@ -6190,6 +6691,7 @@ static void K_drawKartFirstPerson(void) { fixed_t dsone = K_GetKartDriftSparkValue(stplyr); fixed_t dstwo = dsone*2; + fixed_t dsthree = dstwo*2; #ifndef DONTLIKETOASTERSFPTWEAKS { @@ -6228,8 +6730,10 @@ static void K_drawKartFirstPerson(void) } // drift sparks! - if ((leveltime & 1) && (stplyr->kartstuff[k_driftcharge] >= dstwo)) - colmap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_TANGERINE, 0); + if ((leveltime & 1) && (stplyr->kartstuff[k_driftcharge] >= dsthree)) + colmap = R_GetTranslationColormap(TC_RAINBOW, (UINT8)(1 + (leveltime % (MAXSKINCOLORS-1))), 0); + else if ((leveltime & 1) && (stplyr->kartstuff[k_driftcharge] >= dstwo)) + colmap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_KETCHUP, 0); else if ((leveltime & 1) && (stplyr->kartstuff[k_driftcharge] >= dsone)) colmap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_SAPPHIRE, 0); else @@ -6415,8 +6919,101 @@ void K_drawKartFreePlay(UINT32 flashtime) LAPS_Y+3, V_SNAPTOBOTTOM|V_SNAPTORIGHT, "FREE PLAY"); } +static void K_drawDistributionDebugger(void) +{ + patch_t *items[NUMKARTRESULTS] = { + kp_sadface[1], + kp_sneaker[1], + kp_rocketsneaker[1], + kp_invincibility[7], + kp_banana[1], + kp_eggman[1], + kp_orbinaut[4], + kp_jawz[1], + kp_mine[1], + kp_ballhog[1], + kp_selfpropelledbomb[1], + kp_grow[1], + kp_shrink[1], + kp_thundershield[1], + kp_hyudoro[1], + kp_pogospring[1], + kp_kitchensink[1], + + kp_sneaker[1], + kp_banana[1], + kp_banana[1], + kp_orbinaut[4], + kp_orbinaut[4], + kp_jawz[1] + }; + INT32 useodds = 0; + INT32 pingame = 0, bestbumper = 0; + INT32 i; + INT32 x = -9, y = -9; + + if (stplyr != &players[displayplayer]) // only for p1 + return; + + // The only code duplication from the Kart, just to avoid the actual item function from calculating pingame twice + for (i = 0; i < MAXPLAYERS; i++) + { + if (!playeringame[i] || players[i].spectator) + continue; + pingame++; + if (players[i].kartstuff[k_bumper] > bestbumper) + bestbumper = players[i].kartstuff[k_bumper]; + } + + useodds = K_FindUseodds(stplyr, 0, pingame, bestbumper); + + for (i = 1; i < NUMKARTRESULTS; i++) + { + const INT32 itemodds = K_KartGetItemOdds(useodds, i, 0); + if (itemodds <= 0) + continue; + + V_DrawScaledPatch(x, y, V_HUDTRANS|V_SNAPTOTOP, items[i]); + V_DrawThinString(x+11, y+31, V_HUDTRANS|V_SNAPTOTOP, va("%d", itemodds)); + + // Display amount for multi-items + if (i >= NUMKARTITEMS) + { + INT32 amount; + switch (i) + { + case KRITEM_TENFOLDBANANA: + amount = 10; + break; + case KRITEM_QUADORBINAUT: + amount = 4; + break; + case KRITEM_DUALJAWZ: + amount = 2; + break; + default: + amount = 3; + break; + } + V_DrawString(x+24, y+31, V_ALLOWLOWERCASE|V_HUDTRANS|V_SNAPTOTOP, va("x%d", amount)); + } + + x += 32; + if (x >= 297) + { + x = -9; + y += 32; + } + } + + V_DrawString(0, 0, V_HUDTRANS|V_SNAPTOTOP, va("USEODDS %d", useodds)); +} + static void K_drawCheckpointDebugger(void) { + if (stplyr != &players[displayplayer]) // only for p1 + return; + if ((numstarposts/2 + stplyr->starpostnum) >= numstarposts) V_DrawString(8, 184, 0, va("Checkpoint: %d / %d (Can finish)", stplyr->starpostnum, numstarposts)); else @@ -6563,6 +7160,9 @@ void K_drawKartHUD(void) if (isfreeplay && !stplyr->spectator && timeinmap > 113) K_drawKartFreePlay(leveltime); + if (cv_kartdebugdistribution.value) + K_drawDistributionDebugger(); + if (cv_kartdebugcheckpoint.value) K_drawCheckpointDebugger(); } diff --git a/src/k_kart.h b/src/k_kart.h index 7c7d66fc..c0cb63d5 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -42,6 +42,7 @@ void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source); void K_CleanHnextList(mobj_t *work); void K_UpdateHnextList(player_t *player); void K_RepairOrbitChain(mobj_t *orbit); +player_t *K_FindJawzTarget(mobj_t *actor, player_t *source); boolean K_CheckPlayersRespawnColliding(INT32 playernum, fixed_t x, fixed_t y); INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue); fixed_t K_GetKartDriftSparkValue(player_t *player); @@ -56,6 +57,7 @@ void K_CalculateBattleWanted(void); void K_CheckBumpers(void); void K_CheckSpectateStatus(void); +const char *K_GetItemPatch(UINT8 item, boolean small); INT32 K_calcSplitFlags(INT32 snapflags); void K_LoadKartHUDGraphics(void); fixed_t K_FindCheckX(fixed_t px, fixed_t py, angle_t ang, fixed_t mx, fixed_t my); diff --git a/src/m_menu.c b/src/m_menu.c index 536edd20..8cf6a88c 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -54,6 +54,7 @@ #include "st_stuff.h" #include "i_sound.h" #include "k_kart.h" // SRB2kart +#include "d_player.h" // KITEM_ constants // Condition Sets #include "m_cond.h" @@ -223,6 +224,7 @@ menu_t SR_MainDef, SR_UnlockChecklistDef; // Misc. Main Menu static void M_SinglePlayerMenu(INT32 choice); static void M_Options(INT32 choice); +static void M_Manual(INT32 choice); static void M_SelectableClearMenus(INT32 choice); static void M_Retry(INT32 choice); static void M_EndGame(INT32 choice); @@ -340,7 +342,7 @@ static void M_DrawControl(void); static void M_DrawVideoMenu(void); static void M_DrawHUDOptions(void); static void M_DrawVideoMode(void); -//static void M_DrawMonitorToggles(void); +static void M_DrawMonitorToggles(void); #ifdef HWRENDER static void M_OGL_DrawFogMenu(void); static void M_OGL_DrawColorMenu(void); @@ -371,6 +373,7 @@ static void M_HandleSetupMultiPlayer(INT32 choice); static void M_HandleFogColor(INT32 choice); #endif static void M_HandleVideoMode(INT32 choice); +static void M_HandleMonitorToggles(INT32 choice); // Consvar onchange functions static void Nextmap_OnChange(void); @@ -623,11 +626,19 @@ static menuitem_t MISC_ChangeLevelMenu[] = static menuitem_t MISC_HelpMenu[] = { - {IT_KEYHANDLER | IT_NOTHING, NULL, "HELPN01", M_HandleImageDef, 0}, - {IT_KEYHANDLER | IT_NOTHING, NULL, "HELPN02", M_HandleImageDef, 0}, - {IT_KEYHANDLER | IT_NOTHING, NULL, "HELPN03", M_HandleImageDef, 0}, - {IT_KEYHANDLER | IT_NOTHING, NULL, "HELPM01", M_HandleImageDef, 0}, - {IT_KEYHANDLER | IT_NOTHING, NULL, "HELPM02", M_HandleImageDef, 0}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL00", M_HandleImageDef, 0}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL01", M_HandleImageDef, 1}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL02", M_HandleImageDef, 1}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL03", M_HandleImageDef, 1}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL04", M_HandleImageDef, 1}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL05", M_HandleImageDef, 1}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL06", M_HandleImageDef, 1}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL07", M_HandleImageDef, 1}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL08", M_HandleImageDef, 1}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL09", M_HandleImageDef, 1}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL10", M_HandleImageDef, 1}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL11", M_HandleImageDef, 1}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL12", M_HandleImageDef, 0}, }; // -------------------------------- @@ -1055,8 +1066,9 @@ static menuitem_t OP_MainMenu[] = {IT_SUBMENU|IT_STRING, NULL, "Gameplay Options...", &OP_GameOptionsDef, 90}, {IT_SUBMENU|IT_STRING, NULL, "Server Options...", &OP_ServerOptionsDef, 100}, - {IT_CALL|IT_STRING, NULL, "Play Credits", M_Credits, 120}, - {IT_SUBMENU|IT_STRING, NULL, "Erase Data...", &OP_EraseDataDef, 130}, + {IT_CALL|IT_STRING, NULL, "Tricks & Secrets (F1)", M_Manual, 120}, + {IT_CALL|IT_STRING, NULL, "Play Credits", M_Credits, 130}, + {IT_SUBMENU|IT_STRING, NULL, "Erase Data...", &OP_EraseDataDef, 140}, }; static menuitem_t OP_ControlsMenu[] = @@ -1090,12 +1102,13 @@ static menuitem_t OP_MoveControlsMenu[] = {IT_CONTROL, NULL, "Talk key", M_ChangeControl, gc_talkkey }, //{IT_CONTROL, NULL, "Team-Talk key", M_ChangeControl, gc_teamkey }, {IT_CONTROL, NULL, "Rankings/Scores", M_ChangeControl, gc_scores }, + {IT_CONTROL, NULL, "Open/Close Menu (ESC)", M_ChangeControl, gc_systemmenu}, {IT_CONTROL, NULL, "Pause", M_ChangeControl, gc_pause }, {IT_CONTROL, NULL, "Console", M_ChangeControl, gc_console }, - {IT_SUBMENU | IT_STRING, NULL, "Gamepad Options...", &OP_Joystick1Def, 112}, - {IT_SUBMENU | IT_STRING, NULL, "Spectator Controls...", &OP_SpectateControlsDef, 120}, - {IT_SUBMENU | IT_STRING, NULL, "Custom Lua Actions...", &OP_CustomControlsDef, 128}, + {IT_SUBMENU | IT_STRING, NULL, "Gamepad Options...", &OP_Joystick1Def, 120}, + {IT_SUBMENU | IT_STRING, NULL, "Spectator Controls...", &OP_SpectateControlsDef, 128}, + {IT_SUBMENU | IT_STRING, NULL, "Custom Lua Actions...", &OP_CustomControlsDef, 136}, }; static menuitem_t OP_SpectateControlsMenu[] = @@ -1518,29 +1531,38 @@ static menuitem_t OP_ServerOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "Karma Comeback", &cv_kartcomeback, 66}, };*/ +#define ITEMTOGGLEBOTTOMRIGHT + static menuitem_t OP_MonitorToggleMenu[] = { - // Printing handled by drawing function + // Mostly handled by the drawing function. // Instead of using this for dumb monitors, lets use the new item bools we have :V - {IT_STRING | IT_CVAR, NULL, "Sneakers", &cv_sneaker, 10}, - {IT_STRING | IT_CVAR, NULL, "Sneakers x3", &cv_triplesneaker, 18}, - {IT_STRING | IT_CVAR, NULL, "Rocket Sneakers", &cv_rocketsneaker, 26}, - {IT_STRING | IT_CVAR, NULL, "Invinciblity", &cv_invincibility, 34}, - {IT_STRING | IT_CVAR, NULL, "Bananas", &cv_banana, 42}, - {IT_STRING | IT_CVAR, NULL, "Bananas x3", &cv_triplebanana, 50}, - {IT_STRING | IT_CVAR, NULL, "Eggman Monitors", &cv_eggmanmonitor, 58}, - {IT_STRING | IT_CVAR, NULL, "Orbinauts", &cv_orbinaut, 66}, - {IT_STRING | IT_CVAR, NULL, "Orbinauts x3", &cv_tripleorbinaut, 74}, - {IT_STRING | IT_CVAR, NULL, "Jawz", &cv_jawz, 82}, - {IT_STRING | IT_CVAR, NULL, "Jawz x2", &cv_dualjawz, 90}, - {IT_STRING | IT_CVAR, NULL, "Mines", &cv_mine, 98}, - {IT_STRING | IT_CVAR, NULL, "Ballhogs", &cv_ballhog, 106}, - {IT_STRING | IT_CVAR, NULL, "Self-Propelled Bombs",&cv_selfpropelledbomb,114}, - {IT_STRING | IT_CVAR, NULL, "Grow", &cv_grow, 122}, - {IT_STRING | IT_CVAR, NULL, "Shrink", &cv_shrink, 130}, - {IT_STRING | IT_CVAR, NULL, "Thunder Shields", &cv_thundershield, 138}, - {IT_STRING | IT_CVAR, NULL, "Hyudoros", &cv_hyudoro, 146}, - {IT_STRING | IT_CVAR, NULL, "Pogo Springs", &cv_pogospring, 154}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "Sneakers", M_HandleMonitorToggles, KITEM_SNEAKER}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "Sneakers x3", M_HandleMonitorToggles, KRITEM_TRIPLESNEAKER}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "Rocket Sneakers", M_HandleMonitorToggles, KITEM_ROCKETSNEAKER}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "Toggle All", M_HandleMonitorToggles, 0}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "Bananas", M_HandleMonitorToggles, KITEM_BANANA}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "Bananas x3", M_HandleMonitorToggles, KRITEM_TRIPLEBANANA}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "Bananas x10", M_HandleMonitorToggles, KRITEM_TENFOLDBANANA}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "Eggman Monitors", M_HandleMonitorToggles, KITEM_EGGMAN}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "Orbinauts", M_HandleMonitorToggles, KITEM_ORBINAUT}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "Orbinauts x3", M_HandleMonitorToggles, KRITEM_TRIPLEORBINAUT}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "Orbinauts x4", M_HandleMonitorToggles, KRITEM_QUADORBINAUT}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "Mines", M_HandleMonitorToggles, KITEM_MINE}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "Jawz", M_HandleMonitorToggles, KITEM_JAWZ}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "Jawz x2", M_HandleMonitorToggles, KRITEM_DUALJAWZ}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "Ballhogs", M_HandleMonitorToggles, KITEM_BALLHOG}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "Self-Propelled Bombs", M_HandleMonitorToggles, KITEM_SPB}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "Invinciblity", M_HandleMonitorToggles, KITEM_INVINCIBILITY}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "Grow", M_HandleMonitorToggles, KITEM_GROW}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "Shrink", M_HandleMonitorToggles, KITEM_SHRINK}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "Thunder Shields", M_HandleMonitorToggles, KITEM_THUNDERSHIELD}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "Hyudoros", M_HandleMonitorToggles, KITEM_HYUDORO}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "Pogo Springs", M_HandleMonitorToggles, KITEM_POGOSPRING}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "Kitchen Sinks", M_HandleMonitorToggles, KITEM_KITCHENSINK}, +#ifdef ITEMTOGGLEBOTTOMRIGHT + {IT_KEYHANDLER | IT_NOTHING, NULL, "---", M_HandleMonitorToggles, 255}, +#endif }; // ========================================================================== @@ -1962,18 +1984,17 @@ menu_t OP_ServerOptionsDef = DEFAULTMENUSTYLE("M_SERVER", OP_ServerOptionsMenu, //menu_t OP_NetgameOptionsDef = DEFAULTMENUSTYLE("M_SERVER", OP_NetgameOptionsMenu, &OP_ServerOptionsDef, 30, 30); //menu_t OP_GametypeOptionsDef = DEFAULTMENUSTYLE("M_SERVER", OP_GametypeOptionsMenu, &OP_ServerOptionsDef, 30, 30); -menu_t OP_MonitorToggleDef = DEFAULTMENUSTYLE("M_GAME", OP_MonitorToggleMenu, &OP_GameOptionsDef, 30, 30); -/*menu_t OP_MonitorToggleDef = +menu_t OP_MonitorToggleDef = { - "M_SERVER", + "M_GAME", sizeof (OP_MonitorToggleMenu)/sizeof (menuitem_t), - &OP_ServerOptionsDef, + &OP_GameOptionsDef, OP_MonitorToggleMenu, M_DrawMonitorToggles, - 30, 30, + 47, 30, 0, NULL -};*/ +}; #ifdef HWRENDER menu_t OP_OpenGLOptionsDef = DEFAULTMENUSTYLE("M_VIDEO", OP_OpenGLOptionsMenu, &OP_VideoOptionsDef, 30, 30); @@ -2463,18 +2484,21 @@ boolean M_Responder(event_t *ev) if (ch == -1) return false; + else if (ch == gamecontrol[gc_systemmenu][0]) // allow remappable ESC key + ch = KEY_ESCAPE; // F-Keys if (!menuactive) { noFurtherInput = true; + switch (ch) { case KEY_F1: // Help key if (modeattacking) return true; M_StartControlPanel(); - currentMenu = &MISC_HelpDef; + M_Manual(INT32_MAX); itemOn = 0; return true; @@ -2729,10 +2753,9 @@ boolean M_Responder(event_t *ev) } // Why _does_ backspace go back anyway? - // Sal: Because it supports gamepads better. And still makes sense for keyboard. - currentMenu->lastOn = itemOn; - if (currentMenu->prevMenu) - M_SetupNextMenu(currentMenu->prevMenu); + //currentMenu->lastOn = itemOn; + //if (currentMenu->prevMenu) + // M_SetupNextMenu(currentMenu->prevMenu); return false; default: @@ -4166,6 +4189,9 @@ static void M_StopMessage(INT32 choice) // You can even put multiple images in one menu! static void M_DrawImageDef(void) { + // this is probably what the V_DrawFixedPatch screen-fill bullshit was for, right + //V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); -- never mind, screen fade + // Grr. Need to autodetect for pic_ts. pic_t *pictest = (pic_t *)W_CachePatchName(currentMenu->menuitems[itemOn].text,PU_CACHE); if (!pictest->zero) @@ -4179,41 +4205,59 @@ static void M_DrawImageDef(void) V_DrawSmallScaledPatch(0,0,0,patch); } - if (currentMenu->numitems > 1) - V_DrawString(0,192,V_TRANSLUCENT, va("PAGE %d of %hd", itemOn+1, currentMenu->numitems)); + if (currentMenu->menuitems[itemOn].alphaKey) + { + V_DrawString(2,BASEVIDHEIGHT-10, V_YELLOWMAP, va("%d", (itemOn<<1)-1)); // intentionally not highlightflags, unlike below + V_DrawRightAlignedString(BASEVIDWIDTH-2,BASEVIDHEIGHT-10, V_YELLOWMAP, va("%d", itemOn<<1)); // ditto + } + else + { + INT32 x = ((itemOn ? 3 : 1)*BASEVIDWIDTH)>>2, y = (BASEVIDHEIGHT>>1) - 4; + V_DrawCenteredString(x, y-10, highlightflags, "USE ARROW KEYS"); + V_DrawCharacter(x - 10 - (skullAnimCounter/5), y, + '\x1C' | highlightflags, false); // left arrow + V_DrawCharacter(x + 2 + (skullAnimCounter/5), y, + '\x1D' | highlightflags, false); // right arrow + V_DrawCenteredString(x, y+10, highlightflags, "TO LEAF THROUGH"); + } } // Handles the ImageDefs. Just a specialized function that // uses left and right movement. static void M_HandleImageDef(INT32 choice) { + boolean exitmenu = false; + switch (choice) { case KEY_RIGHTARROW: - if (currentMenu->numitems == 1) - break; - - S_StartSound(NULL, sfx_menu1); if (itemOn >= (INT16)(currentMenu->numitems-1)) - itemOn = 0; - else itemOn++; + break; + S_StartSound(NULL, sfx_menu1); + itemOn++; break; case KEY_LEFTARROW: - if (currentMenu->numitems == 1) + if (!itemOn) break; S_StartSound(NULL, sfx_menu1); - if (!itemOn) - itemOn = currentMenu->numitems - 1; - else itemOn--; + itemOn--; break; case KEY_ESCAPE: case KEY_ENTER: - M_ClearMenus(true); + exitmenu = true; break; } + + if (exitmenu) + { + if (currentMenu->prevMenu) + M_SetupNextMenu(currentMenu->prevMenu); + else + M_ClearMenus(true); + } } // ====================== @@ -4322,8 +4366,8 @@ static void M_Options(INT32 choice) OP_MainMenu[5].status = OP_MainMenu[6].status = (Playing() && !(server || IsPlayerAdmin(consoleplayer))) ? (IT_GRAYEDOUT) : (IT_STRING|IT_SUBMENU); // if the player is playing _at all_, disable the erase data & credits options - OP_MainMenu[7].status = (Playing()) ? (IT_GRAYEDOUT) : (IT_STRING|IT_CALL); - OP_MainMenu[8].status = (Playing()) ? (IT_GRAYEDOUT) : (IT_STRING|IT_SUBMENU); + OP_MainMenu[8].status = (Playing()) ? (IT_GRAYEDOUT) : (IT_STRING|IT_CALL); + OP_MainMenu[9].status = (Playing()) ? (IT_GRAYEDOUT) : (IT_STRING|IT_SUBMENU); OP_GameOptionsMenu[3].status = (M_SecretUnlocked(SECRET_ENCORE)) ? (IT_CVAR|IT_STRING) : IT_SECRET; // cv_kartencore @@ -4332,6 +4376,14 @@ static void M_Options(INT32 choice) M_SetupNextMenu(&OP_MainDef); } +static void M_Manual(INT32 choice) +{ + (void)choice; + + MISC_HelpDef.prevMenu = (choice == INT32_MAX ? NULL : currentMenu); + M_SetupNextMenu(&MISC_HelpDef); +} + static void M_RetryResponse(INT32 ch) { if (ch != 'y' && ch != KEY_ENTER) @@ -5520,7 +5572,8 @@ static void M_DrawStatsMaps(int location) boolean dotopname = true, dobottomarrow = (location < statsMax); if (location) - V_DrawCharacter(10, y-(skullAnimCounter/5), '\x1A' | highlightflags, false); + V_DrawCharacter(10, y-(skullAnimCounter/5), + '\x1A' | highlightflags, false); // up arrow while (statsMapList[++i] != -1) { @@ -5602,7 +5655,8 @@ static void M_DrawStatsMaps(int location) } bottomarrow: if (dobottomarrow) - V_DrawCharacter(10, y-8 + (skullAnimCounter/5), '\x1B' | highlightflags, false); + V_DrawCharacter(10, y-8 + (skullAnimCounter/5), + '\x1B' | highlightflags, false); // up arrow } static void M_DrawLevelStats(void) @@ -7190,6 +7244,8 @@ static void M_DrawSetupMultiPlayerMenu(void) spritedef_t *sprdef; spriteframe_t *sprframe; patch_t *statbg = W_CachePatchName("K_STATBG", PU_CACHE); + patch_t *statlr = W_CachePatchName("K_STATLR", PU_CACHE); + patch_t *statud = W_CachePatchName("K_STATUD", PU_CACHE); patch_t *statdot = W_CachePatchName("K_SDOT0", PU_CACHE); patch_t *patch; UINT8 frame; @@ -7197,10 +7253,14 @@ static void M_DrawSetupMultiPlayerMenu(void) UINT8 weight; UINT8 i; const UINT8 *flashcol = V_GetStringColormap(highlightflags); + INT32 statx, staty; mx = MP_PlayerSetupDef.x; my = MP_PlayerSetupDef.y; + statx = (BASEVIDWIDTH - mx - 118); + staty = (my+62); + // use generic drawer for cursor, items and title M_DrawGenericMenu(); @@ -7238,7 +7298,16 @@ static void M_DrawSetupMultiPlayerMenu(void) } // SRB2Kart: draw the stat backer - V_DrawFixedPatch((BASEVIDWIDTH - mx - 117)<x, y = currentMenu->y+(spacing/4); + INT32 onx = 0, ony = 0; consvar_t *cv; - boolean cheating = false; + INT32 i, translucent, drawnum; - M_DrawGenericMenu(); + M_DrawMenuTitle(); - // Assumes all are cvar type. - for (i = 0; i < currentMenu->numitems; ++i) + // Find the available space around column + leftdraw = rightdraw = column; + totaldraw = 0; + for (i = 0; (totaldraw < edges*2 && i < edges*4); i++) { - cv = (consvar_t *)currentMenu->menuitems[i].itemaction; - sum += cv->value; - - if (!CV_IsSetToDefault(cv)) - cheating = true; + if (rightdraw+1 < (currentMenu->numitems/height)+1) + { + rightdraw++; + totaldraw++; + } + if (leftdraw-1 >= 0) + { + leftdraw--; + totaldraw++; + } } - for (i = 0; i < currentMenu->numitems; ++i) + for (i = leftdraw; i <= rightdraw; i++) { - cv = (consvar_t *)currentMenu->menuitems[i].itemaction; - y = currentMenu->y + currentMenu->menuitems[i].alphaKey; + INT32 j; - M_DrawSlider(currentMenu->x + 20, y, cv, (i == itemOn)); + for (j = 0; j < height; j++) + { + const INT32 thisitem = (i*height)+j; + INT32 drawnum = 0; - if (!cv->value) - V_DrawRightAlignedString(312, y, V_OLDSPACING|((i == itemOn) ? highlightflags : 0), "None"); + if (thisitem >= currentMenu->numitems) + continue; + + if (thisitem == itemOn) + { + onx = x; + ony = y; + y += spacing; + continue; + } + +#ifdef ITEMTOGGLEBOTTOMRIGHT + if (currentMenu->menuitems[thisitem].alphaKey == 255) + { + V_DrawScaledPatch(x, y, V_TRANSLUCENT, W_CachePatchName("K_ISBG", PU_CACHE)); + continue; + } +#endif + if (currentMenu->menuitems[thisitem].alphaKey == 0) + { + V_DrawScaledPatch(x, y, 0, W_CachePatchName("K_ISBG", PU_CACHE)); + V_DrawScaledPatch(x, y, 0, W_CachePatchName("K_ISTOGL", PU_CACHE)); + continue; + } + + cv = kartitemcvs[currentMenu->menuitems[thisitem].alphaKey-1]; + translucent = (cv->value ? 0 : V_TRANSLUCENT); + + switch (currentMenu->menuitems[thisitem].alphaKey) + { + case KRITEM_DUALJAWZ: + drawnum = 2; + break; + case KRITEM_TRIPLESNEAKER: + case KRITEM_TRIPLEBANANA: + case KRITEM_TRIPLEORBINAUT: + drawnum = 3; + break; + case KRITEM_QUADORBINAUT: + drawnum = 4; + break; + case KRITEM_TENFOLDBANANA: + drawnum = 10; + break; + default: + drawnum = 0; + break; + } + + if (cv->value) + V_DrawScaledPatch(x, y, 0, W_CachePatchName("K_ISBG", PU_CACHE)); + else + V_DrawScaledPatch(x, y, 0, W_CachePatchName("K_ISBGD", PU_CACHE)); + + if (drawnum != 0) + { + V_DrawScaledPatch(x, y, 0, W_CachePatchName("K_ISMUL", PU_CACHE)); + V_DrawScaledPatch(x, y, translucent, W_CachePatchName(K_GetItemPatch(currentMenu->menuitems[thisitem].alphaKey, true), PU_CACHE)); + V_DrawString(x+24, y+31, V_ALLOWLOWERCASE|translucent, va("x%d", drawnum)); + } + else + V_DrawScaledPatch(x, y, translucent, W_CachePatchName(K_GetItemPatch(currentMenu->menuitems[thisitem].alphaKey, true), PU_CACHE)); + + y += spacing; + } + + x += spacing; + y = currentMenu->y+(spacing/4); + } + + { +#ifdef ITEMTOGGLEBOTTOMRIGHT + if (currentMenu->menuitems[itemOn].alphaKey == 255) + V_DrawScaledPatch(onx-1, ony-2, V_TRANSLUCENT, W_CachePatchName("K_ITBG", PU_CACHE)); else - V_DrawRightAlignedString(312, y, V_OLDSPACING|((i == itemOn) ? highlightflags : 0), va("%3d%%", (cv->value*100)/sum)); +#endif + if (currentMenu->menuitems[itemOn].alphaKey == 0) + { + V_DrawScaledPatch(onx-1, ony-2, 0, W_CachePatchName("K_ITBG", PU_CACHE)); + V_DrawScaledPatch(onx-1, ony-2, 0, W_CachePatchName("K_ITTOGL", PU_CACHE)); + } + else + { + cv = kartitemcvs[currentMenu->menuitems[itemOn].alphaKey-1]; + translucent = (cv->value ? 0 : V_TRANSLUCENT); + + switch (currentMenu->menuitems[itemOn].alphaKey) + { + case KRITEM_DUALJAWZ: + drawnum = 2; + break; + case KRITEM_TRIPLESNEAKER: + case KRITEM_TRIPLEBANANA: + drawnum = 3; + break; + case KRITEM_TENFOLDBANANA: + drawnum = 10; + break; + default: + drawnum = 0; + break; + } + + if (cv->value) + V_DrawScaledPatch(onx-1, ony-2, 0, W_CachePatchName("K_ITBG", PU_CACHE)); + else + V_DrawScaledPatch(onx-1, ony-2, 0, W_CachePatchName("K_ITBGD", PU_CACHE)); + + if (drawnum != 0) + { + V_DrawScaledPatch(onx-1, ony-2, 0, W_CachePatchName("K_ITMUL", PU_CACHE)); + V_DrawScaledPatch(onx-1, ony-2, translucent, W_CachePatchName(K_GetItemPatch(currentMenu->menuitems[itemOn].alphaKey, false), PU_CACHE)); + V_DrawScaledPatch(onx+27, ony+39, translucent, W_CachePatchName("K_ITX", PU_CACHE)); + V_DrawKartString(onx+37, ony+34, translucent, va("%d", drawnum)); + } + else + V_DrawScaledPatch(onx-1, ony-2, translucent, W_CachePatchName(K_GetItemPatch(currentMenu->menuitems[itemOn].alphaKey, false), PU_CACHE)); + } } - if (cheating) - V_DrawCenteredString(BASEVIDWIDTH/2, currentMenu->y, warningflags, "* MODIFIED, CHEATS ENABLED *"); -}*/ + V_DrawCenteredString(BASEVIDWIDTH/2, currentMenu->y, highlightflags, va("* %s *", currentMenu->menuitems[itemOn].text)); +} + +static void M_HandleMonitorToggles(INT32 choice) +{ + const INT32 width = 6, height = 4; + INT32 column = itemOn/height, row = itemOn%height; + INT16 next; + UINT8 i; + boolean exitmenu = false; + + switch (choice) + { + case KEY_RIGHTARROW: + S_StartSound(NULL, sfx_menu1); + column++; + if (((column*height)+row) >= currentMenu->numitems) + column = 0; + next = min(((column*height)+row), currentMenu->numitems-1); + itemOn = next; + break; + + case KEY_LEFTARROW: + S_StartSound(NULL, sfx_menu1); + column--; + if (column < 0) + column = width-1; + if (((column*height)+row) >= currentMenu->numitems) + column--; + next = max(((column*height)+row), 0); + if (next >= currentMenu->numitems) + next = currentMenu->numitems-1; + itemOn = next; + break; + + case KEY_DOWNARROW: + S_StartSound(NULL, sfx_menu1); + row = (row+1) % height; + if (((column*height)+row) >= currentMenu->numitems) + row = 0; + next = min(((column*height)+row), currentMenu->numitems-1); + itemOn = next; + break; + + case KEY_UPARROW: + S_StartSound(NULL, sfx_menu1); + row = (row-1) % height; + if (row < 0) + row = height-1; + if (((column*height)+row) >= currentMenu->numitems) + row--; + next = max(((column*height)+row), 0); + if (next >= currentMenu->numitems) + next = currentMenu->numitems-1; + itemOn = next; + break; + + case KEY_ENTER: +#ifdef ITEMTOGGLEBOTTOMRIGHT + if (currentMenu->menuitems[itemOn].alphaKey == 255) + S_StartSound(NULL, sfx_lose); + else +#endif + if (currentMenu->menuitems[itemOn].alphaKey == 0) + { + INT32 v = cv_sneaker.value; + S_StartSound(NULL, sfx_s1b4); + for (i = 0; i < NUMKARTRESULTS-1; i++) + { + if (kartitemcvs[i]->value == v) + CV_AddValue(kartitemcvs[i], 1); + } + } + else + { + S_StartSound(NULL, sfx_s1ba); + CV_AddValue(kartitemcvs[currentMenu->menuitems[itemOn].alphaKey-1], 1); + } + break; + + case KEY_ESCAPE: + exitmenu = true; + break; + } + + if (exitmenu) + { + if (currentMenu->prevMenu) + M_SetupNextMenu(currentMenu->prevMenu); + else + M_ClearMenus(true); + } +} // ========= // Quit Game @@ -8640,7 +8953,6 @@ static void M_HandleFogColor(INT32 choice) break; case KEY_ESCAPE: - S_StartSound(NULL, sfx_menu1); exitmenu = true; break; diff --git a/src/p_enemy.c b/src/p_enemy.c index 6bbf00b2..ded0a20f 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -8164,9 +8164,6 @@ void A_ItemPop(mobj_t *actor) void A_JawzChase(mobj_t *actor) { - - INT32 c = 0; - INT32 stop; player_t *player; #ifdef HAVE_BLUA if (LUA_CallAction("A_JawzChase", actor)) @@ -8175,95 +8172,33 @@ void A_JawzChase(mobj_t *actor) if (actor->tracer) { - if (!actor->tracer->health) + if (actor->tracer->health) { - P_SetTarget(&actor->tracer, NULL); - } + mobj_t *ret; + + 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; - if (actor->tracer && (actor->tracer->health)) - { P_Thrust(actor, R_PointToAngle2(actor->x, actor->y, actor->tracer->x, actor->tracer->y), actor->info->speed); return; } + else + P_SetTarget(&actor->tracer, NULL); } - // first time init, this allow minimum lastlook changes - if (actor->lastlook == -1) - actor->lastlook = P_RandomFixed(); + if (actor->extravalue1) // Disable looking by setting this + return; - actor->lastlook %= MAXPLAYERS; + player = K_FindJawzTarget(actor, actor->target->player); + if (player) + P_SetTarget(&actor->tracer, player->mo); - stop = (actor->lastlook - 1) & PLAYERSMASK; - - if (actor->lastlook >= 0) - { - for (; ; actor->lastlook = (actor->lastlook + 1) & PLAYERSMASK) - { - if (!playeringame[actor->lastlook]) - continue; - - if (c++ == 2) - return; - - player = &players[actor->lastlook]; - - if (!player->mo) - continue; - - if (player->mo->health <= 0) - continue; // dead - - if ((netgame || multiplayer) && player->spectator) - continue; // spectator - - if (actor->target && actor->target->player) - { - if (player->mo == actor->target) - continue; - - // Don't home in on teammates. - if (gametype == GT_CTF - && actor->target->player->ctfteam == player->ctfteam) - continue; - - if (G_RaceGametype()) // Only in races, in match and CTF you should go after any nearby players - { - // USER TARGET - if (actor->target->player->kartstuff[k_position] != (player->kartstuff[k_position] + 1)) // Jawz only go after the person directly ahead of you -Sryder - continue; - } - - if (G_BattleGametype()) - { - if (player->kartstuff[k_bumper] <= 0) - continue; - - if (P_AproxDistance(P_AproxDistance(player->mo->x-actor->x, - player->mo->y-actor->y), player->mo->z-actor->z) > RING_DIST) - continue; - } - } - - if ((G_RaceGametype()) || (G_BattleGametype() // If in match etc. only home in when you get close enough, in race etc. home in all the time - && P_AproxDistance(P_AproxDistance(player->mo->x-actor->x, - player->mo->y-actor->y), player->mo->z-actor->z) < RING_DIST - && player->kartstuff[k_bumper] > 0)) - P_SetTarget(&actor->tracer, player->mo); - return; - - // Moved to bottom so it doesn't not check the last player - // done looking - if (actor->lastlook == stop) - { - if (G_RaceGametype()) - actor->lastlook = -2; - return; - } - } - } + if (G_RaceGametype()) // Stop looking after first tic in race + actor->extravalue1 = 1; return; - } void A_JawzExplode(mobj_t *actor) diff --git a/src/p_inter.c b/src/p_inter.c index f980e70d..6f3685d6 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -516,6 +516,22 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) boom->color = SKINCOLOR_RED; S_StartSound(boom, special->info->attacksound); + if (player->kartstuff[k_bumper] == 1) // If you have only one bumper left, and see if it's a 1v1 + { + INT32 numingame = 0; + INT32 i; + + for (i = 0; i < MAXPLAYERS; i++) + { + if (!playeringame[i] || players[i].spectator || players[i].kartstuff[k_bumper] <= 0) + continue; + numingame++; + } + + if (numingame <= 2) // If so, then an extra karma point so they are 100% certain to switch places; it's annoying to end matches with a bomb kill + special->target->player->kartstuff[k_comebackpoints]++; + } + special->target->player->kartstuff[k_comebackpoints] += 2 * (K_IsPlayerWanted(player) ? 2 : 1); if (netgame && cv_hazardlog.value) CONS_Printf(M_GetText("%s bombed %s!\n"), player_names[special->target->player-players], player_names[player-players]); @@ -1733,7 +1749,6 @@ static void P_HitDeathMessages(player_t *player, mobj_t *inflictor, mobj_t *sour str = M_GetText("%s%s's tagging hand %s %s.\n"); break; case MT_SPINFIRE: - case MT_SNEAKERTRAIL: str = M_GetText("%s%s's elemental fire trail %s %s.\n"); break; case MT_THROWNBOUNCE: @@ -2219,7 +2234,8 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source) if (target->target->player->kartstuff[k_itemheld]) { if ((target->type == MT_BANANA_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_BANANA) // trail items - || (target->type == MT_SSMINE_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_MINE)) + || (target->type == MT_SSMINE_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_MINE) + || (target->type == MT_SINK_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_KITCHENSINK)) { if (target->movedir != 0 && target->movedir < (UINT16)target->target->player->kartstuff[k_itemamount]) { diff --git a/src/p_local.h b/src/p_local.h index 7d7342bc..51676a2c 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -107,6 +107,9 @@ typedef struct camera_s // Momentums, used to update position. fixed_t momx, momy, momz; + + // SRB2Kart: camera pans while drifting + fixed_t pan; } camera_t; extern camera_t camera, camera2, camera3, camera4; diff --git a/src/p_map.c b/src/p_map.c index 5c3e7177..41d61cb0 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -188,7 +188,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) P_InstaThrustEvenIn2D(object, spring->angle, FixedMul(horizspeed,FixedSqrt(FixedMul(hscale, spring->scale)))); else { - fixed_t finalSpeed = horizspeed; + fixed_t finalSpeed = FixedDiv(horizspeed, hscale); fixed_t pSpeed = object->player->speed; if (pSpeed > finalSpeed) @@ -698,7 +698,7 @@ static boolean PIT_CheckThing(mobj_t *thing) K_KartBouncing(thing, tmthing, false, false); if (tmthing->type == MT_ORBINAUT || tmthing->type == MT_JAWZ || tmthing->type == MT_JAWZ_DUD) - S_StartSound(thing, sfx_shelit); + S_StartSound(thing, sfx_s3k7b); // This Item Damage if (tmthing->eflags & MFE_VERTICALFLIP) @@ -981,7 +981,7 @@ static boolean PIT_CheckThing(mobj_t *thing) K_KartBouncing(tmthing, thing, false, false); if (thing->type == MT_ORBINAUT || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD) - S_StartSound(tmthing, sfx_shelit); + S_StartSound(tmthing, sfx_s3k7b); // Other Item Damage if (thing->eflags & MFE_VERTICALFLIP) @@ -1491,10 +1491,15 @@ static boolean PIT_CheckThing(mobj_t *thing) if (thing->player->kartstuff[k_squishedtimer] || thing->player->kartstuff[k_hyudorotimer] || thing->player->kartstuff[k_justbumped] || thing->scale > tmthing->scale + (FRACUNIT/8) - || (G_BattleGametype() && thing->player->kartstuff[k_bumper] <= 0) || tmthing->player->kartstuff[k_squishedtimer] || tmthing->player->kartstuff[k_hyudorotimer] - || tmthing->player->kartstuff[k_justbumped] || tmthing->scale > thing->scale + (FRACUNIT/8) - || (G_BattleGametype() && tmthing->player->kartstuff[k_bumper] <= 0)) + || tmthing->player->kartstuff[k_justbumped] || tmthing->scale > thing->scale + (FRACUNIT/8)) + { + return true; + } + + if (G_BattleGametype() + && ((thing->player->kartstuff[k_bumper] && !tmthing->player->kartstuff[k_bumper]) + || (tmthing->player->kartstuff[k_bumper] && !thing->player->kartstuff[k_bumper]))) { return true; } @@ -2587,6 +2592,10 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) if (P_PlayerTouchingSectorSpecial(thing->player, 1, 13) || GETSECSPECIAL(R_PointInSubsector(x, y)->sector->special, 1) == 13) maxstep <<= 1; + // If using type Section1:12, no maxstep. For ledges you don't want the player to climb! (see: Egg Zeppelin & SMK port walls) + else if (P_PlayerTouchingSectorSpecial(thing->player, 1, 12) + || GETSECSPECIAL(R_PointInSubsector(x, y)->sector->special, 1) == 12) + maxstep = 0; // Don't 'step up' while springing, // Only step up "if needed". @@ -2793,7 +2802,7 @@ boolean P_SceneryTryMove(mobj_t *thing, fixed_t x, fixed_t y) if (!(thing->flags & MF_NOCLIP)) { - const fixed_t maxstep = MAXSTEPMOVE; + const fixed_t maxstep = FixedMul(MAXSTEPMOVE, mapheaderinfo[gamemap-1]->mobj_scale); if (tmceilingz - tmfloorz < thing->height) return false; // doesn't fit @@ -3276,7 +3285,7 @@ static boolean PTR_SlideTraverse(intercept_t *in) if (opentop - slidemo->z < slidemo->height) goto isblocking; // mobj is too high - if (openbottom - slidemo->z > FixedMul(MAXSTEPMOVE, slidemo->scale)) + if (openbottom - slidemo->z > FixedMul(MAXSTEPMOVE, mapheaderinfo[gamemap-1]->mobj_scale)) goto isblocking; // too big a step up // this line doesn't block movement diff --git a/src/p_mobj.c b/src/p_mobj.c index 129ea333..b8003c3a 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1404,8 +1404,11 @@ fixed_t P_GetMobjGravity(mobj_t *mo) case MT_BANANA: case MT_FAKEITEM: case MT_SSMINE: - case MT_SINK: gravityadd = FixedMul(gravityadd, 5*FRACUNIT/2); + break; + case MT_SINK: + gravityadd = FixedMul(gravityadd, 5*FRACUNIT); // Double gravity + break; default: break; } @@ -6614,115 +6617,12 @@ void P_MobjThinker(mobj_t *mobj) return; break; //{ SRB2kart mobs - case MT_DRIFT: - { - if (mobj->target && mobj->target->player && mobj->target->player->mo && mobj->target->player->health > 0 && !mobj->target->player->spectator) - { - fixed_t HEIGHT; - fixed_t radius; - - fixed_t dsone = K_GetKartDriftSparkValue(mobj->target->player); - fixed_t dstwo = dsone*2; - - if (mobj->target->player->kartstuff[k_driftcharge] < dsone) - { - P_RemoveMobj(mobj); - return; - } - - if (mobj->target->player->kartstuff[k_hyudorotimer] > 0) - { - if (splitscreen) - { - if (leveltime & 1) - mobj->flags2 |= MF2_DONTDRAW; - else - mobj->flags2 &= ~MF2_DONTDRAW; - - if (mobj->target->player->kartstuff[k_hyudorotimer] >= (1*TICRATE/2) && mobj->target->player->kartstuff[k_hyudorotimer] <= hyudorotime-(1*TICRATE/2)) - { - if (mobj->target->player == &players[secondarydisplayplayer]) - mobj->eflags |= MFE_DRAWONLYFORP2; - else if (mobj->target->player == &players[thirddisplayplayer] && splitscreen > 1) - mobj->eflags |= MFE_DRAWONLYFORP3; - else if (mobj->target->player == &players[fourthdisplayplayer] && splitscreen > 2) - mobj->eflags |= MFE_DRAWONLYFORP4; - else - mobj->eflags |= MFE_DRAWONLYFORP1; - } - else - mobj->eflags &= ~(MFE_DRAWONLYFORP1|MFE_DRAWONLYFORP2|MFE_DRAWONLYFORP3|MFE_DRAWONLYFORP4); - } - else - { - if (mobj->target->player == &players[displayplayer] - || (mobj->target->player != &players[displayplayer] - && (mobj->target->player->kartstuff[k_hyudorotimer] < (1*TICRATE/2) || mobj->target->player->kartstuff[k_hyudorotimer] > hyudorotime-(1*TICRATE/2)))) - { - if (leveltime & 1) - mobj->flags2 |= MF2_DONTDRAW; - else - mobj->flags2 &= ~MF2_DONTDRAW; - } - else - mobj->flags2 |= MF2_DONTDRAW; - } - } - else if (mobj->target->player->kartstuff[k_hyudorotimer] == 0) - { - mobj->flags2 &= ~MF2_DONTDRAW; - mobj->eflags &= ~(MFE_DRAWONLYFORP1|MFE_DRAWONLYFORP2|MFE_DRAWONLYFORP3|MFE_DRAWONLYFORP4); - } - - // Actor's distance from its Target, or Radius. - radius = 7*mobj->target->scale; - - // Switch blue flames to red flames - if (mobj->target->player && mobj->type == MT_DRIFT - && mobj->target->player->kartstuff[k_driftcharge] >= dstwo - && !(mobj->state >= &states[S_DRIFTSPARK4] && mobj->state <= &states[S_DRIFTSPARK6])) - P_SetMobjStateNF(mobj, S_DRIFTSPARK4); - - // Get the angle - if (mobj->target->player) - mobj->angle = ANGLE_180 + mobj->target->player->frameangle; - - // If the player is on the ceiling, then flip - if (mobj->target->eflags & MFE_VERTICALFLIP) - { - mobj->eflags |= MFE_VERTICALFLIP; - HEIGHT = (16<eflags &= ~MFE_VERTICALFLIP; - HEIGHT = 0; - } - - // Shrink if the player shrunk too. - mobj->scale = mobj->target->scale; - - P_UnsetThingPosition(mobj); - { - const angle_t fa = mobj->angle>>ANGLETOFINESHIFT; - mobj->x = mobj->target->x + FixedMul(finecosine[fa],radius); - mobj->y = mobj->target->y + FixedMul(finesine[fa],radius); - mobj->z = mobj->target->z - HEIGHT; - P_SetThingPosition(mobj); - } - } - else - { - P_RemoveMobj(mobj); - return; - } - break; - } case MT_ORBINAUT_SHIELD: // Kart orbit/trail items case MT_JAWZ_SHIELD: case MT_BANANA_SHIELD: case MT_SSMINE_SHIELD: case MT_FAKESHIELD: + case MT_SINK_SHIELD: /*if (mobj->health > 0 && mobj->target && mobj->target->player && mobj->target->player->health > 0 && !mobj->target->player->spectator) { @@ -7021,7 +6921,15 @@ void P_MobjThinker(mobj_t *mobj) break; } - mobj->tracer->flags2 &= ~MF2_DONTDRAW; + if (mobj->target->player->kartstuff[k_itemheld]) + { + if (leveltime & 1) + mobj->tracer->flags2 &= ~MF2_DONTDRAW; + else + mobj->tracer->flags2 |= MF2_DONTDRAW; + } + else + mobj->tracer->flags2 &= ~MF2_DONTDRAW; } else { @@ -7032,7 +6940,7 @@ void P_MobjThinker(mobj_t *mobj) mobj->tracer->destscale = scale; if (mobj->target->player->kartstuff[k_itemamount] >= numberdisplaymin - && mobj->target->player->kartstuff[k_itemamount] < 10) // Meh, too difficult to support greater than this; convert this to a decent HUD object and then maybe :V + && mobj->target->player->kartstuff[k_itemamount] <= 10) // Meh, too difficult to support greater than this; convert this to a decent HUD object and then maybe :V { mobj_t *number = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_OVERLAY); mobj_t *numx = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_OVERLAY); @@ -7916,7 +7824,7 @@ void P_MobjThinker(mobj_t *mobj) else { mobj->flags &= ~MF_NOGRAVITY; - if (mobj->z > mobj->watertop && mobj->z - mobj->watertop < FixedMul(MAXSTEPMOVE, mobj->scale)) + if (mobj->z > mobj->watertop && mobj->z - mobj->watertop < FixedMul(MAXSTEPMOVE, mapheaderinfo[gamemap-1]->mobj_scale)) mobj->z = mobj->watertop; } break; @@ -8228,6 +8136,39 @@ void P_MobjThinker(mobj_t *mobj) S_StartSound(mobj, sfx_prloop); mobj->health--; break; + case MT_BOOSTFLAME: + if (!mobj->target || !mobj->target->health) + { + P_RemoveMobj(mobj); + return; + } + + P_TeleportMove(mobj, mobj->target->x + P_ReturnThrustX(mobj, mobj->target->angle+ANGLE_180, mobj->target->radius), + mobj->target->y + P_ReturnThrustY(mobj, mobj->target->angle+ANGLE_180, mobj->target->radius), mobj->target->z); + mobj->angle = mobj->target->angle; + P_SetScale(mobj, mobj->target->scale); + + if (mobj->target->player) + { + if (mobj->target->player->kartstuff[k_sneakertimer] > mobj->movecount) + P_SetMobjState(mobj, S_BOOSTFLAME); + mobj->movecount = mobj->target->player->kartstuff[k_sneakertimer]; + } + + if (mobj->state == &states[S_BOOSTSMOKESPAWNER]) + { + mobj_t *smoke = P_SpawnMobj(mobj->x, mobj->y, mobj->z+(8<target->scale/2); + smoke->destscale = 3*mobj->target->scale/2; + + smoke->momx = mobj->target->momx/2; + smoke->momy = mobj->target->momy/2; + smoke->momz = mobj->target->momz/2; + + P_Thrust(smoke, mobj->target->angle+FixedAngle(P_RandomRange(135, 225)<mobj_scale); + } + break; case MT_SPARKLETRAIL: if (!mobj->target) { @@ -8245,6 +8186,14 @@ void P_MobjThinker(mobj_t *mobj) } P_TeleportMove(mobj, mobj->target->x, mobj->target->y, mobj->target->z); break; + case MT_PLAYERRETICULE: + if (!mobj->target || !mobj->target->health) + { + P_RemoveMobj(mobj); + return; + } + P_TeleportMove(mobj, mobj->target->x, mobj->target->y, mobj->target->z); + break; case MT_INSTASHIELDB: if (leveltime & 1) mobj->flags2 |= MF2_DONTDRAW; diff --git a/src/p_slopes.c b/src/p_slopes.c index dd737204..c516fa97 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -778,6 +778,10 @@ void P_ReverseQuantizeMomentumToSlope(vector3_t *momentum, pslope_t *slope) slope->zangle = InvAngle(slope->zangle); } +// SRB2Kart: This fixes all slope-based jumps for different scales in Kart automatically without map tweaking. +// However, they will always feel off every single time... see for yourself: https://cdn.discordapp.com/attachments/270211093761097728/484924392128774165/kart0181.gif +//#define GROWNEVERMISSES + // // P_SlopeLaunch // @@ -795,9 +799,19 @@ void P_SlopeLaunch(mobj_t *mo) slopemom.z = mo->momz; P_QuantizeMomentumToSlope(&slopemom, mo->standingslope); +#ifdef GROWNEVERMISSES + { + const fixed_t xyscale = mapheaderinfo[gamemap-1]->mobj_scale + (mapheaderinfo[gamemap-1]->mobj_scale - mo->scale); + const fixed_t zscale = mapheaderinfo[gamemap-1]->mobj_scale + (mapheaderinfo[gamemap-1]->mobj_scale - mo->scale); + mo->momx = FixedMul(slopemom.x, xyscale); + mo->momy = FixedMul(slopemom.y, xyscale); + mo->momz = FixedMul(slopemom.z, zscale); + } +#else mo->momx = slopemom.x; mo->momy = slopemom.y; mo->momz = slopemom.z; +#endif } //CONS_Printf("Launched off of slope.\n"); diff --git a/src/p_spec.c b/src/p_spec.c index 90166104..9c90b4bb 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3618,10 +3618,7 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers if (gametype == GT_CTF && player->gotflag & (GF_REDFLAG|GF_BLUEFLAG)) P_PlayerFlagBurst(player, false); break; - case 12: // Space Countdown - if ((player->powers[pw_shield] & SH_NOSTACK) != SH_ELEMENTAL && !player->powers[pw_spacetime]) - player->powers[pw_spacetime] = spacetimetics + 1; - break; + case 12: // Wall Sector (Don't step-up/down) case 13: // Ramp Sector (Increase step-up/down) case 14: // Non-Ramp Sector (Don't step-down) case 15: // Bouncy Sector (FOF Control Only) @@ -3760,8 +3757,8 @@ DoneSection2: case 1: // SRB2kart: Spring Panel if (roversector || P_MobjReadyToTrigger(player->mo, sector)) { - const fixed_t scale = mapheaderinfo[gamemap-1]->mobj_scale + abs(player->mo->scale - mapheaderinfo[gamemap-1]->mobj_scale); - const fixed_t minspeed = 24*scale; + const fixed_t hscale = mapheaderinfo[gamemap-1]->mobj_scale + (mapheaderinfo[gamemap-1]->mobj_scale - player->mo->scale); + const fixed_t minspeed = 24*hscale; if (player->mo->eflags & MFE_SPRUNG) break; @@ -3780,9 +3777,9 @@ DoneSection2: case 3: // SRB2kart: Spring Panel (capped speed) if (roversector || P_MobjReadyToTrigger(player->mo, sector)) { - const fixed_t scale = mapheaderinfo[gamemap-1]->mobj_scale + abs(player->mo->scale - mapheaderinfo[gamemap-1]->mobj_scale); - const fixed_t minspeed = 24*scale; - const fixed_t maxspeed = 36*scale; + const fixed_t hscale = mapheaderinfo[gamemap-1]->mobj_scale + (mapheaderinfo[gamemap-1]->mobj_scale - player->mo->scale); + const fixed_t minspeed = 24*hscale; + const fixed_t maxspeed = 28*hscale; if (player->mo->eflags & MFE_SPRUNG) break; @@ -3802,7 +3799,7 @@ DoneSection2: case 5: // Speed pad w/o spin case 6: // Speed pad w/ spin - if (player->powers[pw_flashing] != 0 && player->powers[pw_flashing] < TICRATE/2) + if (player->kartstuff[k_dashpadcooldown] != 0) break; i = P_FindSpecialLineFromTag(4, sector->tag, -1); @@ -3817,6 +3814,11 @@ DoneSection2: player->mo->angle = lineangle; + // SRB2Kart: Scale the speed you get from them! + // This is scaled differently from other horizontal speed boosts from stuff like springs, because of how this is used for some ramp jumps. + if (player->mo->scale > mapheaderinfo[gamemap-1]->mobj_scale) + linespeed = FixedMul(linespeed, mapheaderinfo[gamemap-1]->mobj_scale + (player->mo->scale - mapheaderinfo[gamemap-1]->mobj_scale)); + if (!demoplayback || P_AnalogMove(player)) { if (player == &players[consoleplayer]) @@ -3847,15 +3849,15 @@ DoneSection2: P_InstaThrust(player->mo, player->mo->angle, linespeed); - if (GETSECSPECIAL(sector->special, 3) == 6 && (player->charability2 == CA2_SPINDASH)) + /*if (GETSECSPECIAL(sector->special, 3) == 6 && (player->charability2 == CA2_SPINDASH)) // SRB2kart { if (!(player->pflags & PF_SPINNING)) player->pflags |= PF_SPINNING; - //P_SetPlayerMobjState(player->mo, S_PLAY_ATK1); // SRB2kart - } + //P_SetPlayerMobjState(player->mo, S_PLAY_ATK1); + }*/ - player->powers[pw_flashing] = TICRATE/3; + player->kartstuff[k_dashpadcooldown] = TICRATE/3; S_StartSound(player->mo, sfx_spdpad); } break; diff --git a/src/p_user.c b/src/p_user.c index ba7cb80b..808c203f 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2942,17 +2942,14 @@ static void P_DoClimbing(player_t *player) // SRB2kart - unused P_InstaThrust(player->mo, player->mo->angle, FixedMul(-4*FRACUNIT, player->mo->scale)); } - if (!demoplayback || P_AnalogMove(player)) - { - if (player == &players[consoleplayer]) - localangle = player->mo->angle; - else if (player == &players[secondarydisplayplayer]) - localangle2 = player->mo->angle; - else if (player == &players[thirddisplayplayer]) - localangle3 = player->mo->angle; - else if (player == &players[fourthdisplayplayer]) - localangle4 = player->mo->angle; - } + if (player == &players[consoleplayer]) + localangle = player->mo->angle; + else if (player == &players[secondarydisplayplayer]) + localangle2 = player->mo->angle; + else if (player == &players[thirddisplayplayer]) + localangle3 = player->mo->angle; + else if (player == &players[fourthdisplayplayer]) + localangle4 = player->mo->angle; if (player->climbing == 0) P_SetPlayerMobjState(player->mo, S_PLAY_ATK1); @@ -2981,7 +2978,7 @@ static fixed_t teeteryl, teeteryh; static boolean PIT_CheckSolidsTeeter(mobj_t *thing) // SRB2kart - unused. { fixed_t blockdist; - fixed_t tiptop = FixedMul(MAXSTEPMOVE, teeterer->scale); + fixed_t tiptop = FixedMul(MAXSTEPMOVE, mapheaderinfo[gamemap-1]->mobj_scale); fixed_t thingtop = thing->z + thing->height; fixed_t teeterertop = teeterer->z + teeterer->height; @@ -3098,7 +3095,7 @@ static void P_DoTeeter(player_t *player) // SRB2kart - unused. boolean roverfloor; // solid 3d floors? fixed_t floorheight, ceilingheight; fixed_t topheight, bottomheight; // for 3d floor usage - const fixed_t tiptop = FixedMul(MAXSTEPMOVE, player->mo->scale); // Distance you have to be above the ground in order to teeter. + const fixed_t tiptop = FixedMul(MAXSTEPMOVE, mapheaderinfo[gamemap-1]->mobj_scale); // Distance you have to be above the ground in order to teeter. if (player->mo->standingslope && player->mo->standingslope->zdelta >= (FRACUNIT/2)) // Always teeter if the slope is too steep. teeter = true; @@ -3775,17 +3772,14 @@ void P_DoJump(player_t *player, boolean soundandstate) player->mo->angle = player->mo->angle - ANGLE_180; // Turn around from the wall you were climbing. - if (!demoplayback || P_AnalogMove(player)) - { - if (player == &players[consoleplayer]) - localangle = player->mo->angle; // Adjust the local control angle. - else if (player == &players[secondarydisplayplayer]) - localangle2 = player->mo->angle; - else if (player == &players[thirddisplayplayer]) - localangle3 = player->mo->angle; - else if (player == &players[fourthdisplayplayer]) - localangle4 = player->mo->angle; - } + if (player == &players[consoleplayer]) + localangle = player->mo->angle; // Adjust the local control angle. + else if (player == &players[secondarydisplayplayer]) + localangle2 = player->mo->angle; + else if (player == &players[thirddisplayplayer]) + localangle3 = player->mo->angle; + else if (player == &players[fourthdisplayplayer]) + localangle4 = player->mo->angle; player->climbing = 0; // Stop climbing, duh! P_InstaThrust(player->mo, player->mo->angle, FixedMul(6*FRACUNIT, player->mo->scale)); // Jump off the wall. @@ -7768,8 +7762,8 @@ boolean P_LookForEnemies(player_t *player) if (mo->type == MT_DETON) // Don't be STUPID, Sonic! continue; - if (((mo->z > player->mo->z+FixedMul(MAXSTEPMOVE, player->mo->scale)) && !(player->mo->eflags & MFE_VERTICALFLIP)) - || ((mo->z+mo->height < player->mo->z+player->mo->height-FixedMul(MAXSTEPMOVE, player->mo->scale)) && (player->mo->eflags & MFE_VERTICALFLIP))) // Reverse gravity check - Flame. + if (((mo->z > player->mo->z+FixedMul(MAXSTEPMOVE, mapheaderinfo[gamemap-1]->mobj_scale)) && !(player->mo->eflags & MFE_VERTICALFLIP)) + || ((mo->z+mo->height < player->mo->z+player->mo->height-FixedMul(MAXSTEPMOVE, mapheaderinfo[gamemap-1]->mobj_scale)) && (player->mo->eflags & MFE_VERTICALFLIP))) // Reverse gravity check - Flame. continue; // Don't home upwards! if (P_AproxDistance(P_AproxDistance(player->mo->x-mo->x, player->mo->y-mo->y), @@ -7823,7 +7817,7 @@ void P_HomingAttack(mobj_t *source, mobj_t *enemy) // Home in on your target // change angle source->angle = R_PointToAngle2(source->x, source->y, enemy->x, enemy->y); - if (source->player && (!demoplayback || P_AnalogMove(source->player))) + if (source->player) { if (source->player == &players[consoleplayer]) localangle = source->angle; @@ -8089,25 +8083,25 @@ static CV_PossibleValue_t CV_CamRotate[] = {{-720, "MIN"}, {720, "MAX"}, {0, NUL consvar_t cv_cam_dist = {"cam_dist", "160", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam_height = {"cam_height", "50", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam_still = {"cam_still", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_cam_speed = {"cam_speed", "0.45", CV_FLOAT|CV_SAVE, CV_CamSpeed, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_cam_speed = {"cam_speed", "0.4", CV_FLOAT|CV_SAVE, CV_CamSpeed, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam_rotate = {"cam_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam_rotspeed = {"cam_rotspeed", "10", CV_SAVE, rotation_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam2_dist = {"cam2_dist", "160", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam2_height = {"cam2_height", "50", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam2_still = {"cam2_still", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_cam2_speed = {"cam2_speed", "0.45", CV_FLOAT|CV_SAVE, CV_CamSpeed, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_cam2_speed = {"cam2_speed", "0.4", CV_FLOAT|CV_SAVE, CV_CamSpeed, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam2_rotate = {"cam2_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate2_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam2_rotspeed = {"cam2_rotspeed", "10", CV_SAVE, rotation_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam3_dist = {"cam3_dist", "160", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam3_height = {"cam3_height", "50", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam3_still = {"cam3_still", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_cam3_speed = {"cam3_speed", "0.45", CV_FLOAT|CV_SAVE, CV_CamSpeed, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_cam3_speed = {"cam3_speed", "0.4", CV_FLOAT|CV_SAVE, CV_CamSpeed, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam3_rotate = {"cam3_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate3_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam3_rotspeed = {"cam3_rotspeed", "10", CV_SAVE, rotation_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam4_dist = {"cam4_dist", "160", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam4_height = {"cam4_height", "50", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam4_still = {"cam4_still", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_cam4_speed = {"cam4_speed", "0.45", CV_FLOAT|CV_SAVE, CV_CamSpeed, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_cam4_speed = {"cam4_speed", "0.4", CV_FLOAT|CV_SAVE, CV_CamSpeed, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam4_rotate = {"cam4_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate4_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam4_rotspeed = {"cam4_rotspeed", "10", CV_SAVE, rotation_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -8171,7 +8165,8 @@ void P_ResetCamera(player_t *player, camera_t *thiscam) boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcalled) { angle_t angle = 0, focusangle = 0, focusaiming = 0; - fixed_t x, y, z, dist, height, checkdist, viewpointx, viewpointy, camspeed, camdist, camheight, pviewheight; + fixed_t x, y, z, dist, height, viewpointx, viewpointy, camspeed, camdist, camheight, pviewheight; + fixed_t pan, xpan, ypan; INT32 camrotate; boolean camstill, cameranoclip, lookback; mobj_t *mo; @@ -8241,8 +8236,8 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall mo = player->mo; - thiscam->radius = FixedMul(20*FRACUNIT, mo->scale); - thiscam->height = FixedMul(16*FRACUNIT, mo->scale); + thiscam->radius = FixedMul(20*FRACUNIT, mapheaderinfo[gamemap-1]->mobj_scale); + thiscam->height = FixedMul(16*FRACUNIT, mapheaderinfo[gamemap-1]->mobj_scale); if (!mo) return true; @@ -8340,54 +8335,31 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall camspeed = FRACUNIT; } -#ifdef REDSANALOG - if (P_AnalogMove(player) && (player->cmd.buttons & (BT_FORWARD|BT_BACKWARD)) == (BT_FORWARD|BT_BACKWARD)) { - camstill = true; - if (camspeed < 4*FRACUNIT/5) - camspeed = 4*FRACUNIT/5; - } -#endif // REDSANALOG - if (mo->eflags & MFE_VERTICALFLIP) camheight += thiscam->height; - if (twodlevel || (mo->flags2 & MF2_TWOD)) - angle = ANGLE_90; - else if (camstill || resetcalled || player->playerstate == PST_DEAD) + if (camstill || resetcalled || player->playerstate == PST_DEAD) angle = thiscam->angle; - else if (player->pflags & PF_NIGHTSMODE) // NiGHTS Level - { - if ((player->pflags & PF_TRANSFERTOCLOSEST) && player->axis1 && player->axis2) - { - angle = R_PointToAngle2(player->axis1->x, player->axis1->y, player->axis2->x, player->axis2->y); - angle += ANGLE_90; - } - else if (player->mo->target) - { - if (player->mo->target->flags2 & MF2_AMBUSH) - angle = R_PointToAngle2(player->mo->target->x, player->mo->target->y, player->mo->x, player->mo->y); - else - angle = R_PointToAngle2(player->mo->x, player->mo->y, player->mo->target->x, player->mo->target->y); - } - } - else if (P_AnalogMove(player)) // Analog - angle = R_PointToAngle2(thiscam->x, thiscam->y, mo->x, mo->y); - else if (demoplayback && leveltime > starttime) - { - angle = focusangle; - focusangle = R_PointToAngle2(thiscam->x, thiscam->y, mo->x, mo->y); - if (player == &players[consoleplayer]) - { - if (focusangle >= localangle) - localangle += abs((signed)(focusangle - localangle))>>5; - else - localangle -= abs((signed)(focusangle - localangle))>>5; - } - } - else + else if (leveltime < starttime) angle = focusangle + FixedAngle(camrotate*FRACUNIT); + else + { + angle_t input = focusangle + FixedAngle(camrotate<angle; + boolean invert = (input > ANGLE_180); + if (invert) + input = InvAngle(input); - if (!resetcalled && (leveltime > starttime) && (cv_analog.value || demoplayback) + input = FixedAngle(FixedMul(AngleFixed(input), camspeed)); + if (invert) + input = InvAngle(input); + + angle = thiscam->angle + input; + + if (demoplayback && player == &players[consoleplayer]) + localangle = angle; + } + + if (!resetcalled && (leveltime > starttime) && ((thiscam == &camera && t_cam_rotate != -42) || (thiscam == &camera2 && t_cam2_rotate != -42) || (thiscam == &camera3 && t_cam3_rotate != -42) @@ -8397,112 +8369,51 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall thiscam->angle = angle; } - /* // SRB2kart - camera controls are disabled... for now. - if (!objectplacing && !(twodlevel || (mo->flags2 & MF2_TWOD)) && !(player->pflags & PF_NIGHTSMODE) && displayplayer == consoleplayer) - { -#ifdef REDSANALOG - if ((player->cmd.buttons & (BT_FORWARD|BT_BACKWARD)) == (BT_FORWARD|BT_BACKWARD)); else -#endif - if (player->cmd.buttons & BT_FORWARD) - { - if (thiscam == &camera) - { - if (cv_analog.value || demoplayback) - angle -= FixedAngle(cv_cam_rotspeed.value*FRACUNIT); - else - CV_SetValue(&cv_cam_rotate, camrotate == 0 ? 358 - : camrotate - 2); - } - else - { - if (cv_analog2.value) - angle -= FixedAngle(cv_cam2_rotspeed.value*FRACUNIT); - else - CV_SetValue(&cv_cam2_rotate, camrotate == 0 ? 358 - : camrotate - 2); - } - } - else if (player->cmd.buttons & BT_BACKWARD) - { - if (thiscam == &camera) - { - if (cv_analog.value || demoplayback) - angle += FixedAngle(cv_cam_rotspeed.value*FRACUNIT); - else - CV_SetValue(&cv_cam_rotate, camrotate + 2); - } - else - { - if (cv_analog2.value) - angle += FixedAngle(cv_cam2_rotspeed.value*FRACUNIT); - else - CV_SetValue(&cv_cam2_rotate, camrotate + 2); - } - } - } - */ - height = camheight; // sets ideal cam pos - if (twodlevel || (mo->flags2 & MF2_TWOD)) - dist = 480<pflags & PF_NIGHTSMODE) - dist = 320<speed > K_GetKartSpeed(player, false)) + dist += 4*(player->speed - K_GetKartSpeed(player, false)); + dist += abs(thiscam->momz)/4; + + if (player->kartstuff[k_boostcam]) { - dist = camdist; - - // in splitscreen modes, mess with the camera distances to make it feel proportional to how it feels normally - if (splitscreen == 1) // widescreen splits should get x1.5 distance - { - dist = FixedMul(dist, 3*FRACUNIT/2); - height = FixedMul(height, 3*FRACUNIT/2); - } - - if (player->climbing || player->exiting || player->playerstate == PST_DEAD || (player->pflags & (PF_MACESPIN|PF_ITEMHANG|PF_ROPEHANG))) - dist <<= 1; + dist -= FixedMul(11*dist/16, player->kartstuff[k_boostcam]); + height -= FixedMul(height, player->kartstuff[k_boostcam]); } - checkdist = dist; - - if (checkdist < 128*FRACUNIT) - checkdist = 128*FRACUNIT; + // in splitscreen modes, mess with the camera distances to make it feel proportional to how it feels normally + if (splitscreen == 1) // widescreen splits should get x1.5 distance + { + dist = FixedMul(dist, 3*FRACUNIT/2); + height = FixedMul(height, 3*FRACUNIT/2); + } x = mo->x - FixedMul(FINECOSINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist); y = mo->y - FixedMul(FINESINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist); -#if 0 - if (twodlevel || (mo->flags2 & MF2_TWOD)) + // SRB2Kart: set camera panning + if (player->kartstuff[k_drift] != 0) { - // Camera doesn't ALWAYS need to move, only when running... - if (abs(player->mo->momx) > 10) - { - // Move the camera all smooth-like, not jerk it around... - if (mo->momx > 0) - { - if (thiscam->relativex < MAXCAMERADIST) - thiscam->relativex += 4*FRACUNIT; - } - else if (mo->momx < 0) - { - if (thiscam->relativex > -MAXCAMERADIST) - thiscam->relativex -= 4*FRACUNIT; - } - } - else // If speed is less than required, start moving the camera back. - { - if (thiscam->relativex > 0) - thiscam->relativex -= 4*FRACUNIT; - else if (thiscam->relativex < 0) - thiscam->relativex += 4*FRACUNIT; - } - - // Add the relative x to the global x - x += thiscam->relativex; - y += mo->momy << 1; + fixed_t panmax = (dist/5); + pan = FixedDiv(FixedMul(min((fixed_t)player->kartstuff[k_driftcharge], K_GetKartDriftSparkValue(player)), panmax), K_GetKartDriftSparkValue(player)); + if (pan > panmax) + pan = panmax; + if (player->kartstuff[k_drift] < 0) + pan *= -1; } -#endif // bad 2D camera code + else + pan = 0; + + pan = thiscam->pan + FixedMul(pan - thiscam->pan, camspeed/4); + + xpan = FixedMul(FINECOSINE(((angle+ANGLE_90)>>ANGLETOFINESHIFT) & FINEMASK), pan); + ypan = FixedMul(FINESINE(((angle+ANGLE_90)>>ANGLETOFINESHIFT) & FINEMASK), pan); + + x += xpan; + y += ypan; pviewheight = FixedMul(32<scale); @@ -8680,7 +8591,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall for (rover = newsubsec->sector->ffloors; rover; rover = rover->next) { fixed_t topheight, bottomheight; - if ((rover->flags & FF_BLOCKOTHERS) && (rover->flags & FF_RENDERALL) && (rover->flags & FF_EXISTS) && GETSECSPECIAL(rover->master->frontsector->special, 4) != 12) + if ((rover->flags & FF_BLOCKOTHERS) && (rover->flags & FF_RENDERALL) && (rover->flags & FF_EXISTS) && GETSECSPECIAL(rover->master->frontsector->special, 4) == 12) { topheight = P_CameraGetFOFTopZ(thiscam, newsubsec->sector, rover, midx, midy, NULL); bottomheight = P_CameraGetFOFBottomZ(thiscam, newsubsec->sector, rover, midx, midy, NULL); @@ -8706,72 +8617,39 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall } } - if (mo->type == MT_EGGTRAP) - z = mo->z + 128*FRACUNIT + pviewheight + camheight; - if (thiscam->z < thiscam->floorz && !cameranoclip) thiscam->z = thiscam->floorz; // point viewed by the camera // this point is just 64 unit forward the player - dist = FixedMul(64 << FRACBITS, mapheaderinfo[gamemap-1]->mobj_scale); - viewpointx = mo->x + FixedMul(FINECOSINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist); - viewpointy = mo->y + FixedMul(FINESINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist); + dist = 64*mapheaderinfo[gamemap-1]->mobj_scale; + viewpointx = mo->x + FixedMul(FINECOSINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist) + xpan; + viewpointy = mo->y + FixedMul(FINESINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist) + ypan; if (!camstill && !resetcalled && !paused) thiscam->angle = R_PointToAngle2(thiscam->x, thiscam->y, viewpointx, viewpointy); - viewpointx = mo->x + FixedMul(FINECOSINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist); - viewpointy = mo->y + FixedMul(FINESINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist); - -/* - if (twodlevel || (mo->flags2 & MF2_TWOD)) - thiscam->angle = angle; -*/ - // follow the player - /*if (player->playerstate != PST_DEAD && (camspeed) != 0) - { - if (P_AproxDistance(mo->x - thiscam->x, mo->y - thiscam->y) > (checkdist + P_AproxDistance(mo->momx, mo->momy)) * 4 - || abs(mo->z - thiscam->z) > checkdist * 3) - { - if (!resetcalled) - P_ResetCamera(player, thiscam); - return true; - } - }*/ - if (player->exiting) { thiscam->momx = 0; thiscam->momy = 0; thiscam->momz = 0; } + else if (leveltime < starttime) + { + thiscam->momx = FixedMul(x - thiscam->x, camspeed); + thiscam->momy = FixedMul(y - thiscam->y, camspeed); + thiscam->momz = FixedMul(z - thiscam->z, camspeed); + } else { - if (twodlevel || (mo->flags2 & MF2_TWOD)) - { - thiscam->momx = x-thiscam->x; - thiscam->momy = y-thiscam->y; - thiscam->momz = z-thiscam->z; - } - else - { - thiscam->momx = FixedMul(x - thiscam->x, camspeed); - thiscam->momy = FixedMul(y - thiscam->y, camspeed); - - if ((GETSECSPECIAL(thiscam->subsector->sector->special, 1) == 6 - && thiscam->z < thiscam->subsector->sector->floorheight + 256*FRACUNIT - && FixedMul(z - thiscam->z, camspeed) < 0) -#if 0 - || player->kartstuff[k_pogospring] // SRB2Kart: don't follow while bouncing, experimental -#endif - ) - thiscam->momz = 0; // Don't go down a death pit - else - thiscam->momz = FixedMul(z - thiscam->z, camspeed); - } + thiscam->momx = x - thiscam->x; + thiscam->momy = y - thiscam->y; + thiscam->momz = FixedMul(z - thiscam->z, camspeed/2); } + thiscam->pan = pan; + // compute aming to look the viewed point f1 = viewpointx-thiscam->x; f2 = viewpointy-thiscam->y; @@ -8781,6 +8659,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall angle = R_PointToAngle2(0, thiscam->z + thiscam->height, dist, mo->z + mo->height - P_GetPlayerHeight(player)); else angle = R_PointToAngle2(0, thiscam->z, dist, mo->z + P_GetPlayerHeight(player)); + if (player->playerstate != PST_DEAD && !(player->pflags & PF_NIGHTSMODE && player->exiting)) angle += (focusaiming < ANGLE_180 ? focusaiming/2 : InvAngle(InvAngle(focusaiming)/2)); // overcomplicated version of '((signed)focusaiming)/2;' @@ -8791,40 +8670,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall thiscam->aiming -= (dist>>3); } - // Make player translucent if camera is too close (only in single player). - /*if (!(multiplayer || netgame) && !splitscreen) - { - fixed_t vx = 0, vy = 0; - if (player->awayviewtics) { - vx = player->awayviewmobj->x; - vy = player->awayviewmobj->y; - } - else - { - vx = thiscam->x; - vy = thiscam->y; - } - - if (P_AproxDistance(vx - player->mo->x, vy - player->mo->y) < FixedMul(48*FRACUNIT, mo->scale)) - player->mo->flags2 |= MF2_SHADOW; - else - player->mo->flags2 &= ~MF2_SHADOW; - } - else - player->mo->flags2 &= ~MF2_SHADOW;*/ - -/* if (!resetcalled && (player->pflags & PF_NIGHTSMODE && player->exiting)) - { - // Don't let the camera match your movement. - thiscam->momz = 0; - - // Only let the camera go a little bit upwards. - if (mo->eflags & MFE_VERTICALFLIP && thiscam->aiming < ANGLE_315 && thiscam->aiming > ANGLE_180) - thiscam->aiming = ANGLE_315; - else if (!(mo->eflags & MFE_VERTICALFLIP) && thiscam->aiming > ANGLE_45 && thiscam->aiming < ANGLE_180) - thiscam->aiming = ANGLE_45; - } - else */if (!resetcalled && (player->playerstate == PST_DEAD || player->playerstate == PST_REBORN)) + if (!resetcalled && (player->playerstate == PST_DEAD || player->playerstate == PST_REBORN)) { // Don't let the camera match your movement. thiscam->momz = 0; @@ -8836,17 +8682,6 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall thiscam->aiming = ANGLE_22h; } -#if 0 - // SRB2Kart: keep camera the same distance away from the player, while maintaining its angle - { - fixed_t xlen = (thiscam->x+thiscam->momx) - (mo->x+mo->momx); - fixed_t ylen = (thiscam->y+thiscam->momy) - (mo->y+mo->momy); - fixed_t xydist = P_AproxDistance(xlen, ylen); - thiscam->momx = FixedMul(dist, FixedDiv(xlen, xydist)); - thiscam->momy = FixedMul(dist, FixedDiv(ylen, xydist)); - } -#endif - return (x == thiscam->x && y == thiscam->y && z == thiscam->z && angle == thiscam->aiming); } @@ -9453,7 +9288,7 @@ void P_PlayerThink(player_t *player) #if 1 // "Blur" a bit when you have speed shoes and are going fast enough if ((player->powers[pw_super] || player->powers[pw_sneakers] - || player->kartstuff[k_driftboost] || player->kartstuff[k_sneakertimer]) && !player->kartstuff[k_invincibilitytimer] // SRB2kart + || player->kartstuff[k_driftboost] || player->kartstuff[k_sneakertimer] || player->kartstuff[k_startboost]) && !player->kartstuff[k_invincibilitytimer] // SRB2kart && (player->speed + abs(player->mo->momz)) > FixedMul(20*FRACUNIT,player->mo->scale)) { mobj_t *gmobj = P_SpawnGhostMobj(player->mo); @@ -9602,6 +9437,7 @@ void P_PlayerThink(player_t *player) if (!(player->pflags & PF_NIGHTSMODE || player->kartstuff[k_hyudorotimer] // SRB2kart - fixes Hyudoro not flashing when it should. || player->kartstuff[k_growshrinktimer] > 0 // Grow doesn't flash either. + || player->kartstuff[k_respawn] // Respawn timer (for drop dash effect) || (G_BattleGametype() && player->kartstuff[k_bumper] <= 0 && player->kartstuff[k_comebacktimer]) || leveltime < starttime)) // Level intro { @@ -9889,17 +9725,14 @@ void P_PlayerAfterThink(player_t *player) { player->mo->angle = player->mo->tracer->angle; - if (!demoplayback || P_AnalogMove(player)) - { - if (player == &players[consoleplayer]) - localangle = player->mo->angle; - else if (player == &players[secondarydisplayplayer]) - localangle2 = player->mo->angle; - else if (player == &players[thirddisplayplayer]) - localangle3 = player->mo->angle; - else if (player == &players[fourthdisplayplayer]) - localangle4 = player->mo->angle; - } + if (player == &players[consoleplayer]) + localangle = player->mo->angle; + else if (player == &players[secondarydisplayplayer]) + localangle2 = player->mo->angle; + else if (player == &players[thirddisplayplayer]) + localangle3 = player->mo->angle; + else if (player == &players[fourthdisplayplayer]) + localangle4 = player->mo->angle; } if (P_AproxDistance(player->mo->x - player->mo->tracer->x, player->mo->y - player->mo->tracer->y) > player->mo->radius) @@ -9966,17 +9799,14 @@ void P_PlayerAfterThink(player_t *player) player->mo->tracer->target->health += cmd->sidemove; player->mo->angle += cmd->sidemove< ANGLE_MAX - if (!demoplayback || P_AnalogMove(player)) - { - if (player == &players[consoleplayer]) - localangle = player->mo->angle; // Adjust the local control angle. - else if (player == &players[secondarydisplayplayer]) - localangle2 = player->mo->angle; - else if (player == &players[thirddisplayplayer]) - localangle3 = player->mo->angle; - else if (player == &players[fourthdisplayplayer]) - localangle4 = player->mo->angle; - } + if (player == &players[consoleplayer]) + localangle = player->mo->angle; // Adjust the local control angle. + else if (player == &players[secondarydisplayplayer]) + localangle2 = player->mo->angle; + else if (player == &players[thirddisplayplayer]) + localangle3 = player->mo->angle; + else if (player == &players[fourthdisplayplayer]) + localangle4 = player->mo->angle; } } diff --git a/src/r_plane.c b/src/r_plane.c index 66570886..0f0e2f7a 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -726,7 +726,7 @@ void R_DrawPlanes(void) dc_iscale = FixedMul(skyscale, FINECOSINE(xtoviewangle[x]>>ANGLETOFINESHIFT)); dc_x = x; dc_source = - R_GetColumn(skytexture, + R_GetColumn(texturetranslation[skytexture], angle); wallcolfunc(); } diff --git a/src/sounds.c b/src/sounds.c index b703fdf8..d279780b 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -438,7 +438,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3k59", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k5a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k5b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k5c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"s3k5c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Kart Mine tick {"s3k5d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k5e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k5f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, @@ -469,7 +469,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3k78", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k79", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k7a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k7b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"s3k7b", false, 64, 16, -1, NULL, 0, -1, -1, LUMPERROR}, // Kart successful hit {"s3k7c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k7d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k7e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, @@ -483,7 +483,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3k86", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k87", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k88", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k89", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"s3k89", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Kart Jawz target {"s3k8a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k8b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k8c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, @@ -645,7 +645,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"cdfm36", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"cdfm37", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"cdfm38", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"cdfm39", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // SS Mine deployed + {"cdfm39", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Mine deployed {"cdfm40", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"cdfm41", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"cdfm42", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, @@ -813,6 +813,8 @@ sfxinfo_t S_sfx[NUMSFX] = {"ruby1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"ruby2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"hogbom", false, 110, 8, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kpogos", false, 110, 8, -1, NULL, 0, -1, -1, LUMPERROR}, + {"ddash", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"dbgsal", false, 110, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // SRB2kart - Skin sounds diff --git a/src/sounds.h b/src/sounds.h index b893cd6f..ebec0d9d 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -885,6 +885,8 @@ typedef enum sfx_ruby1, sfx_ruby2, sfx_hogbom, + sfx_kpogos, + sfx_ddash, sfx_dbgsal, sfx_kwin, diff --git a/src/v_video.c b/src/v_video.c index 8de78852..33d6609d 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -1758,8 +1758,9 @@ void V_DrawThinString(INT32 x, INT32 y, INT32 option, const char *string) case V_OLDSPACING: charwidth = 5; break; - case V_6WIDTHSPACE: - spacewidth = 3; + // Out of video flags, so we're reusing this for alternate charwidth instead + /*case V_6WIDTHSPACE: + spacewidth = 3;*/ default: break; } @@ -1801,7 +1802,8 @@ void V_DrawThinString(INT32 x, INT32 y, INT32 option, const char *string) if (charwidth) w = charwidth * dupx; else - w = (SHORT(tny_font[c]->width) * dupx); + w = ((option & V_6WIDTHSPACE ? max(1, SHORT(tny_font[c]->width)-1) // Reuse this flag for the alternate bunched-up spacing + : SHORT(tny_font[c]->width)) * dupx); if (cx > scrwidth) break; @@ -2223,8 +2225,9 @@ INT32 V_ThinStringWidth(const char *string, INT32 option) case V_OLDSPACING: charwidth = 5; break; - case V_6WIDTHSPACE: - spacewidth = 3; + // Out of video flags, so we're reusing this for alternate charwidth instead + /*case V_6WIDTHSPACE: + spacewidth = 3;*/ default: break; } @@ -2239,7 +2242,8 @@ INT32 V_ThinStringWidth(const char *string, INT32 option) if (c < 0 || c >= HU_FONTSIZE || !tny_font[c]) w += spacewidth; else - w += (charwidth ? charwidth : SHORT(tny_font[c]->width)); + w += (charwidth ? charwidth + : (option & V_6WIDTHSPACE ? max(1, SHORT(tny_font[c]->width)-1) : SHORT(tny_font[c]->width))); // Reuse this flag for the alternate bunched-up spacing } return w; diff --git a/src/w_wad.c b/src/w_wad.c index 3a828559..89fdadde 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -769,6 +769,29 @@ static size_t W_RawReadLumpHeader(UINT16 wad, UINT16 lump, void *dest, size_t si fseek(handle, (long)(l->position + offset), SEEK_SET); bytesread = fread(dest, 1, size, handle); +#if 1 // we're fucking sick of this + if (bytesread < 67) // http://garethrees.org/2007/11/14/pngcrush/ + return bytesread; + +#define sigcheck ((UINT8 *)dest) + if (sigcheck[0] == 0x89 + && sigcheck[1] == 0x50 + && sigcheck[2] == 0x4e + && sigcheck[3] == 0x47 + && sigcheck[4] == 0x0d + && sigcheck[5] == 0x0a + && sigcheck[6] == 0x1a + && sigcheck[7] == 0x0a) + { + char pnglump[9]; + strncpy(pnglump, l->name, 8); + pnglump[8] = '\0'; + I_Error("W_Wad: Lump \"%s\" is a .PNG - have you tried converting to Doom or Flat (raw) image formats?", pnglump); + } +#undef sigcheck + +#endif + return bytesread; } diff --git a/src/y_inter.c b/src/y_inter.c index f5e1ba6e..e26d4973 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -1071,7 +1071,8 @@ void Y_VoteDrawer(void) V_DrawFixedPatch((BASEVIDWIDTH-60)<