From 72d80a9aa890d93dfd86e95af75c0752e1ff7e56 Mon Sep 17 00:00:00 2001 From: Matthew Marsalko Date: Sun, 24 Dec 2017 23:09:06 -0800 Subject: [PATCH 001/293] Add support for overriding the ESC key --- src/g_input.c | 1 + src/g_input.h | 1 + src/m_menu.c | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/src/g_input.c b/src/g_input.c index b004384c..4f87332c 100644 --- a/src/g_input.c +++ b/src/g_input.c @@ -990,6 +990,7 @@ static const char *gamecontrolname[num_gamecontrols] = "jump", "console", "pause", + "systemmenu", "custom1", "custom2", "custom3", diff --git a/src/g_input.h b/src/g_input.h index d6533932..63350482 100644 --- a/src/g_input.h +++ b/src/g_input.h @@ -118,6 +118,7 @@ typedef enum gc_jump, gc_console, gc_pause, + gc_systemmenu, gc_custom1, // Lua scriptable gc_custom2, // Lua scriptable gc_custom3, // Lua scriptable diff --git a/src/m_menu.c b/src/m_menu.c index ea93d1e2..f438508a 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1077,6 +1077,8 @@ static menuitem_t OP_MiscControlsMenu[] = {IT_CALL | IT_STRING2, NULL, "Custom Action 2", M_ChangeControl, gc_custom2 }, {IT_CALL | IT_STRING2, NULL, "Custom Action 3", M_ChangeControl, gc_custom3 }, + {IT_CALL | IT_STRING2, NULL, "System Menu (ESC)",M_ChangeControl, gc_systemmenu }, + {IT_CALL | IT_STRING2, NULL, "Pause", M_ChangeControl, gc_pause }, {IT_CALL | IT_STRING2, NULL, "Console", M_ChangeControl, gc_console }, }; @@ -2176,11 +2178,14 @@ 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 From 0cc4b8d6db42e403b2692eb5e8f97ff0686c2320 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Tue, 6 Feb 2018 14:50:08 -0500 Subject: [PATCH 002/293] Smoother MD2 interpolation --- src/hardware/hw_md2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index f59c1d4f..d1315979 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -1347,7 +1347,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr) frame = (spr->mobj->frame & FF_FRAMEMASK) % md2->model->header.numFrames; buff = md2->model->glCommandBuffer; curr = &md2->model->frames[frame]; - if (cv_grmd2.value == 1) + if (cv_grmd2.value == 1 && tics <= durs) { // frames are handled differently for states with FF_ANIMATE, so get the next frame differently for the interpolation if (spr->mobj->frame & FF_ANIMATE) From 490f5beb89b90f77a98d49c39de700200859b170 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Tue, 13 Feb 2018 17:53:18 +0100 Subject: [PATCH 003/293] Do not prevent all net commands for the current tic from being executed because of an unkown net command ID --- src/d_clisrv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index d48f223c..87b154f8 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -401,8 +401,7 @@ static void ExtraDataTicker(void) DEBFILE(va("player %d kicked [gametic=%u] reason as follows:\n", i, gametic)); } CONS_Alert(CONS_WARNING, M_GetText("Got unknown net command [%s]=%d (max %d)\n"), sizeu1(curpos - bufferstart), *curpos, bufferstart[0]); - D_FreeTextcmd(gametic); - return; + break; } } } From bd2334dd93985799cb6f77909f2a145ab1474ab5 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Wed, 14 Feb 2018 21:00:55 +0100 Subject: [PATCH 004/293] Fix SV_StopServer not calling D_Clearticcmd correctly --- src/d_clisrv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 87b154f8..e42bceef 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3292,7 +3292,7 @@ void SV_StopServer(void) localtextcmd[0] = 0; localtextcmd2[0] = 0; - for (i = 0; i < BACKUPTICS; i++) + for (i = firstticstosend; i < firstticstosend + BACKUPTICS; i++) D_Clearticcmd(i); consoleplayer = 0; From 2139d4771f1fd6a0a870e73d76df9d44ef64b397 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Wed, 11 Apr 2018 14:40:05 -0400 Subject: [PATCH 005/293] Default sound volume is too loud --- src/android/i_cdmus.c | 2 +- src/djgppdos/i_cdmus.c | 2 +- src/s_sound.c | 2 +- src/sdl12/i_cdmus.c | 2 +- src/win32/win_cd.c | 2 +- src/win32ce/win_cd.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/android/i_cdmus.c b/src/android/i_cdmus.c index c5aac8f1..426bc5dc 100644 --- a/src/android/i_cdmus.c +++ b/src/android/i_cdmus.c @@ -8,7 +8,7 @@ UINT8 cdaudio_started = 0; -consvar_t cd_volume = {"cd_volume","31",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cd_volume = {"cd_volume","18",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cdUpdate = {"cd_update","1",CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; diff --git a/src/djgppdos/i_cdmus.c b/src/djgppdos/i_cdmus.c index f707add5..2a629ca1 100644 --- a/src/djgppdos/i_cdmus.c +++ b/src/djgppdos/i_cdmus.c @@ -50,7 +50,7 @@ static boolean wasPlaying; static int cdVolume=0; // current cd volume (0-31) // 0-31 like Music & Sfx, though CD hardware volume is 0-255. -consvar_t cd_volume = {"cd_volume","31",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cd_volume = {"cd_volume","18",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // allow Update for next/loop track // some crap cd drivers take up to diff --git a/src/s_sound.c b/src/s_sound.c index 47a95556..76ee4c64 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -78,7 +78,7 @@ consvar_t stereoreverse = {"stereoreverse", "Off", CV_SAVE, CV_OnOff, NULL, 0, N static consvar_t precachesound = {"precachesound", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; // actual general (maximum) sound & music volume, saved into the config -consvar_t cv_soundvolume = {"soundvolume", "31", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_soundvolume = {"soundvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_digmusicvolume = {"digmusicvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_midimusicvolume = {"midimusicvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // number of channels available diff --git a/src/sdl12/i_cdmus.c b/src/sdl12/i_cdmus.c index 1eeac370..b3490592 100644 --- a/src/sdl12/i_cdmus.c +++ b/src/sdl12/i_cdmus.c @@ -60,7 +60,7 @@ void SDL_SYS_CDQuit(void) UINT8 cdaudio_started = 0; // for system startup/shutdown -consvar_t cd_volume = {"cd_volume","31",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cd_volume = {"cd_volume","18",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cdUpdate = {"cd_update","1",CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; #ifndef NOSDLCD diff --git a/src/win32/win_cd.c b/src/win32/win_cd.c index 4ac1506e..f6c43074 100644 --- a/src/win32/win_cd.c +++ b/src/win32/win_cd.c @@ -161,7 +161,7 @@ static BOOL wasPlaying; //static INT cdVolume = 0; // current cd volume (0-31) // 0-31 like Music & Sfx, though CD hardware volume is 0-255. -consvar_t cd_volume = {"cd_volume","31",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cd_volume = {"cd_volume","18",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // allow Update for next/loop track // some crap cd drivers take up to diff --git a/src/win32ce/win_cd.c b/src/win32ce/win_cd.c index 2b1a8be9..940f59ff 100644 --- a/src/win32ce/win_cd.c +++ b/src/win32ce/win_cd.c @@ -159,7 +159,7 @@ static boolean wasPlaying; //static int cdVolume = 0; // current cd volume (0-31) // 0-31 like Music & Sfx, though CD hardware volume is 0-255. -consvar_t cd_volume = {"cd_volume","31",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cd_volume = {"cd_volume","18",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // allow Update for next/loop track // some crap cd drivers take up to From e66e0bb20e7b2f211c5ed5956b2539abcca1f99a Mon Sep 17 00:00:00 2001 From: GoldenTails <39245725+GoldenTails@users.noreply.github.com> Date: Sun, 13 May 2018 14:19:36 -0500 Subject: [PATCH 006/293] Fixed MD2 models not loading correctly on Linux --- src/hardware/hw_md2.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index f59c1d4f..5d156e1d 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -288,7 +288,8 @@ static md2_model_t *md2_readModel(const char *filename) if (model == NULL) return 0; - file = fopen(filename, "rb"); + //Filename checking fixed ~Monster Iestyn and Golden + file = fopen(va("%s"PATHSEP"%s", srb2home, filename), "rb"); if (!file) { free(model); @@ -477,7 +478,8 @@ static GrTextureFormat_t PNG_Load(const char *filename, int *w, int *h, GLPatch_ #endif #endif png_FILE_p png_FILE; - char *pngfilename = va("md2/%s", filename); + //Filename checking fixed ~Monster Iestyn and Golden + char *pngfilename = va("%s"PATHSEP"md2"PATHSEP"%s", srb2home, filename); FIL_ForceExtension(pngfilename, ".png"); png_FILE = fopen(pngfilename, "rb"); @@ -605,7 +607,8 @@ static GrTextureFormat_t PCX_Load(const char *filename, int *w, int *h, size_t pw, ph, size, ptr = 0; INT32 ch, rep; FILE *file; - char *pcxfilename = va("md2/%s", filename); + //Filename checking fixed ~Monster Iestyn and Golden + char *pcxfilename = va("%s"PATHSEP"md2"PATHSEP"%s", srb2home, filename); FIL_ForceExtension(pcxfilename, ".pcx"); file = fopen(pcxfilename, "rb"); @@ -795,7 +798,8 @@ void HWR_InitMD2(void) } // read the md2.dat file - f = fopen("md2.dat", "rt"); + //Filename checking fixed ~Monster Iestyn and Golden + f = fopen(va("%s"PATHSEP"%s", srb2home, "md2.dat"), "rt"); if (!f) { @@ -861,7 +865,8 @@ void HWR_AddPlayerMD2(int skin) // For MD2's that were added after startup CONS_Printf("AddPlayerMD2()...\n"); // read the md2.dat file - f = fopen("md2.dat", "rt"); + //Filename checking fixed ~Monster Iestyn and Golden + f = fopen(va("%s"PATHSEP"%s", srb2home, "md2.dat"), "rt"); if (!f) { @@ -906,7 +911,8 @@ void HWR_AddSpriteMD2(size_t spritenum) // For MD2s that were added after startu return; // Read the md2.dat file - f = fopen("md2.dat", "rt"); + //Filename checking fixed ~Monster Iestyn and Golden + f = fopen(va("%s"PATHSEP"%s", srb2home, "md2.dat"), "rt"); if (!f) { From 5f0a45124c8209fb10800ec76261e40a92572006 Mon Sep 17 00:00:00 2001 From: GoldenTails <39245725+GoldenTails@users.noreply.github.com> Date: Sun, 13 May 2018 14:32:33 -0500 Subject: [PATCH 007/293] Update hw_md2.c --- src/hardware/hw_md2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index 5d156e1d..3dc43470 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -26,6 +26,7 @@ #include #include +#include "../d_main.h" #include "../doomdef.h" #include "../doomstat.h" From 7783ddd13443854955a977d70a7fe087edad6d64 Mon Sep 17 00:00:00 2001 From: GoldenTails <39245725+GoldenTails@users.noreply.github.com> Date: Sun, 13 May 2018 14:34:08 -0500 Subject: [PATCH 008/293] Update hw_md2.c --- src/hardware/hw_md2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index 3dc43470..be547e5a 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -26,7 +26,6 @@ #include #include -#include "../d_main.h" #include "../doomdef.h" #include "../doomstat.h" @@ -34,6 +33,7 @@ #include "hw_drv.h" #include "hw_light.h" #include "hw_md2.h" +#include "../d_main.h" #include "../r_bsp.h" #include "../r_main.h" #include "../m_misc.h" From 7f084868b9a84baf9929e153513c9d5e224c9a4e Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sun, 13 May 2018 15:35:38 -0400 Subject: [PATCH 009/293] More helpful error message --- src/hardware/hw_md2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index f59c1d4f..99018e1e 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -799,7 +799,7 @@ void HWR_InitMD2(void) if (!f) { - CONS_Printf("%s", M_GetText("Error while loading md2.dat\n")); + CONS_Printf("%s %s\n", M_GetText("Error while loading md2.dat:"), strerror(errno)); nomd2s = true; return; } From b4d479ad9a121bcb4095e7610baaed63c27f6ebe Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sun, 13 May 2018 16:04:34 -0400 Subject: [PATCH 010/293] Include errno if not already included. --- src/hardware/hw_md2.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index 99018e1e..d6052445 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -67,6 +67,10 @@ #endif #endif +#ifndef errno +#include "errno.h" +#endif + #define NUMVERTEXNORMALS 162 float avertexnormals[NUMVERTEXNORMALS][3] = { {-0.525731f, 0.000000f, 0.850651f}, From 0b6d6c3363d4b1aeece18a415caec54e7b0aca86 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Thu, 24 May 2018 16:24:09 -0400 Subject: [PATCH 011/293] GME low volume fix --- src/sdl/mixer_sound.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 71832459..8938cb74 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -458,7 +458,7 @@ static void mix_gme(void *udata, Uint8 *stream, int len) // apply volume to stream for (i = 0, p = (short *)stream; i < len/2; i++, p++) - *p = ((INT32)*p) * music_volume / 31; + *p = ((INT32)*p) * music_volume*2/31; } #endif From 0248fcecd40c67fa6adffe0b6d0ff2a93ea46ceb Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Tue, 29 May 2018 20:31:28 -0400 Subject: [PATCH 012/293] Some small change Really this is just to prevent the music end up being disorted at max volume --- src/sdl/mixer_sound.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 8938cb74..fd8e64de 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -458,7 +458,8 @@ static void mix_gme(void *udata, Uint8 *stream, int len) // apply volume to stream for (i = 0, p = (short *)stream; i < len/2; i++, p++) - *p = ((INT32)*p) * music_volume*2/31; + *p = ((INT32)*p) * music_volume*2 / 42; + CONS_Printf("%hs", p); } #endif From e394f7992deb81a195709126bec7e9cc68d14114 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Tue, 29 May 2018 22:12:36 -0400 Subject: [PATCH 013/293] Removed CONS_Printf line. That wasn't meant to be commited. --- src/sdl/mixer_sound.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index fd8e64de..49742272 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -459,7 +459,6 @@ static void mix_gme(void *udata, Uint8 *stream, int len) // apply volume to stream for (i = 0, p = (short *)stream; i < len/2; i++, p++) *p = ((INT32)*p) * music_volume*2 / 42; - CONS_Printf("%hs", p); } #endif From bf3910cdcab5db2dabf987b2301d700da27a6a73 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 31 May 2018 20:51:05 -0400 Subject: [PATCH 014/293] Incredibly rudimentary Jawz stuff --- src/dehacked.c | 83 ++++++++----------- src/info.c | 212 +++++++++++++++++++++++-------------------------- src/info.h | 86 +++++++++----------- src/k_kart.c | 24 +++--- src/p_inter.c | 12 +-- src/p_map.c | 72 ++++++++--------- src/p_mobj.c | 77 +++++++++--------- src/p_user.c | 6 +- 8 files changed, 265 insertions(+), 307 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 09a892cd..81a10170 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6301,8 +6301,8 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit //} // Banana - "S_BANANAITEM", - "S_DEADBANANA", + "S_BANANA", + "S_BANANA_DEAD", //{ Orbinaut "S_GREENSHIELD1", @@ -6324,23 +6324,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_DEADGREEN", //} //{ Jawz - "S_REDSHIELD1", - "S_REDSHIELD2", - "S_REDSHIELD3", - "S_REDSHIELD4", - "S_REDSHIELD5", - "S_REDSHIELD6", - "S_REDSHIELD7", - "S_REDSHIELD8", - "S_REDITEM1", - "S_REDITEM2", - "S_REDITEM3", - "S_REDITEM4", - "S_REDITEM5", - "S_REDITEM6", - "S_REDITEM7", - "S_REDITEM8", - "S_DEADRED", + "S_JAWZ", + "S_JAWZ_SHIELD", + "S_JAWZ_DEAD", //} "S_FIRETRAIL1", @@ -6354,28 +6340,28 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_FIRETRAIL9", // Special Stage Mine - "S_MINESHIELD1", - "S_MINESHIELD2", - "S_MINEAIR1", - "S_MINEAIR2", - "S_MINEDEPLOY1", - "S_MINEDEPLOY2", - "S_MINEDEPLOY3", - "S_MINEDEPLOY4", - "S_MINEDEPLOY5", - "S_MINEDEPLOY6", - "S_MINEDEPLOY7", - "S_MINEDEPLOY8", - "S_MINEDEPLOY9", - "S_MINEDEPLOY10", - "S_MINEDEPLOY11", - "S_MINEDEPLOY12", - "S_MINEDEPLOY13", - "S_MINEITEM1", - "S_MINEITEM2", - "S_MINEITEM3", - "S_MINEITEM4", - "S_MINEEXPLODE", + "S_SSMINE1", + "S_SSMINE2", + "S_SSMINE3", + "S_SSMINE4", + "S_SSMINE_SHIELD1", + "S_SSMINE_SHIELD2", + "S_SSMINE_AIR1", + "S_SSMINE_AIR2", + "S_SSMINE_DEPLOY1", + "S_SSMINE_DEPLOY2", + "S_SSMINE_DEPLOY3", + "S_SSMINE_DEPLOY4", + "S_SSMINE_DEPLOY5", + "S_SSMINE_DEPLOY6", + "S_SSMINE_DEPLOY7", + "S_SSMINE_DEPLOY8", + "S_SSMINE_DEPLOY9", + "S_SSMINE_DEPLOY10", + "S_SSMINE_DEPLOY11", + "S_SSMINE_DEPLOY12", + "S_SSMINE_DEPLOY13", + "S_SSMINE_EXPLODE", "S_MINEEXPLOSION1", "S_MINEEXPLOSION2", @@ -7125,20 +7111,19 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_FAKESHIELD", "MT_FAKEITEM", - - "MT_BANANASHIELD", // Banana Stuff - "MT_BANANAITEM", + "MT_BANANA", + "MT_BANANA_SHIELD", // Banana Stuff "MT_GREENSHIELD", // Orbinaut stuff "MT_GREENITEM", "MT_FIRETRAIL", - "MT_REDSHIELD", // Jawz stuff - "MT_REDITEM", - "MT_REDITEMDUD", + "MT_JAWZ", // Jawz stuff + "MT_JAWZ_DUD", + "MT_JAWZ_SHIELD", - "MT_MINESHIELD", // Special Stage Mine stuff - "MT_MINEITEM", + "MT_SSMINE_SHIELD", // Special Stage Mine stuff + "MT_SSMINE", "MT_MINEEXPLOSION", "MT_MINEEXPLOSIONSOUND", diff --git a/src/info.c b/src/info.c index b5533cfe..c2c939ef 100644 --- a/src/info.c +++ b/src/info.c @@ -56,7 +56,7 @@ char sprnames[NUMSPRITES + 1][5] = "SRBJ","SRBK","SRBL","SRBM","SRBN","SRBO", //SRB2kart Sprites "SPRG","BSPR","RNDM","KFRE","KINV","KINF","DRIF","DSMO","FITM","BANA", - "GSHE","RSHE","SSMN","KRBM","BLIG","LIGH","SINK","SITR","KBLN","LAKI", + "GSHE","JAWZ","SSMN","KRBM","BLIG","LIGH","SINK","SITR","KBLN","LAKI", "POKE","AUDI","DECO","DOOD","SNES","GBAS","SPRS","BUZB","CHOM","SACO", "CRAB","SHAD","BUMP","FLEN","CLAS","PSHW","ARRO","ITEM","ITMI","ITMN", "PBOM" @@ -2636,8 +2636,8 @@ state_t states[NUMSTATES] = {SPR_FITM, 23, 3, {NULL}, 0, 0, S_FAKEITEM1}, // S_FAKEITEM24 // ***** {SPR_FITM, 24, 175, {NULL}, 0, 0, S_FAKEITEM1}, // S_DEADFAKEITEM - {SPR_BANA, 0, -1, {NULL}, 0, 0, S_NULL}, // S_BANANAITEM - {SPR_BANA, 1, 175, {NULL}, 0, 0, S_NULL}, // S_DEADBANANA + {SPR_BANA, 0, -1, {NULL}, 0, 0, S_NULL}, // S_BANANA + {SPR_BANA, 1, 175, {NULL}, 0, 0, S_NULL}, // S_BANANA_DEAD {SPR_GSHE, 0, 1, {NULL}, 0, 0, S_GREENSHIELD2}, // S_GREENSHIELD1 {SPR_GSHE, 1, 1, {NULL}, 0, 0, S_GREENSHIELD3}, // S_GREENSHIELD2 @@ -2657,23 +2657,9 @@ state_t states[NUMSTATES] = {SPR_GSHE, 7, 1, {NULL}, 0, 0, S_GREENITEM1}, // S_GREENITEM8 {SPR_GSHE, 8, 175, {NULL}, 0, 0, S_NULL}, // S_DEADGREEN - {SPR_RSHE, 0, 1, {NULL}, 0, 0, S_REDSHIELD2}, // S_REDSHIELD1 - {SPR_RSHE, 1, 1, {NULL}, 0, 0, S_REDSHIELD3}, // S_REDSHIELD2 - {SPR_RSHE, 2, 1, {NULL}, 0, 0, S_REDSHIELD4}, // S_REDSHIELD3 - {SPR_RSHE, 3, 1, {NULL}, 0, 0, S_REDSHIELD5}, // S_REDSHIELD4 - {SPR_RSHE, 4, 1, {NULL}, 0, 0, S_REDSHIELD6}, // S_REDSHIELD5 - {SPR_RSHE, 5, 1, {NULL}, 0, 0, S_REDSHIELD7}, // S_REDSHIELD6 - {SPR_RSHE, 6, 1, {NULL}, 0, 0, S_REDSHIELD8}, // S_REDSHIELD7 - {SPR_RSHE, 7, 1, {NULL}, 0, 0, S_REDSHIELD1}, // S_REDSHIELD8 - {SPR_RSHE, 0, 1, {A_JawzChase}, 0, 0, S_REDITEM2}, // S_REDITEM1 - {SPR_RSHE, 1, 1, {A_JawzChase}, 0, 0, S_REDITEM3}, // S_REDITEM2 - {SPR_RSHE, 2, 1, {A_JawzChase}, 0, 0, S_REDITEM4}, // S_REDITEM3 - {SPR_RSHE, 3, 1, {A_JawzChase}, 0, 0, S_REDITEM5}, // S_REDITEM4 - {SPR_RSHE, 4, 1, {A_JawzChase}, 0, 0, S_REDITEM6}, // S_REDITEM5 - {SPR_RSHE, 5, 1, {A_JawzChase}, 0, 0, S_REDITEM7}, // S_REDITEM6 - {SPR_RSHE, 6, 1, {A_JawzChase}, 0, 0, S_REDITEM8}, // S_REDITEM7 - {SPR_RSHE, 7, 1, {A_JawzChase}, 0, 0, S_REDITEM1}, // S_REDITEM8 - {SPR_RSHE, 8, 175, {NULL}, 0, 0, S_NULL}, // S_DEADRED + {SPR_JAWZ, 0, 1, {A_JawzChase}, 0, 0, S_JAWZ}, // S_JAWZ + {SPR_JAWZ, 0, 1, {NULL}, 0, 0, S_JAWZ_SHIELD}, // S_JAWZ_SHIELD + {SPR_JAWZ, 0, 0, {NULL}, 0, 0, S_NULL}, // S_JAWZ_DEAD {SPR_FBLL, 13, 3, {NULL}, 0, 0, S_FIRETRAIL2}, // S_FIRETRAIL1 {SPR_FBLL, 14, 3, {NULL}, 0, 0, S_FIRETRAIL3}, // S_FIRETRAIL2 @@ -2685,28 +2671,28 @@ state_t states[NUMSTATES] = {SPR_FBLL, 20, 3, {NULL}, 0, 0, S_FIRETRAIL9}, // S_FIRETRAIL8 {SPR_FBLL, 21, 3, {NULL}, 0, 0, S_NULL}, // S_FIRETRAIL9 - {SPR_SSMN, 4, 1, {NULL}, 0, 0, S_MINESHIELD2}, // S_MINESHIELD1 - {SPR_SSMN, 5, 1, {NULL}, 0, 0, S_MINESHIELD1}, // S_MINESHIELD2 - {SPR_SSMN, 4, 1, {NULL}, 0, 0, S_MINEAIR2}, // S_MINEAIR1 - {SPR_SSMN, 5, 1, {NULL}, 0, 0, S_MINEAIR1}, // S_MINEAIR2 - {SPR_SSMN, 6, 3, {NULL}, 0, 0, S_MINEDEPLOY2}, // S_MINEDEPLOY1 - {SPR_SSMN, 7, 5, {NULL}, 0, 0, S_MINEDEPLOY3}, // S_MINEDEPLOY2 - {SPR_SSMN, 8, 7, {NULL}, 0, 0, S_MINEDEPLOY4}, // S_MINEDEPLOY3 - {SPR_SSMN, 9, 1, {NULL}, 0, 0, S_MINEDEPLOY5}, // S_MINEDEPLOY4 - {SPR_SSMN, 10, 1, {NULL}, 0, 0, S_MINEDEPLOY6}, // S_MINEDEPLOY5 - {SPR_SSMN, 9, 1, {NULL}, 0, 0, S_MINEDEPLOY7}, // S_MINEDEPLOY6 - {SPR_SSMN, 10, 3, {NULL}, 0, 0, S_MINEDEPLOY8}, // S_MINEDEPLOY7 - {SPR_SSMN, 11, 1, {NULL}, 0, 0, S_MINEDEPLOY9}, // S_MINEDEPLOY8 - {SPR_SSMN, 10, 1, {NULL}, 0, 0, S_MINEDEPLOY10}, // S_MINEDEPLOY9 - {SPR_SSMN, 11, 3, {NULL}, 0, 0, S_MINEDEPLOY11}, // S_MINEDEPLOY10 - {SPR_SSMN, 12, 3, {NULL}, 0, 0, S_MINEDEPLOY12}, // S_MINEDEPLOY11 - {SPR_SSMN, 13, 3, {NULL}, 0, 0, S_MINEDEPLOY13}, // S_MINEDEPLOY12 - {SPR_SSMN, 14, 3, {NULL}, 0, 0, S_MINEITEM1}, // S_MINEDEPLOY13 - {SPR_SSMN, 0, 30, {NULL}, 0, 0, S_MINEITEM2}, // S_MINEITEM1 - {SPR_SSMN, 3, 3, {NULL}, 0, 0, S_MINEITEM3}, // S_MINEITEM2 - {SPR_SSMN, 2, 3, {NULL}, 0, 0, S_MINEITEM4}, // S_MINEITEM3 - {SPR_SSMN, 1, 3, {NULL}, 0, 0, S_MINEITEM1}, // S_MINEITEM4 - {SPR_SSMN, 3, 1, {A_MineExplode}, MT_MINEEXPLOSION, 0, S_NULL}, // S_MINEEXPLODE + {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 + {SPR_SSMN, 1, 3, {NULL}, 0, 0, S_SSMINE1}, // S_SSMINE4 + {SPR_SSMN, 4, 1, {NULL}, 0, 0, S_SSMINE_SHIELD2}, // S_SSMINE_SHIELD1 + {SPR_SSMN, 5, 1, {NULL}, 0, 0, S_SSMINE_SHIELD1}, // S_SSMINE_SHIELD2 + {SPR_SSMN, 4, 1, {NULL}, 0, 0, S_SSMINE_AIR2}, // S_SSMINE_AIR1 + {SPR_SSMN, 5, 1, {NULL}, 0, 0, S_SSMINE_AIR1}, // S_SSMINE_AIR2 + {SPR_SSMN, 6, 3, {NULL}, 0, 0, S_SSMINE_DEPLOY2}, // S_SSMINE_DEPLOY1 + {SPR_SSMN, 7, 5, {NULL}, 0, 0, S_SSMINE_DEPLOY3}, // S_SSMINE_DEPLOY2 + {SPR_SSMN, 8, 7, {NULL}, 0, 0, S_SSMINE_DEPLOY4}, // S_SSMINE_DEPLOY3 + {SPR_SSMN, 9, 1, {NULL}, 0, 0, S_SSMINE_DEPLOY5}, // S_SSMINE_DEPLOY4 + {SPR_SSMN, 10, 1, {NULL}, 0, 0, S_SSMINE_DEPLOY6}, // S_SSMINE_DEPLOY5 + {SPR_SSMN, 9, 1, {NULL}, 0, 0, S_SSMINE_DEPLOY7}, // S_SSMINE_DEPLOY6 + {SPR_SSMN, 10, 3, {NULL}, 0, 0, S_SSMINE_DEPLOY8}, // S_SSMINE_DEPLOY7 + {SPR_SSMN, 11, 1, {NULL}, 0, 0, S_SSMINE_DEPLOY9}, // S_SSMINE_DEPLOY8 + {SPR_SSMN, 10, 1, {NULL}, 0, 0, S_SSMINE_DEPLOY10}, // S_SSMINE_DEPLOY9 + {SPR_SSMN, 11, 3, {NULL}, 0, 0, S_SSMINE_DEPLOY11}, // S_SSMINE_DEPLOY10 + {SPR_SSMN, 12, 3, {NULL}, 0, 0, S_SSMINE_DEPLOY12}, // S_SSMINE_DEPLOY11 + {SPR_SSMN, 13, 3, {NULL}, 0, 0, S_SSMINE_DEPLOY13}, // S_SSMINE_DEPLOY12 + {SPR_SSMN, 14, 3, {NULL}, 0, 0, S_SSMINE1}, // S_SSMINE_DEPLOY13 + {SPR_SSMN, 3, 1, {A_MineExplode}, MT_MINEEXPLOSION, 0, S_NULL}, // S_SSMINE_EXPLODE {SPR_NULL, 0, 6, {NULL}, 0, 0, S_MINEEXPLOSION2}, // S_MINEEXPLOSION1 {SPR_NULL, 1, 22, {A_ForceStop}, 0, 0, S_NULL}, // S_MINEEXPLOSION2 @@ -14471,36 +14457,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_BANANASHIELD + { // MT_BANANA -1, // doomednum - S_BANANAITEM, // 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_DEADBANANA, // deathstate - S_NULL, // xdeathstate - sfx_None, // deathsound - 0, // speed - 16*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 100, // mass - 1, // damage - sfx_None, // activesound - MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY, // flags - S_NULL // raisestate - }, - - { // MT_BANANAITEM - -1, // doomednum - S_BANANAITEM, // spawnstate + S_BANANA, // spawnstate 2, // spawnhealth S_NULL, // seestate sfx_tossed, // seesound @@ -14511,7 +14470,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_DEADBANANA, // deathstate + S_BANANA_DEAD, // deathstate S_NULL, // xdeathstate sfx_None, // deathsound 0, // speed @@ -14525,6 +14484,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_BANANA_SHIELD + -1, // doomednum + S_BANANA, // 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_BANANA_DEAD, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + 1, // damage + sfx_None, // activesound + MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY, // flags + S_NULL // raisestate + }, + { // MT_GREENSHIELD -1, // doomednum S_GREENSHIELD1, // spawnstate @@ -14606,36 +14592,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_REDSHIELD + { // MT_JAWZ -1, // doomednum - S_REDSHIELD1, // 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_DEADRED, // deathstate - S_NULL, // xdeathstate - sfx_None, // deathsound - 10*FRACUNIT, // speed - 16*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 100, // mass - 1, // damage - sfx_None, // activesound - MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY, // flags - S_NULL // raisestate - }, - - { // MT_REDITEM - -1, // doomednum - S_REDITEM1, // spawnstate + S_JAWZ, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_tossed, // seesound @@ -14646,7 +14605,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_DEADRED, // deathstate + S_JAWZ_DEAD, // deathstate S_NULL, // xdeathstate sfx_shbrk, // deathsound 7*FRACUNIT, // speed @@ -14660,9 +14619,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_REDITEMDUD + { // MT_JAWZ_DUD -1, // doomednum - S_REDITEM1, // spawnstate + S_JAWZ, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_tossed, // seesound @@ -14673,7 +14632,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_DEADRED, // deathstate + S_JAWZ_DEAD, // deathstate S_NULL, // xdeathstate sfx_shbrk, // deathsound 56*FRACUNIT, // speed @@ -14687,20 +14646,20 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_MINESHIELD + { // MT_JAWZ_SHIELD -1, // doomednum - S_MINESHIELD1, // spawnstate + S_JAWZ_SHIELD, // spawnstate 1000, // spawnhealth S_NULL, // seestate sfx_None, // seesound 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate - 320*FRACUNIT, // painchance + 0, // painchance sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_MINEEXPLODE, // deathstate + S_JAWZ_DEAD, // deathstate S_NULL, // xdeathstate sfx_None, // deathsound 10*FRACUNIT, // speed @@ -14714,9 +14673,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_MINEITEM + { // MT_SSMINE -1, // doomednum - S_MINEAIR1, // spawnstate + S_SSMINE_AIR1, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_tossed, // seesound @@ -14727,7 +14686,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_MINEEXPLODE, // deathstate + S_SSMINE_EXPLODE, // deathstate S_NULL, // xdeathstate sfx_None, // deathsound 0, // speed @@ -14741,6 +14700,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_SSMINE_SHIELD + -1, // doomednum + S_SSMINE_SHIELD1, // spawnstate + 1000, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 320*FRACUNIT, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_SSMINE_EXPLODE, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 10*FRACUNIT, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + 1, // damage + sfx_None, // activesound + MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY, // flags + S_NULL // raisestate + }, + { // MT_MINEEXPLOSION -1, // doomednum S_MINEEXPLOSION1, // spawnstate @@ -14916,7 +14902,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_MINEEXPLODE, // deathstate + S_SSMINE_EXPLODE, // deathstate S_NULL, // xdeathstate sfx_None, // deathsound 0, // speed diff --git a/src/info.h b/src/info.h index 97a40755..c1244934 100644 --- a/src/info.h +++ b/src/info.h @@ -589,7 +589,7 @@ typedef enum sprite SPR_FITM, // Eggman Monitor SPR_BANA, // Banana Peel SPR_GSHE, // Orbinaut - SPR_RSHE, // Jawz + SPR_JAWZ, // Jawz SPR_SSMN, // SS Mine SPR_KRBM, // SS Mine BOOM SPR_BLIG, // Self-Propelled Bomb @@ -3144,8 +3144,8 @@ typedef enum state //} // Banana - S_BANANAITEM, - S_DEADBANANA, + S_BANANA, + S_BANANA_DEAD, //{ Orbinaut S_GREENSHIELD1, @@ -3167,23 +3167,9 @@ typedef enum state S_DEADGREEN, //} //{ Jawz - S_REDSHIELD1, - S_REDSHIELD2, - S_REDSHIELD3, - S_REDSHIELD4, - S_REDSHIELD5, - S_REDSHIELD6, - S_REDSHIELD7, - S_REDSHIELD8, - S_REDITEM1, - S_REDITEM2, - S_REDITEM3, - S_REDITEM4, - S_REDITEM5, - S_REDITEM6, - S_REDITEM7, - S_REDITEM8, - S_DEADRED, + S_JAWZ, + S_JAWZ_SHIELD, + S_JAWZ_DEAD, //} S_FIRETRAIL1, @@ -3197,28 +3183,28 @@ typedef enum state S_FIRETRAIL9, // Special Stage Mine - S_MINESHIELD1, - S_MINESHIELD2, - S_MINEAIR1, - S_MINEAIR2, - S_MINEDEPLOY1, - S_MINEDEPLOY2, - S_MINEDEPLOY3, - S_MINEDEPLOY4, - S_MINEDEPLOY5, - S_MINEDEPLOY6, - S_MINEDEPLOY7, - S_MINEDEPLOY8, - S_MINEDEPLOY9, - S_MINEDEPLOY10, - S_MINEDEPLOY11, - S_MINEDEPLOY12, - S_MINEDEPLOY13, - S_MINEITEM1, - S_MINEITEM2, - S_MINEITEM3, - S_MINEITEM4, - S_MINEEXPLODE, + S_SSMINE1, + S_SSMINE2, + S_SSMINE3, + S_SSMINE4, + S_SSMINE_SHIELD1, + S_SSMINE_SHIELD2, + S_SSMINE_AIR1, + S_SSMINE_AIR2, + S_SSMINE_DEPLOY1, + S_SSMINE_DEPLOY2, + S_SSMINE_DEPLOY3, + S_SSMINE_DEPLOY4, + S_SSMINE_DEPLOY5, + S_SSMINE_DEPLOY6, + S_SSMINE_DEPLOY7, + S_SSMINE_DEPLOY8, + S_SSMINE_DEPLOY9, + S_SSMINE_DEPLOY10, + S_SSMINE_DEPLOY11, + S_SSMINE_DEPLOY12, + S_SSMINE_DEPLOY13, + S_SSMINE_EXPLODE, S_MINEEXPLOSION1, S_MINEEXPLOSION2, @@ -3985,19 +3971,19 @@ typedef enum mobj_type MT_FAKESHIELD, MT_FAKEITEM, - MT_BANANASHIELD, // Banana Stuff - MT_BANANAITEM, - + MT_BANANA, // Banana Stuff + MT_BANANA_SHIELD, + MT_GREENSHIELD, // Orbinaut stuff MT_GREENITEM, MT_FIRETRAIL, - MT_REDSHIELD, // Jawz stuff - MT_REDITEM, - MT_REDITEMDUD, + MT_JAWZ, // Jawz stuff + MT_JAWZ_DUD, + MT_JAWZ_SHIELD, - MT_MINESHIELD, // Mine stuff - MT_MINEITEM, + MT_SSMINE, // Mine stuff + MT_SSMINE_SHIELD, MT_MINEEXPLOSION, MT_MINEEXPLOSIONSOUND, diff --git a/src/k_kart.c b/src/k_kart.c index ef00f108..cddc478a 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2781,7 +2781,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) newangle = player->mo->angle; newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, 64*FRACUNIT); newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, 64*FRACUNIT); - mo = P_SpawnMobj(newx, newy, player->mo->z, MT_BANANASHIELD); + mo = P_SpawnMobj(newx, newy, player->mo->z, MT_BANANA_SHIELD); mo->threshold = 10; if (mo) P_SetTarget(&mo->target, player->mo); @@ -2804,7 +2804,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) newangle = player->mo->angle; newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, 64*FRACUNIT); newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, 64*FRACUNIT); - mo = P_SpawnMobj(newx, newy, player->mo->z, MT_BANANASHIELD); + mo = P_SpawnMobj(newx, newy, player->mo->z, MT_BANANA_SHIELD); if (mo) { @@ -2818,14 +2818,14 @@ void K_MoveKartPlayer(player_t *player, boolean onground) } else if (!(cmd->buttons & BT_ATTACK) && player->kartstuff[k_itemheld] == 1) { - K_ThrowKartItem(player, false, MT_BANANAITEM, -1, false); + K_ThrowKartItem(player, false, MT_BANANA, -1, false); K_PlayTauntSound(player->mo); player->kartstuff[k_itemamount]--; player->kartstuff[k_itemheld] = 0; } else if (ATTACK_IS_DOWN && player->kartstuff[k_itemheld] == 2) // Banana x3 thrown { - K_ThrowKartItem(player, false, MT_BANANAITEM, -1,false ); + K_ThrowKartItem(player, false, MT_BANANA, -1,false ); K_PlayTauntSound(player->mo); player->pflags |= PF_ATTACKDOWN; player->kartstuff[k_itemamount]--; @@ -2937,7 +2937,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) newangle = player->mo->angle; newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, 64*FRACUNIT); newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, 64*FRACUNIT); - mo = P_SpawnMobj(newx, newy, player->mo->z, MT_REDSHIELD); + mo = P_SpawnMobj(newx, newy, player->mo->z, MT_JAWZ_SHIELD); mo->threshold = 10; if (mo) P_SetTarget(&mo->target, player->mo); @@ -2960,7 +2960,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) newangle = player->mo->angle; newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, 64*FRACUNIT); newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, 64*FRACUNIT); - mo = P_SpawnMobj(newx, newy, player->mo->z, MT_REDSHIELD); + mo = P_SpawnMobj(newx, newy, player->mo->z, MT_JAWZ_SHIELD); if (mo) { mo->threshold = 10; @@ -2976,17 +2976,17 @@ void K_MoveKartPlayer(player_t *player, boolean onground) player->kartstuff[k_itemamount]--; player->kartstuff[k_itemheld] = 0; if (player->kartstuff[k_throwdir] == 1 || player->kartstuff[k_throwdir] == 0) - K_ThrowKartItem(player, true, MT_REDITEM, 1, false); + K_ThrowKartItem(player, true, MT_JAWZ, 1, false); else if (player->kartstuff[k_throwdir] == -1) // Throwing backward gives you a dud that doesn't home in - K_ThrowKartItem(player, true, MT_REDITEMDUD, -1, false); + K_ThrowKartItem(player, true, MT_JAWZ_DUD, -1, false); K_PlayTauntSound(player->mo); } else if (ATTACK_IS_DOWN && HOLDING_ITEM && player->kartstuff[k_itemheld] == 2) // Jawz x2 thrown { if (player->kartstuff[k_throwdir] == 1 || player->kartstuff[k_throwdir] == 0) - K_ThrowKartItem(player, true, MT_REDITEM, 1, false); + K_ThrowKartItem(player, true, MT_JAWZ, 1, false); else if (player->kartstuff[k_throwdir] == -1) // Throwing backward gives you a dud that doesn't home in - K_ThrowKartItem(player, true, MT_REDITEMDUD, -1, false); + K_ThrowKartItem(player, true, MT_JAWZ_DUD, -1, false); K_PlayTauntSound(player->mo); player->pflags |= PF_ATTACKDOWN; player->kartstuff[k_itemamount]--; @@ -3006,14 +3006,14 @@ void K_MoveKartPlayer(player_t *player, boolean onground) newangle = player->mo->angle; newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, 64*FRACUNIT); newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, 64*FRACUNIT); - mo = P_SpawnMobj(newx, newy, player->mo->z, MT_MINESHIELD); + mo = P_SpawnMobj(newx, newy, player->mo->z, MT_SSMINE_SHIELD); mo->threshold = 10; if (mo) P_SetTarget(&mo->target, player->mo); } else if (!(cmd->buttons & BT_ATTACK) && HOLDING_ITEM) { - K_ThrowKartItem(player, false, MT_MINEITEM, 1, true); + K_ThrowKartItem(player, false, MT_SSMINE, 1, true); K_PlayTauntSound(player->mo); player->kartstuff[k_itemamount]--; player->kartstuff[k_itemheld] = 0; diff --git a/src/p_inter.c b/src/p_inter.c index 60f6596e..b2c51cf3 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2013,9 +2013,9 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source) if ((target->target->player->kartstuff[k_itemheld]) && ((target->type == MT_GREENSHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_ORBINAUT) - || (target->type == MT_REDSHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_JAWZ) - || (target->type == MT_BANANASHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_BANANA) - || (target->type == MT_MINESHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_MINE))) + || (target->type == MT_JAWZ_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_JAWZ) + || (target->type == MT_BANANA_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_BANANA) + || (target->type == MT_SSMINE_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_MINE))) { if (target->lastlook > 0) target->target->player->kartstuff[k_itemamount] = target->lastlook-1; @@ -2036,8 +2036,8 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source) // SRB2kart if (target->type != MT_PLAYER && !(target->flags & MF_MONITOR) && !(target->type == MT_GREENITEM || target->type == MT_GREENSHIELD - || target->type == MT_REDITEM || target->type == MT_REDITEMDUD || target->type == MT_REDSHIELD - || target->type == MT_BANANAITEM || target->type == MT_BANANASHIELD + || target->type == MT_JAWZ || target->type == MT_JAWZ_DUD || target->type == MT_JAWZ_SHIELD + || target->type == MT_BANANA || target->type == MT_BANANA_SHIELD || target->type == MT_FAKEITEM || target->type == MT_FAKESHIELD || target->type == MT_FIREBALL)) // kart dead items target->flags |= MF_NOGRAVITY; // Don't drop Tails 03-08-2000 @@ -3167,7 +3167,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da else { if (inflictor && (inflictor->type == MT_GREENITEM || inflictor->type == MT_GREENSHIELD - || inflictor->type == MT_REDITEM || inflictor->type == MT_REDSHIELD || inflictor->type == MT_REDITEMDUD + || inflictor->type == MT_JAWZ || inflictor->type == MT_JAWZ_SHIELD || inflictor->type == MT_JAWZ_DUD || inflictor->type == MT_FAKEITEM || inflictor->type == MT_FAKESHIELD || inflictor->player)) { diff --git a/src/p_map.c b/src/p_map.c index 6be4be7e..12177a72 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -655,8 +655,8 @@ static boolean PIT_CheckThing(mobj_t *thing) if (tmthing->type == MT_RANDOMITEM) return true; - if (tmthing->type == MT_GREENITEM || tmthing->type == MT_REDITEM || tmthing->type == MT_REDITEMDUD - || tmthing->type == MT_GREENSHIELD || tmthing->type == MT_REDSHIELD) + if (tmthing->type == MT_GREENITEM || tmthing->type == MT_JAWZ || tmthing->type == MT_JAWZ_DUD + || tmthing->type == MT_GREENSHIELD || tmthing->type == MT_JAWZ_SHIELD) { // see if it went over / under if (tmthing->z > thing->z + thing->height) @@ -670,13 +670,13 @@ static boolean PIT_CheckThing(mobj_t *thing) if (tmthing->health <= 0 || thing->health <= 0) return true; - if ((tmthing->type == MT_GREENSHIELD || tmthing->type == MT_REDSHIELD) && tmthing->lastlook - && (thing->type == MT_GREENSHIELD || thing->type == MT_REDSHIELD) && thing->lastlook + if ((tmthing->type == MT_GREENSHIELD || tmthing->type == MT_JAWZ_SHIELD) && tmthing->lastlook + && (thing->type == MT_GREENSHIELD || thing->type == MT_JAWZ_SHIELD) && thing->lastlook && (tmthing->target == thing->target)) // Don't hit each other if you have the same target return true; if (thing->player && thing->player->powers[pw_flashing] - && !(tmthing->type == MT_GREENITEM || tmthing->type == MT_REDITEM || tmthing->type == MT_REDITEMDUD)) + && !(tmthing->type == MT_GREENITEM || tmthing->type == MT_JAWZ || tmthing->type == MT_JAWZ_DUD)) return true; if (thing->type == MT_PLAYER) @@ -684,7 +684,7 @@ static boolean PIT_CheckThing(mobj_t *thing) // Player Damage P_DamageMobj(thing, tmthing, tmthing->target, 1); - if (tmthing->type == MT_GREENITEM || tmthing->type == MT_REDITEM || tmthing->type == MT_REDITEMDUD) + if (tmthing->type == MT_GREENITEM || tmthing->type == MT_JAWZ || tmthing->type == MT_JAWZ_DUD) S_StartSound(thing, sfx_shelit); // This Item Damage @@ -699,9 +699,9 @@ static boolean PIT_CheckThing(mobj_t *thing) P_SetObjectMomZ(tmthing, 8*FRACUNIT, false); P_InstaThrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y)+ANGLE_90, 16*FRACUNIT); } - else if (thing->type == MT_GREENITEM || thing->type == MT_REDITEM || thing->type == MT_REDITEMDUD - || thing->type == MT_GREENSHIELD || thing->type == MT_REDSHIELD - || thing->type == MT_BANANAITEM || thing->type == MT_BANANASHIELD + else if (thing->type == MT_GREENITEM || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD + || thing->type == MT_GREENSHIELD || thing->type == MT_JAWZ_SHIELD + || thing->type == MT_BANANA || thing->type == MT_BANANA_SHIELD || thing->type == MT_FIREBALL) { // Other Item Damage @@ -732,7 +732,7 @@ static boolean PIT_CheckThing(mobj_t *thing) } else if (thing->type == MT_FAKEITEM || thing->type == MT_FAKESHIELD) { - if (tmthing->type == MT_GREENSHIELD || tmthing->type == MT_REDSHIELD) + if (tmthing->type == MT_GREENSHIELD || tmthing->type == MT_JAWZ_SHIELD) { // This Item Damage if (tmthing->eflags & MFE_VERTICALFLIP) @@ -761,7 +761,7 @@ static boolean PIT_CheckThing(mobj_t *thing) P_SetObjectMomZ(thing, 8*FRACUNIT, false); P_InstaThrust(thing, R_PointToAngle2(tmthing->x, tmthing->y, thing->x, thing->y)+ANGLE_90, 16*FRACUNIT); } - else if (thing->type == MT_MINESHIELD || thing->type == MT_MINEITEM) + else if (thing->type == MT_SSMINE_SHIELD || thing->type == MT_SSMINE) { // This Item Damage if (tmthing->eflags & MFE_VERTICALFLIP) @@ -778,12 +778,12 @@ static boolean PIT_CheckThing(mobj_t *thing) // Bomb death P_KillMobj(thing, tmthing, tmthing); } - else if (thing->flags & MF_SPRING && (tmthing->type == MT_REDITEM || tmthing->type == MT_REDITEMDUD || tmthing->type == MT_GREENITEM)) + else if (thing->flags & MF_SPRING && (tmthing->type == MT_JAWZ || tmthing->type == MT_JAWZ_DUD || tmthing->type == MT_GREENITEM)) P_DoSpring(thing, tmthing); return true; } - else if (tmthing->flags & MF_SPRING && (thing->type == MT_REDITEM || thing->type == MT_REDITEMDUD || thing->type == MT_GREENITEM)) + else if (tmthing->flags & MF_SPRING && (thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD || thing->type == MT_GREENITEM)) { // see if it went over / under if (tmthing->z > thing->z + thing->height) @@ -849,7 +849,7 @@ static boolean PIT_CheckThing(mobj_t *thing) return true; // This doesn't collide with anything, but we want it to effect the player anyway. } - else if (tmthing->type == MT_BANANASHIELD || tmthing->type == MT_BANANAITEM + else if (tmthing->type == MT_BANANA_SHIELD || tmthing->type == MT_BANANA || tmthing->type == MT_FIREBALL) { // see if it went over / under @@ -864,7 +864,7 @@ static boolean PIT_CheckThing(mobj_t *thing) if (tmthing->health <= 0 || thing->health <= 0) return true; - if (((tmthing->type == MT_BANANASHIELD) && (thing->type == MT_BANANASHIELD)) + if (((tmthing->type == MT_BANANA_SHIELD) && (thing->type == MT_BANANA_SHIELD)) && (tmthing->target == thing->target)) // Don't hit each other if you have the same target return true; @@ -891,9 +891,9 @@ static boolean PIT_CheckThing(mobj_t *thing) P_SetObjectMomZ(tmthing, 8*FRACUNIT, false); P_InstaThrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y)+ANGLE_90, 16*FRACUNIT); } - else if (thing->type == MT_BANANAITEM || thing->type == MT_BANANASHIELD + else if (thing->type == MT_BANANA || thing->type == MT_BANANA_SHIELD || thing->type == MT_GREENITEM || thing->type == MT_GREENSHIELD - || thing->type == MT_REDITEM || thing->type == MT_REDITEMDUD || thing->type == MT_REDSHIELD + || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD || thing->type == MT_JAWZ_SHIELD || thing->type == MT_FIREBALL) { // Other Item Damage @@ -924,7 +924,7 @@ static boolean PIT_CheckThing(mobj_t *thing) } else if (thing->type == MT_FAKEITEM || thing->type == MT_FAKESHIELD) { - if (tmthing->type == MT_BANANASHIELD) + if (tmthing->type == MT_BANANA_SHIELD) { // This Item Damage if (tmthing->eflags & MFE_VERTICALFLIP) @@ -973,9 +973,9 @@ static boolean PIT_CheckThing(mobj_t *thing) return true; if (thing->type == MT_GREENITEM // When these items collide with the fake item, just the fake item is destroyed - || thing->type == MT_REDITEM || thing->type == MT_REDITEMDUD - || thing->type == MT_MINEITEM - || thing->type == MT_BANANAITEM || thing->type == MT_FIREBALL) + || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD + || thing->type == MT_SSMINE + || thing->type == MT_BANANA || thing->type == MT_FIREBALL) { // This Item Damage if (tmthing->eflags & MFE_VERTICALFLIP) @@ -990,9 +990,9 @@ static boolean PIT_CheckThing(mobj_t *thing) P_InstaThrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y)+ANGLE_90, 16*FRACUNIT); } else if (thing->type == MT_GREENSHIELD // When these items collide with the fake item, both of them are destroyed - || thing->type == MT_REDSHIELD - || thing->type == MT_MINESHIELD - || thing->type == MT_BANANASHIELD + || thing->type == MT_JAWZ_SHIELD + || thing->type == MT_SSMINE_SHIELD + || thing->type == MT_BANANA_SHIELD || thing->type == MT_FAKEITEM || thing->type == MT_FAKESHIELD) { // Other Item Damage @@ -1041,7 +1041,7 @@ static boolean PIT_CheckThing(mobj_t *thing) return true; } - else if (tmthing->type == MT_MINESHIELD || tmthing->type == MT_MINEITEM) + else if (tmthing->type == MT_SSMINE_SHIELD || tmthing->type == MT_SSMINE) { // see if it went over / under if (tmthing->z > thing->z + thing->height) @@ -1062,8 +1062,8 @@ static boolean PIT_CheckThing(mobj_t *thing) { P_KillMobj(tmthing, thing, thing); } - else if (thing->type == MT_GREENITEM || thing->type == MT_REDITEM || thing->type == MT_REDITEMDUD - || thing->type == MT_GREENSHIELD || thing->type == MT_REDSHIELD) + else if (thing->type == MT_GREENITEM || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD + || thing->type == MT_GREENSHIELD || thing->type == MT_JAWZ_SHIELD) { P_KillMobj(tmthing, thing, thing); @@ -1084,10 +1084,10 @@ static boolean PIT_CheckThing(mobj_t *thing) } else if (tmthing->type == MT_PLAYER && (thing->type == MT_GREENSHIELD || thing->type == MT_GREENITEM - || thing->type == MT_REDSHIELD || thing->type == MT_REDITEM || thing->type == MT_REDITEMDUD + || thing->type == MT_JAWZ_SHIELD || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD || thing->type == MT_FAKESHIELD || thing->type == MT_FAKEITEM - || thing->type == MT_BANANASHIELD || thing->type == MT_BANANAITEM - || thing->type == MT_MINESHIELD || thing->type == MT_MINEITEM + || thing->type == MT_BANANA_SHIELD || thing->type == MT_BANANA + || thing->type == MT_SSMINE_SHIELD || thing->type == MT_SSMINE || thing->type == MT_MINEEXPLOSION || thing->type == MT_SINK || thing->type == MT_FIREBALL )) @@ -1099,11 +1099,11 @@ static boolean PIT_CheckThing(mobj_t *thing) return true; // underneath if (tmthing->player && tmthing->player->powers[pw_flashing] - && !(thing->type == MT_GREENITEM || thing->type == MT_REDITEM || thing->type == MT_REDITEMDUD)) + && !(thing->type == MT_GREENITEM || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD)) return true; - if (thing->type == MT_GREENSHIELD || thing->type == MT_REDSHIELD - || thing->type == MT_GREENITEM || thing->type == MT_REDITEM || thing->type == MT_REDITEMDUD + if (thing->type == MT_GREENSHIELD || thing->type == MT_JAWZ_SHIELD + || thing->type == MT_GREENITEM || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD || thing->type == MT_FAKESHIELD || thing->type == MT_FAKEITEM) { if ((thing->target == tmthing) && (thing->threshold > 0)) @@ -1115,7 +1115,7 @@ static boolean PIT_CheckThing(mobj_t *thing) // Player Damage P_DamageMobj(tmthing, thing, thing->target, 1); - if (thing->type == MT_GREENITEM || thing->type == MT_REDITEM || thing->type == MT_REDITEMDUD) + if (thing->type == MT_GREENITEM || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD) S_StartSound(tmthing, sfx_shelit); // Other Item Damage @@ -1130,7 +1130,7 @@ static boolean PIT_CheckThing(mobj_t *thing) P_SetObjectMomZ(thing, 8*FRACUNIT, false); P_InstaThrust(thing, R_PointToAngle2(tmthing->x, tmthing->y, thing->x, thing->y)+ANGLE_90, 16*FRACUNIT); } - else if (thing->type == MT_BANANASHIELD || thing->type == MT_BANANAITEM + else if (thing->type == MT_BANANA_SHIELD || thing->type == MT_BANANA || thing->type == MT_FIREBALL) { if ((thing->target == tmthing) && (thing->threshold > 0)) @@ -1154,7 +1154,7 @@ static boolean PIT_CheckThing(mobj_t *thing) P_SetObjectMomZ(thing, 8*FRACUNIT, false); P_InstaThrust(thing, R_PointToAngle2(tmthing->x, tmthing->y, thing->x, thing->y)+ANGLE_90, 16*FRACUNIT); } - else if (thing->type == MT_MINESHIELD || thing->type == MT_MINEITEM) + else if (thing->type == MT_SSMINE_SHIELD || thing->type == MT_SSMINE) { if ((thing->target == tmthing) && (thing->threshold > 0)) return true; diff --git a/src/p_mobj.c b/src/p_mobj.c index 54cce299..63377ae0 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1401,9 +1401,9 @@ fixed_t P_GetMobjGravity(mobj_t *mo) case MT_WATERDROP: gravityadd >>= 1; break; - case MT_BANANAITEM: + case MT_BANANA: case MT_FAKEITEM: - case MT_MINEITEM: + case MT_SSMINE: gravityadd = FixedMul(gravityadd, 5*FRACUNIT/2); default: break; @@ -1743,7 +1743,7 @@ void P_XYMovement(mobj_t *mo) B_MoveBlocked(player); } //{ SRB2kart - Jawz - if (mo->type == MT_REDITEM || mo->type == MT_REDITEMDUD) + if (mo->type == MT_JAWZ || mo->type == MT_JAWZ_DUD) { if (mo->health == 1) { @@ -1997,7 +1997,7 @@ void P_XYMovement(mobj_t *mo) #endif //{ SRB2kart stuff - if (mo->type == MT_GREENITEM || mo->type == MT_REDITEMDUD || mo->type == MT_REDITEM || mo->type == MT_FIREBALL) //(mo->type == MT_REDITEM && !mo->tracer)) + if (mo->type == MT_GREENITEM || mo->type == MT_JAWZ_DUD || mo->type == MT_JAWZ || mo->type == MT_FIREBALL) //(mo->type == MT_JAWZ && !mo->tracer)) return; if (mo->player && mo->player->kartstuff[k_spinouttimer] && mo->player->speed <= mo->player->normalspeed/2) @@ -2328,10 +2328,10 @@ static boolean P_ZMovement(mobj_t *mo) // SRB2kart stuff that should die in pits // Shouldn't stop moving along the Z if there's no speed though! case MT_FAKEITEM: - case MT_BANANAITEM: + case MT_BANANA: case MT_GREENITEM: - case MT_REDITEM: - case MT_REDITEMDUD: + case MT_JAWZ: + case MT_JAWZ_DUD: case MT_FIREBALL: // Remove stuff from death pits. if (P_CheckDeathPitCollide(mo)) @@ -6642,10 +6642,10 @@ void P_MobjThinker(mobj_t *mobj) break; } case MT_GREENSHIELD: - case MT_REDSHIELD: - case MT_BANANASHIELD: + case MT_JAWZ_SHIELD: + case MT_BANANA_SHIELD: case MT_FAKESHIELD: - case MT_MINESHIELD: + case MT_SSMINE_SHIELD: if (mobj->health > 0 && mobj->target && mobj->target->player && mobj->target->player->mo && mobj->target->player->health > 0 && !mobj->target->player->spectator) { @@ -6653,11 +6653,11 @@ void P_MobjThinker(mobj_t *mobj) const fixed_t radius = FixedHypot(mobj->target->radius, mobj->target->radius) + FixedHypot(mobj->radius, mobj->radius); // mobj's distance from its Target, or Radius. //mobj->angle += FixedAngle(12*FRACUNIT); // mobj's actual speed. - if ((mobj->type == MT_GREENSHIELD || mobj->type == MT_REDSHIELD) && mobj->lastlook > 0) + if ((mobj->type == MT_GREENSHIELD || mobj->type == MT_JAWZ_SHIELD) && mobj->lastlook > 0) mobj->angle += FixedAngle(mobj->info->speed); - else if (mobj->type == MT_BANANASHIELD && mobj->lastlook == 2) + else if (mobj->type == MT_BANANA_SHIELD && mobj->lastlook == 2) mobj->angle = (mobj->target->angle + ANGLE_135); - else if (mobj->type == MT_BANANASHIELD && mobj->lastlook == 3) + else if (mobj->type == MT_BANANA_SHIELD && mobj->lastlook == 3) mobj->angle = (mobj->target->angle + ANGLE_225); else mobj->angle = (mobj->target->angle + ANGLE_180); @@ -6714,9 +6714,9 @@ void P_MobjThinker(mobj_t *mobj) // Was this so hard? if ((mobj->type == MT_GREENSHIELD && mobj->target->player->kartstuff[k_itemtype] != KITEM_ORBINAUT) - || (mobj->type == MT_REDSHIELD && mobj->target->player->kartstuff[k_itemtype] != KITEM_JAWZ) - || (mobj->type == MT_BANANASHIELD && mobj->target->player->kartstuff[k_itemtype] != KITEM_BANANA) - || (mobj->type == MT_MINESHIELD && mobj->target->player->kartstuff[k_itemtype] != KITEM_MINE) + || (mobj->type == MT_JAWZ_SHIELD && mobj->target->player->kartstuff[k_itemtype] != KITEM_JAWZ) + || (mobj->type == MT_BANANA_SHIELD && mobj->target->player->kartstuff[k_itemtype] != KITEM_BANANA) + || (mobj->type == MT_SSMINE_SHIELD && mobj->target->player->kartstuff[k_itemtype] != KITEM_MINE) || (mobj->type == MT_FAKESHIELD && !mobj->target->player->kartstuff[k_eggmanheld]) || (mobj->type != MT_FAKESHIELD && !mobj->target->player->kartstuff[k_itemheld]) || (mobj->lastlook > 0 && mobj->target->player->kartstuff[k_itemamount] < mobj->lastlook)) @@ -7335,14 +7335,14 @@ void P_MobjThinker(mobj_t *mobj) break; //{ SRB2kart Items - Death States case MT_GREENITEM: - case MT_REDITEM: - case MT_REDITEMDUD: - case MT_BANANAITEM: + case MT_JAWZ: + case MT_JAWZ_DUD: + case MT_BANANA: case MT_FAKEITEM: if (mobj->z <= mobj->floorz) P_RemoveMobj(mobj); break; - case MT_MINEITEM: + case MT_SSMINE: case MT_BLUEEXPLOSION: if (mobj->health > -100) { @@ -7852,7 +7852,7 @@ void P_MobjThinker(mobj_t *mobj) else if (gamespeed == 2) finalspeed = FixedMul(finalspeed, FRACUNIT+FRACUNIT/4); - mobj->angle = R_PointToAngle2(mobj->x, mobj->y, mobj->x+mobj->momx, mobj->y+mobj->momy); + mobj->angle = R_PointToAngle2(0, 0, mobj->momx, mobj->momy); if (mobj->health <= 5) { INT32 i; @@ -7882,7 +7882,7 @@ void P_MobjThinker(mobj_t *mobj) S_StartSound(mobj, mobj->info->activesound); break; } - case MT_REDITEM: + case MT_JAWZ: { sector_t *sec2; fixed_t topspeed = 64*FRACUNIT; @@ -7932,7 +7932,8 @@ void P_MobjThinker(mobj_t *mobj) mobj->friction = 0; } - P_InstaThrust(mobj, R_PointToAngle2(0, 0, mobj->momx, mobj->momy), topspeed); + mobj->angle = R_PointToAngle2(0, 0, mobj->momx, mobj->momy); + P_InstaThrust(mobj, mobj->angle, topspeed); sec2 = P_ThingOnSpecial3DFloor(mobj); if ((sec2 && GETSECSPECIAL(sec2->special, 3) == 1) @@ -7942,12 +7943,12 @@ void P_MobjThinker(mobj_t *mobj) break; } - case MT_REDITEMDUD: + case MT_JAWZ_DUD: { sector_t *sec2; P_SpawnGhostMobj(mobj); - mobj->angle = R_PointToAngle2(mobj->x, mobj->y, mobj->x+mobj->momx, mobj->y+mobj->momy); + mobj->angle = R_PointToAngle2(0, 0, mobj->momx, mobj->momy); P_InstaThrust(mobj, mobj->angle, mobj->info->speed); sec2 = P_ThingOnSpecial3DFloor(mobj); @@ -7964,7 +7965,7 @@ void P_MobjThinker(mobj_t *mobj) break; } - case MT_BANANAITEM: + case MT_BANANA: case MT_FAKEITEM: if (mobj->momx || mobj->momy) P_SpawnGhostMobj(mobj); @@ -7992,7 +7993,7 @@ void P_MobjThinker(mobj_t *mobj) if (mobj->threshold > 0) mobj->threshold--; break; - case MT_MINEITEM: + case MT_SSMINE: if (mobj->target && mobj->target->player) mobj->color = mobj->target->player->skincolor; else @@ -8001,8 +8002,8 @@ void P_MobjThinker(mobj_t *mobj) P_SpawnGhostMobj(mobj); if (P_IsObjectOnGround(mobj)) { - if (mobj->state == &states[S_MINEAIR1] || mobj->state == &states[S_MINEAIR2]) - P_SetMobjState(mobj, S_MINEDEPLOY1); + if (mobj->state == &states[S_SSMINE_AIR1] || mobj->state == &states[S_SSMINE_AIR2]) + P_SetMobjState(mobj, S_SSMINE_DEPLOY1); if (mobj->reactiontime >= mobj->info->reactiontime) { mobj->momx = mobj->momy = 0; @@ -8016,8 +8017,8 @@ void P_MobjThinker(mobj_t *mobj) if (!mobj->reactiontime) P_KillMobj(mobj, NULL, NULL); } - if (mobj->state == &states[S_MINEITEM1] || mobj->state == &states[S_MINEITEM2] - || mobj->state == &states[S_MINEITEM3] || mobj->state == &states[S_MINEITEM4]) + if (mobj->state == &states[S_SSMINE1] || mobj->state == &states[S_SSMINE2] + || mobj->state == &states[S_SSMINE3] || mobj->state == &states[S_SSMINE4]) A_GrenadeRing(mobj); if (mobj->threshold > 0) mobj->threshold--; @@ -8829,15 +8830,15 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) switch (mobj->type) { case MT_PLAYER: - case MT_BIGMACE: case MT_SMALLMACE: + case MT_BIGMACE: case MT_SMALLMACE: case MT_FALLINGROCK: //case MT_RANDOMITEM: - case MT_BANANAITEM: case MT_BANANASHIELD: - case MT_GREENITEM: case MT_GREENSHIELD: - case MT_REDITEM: case MT_REDSHIELD: case MT_REDITEMDUD: - case MT_BATTLEBALLOON: case MT_FIREBALL: - case MT_FAKEITEM: case MT_FAKESHIELD: - case MT_MINEITEM: case MT_MINESHIELD: + case MT_BANANA: case MT_BANANA_SHIELD: + case MT_GREENITEM: case MT_GREENSHIELD: + case MT_JAWZ: case MT_JAWZ_DUD: case MT_JAWZ_SHIELD: + case MT_BATTLEBALLOON: case MT_FIREBALL: + case MT_FAKEITEM: case MT_FAKESHIELD: + case MT_SSMINE: case MT_SSMINE_SHIELD: P_SpawnShadowMobj(mobj); default: break; diff --git a/src/p_user.c b/src/p_user.c index 3ac1a9d8..cfc67bfc 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7836,9 +7836,9 @@ void P_NukeEnemies(mobj_t *inflictor, mobj_t *source, fixed_t radius) P_DamageMobj(mo, inflictor, source, 1); //{ SRB2kart - if (mo->type == MT_GREENITEM || mo->type == MT_REDITEM || mo->type == MT_REDITEMDUD - || mo->type == MT_GREENSHIELD || mo->type == MT_REDSHIELD - || mo->type == MT_BANANAITEM || mo->type == MT_BANANASHIELD + if (mo->type == MT_GREENITEM || mo->type == MT_JAWZ || mo->type == MT_JAWZ_DUD + || mo->type == MT_GREENSHIELD || mo->type == MT_JAWZ_SHIELD + || mo->type == MT_BANANA || mo->type == MT_BANANA_SHIELD || mo->type == MT_FAKEITEM || mo->type == MT_FAKESHIELD || mo->type == MT_FIREBALL) { From 77362c45cc0d6b1371f7145daaef6a1c6dd66a82 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sun, 3 Jun 2018 18:15:20 -0400 Subject: [PATCH 015/293] Fix pausing on gme --- src/sdl/mixer_sound.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 71832459..18670649 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -475,12 +475,24 @@ void I_ShutdownMusic(void) void I_PauseSong(INT32 handle) { (void)handle; +#ifdef HAVE_LIBGME + if (gme) + { + Mix_HookMusic(NULL, NULL); + } +#endif Mix_PauseMusic(); } void I_ResumeSong(INT32 handle) { (void)handle; +#ifdef HAVE_LIBGME + if (gme) + { + Mix_HookMusic(mix_gme, gme); + } +#endif Mix_ResumeMusic(); } From 91081a3e534ad6885bac1fae3013444f9fb2c67e Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Mon, 4 Jun 2018 22:14:01 +0200 Subject: [PATCH 016/293] Disable admin password by default --- src/d_main.c | 9 --------- src/d_netcmd.c | 9 +++++++-- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index fbec5f7d..df339875 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1051,15 +1051,6 @@ void D_SRB2Main(void) if (M_CheckParm("-password") && M_IsNextParm()) D_SetPassword(M_GetNextParm()); - else - { - size_t z; - char junkpw[25]; - for (z = 0; z < 24; z++) - junkpw[z] = (char)(rand() & 64)+32; - junkpw[24] = '\0'; - D_SetPassword(junkpw); - } // add any files specified on the command line with -file wadfile // to the wad list diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 673d64fd..876a3852 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -2656,10 +2656,12 @@ static void D_MD5PasswordPass(const UINT8 *buffer, size_t len, const char *salt, #define BASESALT "basepasswordstorage" static UINT8 adminpassmd5[16]; +static boolean adminpasswordset = false; void D_SetPassword(const char *pw) { D_MD5PasswordPass((const UINT8 *)pw, strlen(pw), BASESALT, &adminpassmd5); + adminpasswordset = true; } // Remote Administration @@ -2728,6 +2730,9 @@ static void Got_Login(UINT8 **cp, INT32 playernum) READMEM(*cp, sentmd5, 16); + if (!adminpasswordset) + CONS_Printf(M_GetText("Password from %s failed (no password set).\n"), player_names[playernum]); + if (client) return; @@ -3951,7 +3956,7 @@ static void Command_RestartAudio_f(void) I_ShutdownSound(); I_StartupSound(); I_InitMusic(); - + // These must be called or no sound and music until manually set. I_SetSfxVolume(cv_soundvolume.value); @@ -3959,7 +3964,7 @@ static void Command_RestartAudio_f(void) I_SetMIDIMusicVolume(cv_midimusicvolume.value); if (Playing()) // Gotta make sure the player is in a level P_RestoreMusic(&players[consoleplayer]); - + } /** Quits a game and returns to the title screen. From c389c0b3dc5fb285f5492474f1c93b62c6336b7a Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Mon, 4 Jun 2018 22:30:27 +0200 Subject: [PATCH 017/293] xd --- src/d_netcmd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 876a3852..727d5eff 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -2731,7 +2731,10 @@ static void Got_Login(UINT8 **cp, INT32 playernum) READMEM(*cp, sentmd5, 16); if (!adminpasswordset) + { CONS_Printf(M_GetText("Password from %s failed (no password set).\n"), player_names[playernum]); + return; + } if (client) return; From 889d790ea0d9ad82581931a79a175074bda6ef51 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 7 Jun 2018 19:46:48 -0400 Subject: [PATCH 018/293] Disable MT_QUESTIONBOX again I refuse to give up the name "cv_invincibility" to another vanilla cvar that we will never use seriously. --- src/d_netcmd.c | 8 ++++---- src/d_netcmd.h | 4 ++-- src/p_enemy.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 02e5efa8..a5408fbe 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -315,7 +315,7 @@ consvar_t cv_matchboxes = {"matchboxes", "Normal", CV_NETVAR|CV_CHEAT, matchboxe consvar_t cv_specialrings = {"specialrings", "On", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_powerstones = {"powerstones", "On", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_recycler = {"tv_recycler", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +/*consvar_t cv_recycler = {"tv_recycler", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_teleporters = {"tv_teleporter", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_superring = {"tv_superring", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_supersneakers = {"tv_supersneaker", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -326,7 +326,7 @@ consvar_t cv_ringshield = {"tv_ringshield", "5", CV_NETVAR|CV_CHEAT, chanc consvar_t cv_forceshield = {"tv_forceshield", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_bombshield = {"tv_bombshield", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_1up = {"tv_1up", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_eggmanbox = {"tv_eggman", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_eggmanbox = {"tv_eggman", "5", CV_NETVAR|CV_CHEAT, chances_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};*/ // SRB2kart consvar_t cv_sneaker = {"sneaker", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -607,7 +607,7 @@ void D_RegisterServerCommands(void) CV_RegisterVar(&cv_competitionboxes); CV_RegisterVar(&cv_matchboxes); - CV_RegisterVar(&cv_recycler); + /*CV_RegisterVar(&cv_recycler); CV_RegisterVar(&cv_teleporters); CV_RegisterVar(&cv_superring); CV_RegisterVar(&cv_supersneakers); @@ -618,7 +618,7 @@ void D_RegisterServerCommands(void) CV_RegisterVar(&cv_forceshield); CV_RegisterVar(&cv_bombshield); CV_RegisterVar(&cv_1up); - CV_RegisterVar(&cv_eggmanbox); + CV_RegisterVar(&cv_eggmanbox);*/ K_RegisterKartStuff(); // SRB2kart diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 80793195..a0cdafca 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -103,10 +103,10 @@ extern consvar_t cv_pause; extern consvar_t cv_restrictskinchange, cv_allowteamchange, cv_respawntime; -extern consvar_t cv_teleporters, cv_superring, cv_supersneakers, cv_invincibility; +/*extern consvar_t cv_teleporters, cv_superring, cv_supersneakers, cv_invincibility; extern consvar_t cv_jumpshield, cv_watershield, cv_ringshield, cv_forceshield, cv_bombshield; extern consvar_t cv_1up, cv_eggmanbox; -extern consvar_t cv_recycler; +extern consvar_t cv_recycler;*/ // SRB2kart items extern consvar_t cv_sneaker, cv_rocketsneaker, cv_invincibility, cv_banana; diff --git a/src/p_enemy.c b/src/p_enemy.c index 52f3c4a4..b0800118 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -2601,7 +2601,7 @@ void A_MonitorPop(mobj_t *actor) switch (actor->type) { - case MT_QUESTIONBOX: // Random! + /*case MT_QUESTIONBOX: // Random! { mobjtype_t spawnchance[256]; INT32 numchoices = 0, i = 0; @@ -2635,7 +2635,7 @@ for (i = cvar.value; i; --i) spawnchance[numchoices++] = type remains->flags2 &= ~MF2_AMBUSH; break; - } + }*/ default: item = actor->info->damage; break; From 4e2b30fcae328df6aab72a7b233dd3feceb976cd Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Fri, 8 Jun 2018 00:02:28 -0400 Subject: [PATCH 019/293] Fixes --- src/d_netcmd.c | 2 +- src/hardware/hw_main.c | 4 +- src/hardware/hw_md2.c | 6 +-- src/info.c | 2 +- src/k_kart.c | 119 ++++++++++++++++++++++++----------------- src/p_enemy.c | 2 +- src/s_sound.h | 2 +- 7 files changed, 80 insertions(+), 57 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index a5408fbe..2ef99f8d 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -220,7 +220,7 @@ static CV_PossibleValue_t competitionboxes_cons_t[] = {{0, "Normal"}, {1, "Rando static CV_PossibleValue_t matchboxes_cons_t[] = {{0, "Normal"}, {1, "Random"}, {2, "Non-Random"}, {3, "None"}, {0, NULL}}; -static CV_PossibleValue_t chances_cons_t[] = {{0, "MIN"}, {9, "MAX"}, {0, NULL}}; +//static CV_PossibleValue_t chances_cons_t[] = {{0, "MIN"}, {9, "MAX"}, {0, NULL}}; static CV_PossibleValue_t match_scoring_cons_t[] = {{0, "Normal"}, {1, "Classic"}, {0, NULL}}; static CV_PossibleValue_t pause_cons_t[] = {{0, "Server"}, {1, "All"}, {0, NULL}}; diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 4429bafe..400ba1fc 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -5392,7 +5392,7 @@ static void HWR_ProjectSprite(mobj_t *thing) if (thing->skin && thing->sprite == SPR_PLAY) // This thing is a player! { if (thing->colorized) - vis->colormap = R_GetTranslationColormap(TC_STARMAN, thing->color, GTC_CACHE); + vis->colormap = R_GetTranslationColormap(TC_RAINBOW, thing->color, GTC_CACHE); else { size_t skinnum = (skin_t*)thing->skin-skins; @@ -5402,7 +5402,7 @@ static void HWR_ProjectSprite(mobj_t *thing) else { if (vis->mobj && vis->mobj->colorized) - vis->colormap = R_GetTranslationColormap(TC_STARMAN, vis->mobj->color ? vis->mobj->color : SKINCOLOR_CYAN, GTC_CACHE); + vis->colormap = R_GetTranslationColormap(TC_RAINBOW, vis->mobj->color ? vis->mobj->color : SKINCOLOR_CYAN, GTC_CACHE); else vis->colormap = R_GetTranslationColormap(TC_DEFAULT, vis->mobj->color ? vis->mobj->color : SKINCOLOR_CYAN, GTC_CACHE); } diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index 8bb4c959..a58b9c86 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -1207,8 +1207,8 @@ static void HWR_CreateBlendedTexture(GLPatch_t *gpatch, GLPatch_t *blendgpatch, break; } - // starman support, could theoretically support boss ones too - if (skinnum == TC_STARMAN) + // rainbow support, could theoretically support boss ones too + if (skinnum == TC_RAINBOW) { while (size--) { @@ -1490,7 +1490,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr) if (spr->mobj->skin && spr->mobj->sprite == SPR_PLAY) { if (spr->mobj->colorized) - skinnum = TC_STARMAN; + skinnum = TC_RAINBOW; else { skinnum = (INT32)((skin_t*)spr->mobj->skin-skins); diff --git a/src/info.c b/src/info.c index 77a6c6b7..a9f23fd8 100644 --- a/src/info.c +++ b/src/info.c @@ -2722,7 +2722,7 @@ state_t states[NUMSTATES] = {SPR_BLIG, 1, 2, {NULL}, 0, 0, S_BLUELIGHTNING3}, // S_BLUELIGHTNING2 {SPR_BLIG, 2, 2, {NULL}, 0, 0, S_BLUELIGHTNING4}, // S_BLUELIGHTNING3 {SPR_BLIG, 3, 2, {NULL}, 0, 0, S_NULL}, // S_BLUELIGHTNING4 - {SPR_BOMB, 0, 1, {A_MineExplode}, MT_BLUEEXPLOSION, 0, S_NULL}, // S_BLUEEXPLODE + {SPR_SSMN, 0, 1, {A_MineExplode}, MT_BLUEEXPLOSION, 0, S_NULL}, // S_BLUEEXPLODE {SPR_LIGH, 0, 2, {NULL}, 0, 0, S_LIGHTNING2}, // S_LIGHTNING1 {SPR_LIGH, 1, 2, {NULL}, 0, 0, S_LIGHTNING3}, // S_LIGHTNING2 diff --git a/src/k_kart.c b/src/k_kart.c index d3984cdf..a1bc08d3 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -425,17 +425,6 @@ static void K_KartGetItemResult(player_t *player, SINT8 getitem) switch (getitem) { // Special roulettes first, then the generic ones are handled by default - case KITEM_TRIPLESNEAKER: - if (getitem <= 0 || getitem >= NUMKARTRESULTS) // Sad (Fallback) - { - if (getitem != 0) - CONS_Printf("ERROR: P_KartGetItemResult - Item roulette gave bad item (%d) :(\n", getitem); - player->kartstuff[k_itemtype] = KITEM_SAD; - } - else - player->kartstuff[k_itemtype] = getitem; - player->kartstuff[k_itemamount] = 1; - break; case KRITEM_TRIPLESNEAKER: // Sneaker x3 player->kartstuff[k_itemtype] = KITEM_SNEAKER; player->kartstuff[k_itemamount] = 3; @@ -478,6 +467,9 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, player_t *player, boolean INT32 newodds; INT32 i; UINT8 pingame = 0, pexiting = 0; + SINT8 first = -1; + SINT8 second = -1; + INT32 secondist = 0; if (G_BattleGametype()) newodds = K_KartItemOddsBattle[item-1][pos]; @@ -487,11 +479,31 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, player_t *player, boolean for (i = 0; i < MAXPLAYERS; i++) { if (playeringame[i] && !players[i].spectator) + { pingame++; + if (players[i].mo) + { + if (players[i].kartstuff[k_position] == 1 && first == -1) + first = i; + if (players[i].kartstuff[k_position] == 2 && second == -1) + second = i; + } + } if (players[i].exiting) pexiting++; } + if (first != -1 && second != -1) // calculate 2nd's distance from 1st, for SPB + { + secondist = P_AproxDistance(P_AproxDistance(players[first].mo->x - players[second].mo->x, + players[first].mo->y - players[second].mo->y), + players[first].mo->z - players[second].mo->z) / mapheaderinfo[gamemap-1]->mobj_scale + * (pingame - 1) + / ((pingame - 1) * (pingame + 1) / 3); + if (franticitems) + secondist = (15*secondist/14); + } + switch (item) { case KITEM_SNEAKER: @@ -592,7 +604,7 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, player_t *player, boolean //{ SRB2kart Roulette Code - Distance Based, no waypoints -static void K_KartItemRouletteByDistance(player_t *player, ticcmd_t *cmd) +static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd) { const INT32 distvar = (64*14); INT32 i; @@ -605,9 +617,6 @@ static void K_KartItemRouletteByDistance(player_t *player, ticcmd_t *cmd) UINT8 oddsvalid[9]; UINT8 disttable[14]; UINT8 distlen = 0; - INT32 secondist = 0; - SINT8 first = -1; - SINT8 second = -1; boolean mashed = false; // This makes the roulette cycle through items - if this is 0, you shouldn't be here. @@ -683,47 +692,32 @@ static void K_KartItemRouletteByDistance(player_t *player, ticcmd_t *cmd) for (i = 0; i < MAXPLAYERS; i++) { - if (playeringame[i] && !players[i].spectator && players[i].mo) - { - if (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); - if (players[i].kartstuff[k_position] == 1 && first == -1) - first = i; - if (players[i].kartstuff[k_position] == 2 && second == -1) - second = i; - } - } - - if (first != -1 && second != -1 && !secondist) // calculate 2nd's distance from 1st, for blue shell - secondist = P_AproxDistance(P_AproxDistance(players[first].mo->x - players[second].mo->x, - players[first].mo->y - players[second].mo->y), - players[first].mo->z - players[second].mo->z) / mapheaderinfo[gamemap-1]->mobj_scale - * (pingame - 1) + 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 { - UINT8 wantedpos; - 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); - // Nothing we can do about setting disttable[5], because of how that is set. + // Nothing we can do about getting new odds for disttable[5], because of how that is set. if (player->kartstuff[k_roulettetype] == 1) useodds = 5; else { - wantedpos = (player->kartstuff[k_balloon]-avgballoon)+2; // 0 is two balloons below average, 2 is average, 4 is two balloons above average + UINT8 wantedpos = (player->kartstuff[k_balloon]-avgballoon)+2; // 0 is two balloons below average, 2 is average, 4 is two balloons above average if (wantedpos > 4) wantedpos = 4; if (wantedpos < 0) @@ -743,10 +737,7 @@ static void K_KartItemRouletteByDistance(player_t *player, ticcmd_t *cmd) if (oddsvalid[8]) SETUPDISTTABLE(8,1); if (franticitems) // Frantic items make the distances between everyone artifically higher, for crazier items - { pdis = (15*pdis/14); - secondist = (15*pdis/14); - } if (pingame == 1 && oddsvalid[0]) // Record Attack, or just alone useodds = 0; @@ -2162,7 +2153,7 @@ static void K_DoShrink(player_t *player) static void K_DoSPB(player_t *victim, player_t *source) { - INT32 i; + //INT32 i; S_StartSound(victim->mo, sfx_bkpoof); // Sound the BANG! /*for (i = 0; i < MAXPLAYERS; i++) @@ -2319,7 +2310,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) if (player->kartstuff[k_deathsentence]) { if (player->kartstuff[k_deathsentence] == 1) - K_DoBlueShell(player, &players[spbplayer]); + K_DoSPB(player, &players[spbplayer]); player->kartstuff[k_deathsentence]--; } @@ -2382,8 +2373,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) K_LakituChecker(player); // Roulette Code - //K_KartItemRouletteByPosition(player, cmd); // Old, position-based - K_KartItemRouletteByDistance(player, cmd); // New, distance-based + K_KartItemRoulette(player, cmd); // Stopping of the horrible invincibility SFX if (player->mo->health <= 0 || player->mo->player->kartstuff[k_invincibilitytimer] <= 0 @@ -3129,8 +3119,41 @@ void K_MoveKartPlayer(player_t *player, boolean onground) case KITEM_SPB: if (ATTACK_IS_DOWN && !HOLDING_ITEM && NO_HYUDORO) { - K_DoShrink(player, true); + UINT8 ploop; + UINT8 bestrank = 0; + fixed_t dist = 0; + + for (ploop = 0; ploop < MAXPLAYERS; ploop++) + { + fixed_t thisdist; + if (!playeringame[ploop] || players[ploop].spectator) + continue; + if (&players[ploop] == player) + continue; + if (!players[ploop].mo) + continue; + if (players[ploop].exiting) + continue; + thisdist = R_PointToDist2(player->mo->x, player->mo->y, players[ploop].mo->x, players[ploop].mo->y); + if (bestrank == 0 || players[ploop].kartstuff[k_position] < bestrank) + { + bestrank = players[ploop].kartstuff[k_position]; + dist = thisdist; + } + } + + if (dist == 0) + spbincoming = 6*TICRATE; // If you couldn't find anyone, just set an abritary timer + else + spbincoming = (tic_t)max(1, FixedDiv(dist, 64*FRACUNIT)/FRACUNIT); + + spbplayer = player-players; + + player->pflags |= PF_ATTACKDOWN; player->kartstuff[k_itemamount]--; + + K_PlayTauntSound(player->mo); + player->kartstuff[k_sounds] = 50; } break; case KITEM_GROW: @@ -3154,7 +3177,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) case KITEM_SHRINK: if (ATTACK_IS_DOWN && !HOLDING_ITEM && NO_HYUDORO) { - K_DoShrink(player, false); + K_DoShrink(player); player->kartstuff[k_itemamount]--; } break; diff --git a/src/p_enemy.c b/src/p_enemy.c index b0800118..b7349fdb 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -2549,7 +2549,7 @@ void A_MonitorPop(mobj_t *actor) mobj_t *remains; mobjtype_t explode; mobjtype_t item = 0; - mobjtype_t newbox; + //mobjtype_t newbox; #ifdef HAVE_BLUA if (LUA_CallAction("A_MonitorPop", actor)) diff --git a/src/s_sound.h b/src/s_sound.h index 708251a5..39ec769a 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -142,7 +142,7 @@ void S_StopSoundByNum(sfxenum_t sfxnum); #ifdef MUSICSLOT_COMPATIBILITY // For compatibility with code/scripts relying on older versions // This is a list of all the "special" slot names and their associated numbers -const char *compat_special_music_slots[21]; +const char *compat_special_music_slots[16]; #endif #endif From 3dac0e21cc2b52a14b13786dc9c7e4916a40cd2c Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Fri, 8 Jun 2018 01:12:07 -0400 Subject: [PATCH 020/293] A better method of Instead of returning at the very start of P_MoveChaseCamera, just set camstill to true, and add another exiting check to momentum. This lets the mirror mode post process effect to continue working. --- src/p_inter.c | 3 +++ src/p_user.c | 49 ++++++++++++++++++++++++++++--------------------- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index 16757431..ad465d5f 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -152,6 +152,9 @@ void P_ResetStarposts(void) // boolean P_CanPickupItem(player_t *player, boolean weapon) { + if (player->exiting) + return false; + /*if (G_BattleGametype() && player->kartstuff[k_balloon] <= 0) // No balloons in Match return false;*/ diff --git a/src/p_user.c b/src/p_user.c index d59908a4..5b730c74 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8138,9 +8138,6 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall subsector_t *newsubsec; fixed_t f1, f2; - if (player->exiting) // SRB2Kart: Leave the camera behind while exiting, for dramatic effect! - return true; - cameranoclip = (player->pflags & (PF_NOCLIP|PF_NIGHTSMODE)) || (player->mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT)); // Noclipping player camera noclips too!! if (!(player->climbing || (player->pflags & PF_NIGHTSMODE) || player->playerstate == PST_DEAD)) @@ -8275,8 +8272,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall lookback = camspin4; } - // SRB2kart - Camera flipper - if (lookback) + if (player->exiting) // SRB2Kart: Leave the camera behind while exiting, for dramatic effect! + camstill = true; + else if (lookback) // SRB2kart - Camera flipper { camrotate += 180; camspeed *= 2; @@ -8684,27 +8682,36 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall } }*/ - if (twodlevel || (mo->flags2 & MF2_TWOD)) + if (player->exiting) { - thiscam->momx = x-thiscam->x; - thiscam->momy = y-thiscam->y; - thiscam->momz = z-thiscam->z; + thiscam->momx = 0; + thiscam->momy = 0; + thiscam->momz = 0; } 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 + if (twodlevel || (mo->flags2 & MF2_TWOD)) + { + thiscam->momx = x-thiscam->x; + thiscam->momy = y-thiscam->y; + thiscam->momz = z-thiscam->z; + } else - thiscam->momz = FixedMul(z - thiscam->z, camspeed); + { + 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); + } } // compute aming to look the viewed point From a5547631280d6beeb12e9b485996e6bb42af452a Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 10 Jun 2018 16:10:24 -0400 Subject: [PATCH 021/293] Maintenence - Fix merge issues - Update invincibility flash to use its own object instead of MT_OVERLAY, so extra hacks don't need baked into overlay thinking - K_SpawnSparkleTrail can accept mobjs now, since there really wasn't any reason it needed a player. - Comment out a few old MK/vanilla SRB2 effects for now --- src/dehacked.c | 1 + src/info.c | 29 ++++++++++++++++++++++++++++- src/info.h | 1 + src/k_kart.c | 36 ++++++++++++++++-------------------- src/k_kart.h | 2 +- src/lua_baselib.c | 22 +++++++++++----------- src/p_inter.c | 4 ++-- src/p_mobj.c | 26 +++++++++++++++++--------- src/p_user.c | 7 +++++-- 9 files changed, 82 insertions(+), 46 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 8e472d3d..bc5814e4 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7106,6 +7106,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_SNEAKERTRAIL", "MT_SPARKLETRAIL", + "MT_INVULNFLASH", "MT_DRIFT", "MT_DRIFTDUST", diff --git a/src/info.c b/src/info.c index 821978bb..94c4ae0d 100644 --- a/src/info.c +++ b/src/info.c @@ -14324,7 +14324,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { // MT_SPARKLETRAIL -1, // doomednum S_KARTINVULN_SMALL1, // spawnstate - 1, // spawnhealth + 1000, // spawnhealth S_NULL, // seestate sfx_None, // seesound 8, // reactiontime @@ -14348,6 +14348,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_INVULNFLASH + -1, // doomednum + S_INVULNFLASH1, // 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 + 0, // display offset + 100, // mass + 0, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY, // flags + S_NULL // raisestate + }, + { // MT_DRIFT -1, // doomednum S_DRIFTSPARK1, // spawnstate diff --git a/src/info.h b/src/info.h index 0eab772a..42d3dacb 100644 --- a/src/info.h +++ b/src/info.h @@ -3965,6 +3965,7 @@ typedef enum mobj_type MT_SNEAKERTRAIL, MT_SPARKLETRAIL, + MT_INVULNFLASH, MT_DRIFT, MT_DRIFTDUST, diff --git a/src/k_kart.c b/src/k_kart.c index 71da5668..853c8bde 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1011,7 +1011,7 @@ void K_LakituChecker(player_t *player) { ticcmd_t *cmd = &player->cmd; - if (player->kartstuff[k_lakitu] == 44) + /*if (player->kartstuff[k_lakitu] == 44) { mobj_t *mo; angle_t newangle; @@ -1033,7 +1033,7 @@ void K_LakituChecker(player_t *player) mo->angle = newangle+ANGLE_180; P_SetTarget(&mo->target, player->mo); } - } + }*/ if (player->kartstuff[k_lakitu] > 3) { @@ -1873,34 +1873,32 @@ void K_SpawnBoostTrail(player_t *player) } } -void K_SpawnSparkleTrail(player_t *player) +void K_SpawnSparkleTrail(mobj_t *mo) { - const INT32 rad = (player->mo->radius*2)>>FRACBITS; - fixed_t newx, newy, newz; + const INT32 rad = (mo->radius*2)>>FRACBITS; mobj_t *sparkle; INT32 i; - I_Assert(player != NULL); - I_Assert(player->mo != NULL); - I_Assert(!P_MobjWasRemoved(player->mo)); + I_Assert(mo != NULL); + I_Assert(!P_MobjWasRemoved(mo)); for (i = 0; i < 3; i++) { - newx = player->mo->x + player->mo->momx + (P_RandomRange(-rad, rad)<mo->y + player->mo->momy + (P_RandomRange(-rad, rad)<mo->z + player->mo->momz + (P_RandomRange(0, player->mo->height>>FRACBITS)<x + mo->momx + (P_RandomRange(-rad, rad)<y + mo->momy + (P_RandomRange(-rad, rad)<z + mo->momz + (P_RandomRange(0, mo->height>>FRACBITS)<target, player->mo); - sparkle->destscale = player->mo->destscale; - P_SetScale(sparkle, player->mo->scale); - sparkle->eflags = (sparkle->eflags & ~MFE_VERTICALFLIP)|(player->mo->eflags & MFE_VERTICALFLIP); - sparkle->color = player->mo->color; - //sparkle->colorized = player->mo->colorized; + 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->color = mo->color; + //sparkle->colorized = mo->colorized; } } @@ -2932,9 +2930,8 @@ void K_MoveKartPlayer(player_t *player, boolean onground) S_StartSound(player->mo, sfx_kinvnc); if (!player->kartstuff[k_invincibilitytimer]) { - mobj_t *overlay = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_OVERLAY); + mobj_t *overlay = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_INVULNFLASH); P_SetTarget(&overlay->target, player->mo); - P_SetMobjState(overlay, S_INVULNFLASH1); overlay->destscale = player->mo->scale; P_SetScale(overlay, player->mo->scale); } @@ -3244,7 +3241,6 @@ void K_MoveKartPlayer(player_t *player, boolean onground) player->kartstuff[k_itemamount]--; K_PlayTauntSound(player->mo); - player->kartstuff[k_sounds] = 50; } break; case KITEM_GROW: diff --git a/src/k_kart.h b/src/k_kart.h index 6a62915e..081d0fc0 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -30,8 +30,8 @@ void K_StealBalloon(player_t *player, player_t *victim, boolean force); void K_SpawnKartExplosion(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32 number, mobjtype_t type, angle_t rotangle, boolean spawncenter, boolean ghostit, mobj_t *source); void K_SpawnMineExplosion(mobj_t *source, UINT8 color); void K_SpawnBoostTrail(player_t *player); +void K_SpawnSparkleTrail(mobj_t *mo); void K_DriftDustHandling(mobj_t *spawner); -void K_SpawnSparkleTrail(player_t *player); void K_DoSneaker(player_t *player, boolean doPFlag); void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed); boolean K_CheckPlayersRespawnColliding(INT32 playernum, fixed_t x, fixed_t y); diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 46b4cab6..30f1feb2 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -2090,6 +2090,16 @@ static int lib_kSpawnBoostTrail(lua_State *L) return 0; } +static int lib_kSpawnSparkleTrail(lua_State *L) +{ + mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); + NOHUD + if (!mo) + return LUA_ErrInvalid(L, "mobj_t"); + K_SpawnSparkleTrail(mo); + return 0; +} + static int lib_kDriftDustHandling(lua_State *L) { mobj_t *spawner = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); @@ -2100,16 +2110,6 @@ static int lib_kDriftDustHandling(lua_State *L) return 0; } -static int lib_kSpawnSparkleTrail(lua_State *L) -{ - player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); - NOHUD - if (!player) - return LUA_ErrInvalid(L, "player_t"); - K_SpawnDriftTrail(player); - return 0; -} - static int lib_kDoSneaker(lua_State *L) { player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); @@ -2355,8 +2355,8 @@ static luaL_Reg lib[] = { {"K_StealBalloon",lib_kStealBalloon}, {"K_SpawnKartExplosion",lib_kSpawnKartExplosion}, {"K_SpawnBoostTrail",lib_kSpawnBoostTrail}, - {"K_DriftDustHandling",lib_kDriftDustHandling}, {"K_SpawnSparkleTrail",lib_kSpawnSparkleTrail}, + {"K_DriftDustHandling",lib_kDriftDustHandling}, {"K_DoSneaker",lib_kDoSneaker}, {"K_DoPogoSpring",lib_kDoPogoSpring}, {"K_MomentumToFacing",lib_kMomentumToFacing}, diff --git a/src/p_inter.c b/src/p_inter.c index ad465d5f..9b2cf4c8 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -3105,7 +3105,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da player->kartstuff[k_sneakertimer] = 0; - // Size Down + // Shrink if (damage == 64) { if (player == source->player) @@ -3126,7 +3126,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da player->kartstuff[k_growshrinktimer] = 2; } // Invincible or not, we still need this. - P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_LIGHTNING); + //P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_LIGHTNING); return true; } diff --git a/src/p_mobj.c b/src/p_mobj.c index 2fc4f8de..2a216661 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8122,6 +8122,23 @@ void P_MobjThinker(mobj_t *mobj) S_StartSound(mobj, sfx_prloop); mobj->health--; break; + case MT_SPARKLETRAIL: + if (!mobj->target) + { + P_RemoveMobj(mobj); + return; + } + mobj->color = mobj->target->color; + mobj->colorized = mobj->target->colorized; + break; + case MT_INVULNFLASH: + if (!mobj->target || (mobj->target->player && !mobj->target->player->kartstuff[k_invincibilitytimer])) + { + P_RemoveMobj(mobj); + return; + } + A_CapeChase(mobj); + break; //} case MT_TURRET: P_MobjCheckWater(mobj); @@ -8181,15 +8198,6 @@ void P_MobjThinker(mobj_t *mobj) mobj->tracer->y, mobj->tracer->floorz, SPLATDRAWMODE_SHADE); #endif break; - case MT_SPARKLETRAIL: - if (!mobj->target) - { - P_RemoveMobj(mobj); - return; - } - mobj->color = mobj->target->color; - mobj->colorized = mobj->target->colorized; - break; case MT_SPINFIRE: case MT_SNEAKERTRAIL: if (mobj->eflags & MFE_VERTICALFLIP) diff --git a/src/p_user.c b/src/p_user.c index f010fde1..a3d5bfdd 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2304,12 +2304,12 @@ static void P_CheckInvincibilityTimer(player_t *player) //if (mariomode && !player->powers[pw_super]) // SRB2kart player->mo->color = (UINT8)(1 + (leveltime % (MAXSKINCOLORS-1))); - if (leveltime % (TICRATE/7) == 0) + /*if (leveltime % (TICRATE/7) == 0) { mobj_t *sparkle = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_IVSP); sparkle->destscale = player->mo->scale; P_SetScale(sparkle, player->mo->scale); - } + }*/ // Resume normal music stuff. if (player->powers[pw_invulnerability] == 1 || player->kartstuff[k_invincibilitytimer] == 1) @@ -6925,6 +6925,9 @@ static void P_MovePlayer(player_t *player) if (player->kartstuff[k_sneakertimer] > 0 && onground && (leveltime & 1)) K_SpawnBoostTrail(player); + if (player->kartstuff[k_invincibilitytimer] > 0) + K_SpawnSparkleTrail(player->mo); + K_DriftDustHandling(player->mo); /* // SRB2kart - nadah From ea3b82791fe32335ced258386f46e0a22a8af81d Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 10 Jun 2018 21:05:09 -0400 Subject: [PATCH 022/293] Whoops, no break here --- src/k_kart.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 853c8bde..89792566 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -711,9 +711,8 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd) if (oddsvalid[2]) SETUPDISTTABLE(2,1); if (oddsvalid[3]) SETUPDISTTABLE(3,1); if (oddsvalid[4]) SETUPDISTTABLE(4,1); - // Nothing we can do about getting new odds for disttable[5], because of how that is set. - if (player->kartstuff[k_roulettetype] == 1) + if (player->kartstuff[k_roulettetype] == 1 && oddsvalid[5]) // Player-controlled "Karma" items useodds = 5; else { @@ -748,13 +747,19 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd) else { for (i = 1; i < 12; i++) - if (pdis <= distvar * ((i * distlen) / 14)) useodds = disttable[((i * distlen) / 14)]; + { + if (pdis <= distvar * ((i * distlen) / 14)) + { + useodds = disttable[((i * distlen) / 14)]; + break; + } + } } } #undef SETUPDISTTABLE - //CONS_Printf("%d %d\n", secondist, distvar*2); + //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, player, mashed); chance++) \ From a417b57bc7c49ce320ebae2af49de504ce2134f0 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 11 Jun 2018 00:59:20 -0400 Subject: [PATCH 023/293] Fixed Battle arrows --- src/dehacked.c | 2 -- src/info.c | 8 +++----- src/info.h | 2 -- src/m_menu.c | 8 ++++---- src/p_mobj.c | 54 +++++++++++++++++++++++++------------------------- 5 files changed, 34 insertions(+), 40 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index bc5814e4..6a1297f9 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6578,8 +6578,6 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_PLAYERARROW", // Above player arrow "S_PLAYERARROW_BOX", "S_PLAYERARROW_ITEM", - "S_PLAYERARROW_INVINCIBILITY", - "S_PLAYERARROW_ROULETTE", "S_PLAYERARROW_NUMBER", "S_PLAYERARROW_X", diff --git a/src/info.c b/src/info.c index 94c4ae0d..ee080957 100644 --- a/src/info.c +++ b/src/info.c @@ -2658,7 +2658,7 @@ state_t states[NUMSTATES] = {SPR_JAWZ, 0, 1, {A_JawzChase}, 0, 0, S_JAWZ}, // S_JAWZ {SPR_JAWZ, 0, 1, {NULL}, 0, 0, S_JAWZ_SHIELD}, // S_JAWZ_SHIELD - {SPR_JAWZ, 0, 0, {NULL}, 0, 0, S_NULL}, // S_JAWZ_DEAD + {SPR_JAWZ, 0, 1, {NULL}, 0, 0, S_NULL}, // S_JAWZ_DEAD {SPR_FBLL, 13, 3, {NULL}, 0, 0, S_FIRETRAIL2}, // S_FIRETRAIL1 {SPR_FBLL, 14, 3, {NULL}, 0, 0, S_FIRETRAIL3}, // S_FIRETRAIL2 @@ -2894,10 +2894,8 @@ state_t states[NUMSTATES] = {SPR_ARRO, FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW {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_ITMI, FF_FULLBRIGHT|FF_ANIMATE, -1, {NULL}, 6, 3, S_NULL}, // S_PLAYERARROW_INVINCIBILITY - {SPR_ITEM, FF_FULLBRIGHT|FF_ANIMATE, -1, {NULL}, 16, 3, S_NULL}, // S_PLAYERARROW_ROULETTE - {SPR_ITMN, FF_FULLBRIGHT, -1, {NULL}, 16, 3, S_NULL}, // S_PLAYERARROW_NUMBER - {SPR_ITMN, FF_FULLBRIGHT|10, -1, {NULL}, 16, 3, S_NULL}, // S_PLAYERARROW_X + {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_PBOM, FF_ANIMATE, -1, {NULL}, 3, 3, S_NULL}, // S_PLAYERBOMB {SPR_RNDM, FF_ANIMATE, -1, {NULL}, 23, 3, S_NULL}, // S_PLAYERITEM diff --git a/src/info.h b/src/info.h index 42d3dacb..c20d6da2 100644 --- a/src/info.h +++ b/src/info.h @@ -3420,8 +3420,6 @@ typedef enum state S_PLAYERARROW, // Above player arrow S_PLAYERARROW_BOX, S_PLAYERARROW_ITEM, - S_PLAYERARROW_INVINCIBILITY, - S_PLAYERARROW_ROULETTE, S_PLAYERARROW_NUMBER, S_PLAYERARROW_X, diff --git a/src/m_menu.c b/src/m_menu.c index ac9509bd..385fa78d 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1509,16 +1509,16 @@ static menuitem_t OP_MonitorToggleMenu[] = // Printing handled by 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, "Triple Sneakers", &cv_triplesneaker, 18}, + {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, "Triple Bananas", &cv_triplebanana, 50}, + {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, "Triple Orbinauts", &cv_tripleorbinaut, 74}, + {IT_STRING | IT_CVAR, NULL, "Orbinauts x3", &cv_tripleorbinaut, 74}, {IT_STRING | IT_CVAR, NULL, "Jawz", &cv_jawz, 82}, - {IT_STRING | IT_CVAR, NULL, "Dual Jawz", &cv_dualjawz, 90}, + {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}, diff --git a/src/p_mobj.c b/src/p_mobj.c index 2a216661..6a59caae 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6924,12 +6924,12 @@ void P_MobjThinker(mobj_t *mobj) fixed_t scale = mobj->target->scale; mobj->color = mobj->target->color; - if (!netgame || G_RaceGametype() + /*if (!netgame || G_RaceGametype() || mobj->target->player == &players[displayplayer] || mobj->target->player->kartstuff[k_balloon] <= 0 || (mobj->target->player->mo->flags2 & MF2_DONTDRAW)) mobj->flags2 |= MF2_DONTDRAW; - else + else*/ mobj->flags2 &= ~MF2_DONTDRAW; P_UnsetThingPosition(mobj); @@ -6968,36 +6968,38 @@ void P_MobjThinker(mobj_t *mobj) if (mobj->target->player->kartstuff[k_itemroulette]) { P_SetMobjState(mobj, S_PLAYERARROW_BOX); - - if (mobj->tracer->state != &states[S_PLAYERARROW_ROULETTE]) // don't reset FF_ANIMATE - P_SetMobjState(mobj->tracer, S_PLAYERARROW_ROULETTE); + P_SetMobjState(mobj->tracer, S_PLAYERARROW_ITEM); + mobj->tracer->frame = FF_FULLBRIGHT|((stplyr->kartstuff[k_itemroulette] % (13*3)) / 3); } else if (mobj->target->player->kartstuff[k_itemtype]) { P_SetMobjState(mobj, S_PLAYERARROW_BOX); - - if (mobj->tracer->state != &states[S_PLAYERARROW_ITEM] - || mobj->tracer->state != &states[S_PLAYERARROW_INVINCIBILITY]) - P_SetMobjState(mobj->tracer, S_PLAYERARROW_ITEM); + P_SetMobjState(mobj->tracer, S_PLAYERARROW_ITEM); switch (mobj->target->player->kartstuff[k_itemtype]) { case KITEM_INVINCIBILITY: - if (mobj->tracer->state != &states[S_PLAYERARROW_INVINCIBILITY]) - P_SetMobjState(mobj->tracer, S_PLAYERARROW_INVINCIBILITY); + mobj->tracer->sprite = SPR_ITMI; + mobj->tracer->frame = FF_FULLBRIGHT|((leveltime % (7*3)) / 3); break; case KITEM_SAD: + mobj->tracer->sprite = SPR_ITEM; mobj->tracer->frame = FF_FULLBRIGHT; break; default: - mobj->tracer->frame = FF_FULLBRIGHT|(mobj->tracer->target->player->kartstuff[k_itemtype]); + mobj->tracer->sprite = SPR_ITEM; + mobj->tracer->frame = FF_FULLBRIGHT|(mobj->target->player->kartstuff[k_itemtype]); break; } - if (mobj->target->player->kartstuff[k_growshrinktimer] > 1 && (leveltime & 1)) + if (mobj->target->player->kartstuff[k_growshrinktimer]) + { mobj->tracer->frame = FF_FULLBRIGHT|KITEM_GROW; - else if (mobj->target->player->kartstuff[k_growshrinktimer] > 1 && !(leveltime & 1)) - P_SetMobjState(mobj, S_INVISIBLE); + if (leveltime & 1) + mobj->tracer->flags2 |= MF2_DONTDRAW; + else + mobj->tracer->flags2 &= ~MF2_DONTDRAW; + } } else { @@ -7008,7 +7010,7 @@ void P_MobjThinker(mobj_t *mobj) mobj->tracer->destscale = scale; if (mobj->target->player->kartstuff[k_itemamount] > 1 - && mobj->target->player->kartstuff[k_itemamount] < 10) // Meh, too difficult to support greater than this :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); @@ -7016,14 +7018,12 @@ void P_MobjThinker(mobj_t *mobj) P_SetTarget(&number->target, mobj); P_SetMobjState(number, S_PLAYERARROW_NUMBER); P_SetScale(number, mobj->scale); - number->fuse = 1; number->destscale = scale; number->frame = FF_FULLBRIGHT|(mobj->target->player->kartstuff[k_itemamount]); P_SetTarget(&numx->target, mobj); P_SetMobjState(numx, S_PLAYERARROW_X); P_SetScale(numx, mobj->scale); - numx->fuse = 1; numx->destscale = scale; } } @@ -9625,7 +9625,6 @@ void P_SpawnPlayer(INT32 playernum) { player_t *p = &players[playernum]; mobj_t *mobj; - mobj_t *overheadarrow; if (p->playerstate == PST_REBORN) G_PlayerReborn(playernum); @@ -9713,13 +9712,14 @@ void P_SpawnPlayer(INT32 playernum) // Spawn with a pity shield if necessary. //P_DoPityCheck(p); - overheadarrow = P_SpawnMobj(mobj->x, mobj->y, mobj->z + P_GetPlayerHeight(p)+16*FRACUNIT, MT_PLAYERARROW); - P_SetTarget(&overheadarrow->target, mobj); - overheadarrow->flags2 |= MF2_DONTDRAW; - P_SetScale(overheadarrow, mobj->destscale); - - if (G_BattleGametype()) + if (G_BattleGametype()) // SRB2kart { + mobj_t *overheadarrow = P_SpawnMobj(mobj->x, mobj->y, mobj->z + P_GetPlayerHeight(p)+16*FRACUNIT, MT_PLAYERARROW); + + P_SetTarget(&overheadarrow->target, mobj); + overheadarrow->flags2 |= MF2_DONTDRAW; + P_SetScale(overheadarrow, mobj->destscale); + /*INT32 i; INT32 pcount = 0; @@ -9727,12 +9727,12 @@ void P_SpawnPlayer(INT32 playernum) { if (!playeringame[i] || players[i].spectator || &players[i] == p) continue; - if (players[i].jointime > 0) + if (players[i].jointime > 1) continue; pcount++; }*/ - if (p->kartstuff[k_balloon] > 0 || leveltime < 1/* || pcount <= 1*/) // srb2kart + if (p->kartstuff[k_balloon] > 0 || leveltime < 1/* || pcount <= 1*/) { INT32 i; angle_t newangle; From e6b33ef65febbada84b97f87ffc8f798b13268fc Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 11 Jun 2018 01:51:50 -0400 Subject: [PATCH 024/293] SPB fixes Shrink also plays its sound, and Shrink/Grow have slower scaling speeds --- src/doomstat.h | 2 +- src/g_game.c | 6 +++--- src/k_kart.c | 50 +++++++++++++++++++++++--------------------------- src/p_inter.c | 4 +++- src/p_saveg.c | 4 ++-- src/p_setup.c | 2 +- src/p_tick.c | 4 ++-- 7 files changed, 35 insertions(+), 37 deletions(-) diff --git a/src/doomstat.h b/src/doomstat.h index b3f64723..cf87ad97 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -445,7 +445,7 @@ extern boolean franticitems; extern boolean mirrormode; extern boolean comeback; -extern tic_t instaitemcooldown; +extern tic_t indirectitemcooldown; extern tic_t spbincoming; extern UINT8 spbplayer; diff --git a/src/g_game.c b/src/g_game.c index 4f824e2c..de47d643 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -253,9 +253,9 @@ SINT8 votes[MAXPLAYERS]; // Each player's vote SINT8 pickedvote; // What vote the host rolls // Server-sided variables -tic_t instaitemcooldown; // Cooldown before any more lightning/blue shell is awarded -tic_t spbincoming; // Timer before blue shell hits, can switch targets at this point -UINT8 spbplayer; // Player num that used the last blue shell +tic_t indirectitemcooldown; // Cooldown before any more Shrink, SPB, or any other item that works indirectly is awarded +tic_t spbincoming; // Timer before SPB hits, can switch targets at this point +UINT8 spbplayer; // Player num that used the last SPB // Client-sided variables (NEVER use in anything that needs to be synced with other players) boolean legitimateexit; // Did this client actually finish the match? diff --git a/src/k_kart.c b/src/k_kart.c index 89792566..c70d117b 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -25,9 +25,9 @@ // franticitems is Frantic Mode items, bool // mirrormode is Mirror Mode (duh), bool // comeback is Battle Mode's karma comeback, also bool -// instaitemcooldown is timer before anyone's allowed another lightning/blue shell +// indirectitemcooldown is timer before anyone's allowed another Shrink/SPB // spbincoming is the timer before k_deathsentence is cast on the player in 1st -// spbplayer is the last player who fired one +// spbplayer is the last player who fired a SPB //{ SRB2kart Color Code @@ -464,6 +464,7 @@ static void K_KartGetItemResult(player_t *player, SINT8 getitem) static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, player_t *player, boolean mashed) { + const INT32 distvar = (64*14); INT32 newodds; INT32 i; UINT8 pingame = 0, pexiting = 0; @@ -507,7 +508,7 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, player_t *player, boolean switch (item) { case KITEM_SNEAKER: - if (!cv_sneaker.value && !modeattacking) newodds = 0; + if ((!cv_sneaker.value) && (!modeattacking)) newodds = 0; break; case KITEM_ROCKETSNEAKER: if (franticitems) newodds *= 2; @@ -517,7 +518,8 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, player_t *player, boolean case KITEM_INVINCIBILITY: if (franticitems) newodds *= 2; if (mashed) newodds /= 2; - if (!cv_invincibility.value || player->kartstuff[k_poweritemtimer]) newodds = 0; + if ((!cv_invincibility.value) + || (player->kartstuff[k_poweritemtimer])) newodds = 0; break; case KITEM_BANANA: if (!cv_banana.value) newodds = 0; @@ -546,18 +548,23 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, player_t *player, boolean case KITEM_SPB: if (franticitems) newodds *= 2; if (mashed) newodds /= 2; - if (!cv_selfpropelledbomb.value || pexiting <= 0 - || (secondist <= (64*14)*4) || instaitemcooldown) newodds = 0; + if ((!cv_selfpropelledbomb.value) + || (indirectitemcooldown > 0) + || (pexiting > 0) + || (secondist <= distvar*4)) newodds = 0; break; case KITEM_GROW: if (franticitems) newodds *= 2; if (mashed) newodds /= 2; - if (!cv_grow.value || player->kartstuff[k_poweritemtimer]) newodds = 0; + if ((!cv_grow.value) + || (player->kartstuff[k_poweritemtimer])) newodds = 0; break; case KITEM_SHRINK: if (franticitems) newodds *= 2; if (mashed) newodds /= 2; - if (!cv_shrink.value || pingame-1 <= pexiting || instaitemcooldown) newodds = 0; + if ((!cv_shrink.value) + || (indirectitemcooldown > 0) + || (pingame-1 <= pexiting)) newodds = 0; break; case KITEM_LIGHTNINGSHIELD: if (franticitems) newodds *= 2; @@ -2213,31 +2220,19 @@ void K_DoSneaker(player_t *player, boolean doPFlag) static void K_DoShrink(player_t *player) { - mobj_t *mo; - thinker_t *think; - //INT32 i; + INT32 i; //S_StartSound(player->mo, sfx_bkpoof); // Sound the BANG! player->pflags |= PF_ATTACKDOWN; - /*for (i = 0; i < MAXPLAYERS; i++) + for (i = 0; i < MAXPLAYERS; i++) { - if (playeringame[i]) - P_FlashPal(&players[i], PAL_NUKE, 10); - }*/ + /*if (playeringame[i]) + P_FlashPal(&players[i], PAL_NUKE, 10);*/ - for (think = thinkercap.next; think != &thinkercap; think = think->next) - { - if (think->function.acp1 != (actionf_p1)P_MobjThinker) - continue; // not a mobj thinker - - mo = (mobj_t *)think; - - if (mo->player && !mo->player->spectator - && mo->player->kartstuff[k_position] < player->kartstuff[k_position]) - P_DamageMobj(mo, player->mo, player->mo, 64); - else - continue; + if (playeringame[i] && players[i].mo && !player->spectator + && players[i].kartstuff[k_position] < player->kartstuff[k_position]) + P_DamageMobj(players[i].mo, player->mo, player->mo, 64); } K_PlayTauntSound(player->mo); @@ -3257,6 +3252,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) if (!cv_kartstarsfx.value && !P_IsLocalPlayer(player)) S_StartSound(player->mo, sfx_kgrow); K_PlayTauntSound(player->mo); + player->mo->scalespeed = FRACUNIT/TICRATE; player->mo->destscale = 3*(mapheaderinfo[gamemap-1]->mobj_scale)/2; player->kartstuff[k_growshrinktimer] = itemtime; S_StartSound(player->mo, sfx_kc5a); diff --git a/src/p_inter.c b/src/p_inter.c index 9b2cf4c8..37920f2e 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -3117,6 +3117,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da K_SpinPlayer(player, source); // Start shrinking! + player->mo->scalespeed = FRACUNIT/TICRATE; player->mo->destscale = 6*(mapheaderinfo[gamemap-1]->mobj_scale)/8; player->kartstuff[k_growshrinktimer] -= (100+20*(16-(player->kartstuff[k_position]))); } @@ -3127,6 +3128,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da } // Invincible or not, we still need this. //P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_LIGHTNING); + S_StartSound(player->mo, sfx_kc59); return true; } @@ -3136,7 +3138,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da if (player == source->player) return false; // Just need to do this now! Being thrown upwards is done by the explosion. - P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_BLUELIGHTNING); + //P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_BLUELIGHTNING); blueexplode = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_BLUEEXPLOSION); P_SetTarget(&blueexplode->target, source); return true; diff --git a/src/p_saveg.c b/src/p_saveg.c index d375f693..763f24e2 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -3255,7 +3255,7 @@ static void P_NetArchiveMisc(void) WRITEUINT8(save_p, franticitems); WRITEUINT8(save_p, comeback); - WRITEUINT32(save_p, instaitemcooldown); + WRITEUINT32(save_p, indirectitemcooldown); WRITEUINT32(save_p, spbincoming); WRITEUINT8(save_p, spbplayer); @@ -3352,7 +3352,7 @@ static inline boolean P_NetUnArchiveMisc(void) franticitems = (boolean)READUINT8(save_p); comeback = (boolean)READUINT8(save_p); - instaitemcooldown = READUINT32(save_p); + indirectitemcooldown = READUINT32(save_p); spbincoming = READUINT32(save_p); spbplayer = READUINT8(save_p); diff --git a/src/p_setup.c b/src/p_setup.c index 5cd82a70..575452e9 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3003,7 +3003,7 @@ boolean P_SetupLevel(boolean skipprecip) comeback = cv_kartcomeback.value; } - instaitemcooldown = 0; + indirectitemcooldown = 0; spbincoming = 0; spbplayer = 0; diff --git a/src/p_tick.c b/src/p_tick.c index bcedf1f6..57574d6f 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -706,8 +706,8 @@ void P_Ticker(boolean run) players[hurtthisguy].kartstuff[k_deathsentence] = TICRATE+1; } - if (instaitemcooldown) - instaitemcooldown--; + if (indirectitemcooldown) + indirectitemcooldown--; if (quake.time) { From e415bae2e503adefd6e351ff089827e2d8226cf8 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 11 Jun 2018 01:56:41 -0400 Subject: [PATCH 025/293] Forgot to uncomment after finished testing. --- src/p_mobj.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 6a59caae..731339fe 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6924,12 +6924,12 @@ void P_MobjThinker(mobj_t *mobj) fixed_t scale = mobj->target->scale; mobj->color = mobj->target->color; - /*if (!netgame || G_RaceGametype() + if (!netgame || G_RaceGametype() || mobj->target->player == &players[displayplayer] || mobj->target->player->kartstuff[k_balloon] <= 0 || (mobj->target->player->mo->flags2 & MF2_DONTDRAW)) mobj->flags2 |= MF2_DONTDRAW; - else*/ + else mobj->flags2 &= ~MF2_DONTDRAW; P_UnsetThingPosition(mobj); From 35eb978c693c186cb6f3ce9c19b130b189b88090 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 11 Jun 2018 02:15:27 -0400 Subject: [PATCH 026/293] MFE_DRAWONLYFORPx stuff ported to OpenGL, and MT_DRIFTDUST respects Boo powers --- src/hardware/hw_main.c | 140 ++++++++++++++++++++++++++++++++--------- src/k_kart.c | 29 ++++++++- 2 files changed, 136 insertions(+), 33 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index ec275f05..189953cd 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -59,7 +59,7 @@ struct hwdriver_s hwdriver; // ========================================================================== -static void HWR_AddSprites(sector_t *sec); +static void HWR_AddSprites(sector_t *sec, UINT8 ssplayer); static void HWR_ProjectSprite(mobj_t *thing); #ifdef HWPRECIP static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing); @@ -3234,7 +3234,7 @@ static void HWR_AddPolyObjectPlanes(void) // : Draw one or more line segments. // Notes : Sets gr_cursectorlight to the light of the parent sector, to modulate wall textures // -----------------+ -static void HWR_Subsector(size_t num) +static void HWR_Subsector(size_t num, UINT8 ssplayer) { INT16 count; seg_t *line; @@ -3602,7 +3602,7 @@ static void HWR_Subsector(size_t num) { // draw sprites first, coz they are clipped to the solidsegs of // subsectors more 'in front' - HWR_AddSprites(gr_frontsector); + HWR_AddSprites(gr_frontsector, ssplayer); //Hurdler: at this point validcount must be the same, but is not because // gr_frontsector doesn't point anymore to sub->sector due to @@ -3654,7 +3654,7 @@ static boolean HWR_CheckHackBBox(fixed_t *bb) // BP: big hack for a test in lighning ref : 1249753487AB fixed_t *hwbbox; -static void HWR_RenderBSPNode(INT32 bspnum) +static void HWR_RenderBSPNode(INT32 bspnum, UINT8 ssplayer) { /*//GZDoom code if(bspnum == -1) @@ -3694,12 +3694,12 @@ static void HWR_RenderBSPNode(INT32 bspnum) if (bspnum == -1) { //*(gr_drawsubsector_p++) = 0; - HWR_Subsector(0); + HWR_Subsector(0, ssplayer); } else { //*(gr_drawsubsector_p++) = bspnum&(~NF_SUBSECTOR); - HWR_Subsector(bspnum&(~NF_SUBSECTOR)); + HWR_Subsector(bspnum&(~NF_SUBSECTOR), ssplayer); } return; } @@ -3711,14 +3711,14 @@ static void HWR_RenderBSPNode(INT32 bspnum) hwbbox = bsp->bbox[side]; // Recursively divide front space. - HWR_RenderBSPNode(bsp->children[side]); + HWR_RenderBSPNode(bsp->children[side], ssplayer); // Possibly divide back space. if (HWR_CheckBBox(bsp->bbox[side^1])) { // BP: big hack for a test in lighning ref : 1249753487AB hwbbox = bsp->bbox[side^1]; - HWR_RenderBSPNode(bsp->children[side^1]); + HWR_RenderBSPNode(bsp->children[side^1], ssplayer); } } @@ -5110,7 +5110,7 @@ static void HWR_DrawSprites(void) // During BSP traversal, this adds sprites by sector. // -------------------------------------------------------------------------- static UINT8 sectorlight; -static void HWR_AddSprites(sector_t *sec) +static void HWR_AddSprites(sector_t *sec, UINT8 ssplayer) { mobj_t *thing; #ifdef HWPRECIP @@ -5140,6 +5140,25 @@ static void HWR_AddSprites(sector_t *sec) if (thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW) continue; + if (splitscreen) + { + if (thing->eflags & MFE_DRAWONLYFORP1) + if (ssplayer != 1) + continue; + + if (thing->eflags & MFE_DRAWONLYFORP2) + if (ssplayer != 2) + continue; + + if (thing->eflags & MFE_DRAWONLYFORP3 && splitscreen > 1) + if (ssplayer != 3) + continue; + + if (thing->eflags & MFE_DRAWONLYFORP4 && splitscreen > 2) + if (ssplayer != 4) + continue; + } + approx_dist = P_AproxDistance(viewx-thing->x, viewy-thing->y); if (approx_dist <= limit_dist) @@ -5150,8 +5169,31 @@ static void HWR_AddSprites(sector_t *sec) { // Draw everything in sector, no checks for (thing = sec->thinglist; thing; thing = thing->snext) - if (!(thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW)) - HWR_ProjectSprite(thing); + { + if (thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW) + continue; + + if (splitscreen) + { + if (thing->eflags & MFE_DRAWONLYFORP1) + if (ssplayer != 1) + continue; + + if (thing->eflags & MFE_DRAWONLYFORP2) + if (ssplayer != 2) + continue; + + if (thing->eflags & MFE_DRAWONLYFORP3 && splitscreen > 1) + if (ssplayer != 3) + continue; + + if (thing->eflags & MFE_DRAWONLYFORP4 && splitscreen > 2) + if (ssplayer != 4) + continue; + } + + HWR_ProjectSprite(thing); + } } #ifdef HWPRECIP @@ -5666,13 +5708,31 @@ void HWR_RenderSkyboxView(INT32 viewnumber, player_t *player) { const float fpov = FIXED_TO_FLOAT(cv_grfov.value+player->fovadd); postimg_t *type; + UINT8 ssplayer = 0; - if (splitscreen && player == &players[secondarydisplayplayer]) - type = &postimgtype2; - else if (splitscreen > 1 && player == &players[thirddisplayplayer]) - type = &postimgtype3; - else if (splitscreen > 2 && player == &players[fourthdisplayplayer]) - type = &postimgtype4; + if (splitscreen) + { + if (player == &players[secondarydisplayplayer]) + { + type = &postimgtype2; + ssplayer = 2; + } + else if (splitscreen > 1 && player == &players[thirddisplayplayer]) + { + type = &postimgtype3; + ssplayer = 3; + } + else if (splitscreen > 2 && player == &players[fourthdisplayplayer]) + { + type = &postimgtype4; + ssplayer = 4; + } + else + { + type = &postimgtype; + ssplayer = 1; + } + } else type = &postimgtype; @@ -5789,7 +5849,7 @@ if (0) validcount++; - HWR_RenderBSPNode((INT32)numnodes-1); + HWR_RenderBSPNode((INT32)numnodes-1, ssplayer); // Make a viewangle int so we can render things based on mouselook if (player == &players[consoleplayer]) @@ -5806,18 +5866,18 @@ if (0) { dup_viewangle += ANGLE_90; HWR_ClearClipSegs(); - HWR_RenderBSPNode((INT32)numnodes-1); //left + HWR_RenderBSPNode((INT32)numnodes-1, ssplayer); //left dup_viewangle += ANGLE_90; if (((INT32)aimingangle > ANGLE_45 || (INT32)aimingangle<-ANGLE_45)) { HWR_ClearClipSegs(); - HWR_RenderBSPNode((INT32)numnodes-1); //back + HWR_RenderBSPNode((INT32)numnodes-1, ssplayer); //back } dup_viewangle += ANGLE_90; HWR_ClearClipSegs(); - HWR_RenderBSPNode((INT32)numnodes-1); //right + HWR_RenderBSPNode((INT32)numnodes-1, ssplayer); //right dup_viewangle += ANGLE_90; } @@ -5881,17 +5941,35 @@ void HWR_RenderPlayerView(INT32 viewnumber, player_t *player) { const float fpov = FIXED_TO_FLOAT(cv_grfov.value+player->fovadd); postimg_t *type; + UINT8 ssplayer = 0; const boolean skybox = (skyboxmo[0] && cv_skybox.value); // True if there's a skybox object and skyboxes are on FRGBAFloat ClearColor; - if (splitscreen && player == &players[secondarydisplayplayer]) - type = &postimgtype2; - else if (splitscreen > 1 && player == &players[thirddisplayplayer]) - type = &postimgtype3; - else if (splitscreen > 2 && player == &players[fourthdisplayplayer]) - type = &postimgtype4; + if (splitscreen) + { + if (player == &players[secondarydisplayplayer]) + { + type = &postimgtype2; + ssplayer = 2; + } + else if (splitscreen > 1 && player == &players[thirddisplayplayer]) + { + type = &postimgtype3; + ssplayer = 3; + } + else if (splitscreen > 2 && player == &players[fourthdisplayplayer]) + { + type = &postimgtype4; + ssplayer = 4; + } + else + { + type = &postimgtype; + ssplayer = 1; + } + } else type = &postimgtype; @@ -6019,7 +6097,7 @@ if (0) validcount++; - HWR_RenderBSPNode((INT32)numnodes-1); + HWR_RenderBSPNode((INT32)numnodes-1, ssplayer); // Make a viewangle int so we can render things based on mouselook if (player == &players[consoleplayer]) @@ -6036,18 +6114,18 @@ if (0) { dup_viewangle += ANGLE_90; HWR_ClearClipSegs(); - HWR_RenderBSPNode((INT32)numnodes-1); //left + HWR_RenderBSPNode((INT32)numnodes-1, ssplayer); //left dup_viewangle += ANGLE_90; if (((INT32)aimingangle > ANGLE_45 || (INT32)aimingangle<-ANGLE_45)) { HWR_ClearClipSegs(); - HWR_RenderBSPNode((INT32)numnodes-1); //back + HWR_RenderBSPNode((INT32)numnodes-1, ssplayer); //back } dup_viewangle += ANGLE_90; HWR_ClearClipSegs(); - HWR_RenderBSPNode((INT32)numnodes-1); //right + HWR_RenderBSPNode((INT32)numnodes-1, ssplayer); //right dup_viewangle += ANGLE_90; } diff --git a/src/k_kart.c b/src/k_kart.c index c70d117b..c00e34f9 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1968,10 +1968,35 @@ void K_DriftDustHandling(mobj_t *spawner) dust->momz = P_MobjFlip(spawner) * P_RandomRange(1, 4)<scale = spawner->scale/2; dust->destscale = spawner->scale * 3; + if (leveltime % 6 == 0) - { S_StartSound(spawner, sfx_screec); - } + + // Now time for a bunch of flag shit, groooooaann... + if (spawner->flags2 & MF2_DONTDRAW) + dust->flags2 |= MF2_DONTDRAW; + else + dust->flags2 &= ~MF2_DONTDRAW; + + if (spawner->eflags & MFE_DRAWONLYFORP1) + dust->eflags |= MFE_DRAWONLYFORP1; + else + dust->eflags &= ~MFE_DRAWONLYFORP1; + + if (spawner->eflags & MFE_DRAWONLYFORP2) + dust->eflags |= MFE_DRAWONLYFORP2; + else + dust->eflags &= ~MFE_DRAWONLYFORP2; + + if (spawner->eflags & MFE_DRAWONLYFORP3) + dust->eflags |= MFE_DRAWONLYFORP3; + else + dust->eflags &= ~MFE_DRAWONLYFORP3; + + if (spawner->eflags & MFE_DRAWONLYFORP4) + dust->eflags |= MFE_DRAWONLYFORP4; + else + dust->eflags &= ~MFE_DRAWONLYFORP4; } } From 8bb6cc6c198e3498b5f7a144215292dff5a71ebb Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 12 Jun 2018 16:27:51 -0400 Subject: [PATCH 027/293] Shrink buffed HEAVILY It now does its job properly: repairing races when there is one straggler far in the back. - Wipeout instead of spinout, to prevent cheap deaths - Lose all of your items when you get shrunk. - You cannot pick up any items while shrunk. - x2 duration. - Appears in the very back, with 10% chance. --- src/k_kart.c | 19 ++++++++++++------- src/k_kart.h | 1 + src/p_inter.c | 19 +++++++++++++++++-- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index c00e34f9..351f387d 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -368,7 +368,7 @@ static INT32 K_KartItemOddsRace[NUMKARTRESULTS][9] = //P-Odds 0 1 2 3 4 5 6 7 8 /*Sneaker*/ {20, 0, 0, 3, 7, 6, 0, 0, 0 }, // Sneaker /*Rocket Sneaker*/ { 0, 0, 0, 0, 0, 3, 5, 4, 0 }, // Rocket Sneaker - /*Invincibility*/ { 0, 0, 0, 0, 0, 1, 6, 9,18 }, // Invincibility + /*Invincibility*/ { 0, 0, 0, 0, 0, 1, 6, 9,16 }, // Invincibility /*Banana*/ { 0, 9, 4, 2, 1, 0, 0, 0, 0 }, // Banana /*Eggman Monitor*/ { 0, 4, 2, 1, 0, 0, 0, 0, 0 }, // Eggman Monitor /*Orbinaut*/ { 0, 6, 4, 3, 2, 0, 0, 0, 0 }, // Orbinaut @@ -377,7 +377,7 @@ static INT32 K_KartItemOddsRace[NUMKARTRESULTS][9] = /*Ballhog*/ { 0, 0, 1, 2, 1, 0, 0, 0, 0 }, // Ballhog /*Self-Propelled Bomb*/ { 0, 0, 1, 2, 4, 3, 1, 0, 0 }, // Self-Propelled Bomb /*Grow*/ { 0, 0, 0, 0, 0, 0, 1, 1, 2 }, // Grow - /*Shrink*/ { 0, 0, 0, 0, 0, 0, 1, 2, 0 }, // Shrink + /*Shrink*/ { 0, 0, 0, 0, 0, 0, 1, 2, 2 }, // Shrink /*Lightning Shield*/ { 0, 1, 2, 0, 0, 0, 0, 0, 0 }, // Lightning Shield /*Hyudoro*/ { 0, 0, 2, 2, 1, 0, 0, 0, 0 }, // Hyudoro /*Pogo Spring*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Pogo Spring @@ -2850,7 +2850,7 @@ static void K_KartUpdatePosition(player_t *player) // // K_StripItems // -static void K_StripItems(player_t *player) +void K_StripItems(player_t *player) { player->kartstuff[k_itemtype] = 0; player->kartstuff[k_itemamount] = 0; @@ -2858,14 +2858,19 @@ static void K_StripItems(player_t *player) player->kartstuff[k_itemroulette] = 0; player->kartstuff[k_roulettetype] = 0; + + player->kartstuff[k_rocketsneakertimer] = 0; + player->kartstuff[k_invincibilitytimer] = 0; + player->kartstuff[k_growshrinktimer] = 0; + + player->kartstuff[k_eggmanheld] = 0; + player->kartstuff[k_hyudorotimer] = 0; player->kartstuff[k_stealingtimer] = 0; player->kartstuff[k_stolentimer] = 0; - player->kartstuff[k_rocketsneakertimer] = 0; - player->kartstuff[k_growshrinktimer] = 0; + player->kartstuff[k_attractiontimer] = 0; - player->kartstuff[k_invincibilitytimer] = 0; - player->kartstuff[k_eggmanheld] = 0; + player->kartstuff[k_sadtimer] = 0; } diff --git a/src/k_kart.h b/src/k_kart.h index 081d0fc0..be455b0f 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -36,6 +36,7 @@ void K_DoSneaker(player_t *player, boolean doPFlag); void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed); boolean K_CheckPlayersRespawnColliding(INT32 playernum, fixed_t x, fixed_t y); INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue); +void K_StripItems(player_t *player); void K_MomentumToFacing(player_t *player); fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower); fixed_t K_GetKartAccel(player_t *player); diff --git a/src/p_inter.c b/src/p_inter.c index 37920f2e..e8e0b0cc 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -161,7 +161,7 @@ boolean P_CanPickupItem(player_t *player, boolean weapon) if (weapon) { if (player->kartstuff[k_stealingtimer] || player->kartstuff[k_stolentimer] - || player->kartstuff[k_growshrinktimer] > 1 || player->kartstuff[k_rocketsneakertimer]) // Item-specific timer going off + || player->kartstuff[k_growshrinktimer] != 0 || player->kartstuff[k_rocketsneakertimer]) // Item-specific timer going off return false; if (player->kartstuff[k_itemroulette] @@ -3119,7 +3119,22 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da // Start shrinking! player->mo->scalespeed = FRACUNIT/TICRATE; player->mo->destscale = 6*(mapheaderinfo[gamemap-1]->mobj_scale)/8; - player->kartstuff[k_growshrinktimer] -= (100+20*(16-(player->kartstuff[k_position]))); + + // Wipeout + player->kartstuff[k_spinouttype] = 1; + K_SpinPlayer(player, source); + damage = player->mo->health - 1; + P_RingDamage(player, inflictor, source, damage); + P_PlayerRingBurst(player, 5); + player->mo->momx = player->mo->momy = 0; + if (P_IsLocalPlayer(player)) + { + quake.intensity = 32*FRACUNIT; + quake.time = 5; + } + + K_StripItems(player); + player->kartstuff[k_growshrinktimer] -= (200+(40*(16-player->kartstuff[k_position]))); } // Grow? Let's take that away. if (player->kartstuff[k_growshrinktimer] > 0) From 1bfcb35effcbd98c0e062590e34fc23d0dc7abca Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 12 Jun 2018 17:14:32 -0400 Subject: [PATCH 028/293] More frequent SPB, and fixed CHECK The new distance setting on SPB is directly inbetween the previous "way too rare" setting and the "way too frequent" setting before that. Hopefully they should come up in reasonable intervals now. --- src/k_kart.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 351f387d..17a8dc79 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -551,7 +551,7 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, player_t *player, boolean if ((!cv_selfpropelledbomb.value) || (indirectitemcooldown > 0) || (pexiting > 0) - || (secondist <= distvar*4)) newodds = 0; + || (secondist <= distvar*3)) newodds = 0; break; case KITEM_GROW: if (franticitems) newodds *= 2; @@ -4497,7 +4497,6 @@ static void K_drawKartPlayerCheck(void) INT32 i; UINT8 *colormap; INT32 x; - UINT8 pnum = 0; INT32 splitflags = K_calcSplitFlags(V_SNAPTOBOTTOM); @@ -4512,6 +4511,8 @@ static void K_drawKartPlayerCheck(void) for (i = 0; i < MAXPLAYERS; i++) { + UINT8 pnum = 0; + if (!playeringame[i] || players[i].spectator) continue; if (!players[i].mo) From 510cf8b521b1663911f5c34088e06e98187b15e0 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 12 Jun 2018 18:01:17 -0400 Subject: [PATCH 029/293] Fix a few minor player arrow bugs --- src/p_mobj.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 731339fe..41315057 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6968,13 +6968,11 @@ void P_MobjThinker(mobj_t *mobj) if (mobj->target->player->kartstuff[k_itemroulette]) { P_SetMobjState(mobj, S_PLAYERARROW_BOX); - P_SetMobjState(mobj->tracer, S_PLAYERARROW_ITEM); mobj->tracer->frame = FF_FULLBRIGHT|((stplyr->kartstuff[k_itemroulette] % (13*3)) / 3); } else if (mobj->target->player->kartstuff[k_itemtype]) { P_SetMobjState(mobj, S_PLAYERARROW_BOX); - P_SetMobjState(mobj->tracer, S_PLAYERARROW_ITEM); switch (mobj->target->player->kartstuff[k_itemtype]) { @@ -7000,6 +6998,8 @@ void P_MobjThinker(mobj_t *mobj) else mobj->tracer->flags2 &= ~MF2_DONTDRAW; } + else + mobj->tracer->flags2 &= ~MF2_DONTDRAW; } else { @@ -7027,6 +7027,8 @@ void P_MobjThinker(mobj_t *mobj) numx->destscale = scale; } } + else + mobj->tracer->flags2 |= MF2_DONTDRAW; } else if (mobj->health > 0) { From d1e206072ac5433ad9271a70b10c6c405302855e Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 12 Jun 2018 19:05:11 -0400 Subject: [PATCH 030/293] Minor vote screen fixes --- src/y_inter.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index 15b20d87..11fefe72 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -2206,6 +2206,7 @@ void Y_VoteDrawer(void) for (j = 0; j <= splitscreen; j++) // another loop for drawing the selection backgrounds in the right order, grumble grumble.. { INT32 handy = y; + UINT8 p; UINT8 *colormap; patch_t *thiscurs; @@ -2215,7 +2216,8 @@ void Y_VoteDrawer(void) if (splitscreen == 0) { thiscurs = cursor; - color = colortranslations[players[consoleplayer].skincolor][7]; + p = consoleplayer; + color = 104; colormap = NULL; } else @@ -2224,27 +2226,29 @@ void Y_VoteDrawer(void) { case 1: thiscurs = cursor2; - color = colortranslations[players[secondarydisplayplayer].skincolor][7]; - colormap = R_GetTranslationColormap(-1, players[secondarydisplayplayer].skincolor, GTC_CACHE); + p = secondarydisplayplayer; break; case 2: thiscurs = cursor3; - color = colortranslations[players[thirddisplayplayer].skincolor][7]; - colormap = R_GetTranslationColormap(-1, players[thirddisplayplayer].skincolor, GTC_CACHE); + p = thirddisplayplayer; break; case 3: thiscurs = cursor4; - color = colortranslations[players[fourthdisplayplayer].skincolor][7]; - colormap = R_GetTranslationColormap(-1, players[fourthdisplayplayer].skincolor, GTC_CACHE); + p = fourthdisplayplayer; break; default: thiscurs = cursor1; - color = colortranslations[players[consoleplayer].skincolor][7]; - colormap = R_GetTranslationColormap(-1, players[consoleplayer].skincolor, GTC_CACHE); + p = displayplayer; break; } + + color = colortranslations[players[p].skincolor][7]; + colormap = R_GetTranslationColormap(TC_DEFAULT, players[p].skincolor, GTC_CACHE); } + if (votes[p] != -1 || players[p].spectator) + continue; + handy += 6*(3-splitscreen) + (13*j); V_DrawMappedPatch(BASEVIDWIDTH-124, handy, V_SNAPTORIGHT, thiscurs, colormap); From d5f311681f964ce1c9b675a77a9f3510b2896318 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 12 Jun 2018 22:10:26 -0400 Subject: [PATCH 031/293] Voting fakeouts The voting cursor can land early, or go up a position, on vote end. Not only is this hilarious and makes it more unpredicatable, it also makes it easier for the game to pick a vote and move on to the next level . (I bet people will mistake this for a bug on release :V) --- src/y_inter.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/y_inter.c b/src/y_inter.c index 11fefe72..5f17c16e 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -2403,7 +2403,9 @@ void Y_VoteTicker(void) { if (voteclient.rendoff == 0) { - if (tempvotes[((pickedvote + voteclient.roffset + 4) % numvotes)] == pickedvote + if ((tempvotes[((pickedvote + voteclient.roffset + 4) % numvotes)] == pickedvote // Pick normally + || tempvotes[((pickedvote + voteclient.roffset + 3) % numvotes)] == pickedvote // Fake out: land early + || tempvotes[((pickedvote + voteclient.roffset + 2) % numvotes)] == pickedvote) // Fake out: cheat and move && voteclient.rsynctime % 51 == 0) // Song is 1.45 seconds long (sorry @ whoever wants to replace it in a music wad :V) { voteclient.rendoff = voteclient.roffset+4; From ed73984d3e2000ccd8af5c877a92638b04d06d4a Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 12 Jun 2018 23:01:17 -0400 Subject: [PATCH 032/293] Messing with the SPB item odds themselves I'm pretty sure this is why it feels like we can't hit a decent balance. --- src/k_kart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index 17a8dc79..ecd5f4cc 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -375,7 +375,7 @@ static INT32 K_KartItemOddsRace[NUMKARTRESULTS][9] = /*Jawz*/ { 0, 0, 3, 2, 2, 1, 0, 0, 0 }, // Jawz /*Mine*/ { 0, 0, 1, 2, 1, 0, 0, 0, 0 }, // Mine /*Ballhog*/ { 0, 0, 1, 2, 1, 0, 0, 0, 0 }, // Ballhog - /*Self-Propelled Bomb*/ { 0, 0, 1, 2, 4, 3, 1, 0, 0 }, // Self-Propelled Bomb + /*Self-Propelled Bomb*/ { 0, 0, 0, 1, 2, 2, 1, 0, 0 }, // Self-Propelled Bomb /*Grow*/ { 0, 0, 0, 0, 0, 0, 1, 1, 2 }, // Grow /*Shrink*/ { 0, 0, 0, 0, 0, 0, 1, 2, 2 }, // Shrink /*Lightning Shield*/ { 0, 1, 2, 0, 0, 0, 0, 0, 0 }, // Lightning Shield From b0d6e2606d051927ef8161730df3c4f951c57804 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 13 Jun 2018 21:32:33 -0400 Subject: [PATCH 033/293] Fix karma items in this branch --- src/k_kart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index ecd5f4cc..9153edb5 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -679,7 +679,7 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd) INT32 j; UINT8 available = 0; - if ((gametype == GT_MATCH || gametype == GT_TEAMMATCH || gametype == GT_CTF) && i >= 5) + if (G_BattleGametype() && i > 5) { oddsvalid[i] = 0; break; From c818689dc17cc29316b7d7c4a4abf57c6cc3e8fc Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 13 Jun 2018 21:33:55 -0400 Subject: [PATCH 034/293] Fix player arrows in this branch again --- src/p_mobj.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 41315057..460adb63 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6954,16 +6954,16 @@ void P_MobjThinker(mobj_t *mobj) scale = 16*FRACUNIT; mobj->destscale = scale; + if (!mobj->tracer) + { + mobj->tracer = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_OVERLAY); + P_SetTarget(&mobj->tracer->target, mobj); + P_SetMobjState(mobj->tracer, S_PLAYERARROW_ITEM); + P_SetScale(mobj->tracer, mobj->scale); + } + if (!(mobj->flags2 & MF2_DONTDRAW)) { - if (!mobj->tracer) - { - mobj->tracer = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_OVERLAY); - P_SetTarget(&mobj->tracer->target, mobj); - P_SetMobjState(mobj->tracer, S_PLAYERARROW_ITEM); - P_SetScale(mobj->tracer, mobj->scale); - } - // Set it to use the correct states for its condition if (mobj->target->player->kartstuff[k_itemroulette]) { From 5f4c0bb05240f76ed3688fc8cd0683a2769893f2 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 13 Jun 2018 21:47:27 -0400 Subject: [PATCH 035/293] Different, nicer way of doing fakeouts Means it can no longer cheat, but I never saw it cheat in action anyway. --- src/y_inter.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index 5f17c16e..d8291933 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -2403,13 +2403,17 @@ void Y_VoteTicker(void) { if (voteclient.rendoff == 0) { - if ((tempvotes[((pickedvote + voteclient.roffset + 4) % numvotes)] == pickedvote // Pick normally - || tempvotes[((pickedvote + voteclient.roffset + 3) % numvotes)] == pickedvote // Fake out: land early - || tempvotes[((pickedvote + voteclient.roffset + 2) % numvotes)] == pickedvote) // Fake out: cheat and move - && voteclient.rsynctime % 51 == 0) // Song is 1.45 seconds long (sorry @ whoever wants to replace it in a music wad :V) + if (voteclient.rsynctime % 51 == 0) // Song is 1.45 seconds long (sorry @ whoever wants to replace it in a music wad :V) { - voteclient.rendoff = voteclient.roffset+4; - S_ChangeMusicInternal("voteeb", false); + for (i = 5; i >= 3; i--) // Find a suitable place to stop + { + if (tempvotes[((pickedvote + voteclient.roffset + i) % numvotes)] == pickedvote) + { + voteclient.rendoff = voteclient.roffset+i; + S_ChangeMusicInternal("voteeb", false); + break; + } + } } } else if (voteclient.roffset >= voteclient.rendoff) From 8f9595b72fee1d0bb2b88d3ba7cae4118384af89 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 13 Jun 2018 21:58:21 -0400 Subject: [PATCH 036/293] Readd voting cheating, just in an entirely different way Will need tested for desyncs, since it adds some RNG into the vote ticker. Which may or may not matter. --- src/y_inter.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/y_inter.c b/src/y_inter.c index d8291933..b1c7198e 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -2410,6 +2410,8 @@ void Y_VoteTicker(void) if (tempvotes[((pickedvote + voteclient.roffset + i) % numvotes)] == pickedvote) { voteclient.rendoff = voteclient.roffset+i; + if (P_RandomChance(FRACUNIT/1024)) // Let it cheat occasionally~ + voteclient.rendoff++; S_ChangeMusicInternal("voteeb", false); break; } From ff09a5191543be31aa999257b59b06b73f2cc9e8 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 13 Jun 2018 22:24:31 -0400 Subject: [PATCH 037/293] Fix invincibility white flash Calls P_TeleportMove instead of A_CapeChase, object was given a dispoffset --- src/info.c | 2 +- src/p_mobj.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/info.c b/src/info.c index ee080957..a0ea3c32 100644 --- a/src/info.c +++ b/src/info.c @@ -14365,7 +14365,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 8, // speed 8*FRACUNIT, // radius 8*FRACUNIT, // height - 0, // display offset + 1, // display offset 100, // mass 0, // damage sfx_None, // activesound diff --git a/src/p_mobj.c b/src/p_mobj.c index 460adb63..d7ad596b 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8134,12 +8134,12 @@ void P_MobjThinker(mobj_t *mobj) mobj->colorized = mobj->target->colorized; break; case MT_INVULNFLASH: - if (!mobj->target || (mobj->target->player && !mobj->target->player->kartstuff[k_invincibilitytimer])) + if (!mobj->target || !mobj->target->health || (mobj->target->player && !mobj->target->player->kartstuff[k_invincibilitytimer])) { P_RemoveMobj(mobj); return; } - A_CapeChase(mobj); + P_TeleportMove(mobj, mobj->target->x, mobj->target->y, mobj->target->z); break; //} case MT_TURRET: From 118721ebc1141956bfd5e87e8e2755ea303c90fc Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 13 Jun 2018 23:37:37 -0400 Subject: [PATCH 038/293] Random items poof instead of sparkle Also added a poof when they respawn in Battle --- src/info.c | 2 +- src/m_menu.c | 6 +++--- src/p_mobj.c | 6 +++++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/info.c b/src/info.c index a0ea3c32..dbeee245 100644 --- a/src/info.c +++ b/src/info.c @@ -14285,7 +14285,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 16*FRACUNIT, // radius 32*FRACUNIT, // height 0, // display offset - MT_SPARK, // mass + MT_EXPLODE, // mass 0, // damage sfx_None, // activesound MF_NOCLIP, // flags diff --git a/src/m_menu.c b/src/m_menu.c index 385fa78d..7146890f 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1480,12 +1480,12 @@ static menuitem_t OP_NetgameOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "Frantic Items", &cv_kartfrantic, 34}, {IT_STRING | IT_CVAR, NULL, "Item Respawn", &cv_itemrespawn, 50}, - {IT_STRING | IT_CVAR, NULL, "Item Respawn time", &cv_itemrespawntime, 58}, + {IT_STRING | IT_CVAR, NULL, "Item Respawn Delay", &cv_itemrespawntime, 58}, - {IT_STRING | IT_CVAR, NULL, "Player respawn delay", &cv_respawntime, 74}, + {IT_STRING | IT_CVAR, NULL, "Player Respawn Delay", &cv_respawntime, 74}, {IT_STRING | IT_CVAR, NULL, "Force Skin #", &cv_forceskin, 90}, - {IT_STRING | IT_CVAR, NULL, "Restrict skin changes", &cv_restrictskinchange, 98}, + {IT_STRING | IT_CVAR, NULL, "Restrict Skin Changes", &cv_restrictskinchange, 98}, //{IT_STRING | IT_CVAR, NULL, "Autobalance Teams", &cv_autobalance, 114}, //{IT_STRING | IT_CVAR, NULL, "Scramble Teams on Map Change", &cv_scrambleonchange, 122}, diff --git a/src/p_mobj.c b/src/p_mobj.c index d7ad596b..b7f2946b 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9279,7 +9279,7 @@ void P_RemoveSavegameMobj(mobj_t *mobj) } static CV_PossibleValue_t respawnitemtime_cons_t[] = {{1, "MIN"}, {300, "MAX"}, {0, NULL}}; -consvar_t cv_itemrespawntime = {"respawnitemtime", "1", CV_NETVAR|CV_CHEAT, respawnitemtime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_itemrespawntime = {"respawnitemtime", "3", CV_NETVAR|CV_CHEAT, respawnitemtime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_itemrespawn = {"respawnitem", "On", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t flagtime_cons_t[] = {{0, "MIN"}, {300, "MAX"}, {0, NULL}}; consvar_t cv_flagtime = {"flagtime", "30", CV_NETVAR|CV_CHEAT, flagtime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -9514,9 +9514,13 @@ void P_RespawnSpecials(void) { P_SpawnMapThing(box->spawnpoint); newmobj = box->spawnpoint->mobj; // this is set to the new mobj in P_SpawnMapThing + P_SpawnMobj(box->spawnpoint->mobj->x, box->spawnpoint->mobj->y, box->spawnpoint->mobj->z, MT_EXPLODE); // poof into existance } else + { newmobj = P_SpawnMobj(box->x, box->y, box->z, box->type); + P_SpawnMobj(newmobj->x, newmobj->y, newmobj->z, MT_EXPLODE); // poof into existance + } // Transfer flags2 (strongbox, objectflip) newmobj->flags2 = box->flags2; From 0543d8e0fadd6325f5cb9bca01f0d7ececdf7037 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 14 Jun 2018 20:18:29 -0400 Subject: [PATCH 039/293] Better menus --- src/d_netcmd.c | 10 +-- src/d_netcmd.h | 4 +- src/k_kart.c | 16 ++-- src/m_menu.c | 228 +++++++++++++++++++++++++++++-------------------- src/r_main.c | 2 +- src/s_sound.c | 2 +- src/s_sound.h | 1 + src/v_video.c | 2 +- 8 files changed, 153 insertions(+), 112 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 2ef99f8d..da91032e 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -244,7 +244,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", "Ally/Foe", CV_SAVE, seenames_cons_t, 0, 0, NULL, NULL, 0, 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}; #endif @@ -354,16 +354,16 @@ consvar_t cv_karthud = {"karthud", "Default", CV_SAVE|CV_CALL, karthud_cons_t, N 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}; -static CV_PossibleValue_t kartstarsfx_cons_t[] = {{0, "Music"}, {1, "SMK"}, {0, NULL}}; -consvar_t cv_kartstarsfx = {"kartstarsfx", "SMK", CV_SAVE, kartstarsfx_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +static CV_PossibleValue_t kartinvinsfx_cons_t[] = {{0, "Music"}, {1, "SFX"}, {0, NULL}}; +consvar_t cv_kartinvinsfx = {"kartinvinsfx", "SFX", CV_SAVE, kartinvinsfx_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_kartspeed = {"kartspeed", "Normal", CV_NETVAR|CV_CALL|CV_NOINIT, kartspeed_cons_t, KartSpeed_OnChange, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t kartballoons_cons_t[] = {{1, "MIN"}, {12, "MAX"}, {0, NULL}}; consvar_t cv_kartballoons = {"kartballoons", "3", CV_NETVAR|CV_CHEAT, kartballoons_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_kartfrantic = {"kartfrantic", "Off", CV_NETVAR|CV_CHEAT|CV_CALL|CV_NOINIT, CV_OnOff, KartFrantic_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_kartcomeback = {"kartcomeback", "On", CV_NETVAR|CV_CHEAT|CV_CALL|CV_NOINIT, CV_OnOff, KartComeback_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_kartmirror = {"kartmirror", "Off", CV_NETVAR|CV_CHEAT|CV_CALL|CV_NOINIT, CV_OnOff, KartMirror_OnChange, 0, NULL, NULL, 0, 0, NULL}; -static CV_PossibleValue_t speedometer_cons_t[] = {{0, "Off"}, {1, "Kilometers"}, {2, "Miles"}, {3, "Fracunits"}, {0, NULL}}; -consvar_t cv_speedometer = {"speedometer", "Off", CV_SAVE, speedometer_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // use tics in display +static CV_PossibleValue_t kartspeedometer_cons_t[] = {{0, "Off"}, {1, "Kilometers"}, {2, "Miles"}, {3, "Fracunits"}, {0, NULL}}; +consvar_t cv_kartspeedometer = {"kartdisplayspeed", "Off", CV_SAVE, kartspeedometer_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // use tics in display static CV_PossibleValue_t kartdebugitem_cons_t[] = {{-1, "MIN"}, {NUMKARTITEMS-1, "MAX"}, {0, NULL}}; consvar_t cv_kartdebugitem = {"kartdebugitem", "0", CV_NETVAR|CV_CHEAT, kartdebugitem_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; diff --git a/src/d_netcmd.h b/src/d_netcmd.h index a0cdafca..262e4122 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -119,13 +119,13 @@ extern consvar_t cv_triplesneaker, cv_triplebanana, cv_tripleorbinaut, cv_dualja extern consvar_t cv_karthud; extern consvar_t cv_kartminimap; extern consvar_t cv_kartcheck; -extern consvar_t cv_kartstarsfx; +extern consvar_t cv_kartinvinsfx; extern consvar_t cv_kartspeed; extern consvar_t cv_kartballoons; extern consvar_t cv_kartfrantic; extern consvar_t cv_kartcomeback; extern consvar_t cv_kartmirror; -extern consvar_t cv_speedometer; +extern consvar_t cv_kartspeedometer; extern consvar_t cv_votetime; diff --git a/src/k_kart.c b/src/k_kart.c index 9153edb5..4a1f6a9a 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -319,13 +319,13 @@ void K_RegisterKartStuff(void) CV_RegisterVar(&cv_kartminimap); CV_RegisterVar(&cv_kartcheck); - CV_RegisterVar(&cv_kartstarsfx); + CV_RegisterVar(&cv_kartinvinsfx); CV_RegisterVar(&cv_kartspeed); CV_RegisterVar(&cv_kartballoons); CV_RegisterVar(&cv_kartfrantic); CV_RegisterVar(&cv_kartcomeback); CV_RegisterVar(&cv_kartmirror); - CV_RegisterVar(&cv_speedometer); + CV_RegisterVar(&cv_kartspeedometer); CV_RegisterVar(&cv_votetime); CV_RegisterVar(&cv_kartdebugitem); @@ -2509,7 +2509,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) if (player->mo->health > 0 && (player->mo->player->kartstuff[k_invincibilitytimer] > 0 || player->mo->player->kartstuff[k_growshrinktimer] > 0)) { - if (leveltime % 13 == 0 && cv_kartstarsfx.value && !P_IsLocalPlayer(player)) + if (leveltime % 13 == 0 && cv_kartinvinsfx.value && !P_IsLocalPlayer(player)) S_StartSound(player->mo, sfx_smkinv); } else if (S_SoundPlaying(player->mo, sfx_smkinv)) @@ -2956,7 +2956,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) { if (P_IsLocalPlayer(player) && !player->exiting) S_ChangeMusicInternal("kinvnc", true); - if (!cv_kartstarsfx.value && !P_IsLocalPlayer(player)) + if (!cv_kartinvinsfx.value && !P_IsLocalPlayer(player)) S_StartSound(player->mo, sfx_kinvnc); if (!player->kartstuff[k_invincibilitytimer]) { @@ -3279,7 +3279,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) { if (P_IsLocalPlayer(player) && !player->exiting) S_ChangeMusicInternal("kgrow", true); - if (!cv_kartstarsfx.value && !P_IsLocalPlayer(player)) + if (!cv_kartinvinsfx.value && !P_IsLocalPlayer(player)) S_StartSound(player->mo, sfx_kgrow); K_PlayTauntSound(player->mo); player->mo->scalespeed = FRACUNIT/TICRATE; @@ -4394,17 +4394,17 @@ static void K_drawKartSpeedometer(void) fixed_t convSpeed; INT32 splitflags = K_calcSplitFlags(V_SNAPTOBOTTOM|V_SNAPTOLEFT); - if (cv_speedometer.value == 1) + if (cv_kartspeedometer.value == 1) // Kilometers { convSpeed = FixedDiv(FixedMul(stplyr->speed, 142371), mapheaderinfo[gamemap-1]->mobj_scale)/FRACUNIT; // 2.172409058 V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%3d km/h", convSpeed)); } - else if (cv_speedometer.value == 2) + else if (cv_kartspeedometer.value == 2) // Miles { convSpeed = FixedDiv(FixedMul(stplyr->speed, 88465), mapheaderinfo[gamemap-1]->mobj_scale)/FRACUNIT; // 1.349868774 V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%3d mph", convSpeed)); } - else if (cv_speedometer.value == 3) + else if (cv_kartspeedometer.value == 3) // Fracunits { convSpeed = FixedDiv(stplyr->speed, mapheaderinfo[gamemap-1]->mobj_scale)/FRACUNIT; V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%3d fu/t", convSpeed)); diff --git a/src/m_menu.c b/src/m_menu.c index 7146890f..f82ade5d 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -316,11 +316,13 @@ menu_t OP_SoundOptionsDef; static void M_ToggleSFX(void); static void M_ToggleDigital(void); static void M_ToggleMIDI(void); +static void M_RestartAudio(void); //Misc -menu_t OP_DataOptionsDef, OP_ScreenshotOptionsDef, OP_EraseDataDef; +menu_t /*OP_DataOptionsDef,*/ OP_ScreenshotOptionsDef, OP_EraseDataDef; +menu_t OP_HUDOptionsDef; menu_t OP_GameOptionsDef, OP_ServerOptionsDef; -menu_t OP_NetgameOptionsDef, OP_GametypeOptionsDef; +//menu_t OP_NetgameOptionsDef, OP_GametypeOptionsDef; menu_t OP_MonitorToggleDef; static void M_ScreenshotOptions(INT32 choice); static void M_EraseData(INT32 choice); @@ -1033,17 +1035,19 @@ static menuitem_t MP_PlayerSetupMenu[] = // Prefix: OP_ static menuitem_t OP_MainMenu[] = { - {IT_SUBMENU | IT_STRING, NULL, "Setup Controls...", &OP_ControlsDef, 10}, + {IT_SUBMENU|IT_STRING, NULL, "Control Setup...", &OP_ControlsDef, 10}, - {IT_SUBMENU | IT_STRING, NULL, "Video Options...", &OP_VideoOptionsDef, 30}, - {IT_SUBMENU | IT_STRING, NULL, "Sound Options...", &OP_SoundOptionsDef, 40}, - {IT_SUBMENU | IT_STRING, NULL, "Data Options...", &OP_DataOptionsDef, 50}, + {IT_SUBMENU|IT_STRING, NULL, "Video Options...", &OP_VideoOptionsDef, 30}, + {IT_SUBMENU|IT_STRING, NULL, "Sound Options...", &OP_SoundOptionsDef, 40}, - {IT_SUBMENU | IT_STRING, NULL, "Game Options...", &OP_GameOptionsDef, 70}, - {IT_SUBMENU | IT_STRING, NULL, "Server Options...", &OP_ServerOptionsDef, 80}, + {IT_SUBMENU|IT_STRING, NULL, "HUD Options...", &OP_HUDOptionsDef, 60}, + {IT_STRING|IT_CALL, NULL, "Screenshot Options...", M_ScreenshotOptions, 70}, - {IT_CALL | IT_STRING, NULL, "Play Credits", M_Credits, 100}, - {IT_KEYHANDLER | IT_STRING, NULL, "Sound Test", M_HandleSoundTest, 110}, + {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}, }; static menuitem_t OP_ControlsMenu[] = @@ -1285,26 +1289,24 @@ static menuitem_t OP_Mouse2OptionsMenu[] = static menuitem_t OP_VideoOptionsMenu[] = { - {IT_STRING | IT_CALL, NULL, "Video Modes...", M_VideoModeMenu, 10}, - + {IT_STRING | IT_CALL, NULL, "Resolution Modes...", M_VideoModeMenu, 10}, #ifdef HWRENDER - {IT_SUBMENU|IT_STRING, NULL, "3D Card Options...", &OP_OpenGLOptionsDef, 20}, + {IT_SUBMENU|IT_STRING, NULL, "OpenGL Options...", &OP_OpenGLOptionsDef, 20}, #endif - #if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL) - {IT_STRING|IT_CVAR, NULL, "Fullscreen", &cv_fullscreen, 30}, + {IT_STRING|IT_CVAR, NULL, "Fullscreen", &cv_fullscreen, 30}, #endif - {IT_STRING | IT_CVAR | IT_CV_SLIDER, - NULL, "Brightness", &cv_usegamma, 50}, - {IT_STRING | IT_CVAR, NULL, "Draw Distance", &cv_drawdist, 60}, - {IT_STRING | IT_CVAR, NULL, "NiGHTS Draw Dist", &cv_drawdist_nights, 70}, - {IT_STRING | IT_CVAR, NULL, "Precip Draw Dist", &cv_drawdist_precip, 80}, - {IT_STRING | IT_CVAR, NULL, "Precip Density", &cv_precipdensity, 90}, + NULL, "Gamma", &cv_usegamma, 50}, - {IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 110}, - {IT_STRING | IT_CVAR, NULL, "Clear Before Redraw", &cv_homremoval, 120}, - {IT_STRING | IT_CVAR, NULL, "Vertical Sync", &cv_vidwait, 130}, + {IT_STRING | IT_CVAR, NULL, "Draw Distance", &cv_drawdist, 70}, + {IT_STRING | IT_CVAR, NULL, "NiGHTS Draw Dist", &cv_drawdist_nights, 80}, + {IT_STRING | IT_CVAR, NULL, "Precip Draw Dist", &cv_drawdist_precip, 90}, + {IT_STRING | IT_CVAR, NULL, "Precip Density", &cv_precipdensity, 100}, + {IT_STRING | IT_CVAR, NULL, "Skyboxes", &cv_skybox, 110}, + + {IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 130}, + {IT_STRING | IT_CVAR, NULL, "Vertical Sync", &cv_vidwait, 140}, }; static menuitem_t OP_VideoModeMenu[] = @@ -1315,7 +1317,7 @@ static menuitem_t OP_VideoModeMenu[] = #ifdef HWRENDER static menuitem_t OP_OpenGLOptionsMenu[] = { - {IT_STRING|IT_CVAR, NULL, "Field of view", &cv_grfov, 10}, + {IT_STRING|IT_CVAR, NULL, "Field of View", &cv_grfov, 10}, {IT_STRING|IT_CVAR, NULL, "Quality", &cv_scr_depth, 20}, {IT_STRING|IT_CVAR, NULL, "Texture Filter", &cv_grfiltermode, 30}, {IT_STRING|IT_CVAR, NULL, "Anisotropic", &cv_granisotropicmode,40}, @@ -1342,43 +1344,48 @@ static menuitem_t OP_OpenGLLightingMenu[] = static menuitem_t OP_OpenGLFogMenu[] = { {IT_STRING|IT_CVAR, NULL, "Fog", &cv_grfog, 10}, - {IT_STRING|IT_KEYHANDLER, NULL, "Fog color", M_HandleFogColor, 20}, - {IT_STRING|IT_CVAR, NULL, "Fog density", &cv_grfogdensity, 30}, + {IT_STRING|IT_KEYHANDLER, NULL, "Fog Color", M_HandleFogColor, 20}, + {IT_STRING|IT_CVAR, NULL, "Fog Density", &cv_grfogdensity, 30}, {IT_STRING|IT_CVAR, NULL, "Software Fog",&cv_grsoftwarefog,40}, }; static menuitem_t OP_OpenGLColorMenu[] = { - {IT_STRING|IT_CVAR|IT_CV_SLIDER, NULL, "red", &cv_grgammared, 10}, - {IT_STRING|IT_CVAR|IT_CV_SLIDER, NULL, "green", &cv_grgammagreen, 20}, - {IT_STRING|IT_CVAR|IT_CV_SLIDER, NULL, "blue", &cv_grgammablue, 30}, + {IT_STRING|IT_CVAR|IT_CV_SLIDER, NULL, "Red", &cv_grgammared, 10}, + {IT_STRING|IT_CVAR|IT_CV_SLIDER, NULL, "Green", &cv_grgammagreen, 20}, + {IT_STRING|IT_CVAR|IT_CV_SLIDER, NULL, "Blue", &cv_grgammablue, 30}, }; #endif static menuitem_t OP_SoundOptionsMenu[] = { - {IT_STRING | IT_CVAR | IT_CV_SLIDER, - NULL, "Sound Volume" , &cv_soundvolume, 10}, - {IT_STRING | IT_CVAR | IT_CV_SLIDER, - NULL, "Music Volume" , &cv_digmusicvolume, 20}, - {IT_STRING | IT_CVAR | IT_CV_SLIDER, - NULL, "MIDI Volume" , &cv_midimusicvolume, 30}, + {IT_STRING|IT_CVAR|IT_CV_SLIDER, + NULL, "SFX Volume", &cv_soundvolume, 10}, + {IT_STRING|IT_CVAR|IT_CV_SLIDER, + NULL, "Music Volume", &cv_digmusicvolume, 20}, + {IT_STRING|IT_CVAR|IT_CV_SLIDER, + NULL, "MIDI Volume", &cv_midimusicvolume, 30}, #ifdef PC_DOS - {IT_STRING | IT_CVAR | IT_CV_SLIDER, - NULL, "CD Volume" , &cd_volume, 40}, + {IT_STRING|IT_CVAR|IT_CV_SLIDER, + NULL, "CD Volume", &cd_volume, 40}, #endif + {IT_STRING|IT_CALL, NULL, "Toggle SFX", M_ToggleSFX, 50}, + {IT_STRING|IT_CALL, NULL, "Toggle Music", M_ToggleDigital, 60}, + {IT_STRING|IT_CALL, NULL, "Toggle MIDI", M_ToggleMIDI, 70}, + {IT_STRING|IT_CALL, NULL, "Restart Audio System", M_RestartAudio, 80}, - {IT_STRING | IT_CALL, NULL, "Toggle SFX" , M_ToggleSFX, 50}, - {IT_STRING | IT_CALL, NULL, "Toggle Digital Music", M_ToggleDigital, 60}, - {IT_STRING | IT_CALL, NULL, "Toggle MIDI Music", M_ToggleMIDI, 70}, + {IT_STRING|IT_CVAR, NULL, "Reverse L/R Channels", &stereoreverse, 100}, + {IT_STRING|IT_CVAR, NULL, "Surround Sound", &surround, 110}, + + {IT_KEYHANDLER|IT_STRING, NULL, "Sound Test", M_HandleSoundTest, 130}, }; -static menuitem_t OP_DataOptionsMenu[] = +/*static menuitem_t OP_DataOptionsMenu[] = { {IT_STRING | IT_CALL, NULL, "Screenshot Options...", M_ScreenshotOptions, 10}, {IT_STRING | IT_SUBMENU, NULL, "Erase Data...", &OP_EraseDataDef, 30}, -}; +};*/ static menuitem_t OP_ScreenshotOptionsMenu[] = { @@ -1416,63 +1423,69 @@ enum static menuitem_t OP_EraseDataMenu[] = { {IT_STRING | IT_CALL, NULL, "Erase Record Data", M_EraseData, 10}, - {IT_STRING | IT_CALL, NULL, "Erase Secrets Data", M_EraseData, 20}, + {IT_STRING | IT_CALL, NULL, "Erase Unlockable Data", M_EraseData, 20}, {IT_STRING | IT_CALL, NULL, "\x85" "Erase ALL Data", M_EraseData, 40}, }; +static menuitem_t OP_HUDOptionsMenu[] = +{ + {IT_STRING | IT_CVAR, NULL, "Show HUD", &cv_showhud, 10}, + {IT_STRING | IT_CVAR | IT_CV_SLIDER, + NULL, "HUD Visibility", &cv_translucenthud, 20}, + + {IT_STRING | IT_CVAR | IT_CV_SLIDER, + NULL, "Minimap Visibility", &cv_kartminimap, 40}, + {IT_STRING | IT_CVAR, NULL, "Speedometer Display", &cv_kartspeedometer, 50}, + {IT_STRING | IT_CVAR, NULL, "Show \"CHECK\"", &cv_kartcheck, 60}, + {IT_STRING | IT_CVAR, NULL, "Invinciblity SFX", &cv_kartinvinsfx, 70}, + + {IT_STRING | IT_CVAR, NULL, "Console Color", &cons_backcolor, 90}, + {IT_STRING | IT_CVAR, NULL, "Console Text Size", &cv_constextsize, 100}, +}; + static menuitem_t OP_GameOptionsMenu[] = { -#ifndef NONET - {IT_STRING | IT_CVAR | IT_CV_STRING, - NULL, "Master server", &cv_masterserver, 10}, -#endif - {IT_STRING | IT_CVAR, NULL, "Show HUD", &cv_showhud, 40}, - {IT_STRING | IT_CVAR | IT_CV_SLIDER, - NULL, "HUD Visibility", &cv_translucenthud, 50}, + {IT_STRING | IT_SUBMENU, NULL, "Random Item Toggles...", &OP_MonitorToggleDef, 10}, - {IT_STRING | IT_CVAR | IT_CV_SLIDER, - NULL, "Minimap Visibility", &cv_kartminimap, 62}, - {IT_STRING | IT_CVAR, NULL, "Speedometer Display", &cv_speedometer, 72}, - {IT_STRING | IT_CVAR, NULL, "Show \"CHECK\"", &cv_kartcheck, 82}, - {IT_STRING | IT_CVAR, NULL, "Star SFX", &cv_kartstarsfx, 92}, + {IT_STRING | IT_CVAR, NULL, "Game Speed", &cv_kartspeed, 30}, + {IT_STRING | IT_CVAR, NULL, "Frantic Items", &cv_kartfrantic, 40}, + {IT_STRING | IT_CVAR, NULL, "Mirror Mode", &cv_kartmirror, 50}, -#ifdef SEENAMES - {IT_STRING | IT_CVAR, NULL, "HUD Player Names", &cv_seenames, 104}, -#endif - {IT_STRING | IT_CVAR, NULL, "Log Hazard Damage", &cv_hazardlog, 114}, + {IT_STRING | IT_CVAR, NULL, "Number of Laps", &cv_numlaps, 70}, + {IT_STRING | IT_CVAR, NULL, "Use Default Lap Counts", &cv_usemapnumlaps, 80}, + {IT_STRING | IT_CVAR, NULL, "Exit Countdown Timer", &cv_countdowntime, 90}, - {IT_STRING | IT_CVAR, NULL, "Console Back Color", &cons_backcolor, 126}, - {IT_STRING | IT_CVAR, NULL, "Console Text Size", &cv_constextsize,136}, - {IT_STRING | IT_CVAR, NULL, "Uppercase Console", &cv_allcaps, 146}, + //{IT_STRING | IT_CVAR, NULL, "Time Limit", &cv_timelimit, 110}, + {IT_STRING | IT_CVAR, NULL, "Starting Balloons", &cv_kartballoons, 110}, + {IT_STRING | IT_CVAR, NULL, "Karma Comeback", &cv_kartcomeback, 120}, - {IT_STRING | IT_CVAR, NULL, "Title Screen Demos", &cv_rollingdemos, 158}, + {IT_STRING | IT_CVAR, NULL, "Force Character #", &cv_forceskin, 140}, + {IT_STRING | IT_CVAR, NULL, "Restrict Character Changes", &cv_restrictskinchange, 150}, }; static menuitem_t OP_ServerOptionsMenu[] = { - {IT_STRING | IT_SUBMENU, NULL, "General netgame options...", &OP_NetgameOptionsDef, 10}, - {IT_STRING | IT_SUBMENU, NULL, "Gametype options...", &OP_GametypeOptionsDef, 20}, - {IT_STRING | IT_SUBMENU, NULL, "Random item toggles...", &OP_MonitorToggleDef, 30}, - #ifndef NONET {IT_STRING | IT_CVAR | IT_CV_STRING, - NULL, "Server name", &cv_servername, 50}, + NULL, "Server Name", &cv_servername, 10}, #endif - {IT_STRING | IT_CVAR, NULL, "Intermission Timer", &cv_inttime, 80}, - {IT_STRING | IT_CVAR, NULL, "Voting Timer", &cv_votetime, 90}, - {IT_STRING | IT_CVAR, NULL, "Advance to next map", &cv_advancemap, 100}, + {IT_STRING | IT_CVAR, NULL, "Intermission Timer", &cv_inttime, 40}, + {IT_STRING | IT_CVAR, NULL, "Voting Timer", &cv_votetime, 50}, + {IT_STRING | IT_CVAR, NULL, "Advance to Next Level", &cv_advancemap, 60}, #ifndef NONET - {IT_STRING | IT_CVAR, NULL, "Max Players", &cv_maxplayers, 120}, - {IT_STRING | IT_CVAR, NULL, "Allow players to join", &cv_allownewplayer, 130}, - {IT_STRING | IT_CVAR, NULL, "Allow WAD Downloading", &cv_downloading, 140}, - {IT_STRING | IT_CVAR, NULL, "Attempts to Resynch", &cv_resynchattempts, 150}, + {IT_STRING | IT_CVAR, NULL, "Max Player Count", &cv_maxplayers, 80}, + {IT_STRING | IT_CVAR, NULL, "Allow Players to Join", &cv_allownewplayer, 90}, + {IT_STRING | IT_CVAR, NULL, "Join on Map Change", &cv_joinnextround, 100}, + + {IT_STRING | IT_CVAR, NULL, "Allow WAD Downloading", &cv_downloading, 120}, + {IT_STRING | IT_CVAR, NULL, "Attempts to Resynch", &cv_resynchattempts, 130}, #endif }; -static menuitem_t OP_NetgameOptionsMenu[] = +/*static menuitem_t OP_NetgameOptionsMenu[] = { {IT_STRING | IT_CVAR, NULL, "Time Limit", &cv_timelimit, 10}, {IT_STRING | IT_CVAR, NULL, "Point Limit", &cv_pointlimit, 18}, @@ -1489,9 +1502,9 @@ static menuitem_t OP_NetgameOptionsMenu[] = //{IT_STRING | IT_CVAR, NULL, "Autobalance Teams", &cv_autobalance, 114}, //{IT_STRING | IT_CVAR, NULL, "Scramble Teams on Map Change", &cv_scrambleonchange, 122}, -}; +};*/ -static menuitem_t OP_GametypeOptionsMenu[] = +/*static menuitem_t OP_GametypeOptionsMenu[] = { {IT_HEADER, NULL, "RACE", NULL, 2}, {IT_STRING | IT_CVAR, NULL, "Game Speed", &cv_kartspeed, 10}, @@ -1502,7 +1515,7 @@ static menuitem_t OP_GametypeOptionsMenu[] = {IT_HEADER, NULL, "BATTLE", NULL, 50}, {IT_STRING | IT_CVAR, NULL, "Starting Balloons", &cv_kartballoons, 58}, {IT_STRING | IT_CVAR, NULL, "Karma Comeback", &cv_kartcomeback, 66}, -}; +};*/ static menuitem_t OP_MonitorToggleMenu[] = { @@ -1804,7 +1817,7 @@ menu_t OP_MainDef = sizeof (OP_MainMenu)/sizeof (menuitem_t), &MainDef, OP_MainMenu, - M_DrawSkyRoom, + M_DrawGenericMenu, 60, 30, 0, NULL @@ -1856,13 +1869,26 @@ menu_t OP_VideoModeDef = 0, NULL }; -menu_t OP_SoundOptionsDef = DEFAULTMENUSTYLE("M_SOUND", OP_SoundOptionsMenu, &OP_MainDef, 60, 30); + +menu_t OP_SoundOptionsDef = +{ + "M_SOUND", + sizeof (OP_SoundOptionsMenu)/sizeof (menuitem_t), + &OP_MainDef, + OP_SoundOptionsMenu, + M_DrawSkyRoom, + 60, 30, + 0, + NULL +}; + +menu_t OP_HUDOptionsDef = DEFAULTMENUSTYLE("M_HUD", OP_HUDOptionsMenu, &OP_MainDef, 30, 30); menu_t OP_GameOptionsDef = DEFAULTMENUSTYLE("M_GAME", OP_GameOptionsMenu, &OP_MainDef, 30, 30); menu_t OP_ServerOptionsDef = DEFAULTMENUSTYLE("M_SERVER", OP_ServerOptionsMenu, &OP_MainDef, 30, 30); -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_SERVER", OP_MonitorToggleMenu, &OP_ServerOptionsDef, 30, 30); +//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 = { "M_SERVER", @@ -1903,9 +1929,9 @@ menu_t OP_OpenGLColorDef = NULL }; #endif -menu_t OP_DataOptionsDef = DEFAULTMENUSTYLE("M_DATA", OP_DataOptionsMenu, &OP_MainDef, 60, 30); -menu_t OP_ScreenshotOptionsDef = DEFAULTMENUSTYLE("M_DATA", OP_ScreenshotOptionsMenu, &OP_DataOptionsDef, 30, 30); -menu_t OP_EraseDataDef = DEFAULTMENUSTYLE("M_DATA", OP_EraseDataMenu, &OP_DataOptionsDef, 60, 30); +//menu_t OP_DataOptionsDef = DEFAULTMENUSTYLE("M_DATA", OP_DataOptionsMenu, &OP_MainDef, 60, 30); +menu_t OP_ScreenshotOptionsDef = DEFAULTMENUSTYLE("M_DATA", OP_ScreenshotOptionsMenu, &OP_MainDef, 30, 30); +menu_t OP_EraseDataDef = DEFAULTMENUSTYLE("M_DATA", OP_EraseDataMenu, &OP_MainDef, 60, 30); // ========================================================================== // CVAR ONCHANGE EVENTS GO HERE @@ -4160,13 +4186,12 @@ static void M_Options(INT32 choice) { (void)choice; - // if the player is not admin or server, disable server options - OP_MainMenu[5].status = (Playing() && !(server || IsPlayerAdmin(consoleplayer))) ? (IT_GRAYEDOUT) : (IT_STRING|IT_SUBMENU); + // if the player is not admin or server, disable gameplay & server options + 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 options - OP_DataOptionsMenu[1].status = (Playing()) ? (IT_GRAYEDOUT) : (IT_STRING|IT_SUBMENU); - // SRB2Kart: Same with the "Play Credits" option - OP_MainMenu[6].status = (Playing()) ? (IT_GRAYEDOUT) : (IT_STRING|IT_CALL); + // 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_MainDef.prevMenu = currentMenu; M_SetupNextMenu(&OP_MainDef); @@ -7695,6 +7720,21 @@ static void M_ToggleMIDI(void) } } +static void M_RestartAudio(void) +{ + S_StopMusic(); + I_ShutdownMusic(); + I_ShutdownSound(); + I_StartupSound(); + I_InitMusic(); + + I_SetSfxVolume(cv_soundvolume.value); + I_SetDigMusicVolume(cv_digmusicvolume.value); + I_SetMIDIMusicVolume(cv_midimusicvolume.value); + if (Playing()) // Gotta make sure the player is in a level + P_RestoreMusic(&players[consoleplayer]); +} + // =============== // VIDEO MODE MENU // =============== diff --git a/src/r_main.c b/src/r_main.c index c516b87a..6e1823e4 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -170,7 +170,7 @@ consvar_t cv_drawdist_precip = {"drawdist_precip", "1024", CV_SAVE, drawdist_con consvar_t cv_precipdensity = {"precipdensity", "Moderate", CV_SAVE, precipdensity_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // Okay, whoever said homremoval causes a performance hit should be shot. -consvar_t cv_homremoval = {"homremoval", "No", CV_SAVE, homremoval_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_homremoval = {"homremoval", "Yes", CV_SAVE, homremoval_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_maxportals = {"maxportals", "2", CV_SAVE, maxportals_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; diff --git a/src/s_sound.c b/src/s_sound.c index 0a352e9b..5dc53b65 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -88,7 +88,7 @@ consvar_t cv_numChannels = {"snd_channels", "8", CV_SAVE|CV_CALL, CV_Unsigned, S consvar_t cv_numChannels = {"snd_channels", "32", CV_SAVE|CV_CALL, CV_Unsigned, SetChannelsNum, 0, NULL, NULL, 0, 0, NULL}; #endif -static consvar_t surround = {"surround", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t surround = {"surround", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; #define S_MAX_VOLUME 127 diff --git a/src/s_sound.h b/src/s_sound.h index 39ec769a..3daebf38 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -25,6 +25,7 @@ extern consvar_t stereoreverse; extern consvar_t cv_soundvolume, cv_digmusicvolume, cv_midimusicvolume; extern consvar_t cv_numChannels; +extern consvar_t surround; #ifdef SNDSERV extern consvar_t sndserver_cmd, sndserver_arg; diff --git a/src/v_video.c b/src/v_video.c index ac0eed17..6435e413 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -41,7 +41,7 @@ UINT8 *screens[5]; static CV_PossibleValue_t gamma_cons_t[] = {{0, "MIN"}, {4, "MAX"}, {0, NULL}}; static void CV_usegamma_OnChange(void); -consvar_t cv_ticrate = {"showfps", "No", 0, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_ticrate = {"showfps", "No", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_usegamma = {"gamma", "0", CV_SAVE|CV_CALL, gamma_cons_t, CV_usegamma_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_allcaps = {"allcaps", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; From e1a82675635751f5926ac43f0f944735229c8049 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 14 Jun 2018 20:23:04 -0400 Subject: [PATCH 040/293] More lenient bombs They can now blow up after they first stick their spikes out in the deploy animation. They also make a spikey sound effect to indicate when they can blow up. --- src/info.c | 48 ++++++++++++++++++++++++------------------------ src/p_mobj.c | 4 ++-- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/info.c b/src/info.c index dbeee245..3fe47a76 100644 --- a/src/info.c +++ b/src/info.c @@ -2670,30 +2670,30 @@ state_t states[NUMSTATES] = {SPR_FBLL, 20, 3, {NULL}, 0, 0, S_FIRETRAIL9}, // S_FIRETRAIL8 {SPR_FBLL, 21, 3, {NULL}, 0, 0, S_NULL}, // S_FIRETRAIL9 - {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 - {SPR_SSMN, 1, 3, {NULL}, 0, 0, S_SSMINE1}, // S_SSMINE4 - {SPR_SSMN, 4, 1, {NULL}, 0, 0, S_SSMINE_SHIELD2}, // S_SSMINE_SHIELD1 - {SPR_SSMN, 5, 1, {NULL}, 0, 0, S_SSMINE_SHIELD1}, // S_SSMINE_SHIELD2 - {SPR_SSMN, 4, 1, {NULL}, 0, 0, S_SSMINE_AIR2}, // S_SSMINE_AIR1 - {SPR_SSMN, 5, 1, {NULL}, 0, 0, S_SSMINE_AIR1}, // S_SSMINE_AIR2 - {SPR_SSMN, 6, 3, {NULL}, 0, 0, S_SSMINE_DEPLOY2}, // S_SSMINE_DEPLOY1 - {SPR_SSMN, 7, 5, {NULL}, 0, 0, S_SSMINE_DEPLOY3}, // S_SSMINE_DEPLOY2 - {SPR_SSMN, 8, 7, {NULL}, 0, 0, S_SSMINE_DEPLOY4}, // S_SSMINE_DEPLOY3 - {SPR_SSMN, 9, 1, {NULL}, 0, 0, S_SSMINE_DEPLOY5}, // S_SSMINE_DEPLOY4 - {SPR_SSMN, 10, 1, {NULL}, 0, 0, S_SSMINE_DEPLOY6}, // S_SSMINE_DEPLOY5 - {SPR_SSMN, 9, 1, {NULL}, 0, 0, S_SSMINE_DEPLOY7}, // S_SSMINE_DEPLOY6 - {SPR_SSMN, 10, 3, {NULL}, 0, 0, S_SSMINE_DEPLOY8}, // S_SSMINE_DEPLOY7 - {SPR_SSMN, 11, 1, {NULL}, 0, 0, S_SSMINE_DEPLOY9}, // S_SSMINE_DEPLOY8 - {SPR_SSMN, 10, 1, {NULL}, 0, 0, S_SSMINE_DEPLOY10}, // S_SSMINE_DEPLOY9 - {SPR_SSMN, 11, 3, {NULL}, 0, 0, S_SSMINE_DEPLOY11}, // S_SSMINE_DEPLOY10 - {SPR_SSMN, 12, 3, {NULL}, 0, 0, S_SSMINE_DEPLOY12}, // S_SSMINE_DEPLOY11 - {SPR_SSMN, 13, 3, {NULL}, 0, 0, S_SSMINE_DEPLOY13}, // S_SSMINE_DEPLOY12 - {SPR_SSMN, 14, 3, {NULL}, 0, 0, S_SSMINE1}, // S_SSMINE_DEPLOY13 - {SPR_SSMN, 3, 1, {A_MineExplode}, MT_MINEEXPLOSION, 0, S_NULL}, // S_SSMINE_EXPLODE - {SPR_NULL, 0, 6, {NULL}, 0, 0, S_MINEEXPLOSION2}, // S_MINEEXPLOSION1 - {SPR_NULL, 1, 22, {A_ForceStop}, 0, 0, S_NULL}, // S_MINEEXPLOSION2 + {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 + {SPR_SSMN, 1, 3, {NULL}, 0, 0, S_SSMINE1}, // S_SSMINE4 + {SPR_SSMN, 4, 1, {NULL}, 0, 0, S_SSMINE_SHIELD2}, // S_SSMINE_SHIELD1 + {SPR_SSMN, 5, 1, {NULL}, 0, 0, S_SSMINE_SHIELD1}, // S_SSMINE_SHIELD2 + {SPR_SSMN, 4, 1, {NULL}, 0, 0, S_SSMINE_AIR2}, // S_SSMINE_AIR1 + {SPR_SSMN, 5, 1, {NULL}, 0, 0, S_SSMINE_AIR1}, // S_SSMINE_AIR2 + {SPR_SSMN, 6, 3, {NULL}, 0, 0, S_SSMINE_DEPLOY2}, // S_SSMINE_DEPLOY1 + {SPR_SSMN, 7, 5, {NULL}, 0, 0, S_SSMINE_DEPLOY3}, // S_SSMINE_DEPLOY2 + {SPR_SSMN, 8, 7, {NULL}, 0, 0, S_SSMINE_DEPLOY4}, // S_SSMINE_DEPLOY3 + {SPR_SSMN, 9, 1, {NULL}, 0, 0, S_SSMINE_DEPLOY5}, // S_SSMINE_DEPLOY4 + {SPR_SSMN, 10, 1, {NULL}, 0, 0, S_SSMINE_DEPLOY6}, // S_SSMINE_DEPLOY5 + {SPR_SSMN, 9, 1, {NULL}, 0, 0, S_SSMINE_DEPLOY7}, // S_SSMINE_DEPLOY6 + {SPR_SSMN, 10, 3, {NULL}, 0, 0, S_SSMINE_DEPLOY8}, // S_SSMINE_DEPLOY7 + {SPR_SSMN, 11, 1, {A_PlaySound}, sfx_cdfm39, 0, S_SSMINE_DEPLOY9}, // S_SSMINE_DEPLOY8 + {SPR_SSMN, 10, 1, {NULL}, 0, 0, S_SSMINE_DEPLOY10}, // S_SSMINE_DEPLOY9 + {SPR_SSMN, 11, 3, {NULL}, 0, 0, S_SSMINE_DEPLOY11}, // S_SSMINE_DEPLOY10 + {SPR_SSMN, 12, 3, {NULL}, 0, 0, S_SSMINE_DEPLOY12}, // S_SSMINE_DEPLOY11 + {SPR_SSMN, 13, 3, {NULL}, 0, 0, S_SSMINE_DEPLOY13}, // S_SSMINE_DEPLOY12 + {SPR_SSMN, 14, 3, {NULL}, 0, 0, S_SSMINE1}, // S_SSMINE_DEPLOY13 + {SPR_SSMN, 3, 1, {A_MineExplode}, MT_MINEEXPLOSION, 0, S_NULL}, // S_SSMINE_EXPLODE + {SPR_NULL, 0, 6, {NULL}, 0, 0, S_MINEEXPLOSION2}, // S_MINEEXPLOSION1 + {SPR_NULL, 1, 22, {A_ForceStop}, 0, 0, S_NULL}, // S_MINEEXPLOSION2 {SPR_KRBM, FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_QUICKBOOM2}, // S_QUICKBOOM1 {SPR_KRBM, FF_FULLBRIGHT|1, 1, {NULL}, 0, 0, S_QUICKBOOM3}, // S_QUICKBOOM2 diff --git a/src/p_mobj.c b/src/p_mobj.c index b7f2946b..a1ccdae1 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8087,8 +8087,8 @@ void P_MobjThinker(mobj_t *mobj) if (!mobj->reactiontime) P_KillMobj(mobj, NULL, NULL); } - if (mobj->state == &states[S_SSMINE1] || mobj->state == &states[S_SSMINE2] - || mobj->state == &states[S_SSMINE3] || mobj->state == &states[S_SSMINE4]) + if ((mobj->state >= &states[S_SSMINE1] && mobj->state <= &states[S_SSMINE4]) + || (mobj->state >= &states[S_SSMINE_DEPLOY8] && mobj->state <= &states[S_SSMINE_DEPLOY13])) A_GrenadeRing(mobj); if (mobj->threshold > 0) mobj->threshold--; From 10d09d3dd8a93339174c9a8d51eb98f1c216d244 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 14 Jun 2018 20:46:07 -0400 Subject: [PATCH 041/293] Tiny menu header tweaks Screenshot Options has its own header, intermission "Result" header is automatically centered --- src/m_menu.c | 2 +- src/y_inter.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index f82ade5d..cd8da4e6 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1930,7 +1930,7 @@ menu_t OP_OpenGLColorDef = }; #endif //menu_t OP_DataOptionsDef = DEFAULTMENUSTYLE("M_DATA", OP_DataOptionsMenu, &OP_MainDef, 60, 30); -menu_t OP_ScreenshotOptionsDef = DEFAULTMENUSTYLE("M_DATA", OP_ScreenshotOptionsMenu, &OP_MainDef, 30, 30); +menu_t OP_ScreenshotOptionsDef = DEFAULTMENUSTYLE("M_SCSHOT", OP_ScreenshotOptionsMenu, &OP_MainDef, 30, 30); menu_t OP_EraseDataDef = DEFAULTMENUSTYLE("M_DATA", OP_EraseDataMenu, &OP_MainDef, 60, 30); // ========================================================================== diff --git a/src/y_inter.c b/src/y_inter.c index b1c7198e..4ad895d5 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -427,7 +427,7 @@ void Y_IntermissionDrawer(void) char strtime[10]; // draw the header - V_DrawScaledPatch(112, 2, 0, data.match.result); + V_DrawScaledPatch((BASEVIDWIDTH/2) - (SHORT(data.match.result->width) / 2), 2, 0, data.match.result); // draw the level name V_DrawCenteredString(BASEVIDWIDTH/2, 20, 0, data.match.levelstring); From 3b2d156e7fabe6664f3cff799be0e8b2ec5934b6 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 14 Jun 2018 20:57:21 -0400 Subject: [PATCH 042/293] Mhm. Changing this back. --- src/k_kart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index 4a1f6a9a..106ddacb 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -551,7 +551,7 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, player_t *player, boolean if ((!cv_selfpropelledbomb.value) || (indirectitemcooldown > 0) || (pexiting > 0) - || (secondist <= distvar*3)) newodds = 0; + || (secondist <= distvar*4)) newodds = 0; break; case KITEM_GROW: if (franticitems) newodds *= 2; From 788c98144f34d20ffbff30ac32b0e32607163296 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Fri, 15 Jun 2018 02:18:43 -0400 Subject: [PATCH 043/293] Item tweakings - Mines last twice as long - Mines can appear in 1st with a measly 5% chance, for maximum ass-blasting - Mine shiiiiink sound no longer plays globally - Thrown Bananas and Eggman Monitors bounce off walls like Mines - Hyudoro can steal from anyone - Halved invincibility alarm/music distance - Getting out Orbinaut/Jawz plays a shield sound - Using Shrink plays a devastating Chaotix sound - SPB plays a high-pitched wail when it's locked in - Hyudoro plays a ghosty sound when used - Fixed Battle arrow roulette --- src/info.c | 54 ++++++++++++++++++++++++++-------------------------- src/k_kart.c | 37 ++++++++++++++++++++--------------- src/p_mobj.c | 2 +- src/p_tick.c | 3 +++ src/sounds.c | 20 +++++++++---------- 5 files changed, 63 insertions(+), 53 deletions(-) diff --git a/src/info.c b/src/info.c index 3fe47a76..43baf852 100644 --- a/src/info.c +++ b/src/info.c @@ -2685,7 +2685,7 @@ state_t states[NUMSTATES] = {SPR_SSMN, 10, 1, {NULL}, 0, 0, S_SSMINE_DEPLOY6}, // S_SSMINE_DEPLOY5 {SPR_SSMN, 9, 1, {NULL}, 0, 0, S_SSMINE_DEPLOY7}, // S_SSMINE_DEPLOY6 {SPR_SSMN, 10, 3, {NULL}, 0, 0, S_SSMINE_DEPLOY8}, // S_SSMINE_DEPLOY7 - {SPR_SSMN, 11, 1, {A_PlaySound}, sfx_cdfm39, 0, S_SSMINE_DEPLOY9}, // S_SSMINE_DEPLOY8 + {SPR_SSMN, 11, 1, {A_PlaySound}, sfx_cdfm39, 1, S_SSMINE_DEPLOY9}, // S_SSMINE_DEPLOY8 {SPR_SSMN, 10, 1, {NULL}, 0, 0, S_SSMINE_DEPLOY10}, // S_SSMINE_DEPLOY9 {SPR_SSMN, 11, 3, {NULL}, 0, 0, S_SSMINE_DEPLOY11}, // S_SSMINE_DEPLOY10 {SPR_SSMN, 12, 3, {NULL}, 0, 0, S_SSMINE_DEPLOY12}, // S_SSMINE_DEPLOY11 @@ -14477,7 +14477,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_fake, // activesound - MF_SHOOTABLE, // flags + MF_BOUNCE|MF_SHOOTABLE, // flags S_NULL // raisestate }, @@ -14504,7 +14504,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_peel, // activesound - MF_SHOOTABLE, // flags + MF_BOUNCE|MF_SHOOTABLE, // flags S_NULL // raisestate }, @@ -14698,30 +14698,30 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_SSMINE - -1, // doomednum - S_SSMINE_AIR1, // spawnstate - 1, // spawnhealth - S_NULL, // seestate - sfx_tossed, // seesound - 105, // reactiontime - sfx_None, // attacksound - S_NULL, // painstate - 288*FRACUNIT, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_SSMINE_EXPLODE, // deathstate - S_NULL, // xdeathstate - sfx_None, // deathsound - 0, // speed - 16*FRACUNIT, // radius - 24*FRACUNIT, // height - 0, // display offset - 100, // mass - 1, // damage - sfx_bomb, // activesound - MF_BOUNCE|MF_SHOOTABLE, // flags - S_NULL // raisestate + -1, // doomednum + S_SSMINE_AIR1, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_tossed, // seesound + 6*TICRATE, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 288*FRACUNIT, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_SSMINE_EXPLODE, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 24*FRACUNIT, // height + 0, // display offset + 100, // mass + 1, // damage + sfx_bomb, // activesound + MF_BOUNCE|MF_SHOOTABLE, // flags + S_NULL // raisestate }, { // MT_SSMINE_SHIELD diff --git a/src/k_kart.c b/src/k_kart.c index 106ddacb..4784662d 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -369,13 +369,13 @@ static INT32 K_KartItemOddsRace[NUMKARTRESULTS][9] = /*Sneaker*/ {20, 0, 0, 3, 7, 6, 0, 0, 0 }, // Sneaker /*Rocket Sneaker*/ { 0, 0, 0, 0, 0, 3, 5, 4, 0 }, // Rocket Sneaker /*Invincibility*/ { 0, 0, 0, 0, 0, 1, 6, 9,16 }, // Invincibility - /*Banana*/ { 0, 9, 4, 2, 1, 0, 0, 0, 0 }, // Banana + /*Banana*/ { 0, 8, 4, 2, 1, 0, 0, 0, 0 }, // Banana /*Eggman Monitor*/ { 0, 4, 2, 1, 0, 0, 0, 0, 0 }, // Eggman Monitor /*Orbinaut*/ { 0, 6, 4, 3, 2, 0, 0, 0, 0 }, // Orbinaut /*Jawz*/ { 0, 0, 3, 2, 2, 1, 0, 0, 0 }, // Jawz - /*Mine*/ { 0, 0, 1, 2, 1, 0, 0, 0, 0 }, // Mine + /*Mine*/ { 0, 1, 1, 2, 1, 0, 0, 0, 0 }, // Mine /*Ballhog*/ { 0, 0, 1, 2, 1, 0, 0, 0, 0 }, // Ballhog - /*Self-Propelled Bomb*/ { 0, 0, 0, 1, 2, 2, 1, 0, 0 }, // Self-Propelled Bomb + /*Self-Propelled Bomb*/ { 0, 0, 1, 1, 2, 3, 2, 1, 0 }, // Self-Propelled Bomb /*Grow*/ { 0, 0, 0, 0, 0, 0, 1, 1, 2 }, // Grow /*Shrink*/ { 0, 0, 0, 0, 0, 0, 1, 2, 2 }, // Shrink /*Lightning Shield*/ { 0, 1, 2, 0, 0, 0, 0, 0, 0 }, // Lightning Shield @@ -1446,7 +1446,7 @@ void K_SquishPlayer(player_t *player, mobj_t *source) player->kartstuff[k_comebacktimer] = comebacktime; - player->kartstuff[k_squishedtimer] = 1*TICRATE; + player->kartstuff[k_squishedtimer] = TICRATE; player->powers[pw_flashing] = K_GetKartFlashing(); @@ -2184,7 +2184,7 @@ static void K_DoHyudoroSteal(player_t *player) && player != &players[i] && !players[i].exiting && !players[i].spectator // Player in-game // Can steal from this player - && ((G_RaceGametype() && players[i].kartstuff[k_position] < player->kartstuff[k_position]) + && (G_RaceGametype() //&& players[i].kartstuff[k_position] < player->kartstuff[k_position]) || (G_BattleGametype() && players[i].kartstuff[k_balloon] > 0)) // Has an item @@ -2198,6 +2198,7 @@ static void K_DoHyudoroSteal(player_t *player) } prandom = P_RandomFixed(); + S_StartSound(player->mo, sfx_s3k92); if ((G_RaceGametype() && player->kartstuff[k_position] == 1) || numplayers == 0) // No-one can be stolen from? Get longer invisibility for nothing { @@ -2227,6 +2228,9 @@ static void K_DoHyudoroSteal(player_t *player) players[stealplayer].kartstuff[k_itemtype] = KITEM_NONE; players[stealplayer].kartstuff[k_itemamount] = 0; players[stealplayer].kartstuff[k_itemheld] = 0; + + if (P_IsLocalPlayer(players[stealplayer]) && !splitscreen) + S_StartSound(NULL, sfx_s3k92); } } @@ -2247,7 +2251,7 @@ static void K_DoShrink(player_t *player) { INT32 i; - //S_StartSound(player->mo, sfx_bkpoof); // Sound the BANG! + S_StartSound(player->mo, sfx_kc46); // Sound the BANG! player->pflags |= PF_ATTACKDOWN; for (i = 0; i < MAXPLAYERS; i++) @@ -2505,7 +2509,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) S_StopSoundByID(player->mo, sfx_kgrow); // Stop it } - // AAAAAAND handle the SMK star alarm + // AAAAAAND handle the invincibility alarm if (player->mo->health > 0 && (player->mo->player->kartstuff[k_invincibilitytimer] > 0 || player->mo->player->kartstuff[k_growshrinktimer] > 0)) { @@ -2965,11 +2969,9 @@ void K_MoveKartPlayer(player_t *player, boolean onground) overlay->destscale = player->mo->scale; P_SetScale(overlay, player->mo->scale); } - player->kartstuff[k_invincibilitytimer] = itemtime; // Activate it + player->kartstuff[k_invincibilitytimer] = itemtime+(2*TICRATE); // 10 seconds K_PlayTauntSound(player->mo); player->kartstuff[k_itemamount]--; - if (gametype != GT_RACE) - player->kartstuff[k_poweritemtimer] = 10*TICRATE; player->pflags |= PF_ATTACKDOWN; } break; @@ -3087,7 +3089,8 @@ void K_MoveKartPlayer(player_t *player, boolean onground) player->kartstuff[k_itemheld] = 2; player->pflags |= PF_ATTACKDOWN; - K_PlayTauntSound(player->mo); + //K_PlayTauntSound(player->mo); + S_StartSound(player->mo, sfx_s3k3a); for (moloop = 0; moloop < player->kartstuff[k_itemamount]; moloop++) { @@ -3154,7 +3157,8 @@ void K_MoveKartPlayer(player_t *player, boolean onground) player->kartstuff[k_itemheld] = 2; player->pflags |= PF_ATTACKDOWN; - K_PlayTauntSound(player->mo); + //K_PlayTauntSound(player->mo); + S_StartSound(player->mo, sfx_s3k3a); for (moloop = 0; moloop < player->kartstuff[k_itemamount]; moloop++) { @@ -3284,12 +3288,10 @@ void K_MoveKartPlayer(player_t *player, boolean onground) K_PlayTauntSound(player->mo); player->mo->scalespeed = FRACUNIT/TICRATE; player->mo->destscale = 3*(mapheaderinfo[gamemap-1]->mobj_scale)/2; - player->kartstuff[k_growshrinktimer] = itemtime; + player->kartstuff[k_growshrinktimer] = itemtime+(4*TICRATE); // 12 seconds S_StartSound(player->mo, sfx_kc5a); player->pflags |= PF_ATTACKDOWN; player->kartstuff[k_itemamount]--; - if (gametype != GT_RACE) - player->kartstuff[k_poweritemtimer] = 10*TICRATE; } break; case KITEM_SHRINK: @@ -3363,6 +3365,11 @@ void K_MoveKartPlayer(player_t *player, boolean onground) || player->kartstuff[k_growshrinktimer] > 0)) player->kartstuff[k_poweritemtimer] = 10*TICRATE; + if (player->kartstuff[k_itemtype] == KITEM_SPB + || player->kartstuff[k_itemtype] == KITEM_SHRINK + || spbincoming) + indirectitemcooldown = 20*TICRATE; + if (player->kartstuff[k_hyudorotimer] > 0) { if (splitscreen) diff --git a/src/p_mobj.c b/src/p_mobj.c index a1ccdae1..5be6ea20 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6968,7 +6968,7 @@ void P_MobjThinker(mobj_t *mobj) if (mobj->target->player->kartstuff[k_itemroulette]) { P_SetMobjState(mobj, S_PLAYERARROW_BOX); - mobj->tracer->frame = FF_FULLBRIGHT|((stplyr->kartstuff[k_itemroulette] % (13*3)) / 3); + mobj->tracer->frame = FF_FULLBRIGHT|((mobj->target->player->kartstuff[k_itemroulette] % (13*3)) / 3); } else if (mobj->target->player->kartstuff[k_itemtype]) { diff --git a/src/p_tick.c b/src/p_tick.c index 57574d6f..70450913 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -703,7 +703,10 @@ void P_Ticker(boolean run) } if (hurtthisguy != -1) + { players[hurtthisguy].kartstuff[k_deathsentence] = TICRATE+1; + S_StartSound(players[hurtthisguy].mo, sfx_kc57); + } } if (indirectitemcooldown) diff --git a/src/sounds.c b/src/sounds.c index dad85ffc..3cf54148 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -405,7 +405,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3k37", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k38", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k39", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k3a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"s3k3a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Kart item shield {"s3k3b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k3c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k3d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, @@ -416,7 +416,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3k42", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k43", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k44", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k45", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"s3k45", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Kart Lightning Shield use {"s3k46", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k47", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k48", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, @@ -493,7 +493,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3k8f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k90", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k91", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k92", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"s3k92", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Kart Hyudoro use {"s3k93", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k94", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k95", 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, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"cdfm39", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // SS 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}, @@ -703,7 +703,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"kc2c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"kc2d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"kc2e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"kc2f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Pogo Spring + {"kc2f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Pogo Spring use {"kc30", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"kc31", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"kc32", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, @@ -726,7 +726,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"kc43", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"kc44", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"kc45", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"kc46", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc46", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Shrink use {"kc47", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"kc48", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Vote picked {"kc49", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, @@ -743,7 +743,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"kc54", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"kc55", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"kc56", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"kc57", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kc57", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // SPB locked in {"kc58", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"kc59", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Shrink {"kc5a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Grow @@ -777,8 +777,8 @@ sfxinfo_t S_sfx[NUMSFX] = {"mlap", true, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"sboost", true, 90, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"mush", false, 90, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"kinvnc", false, 140, 16, -1, NULL, 0, -1, -1, LUMPERROR}, - {"kgrow", false, 140, 16, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kinvnc", false, 140, 8, -1, NULL, 0, -1, -1, LUMPERROR}, + {"kgrow", false, 140, 8, -1, NULL, 0, -1, -1, LUMPERROR}, {"bomb", false, 110, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"bomb2", false, 110, 8, -1, NULL, 0, -1, -1, LUMPERROR}, {"peel", false, 100, 0, -1, NULL, 0, -1, -1, LUMPERROR}, @@ -804,7 +804,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"shelit", false, 64, 16, -1, NULL, 0, -1, -1, LUMPERROR}, {"vroom", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"boing", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"smkinv", false, 140, 16, -1, NULL, 0, -1, -1, LUMPERROR}, + {"smkinv", false, 140, 8, -1, NULL, 0, -1, -1, LUMPERROR}, {"screec", false, 52, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // SRB2kart - Skin sounds From bfb4c0fae54533afb601e6713c5329ef8d373b33 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Fri, 15 Jun 2018 03:02:05 -0400 Subject: [PATCH 044/293] Minor fixes --- src/k_kart.c | 3 ++- src/p_tick.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 4784662d..0dffd9c6 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2229,7 +2229,7 @@ static void K_DoHyudoroSteal(player_t *player) players[stealplayer].kartstuff[k_itemamount] = 0; players[stealplayer].kartstuff[k_itemheld] = 0; - if (P_IsLocalPlayer(players[stealplayer]) && !splitscreen) + if (P_IsLocalPlayer(&players[stealplayer]) && !splitscreen) S_StartSound(NULL, sfx_s3k92); } } @@ -3428,6 +3428,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) P_SetTarget(&player->mo->tracer->target, player->mo); player->mo->tracer->color = player->mo->color; + player->mo->tracer->colorized = (player->kartstuff[k_comebackmode] == 1); if (player->kartstuff[k_comebacktimer] > 0) { diff --git a/src/p_tick.c b/src/p_tick.c index 70450913..4ac56b90 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -704,7 +704,7 @@ void P_Ticker(boolean run) if (hurtthisguy != -1) { - players[hurtthisguy].kartstuff[k_deathsentence] = TICRATE+1; + players[hurtthisguy].kartstuff[k_deathsentence] = (2*TICRATE)+1; S_StartSound(players[hurtthisguy].mo, sfx_kc57); } } From b71471d1ba93e95dfe591a5d617df6ca0f8e3454 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Fri, 15 Jun 2018 03:45:59 -0400 Subject: [PATCH 045/293] More poof --- src/p_map.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/p_map.c b/src/p_map.c index fdf65b7a..5dba8c29 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1692,6 +1692,7 @@ static boolean PIT_CheckThing(mobj_t *thing) CONS_Printf(M_GetText("%s gave an item to %s.\n"), player_names[thing->player-players], player_names[tmthing->player-players]); tmthing->player->kartstuff[k_itemroulette] = 1; tmthing->player->kartstuff[k_roulettetype] = 1; + P_SpawnMobj(tmthing->x, tmthing->y, tmthing->z, MT_EXPLODE); if (thing->player->kartstuff[k_comebackpoints] >= 3) K_StealBalloon(thing->player, tmthing->player, true); thing->player->kartstuff[k_comebacktimer] = comebacktime; @@ -1707,6 +1708,7 @@ static boolean PIT_CheckThing(mobj_t *thing) CONS_Printf(M_GetText("%s gave an item to %s.\n"), player_names[tmthing->player-players], player_names[thing->player-players]); thing->player->kartstuff[k_itemroulette] = 1; thing->player->kartstuff[k_roulettetype] = 1; + P_SpawnMobj(thing->x, thing->y, thing->z, MT_EXPLODE); if (tmthing->player->kartstuff[k_comebackpoints] >= 3) K_StealBalloon(tmthing->player, thing->player, true); tmthing->player->kartstuff[k_comebacktimer] = comebacktime; From 8abeae7805eb1350a5a12ced1074276d971162d6 Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Fri, 15 Jun 2018 05:20:01 -0500 Subject: [PATCH 046/293] Chat Manager --- src/d_main.c | 1 + src/d_netcmd.c | 7 + src/doomdef.h | 1 + src/g_game.c | 26 ++ src/g_game.h | 1 + src/hardware/hw_draw.c | 105 +++++ src/hardware/hw_main.h | 1 + src/hu_stuff.c | 990 +++++++++++++++++++++++++++++++++++++---- src/hu_stuff.h | 6 + src/lua_baselib.c | 47 ++ src/lua_hook.h | 2 +- src/lua_hooklib.c | 19 +- src/v_video.c | 151 ++++++- src/v_video.h | 3 + 14 files changed, 1262 insertions(+), 98 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index b12dcdbf..367a0e08 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -184,6 +184,7 @@ void D_PostEvent_end(void) {}; UINT8 shiftdown = 0; // 0x1 left, 0x2 right UINT8 ctrldown = 0; // 0x1 left, 0x2 right UINT8 altdown = 0; // 0x1 left, 0x2 right +boolean capslock = 0; // jeez i wonder what this does. // // D_ModifierKeyResponder // Sets global shift/ctrl/alt variables, never actually eats events diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 2f2657d7..5a4227c3 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -776,6 +776,13 @@ void D_RegisterClientCommands(void) CV_RegisterVar(&cv_usegamma); // m_menu.c + CV_RegisterVar(&cv_compactscoreboard); + CV_RegisterVar(&cv_chatheight); + CV_RegisterVar(&cv_chatwidth); + CV_RegisterVar(&cv_chattime); + CV_RegisterVar(&cv_chatspamprotection); + CV_RegisterVar(&cv_consolechat); + CV_RegisterVar(&cv_chatnotifications); CV_RegisterVar(&cv_crosshair); CV_RegisterVar(&cv_crosshair2); CV_RegisterVar(&cv_crosshair3); diff --git a/src/doomdef.h b/src/doomdef.h index 175838c0..278dc002 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -434,6 +434,7 @@ extern INT32 cv_debug; // Modifier key variables, accessible anywhere extern UINT8 shiftdown, ctrldown, altdown; +extern boolean capslock; // if we ever make our alloc stuff... #define ZZ_Alloc(x) Z_Malloc(x, PU_STATIC, NULL) diff --git a/src/g_game.c b/src/g_game.c index bbce2d3e..9224ad84 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -397,6 +397,32 @@ static CV_PossibleValue_t joyaxis_cons_t[] = {{0, "None"}, #endif #endif +// don't mind me putting these here, I was lazy to figure out where else I could put those without blowing up the compiler. + +// it automatically becomes compact with 20+ players, but if you like it, I guess you can turn that on! +consvar_t cv_compactscoreboard= {"compactscoreboard", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; + +// chat timer thingy +static CV_PossibleValue_t chattime_cons_t[] = {{5, "MIN"}, {999, "MAX"}, {0, NULL}}; +consvar_t cv_chattime = {"chattime", "8", CV_SAVE, chattime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; + +// chatwidth +static CV_PossibleValue_t chatwidth_cons_t[] = {{64, "MIN"}, {150, "MAX"}, {0, NULL}}; +consvar_t cv_chatwidth = {"chatwidth", "150", CV_SAVE, chatwidth_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; + +// chatheight +static CV_PossibleValue_t chatheight_cons_t[] = {{6, "MIN"}, {22, "MAX"}, {0, NULL}}; +consvar_t cv_chatheight= {"chatheight", "8", CV_SAVE, chatheight_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; + +// chat notifications (do you want to hear beeps? I'd understand if you didn't.) +consvar_t cv_chatnotifications= {"chatnotifications", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; + +// chat spam protection (why would you want to disable that???) +consvar_t cv_chatspamprotection= {"chatspamprotection", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; + +// old shit console chat. (mostly exists for stuff like terminal, not because I cared if anyone liked the old chat.) +consvar_t cv_consolechat= {"consolechat", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; + consvar_t cv_crosshair = {"crosshair", "Cross", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_crosshair2 = {"crosshair2", "Cross", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_crosshair3 = {"crosshair3", "Cross", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; diff --git a/src/g_game.h b/src/g_game.h index f59641fb..fa188824 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -54,6 +54,7 @@ extern tic_t timeinmap; // Ticker for time spent in level (used for levelcard di extern INT16 rw_maximums[NUM_WEAPONS]; // used in game menu +extern consvar_t cv_chatwidth, cv_chatnotifications, cv_chatheight, cv_chattime, cv_consolechat, cv_chatspamprotection, cv_compactscoreboard; extern consvar_t cv_crosshair, cv_crosshair2, cv_crosshair3, cv_crosshair4; extern consvar_t cv_invertmouse, cv_alwaysfreelook, cv_mousemove; extern consvar_t cv_turnaxis,cv_moveaxis,cv_brakeaxis,cv_aimaxis,cv_lookaxis,cv_fireaxis,cv_driftaxis; diff --git a/src/hardware/hw_draw.c b/src/hardware/hw_draw.c index c142e74c..99cc3613 100644 --- a/src/hardware/hw_draw.c +++ b/src/hardware/hw_draw.c @@ -900,6 +900,111 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color) PF_Modulated|PF_NoTexture|PF_NoDepthTest); } +// -------------------+ +// HWR_DrawConsoleFill : draw flat coloured transparent rectangle because that's cool, and hw sucks less than sw for that. +// -------------------+ +void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32 options) +{ + FOutVector v[4]; + FSurfaceInfo Surf; + float fx, fy, fw, fh; + + if (w < 0 || h < 0) + return; // consistency w/ software + +// 3--2 +// | /| +// |/ | +// 0--1 + + fx = (float)x; + fy = (float)y; + fw = (float)w; + fh = (float)h; + + if (!(options & V_NOSCALESTART)) + { + float dupx = (float)vid.dupx, dupy = (float)vid.dupy; + + if (x == 0 && y == 0 && w == BASEVIDWIDTH && h == BASEVIDHEIGHT) + { + RGBA_t rgbaColour = V_GetColor(color); + FRGBAFloat clearColour; + clearColour.red = (float)rgbaColour.s.red / 255; + clearColour.green = (float)rgbaColour.s.green / 255; + clearColour.blue = (float)rgbaColour.s.blue / 255; + clearColour.alpha = 1; + HWD.pfnClearBuffer(true, false, &clearColour); + return; + } + + fx *= dupx; + fy *= dupy; + fw *= dupx; + fh *= dupy; + + if (vid.width != BASEVIDWIDTH * vid.dupx) + { + if (options & V_SNAPTORIGHT) + fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)); + else if (!(options & V_SNAPTOLEFT)) + fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 2; + } + if (vid.height != BASEVIDHEIGHT * dupy) + { + // same thing here + if (options & V_SNAPTOBOTTOM) + fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)); + else if (!(options & V_SNAPTOTOP)) + fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 2; + } + } + + if (fx >= vid.width || fy >= vid.height) + return; + if (fx < 0) + { + fw += fx; + fx = 0; + } + if (fy < 0) + { + fh += fy; + fy = 0; + } + + if (fw <= 0 || fh <= 0) + return; + if (fx + fw > vid.width) + fw = (float)vid.width - fx; + if (fy + fh > vid.height) + fh = (float)vid.height - fy; + + fx = -1 + fx / (vid.width / 2); + fy = 1 - fy / (vid.height / 2); + fw = fw / (vid.width / 2); + fh = fh / (vid.height / 2); + + v[0].x = v[3].x = fx; + v[2].x = v[1].x = fx + fw; + v[0].y = v[1].y = fy; + v[2].y = v[3].y = fy - fh; + + //Hurdler: do we still use this argb color? if not, we should remove it + v[0].argb = v[1].argb = v[2].argb = v[3].argb = 0xff00ff00; //; + v[0].z = v[1].z = v[2].z = v[3].z = 1.0f; + + v[0].sow = v[3].sow = 0.0f; + v[2].sow = v[1].sow = 1.0f; + v[0].tow = v[1].tow = 0.0f; + v[2].tow = v[3].tow = 1.0f; + + Surf.FlatColor.rgba = UINT2RGBA(color); + Surf.FlatColor.s.alpha = 0x80; + + HWD.pfnDrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest); +} + #ifdef HAVE_PNG #ifndef _MSC_VER diff --git a/src/hardware/hw_main.h b/src/hardware/hw_main.h index fce17062..f0efc1c5 100644 --- a/src/hardware/hw_main.h +++ b/src/hardware/hw_main.h @@ -52,6 +52,7 @@ void HWR_CreatePlanePolygons(INT32 bspnum); void HWR_CreateStaticLightmaps(INT32 bspnum); void HWR_PrepLevelCache(size_t pnumtextures); void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color); +void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32 options); // Lat: separate flags from color since color needs to be an uint to work right. void HWR_DrawPic(INT32 x,INT32 y,lumpnum_t lumpnum); void HWR_AddCommands(void); diff --git a/src/hu_stuff.c b/src/hu_stuff.c index c3c04bed..135cedfc 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -76,6 +76,7 @@ patch_t *cred_font[CRED_FONTSIZE]; static player_t *plr; boolean chat_on; // entering a chat message? static char w_chat[HU_MAXMSGLEN]; +static INT32 c_input = 0; // let's try to make the chat input less shitty. static boolean headsupactive = false; boolean hu_showscores; // draw rankings static char hu_tick; @@ -336,6 +337,74 @@ void HU_Start(void) //====================================================================== #ifndef NONET + +// EVERY CHANGE IN THIS SCRIPT IS LOL XD! BY VINCYTM + +static UINT32 chat_nummsg_log = 0; +static UINT32 chat_nummsg_min = 0; +static UINT32 chat_scroll = 0; +static tic_t chat_scrolltime = 0; + +static INT32 chat_maxscroll = 0; // how far can we scroll? + +//static chatmsg_t chat_mini[CHAT_BUFSIZE]; // Display the last few messages sent. +//static chatmsg_t chat_log[CHAT_BUFSIZE]; // Keep every message sent to us in memory so we can scroll n shit, it's cool. + +static char chat_log[CHAT_BUFSIZE][255]; // hold the last 48 or so messages in that log. +static char chat_mini[8][255]; // display up to 8 messages that will fade away / get overwritten +static tic_t chat_timers[8]; + +static boolean chat_scrollmedown = false; // force instant scroll down on the chat log. Happens when you open it / send a message. + +// remove text from minichat table + +static INT16 addy = 0; // use this to make the messages scroll smoothly when one fades away + +static void HU_removeChatText_Mini(void) +{ + // MPC: Don't create new arrays, just iterate through an existing one + int i; + for(i=0;i= CHAT_BUFSIZE) + HU_removeChatText_Log(); + + strcpy(chat_log[chat_nummsg_log], text); + chat_nummsg_log++; + + if (chat_nummsg_min >= 8) + HU_removeChatText_Mini(); + + strcpy(chat_mini[chat_nummsg_min], text); + chat_timers[chat_nummsg_min] = TICRATE*cv_chattime.value; + chat_nummsg_min++; +} + /** Runs a say command, sending an ::XD_SAY message. * A say command consists of a signed 8-bit integer for the target, an * unsigned 8-bit flag variable, and then the message itself. @@ -364,14 +433,14 @@ static void DoSayCommand(SINT8 target, size_t usedargs, UINT8 flags) numwords = COM_Argc() - usedargs; I_Assert(numwords > 0); - if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) + if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) // TODO: Per Player mute. { - CONS_Alert(CONS_NOTICE, M_GetText("The chat is muted. You can't say anything at the moment.\n")); + HU_AddChatText(va("%s>ERROR: The chat is muted. You can't say anything.", "\x85")); return; } // Only servers/admins can CSAY. - if(!server && IsPlayerAdmin(consoleplayer)) + if(!server && !(IsPlayerAdmin(consoleplayer))) flags &= ~HU_CSAY; // We handle HU_SERVER_SAY, not the caller. @@ -389,6 +458,52 @@ static void DoSayCommand(SINT8 target, size_t usedargs, UINT8 flags) strlcat(msg, " ", msgspace); strlcat(msg, COM_Argv(ix + usedargs), msgspace); } + + if (strlen(msg) > 4 && strnicmp(msg, "/pm", 3) == 0) // used /pm + { + // what we're gonna do now is check if the node exists + // with that logic, characters 4 and 5 are our numbers: + int spc = 1; // used if nodenum[1] is a space. + char *nodenum = (char*) malloc(3); + strncpy(nodenum, msg+3, 5); + // check for undesirable characters in our "number" + if (((nodenum[0] < '0') || (nodenum[0] > '9')) || ((nodenum[1] < '0') || (nodenum[1] > '9'))) + { + // check if nodenum[1] is a space + if (nodenum[1] == ' ') + spc = 0; + // let it slide + else + { + HU_AddChatText("\x82NOTICE: \x80Invalid command format. Correct format is \'/pm \'."); + return; + } + } + // I'm very bad at C, I swear I am, additional checks eww! + if (spc != 0) + { + if (msg[5] != ' ') + { + HU_AddChatText("\x82NOTICE: \x80Invalid command format. Correct format is \'/pm \'."); + return; + } + } + + target = atoi((const char*) nodenum); // turn that into a number + //CONS_Printf("%d\n", target); + + // check for target player, if it doesn't exist then we can't send the message! + if (playeringame[target]) // player exists + target++; // even though playernums are from 0 to 31, target is 1 to 32, so up that by 1 to have it work! + else + { + HU_AddChatText(va("\x82NOTICE: \x80Player %d does not exist.", target)); // same + return; + } + buf[0] = target; + const char *newmsg = msg+5+spc; + memcpy(msg, newmsg, 255); + } SendNetXCmd(XD_SAY, buf, strlen(msg) + 1 + msg-buf); } @@ -473,6 +588,7 @@ static void Command_CSay_f(void) DoSayCommand(0, 1, HU_CSAY); } +static tic_t stop_spamming_you_cunt[MAXPLAYERS]; /** Receives a message, processing an ::XD_SAY command. * \sa DoSayCommand @@ -486,7 +602,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) char *msg; boolean action = false; char *ptr; - + CONS_Debug(DBG_NETPLAY,"Received SAY cmd from Player %d (%s)\n", playernum+1, player_names[playernum]); target = READSINT8(*p); @@ -494,7 +610,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) msg = (char *)*p; SKIPSTRING(*p); - if ((cv_mute.value || flags & (HU_CSAY|HU_SERVER_SAY)) && playernum != serverplayer && !IsPlayerAdmin(playernum)) + if ((cv_mute.value || flags & (HU_CSAY|HU_SERVER_SAY)) && playernum != serverplayer && !(IsPlayerAdmin(playernum))) { CONS_Alert(CONS_WARNING, cv_mute.value ? M_GetText("Illegal say command received from %s while muted\n") : M_GetText("Illegal csay command received from non-admin %s\n"), @@ -531,12 +647,31 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) } } } - + + int spam_eatmsg = 0; + + // before we do anything, let's verify the guy isn't spamming, get this easier on us. + + //if (stop_spamming_you_cunt[playernum] != 0 && cv_chatspamprotection.value && !(flags & HU_CSAY)) + if (stop_spamming_you_cunt[playernum] != 0 && consoleplayer != playernum && cv_chatspamprotection.value && !(flags & HU_CSAY)) + { + CONS_Debug(DBG_NETPLAY,"Received SAY cmd too quickly from Player %d (%s), assuming as spam and blocking message.\n", playernum+1, player_names[playernum]); + stop_spamming_you_cunt[playernum] = 4; + spam_eatmsg = 1; + } + else + stop_spamming_you_cunt[playernum] = 4; // you can hold off for 4 tics, can you? + + // run the lua hook even if we were supposed to eat the msg, netgame consistency goes first. + #ifdef HAVE_BLUA - if (LUAh_PlayerMsg(playernum, target, flags, msg)) + if (LUAh_PlayerMsg(playernum, target, flags, msg, spam_eatmsg)) return; #endif - + + if (spam_eatmsg) + return; // don't proceed if we were supposed to eat the message. + // If it's a CSAY, just CECHO and be done with it. if (flags & HU_CSAY) { @@ -576,18 +711,23 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) || target == 0 // To everyone || consoleplayer == target-1) // To you { - const char *cstart = "", *cend = "", *adminchar = "~", *remotechar = "@", *fmt; + const char *prefix = "", *cstart = "", *cend = "", *adminchar = "\x82~\x83", *remotechar = "\x82@\x83", *fmt, *fmt2; char *tempchar = NULL; - + // In CTF and team match, color the player's name. if (G_GametypeHasTeams()) { - cend = "\x80"; - if (players[playernum].ctfteam == 1) // red - cstart = "\x85"; + cend = ""; + if (players[playernum].ctfteam == 1) // red + cstart = "\x85"; else if (players[playernum].ctfteam == 2) // blue cstart = "\x84"; + } + + // player is a spectator? + if (players[playernum].spectator) + cstart = "\x86"; // grey name // Give admins and remote admins their symbols. if (playernum == serverplayer) @@ -596,11 +736,11 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) tempchar = (char *)Z_Calloc(strlen(cstart) + strlen(remotechar) + 1, PU_STATIC, NULL); if (tempchar) { - strcat(tempchar, cstart); if (playernum == serverplayer) strcat(tempchar, adminchar); else strcat(tempchar, remotechar); + strcat(tempchar, cstart); cstart = tempchar; } @@ -609,21 +749,61 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) // name, color end, and the message itself. // '\4' makes the message yellow and beeps; '\3' just beeps. if (action) - fmt = "\4* %s%s%s \x82%s\n"; + { + fmt = "\3* %s%s%s%s \x82%s\n"; // don't make /me yellow, yellow will be for mentions and PMs! + fmt2 = "* %s%s%s%s \x82%s"; + } else if (target == 0) // To everyone - fmt = "\3<%s%s%s> %s\n"; + { + fmt = "\3%s\x83<%s%s%s\x83>\x80 %s\n"; + fmt2 = "%s\x83<%s%s%s\x83>\x80 %s"; + } else if (target-1 == consoleplayer) // To you - fmt = "\3*%s%s%s* %s\n"; + { + prefix = "\x82[PM]"; + cstart = "\x82"; + fmt = "\4%s<%s%s>%s\x80 %s\n"; // make this yellow, however. + fmt2 = "%s<%s%s>%s\x80 %s"; + } else if (target > 0) // By you, to another player { // Use target's name. dispname = player_names[target-1]; - fmt = "\3->*%s%s%s* %s\n"; + /*fmt = "\3\x82[TO]\x80%s%s%s* %s\n"; + fmt2 = "\x82[TO]\x80%s%s%s* %s";*/ + prefix = "\x82[TO]"; + cstart = "\x82"; + fmt = "\4%s<%s%s>%s\x80 %s\n"; // make this yellow, however. + fmt2 = "%s<%s%s>%s\x80 %s"; + } else // To your team - fmt = "\3>>%s%s%s<< (team) %s\n"; - - CONS_Printf(fmt, cstart, dispname, cend, msg); + { + if (players[playernum].ctfteam == 1) // red + prefix = "\x85[TEAM]"; + else if (players[playernum].ctfteam == 2) // blue + prefix = "\x84[TEAM]"; + else + prefix = "\x83"; // makes sure this doesn't implode if you sayteam on non-team gamemodes + + fmt = "\3%s<%s%s>\x80%s %s\n"; + fmt2 = "%s<%s%s>\x80%s %s"; + + } + + if (cv_consolechat.value) + { + CONS_Printf(fmt, prefix, cstart, dispname, cend, msg); + HU_AddChatText(va(fmt2, prefix, cstart, dispname, cend, msg)); // add it reguardless, in case we decide to change our mind about our chat type. + } + else + { + HU_AddChatText(va(fmt2, prefix, cstart, dispname, cend, msg)); + CON_LogMessage(va(fmt, prefix, cstart, dispname, cend, msg)); // save to log.txt + if (cv_chatnotifications.value) + S_StartSound(NULL, sfx_radio); + } + if (tempchar) Z_Free(tempchar); } @@ -650,19 +830,48 @@ static inline boolean HU_keyInChatString(char *s, char ch) l = strlen(s); if (l < HU_MAXMSGLEN - 1) { - s[l++] = ch; - s[l]=0; + if (c_input >= strlen(s)) // don't do anything complicated + { + s[l++] = ch; + s[l]=0; + } + else + { + + // move everything past c_input for new characters: + INT32 m = HU_MAXMSGLEN-1; + for (;(m>=c_input);m--) + { + if (s[m]) + s[m+1] = (s[m]); + } + s[c_input] = ch; // and replace this. + } + c_input++; return true; } return false; } else if (ch == KEY_BACKSPACE) { - l = strlen(s); - if (l) - s[--l] = 0; - else + if (c_input <= 0) return false; + size_t i = c_input; + if (!s[i-1]) + return false; + + if (i >= strlen(s)-1) + { + s[strlen(s)-1] = 0; + c_input--; + return false; + } + + for (; (i < HU_MAXMSGLEN); i++) + { + s[i-1] = s[i]; + } + c_input--; } else if (ch != KEY_ENTER) return false; // did not eat key @@ -686,29 +895,9 @@ void HU_Ticker(void) hu_showscores = false; } -#define QUEUESIZE 256 static boolean teamtalk = false; -static char chatchars[QUEUESIZE]; -static INT32 head = 0, tail = 0; - -// -// HU_dequeueChatChar -// -char HU_dequeueChatChar(void) -{ - char c; - - if (head != tail) - { - c = chatchars[tail]; - tail = (tail + 1) & (QUEUESIZE-1); - } - else - c = 0; - - return c; -} +// WHY DO YOU OVERCOMPLICATE EVERYTHING????????? // // @@ -719,79 +908,130 @@ static void HU_queueChatChar(char c) { char buf[2+256]; size_t ci = 2; - + char *msg = &buf[2]; do { - c = HU_dequeueChatChar(); + c = w_chat[-2+ci++]; if (!c || (c >= ' ' && !(c & 0x80))) // copy printable characters and terminating '\0' only. - buf[ci++]=c; + buf[ci-1]=c; } while (c); - + size_t i = 0; + for (;(iERROR: The chat is muted. You can't say anything.", "\x85")); return; } - + + INT32 target = 0; + + if (strlen(msg) > 4 && strnicmp(msg, "/pm", 3) == 0) // used /pm + { + // what we're gonna do now is check if the node exists + // with that logic, characters 4 and 5 are our numbers: + + // teamtalk can't send PMs, just don't send it, else everyone would be able to see it, and no one wants to see your sex RP sicko. + if (teamtalk) + { + HU_AddChatText(va("%sCannot send sayto in Say-Team.", "\x85")); + return; + } + + int spc = 1; // used if nodenum[1] is a space. + char *nodenum = (char*) malloc(3); + strncpy(nodenum, msg+3, 5); + // check for undesirable characters in our "number" + if (((nodenum[0] < '0') || (nodenum[0] > '9')) || ((nodenum[1] < '0') || (nodenum[1] > '9'))) + { + // check if nodenum[1] is a space + if (nodenum[1] == ' ') + spc = 0; + // let it slide + else + { + HU_AddChatText("\x82NOTICE: \x80Invalid command format. Correct format is \'/pm \'."); + return; + } + } + // I'm very bad at C, I swear I am, additional checks eww! + if (spc != 0) + { + if (msg[5] != ' ') + { + HU_AddChatText("\x82NOTICE: \x80Invalid command format. Correct format is \'/pm \'."); + return; + } + } + + target = atoi((const char*) nodenum); // turn that into a number + //CONS_Printf("%d\n", target); + + // check for target player, if it doesn't exist then we can't send the message! + if (playeringame[target]) // player exists + target++; // even though playernums are from 0 to 31, target is 1 to 32, so up that by 1 to have it work! + else + { + HU_AddChatText(va("\x82NOTICE: \x80Player %d does not exist.", target)); // same + return; + } + // we need to get rid of the /pm + const char *newmsg = msg+5+spc; + memcpy(msg, newmsg, 255); + } if (ci > 3) // don't send target+flags+empty message. { if (teamtalk) buf[0] = -1; // target else - buf[0] = 0; // target + buf[0] = target; + buf[1] = 0; // flags SendNetXCmd(XD_SAY, buf, 2 + strlen(&buf[2]) + 1); } return; } - - if (((head + 1) & (QUEUESIZE-1)) == tail) - CONS_Printf(M_GetText("[Message unsent]\n")); // message not sent - else - { - if (c == KEY_BACKSPACE) - { - if (tail != head) - head = (head - 1) & (QUEUESIZE-1); - } - else - { - chatchars[head] = c; - head = (head + 1) & (QUEUESIZE-1); - } - } } void HU_clearChatChars(void) { - while (tail != head) - HU_queueChatChar(KEY_BACKSPACE); + size_t i = 0; + for (;itype != ev_keydown) return false; // only KeyDown events now... - + if (!chat_on) { // enter chat mode if ((ev->data1 == gamecontrol[gc_talkkey][0] || ev->data1 == gamecontrol[gc_talkkey][1]) - && netgame && (!cv_mute.value || server || IsPlayerAdmin(consoleplayer))) + && netgame && (!cv_mute.value || server || (IsPlayerAdmin(consoleplayer)))) { if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) return false; chat_on = true; w_chat[0] = 0; teamtalk = false; + chat_scrollmedown = true; return true; } if ((ev->data1 == gamecontrol[gc_teamkey][0] || ev->data1 == gamecontrol[gc_teamkey][1]) @@ -802,11 +1042,13 @@ boolean HU_Responder(event_t *ev) chat_on = true; w_chat[0] = 0; teamtalk = true; + chat_scrollmedown = true; return true; } } else // if chat_on { + // Ignore modifier keys // Note that we do this here so users can still set // their chat keys to one of these, if they so desire. @@ -816,18 +1058,95 @@ boolean HU_Responder(event_t *ev) return true; c = (UINT8)ev->data1; - - // use console translations - if (shiftdown) + + // capslock + if (c && c == KEY_CAPSLOCK) // it's a toggle. + { + if (capslock) + capslock = false; + else + capslock = true; + return true; + } + + // use console translations + if (shiftdown ^ capslock) c = shiftxform[c]; - + + // TODO: make chat behave like the console, so that we can go back and edit stuff when we fuck up. + + // pasting. pasting is cool. chat is a bit limited, though :( + if ((c == 'v' || c == 'V') && ctrldown) + { + const char *paste = I_ClipboardPaste(); + + // create a dummy string real quickly + + if (paste == NULL) + return true; + + size_t chatlen = strlen(w_chat); + size_t pastelen = strlen(paste); + if (chatlen+pastelen > HU_MAXMSGLEN) + return true; // we can't paste this!! + + if (c_input >= strlen(w_chat)) // add it at the end of the string. + { + memcpy(&w_chat[chatlen], paste, pastelen); // copy all of that. + c_input += pastelen; + /*size_t i = 0; + for (;i=c_input;i--) + { + if (w_chat[i]) + w_chat[i+pastelen] = w_chat[i]; + + } + memcpy(&w_chat[c_input], paste, pastelen); // copy all of that. + c_input += pastelen; + return true; + } + } + if (HU_keyInChatString(w_chat,c)) + { HU_queueChatChar(c); + } if (c == KEY_ENTER) + { chat_on = false; + c_input = 0; // reset input cursor + chat_scrollmedown = true; // you hit enter, so you might wanna autoscroll to see what you just sent. :) + } else if (c == KEY_ESCAPE) + { chat_on = false; - + c_input = 0; // reset input cursor + } + else if ((c == KEY_UPARROW || c == KEY_MOUSEWHEELUP) && chat_scroll > 0) // CHAT SCROLLING YAYS! + { + chat_scroll--; + justscrolledup = true; + chat_scrolltime = 4; + } + else if ((c == KEY_DOWNARROW || c == KEY_MOUSEWHEELDOWN) && chat_scroll < chat_maxscroll && chat_maxscroll > 0) + { + chat_scroll++; + justscrolleddown = true; + chat_scrolltime = 4; + } + else if (c == KEY_LEFTARROW && c_input != 0) // i said go back + c_input--; + else if (c == KEY_RIGHTARROW && c_input < strlen(w_chat)) + c_input++; return true; } return false; @@ -837,12 +1156,412 @@ boolean HU_Responder(event_t *ev) // HEADS UP DRAWING //====================================================================== +// Gets string colormap, used for 0x80 color codes +// +static UINT8 *CHAT_GetStringColormap(INT32 colorflags) // pasted from video.c, sorry for the mess. +{ + switch ((colorflags & V_CHARCOLORMASK) >> V_CHARCOLORSHIFT) + { + case 1: // 0x81, purple + return purplemap; + case 2: // 0x82, yellow + return yellowmap; + case 3: // 0x83, lgreen + return lgreenmap; + case 4: // 0x84, blue + return bluemap; + case 5: // 0x85, red + return redmap; + case 6: // 0x86, gray + return graymap; + case 7: // 0x87, orange + return orangemap; + default: // reset + return NULL; + } +} + +// Precompile a wordwrapped string to any given width. +// This is a muuuch better method than V_WORDWRAP. +// again stolen and modified a bit from video.c, don't mind me, will need to rearrange this one day. +// this one is simplified for the chat drawer. +char *CHAT_WordWrap(INT32 x, INT32 w, INT32 option, const char *string) +{ + int c; + size_t chw, i, lastusablespace = 0; + size_t slen; + char *newstring = Z_StrDup(string); + INT32 spacewidth = (vid.width < 640) ? 8 : 4, charwidth = (vid.width < 640) ? 8 : 4; + + slen = strlen(string); + x = 0; + + for (i = 0; i < slen; ++i) + { + c = newstring[i]; + if ((UINT8)c >= 0x80 && (UINT8)c <= 0x89) //color parsing! -Inuyasha 2.16.09 + continue; + + if (c == '\n') + { + x = 0; + lastusablespace = 0; + continue; + } + + if (!(option & V_ALLOWLOWERCASE)) + c = toupper(c); + c -= HU_FONTSTART; + + if (c < 0 || c >= HU_FONTSIZE || !hu_font[c]) + { + chw = spacewidth; + lastusablespace = i; + } + else + chw = charwidth; + + x += chw; + + if (lastusablespace != 0 && x > w) + { + //CONS_Printf("Wrap at index %d\n", i); + newstring[lastusablespace] = '\n'; + i = lastusablespace+1; + lastusablespace = 0; + x = 0; + } + } + return newstring; +} + +INT16 chatx = 160, chaty = 16; // let's use this as our coordinates, shh + +// chat stuff by VincyTM LOL XD! + +// HU_DrawMiniChat + +static void HU_drawMiniChat(void) +{ + INT32 charwidth = (vid.width < 640) ? 8 : 4, charheight = (vid.width < 640) ? 8 : 6; + INT32 x = chatx+2, y = chaty+2, dx = 0, dy = 0; + size_t i = 0; + + for (i=0; i= 0 && timer <= 9) ? (timer*V_10TRANS) : 0; // you can make bad jokes out of this one. + size_t j = 0; + const char *msg = CHAT_WordWrap(x, cv_chatwidth.value-charwidth, V_SNAPTOTOP|V_SNAPTOLEFT|V_ALLOWLOWERCASE, chat_mini[i]); // get the current message, and word wrap it. + while(msg[j]) // iterate through msg + { + if (msg[j] < HU_FONTSTART) // don't draw + { + if (msg[j] == '\n') // get back down. + { + ++j; + dy += charheight; + dx = 0; + continue; + } + else if (msg[j] & 0x80) // stolen from video.c, nice. + { + clrflag = ((msg[j] & 0x7f) << V_CHARCOLORSHIFT) & V_CHARCOLORMASK; + ++j; + continue; + } + + ++j; + } + else + { + UINT8 *colormap = CHAT_GetStringColormap(clrflag); + V_DrawChatCharacter(x + dx + 2, y+dy+addy, msg[j++] |V_SNAPTOTOP|V_SNAPTORIGHT|transflag, !cv_allcaps.value, colormap); + } + + dx += charwidth; + if (dx >= cv_chatwidth.value) + { + dx = 0; + dy += charheight; + } + } + dy += charheight; + dx = 0; + } + + // decrement addy and make that shit smooth: + addy /= 2; + +} + +// 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(void) +{ + + // before we do anything, make sure that our scroll position isn't "illegal"; + if (chat_scroll > chat_maxscroll) + chat_scroll = chat_maxscroll; + + INT32 charwidth = (vid.width < 640) ? 8 : 4, charheight = (vid.width < 640) ? 8 : 6; + INT32 x = chatx+2, y = chaty+2-(chat_scroll*charheight), dx = 0, dy = 0; + size_t i = 0; + boolean atbottom = false; + + V_DrawFillConsoleMap(chatx, chaty, cv_chatwidth.value, cv_chatheight.value*charheight +2, 239|V_SNAPTOTOP|V_SNAPTORIGHT); // INUT + + for (i=0; i chaty) && (y+dy < (chaty+cv_chatheight.value*charheight))) + { + UINT8 *colormap = CHAT_GetStringColormap(clrflag); + V_DrawChatCharacter(x + dx + 2, y+dy, msg[j++] |V_SNAPTOTOP|V_SNAPTORIGHT, !cv_allcaps.value, colormap); + } + else + j++; // don't forget to increment this or we'll get stuck in the limbo. + } + + dx += charwidth; + if (dx >= cv_chatwidth.value-charwidth-2 && i= HU_FONTSTART) // end of message shouldn't count, nor should invisible characters!!!! + { + dx = 0; + dy += charheight; + } + } + dy += charheight; + dx = 0; + } + + if (((chat_scroll >= chat_maxscroll) || (chat_scrollmedown)) && !(justscrolleddown || justscrolledup || chat_scrolltime)) // was already at the bottom of the page before new maxscroll calculation and was NOT scrolling. + { + atbottom = true; // we should scroll + } + chat_scrollmedown = false; + + // getmaxscroll through a lazy hack. We do all these loops, so let's not do more loops that are gonna lag the game more. :P + chat_maxscroll = (dy/charheight)-cv_chatheight.value; // welcome to C, we don't know what min() and max() are. + if (chat_maxscroll < 0) + chat_maxscroll = 0; + + // if we're not bound by the time, autoscroll for next frame: + if (atbottom) + chat_scroll = chat_maxscroll; + + // draw arrows to indicate that we can (or not) scroll. + + if (chat_scroll > 0) + HU_DrawUpArrow(chatx-8, ((justscrolledup) ? (chaty-1) : (chaty)), V_SNAPTOTOP | V_SNAPTORIGHT); + if (chat_scroll < chat_maxscroll) + HU_DrawDownArrow(chatx-8, chaty+(cv_chatheight.value*charheight)-((justscrolleddown) ? 3 : 4), V_SNAPTOTOP | V_SNAPTORIGHT); + + justscrolleddown = false; + justscrolledup = false; +} + // // HU_DrawChat // // Draw chat input // + +static INT16 typelines = 1; // number of drawfill lines we need. it's some weird hack and might be one frame off but I'm lazy to make another loop. static void HU_DrawChat(void) +{ + INT32 charwidth = (vid.width < 640) ? 8 : 4, charheight = (vid.width < 640) ? 8 : 6; + INT32 t = 0, c = 0, y = chaty + 4 + cv_chatheight.value*charheight; + size_t i = 0; + const char *ntalk = "Say: ", *ttalk = "Team: "; + const char *talk = ntalk; + + if (teamtalk) + { + talk = ttalk; +#if 0 + if (players[consoleplayer].ctfteam == 1) + t = 0x500; // Red + else if (players[consoleplayer].ctfteam == 2) + t = 0x400; // Blue +#endif + } + + HU_drawChatLog(); + V_DrawFillConsoleMap(chatx, y-1, cv_chatwidth.value, (vid.width < 640 ) ? (typelines*charheight+2) : (typelines*charheight), 239 | V_SNAPTOTOP | V_SNAPTORIGHT); + + while (talk[i]) + { + if (talk[i] < HU_FONTSTART) + ++i; + else + V_DrawChatCharacter(chatx + c + 2, y, talk[i++] |V_SNAPTOTOP|V_SNAPTORIGHT, !cv_allcaps.value, NULL); + + c += charwidth; + } + + i = 0; + typelines = 1; + + if ((strlen(w_chat) == 0 || c_input == 0) && hu_tick < 4) + V_DrawChatCharacter(chatx + 2 + c, y+1, '_' |V_SNAPTOTOP|V_SNAPTORIGHT|t, !cv_allcaps.value, NULL); + + while (w_chat[i]) + { + + if (c_input == (i+1) && hu_tick < 4) + { + int cursorx = (c+charwidth < cv_chatwidth.value-charwidth) ? (chatx + 2 + c+charwidth) : (chatx); // we may have to go down. + int cursory = (cursorx != chatx) ? (y) : (y+charheight); + V_DrawChatCharacter(cursorx, cursory+1, '_' |V_SNAPTOTOP|V_SNAPTORIGHT|t, !cv_allcaps.value, NULL); + } + + //Hurdler: isn't it better like that? + if (w_chat[i] < HU_FONTSTART) + ++i; + else + V_DrawChatCharacter(chatx + c + 2, y, w_chat[i++] | V_SNAPTOTOP|V_SNAPTORIGHT | t, !cv_allcaps.value, NULL); + + c += charwidth; + if (c > cv_chatwidth.value-charwidth) + { + c = 0; + y += charheight; + typelines += 1; + } + } + + // handle /pm list. + if (strnicmp(w_chat, "/pm", 3) == 0 && vid.width >= 400 && !teamtalk) // 320x200 unsupported kthxbai + { + i = 0; + int count = 0; + INT32 p_dispy = chaty+2; + V_DrawFillConsoleMap(chatx-50, p_dispy-2, 48, 2, 239 | V_SNAPTOTOP | V_SNAPTORIGHT); // top (don't mind me) + for(i=0; (i '9'))) || ((w_chat[4] != 0) && (((w_chat[4] < '0') || (w_chat[4] > '9'))))) && (w_chat[4] != ' ')) + break; + + + char *nodenum = (char*) malloc(3); + strncpy(nodenum, w_chat+3, 4); + INT32 n = atoi((const char*) nodenum); // turn that into a number + // special cases: + + if ((n == 0) && !(w_chat[4] == '0')) + { + if (!(i<10)) + continue; + } + else if ((n == 1) && !(w_chat[3] == '0')) + { + if (!((i == 1) || ((i >= 10) && (i <= 19)))) + continue; + } + else if ((n == 2) && !(w_chat[3] == '0')) + { + if (!((i == 2) || ((i >= 20) && (i <= 29)))) + continue; + } + else if ((n == 3) && !(w_chat[3] == '0')) + { + if (!((i == 3) || ((i >= 30) && (i <= 31)))) + continue; + } + else // general case. + { + if (i != n) + continue; + } + } + + if ((playeringame[i])) + { + char name[MAXPLAYERNAME+1]; + strlcpy(name, player_names[i], 7); // shorten name to 7 characters. + V_DrawFillConsoleMap(chatx-50, p_dispy+ (6*count), 48, 6, 239 | V_SNAPTOTOP | V_SNAPTORIGHT); // fill it like the chat so the text doesn't become hard to read because of the hud. + V_DrawSmallString(chatx-48, p_dispy+ (6*count), V_SNAPTOTOP|V_SNAPTORIGHT|V_ALLOWLOWERCASE, va("\x82%d\x80 - %s", i, name)); + count++; + } + } + if (count == 0) // no results. + { + V_DrawFillConsoleMap(chatx-50, p_dispy+ (6*count), 48, 6, 239 | V_SNAPTOTOP | V_SNAPTORIGHT); // fill it like the chat so the text doesn't become hard to read because of the hud. + V_DrawSmallString(chatx-48, p_dispy+ (6*count), V_SNAPTOTOP|V_SNAPTORIGHT|V_ALLOWLOWERCASE, "NO RESULT."); + } + } + +} + +// why the fuck would you use this... + +static void HU_DrawChat_Old(void) { INT32 t = 0, c = 0, y = HU_INPUTY; size_t i = 0; @@ -850,7 +1569,6 @@ static void HU_DrawChat(void) const char *talk = ntalk; INT32 charwidth = 8 * con_scalefactor; //SHORT(hu_font['A'-HU_FONTSTART]->width) * con_scalefactor; INT32 charheight = 8 * con_scalefactor; //SHORT(hu_font['A'-HU_FONTSTART]->height) * con_scalefactor; - if (teamtalk) { talk = ttalk; @@ -876,10 +1594,21 @@ static void HU_DrawChat(void) } c += charwidth; } - + + if ((strlen(w_chat) == 0 || c_input == 0) && hu_tick < 4) + V_DrawCharacter(HU_INPUTX+c, y+2*con_scalefactor, '_' |cv_constextsize.value | V_NOSCALESTART|t, !cv_allcaps.value); + i = 0; while (w_chat[i]) { + + if (c_input == (i+1) && hu_tick < 4) + { + int cursorx = (HU_INPUTX+c+charwidth < vid.width) ? (HU_INPUTX + c + charwidth) : (HU_INPUTX); // we may have to go down. + int cursory = (cursorx != HU_INPUTX) ? (y) : (y+charheight); + V_DrawCharacter(cursorx, cursory+2*con_scalefactor, '_' |cv_constextsize.value | V_NOSCALESTART|t, !cv_allcaps.value); + } + //Hurdler: isn't it better like that? if (w_chat[i] < HU_FONTSTART) { @@ -899,12 +1628,8 @@ static void HU_DrawChat(void) y += charheight; } } - - if (hu_tick < 4) - V_DrawCharacter(HU_INPUTX + c, y, '_' | cv_constextsize.value |V_NOSCALESTART|t, !cv_allcaps.value); } - // draw the Crosshair, at the exact center of the view. // // Crosshairs are pre-cached at HU_Init @@ -1175,7 +1900,45 @@ void HU_Drawer(void) { // draw chat string plus cursor if (chat_on) - HU_DrawChat(); + { + // count down the scroll timer. + if (chat_scrolltime > 0) + chat_scrolltime--; + if (!cv_consolechat.value) + HU_DrawChat(); + else + HU_DrawChat_Old(); // why the fuck......................... + } + else + { + if (!cv_consolechat.value) + { + HU_drawMiniChat(); // draw messages in a cool fashion. + chat_scrolltime = 0; // do scroll anyway. + typelines = 0; // make sure that the chat doesn't have a weird blinking huge ass square if we typed a lot last time. + } + } + + if (netgame) // would handle that in hu_drawminichat, but it's actually kinda awkward when you're typing a lot of messages. (only handle that in netgames duh) + { + size_t i = 0; + + // handle spam while we're at it: + for(; (i 0) + stop_spamming_you_cunt[i]--; + } + + // handle chat timers + for (i=0; (i 0) + chat_timers[i]--; + else + HU_removeChatText_Mini(); + } + } if (cechotimer) HU_DrawCEcho(); @@ -1319,6 +2082,40 @@ void HU_Erase(void) // IN-LEVEL MULTIPLAYER RANKINGS //====================================================================== +// +// HU_drawPing +// +void HU_drawPing(INT32 x, INT32 y, INT32 ping, boolean notext) +{ + UINT8 numbars = 1; // how many ping bars do we draw? + UINT8 barcolor = 128; // color we use for the bars (green, yellow or red) + SINT8 i = 0; + SINT8 yoffset = 6; + if (ping < 128) + { + numbars = 3; + barcolor = 184; + } + else if (ping < 256) + { + numbars = 2; // Apparently ternaries w/ multiple statements don't look good in C so I decided against it. + barcolor = 103; + } + + INT32 dx = x+1 - (V_SmallStringWidth(va("%dms", ping), V_ALLOWLOWERCASE)/2); + if (!notext || vid.width >= 640) // how sad, we're using a shit resolution. + V_DrawSmallString(dx, y+4, V_ALLOWLOWERCASE, va("%dms", ping)); + + for (i=0; (i<3); i++) // Draw the ping bar + { + V_DrawFill(x+2 *(i-1), y+yoffset-4, 2, 8-yoffset, 31); + if (i < numbars) + V_DrawFill(x+2 *(i-1), y+yoffset-3, 1, 8-yoffset-1, barcolor); + + yoffset -= 2; + } +} + // // HU_DrawTabRankings // @@ -1336,7 +2133,13 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I { if (players[tab[i].num].spectator) continue; //ignore them. - + + if (!splitscreen) // don't draw it on splitscreen, + { + if (!(tab[i].num == serverplayer)) + HU_drawPing(x+ 253, y+2, playerpingtable[tab[i].num], false); + } + V_DrawString(x + 20, y, ((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0) | ((players[tab[i].num].health > 0) ? 0 : V_60TRANS) @@ -1493,6 +2296,11 @@ void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer) V_DrawSmallMappedPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin], colormap); } V_DrawRightAlignedThinString(x+120, y-1, ((players[tab[i].num].health > 0) ? 0 : V_TRANSLUCENT), va("%u", tab[i].count)); + if (!splitscreen) + { + if (!(tab[i].num == serverplayer)) + HU_drawPing(x+ 113, y+2, playerpingtable[tab[i].num], false); + } } } @@ -1515,6 +2323,8 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline continue; //ignore them. strlcpy(name, tab[i].name, 9); + if (!(tab[i].num == serverplayer)) + HU_drawPing(x+ 113, y+2, playerpingtable[tab[i].num], false); V_DrawString(x + 20, y, ((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0) | ((players[tab[i].num].health > 0) ? 0 : V_TRANSLUCENT) diff --git a/src/hu_stuff.h b/src/hu_stuff.h index 451cc8d8..2a99be4b 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -80,6 +80,11 @@ extern patch_t *tagico; extern patch_t *tallminus; extern patch_t *iconprefix[MAXSKINS]; +#define CHAT_BUFSIZE 64 // that's enough messages, right? We'll delete the older ones when that gets out of hand. + +// some functions +void HU_AddChatText(const char *text); + // set true when entering a chat message extern boolean chat_on; @@ -105,6 +110,7 @@ char HU_dequeueChatChar(void); void HU_Erase(void); void HU_clearChatChars(void); void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer); +void HU_drawPing(INT32 x, INT32 y, INT32 ping, boolean notext); // Lat': Ping drawer for scoreboard. void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer); void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer); void HU_DrawEmeralds(INT32 x, INT32 y, INT32 pemeralds); diff --git a/src/lua_baselib.c b/src/lua_baselib.c index b49cdd72..5cdd31f0 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -86,6 +86,51 @@ static int lib_print(lua_State *L) return 0; } +// Print stuff in the chat, or in the console if we can't. +static int lib_chatprint(lua_State *L) +{ + const char *str = luaL_checkstring(L, 1); // retrieve string + if (str == NULL) // error if we don't have a string! + return luaL_error(L, LUA_QL("tostring") " must return a string to " LUA_QL("chatprint")); + int len = strlen(str); + if (len > 255) // string is too long!!! + return luaL_error(L, "String exceeds the 255 characters limit of the chat buffer."); + + if (cv_consolechat.value || !netgame) + CONS_Printf("%s\n", str); + else + HU_AddChatText(str); + return 0; +} + +// Same as above, but do it for only one player. +static int lib_chatprintf(lua_State *L) +{ + int n = lua_gettop(L); /* number of arguments */ + player_t *plr; + if (n < 2) + return luaL_error(L, "chatprintf requires at least two arguments: player and text."); + + plr = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); // retrieve player + if (!plr) + return LUA_ErrInvalid(L, "player_t"); + if (plr != &players[consoleplayer]) + return 0; + + const char *str = luaL_checkstring(L, 2); // retrieve string + if (str == NULL) // error if we don't have a string! + return luaL_error(L, LUA_QL("tostring") " must return a string to " LUA_QL("chatprintf")); + int len = strlen(str); + if (len > 255) // string is too long!!! + return luaL_error(L, "String exceeds the 255 characters limit of the chat buffer."); + + if (cv_consolechat.value || !netgame) + CONS_Printf("%s\n", str); + else + HU_AddChatText(str); + return 0; +} + static int lib_evalMath(lua_State *L) { const char *word = luaL_checkstring(L, 1); @@ -2165,6 +2210,8 @@ static int lib_kGetKartFlashing(lua_State *L) static luaL_Reg lib[] = { {"print", lib_print}, + {"chatprint", lib_chatprint}, + {"chatprintf", lib_chatprintf}, {"EvalMath", lib_evalMath}, // m_random diff --git a/src/lua_hook.h b/src/lua_hook.h index 53e0a7d8..7acc0d0f 100644 --- a/src/lua_hook.h +++ b/src/lua_hook.h @@ -74,7 +74,7 @@ boolean LUAh_MobjDeath(mobj_t *target, mobj_t *inflictor, mobj_t *source); // Ho boolean LUAh_BotTiccmd(player_t *bot, ticcmd_t *cmd); // Hook for B_BuildTiccmd boolean LUAh_BotAI(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd); // Hook for B_BuildTailsTiccmd by skin name boolean LUAh_LinedefExecute(line_t *line, mobj_t *mo, sector_t *sector); // Hook for linedef executors -boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg); // Hook for chat messages +boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg, int mute); // Hook for chat messages boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source); // Hook for hurt messages #define LUAh_PlayerSpawn(player) LUAh_PlayerHook(player, hook_PlayerSpawn) // Hook for G_SpawnPlayer diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index eadd0153..5b05b77c 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -952,7 +952,9 @@ boolean LUAh_LinedefExecute(line_t *line, mobj_t *mo, sector_t *sector) } // Hook for player chat -boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg) +// Added the "mute" field. It's set to true if the message was supposed to be eaten by spam protection. +// But for netgame consistency purposes, this hook is ran first reguardless, so this boolean allows for modders to adapt if they so desire. +boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg, int mute) { hook_p hookp; boolean hooked = false; @@ -981,14 +983,19 @@ boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg) LUA_PushUserdata(gL, &players[target-1], META_PLAYER); // target } lua_pushstring(gL, msg); // msg + if (mute) + lua_pushboolean(gL, true); // the message was supposed to be eaten by spamprotecc. + else + lua_pushboolean(gL, false); } lua_pushfstring(gL, FMT_HOOKID, hookp->id); lua_gettable(gL, LUA_REGISTRYINDEX); - lua_pushvalue(gL, -5); - lua_pushvalue(gL, -5); - lua_pushvalue(gL, -5); - lua_pushvalue(gL, -5); - if (lua_pcall(gL, 4, 1, 0)) { + lua_pushvalue(gL, -6); + lua_pushvalue(gL, -6); + lua_pushvalue(gL, -6); + lua_pushvalue(gL, -6); + lua_pushvalue(gL, -6); + if (lua_pcall(gL, 5, 1, 0)) { if (!hookp->error || cv_debug & DBG_LUA) CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1)); lua_pop(gL, 1); diff --git a/src/v_video.c b/src/v_video.c index ac0eed17..44319dd7 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -303,7 +303,7 @@ void VID_BlitLinearScreen(const UINT8 *srcptr, UINT8 *destptr, INT32 width, INT3 #endif } -//static UINT8 hudplusalpha[11] = { 10, 8, 6, 4, 2, 0, 0, 0, 0, 0, 0}; +static UINT8 hudplusalpha[11] = { 10, 8, 6, 4, 2, 0, 0, 0, 0, 0, 0}; static UINT8 hudminusalpha[11] = { 10, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5}; static const UINT8 *v_colormap = NULL; @@ -840,6 +840,129 @@ void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c) memset(dest, (UINT8)(c&255), w * vid.bpp); } +// THANK YOU MPC!!! + +void V_DrawFillConsoleMap(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c) +{ + UINT8 *dest; + INT32 u, v; + UINT32 alphalevel = 0; + + if (rendermode == render_none) + return; + +#ifdef HWRENDER + if (rendermode != render_soft && rendermode != render_none) + { + UINT32 hwcolor; + switch (cons_backcolor.value) + { + case 0: hwcolor = 0xffffff00; break; // White + case 1: hwcolor = 0x80808000; break; // Gray + case 2: hwcolor = 0x40201000; break; // Brown + case 3: hwcolor = 0xff000000; break; // Red + case 4: hwcolor = 0xff800000; break; // Orange + case 5: hwcolor = 0x80800000; break; // Yellow + case 6: hwcolor = 0x00800000; break; // Green + case 7: hwcolor = 0x0000ff00; break; // Blue + case 8: hwcolor = 0x4080ff00; break; // Cyan + // Default green + default: hwcolor = 0x00800000; break; + } + HWR_DrawConsoleFill(x, y, w, h, hwcolor, c); // we still use the regular color stuff but only for flags. actual draw color is "hwcolor" for this. + return; + } +#endif + + if (!(c & V_NOSCALESTART)) + { + INT32 dupx = vid.dupx, dupy = vid.dupy; + + if (x == 0 && y == 0 && w == BASEVIDWIDTH && h == BASEVIDHEIGHT) + { // Clear the entire screen, from dest to deststop. Yes, this really works. + memset(screens[0], (UINT8)(c&255), vid.width * vid.height * vid.bpp); + return; + } + + x *= dupx; + y *= dupy; + w *= dupx; + h *= dupy; + + // Center it if necessary + if (vid.width != BASEVIDWIDTH * dupx) + { + // dupx adjustments pretend that screen width is BASEVIDWIDTH * dupx, + // so center this imaginary screen + if (c & V_SNAPTORIGHT) + x += (vid.width - (BASEVIDWIDTH * dupx)); + else if (!(c & V_SNAPTOLEFT)) + x += (vid.width - (BASEVIDWIDTH * dupx)) / 2; + } + if (vid.height != BASEVIDHEIGHT * dupy) + { + // same thing here + if (c & V_SNAPTOBOTTOM) + y += (vid.height - (BASEVIDHEIGHT * dupy)); + else if (!(c & V_SNAPTOTOP)) + y += (vid.height - (BASEVIDHEIGHT * dupy)) / 2; + } + } + + if (x >= vid.width || y >= vid.height) + return; // off the screen + if (x < 0) { + w += x; + x = 0; + } + if (y < 0) { + h += y; + y = 0; + } + + if (w <= 0 || h <= 0) + return; // zero width/height wouldn't draw anything + if (x + w > vid.width) + w = vid.width-x; + if (y + h > vid.height) + h = vid.height-y; + + dest = screens[0] + y*vid.width + x; + + if ((alphalevel = ((c & V_ALPHAMASK) >> V_ALPHASHIFT))) + { + if (alphalevel == 13) + alphalevel = hudminusalpha[cv_translucenthud.value]; + else if (alphalevel == 14) + alphalevel = 10 - cv_translucenthud.value; + else if (alphalevel == 15) + alphalevel = hudplusalpha[cv_translucenthud.value]; + + if (alphalevel >= 10) + return; // invis + } + + c &= 255; + + if (!alphalevel) { + for (v = 0; v < h; v++, dest += vid.width) { + for (u = 0; u < w; u++) { + dest[u] = consolebgmap[dest[u]]; + } + } + } else { // mpc 12-04-2018 + const UINT8 *fadetable = ((UINT8 *)transtables + ((alphalevel-1)<y) ? y : x + w = clip(w,vid.width); + h = clip(h,vid.height); + for (v = 0; v < h; v++, dest += vid.width) { + for (u = 0; u < w; u++) { + dest[u] = fadetable[consolebgmap[dest[u]]]; + } + } + } +} + // // Fills a box of pixels using a flat texture as a pattern, scaled to screen size. // @@ -1060,6 +1183,32 @@ void V_DrawCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed) V_DrawScaledPatch(x, y, flags, hu_font[c]); } +// Writes a single character for the chat. (draw WHITE if bit 7 set) +// Essentially the same as the above but it's small or big depending on what resolution you've chosen to huge.. +// +void V_DrawChatCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed, UINT8 *colormap) +{ + INT32 w, flags; + //const UINT8 *colormap = V_GetStringColormap(c); + + flags = c & ~(V_CHARCOLORMASK | V_PARAMMASK); + c &= 0x7f; + if (lowercaseallowed) + c -= HU_FONTSTART; + else + c = toupper(c) - HU_FONTSTART; + if (c < 0 || c >= HU_FONTSIZE || !hu_font[c]) + return; + + w = (vid.width < 640 ) ? (SHORT(hu_font[c]->width)/2) : (SHORT(hu_font[c]->width)); // use normal sized characters if we're using a terribly low resolution. + if (x + w > vid.width) + return; + + V_DrawFixedPatch(x*FRACUNIT, y*FRACUNIT, (vid.width < 640) ? (FRACUNIT) : (FRACUNIT/2), flags, hu_font[c], colormap); + + +} + // Precompile a wordwrapped string to any given width. // This is a muuuch better method than V_WORDWRAP. char *V_WordWrap(INT32 x, INT32 w, INT32 option, const char *string) diff --git a/src/v_video.h b/src/v_video.h index 990f9b13..ffa1038c 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -139,6 +139,7 @@ void V_DrawScaledPic (INT32 px1, INT32 py1, INT32 scrn, INT32 lumpnum); // fill a box with a single color void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c); +void V_DrawFillConsoleMap(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c); // fill a box with a flat as a pattern void V_DrawFlatFill(INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatnum); @@ -149,6 +150,8 @@ void V_DrawFadeConsBack(INT32 plines); // draw a single character void V_DrawCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed); +// draw a single character, but for the chat +void V_DrawChatCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed, UINT8 *colormap); void V_DrawLevelTitle(INT32 x, INT32 y, INT32 option, const char *string); From 98c6d0f6d9ab4d1fdb1a69f456df089077955be1 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sat, 16 Jun 2018 00:00:46 -0400 Subject: [PATCH 047/293] Redid how karma bombs/items work. Again The overlay object now has a hitbox which handles all of the item giving/bombing code, and no longer takes up the player's tracer. This is to give them a bigger hitbox without any bad side-effects of changing the player's hitbox directly (shadow size). Should make bombing more useful, and just sliiiightly less missed high-fives from items. --- src/dehacked.c | 1 + src/info.c | 27 +++++++++++++++++++ src/info.h | 1 + src/k_kart.c | 70 +++++++++++++---------------------------------- src/p_inter.c | 61 +++++++++++++++++++++++++++++++++++++++++ src/p_map.c | 73 -------------------------------------------------- src/p_mobj.c | 45 ++++++++++++++++++++++++++++++- 7 files changed, 153 insertions(+), 125 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 6a1297f9..515225dc 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7212,6 +7212,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_FIREDITEM", "MT_PLAYERARROW", + "MT_KARMAHITBOX", #ifdef SEENAMES "MT_NAMECHECK", diff --git a/src/info.c b/src/info.c index 43baf852..838e4c30 100644 --- a/src/info.c +++ b/src/info.c @@ -16560,6 +16560,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_KARMAHITBOX + -1, // doomednum + S_PLAYERBOMB, // spawnstate + 1000, // spawnhealth + S_PLAYERITEM, // seestate + sfx_kc2e, // seesound + 8, // reactiontime + sfx_s3k4e, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 26*FRACUNIT, // radius + 52*FRACUNIT, // height + -1, // display offset + 0, // mass + 0, // damage + sfx_None, // activesound + MF_SPECIAL|MF_NOCLIPHEIGHT|MF_NOGRAVITY, // flags + S_NULL // raisestate + }, + // ============================================================================================================================// #ifdef SEENAMES diff --git a/src/info.h b/src/info.h index c20d6da2..cea05a6e 100644 --- a/src/info.h +++ b/src/info.h @@ -4071,6 +4071,7 @@ typedef enum mobj_type MT_FIREDITEM, MT_PLAYERARROW, + MT_KARMAHITBOX, #ifdef SEENAMES MT_NAMECHECK, diff --git a/src/k_kart.c b/src/k_kart.c index 0dffd9c6..3c29d03f 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1379,7 +1379,13 @@ void K_SpinPlayer(player_t *player, mobj_t *source) if (player->kartstuff[k_balloon] > 0) { if (player->kartstuff[k_balloon] == 1) + { + mobj_t *karmahitbox = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_KARMAHITBOX); // Player hitbox is too small!! + P_SetTarget(&karmahitbox->target, player->mo); + karmahitbox->destscale = player->mo->scale; + P_SetScale(karmahitbox, player->mo->scale); CONS_Printf(M_GetText("%s lost all of their balloons!\n"), player_names[player-players]); + } player->kartstuff[k_balloon]--; } @@ -1437,7 +1443,13 @@ void K_SquishPlayer(player_t *player, mobj_t *source) if (player->kartstuff[k_balloon] > 0) { if (player->kartstuff[k_balloon] == 1) + { + mobj_t *karmahitbox = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_KARMAHITBOX); // Player hitbox is too small!! + P_SetTarget(&karmahitbox->target, player->mo); + karmahitbox->destscale = player->mo->scale; + P_SetScale(karmahitbox, player->mo->scale); CONS_Printf(M_GetText("%s lost all of their balloons!\n"), player_names[player-players]); + } player->kartstuff[k_balloon]--; } @@ -1479,22 +1491,18 @@ void K_ExplodePlayer(player_t *player, mobj_t *source) // A bit of a hack, we ju if (G_BattleGametype()) { if (source && source->player && player != source->player) - { - if (source->player->kartstuff[k_balloon] <= 0) - { - source->player->kartstuff[k_comebackpoints] += 2; - if (netgame && cv_hazardlog.value) - CONS_Printf(M_GetText("%s bombed %s!\n"), player_names[source->player-players], player_names[player-players]); - if (source->player->kartstuff[k_comebackpoints] >= 3) - K_StealBalloon(source->player, player, true); - } P_AddPlayerScore(source->player, 1); - } if (player->kartstuff[k_balloon] > 0) { if (player->kartstuff[k_balloon] == 1) + { + mobj_t *karmahitbox = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_KARMAHITBOX); // Player hitbox is too small!! + P_SetTarget(&karmahitbox->target, player->mo); + karmahitbox->destscale = player->mo->scale; + P_SetScale(karmahitbox, player->mo->scale); CONS_Printf(M_GetText("%s lost all of their balloons!\n"), player_names[player-players]); + } player->kartstuff[k_balloon]--; } @@ -3419,51 +3427,11 @@ void K_MoveKartPlayer(player_t *player, boolean onground) { K_StripItems(player); player->mo->flags2 |= MF2_SHADOW; - - if (!(player->mo->tracer)) - { - player->mo->tracer = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_OVERLAY); - P_SetMobjState(player->mo->tracer, S_PLAYERBOMB); - } - - P_SetTarget(&player->mo->tracer->target, player->mo); - player->mo->tracer->color = player->mo->color; - player->mo->tracer->colorized = (player->kartstuff[k_comebackmode] == 1); - - if (player->kartstuff[k_comebacktimer] > 0) - { - if (player->mo->tracer->state != &states[S_PLAYERBOMB]) - P_SetMobjState(player->mo->tracer, S_PLAYERBOMB); - - if (player->kartstuff[k_comebacktimer] < TICRATE && (leveltime & 1)) - player->mo->tracer->flags2 &= ~MF2_DONTDRAW; - else - player->mo->tracer->flags2 |= MF2_DONTDRAW; - - player->powers[pw_flashing] = player->kartstuff[k_comebacktimer]; - } - else - { - if (player->kartstuff[k_comebackmode] == 0 - && player->mo->tracer->state != &states[S_PLAYERBOMB]) - P_SetMobjState(player->mo->tracer, S_PLAYERBOMB); - else if (player->kartstuff[k_comebackmode] == 1 - && player->mo->tracer->state != &states[S_PLAYERITEM]) - P_SetMobjState(player->mo->tracer, S_PLAYERITEM); - - if ((player->powers[pw_flashing] || player->kartstuff[k_spinouttimer]) && (leveltime & 1)) - player->mo->tracer->flags2 |= MF2_DONTDRAW; - else - player->mo->tracer->flags2 &= ~MF2_DONTDRAW; - } + player->powers[pw_flashing] = player->kartstuff[k_comebacktimer]; } else if (G_RaceGametype() || player->kartstuff[k_balloon] > 0) { player->mo->flags2 &= ~MF2_SHADOW; - if (player->mo->tracer - && (player->mo->tracer->state == &states[S_PLAYERBOMB] - || player->mo->tracer->state == &states[S_PLAYERITEM])) - P_RemoveMobj(player->mo->tracer); } } diff --git a/src/p_inter.c b/src/p_inter.c index e8e0b0cc..cc658117 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -422,6 +422,61 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) P_SetTarget(&special->target, toucher); P_KillMobj(special, toucher, toucher); break; + case MT_KARMAHITBOX: + if (!special->target->player) + return; + if (player == special->target->player) + return; + if (player->kartstuff[k_growshrinktimer] || player->kartstuff[k_squishedtimer] + || player->kartstuff[k_hyudorotimer] || player->kartstuff[k_spinouttimer] + || player->kartstuff[k_invincibilitytimer] || player->powers[pw_flashing] + || player->kartstuff[k_balloon] <= 0) + return; + + if (special->target->player->kartstuff[k_comebacktimer] + || special->target->player->kartstuff[k_spinouttimer] + || special->target->player->kartstuff[k_squishedtimer]) + return; + + if (special->target->player->kartstuff[k_comebackmode] == 0) + { + mobj_t *boom = P_SpawnMobj(special->target->x, special->target->y, special->target->z, MT_BOOMPARTICLE); + boom->scale = special->target->scale; + boom->destscale = special->target->scale; + boom->momz = 5*FRACUNIT; + if (special->target->color) + boom->color = special->target->color; + else + boom->color = SKINCOLOR_RED; + S_StartSound(boom, special->info->attacksound); + + K_ExplodePlayer(player, special->target); + + special->target->player->kartstuff[k_comebackpoints] += 2; + if (netgame && cv_hazardlog.value) + CONS_Printf(M_GetText("%s bombed %s!\n"), player_names[special->target->player-players], player_names[player-players]); + if (special->target->player->kartstuff[k_comebackpoints] >= 3) + K_StealBalloon(special->target->player, player, true); + + special->target->player->kartstuff[k_comebacktimer] = comebacktime; + } + else if (special->target->player->kartstuff[k_comebackmode] == 1 && P_CanPickupItem(player, true)) + { + mobj_t *poof = P_SpawnMobj(tmthing->x, tmthing->y, tmthing->z, MT_EXPLODE); + S_StartSound(poof, special->info->seesound); + + player->kartstuff[k_itemroulette] = 1; + player->kartstuff[k_roulettetype] = 1; + + special->target->player->kartstuff[k_comebackmode] = 0; + special->target->player->kartstuff[k_comebackpoints]++; + if (netgame && cv_hazardlog.value) + CONS_Printf(M_GetText("%s gave an item to %s.\n"), player_names[special->target->player-players], player_names[player-players]); + if (special->target->player->kartstuff[k_comebackpoints] >= 3) + K_StealBalloon(special->target->player, player, true); + special->target->player->kartstuff[k_comebacktimer] = comebacktime; + } + return; // ***************************************** // // Rings, coins, spheres, weapon panels, etc // // ***************************************** // @@ -2755,7 +2810,13 @@ static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage) if (player->kartstuff[k_balloon] > 0) { if (player->kartstuff[k_balloon] == 1) + { + mobj_t *karmahitbox = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_KARMAHITBOX); // Player hitbox is too small!! + P_SetTarget(&karmahitbox->target, player->mo); + karmahitbox->destscale = player->mo->scale; + P_SetScale(karmahitbox, player->mo->scale); CONS_Printf(M_GetText("%s lost all of their balloons!\n"), player_names[player-players]); + } player->kartstuff[k_balloon]--; } diff --git a/src/p_map.c b/src/p_map.c index 5dba8c29..392c6443 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1644,79 +1644,6 @@ static boolean PIT_CheckThing(mobj_t *thing) return true; } - if (G_BattleGametype()) - { - if (thing->player->kartstuff[k_balloon] <= 0 || tmthing->player->kartstuff[k_balloon] <= 0) - { - if (thing->player->kartstuff[k_comebackmode] == 0 - && (tmthing->player->kartstuff[k_balloon] > 0 - && !tmthing->player->powers[pw_flashing])) - { - mobj_t *boom = P_SpawnMobj(thing->x, thing->y, thing->z, MT_BOOMPARTICLE); - boom->scale = thing->scale; - boom->destscale = thing->scale; - boom->momz = 5*FRACUNIT; - if (thing->player->skincolor) - boom->color = thing->player->skincolor; - else - boom->color = SKINCOLOR_RED; - S_StartSound(boom, sfx_s3k4e); - K_ExplodePlayer(tmthing->player, thing); - thing->player->kartstuff[k_comebacktimer] = comebacktime; - return true; - } - else if (tmthing->player->kartstuff[k_comebackmode] == 0 - && (thing->player->kartstuff[k_balloon] > 0 - && !thing->player->powers[pw_flashing])) - { - mobj_t *boom = P_SpawnMobj(tmthing->x, tmthing->y, tmthing->z, MT_BOOMPARTICLE); - boom->scale = tmthing->scale; - boom->destscale = tmthing->scale; - boom->momz = 5*FRACUNIT; - if (tmthing->player->skincolor) - boom->color = tmthing->player->skincolor; - else - boom->color = SKINCOLOR_RED; - S_StartSound(boom, sfx_s3k4e); - K_ExplodePlayer(thing->player, tmthing); - tmthing->player->kartstuff[k_comebacktimer] = comebacktime; - return true; - } - else if (thing->player->kartstuff[k_comebackmode] == 1 - && (tmthing->player->kartstuff[k_balloon] > 0 - && P_CanPickupItem(tmthing->player, true))) - { - thing->player->kartstuff[k_comebackmode] = 0; - thing->player->kartstuff[k_comebackpoints]++; - if (netgame && cv_hazardlog.value) - CONS_Printf(M_GetText("%s gave an item to %s.\n"), player_names[thing->player-players], player_names[tmthing->player-players]); - tmthing->player->kartstuff[k_itemroulette] = 1; - tmthing->player->kartstuff[k_roulettetype] = 1; - P_SpawnMobj(tmthing->x, tmthing->y, tmthing->z, MT_EXPLODE); - if (thing->player->kartstuff[k_comebackpoints] >= 3) - K_StealBalloon(thing->player, tmthing->player, true); - thing->player->kartstuff[k_comebacktimer] = comebacktime; - return true; - } - else if (tmthing->player->kartstuff[k_comebackmode] == 1 - && (thing->player->kartstuff[k_balloon] > 0 - && P_CanPickupItem(thing->player, true))) - { - tmthing->player->kartstuff[k_comebackmode] = 0; - tmthing->player->kartstuff[k_comebackpoints]++; - if (netgame && cv_hazardlog.value) - CONS_Printf(M_GetText("%s gave an item to %s.\n"), player_names[tmthing->player-players], player_names[thing->player-players]); - thing->player->kartstuff[k_itemroulette] = 1; - thing->player->kartstuff[k_roulettetype] = 1; - P_SpawnMobj(thing->x, thing->y, thing->z, MT_EXPLODE); - if (tmthing->player->kartstuff[k_comebackpoints] >= 3) - K_StealBalloon(tmthing->player, thing->player, true); - tmthing->player->kartstuff[k_comebacktimer] = comebacktime; - return true; - } - } - } - if (P_IsObjectOnGround(thing) && tmthing->momz < 0) { K_KartBouncing(tmthing, thing, true, false); diff --git a/src/p_mobj.c b/src/p_mobj.c index 5be6ea20..2f9cda0f 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8141,6 +8141,43 @@ void P_MobjThinker(mobj_t *mobj) } P_TeleportMove(mobj, mobj->target->x, mobj->target->y, mobj->target->z); break; + case MT_KARMAHITBOX: + if (!mobj->target || !mobj->target->health || !mobj->target->player + || (G_RaceGametype() || mobj->target->player->kartstuff[k_balloon])) + { + P_RemoveMobj(mobj); + return; + } + + P_TeleportMove(mobj, mobj->target->x, mobj->target->y, mobj->target->z); + mobj->color = mobj->target->color; + mobj->colorized = (mobj->target->player->kartstuff[k_comebackmode] == 1); + + if (mobj->target->player->kartstuff[k_comebacktimer] > 0) + { + if (mobj->state != &states[mobj->info->spawnstate]) + P_SetMobjState(mobj, mobj->info->spawnstate); + + if (mobj->target->player->kartstuff[k_comebacktimer] < TICRATE && (leveltime & 1)) + mobj->flags2 &= ~MF2_DONTDRAW; + else + mobj->flags2 |= MF2_DONTDRAW; + } + else + { + if (mobj->target->player->kartstuff[k_comebackmode] == 0 + && mobj->state != &states[mobj->info->spawnstate]) + P_SetMobjState(mobj, mobj->info->spawnstate); + else if (mobj->target->player->kartstuff[k_comebackmode] == 1 + && mobj->state != &states[mobj->info->seestate]) + P_SetMobjState(mobj, mobj->info->seestate); + + if (mobj->target->player->powers[pw_flashing] && (leveltime & 1)) + mobj->flags2 |= MF2_DONTDRAW; + else + mobj->flags2 &= ~MF2_DONTDRAW; + } + break; //} case MT_TURRET: P_MobjCheckWater(mobj); @@ -9721,7 +9758,6 @@ void P_SpawnPlayer(INT32 playernum) if (G_BattleGametype()) // SRB2kart { mobj_t *overheadarrow = P_SpawnMobj(mobj->x, mobj->y, mobj->z + P_GetPlayerHeight(p)+16*FRACUNIT, MT_PLAYERARROW); - P_SetTarget(&overheadarrow->target, mobj); overheadarrow->flags2 |= MF2_DONTDRAW; P_SetScale(overheadarrow, mobj->destscale); @@ -9772,6 +9808,13 @@ void P_SpawnPlayer(INT32 playernum) mo->flags2 &= ~MF2_DONTDRAW; } } + else if (p->kartstuff[k_balloon] <= 0) + { + mobj_t *karmahitbox = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_KARMAHITBOX); // Player hitbox is too small!! + P_SetTarget(&karmahitbox->target, mobj); + karmahitbox->destscale = mobj->scale; + P_SetScale(karmahitbox, mobj->scale); + } } } From da83809d440cb58b2e68031283f303221d15a137 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sat, 16 Jun 2018 17:54:12 -0400 Subject: [PATCH 048/293] Trailling items Needs redone with a linked list and remove mobjtable; it doesn't like netgames atm --- src/info.c | 8 +-- src/k_kart.c | 128 ++++++++++++++++++++++++++++++---------------- src/lua_mobjlib.c | 9 +++- src/p_inter.c | 77 +++++++++++++++++++--------- src/p_mobj.c | 91 ++++++++++++++++++++++++++++---- src/p_mobj.h | 1 + src/p_saveg.c | 44 ++++++++++++++-- 7 files changed, 272 insertions(+), 86 deletions(-) diff --git a/src/info.c b/src/info.c index 838e4c30..f57295fb 100644 --- a/src/info.c +++ b/src/info.c @@ -14510,7 +14510,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { // MT_BANANA_SHIELD -1, // doomednum - S_BANANA, // spawnstate + S_BANANA, // spawnstate 1000, // spawnhealth S_NULL, // seestate sfx_None, // seesound @@ -14521,12 +14521,12 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_BANANA_DEAD, // deathstate + S_BANANA_DEAD, // deathstate S_NULL, // xdeathstate sfx_None, // deathsound 0, // speed - 16*FRACUNIT, // radius - 32*FRACUNIT, // height + 12*FRACUNIT, // radius + 20*FRACUNIT, // height 0, // display offset 100, // mass 1, // damage diff --git a/src/k_kart.c b/src/k_kart.c index 3c29d03f..28f58d89 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2008,6 +2008,37 @@ void K_DriftDustHandling(mobj_t *spawner) } } +static mobj_t *K_FindLastTrailMobj(player_t *player) +{ + thinker_t *th; + mobj_t *mo; + mobj_t *trail = NULL; + + if (!player) + return NULL; + + for (th = thinkercap.next; th != &thinkercap; th = th->next) + { + if (th->function.acp1 != (actionf_p1)P_MobjThinker) + continue; + + mo = (mobj_t *)th; + + if (mo->type != MT_BANANA_SHIELD + && mo->type != MT_FAKESHIELD + && mo->type != MT_SSMINE_SHIELD) + continue; + + if (!mo->target || !mo->target->player || mo->target->player != player) + continue; + + if (trail == NULL || (mo->lastlook > trail->lastlook)) + trail = mo; + } + + return trail; +} + static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t mapthing, INT32 defaultDir, boolean minethrow) { mobj_t *mo; @@ -2124,13 +2155,23 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map } else { - fixed_t dropradius = FixedHypot(player->mo->radius, player->mo->radius) + FixedHypot(mobjinfo[mapthing].radius, mobjinfo[mapthing].radius); + mobj_t *lasttrail = K_FindLastTrailMobj(player); - // Drop it directly behind you. - newangle = player->mo->angle; + if (lasttrail) + { + newx = lasttrail->x; + newy = lasttrail->y; + } + else + { + // Drop it directly behind you. + fixed_t dropradius = FixedHypot(player->mo->radius, player->mo->radius) + FixedHypot(mobjinfo[mapthing].radius, mobjinfo[mapthing].radius); - newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, dropradius); - newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, dropradius); + newangle = player->mo->angle; + + newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, dropradius); + newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, dropradius); + } mo = P_SpawnMobj(newx, newy, player->mo->z, mapthing); @@ -2986,48 +3027,49 @@ void K_MoveKartPlayer(player_t *player, boolean onground) case KITEM_BANANA: if (ATTACK_IS_DOWN && !HOLDING_ITEM && NO_HYUDORO) { - if (player->kartstuff[k_itemamount] == 1) // Banana x1 held - { - angle_t newangle; - fixed_t newx; - fixed_t newy; - mobj_t *mo; - player->kartstuff[k_itemheld] = 1; - player->pflags |= PF_ATTACKDOWN; - newangle = player->mo->angle; - newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, 64*FRACUNIT); - newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, 64*FRACUNIT); - mo = P_SpawnMobj(newx, newy, player->mo->z, MT_BANANA_SHIELD); - mo->threshold = 10; - if (mo) - P_SetTarget(&mo->target, player->mo); - } - else if (player->kartstuff[k_itemamount] > 1) // Banana x3 held - { - INT32 moloop; + angle_t newangle; + fixed_t newx; + fixed_t newy; + mobj_t *master; - K_PlayTauntSound(player->mo); - player->kartstuff[k_itemheld] = 2; - player->pflags |= PF_ATTACKDOWN; + player->kartstuff[k_itemheld] = 1; + player->pflags |= PF_ATTACKDOWN; + newangle = player->mo->angle; + newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, mobjinfo[MT_BANANA_SHIELD].radius); + newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, mobjinfo[MT_BANANA_SHIELD].radius); + master = P_SpawnMobj(newx, newy, player->mo->z, MT_BANANA_SHIELD); + master->threshold = 10; + master->movecount = player->kartstuff[k_itemamount]-1; + master->lastlook = 1; - for (moloop = 0; moloop < player->kartstuff[k_itemamount]; moloop++) + if (master) + { + P_SetTarget(&master->target, player->mo); + + if (master->movecount > 0) // Banana x3/x10 held { - angle_t newangle; - fixed_t newx; - fixed_t newy; - mobj_t *mo; - - newangle = player->mo->angle; - newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, 64*FRACUNIT); - newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, 64*FRACUNIT); - mo = P_SpawnMobj(newx, newy, player->mo->z, MT_BANANA_SHIELD); + INT32 moloop; + K_PlayTauntSound(player->mo); + player->kartstuff[k_itemheld] = 2; - if (mo) + for (moloop = 0; moloop < master->movecount; moloop++) { - mo->threshold = 10; - mo->lastlook = moloop+1; - P_SetTarget(&mo->target, player->mo); - mo->angle = FixedAngle(((90/player->kartstuff[k_itemamount])*moloop)*FRACUNIT); + if (moloop >= 10) // maxed out mobjtable + break; + + newangle = player->mo->angle; + newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, mobjinfo[MT_BANANA_SHIELD].radius); + newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, mobjinfo[MT_BANANA_SHIELD].radius); + master->mobjtable[moloop] = P_SpawnMobj(newx, newy, player->mo->z, MT_BANANA_SHIELD); + + if (master->mobjtable[moloop]) + { + master->mobjtable[moloop]->threshold = 10; + master->mobjtable[moloop]->lastlook = moloop+2; + P_SetTarget(&master->mobjtable[moloop]->target, player->mo); + P_SetTarget(&master->mobjtable[moloop]->tracer, master); + master->mobjtable[moloop]->angle = newangle; + } } } } @@ -3041,7 +3083,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) } else if (ATTACK_IS_DOWN && player->kartstuff[k_itemheld] == 2) // Banana x3 thrown { - K_ThrowKartItem(player, false, MT_BANANA, -1,false ); + K_ThrowKartItem(player, false, MT_BANANA, -1, false); K_PlayTauntSound(player->mo); player->pflags |= PF_ATTACKDOWN; player->kartstuff[k_itemamount]--; diff --git a/src/lua_mobjlib.c b/src/lua_mobjlib.c index 2dbb58c8..16aa63c1 100644 --- a/src/lua_mobjlib.c +++ b/src/lua_mobjlib.c @@ -81,7 +81,8 @@ enum mobj_e { mobj_extravalue2, mobj_cusval, mobj_cvmem, - mobj_colorized + mobj_colorized, + mobj_mobjtable }; static const char *const mobj_opt[] = { @@ -142,6 +143,7 @@ static const char *const mobj_opt[] = { "cusval", "cvmem", "colorized", + "mobjtable", NULL}; #define UNIMPLEMENTED luaL_error(L, LUA_QL("mobj_t") " field " LUA_QS " is not implemented for Lua and cannot be accessed.", mobj_opt[field]) @@ -348,6 +350,9 @@ static int mobj_get(lua_State *L) case mobj_colorized: lua_pushboolean(L, mo->colorized); break; + case mobj_mobjtable: + // No idea how to do a table like this :V + return UNIMPLEMENTED; default: // extra custom variables in Lua memory lua_getfield(L, LUA_REGISTRYINDEX, LREG_EXTVARS); I_Assert(lua_istable(L, -1)); @@ -646,6 +651,8 @@ static int mobj_set(lua_State *L) case mobj_colorized: mo->colorized = luaL_checkboolean(L, 3); break; + case mobj_mobjtable: + return UNIMPLEMENTED; default: lua_getfield(L, LUA_REGISTRYINDEX, LREG_EXTVARS); I_Assert(lua_istable(L, -1)); diff --git a/src/p_inter.c b/src/p_inter.c index cc658117..202dcddd 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2062,29 +2062,6 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source) //if (inflictor && (inflictor->type == MT_SHELL || inflictor->type == MT_FIREBALL)) // P_SetTarget(&target->tracer, inflictor); - // SRB2kart - // I wish I knew a better way to do this - if (target->target && target->target->player && target->target->player->mo) - { - if (target->target->player->kartstuff[k_eggmanheld] && target->type == MT_FAKESHIELD) - target->target->player->kartstuff[k_eggmanheld] = 0; - - if ((target->target->player->kartstuff[k_itemheld]) - && ((target->type == MT_GREENSHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_ORBINAUT) - || (target->type == MT_JAWZ_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_JAWZ) - || (target->type == MT_BANANA_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_BANANA) - || (target->type == MT_SSMINE_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_MINE))) - { - if (target->lastlook > 0) - target->target->player->kartstuff[k_itemamount] = target->lastlook-1; - else - target->target->player->kartstuff[k_itemamount]--; - if (!target->target->player->kartstuff[k_itemamount]) - target->target->player->kartstuff[k_itemheld] = 0; - } - } - // - if (!useNightsSS && G_IsSpecialStage(gamemap) && target->player && sstimer > 6) sstimer = 6; // Just let P_Ticker take care of the rest. @@ -2116,6 +2093,60 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source) return; #endif + // SRB2kart + // I wish I knew a better way to do this + if (target->target && target->target->player && target->target->player->mo) + { + if (target->target->player->kartstuff[k_eggmanheld] && target->type == MT_FAKESHIELD) + target->target->player->kartstuff[k_eggmanheld] = 0; + + if ((target->target->player->kartstuff[k_itemheld]) + && ((target->type == MT_GREENSHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_ORBINAUT) + || (target->type == MT_JAWZ_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_JAWZ) + || (target->type == MT_BANANA_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_BANANA) + || (target->type == MT_SSMINE_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_MINE))) + { + if ((target->type == MT_BANANA_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_BANANA) + || (target->type == MT_SSMINE_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_MINE)) + { + if (target->lastlook == 1) + { + INT32 i; + for (i = 0; i < 10; i++) + { + if (target->mobjtable[i] && target->mobjtable[i]->health) + P_KillMobj(target->mobjtable[i], inflictor, source); + } + target->target->player->kartstuff[k_itemamount] = 0; + } + else if (target->lastlook > 1) + { + if (target->lastlook < target->target->player->kartstuff[k_itemamount]) + { + if (target->tracer && target->tracer->health) + P_KillMobj(target->tracer, inflictor, source); + target->target->player->kartstuff[k_itemamount] = 0; + } + else + target->target->player->kartstuff[k_itemamount]--; + } + else + target->target->player->kartstuff[k_itemamount]--; + } + else + { + if (target->lastlook > 0) + target->target->player->kartstuff[k_itemamount] = target->lastlook-1; + else + target->target->player->kartstuff[k_itemamount]--; + } + + if (!target->target->player->kartstuff[k_itemamount]) + target->target->player->kartstuff[k_itemheld] = 0; + } + } + // + // Let EVERYONE know what happened to a player! 01-29-2002 Tails if (target->player && !target->player->spectator) { diff --git a/src/p_mobj.c b/src/p_mobj.c index 2f9cda0f..f7418f2c 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6682,11 +6682,8 @@ void P_MobjThinker(mobj_t *mobj) } break; } - case MT_GREENSHIELD: + case MT_GREENSHIELD: // Kart orbit items case MT_JAWZ_SHIELD: - case MT_BANANA_SHIELD: - case MT_FAKESHIELD: - case MT_SSMINE_SHIELD: if (mobj->health > 0 && mobj->target && mobj->target->player && mobj->target->player->mo && mobj->target->player->health > 0 && !mobj->target->player->spectator) { @@ -6694,12 +6691,8 @@ void P_MobjThinker(mobj_t *mobj) const fixed_t radius = FixedHypot(mobj->target->radius, mobj->target->radius) + FixedHypot(mobj->radius, mobj->radius); // mobj's distance from its Target, or Radius. //mobj->angle += FixedAngle(12*FRACUNIT); // mobj's actual speed. - if ((mobj->type == MT_GREENSHIELD || mobj->type == MT_JAWZ_SHIELD) && mobj->lastlook > 0) + if (mobj->lastlook > 0) mobj->angle += FixedAngle(mobj->info->speed); - else if (mobj->type == MT_BANANA_SHIELD && mobj->lastlook == 2) - mobj->angle = (mobj->target->angle + ANGLE_135); - else if (mobj->type == MT_BANANA_SHIELD && mobj->lastlook == 3) - mobj->angle = (mobj->target->angle + ANGLE_225); else mobj->angle = (mobj->target->angle + ANGLE_180); @@ -6756,7 +6749,85 @@ void P_MobjThinker(mobj_t *mobj) // Was this so hard? if ((mobj->type == MT_GREENSHIELD && mobj->target->player->kartstuff[k_itemtype] != KITEM_ORBINAUT) || (mobj->type == MT_JAWZ_SHIELD && mobj->target->player->kartstuff[k_itemtype] != KITEM_JAWZ) - || (mobj->type == MT_BANANA_SHIELD && mobj->target->player->kartstuff[k_itemtype] != KITEM_BANANA) + || (mobj->lastlook > 0 && mobj->target->player->kartstuff[k_itemamount] < mobj->lastlook) + || (!mobj->target->player->kartstuff[k_itemheld])) + { + P_RemoveMobj(mobj); + return; + } + } + else if ((mobj->health > 0 + && (!mobj->target || !mobj->target->player || !mobj->target->player->mo || mobj->target->player->health <= 0 || mobj->target->player->spectator)) + || (mobj->health <= 0 && mobj->z <= mobj->floorz) + || P_CheckDeathPitCollide(mobj)) // When in death state + { + P_RemoveMobj(mobj); + return; + } + break; + case MT_BANANA_SHIELD: // Kart trailing items + case MT_SSMINE_SHIELD: + case MT_FAKESHIELD: + if (mobj->health > 0 && mobj->target && mobj->target->player && mobj->target->player->mo + && mobj->target->player->health > 0 && !mobj->target->player->spectator) + { + if (mobj->lastlook == 1) + { + const fixed_t spacing = FixedMul(mobj->info->radius, mobj->target->scale); + angle_t ang = mobj->target->angle; + fixed_t targx = mobj->target->x + P_ReturnThrustX(mobj, ang + ANGLE_180, spacing); + fixed_t targy = mobj->target->y + P_ReturnThrustY(mobj, ang + ANGLE_180, spacing); + fixed_t targz = mobj->target->z; + fixed_t speed = FixedMul(R_PointToDist2(mobj->x, mobj->y, targx, targy), FRACUNIT/2); + INT32 i; + INT32 previ = -1; + + if (P_IsObjectOnGround(mobj->target)) + targz = mobj->floorz; + mobj->angle = R_PointToAngle2(mobj->x, mobj->y, targx, targy); + + if (speed > spacing/2) + P_InstaThrust(mobj, mobj->angle, speed-spacing/2); + P_SetObjectMomZ(mobj, FixedMul(targz - mobj->z, FRACUNIT/2), false); + if (R_PointToDist2(mobj->x, mobj->y, targx, targy) > 768*FRACUNIT) + P_TeleportMove(mobj, targx, targy, mobj->z); + + if (mobj->movecount > 0) // Now, for chaser bananas. + { + for (i = 0; i < mobj->movecount; i++) + { + mobj_t *targ; + + if (!mobj->mobjtable[i]) + continue; + + targ = mobj; + if (previ >= 0 && mobj->mobjtable[previ]) + targ = mobj->mobjtable[previ]; + + ang = targ->angle; + targx = targ->x + P_ReturnThrustX(mobj->mobjtable[i], ang + ANGLE_180, spacing); + targy = targ->y + P_ReturnThrustY(mobj->mobjtable[i], ang + ANGLE_180, spacing); + targz = targ->z; + speed = FixedMul(R_PointToDist2(mobj->mobjtable[i]->x, mobj->mobjtable[i]->y, targx, targy), FRACUNIT/2); + if (P_IsObjectOnGround(targ)) + targz = mobj->mobjtable[i]->floorz; + + mobj->mobjtable[i]->angle = R_PointToAngle2(mobj->mobjtable[i]->x, mobj->mobjtable[i]->y, targx, targy); + + if (speed > spacing/2) + P_InstaThrust(mobj->mobjtable[i], mobj->mobjtable[i]->angle, speed-(spacing/2)); + P_SetObjectMomZ(mobj->mobjtable[i], FixedMul(targz - mobj->mobjtable[i]->z, FRACUNIT/2), false); + if (R_PointToDist2(mobj->mobjtable[i]->x, mobj->mobjtable[i]->y, targx, targy) > 768*FRACUNIT) + P_TeleportMove(mobj->mobjtable[i], targx, targy, mobj->mobjtable[i]->z); + + previ = i; + } + } + } + + // Was this so hard? + if ((mobj->type == MT_BANANA_SHIELD && mobj->target->player->kartstuff[k_itemtype] != KITEM_BANANA) || (mobj->type == MT_SSMINE_SHIELD && mobj->target->player->kartstuff[k_itemtype] != KITEM_MINE) || (mobj->type == MT_FAKESHIELD && !mobj->target->player->kartstuff[k_eggmanheld]) || (mobj->type != MT_FAKESHIELD && !mobj->target->player->kartstuff[k_itemheld]) diff --git a/src/p_mobj.h b/src/p_mobj.h index 096c7762..93cdbf0c 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -367,6 +367,7 @@ typedef struct mobj_s #endif boolean colorized; // Whether the mobj uses the rainbow colormap + struct mobj_s *mobjtable[10]; // Table of 10 mobj pointers // WARNING: New fields must be added separately to savegame and Lua. } mobj_t; diff --git a/src/p_saveg.c b/src/p_saveg.c index 763f24e2..9ce7708b 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -944,13 +944,14 @@ typedef enum MD2_EXTVAL1 = 1<<5, MD2_EXTVAL2 = 1<<6, MD2_HNEXT = 1<<7, + MD2_HPREV = 1<<8, #ifdef ESLOPE - MD2_HPREV = 1<<8, MD2_SLOPE = 1<<9, - MD2_COLORIZED = 1<<10 + MD2_COLORIZED = 1<<10, + MD2_MOBJTABLE = 1<<11 #else - MD2_HPREV = 1<<8, - MD2_COLORIZED = 1<<9 + MD2_COLORIZED = 1<<9, + MD2_MOBJTABLE = 1<<10 #endif } mobj_diff2_t; @@ -1030,6 +1031,8 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type) const mobj_t *mobj = (const mobj_t *)th; UINT32 diff; UINT16 diff2; + UINT16 difft; + UINT8 i; // Ignore stationary hoops - these will be respawned from mapthings. if (mobj->type == MT_HOOP) @@ -1059,7 +1062,7 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type) else diff = MD_POS | MD_TYPE; // not a map spawned thing so make it from scratch - diff2 = 0; + diff2 = difft = 0; // not the default but the most probable if (mobj->momx != 0 || mobj->momy != 0 || mobj->momz != 0) @@ -1147,6 +1150,14 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type) #endif if (mobj->colorized) diff2 |= MD2_COLORIZED; + for (i = 0; i < 10; i++) + { + if (mobj->mobjtable[i]) + { + diff2 |= MD2_MOBJTABLE; + difft |= ((i > 0) ? (1<colorized); + if (diff2 & MD2_MOBJTABLE) + { + for (i = 0; i < 10; i++) + { + if (difft & ((i > 0) ? (1<mobjtable[i]->mobjnum); + } + } WRITEUINT32(save_p, mobj->mobjnum); } @@ -1938,6 +1959,7 @@ static void LoadMobjThinker(actionf_p1 thinker) mobj_t *mobj; UINT32 diff; UINT16 diff2; + UINT16 difft; INT32 i; fixed_t z, floorz, ceilingz; @@ -1946,6 +1968,10 @@ static void LoadMobjThinker(actionf_p1 thinker) diff2 = READUINT16(save_p); else diff2 = 0; + if (diff2 & MD2_MOBJTABLE) + difft = READUINT16(save_p); + else + difft = 0; next = (void *)(size_t)READUINT32(save_p); @@ -2139,6 +2165,14 @@ static void LoadMobjThinker(actionf_p1 thinker) #endif if (diff2 & MD2_COLORIZED) mobj->colorized = READUINT8(save_p); + if (diff2 & MD2_MOBJTABLE) + { + for (i = 0; i < 10; i++) + { + if (difft & ((i > 0) ? (1<mobjtable[i] = (mobj_t *)(size_t)READUINT32(save_p); + } + } if (diff & MD_REDFLAG) { From d1929d3a37928e24f7e31d6e75cc9af9145d7b40 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sat, 16 Jun 2018 19:57:08 -0400 Subject: [PATCH 049/293] Linked list bananas, hnext/hprev fixes --- src/info.c | 4 +- src/k_kart.c | 115 +++++++++++++++++++++++----------------------- src/k_kart.h | 1 + src/lua_baselib.c | 17 +++++++ src/lua_mobjlib.c | 25 ++++++---- src/p_inter.c | 21 ++------- src/p_mobj.c | 75 ++++++++++++++---------------- src/p_mobj.h | 1 - src/p_saveg.c | 40 ++-------------- 9 files changed, 132 insertions(+), 167 deletions(-) diff --git a/src/info.c b/src/info.c index f57295fb..834dcf0a 100644 --- a/src/info.c +++ b/src/info.c @@ -14525,8 +14525,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL, // xdeathstate sfx_None, // deathsound 0, // speed - 12*FRACUNIT, // radius - 20*FRACUNIT, // height + 10*FRACUNIT, // radius + 21*FRACUNIT, // height 0, // display offset 100, // mass 1, // damage diff --git a/src/k_kart.c b/src/k_kart.c index 28f58d89..c6065cf6 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2008,32 +2008,16 @@ void K_DriftDustHandling(mobj_t *spawner) } } -static mobj_t *K_FindLastTrailMobj(player_t *player) +static mobj_t *K_FindLastTrailMobj(player_t *player) // YUCK, i hate this! { - thinker_t *th; - mobj_t *mo; - mobj_t *trail = NULL; + mobj_t *trail = player->mo->hnext; - if (!player) + if (!player || !trail) return NULL; - for (th = thinkercap.next; th != &thinkercap; th = th->next) + while (trail->hnext && !P_MobjWasRemoved(trail->hnext)) { - if (th->function.acp1 != (actionf_p1)P_MobjThinker) - continue; - - mo = (mobj_t *)th; - - if (mo->type != MT_BANANA_SHIELD - && mo->type != MT_FAKESHIELD - && mo->type != MT_SSMINE_SHIELD) - continue; - - if (!mo->target || !mo->target->player || mo->target->player != player) - continue; - - if (trail == NULL || (mo->lastlook > trail->lastlook)) - trail = mo; + trail = trail->hnext; } return trail; @@ -2381,6 +2365,27 @@ void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed) S_StartSound(mo, sfx_kc2f); } +void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source) +{ + if (banana->hnext) + K_KillBananaChain(banana->hnext, inflictor, source); + + if (banana->health) + { + if (banana->eflags & MFE_VERTICALFLIP) + banana->z -= banana->height; + else + banana->z += banana->height; + + S_StartSound(banana, banana->info->deathsound); + P_KillMobj(banana, inflictor, source); + + P_SetObjectMomZ(banana, 8*FRACUNIT, false); + if (inflictor) + P_InstaThrust(banana, R_PointToAngle2(inflictor->x, inflictor->y, banana->x, banana->y)+ANGLE_90, 16*FRACUNIT); + } +} + /** \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 @@ -3030,48 +3035,38 @@ void K_MoveKartPlayer(player_t *player, boolean onground) angle_t newangle; fixed_t newx; fixed_t newy; - mobj_t *master; + INT32 moloop; + mobj_t *mo; + mobj_t *prev = NULL; - player->kartstuff[k_itemheld] = 1; - player->pflags |= PF_ATTACKDOWN; - newangle = player->mo->angle; - newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, mobjinfo[MT_BANANA_SHIELD].radius); - newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, mobjinfo[MT_BANANA_SHIELD].radius); - master = P_SpawnMobj(newx, newy, player->mo->z, MT_BANANA_SHIELD); - master->threshold = 10; - master->movecount = player->kartstuff[k_itemamount]-1; - master->lastlook = 1; - - if (master) + if (player->kartstuff[k_itemamount] > 1) { - P_SetTarget(&master->target, player->mo); + K_PlayTauntSound(player->mo); + player->kartstuff[k_itemheld] = 2; + } + else + player->kartstuff[k_itemheld] = 1; + player->pflags |= PF_ATTACKDOWN; - if (master->movecount > 0) // Banana x3/x10 held + for (moloop = 0; moloop < player->kartstuff[k_itemamount]; moloop++) + { + newangle = player->mo->angle; + newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, mobjinfo[MT_BANANA_SHIELD].radius); + newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, mobjinfo[MT_BANANA_SHIELD].radius); + mo = P_SpawnMobj(newx, newy, player->mo->z, MT_BANANA_SHIELD); + mo->threshold = 10; + mo->movecount = player->kartstuff[k_itemamount]; + mo->lastlook = moloop+1; + P_SetTarget(&mo->target, player->mo); + if (moloop > 0) { - INT32 moloop; - K_PlayTauntSound(player->mo); - player->kartstuff[k_itemheld] = 2; - - for (moloop = 0; moloop < master->movecount; moloop++) - { - if (moloop >= 10) // maxed out mobjtable - break; - - newangle = player->mo->angle; - newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, mobjinfo[MT_BANANA_SHIELD].radius); - newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, mobjinfo[MT_BANANA_SHIELD].radius); - master->mobjtable[moloop] = P_SpawnMobj(newx, newy, player->mo->z, MT_BANANA_SHIELD); - - if (master->mobjtable[moloop]) - { - master->mobjtable[moloop]->threshold = 10; - master->mobjtable[moloop]->lastlook = moloop+2; - P_SetTarget(&master->mobjtable[moloop]->target, player->mo); - P_SetTarget(&master->mobjtable[moloop]->tracer, master); - master->mobjtable[moloop]->angle = newangle; - } - } + P_SetTarget(&mo->hprev, prev); + if (prev != NULL) + P_SetTarget(&prev->hnext, mo); } + else + P_SetTarget(&player->mo->hnext, mo); + prev = mo; } } else if (!(cmd->buttons & BT_ATTACK) && player->kartstuff[k_itemheld] == 1) @@ -3111,6 +3106,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) mo->scale = FRACUNIT/2; mo->threshold = 10; P_SetTarget(&mo->target, player->mo); + P_SetTarget(&player->mo->hnext, mo); } } break; @@ -3269,7 +3265,10 @@ void K_MoveKartPlayer(player_t *player, boolean onground) mo = P_SpawnMobj(newx, newy, player->mo->z, MT_SSMINE_SHIELD); mo->threshold = 10; if (mo) + { P_SetTarget(&mo->target, player->mo); + P_SetTarget(&player->mo->hnext, mo); + } } else if (!(cmd->buttons & BT_ATTACK) && HOLDING_ITEM) { diff --git a/src/k_kart.h b/src/k_kart.h index be455b0f..32dbbbd6 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -34,6 +34,7 @@ void K_SpawnSparkleTrail(mobj_t *mo); void K_DriftDustHandling(mobj_t *spawner); void K_DoSneaker(player_t *player, boolean doPFlag); void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed); +void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source); boolean K_CheckPlayersRespawnColliding(INT32 playernum, fixed_t x, fixed_t y); INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue); void K_StripItems(player_t *player); diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 30f1feb2..930feb55 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -2132,6 +2132,22 @@ static int lib_kDoPogoSpring(lua_State *L) return 0; } +static int lib_kKillBananaChain(lua_State *L) +{ + mobj_t *banana = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); + mobj_t *inflictor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); + mobj_t *source = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); + NOHUD + if (!banana) + return LUA_ErrInvalid(L, "mobj_t"); + if (!inflictor) + return LUA_ErrInvalid(L, "mobj_t"); + if (!source) + return LUA_ErrInvalid(L, "mobj_t"); + K_KillBananaChain(banana, inflictor, source); + return 0; +} + static int lib_kMomentumToFacing(lua_State *L) { player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); @@ -2359,6 +2375,7 @@ static luaL_Reg lib[] = { {"K_DriftDustHandling",lib_kDriftDustHandling}, {"K_DoSneaker",lib_kDoSneaker}, {"K_DoPogoSpring",lib_kDoPogoSpring}, + {"K_KillBananaChain",lib_kKillBananaChain}, {"K_MomentumToFacing",lib_kMomentumToFacing}, {"K_GetKartSpeed",lib_kGetKartSpeed}, {"K_GetKartAccel",lib_kGetKartAccel}, diff --git a/src/lua_mobjlib.c b/src/lua_mobjlib.c index 16aa63c1..814bb325 100644 --- a/src/lua_mobjlib.c +++ b/src/lua_mobjlib.c @@ -81,8 +81,7 @@ enum mobj_e { mobj_extravalue2, mobj_cusval, mobj_cvmem, - mobj_colorized, - mobj_mobjtable + mobj_colorized }; static const char *const mobj_opt[] = { @@ -143,7 +142,6 @@ static const char *const mobj_opt[] = { "cusval", "cvmem", "colorized", - "mobjtable", NULL}; #define UNIMPLEMENTED luaL_error(L, LUA_QL("mobj_t") " field " LUA_QS " is not implemented for Lua and cannot be accessed.", mobj_opt[field]) @@ -350,9 +348,6 @@ static int mobj_get(lua_State *L) case mobj_colorized: lua_pushboolean(L, mo->colorized); break; - case mobj_mobjtable: - // No idea how to do a table like this :V - return UNIMPLEMENTED; default: // extra custom variables in Lua memory lua_getfield(L, LUA_REGISTRYINDEX, LREG_EXTVARS); I_Assert(lua_istable(L, -1)); @@ -535,10 +530,22 @@ static int mobj_set(lua_State *L) case mobj_bprev: return UNIMPLEMENTED; case mobj_hnext: - mo->hnext = luaL_checkudata(L, 3, META_MOBJ); + if (lua_isnil(L, 3)) + P_SetTarget(&mo->hnext, NULL); + else + { + mobj_t *hnext = *((mobj_t **)luaL_checkudata(L, 3, META_MOBJ)); + P_SetTarget(&mo->hnext, hnext); + } break; case mobj_hprev: - mo->hprev = luaL_checkudata(L, 3, META_MOBJ); + if (lua_isnil(L, 3)) + P_SetTarget(&mo->hprev, NULL); + else + { + mobj_t *hprev = *((mobj_t **)luaL_checkudata(L, 3, META_MOBJ)); + P_SetTarget(&mo->hprev, hprev); + } break; case mobj_type: // yeah sure, we'll let you change the mobj's type. { @@ -651,8 +658,6 @@ static int mobj_set(lua_State *L) case mobj_colorized: mo->colorized = luaL_checkboolean(L, 3); break; - case mobj_mobjtable: - return UNIMPLEMENTED; default: lua_getfield(L, LUA_REGISTRYINDEX, LREG_EXTVARS); I_Assert(lua_istable(L, -1)); diff --git a/src/p_inter.c b/src/p_inter.c index 202dcddd..fd6264c3 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2109,27 +2109,12 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source) if ((target->type == MT_BANANA_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_BANANA) || (target->type == MT_SSMINE_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_MINE)) { - if (target->lastlook == 1) + if (target->lastlook != 0 && target->lastlook < target->target->player->kartstuff[k_itemamount]) { - INT32 i; - for (i = 0; i < 10; i++) - { - if (target->mobjtable[i] && target->mobjtable[i]->health) - P_KillMobj(target->mobjtable[i], inflictor, source); - } + if (target->target->hnext) + K_KillBananaChain(target->target->hnext, inflictor, source); target->target->player->kartstuff[k_itemamount] = 0; } - else if (target->lastlook > 1) - { - if (target->lastlook < target->target->player->kartstuff[k_itemamount]) - { - if (target->tracer && target->tracer->health) - P_KillMobj(target->tracer, inflictor, source); - target->target->player->kartstuff[k_itemamount] = 0; - } - else - target->target->player->kartstuff[k_itemamount]--; - } else target->target->player->kartstuff[k_itemamount]--; } diff --git a/src/p_mobj.c b/src/p_mobj.c index f7418f2c..2880bd1c 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6431,6 +6431,11 @@ void P_MobjThinker(mobj_t *mobj) P_SetTarget(&mobj->target, NULL); if (mobj->tracer && P_MobjWasRemoved(mobj->tracer)) P_SetTarget(&mobj->tracer, NULL); + // hnext/hprev changes suggested by toaster + if (mobj->hnext && P_MobjWasRemoved(mobj->hnext)) + P_SetTarget(&mobj->hnext, NULL); + if (mobj->hprev && P_MobjWasRemoved(mobj->hprev)) + P_SetTarget(&mobj->hprev, NULL); mobj->flags2 &= ~MF2_PUSHED; mobj->eflags &= ~(MFE_SPRUNG|MFE_JUSTBOUNCEDWALL); @@ -6774,55 +6779,42 @@ void P_MobjThinker(mobj_t *mobj) if (mobj->lastlook == 1) { const fixed_t spacing = FixedMul(mobj->info->radius, mobj->target->scale); - angle_t ang = mobj->target->angle; - fixed_t targx = mobj->target->x + P_ReturnThrustX(mobj, ang + ANGLE_180, spacing); - fixed_t targy = mobj->target->y + P_ReturnThrustY(mobj, ang + ANGLE_180, spacing); - fixed_t targz = mobj->target->z; - fixed_t speed = FixedMul(R_PointToDist2(mobj->x, mobj->y, targx, targy), FRACUNIT/2); - INT32 i; - INT32 previ = -1; + mobj_t *cur = mobj; + mobj_t *targ = mobj->target; - if (P_IsObjectOnGround(mobj->target)) - targz = mobj->floorz; - mobj->angle = R_PointToAngle2(mobj->x, mobj->y, targx, targy); - - if (speed > spacing/2) - P_InstaThrust(mobj, mobj->angle, speed-spacing/2); - P_SetObjectMomZ(mobj, FixedMul(targz - mobj->z, FRACUNIT/2), false); - if (R_PointToDist2(mobj->x, mobj->y, targx, targy) > 768*FRACUNIT) - P_TeleportMove(mobj, targx, targy, mobj->z); - - if (mobj->movecount > 0) // Now, for chaser bananas. + while (cur && !P_MobjWasRemoved(cur)) { - for (i = 0; i < mobj->movecount; i++) - { - mobj_t *targ; + angle_t ang; + fixed_t targx; + fixed_t targy; + fixed_t targz; + fixed_t speed; - if (!mobj->mobjtable[i]) - continue; + if (cur != mobj) + targ = cur->hprev; - targ = mobj; - if (previ >= 0 && mobj->mobjtable[previ]) - targ = mobj->mobjtable[previ]; + if (!targ || P_MobjWasRemoved(targ)) + continue; - ang = targ->angle; - targx = targ->x + P_ReturnThrustX(mobj->mobjtable[i], ang + ANGLE_180, spacing); - targy = targ->y + P_ReturnThrustY(mobj->mobjtable[i], ang + ANGLE_180, spacing); - targz = targ->z; - speed = FixedMul(R_PointToDist2(mobj->mobjtable[i]->x, mobj->mobjtable[i]->y, targx, targy), FRACUNIT/2); - if (P_IsObjectOnGround(targ)) - targz = mobj->mobjtable[i]->floorz; + ang = targ->angle; + targx = targ->x + P_ReturnThrustX(cur, ang + ANGLE_180, spacing); + targy = targ->y + P_ReturnThrustY(cur, ang + ANGLE_180, spacing); + targz = targ->z; + speed = FixedMul(R_PointToDist2(cur->x, cur->y, targx, targy), FRACUNIT/2); + if (P_IsObjectOnGround(targ)) + targz = cur->floorz; - mobj->mobjtable[i]->angle = R_PointToAngle2(mobj->mobjtable[i]->x, mobj->mobjtable[i]->y, targx, targy); + cur->angle = R_PointToAngle2(cur->x, cur->y, targx, targy); - if (speed > spacing/2) - P_InstaThrust(mobj->mobjtable[i], mobj->mobjtable[i]->angle, speed-(spacing/2)); - P_SetObjectMomZ(mobj->mobjtable[i], FixedMul(targz - mobj->mobjtable[i]->z, FRACUNIT/2), false); - if (R_PointToDist2(mobj->mobjtable[i]->x, mobj->mobjtable[i]->y, targx, targy) > 768*FRACUNIT) - P_TeleportMove(mobj->mobjtable[i], targx, targy, mobj->mobjtable[i]->z); + if (speed > spacing/2) + P_InstaThrust(cur, cur->angle, speed-(spacing/2)); - previ = i; - } + P_SetObjectMomZ(cur, FixedMul(targz - cur->z, FRACUNIT/2), false); + + if (R_PointToDist2(cur->x, cur->y, targx, targy) > 768*FRACUNIT) + P_TeleportMove(cur, targx, targy, cur->z); + + cur = cur->hnext; } } @@ -9308,6 +9300,7 @@ void P_RemoveMobj(mobj_t *mobj) // // Remove any references to other mobjs. P_SetTarget(&mobj->target, P_SetTarget(&mobj->tracer, NULL)); + P_SetTarget(&mobj->hprev, P_SetTarget(&mobj->hnext, NULL)); // free block // DBG: set everything in mobj_t to 0xFF instead of leaving it. debug memory error. diff --git a/src/p_mobj.h b/src/p_mobj.h index 93cdbf0c..096c7762 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -367,7 +367,6 @@ typedef struct mobj_s #endif boolean colorized; // Whether the mobj uses the rainbow colormap - struct mobj_s *mobjtable[10]; // Table of 10 mobj pointers // WARNING: New fields must be added separately to savegame and Lua. } mobj_t; diff --git a/src/p_saveg.c b/src/p_saveg.c index 9ce7708b..cfbeccc9 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -947,11 +947,9 @@ typedef enum MD2_HPREV = 1<<8, #ifdef ESLOPE MD2_SLOPE = 1<<9, - MD2_COLORIZED = 1<<10, - MD2_MOBJTABLE = 1<<11 + MD2_COLORIZED = 1<<10 #else - MD2_COLORIZED = 1<<9, - MD2_MOBJTABLE = 1<<10 + MD2_COLORIZED = 1<<9 #endif } mobj_diff2_t; @@ -1031,7 +1029,6 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type) const mobj_t *mobj = (const mobj_t *)th; UINT32 diff; UINT16 diff2; - UINT16 difft; UINT8 i; // Ignore stationary hoops - these will be respawned from mapthings. @@ -1062,7 +1059,7 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type) else diff = MD_POS | MD_TYPE; // not a map spawned thing so make it from scratch - diff2 = difft = 0; + diff2 = 0; // not the default but the most probable if (mobj->momx != 0 || mobj->momy != 0 || mobj->momz != 0) @@ -1150,14 +1147,6 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type) #endif if (mobj->colorized) diff2 |= MD2_COLORIZED; - for (i = 0; i < 10; i++) - { - if (mobj->mobjtable[i]) - { - diff2 |= MD2_MOBJTABLE; - difft |= ((i > 0) ? (1<colorized); - if (diff2 & MD2_MOBJTABLE) - { - for (i = 0; i < 10; i++) - { - if (difft & ((i > 0) ? (1<mobjtable[i]->mobjnum); - } - } WRITEUINT32(save_p, mobj->mobjnum); } @@ -1959,7 +1938,6 @@ static void LoadMobjThinker(actionf_p1 thinker) mobj_t *mobj; UINT32 diff; UINT16 diff2; - UINT16 difft; INT32 i; fixed_t z, floorz, ceilingz; @@ -1968,10 +1946,6 @@ static void LoadMobjThinker(actionf_p1 thinker) diff2 = READUINT16(save_p); else diff2 = 0; - if (diff2 & MD2_MOBJTABLE) - difft = READUINT16(save_p); - else - difft = 0; next = (void *)(size_t)READUINT32(save_p); @@ -2165,14 +2139,6 @@ static void LoadMobjThinker(actionf_p1 thinker) #endif if (diff2 & MD2_COLORIZED) mobj->colorized = READUINT8(save_p); - if (diff2 & MD2_MOBJTABLE) - { - for (i = 0; i < 10; i++) - { - if (difft & ((i > 0) ? (1<mobjtable[i] = (mobj_t *)(size_t)READUINT32(save_p); - } - } if (diff & MD_REDFLAG) { From ee96b8c7354c035593918e8c2a44a32d45e48b00 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sat, 16 Jun 2018 20:01:25 -0400 Subject: [PATCH 050/293] Add tenfold banana, moved back SPB reach Reuses triple banana's cvar for now --- src/d_player.h | 1 + src/k_kart.c | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 24818372..c6162a5b 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -256,6 +256,7 @@ typedef enum // Additional roulette numbers, only used for K_KartGetItemResult KRITEM_TRIPLESNEAKER = NUMKARTITEMS, KRITEM_TRIPLEBANANA, + KRITEM_TENFOLDBANANA, KRITEM_TRIPLEORBINAUT, KRITEM_DUALJAWZ, diff --git a/src/k_kart.c b/src/k_kart.c index c6065cf6..357627d9 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -366,7 +366,7 @@ boolean K_IsPlayerLosing(player_t *player) static INT32 K_KartItemOddsRace[NUMKARTRESULTS][9] = { //P-Odds 0 1 2 3 4 5 6 7 8 - /*Sneaker*/ {20, 0, 0, 3, 7, 6, 0, 0, 0 }, // Sneaker + /*Sneaker*/ {20, 0, 0, 3, 6, 6, 0, 0, 0 }, // Sneaker /*Rocket Sneaker*/ { 0, 0, 0, 0, 0, 3, 5, 4, 0 }, // Rocket Sneaker /*Invincibility*/ { 0, 0, 0, 0, 0, 1, 6, 9,16 }, // Invincibility /*Banana*/ { 0, 8, 4, 2, 1, 0, 0, 0, 0 }, // Banana @@ -375,7 +375,7 @@ static INT32 K_KartItemOddsRace[NUMKARTRESULTS][9] = /*Jawz*/ { 0, 0, 3, 2, 2, 1, 0, 0, 0 }, // Jawz /*Mine*/ { 0, 1, 1, 2, 1, 0, 0, 0, 0 }, // Mine /*Ballhog*/ { 0, 0, 1, 2, 1, 0, 0, 0, 0 }, // Ballhog - /*Self-Propelled Bomb*/ { 0, 0, 1, 1, 2, 3, 2, 1, 0 }, // Self-Propelled Bomb + /*Self-Propelled Bomb*/ { 0, 0, 0, 1, 2, 3, 3, 2, 1 }, // Self-Propelled Bomb /*Grow*/ { 0, 0, 0, 0, 0, 0, 1, 1, 2 }, // Grow /*Shrink*/ { 0, 0, 0, 0, 0, 0, 1, 2, 2 }, // Shrink /*Lightning Shield*/ { 0, 1, 2, 0, 0, 0, 0, 0, 0 }, // Lightning Shield @@ -384,6 +384,7 @@ static INT32 K_KartItemOddsRace[NUMKARTRESULTS][9] = /*Kitchen Sink*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Kitchen Sink /*Sneaker x3*/ { 0, 0, 0, 0, 3, 8, 7, 4, 0 }, // Sneaker x3 /*Banana x3*/ { 0, 0, 1, 1, 0, 0, 0, 0, 0 }, // Banana x3 + /*Banana x10*/ { 0, 0, 0, 0, 1, 0, 0, 0, 0 }, // Banana x10 /*Orbinaut x3*/ { 0, 0, 0, 1, 1, 1, 0, 0, 0 }, // Orbinaut x3 /*Jawz x2*/ { 0, 0, 0, 1, 1, 0, 0, 0, 0 } // Jawz x2 }; @@ -409,6 +410,7 @@ static INT32 K_KartItemOddsBattle[NUMKARTRESULTS][6] = /*Kitchen Sink*/ { 0, 0, 0, 0, 0, 0 }, // Kitchen Sink /*Sneaker x3*/ { 3, 0, 0, 0, 0, 2 }, // Sneaker x3 /*Banana x3*/ { 0, 2, 2, 1, 1, 2 }, // Banana x3 + /*Banana x10*/ { 0, 0, 0, 0, 0, 0 }, // Banana x10 /*Orbinaut x3*/ { 0, 3, 1, 1, 0, 2 }, // Orbinaut x3 /*Jawz x2*/ { 3, 2, 0, 0, 0, 2 } // Jawz x2 }; @@ -433,6 +435,10 @@ static void K_KartGetItemResult(player_t *player, SINT8 getitem) player->kartstuff[k_itemtype] = KITEM_BANANA; player->kartstuff[k_itemamount] = 3; break; + case KRITEM_TENFOLDBANANA: // Banana x10 + player->kartstuff[k_itemtype] = KITEM_BANANA; + player->kartstuff[k_itemamount] = 10; + break; case KRITEM_TRIPLEORBINAUT: // Orbinaut x3 player->kartstuff[k_itemtype] = KITEM_ORBINAUT; player->kartstuff[k_itemamount] = 3; @@ -592,6 +598,11 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, player_t *player, boolean if (mashed) newodds /= 2; if (!cv_triplebanana.value) newodds = 0; break; + case KRITEM_TENFOLDBANANA: + if (franticitems) newodds *= 2; + if (mashed) newodds /= 2; + if (!cv_triplebanana.value) newodds = 0; + break; case KRITEM_TRIPLEORBINAUT: if (franticitems) newodds *= 2; if (mashed) newodds /= 2; @@ -791,6 +802,7 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd) 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_DUALJAWZ); // Jawz x2 From 3aed1df8ebcc0a6167b93a77db712abdd5570894 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sat, 16 Jun 2018 20:42:47 -0400 Subject: [PATCH 051/293] Fix up fake and mine to use the trail code correctly --- src/k_kart.c | 14 ++++++++------ src/p_inter.c | 21 +++++++++++---------- src/p_mobj.c | 12 ++++++------ 3 files changed, 25 insertions(+), 22 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 357627d9..72ed4645 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3109,14 +3109,14 @@ void K_MoveKartPlayer(player_t *player, boolean onground) player->kartstuff[k_eggmanheld] = 1; player->pflags |= PF_ATTACKDOWN; newangle = player->mo->angle; - newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, 64*FRACUNIT); - newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, 64*FRACUNIT); + newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, mobjinfo[MT_FAKESHIELD].radius); + newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, mobjinfo[MT_FAKESHIELD].radius); mo = P_SpawnMobj(newx, newy, player->mo->z, MT_FAKESHIELD); mo->threshold = 10; + mo->movecount = 1; + mo->lastlook = 1; if (mo) { - mo->scale = FRACUNIT/2; - mo->threshold = 10; P_SetTarget(&mo->target, player->mo); P_SetTarget(&player->mo->hnext, mo); } @@ -3272,10 +3272,12 @@ void K_MoveKartPlayer(player_t *player, boolean onground) player->kartstuff[k_itemheld] = 1; player->pflags |= PF_ATTACKDOWN; newangle = player->mo->angle; - newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, 64*FRACUNIT); - newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, 64*FRACUNIT); + newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, mobjinfo[MT_SSMINE_SHIELD].radius); + newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, mobjinfo[MT_SSMINE_SHIELD].radius); mo = P_SpawnMobj(newx, newy, player->mo->z, MT_SSMINE_SHIELD); mo->threshold = 10; + mo->movecount = 1; + mo->lastlook = 1; if (mo) { P_SetTarget(&mo->target, player->mo); diff --git a/src/p_inter.c b/src/p_inter.c index fd6264c3..2da571e6 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2100,13 +2100,10 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source) if (target->target->player->kartstuff[k_eggmanheld] && target->type == MT_FAKESHIELD) target->target->player->kartstuff[k_eggmanheld] = 0; - if ((target->target->player->kartstuff[k_itemheld]) - && ((target->type == MT_GREENSHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_ORBINAUT) - || (target->type == MT_JAWZ_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_JAWZ) - || (target->type == MT_BANANA_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_BANANA) - || (target->type == MT_SSMINE_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_MINE))) + if (target->target->player->kartstuff[k_itemheld]) { - if ((target->type == MT_BANANA_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_BANANA) + + 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)) { if (target->lastlook != 0 && target->lastlook < target->target->player->kartstuff[k_itemamount]) @@ -2117,17 +2114,21 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source) } else target->target->player->kartstuff[k_itemamount]--; + + if (!target->target->player->kartstuff[k_itemamount]) + target->target->player->kartstuff[k_itemheld] = 0; } - else + else if ((target->type == MT_GREENSHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_ORBINAUT) // orbit items + || (target->type == MT_JAWZ_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_JAWZ)) { if (target->lastlook > 0) target->target->player->kartstuff[k_itemamount] = target->lastlook-1; else target->target->player->kartstuff[k_itemamount]--; - } - if (!target->target->player->kartstuff[k_itemamount]) - target->target->player->kartstuff[k_itemheld] = 0; + if (!target->target->player->kartstuff[k_itemamount]) + target->target->player->kartstuff[k_itemheld] = 0; + } } } // diff --git a/src/p_mobj.c b/src/p_mobj.c index 2880bd1c..6e6c852b 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6689,7 +6689,7 @@ void P_MobjThinker(mobj_t *mobj) } case MT_GREENSHIELD: // Kart orbit items case MT_JAWZ_SHIELD: - if (mobj->health > 0 && mobj->target && mobj->target->player && mobj->target->player->mo + if (mobj->health > 0 && mobj->target && mobj->target->player && mobj->target->player->health > 0 && !mobj->target->player->spectator) { fixed_t z; @@ -6762,7 +6762,7 @@ void P_MobjThinker(mobj_t *mobj) } } else if ((mobj->health > 0 - && (!mobj->target || !mobj->target->player || !mobj->target->player->mo || mobj->target->player->health <= 0 || mobj->target->player->spectator)) + && (!mobj->target || !mobj->target->player || mobj->target->player->health <= 0 || mobj->target->player->spectator)) || (mobj->health <= 0 && mobj->z <= mobj->floorz) || P_CheckDeathPitCollide(mobj)) // When in death state { @@ -6773,7 +6773,7 @@ void P_MobjThinker(mobj_t *mobj) case MT_BANANA_SHIELD: // Kart trailing items case MT_SSMINE_SHIELD: case MT_FAKESHIELD: - if (mobj->health > 0 && mobj->target && mobj->target->player && mobj->target->player->mo + if (mobj->health > 0 && mobj->target && mobj->target->player && mobj->target->player->health > 0 && !mobj->target->player->spectator) { if (mobj->lastlook == 1) @@ -6822,15 +6822,15 @@ void P_MobjThinker(mobj_t *mobj) if ((mobj->type == MT_BANANA_SHIELD && mobj->target->player->kartstuff[k_itemtype] != KITEM_BANANA) || (mobj->type == MT_SSMINE_SHIELD && mobj->target->player->kartstuff[k_itemtype] != KITEM_MINE) || (mobj->type == MT_FAKESHIELD && !mobj->target->player->kartstuff[k_eggmanheld]) - || (mobj->type != MT_FAKESHIELD && !mobj->target->player->kartstuff[k_itemheld]) - || (mobj->lastlook > 0 && mobj->target->player->kartstuff[k_itemamount] < mobj->lastlook)) + || (mobj->type != MT_FAKESHIELD && (!mobj->target->player->kartstuff[k_itemheld] + || (mobj->lastlook > 0 && mobj->target->player->kartstuff[k_itemamount] < mobj->lastlook)))) { P_RemoveMobj(mobj); return; } } else if ((mobj->health > 0 - && (!mobj->target || !mobj->target->player || !mobj->target->player->mo || mobj->target->player->health <= 0 || mobj->target->player->spectator)) + && (!mobj->target || !mobj->target->player || mobj->target->player->health <= 0 || mobj->target->player->spectator)) || (mobj->health <= 0 && mobj->z <= mobj->floorz) || P_CheckDeathPitCollide(mobj)) // When in death state { From 2497d9c96c9313aa1b59fe6da0d536fd1f982b18 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 17 Jun 2018 18:10:42 -0400 Subject: [PATCH 052/293] Debug checkpoint, and prevent spinout/booster timers while in the air --- src/d_netcmd.c | 1 + src/d_netcmd.h | 2 +- src/k_kart.c | 19 ++++++++++++++++--- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index da91032e..412de131 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -369,6 +369,7 @@ 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", CV_CHEAT, 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}; diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 262e4122..78815cb1 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -129,7 +129,7 @@ extern consvar_t cv_kartspeedometer; extern consvar_t cv_votetime; -extern consvar_t cv_kartdebugitem, cv_kartdebugamount; +extern consvar_t cv_kartdebugitem, cv_kartdebugamount, cv_kartdebugcheckpoint; extern consvar_t cv_itemfinder; diff --git a/src/k_kart.c b/src/k_kart.c index 72ed4645..a1284539 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -330,6 +330,7 @@ void K_RegisterKartStuff(void) CV_RegisterVar(&cv_kartdebugitem); CV_RegisterVar(&cv_kartdebugamount); + CV_RegisterVar(&cv_kartdebugcheckpoint); } //} @@ -2423,10 +2424,10 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) player->mo->colorized = false; } - if (player->kartstuff[k_spinout]) + if (player->kartstuff[k_spinout] && P_IsObjectOnGround(player->mo)) player->kartstuff[k_spinout]--; - if (player->kartstuff[k_spinouttimer]) + if (player->kartstuff[k_spinouttimer] && P_IsObjectOnGround(player->mo)) player->kartstuff[k_spinouttimer]--; else if (!comeback) player->kartstuff[k_comebacktimer] = comebacktime; @@ -2443,7 +2444,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) if (player->kartstuff[k_attractiontimer]) player->kartstuff[k_attractiontimer]--; - if (player->kartstuff[k_sneakertimer]) + if (player->kartstuff[k_sneakertimer] && P_IsObjectOnGround(player->mo)) player->kartstuff[k_sneakertimer]--; if (player->kartstuff[k_floorboost]) @@ -4966,6 +4967,15 @@ static void K_drawLapLakitu(void) V_DrawSmallScaledPatch(LAKI_X+14+(swoopTimer/4), LAKI_Y + adjustY, V_SNAPTOTOP, localpatch); } +static void K_drawCheckpointDebugger(void) +{ + if ((numstarposts/2 + stplyr->starpostnum) >= numstarposts) + V_DrawString(8, 184, 0, va("Checkpoint: %d / %d (Can finish)", stplyr->starpostnum, numstarposts)); + else + V_DrawString(8, 184, 0, va("Checkpoint: %d / %d (Skip: %d)", stplyr->starpostnum, numstarposts, (numstarposts/2 + stplyr->starpostnum))); + V_DrawString(8, 192, 0, va("Waypoint dist: Prev %d, Next %d", stplyr->kartstuff[k_prevcheck], stplyr->kartstuff[k_nextcheck])); +} + void K_drawKartHUD(void) { // Define the X and Y for each drawn object @@ -5052,6 +5062,9 @@ void K_drawKartHUD(void) K_drawKartBalloonsOrKarma(); } } + + if (cv_kartdebugcheckpoint.value) + K_drawCheckpointDebugger(); } //} From e2f60d56d2b47a0c09832c656aed6c9e69a025c4 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 17 Jun 2018 20:26:13 -0400 Subject: [PATCH 053/293] Fix --- src/k_kart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index a1284539..4986e743 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2427,7 +2427,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) if (player->kartstuff[k_spinout] && P_IsObjectOnGround(player->mo)) player->kartstuff[k_spinout]--; - if (player->kartstuff[k_spinouttimer] && P_IsObjectOnGround(player->mo)) + if (player->kartstuff[k_spinouttimer] && (P_IsObjectOnGround(player->mo) || player->kartstuff[k_spinouttype])) player->kartstuff[k_spinouttimer]--; else if (!comeback) player->kartstuff[k_comebacktimer] = comebacktime; @@ -2444,7 +2444,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) if (player->kartstuff[k_attractiontimer]) player->kartstuff[k_attractiontimer]--; - if (player->kartstuff[k_sneakertimer] && P_IsObjectOnGround(player->mo)) + if (player->kartstuff[k_sneakertimer] && (P_IsObjectOnGround(player->mo) && !player->kartstuff[k_spinouttimer])) player->kartstuff[k_sneakertimer]--; if (player->kartstuff[k_floorboost]) From 612b2a151fdfe173fccf29af85000265dab7a13e Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 18 Jun 2018 00:42:53 -0400 Subject: [PATCH 054/293] Misc tweaks just about everywhere - More Jawz states for later - Jawz orbit their user in the right direction now. - Banana trails made closer to each other - wheels.lua hardcoded - All held items take a double press, for consistency. - Fixed Karma Items not being able to be collected by invincibility or hyudoro users --- src/d_player.h | 2 +- src/dehacked.c | 25 ++++++++- src/info.c | 96 +++++++++++++++++++++++--------- src/info.h | 25 ++++++++- src/k_kart.c | 148 ++++++++++++++----------------------------------- src/p_inter.c | 42 +++++++------- src/p_map.c | 6 +- src/p_mobj.c | 81 +++++++++++++++++++++++---- src/p_saveg.c | 1 - src/p_spec.c | 10 +--- src/sounds.c | 2 +- 11 files changed, 254 insertions(+), 184 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index c6162a5b..d02a3947 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -303,7 +303,7 @@ typedef enum // Item held stuff k_itemtype, // KITEM_ constant for item number k_itemamount, // Amount of said item - k_itemheld, // Are you holding an item? 1 = normal hold, 2 = rotation hold + k_itemheld, // Are you holding an item? // Some items use timers for their duration or effects k_attractiontimer, // Duration of Lightning Shield's item-break and item box pull diff --git a/src/dehacked.c b/src/dehacked.c index 515225dc..1078da51 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6325,8 +6325,24 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_DEADGREEN", //} //{ Jawz - "S_JAWZ", - "S_JAWZ_SHIELD", + "S_JAWZ1", + "S_JAWZ2", + "S_JAWZ3", + "S_JAWZ4", + "S_JAWZ5", + "S_JAWZ6", + "S_JAWZ_DUD1", + "S_JAWZ_DUD2", + "S_JAWZ_DUD3", + "S_JAWZ_DUD4", + "S_JAWZ_DUD5", + "S_JAWZ_DUD6", + "S_JAWZ_SHIELD1", + "S_JAWZ_SHIELD2", + "S_JAWZ_SHIELD3", + "S_JAWZ_SHIELD4", + "S_JAWZ_SHIELD5", + "S_JAWZ_SHIELD6", "S_JAWZ_DEAD", //} @@ -6583,7 +6599,8 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_PLAYERBOMB", // Player bomb overlay "S_PLAYERITEM", // Player item overlay - "S_PLAYERBOMB_WHEEL", + + "S_KARMAWHEEL", // Karma player wheels #ifdef SEENAMES "S_NAMECHECK", @@ -7212,7 +7229,9 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_FIREDITEM", "MT_PLAYERARROW", + "MT_KARMAHITBOX", + "MT_KARMAWHEEL", #ifdef SEENAMES "MT_NAMECHECK", diff --git a/src/info.c b/src/info.c index 834dcf0a..89ad9b4c 100644 --- a/src/info.c +++ b/src/info.c @@ -2638,27 +2638,43 @@ state_t states[NUMSTATES] = {SPR_BANA, 0, -1, {NULL}, 0, 0, S_NULL}, // S_BANANA {SPR_BANA, 1, 175, {NULL}, 0, 0, S_NULL}, // S_BANANA_DEAD - {SPR_GSHE, 0, 1, {NULL}, 0, 0, S_GREENSHIELD2}, // S_GREENSHIELD1 - {SPR_GSHE, 1, 1, {NULL}, 0, 0, S_GREENSHIELD3}, // S_GREENSHIELD2 - {SPR_GSHE, 2, 1, {NULL}, 0, 0, S_GREENSHIELD4}, // S_GREENSHIELD3 - {SPR_GSHE, 3, 1, {NULL}, 0, 0, S_GREENSHIELD5}, // S_GREENSHIELD4 - {SPR_GSHE, 4, 1, {NULL}, 0, 0, S_GREENSHIELD6}, // S_GREENSHIELD5 - {SPR_GSHE, 5, 1, {NULL}, 0, 0, S_GREENSHIELD7}, // S_GREENSHIELD6 - {SPR_GSHE, 6, 1, {NULL}, 0, 0, S_GREENSHIELD8}, // S_GREENSHIELD7 - {SPR_GSHE, 7, 1, {NULL}, 0, 0, S_GREENSHIELD1}, // S_GREENSHIELD8 - {SPR_GSHE, 0, 1, {NULL}, 0, 0, S_GREENITEM2}, // S_GREENITEM1 - {SPR_GSHE, 1, 1, {NULL}, 0, 0, S_GREENITEM3}, // S_GREENITEM2 - {SPR_GSHE, 2, 1, {NULL}, 0, 0, S_GREENITEM4}, // S_GREENITEM3 - {SPR_GSHE, 3, 1, {NULL}, 0, 0, S_GREENITEM5}, // S_GREENITEM4 - {SPR_GSHE, 4, 1, {NULL}, 0, 0, S_GREENITEM6}, // S_GREENITEM5 - {SPR_GSHE, 5, 1, {NULL}, 0, 0, S_GREENITEM7}, // S_GREENITEM6 - {SPR_GSHE, 6, 1, {NULL}, 0, 0, S_GREENITEM8}, // S_GREENITEM7 - {SPR_GSHE, 7, 1, {NULL}, 0, 0, S_GREENITEM1}, // S_GREENITEM8 - {SPR_GSHE, 8, 175, {NULL}, 0, 0, S_NULL}, // S_DEADGREEN + {SPR_GSHE, 0, 1, {NULL}, 0, 0, S_GREENSHIELD2}, // S_GREENSHIELD1 + {SPR_GSHE, 1, 1, {NULL}, 0, 0, S_GREENSHIELD3}, // S_GREENSHIELD2 + {SPR_GSHE, 2, 1, {NULL}, 0, 0, S_GREENSHIELD4}, // S_GREENSHIELD3 + {SPR_GSHE, 3, 1, {NULL}, 0, 0, S_GREENSHIELD5}, // S_GREENSHIELD4 + {SPR_GSHE, 4, 1, {NULL}, 0, 0, S_GREENSHIELD6}, // S_GREENSHIELD5 + {SPR_GSHE, 5, 1, {NULL}, 0, 0, S_GREENSHIELD7}, // S_GREENSHIELD6 + {SPR_GSHE, 6, 1, {NULL}, 0, 0, S_GREENSHIELD8}, // S_GREENSHIELD7 + {SPR_GSHE, 7, 1, {NULL}, 0, 0, S_GREENSHIELD1}, // S_GREENSHIELD8 + {SPR_GSHE, 0, 1, {NULL}, 0, 0, S_GREENITEM2}, // S_GREENITEM1 + {SPR_GSHE, 1, 1, {NULL}, 0, 0, S_GREENITEM3}, // S_GREENITEM2 + {SPR_GSHE, 2, 1, {NULL}, 0, 0, S_GREENITEM4}, // S_GREENITEM3 + {SPR_GSHE, 3, 1, {NULL}, 0, 0, S_GREENITEM5}, // S_GREENITEM4 + {SPR_GSHE, 4, 1, {NULL}, 0, 0, S_GREENITEM6}, // S_GREENITEM5 + {SPR_GSHE, 5, 1, {NULL}, 0, 0, S_GREENITEM7}, // S_GREENITEM6 + {SPR_GSHE, 6, 1, {NULL}, 0, 0, S_GREENITEM8}, // S_GREENITEM7 + {SPR_GSHE, 7, 1, {NULL}, 0, 0, S_GREENITEM1}, // S_GREENITEM8 + {SPR_GSHE, 8, 175, {NULL}, 0, 0, S_NULL}, // S_DEADGREEN - {SPR_JAWZ, 0, 1, {A_JawzChase}, 0, 0, S_JAWZ}, // S_JAWZ - {SPR_JAWZ, 0, 1, {NULL}, 0, 0, S_JAWZ_SHIELD}, // S_JAWZ_SHIELD - {SPR_JAWZ, 0, 1, {NULL}, 0, 0, S_NULL}, // S_JAWZ_DEAD + {SPR_JAWZ, 0, 1, {A_JawzChase}, 0, 0, S_JAWZ2}, // S_JAWZ1 + {SPR_JAWZ, 3, 1, {A_JawzChase}, 0, 0, S_JAWZ3}, // S_JAWZ2 + {SPR_JAWZ, 1, 1, {A_JawzChase}, 0, 0, S_JAWZ4}, // S_JAWZ3 + {SPR_JAWZ, 3, 1, {A_JawzChase}, 0, 0, S_JAWZ5}, // S_JAWZ4 + {SPR_JAWZ, 2, 1, {A_JawzChase}, 0, 0, S_JAWZ6}, // S_JAWZ5 + {SPR_JAWZ, 3, 1, {A_JawzChase}, 0, 0, S_JAWZ1}, // S_JAWZ6 + {SPR_JAWZ, 0, 1, {NULL}, 0, 0, S_JAWZ_DUD2}, // S_JAWZ_DUD1 + {SPR_JAWZ, 3, 1, {NULL}, 0, 0, S_JAWZ_DUD3}, // S_JAWZ_DUD2 + {SPR_JAWZ, 1, 1, {NULL}, 0, 0, S_JAWZ_DUD4}, // S_JAWZ_DUD3 + {SPR_JAWZ, 3, 1, {NULL}, 0, 0, S_JAWZ_DUD5}, // S_JAWZ_DUD4 + {SPR_JAWZ, 2, 1, {NULL}, 0, 0, S_JAWZ_DUD6}, // S_JAWZ_DUD5 + {SPR_JAWZ, 3, 1, {NULL}, 0, 0, S_JAWZ_DUD1}, // S_JAWZ_DUD6 + {SPR_JAWZ, 4, 1, {NULL}, 0, 0, S_JAWZ_SHIELD2}, // S_JAWZ_SHIELD1 + {SPR_JAWZ, 7, 1, {NULL}, 0, 0, S_JAWZ_SHIELD3}, // S_JAWZ_SHIELD2 + {SPR_JAWZ, 5, 1, {NULL}, 0, 0, S_JAWZ_SHIELD4}, // S_JAWZ_SHIELD3 + {SPR_JAWZ, 7, 1, {NULL}, 0, 0, S_JAWZ_SHIELD5}, // S_JAWZ_SHIELD4 + {SPR_JAWZ, 6, 1, {NULL}, 0, 0, S_JAWZ_SHIELD6}, // S_JAWZ_SHIELD5 + {SPR_JAWZ, 7, 1, {NULL}, 0, 0, S_JAWZ_SHIELD1}, // S_JAWZ_SHIELD6 + {SPR_JAWZ, 8, 175, {NULL}, 0, 0, S_NULL}, // S_JAWZ_DEAD {SPR_FBLL, 13, 3, {NULL}, 0, 0, S_FIRETRAIL2}, // S_FIRETRAIL1 {SPR_FBLL, 14, 3, {NULL}, 0, 0, S_FIRETRAIL3}, // S_FIRETRAIL2 @@ -2899,7 +2915,8 @@ state_t states[NUMSTATES] = {SPR_PBOM, FF_ANIMATE, -1, {NULL}, 3, 3, S_NULL}, // S_PLAYERBOMB {SPR_RNDM, FF_ANIMATE, -1, {NULL}, 23, 3, S_NULL}, // S_PLAYERITEM - {SPR_PBOM, 4, -1, {NULL}, 0, 0, S_NULL}, // S_PLAYERWHEEL + + {SPR_PBOM, 4, -1, {NULL}, 0, 0, S_NULL}, // S_KARMAWHEEL #ifdef SEENAMES {SPR_NULL, 0, 1, {NULL}, 0, 0, S_NULL}, // S_NAMECHECK @@ -14483,7 +14500,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { // MT_BANANA -1, // doomednum - S_BANANA, // spawnstate + S_BANANA, // spawnstate 2, // spawnhealth S_NULL, // seestate sfx_tossed, // seesound @@ -14494,7 +14511,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_BANANA_DEAD, // deathstate + S_BANANA_DEAD, // deathstate S_NULL, // xdeathstate sfx_None, // deathsound 0, // speed @@ -14618,7 +14635,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { // MT_JAWZ -1, // doomednum - S_JAWZ, // spawnstate + S_JAWZ1, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_tossed, // seesound @@ -14645,7 +14662,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { // MT_JAWZ_DUD -1, // doomednum - S_JAWZ, // spawnstate + S_JAWZ_DUD1, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_tossed, // seesound @@ -14672,7 +14689,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { // MT_JAWZ_SHIELD -1, // doomednum - S_JAWZ_SHIELD, // spawnstate + S_JAWZ_SHIELD1, // spawnstate 1000, // spawnhealth S_NULL, // seestate sfx_None, // seesound @@ -16587,6 +16604,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_KARMAWHEEL + -1, // doomednum + S_KARMAWHEEL, // spawnstate + 1000, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 8*FRACUNIT, // radius + 16*FRACUNIT, // height + 0, // display offset + 0, // mass + 0, // damage + sfx_None, // activesound + MF_NOTHINK|MF_NOCLIP|MF_NOCLIPHEIGHT, // flags + S_NULL // raisestate + }, + // ============================================================================================================================// #ifdef SEENAMES diff --git a/src/info.h b/src/info.h index cea05a6e..3a02f63c 100644 --- a/src/info.h +++ b/src/info.h @@ -3167,8 +3167,24 @@ typedef enum state S_DEADGREEN, //} //{ Jawz - S_JAWZ, - S_JAWZ_SHIELD, + S_JAWZ1, + S_JAWZ2, + S_JAWZ3, + S_JAWZ4, + S_JAWZ5, + S_JAWZ6, + S_JAWZ_DUD1, + S_JAWZ_DUD2, + S_JAWZ_DUD3, + S_JAWZ_DUD4, + S_JAWZ_DUD5, + S_JAWZ_DUD6, + S_JAWZ_SHIELD1, + S_JAWZ_SHIELD2, + S_JAWZ_SHIELD3, + S_JAWZ_SHIELD4, + S_JAWZ_SHIELD5, + S_JAWZ_SHIELD6, S_JAWZ_DEAD, //} @@ -3425,7 +3441,8 @@ typedef enum state S_PLAYERBOMB, S_PLAYERITEM, - S_PLAYERWHEEL, + + S_KARMAWHEEL, #ifdef SEENAMES S_NAMECHECK, @@ -4071,7 +4088,9 @@ typedef enum mobj_type MT_FIREDITEM, MT_PLAYERARROW, + MT_KARMAHITBOX, + MT_KARMAWHEEL, #ifdef SEENAMES MT_NAMECHECK, diff --git a/src/k_kart.c b/src/k_kart.c index 4986e743..b5486c77 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2079,7 +2079,7 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map dir = defaultDir; } - if (missile) + if (missile) // Shootables { if (mapthing == MT_FIREBALL) // Messy { @@ -2102,7 +2102,7 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + 0x06000000, 0, PROJSPEED); } } - else // Shells + else { if (dir == -1) { @@ -2986,14 +2986,15 @@ void K_MoveKartPlayer(player_t *player, boolean onground) if (player && player->mo && player->mo->health > 0 && !player->spectator && !player->exiting && player->kartstuff[k_spinouttimer] == 0) { - // Eggman Monitor dropping - if (!(cmd->buttons & BT_ATTACK) && player->kartstuff[k_eggmanheld]) + // First, the really specific, finicky items that function without the item being directly in your item slot. + // Eggman Monitor throwing + if (ATTACK_IS_DOWN && player->kartstuff[k_eggmanheld]) { K_ThrowKartItem(player, false, MT_FAKEITEM, -1, false); K_PlayTauntSound(player->mo); player->kartstuff[k_eggmanheld] = 0; } - // Rocket Sneaker power + // Rocket Sneaker else if (ATTACK_IS_DOWN && !HOLDING_ITEM && onground && NO_HYUDORO && player->kartstuff[k_rocketsneakertimer] > 1) { @@ -3052,13 +3053,8 @@ void K_MoveKartPlayer(player_t *player, boolean onground) mobj_t *mo; mobj_t *prev = NULL; - if (player->kartstuff[k_itemamount] > 1) - { - K_PlayTauntSound(player->mo); - player->kartstuff[k_itemheld] = 2; - } - else - player->kartstuff[k_itemheld] = 1; + //K_PlayTauntSound(player->mo); + player->kartstuff[k_itemheld] = 1; player->pflags |= PF_ATTACKDOWN; for (moloop = 0; moloop < player->kartstuff[k_itemamount]; moloop++) @@ -3082,14 +3078,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) prev = mo; } } - else if (!(cmd->buttons & BT_ATTACK) && player->kartstuff[k_itemheld] == 1) - { - K_ThrowKartItem(player, false, MT_BANANA, -1, false); - K_PlayTauntSound(player->mo); - player->kartstuff[k_itemamount]--; - player->kartstuff[k_itemheld] = 0; - } - else if (ATTACK_IS_DOWN && player->kartstuff[k_itemheld] == 2) // Banana x3 thrown + else if (ATTACK_IS_DOWN && player->kartstuff[k_itemheld]) // Banana x3 thrown { K_ThrowKartItem(player, false, MT_BANANA, -1, false); K_PlayTauntSound(player->mo); @@ -3126,61 +3115,34 @@ void K_MoveKartPlayer(player_t *player, boolean onground) case KITEM_ORBINAUT: if (ATTACK_IS_DOWN && !HOLDING_ITEM && NO_HYUDORO) { - /*if (player->kartstuff[k_itemamount] == 1) // Orbinaut x1 held + INT32 moloop; + + player->kartstuff[k_itemheld] = 1; + player->pflags |= PF_ATTACKDOWN; + //K_PlayTauntSound(player->mo); + S_StartSound(player->mo, sfx_s3k3a); + + for (moloop = 0; moloop < player->kartstuff[k_itemamount]; moloop++) { angle_t newangle; fixed_t newx; fixed_t newy; mobj_t *mo; - player->kartstuff[k_itemheld] = 1; - player->pflags |= PF_ATTACKDOWN; + newangle = player->mo->angle; newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, 64*FRACUNIT); newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, 64*FRACUNIT); mo = P_SpawnMobj(newx, newy, player->mo->z, MT_GREENSHIELD); - mo->threshold = 10; if (mo) - P_SetTarget(&mo->target, player->mo); - } - else if (player->kartstuff[k_itemamount] > 1) // Orbinaut x3 held - {*/ - INT32 moloop; - - player->kartstuff[k_itemheld] = 2; - player->pflags |= PF_ATTACKDOWN; - //K_PlayTauntSound(player->mo); - S_StartSound(player->mo, sfx_s3k3a); - - for (moloop = 0; moloop < player->kartstuff[k_itemamount]; moloop++) { - angle_t newangle; - fixed_t newx; - fixed_t newy; - mobj_t *mo; - - newangle = player->mo->angle; - newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, 64*FRACUNIT); - newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, 64*FRACUNIT); - mo = P_SpawnMobj(newx, newy, player->mo->z, MT_GREENSHIELD); - if (mo) - { - mo->threshold = 10; - mo->lastlook = moloop+1; - P_SetTarget(&mo->target, player->mo); - mo->angle = FixedAngle(((360/player->kartstuff[k_itemamount])*moloop)*FRACUNIT); - } + mo->threshold = 10; + mo->lastlook = moloop+1; + P_SetTarget(&mo->target, player->mo); + mo->angle = FixedAngle(((360/player->kartstuff[k_itemamount])*moloop)*FRACUNIT) + ANGLE_90; } - //} + } } - else if (!(cmd->buttons & BT_ATTACK) && player->kartstuff[k_itemheld] == 1) - { - player->kartstuff[k_itemamount]--; - player->kartstuff[k_itemheld] = 0; - - K_ThrowKartItem(player, true, MT_GREENITEM, 1, false); - K_PlayTauntSound(player->mo); - } - else if (ATTACK_IS_DOWN && player->kartstuff[k_itemheld] == 2) // Orbinaut x3 thrown + else if (ATTACK_IS_DOWN && player->kartstuff[k_itemheld]) // Orbinaut x3 thrown { K_ThrowKartItem(player, true, MT_GREENITEM, 1, false); K_PlayTauntSound(player->mo); @@ -3194,63 +3156,34 @@ void K_MoveKartPlayer(player_t *player, boolean onground) case KITEM_JAWZ: if (ATTACK_IS_DOWN && !HOLDING_ITEM && NO_HYUDORO) { - /*if (player->kartstuff[k_itemamount] == 1) // Jawz x1 held + INT32 moloop; + + player->kartstuff[k_itemheld] = 1; + player->pflags |= PF_ATTACKDOWN; + //K_PlayTauntSound(player->mo); + S_StartSound(player->mo, sfx_s3k3a); + + for (moloop = 0; moloop < player->kartstuff[k_itemamount]; moloop++) { angle_t newangle; fixed_t newx; fixed_t newy; mobj_t *mo; - player->kartstuff[k_itemheld] = 1; - player->pflags |= PF_ATTACKDOWN; + newangle = player->mo->angle; newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, 64*FRACUNIT); newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, 64*FRACUNIT); mo = P_SpawnMobj(newx, newy, player->mo->z, MT_JAWZ_SHIELD); - mo->threshold = 10; if (mo) - P_SetTarget(&mo->target, player->mo); - } - else if (player->kartstuff[k_itemamount] > 1) // Jawz x2 held - {*/ - INT32 moloop; - - player->kartstuff[k_itemheld] = 2; - player->pflags |= PF_ATTACKDOWN; - //K_PlayTauntSound(player->mo); - S_StartSound(player->mo, sfx_s3k3a); - - for (moloop = 0; moloop < player->kartstuff[k_itemamount]; moloop++) { - angle_t newangle; - fixed_t newx; - fixed_t newy; - mobj_t *mo; - - newangle = player->mo->angle; - newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, 64*FRACUNIT); - newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, 64*FRACUNIT); - mo = P_SpawnMobj(newx, newy, player->mo->z, MT_JAWZ_SHIELD); - if (mo) - { - mo->threshold = 10; - mo->lastlook = moloop+1; - P_SetTarget(&mo->target, player->mo); - mo->angle = FixedAngle(((360/player->kartstuff[k_itemamount])*moloop)*FRACUNIT); - } + mo->threshold = 10; + mo->lastlook = moloop+1; + P_SetTarget(&mo->target, player->mo); + mo->angle = FixedAngle(((360/player->kartstuff[k_itemamount])*moloop)*FRACUNIT) + ANGLE_90; } - //} + } } - else if (!(cmd->buttons & BT_ATTACK) && HOLDING_ITEM && player->kartstuff[k_itemheld] == 1) // Jawz x1 thrown - { - player->kartstuff[k_itemamount]--; - player->kartstuff[k_itemheld] = 0; - if (player->kartstuff[k_throwdir] == 1 || player->kartstuff[k_throwdir] == 0) - K_ThrowKartItem(player, true, MT_JAWZ, 1, false); - 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_PlayTauntSound(player->mo); - } - else if (ATTACK_IS_DOWN && HOLDING_ITEM && player->kartstuff[k_itemheld] == 2) // Jawz x2 thrown + 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); @@ -3258,6 +3191,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) K_ThrowKartItem(player, true, MT_JAWZ_DUD, -1, false); K_PlayTauntSound(player->mo); player->pflags |= PF_ATTACKDOWN; + player->kartstuff[k_itemamount]--; if (!player->kartstuff[k_itemamount]) player->kartstuff[k_itemheld] = 0; @@ -3285,7 +3219,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) P_SetTarget(&player->mo->hnext, mo); } } - else if (!(cmd->buttons & BT_ATTACK) && HOLDING_ITEM) + else if (!(cmd->buttons & BT_ATTACK) && HOLDING_ITEM && player->kartstuff[k_itemheld]) { K_ThrowKartItem(player, false, MT_SSMINE, 1, true); K_PlayTauntSound(player->mo); diff --git a/src/p_inter.c b/src/p_inter.c index 2da571e6..84e567bf 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -427,10 +427,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) return; if (player == special->target->player) return; - if (player->kartstuff[k_growshrinktimer] || player->kartstuff[k_squishedtimer] - || player->kartstuff[k_hyudorotimer] || player->kartstuff[k_spinouttimer] - || player->kartstuff[k_invincibilitytimer] || player->powers[pw_flashing] - || player->kartstuff[k_balloon] <= 0) + if (player->kartstuff[k_balloon] <= 0) return; if (special->target->player->kartstuff[k_comebacktimer] @@ -440,25 +437,32 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if (special->target->player->kartstuff[k_comebackmode] == 0) { - mobj_t *boom = P_SpawnMobj(special->target->x, special->target->y, special->target->z, MT_BOOMPARTICLE); - boom->scale = special->target->scale; - boom->destscale = special->target->scale; - boom->momz = 5*FRACUNIT; - if (special->target->color) - boom->color = special->target->color; + if (player->kartstuff[k_growshrinktimer] || player->kartstuff[k_squishedtimer] + || player->kartstuff[k_hyudorotimer] || player->kartstuff[k_spinouttimer] + || player->kartstuff[k_invincibilitytimer] || player->powers[pw_flashing]) + return; else - boom->color = SKINCOLOR_RED; - S_StartSound(boom, special->info->attacksound); + { + mobj_t *boom = P_SpawnMobj(special->target->x, special->target->y, special->target->z, MT_BOOMPARTICLE); + boom->scale = special->target->scale; + boom->destscale = special->target->scale; + boom->momz = 5*FRACUNIT; + if (special->target->color) + boom->color = special->target->color; + else + boom->color = SKINCOLOR_RED; + S_StartSound(boom, special->info->attacksound); - K_ExplodePlayer(player, special->target); + K_ExplodePlayer(player, special->target); - special->target->player->kartstuff[k_comebackpoints] += 2; - if (netgame && cv_hazardlog.value) - CONS_Printf(M_GetText("%s bombed %s!\n"), player_names[special->target->player-players], player_names[player-players]); - if (special->target->player->kartstuff[k_comebackpoints] >= 3) - K_StealBalloon(special->target->player, player, true); + special->target->player->kartstuff[k_comebackpoints] += 2; + if (netgame && cv_hazardlog.value) + CONS_Printf(M_GetText("%s bombed %s!\n"), player_names[special->target->player-players], player_names[player-players]); + if (special->target->player->kartstuff[k_comebackpoints] >= 3) + K_StealBalloon(special->target->player, player, true); - special->target->player->kartstuff[k_comebacktimer] = comebacktime; + special->target->player->kartstuff[k_comebacktimer] = comebacktime; + } } else if (special->target->player->kartstuff[k_comebackmode] == 1 && P_CanPickupItem(player, true)) { diff --git a/src/p_map.c b/src/p_map.c index 392c6443..e6c07afa 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1633,13 +1633,11 @@ static boolean PIT_CheckThing(mobj_t *thing) if (thing->player->kartstuff[k_growshrinktimer] || thing->player->kartstuff[k_squishedtimer] || thing->player->kartstuff[k_hyudorotimer] || thing->player->kartstuff[k_spinouttimer] || thing->player->kartstuff[k_invincibilitytimer] || thing->player->kartstuff[k_justbumped] - || (G_BattleGametype() && (thing->player->kartstuff[k_balloon] <= 0 - && (thing->player->kartstuff[k_comebacktimer]))) + || (G_BattleGametype() && thing->player->kartstuff[k_balloon] <= 0) || tmthing->player->kartstuff[k_growshrinktimer] || tmthing->player->kartstuff[k_squishedtimer] || tmthing->player->kartstuff[k_hyudorotimer] || tmthing->player->kartstuff[k_spinouttimer] || tmthing->player->kartstuff[k_invincibilitytimer] || tmthing->player->kartstuff[k_justbumped] - || (G_BattleGametype() && (tmthing->player->kartstuff[k_balloon] <= 0 - && (tmthing->player->kartstuff[k_comebacktimer])))) + || (G_BattleGametype() && tmthing->player->kartstuff[k_balloon] <= 0)) { return true; } diff --git a/src/p_mobj.c b/src/p_mobj.c index 6e6c852b..fb1da70a 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6695,11 +6695,8 @@ void P_MobjThinker(mobj_t *mobj) fixed_t z; const fixed_t radius = FixedHypot(mobj->target->radius, mobj->target->radius) + FixedHypot(mobj->radius, mobj->radius); // mobj's distance from its Target, or Radius. - //mobj->angle += FixedAngle(12*FRACUNIT); // mobj's actual speed. - if (mobj->lastlook > 0) - mobj->angle += FixedAngle(mobj->info->speed); - else - mobj->angle = (mobj->target->angle + ANGLE_180); + mobj->angle -= ANGLE_90; + mobj->angle += FixedAngle(mobj->info->speed); // If the player is on the ceiling, then flip your items as well. if (mobj->target->player && mobj->target->eflags & MFE_VERTICALFLIP) @@ -6750,6 +6747,7 @@ void P_MobjThinker(mobj_t *mobj) } mobj->z = z; mobj->momx = mobj->momy = 0; + mobj->angle += ANGLE_90; // Was this so hard? if ((mobj->type == MT_GREENSHIELD && mobj->target->player->kartstuff[k_itemtype] != KITEM_ORBINAUT) @@ -6778,7 +6776,7 @@ void P_MobjThinker(mobj_t *mobj) { if (mobj->lastlook == 1) { - const fixed_t spacing = FixedMul(mobj->info->radius, mobj->target->scale); + const fixed_t spacing = FixedMul(3*mobj->info->radius/2, mobj->target->scale); mobj_t *cur = mobj; mobj_t *targ = mobj->target; @@ -6789,27 +6787,31 @@ void P_MobjThinker(mobj_t *mobj) fixed_t targy; fixed_t targz; fixed_t speed; + fixed_t dist = spacing; if (cur != mobj) + { targ = cur->hprev; + dist = spacing/2; + } if (!targ || P_MobjWasRemoved(targ)) continue; ang = targ->angle; - targx = targ->x + P_ReturnThrustX(cur, ang + ANGLE_180, spacing); - targy = targ->y + P_ReturnThrustY(cur, ang + ANGLE_180, spacing); + targx = targ->x + P_ReturnThrustX(cur, ang + ANGLE_180, dist); + targy = targ->y + P_ReturnThrustY(cur, ang + ANGLE_180, dist); targz = targ->z; - speed = FixedMul(R_PointToDist2(cur->x, cur->y, targx, targy), FRACUNIT/2); + speed = FixedMul(R_PointToDist2(cur->x, cur->y, targx, targy), 3*FRACUNIT/4); if (P_IsObjectOnGround(targ)) targz = cur->floorz; cur->angle = R_PointToAngle2(cur->x, cur->y, targx, targy); - if (speed > spacing/2) - P_InstaThrust(cur, cur->angle, speed-(spacing/2)); + if (speed > dist) + P_InstaThrust(cur, cur->angle, speed-dist); - P_SetObjectMomZ(cur, FixedMul(targz - cur->z, FRACUNIT/2), false); + P_SetObjectMomZ(cur, FixedMul(targz - cur->z, 3*FRACUNIT/4) - gravity, false); if (R_PointToDist2(cur->x, cur->y, targx, targy) > 768*FRACUNIT) P_TeleportMove(cur, targx, targy, cur->z); @@ -8240,6 +8242,32 @@ void P_MobjThinker(mobj_t *mobj) else mobj->flags2 &= ~MF2_DONTDRAW; } + + // Now for the wheels + { + const fixed_t rad = mobjinfo[MT_PLAYER].radius; + mobj_t *cur = mobj->hnext; + + while (cur && !P_MobjWasRemoved(cur)) + { + fixed_t offx = rad; + fixed_t offy = rad; + + if (cur->lastlook == 1 || cur->lastlook == 3) + offx *= -1; + if (cur->lastlook == 2 || cur->lastlook == 3) + offy *= -1; + + P_TeleportMove(cur, mobj->x + offx, mobj->y + offy, mobj->z); + + if (mobj->flags2 & MF2_DONTDRAW) + cur->flags2 |= MF2_DONTDRAW; + else + cur->flags2 &= ~MF2_DONTDRAW; + + cur = cur->hnext; + } + } break; //} case MT_TURRET: @@ -9001,6 +9029,35 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) case MT_BLUEBALL: nummaprings++; break; + case MT_KARMAHITBOX: // SRB2Kart + { + const fixed_t rad = mobjinfo[MT_PLAYER].radius; + mobj_t *cur, *prev = mobj; + INT32 i; + + for (i = 0; i < 4; i++) + { + fixed_t offx = rad; + fixed_t offy = rad; + + if (i == 1 || i == 3) + offx *= -1; + if (i == 2 || i == 3) + offy *= -1; + + cur = P_SpawnMobj(mobj->x + offx, mobj->y + offy, mobj->z, MT_KARMAWHEEL); + cur->destscale = mobj->scale; + P_SetScale(cur, mobj->scale); + + cur->lastlook = i; + + P_SetTarget(&cur->hprev, prev); + P_SetTarget(&prev->hnext, cur); + + prev = cur; + } + } + break; default: break; } diff --git a/src/p_saveg.c b/src/p_saveg.c index cfbeccc9..dae613cc 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -1029,7 +1029,6 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type) const mobj_t *mobj = (const mobj_t *)th; UINT32 diff; UINT16 diff2; - UINT8 i; // Ignore stationary hoops - these will be respawned from mapthings. if (mobj->type == MT_HOOP) diff --git a/src/p_spec.c b/src/p_spec.c index 0565dbd7..37797a9c 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4182,13 +4182,9 @@ DoneSection2: //except the time! player->starposttime = player->realtime; - if (P_IsLocalPlayer(player)) - { - if (player->laps < (UINT8)(cv_numlaps.value - 1)) - S_StartSound(NULL, sfx_mlap); - else if (player->laps == (UINT8)(cv_numlaps.value - 1)) - S_StartSound(NULL, sfx_mlap); - } + if (P_IsLocalPlayer(player) && (player->laps <= (UINT8)(cv_numlaps.value - 1))) + S_StartSound(NULL, sfx_s221); + // //player->starpostangle = player->starposttime = player->starpostnum = 0; //player->starpostx = player->starposty = player->starpostz = 0; diff --git a/src/sounds.c b/src/sounds.c index 3cf54148..5f09e525 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -316,7 +316,7 @@ sfxinfo_t S_sfx[NUMSFX] = // Sonic 2 sounds {"s220", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s221", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"s221", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Lap sound {"s222", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s223", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s224", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, From 35ec8a4f6d6b2650ac9027f521f4ca9a2d308a4b Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 18 Jun 2018 21:52:26 -0400 Subject: [PATCH 055/293] Finished Jawz, item odds changes, sound effect distance increases --- src/dehacked.c | 10 ++++++++- src/info.c | 58 +++++++++++++++++++++++++++++--------------------- src/info.h | 10 ++++++++- src/k_kart.c | 20 ++++++++--------- src/p_enemy.c | 41 ++++++++++++++++++++++++++++++++++- src/p_inter.c | 17 +++++++-------- src/p_mobj.c | 7 ++++-- src/sounds.c | 16 +++++++------- 8 files changed, 123 insertions(+), 56 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 1078da51..299ec4b3 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1825,6 +1825,7 @@ static actionpointer_t actionpointers[] = {{A_ToggleFlameJet}, "A_TOGGLEFLAMEJET"}, {{A_ItemPop}, "A_ITEMPOP"}, // SRB2kart {{A_JawzChase}, "A_JAWZCHASE"}, // SRB2kart + {{A_JawzExplode}, "A_JAWZEXPLODE"}, // SRB2kart {{A_MineExplode}, "A_MINEEXPLODE"}, // SRB2kart {{A_OrbitNights}, "A_ORBITNIGHTS"}, {{A_GhostMe}, "A_GHOSTME"}, @@ -6331,19 +6332,26 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_JAWZ4", "S_JAWZ5", "S_JAWZ6", + "S_JAWZ7", + "S_JAWZ8", "S_JAWZ_DUD1", "S_JAWZ_DUD2", "S_JAWZ_DUD3", "S_JAWZ_DUD4", "S_JAWZ_DUD5", "S_JAWZ_DUD6", + "S_JAWZ_DUD7", + "S_JAWZ_DUD8", "S_JAWZ_SHIELD1", "S_JAWZ_SHIELD2", "S_JAWZ_SHIELD3", "S_JAWZ_SHIELD4", "S_JAWZ_SHIELD5", "S_JAWZ_SHIELD6", - "S_JAWZ_DEAD", + "S_JAWZ_SHIELD7", + "S_JAWZ_SHIELD8", + "S_JAWZ_DEAD1", + "S_JAWZ_DEAD2", //} "S_FIRETRAIL1", diff --git a/src/info.c b/src/info.c index 89ad9b4c..aa7267f6 100644 --- a/src/info.c +++ b/src/info.c @@ -2657,24 +2657,34 @@ state_t states[NUMSTATES] = {SPR_GSHE, 8, 175, {NULL}, 0, 0, S_NULL}, // S_DEADGREEN {SPR_JAWZ, 0, 1, {A_JawzChase}, 0, 0, S_JAWZ2}, // S_JAWZ1 - {SPR_JAWZ, 3, 1, {A_JawzChase}, 0, 0, S_JAWZ3}, // S_JAWZ2 + {SPR_JAWZ, 4, 1, {A_JawzChase}, 0, 0, S_JAWZ3}, // S_JAWZ2 {SPR_JAWZ, 1, 1, {A_JawzChase}, 0, 0, S_JAWZ4}, // S_JAWZ3 - {SPR_JAWZ, 3, 1, {A_JawzChase}, 0, 0, S_JAWZ5}, // S_JAWZ4 + {SPR_JAWZ, 4, 1, {A_JawzChase}, 0, 0, S_JAWZ5}, // S_JAWZ4 {SPR_JAWZ, 2, 1, {A_JawzChase}, 0, 0, S_JAWZ6}, // S_JAWZ5 - {SPR_JAWZ, 3, 1, {A_JawzChase}, 0, 0, S_JAWZ1}, // S_JAWZ6 - {SPR_JAWZ, 0, 1, {NULL}, 0, 0, S_JAWZ_DUD2}, // S_JAWZ_DUD1 - {SPR_JAWZ, 3, 1, {NULL}, 0, 0, S_JAWZ_DUD3}, // S_JAWZ_DUD2 - {SPR_JAWZ, 1, 1, {NULL}, 0, 0, S_JAWZ_DUD4}, // S_JAWZ_DUD3 - {SPR_JAWZ, 3, 1, {NULL}, 0, 0, S_JAWZ_DUD5}, // S_JAWZ_DUD4 - {SPR_JAWZ, 2, 1, {NULL}, 0, 0, S_JAWZ_DUD6}, // S_JAWZ_DUD5 - {SPR_JAWZ, 3, 1, {NULL}, 0, 0, S_JAWZ_DUD1}, // S_JAWZ_DUD6 - {SPR_JAWZ, 4, 1, {NULL}, 0, 0, S_JAWZ_SHIELD2}, // S_JAWZ_SHIELD1 - {SPR_JAWZ, 7, 1, {NULL}, 0, 0, S_JAWZ_SHIELD3}, // S_JAWZ_SHIELD2 - {SPR_JAWZ, 5, 1, {NULL}, 0, 0, S_JAWZ_SHIELD4}, // S_JAWZ_SHIELD3 - {SPR_JAWZ, 7, 1, {NULL}, 0, 0, S_JAWZ_SHIELD5}, // S_JAWZ_SHIELD4 - {SPR_JAWZ, 6, 1, {NULL}, 0, 0, S_JAWZ_SHIELD6}, // S_JAWZ_SHIELD5 - {SPR_JAWZ, 7, 1, {NULL}, 0, 0, S_JAWZ_SHIELD1}, // S_JAWZ_SHIELD6 - {SPR_JAWZ, 8, 175, {NULL}, 0, 0, S_NULL}, // S_JAWZ_DEAD + {SPR_JAWZ, 4, 1, {A_JawzChase}, 0, 0, S_JAWZ7}, // S_JAWZ6 + {SPR_JAWZ, 3, 1, {A_JawzChase}, 0, 0, S_JAWZ8}, // S_JAWZ7 + {SPR_JAWZ, 4, 1, {A_JawzChase}, 0, 0, S_JAWZ1}, // S_JAWZ8 + + {SPR_JAWZ, 0, 1, {NULL}, 0, 0, S_JAWZ_DUD2}, // S_JAWZ_DUD1 + {SPR_JAWZ, 4, 1, {NULL}, 0, 0, S_JAWZ_DUD3}, // S_JAWZ_DUD2 + {SPR_JAWZ, 1, 1, {NULL}, 0, 0, S_JAWZ_DUD4}, // S_JAWZ_DUD3 + {SPR_JAWZ, 4, 1, {NULL}, 0, 0, S_JAWZ_DUD5}, // S_JAWZ_DUD4 + {SPR_JAWZ, 2, 1, {NULL}, 0, 0, S_JAWZ_DUD6}, // S_JAWZ_DUD5 + {SPR_JAWZ, 4, 1, {NULL}, 0, 0, S_JAWZ_DUD7}, // S_JAWZ_DUD6 + {SPR_JAWZ, 3, 1, {NULL}, 0, 0, S_JAWZ_DUD8}, // S_JAWZ_DUD7 + {SPR_JAWZ, 4, 1, {NULL}, 0, 0, S_JAWZ_DUD1}, // S_JAWZ_DUD8 + + {SPR_JAWZ, 0, 1, {NULL}, 0, 0, S_JAWZ_SHIELD2}, // S_JAWZ_SHIELD1 + {SPR_JAWZ, 4, 1, {NULL}, 0, 0, S_JAWZ_SHIELD3}, // S_JAWZ_SHIELD2 + {SPR_JAWZ, 1, 1, {NULL}, 0, 0, S_JAWZ_SHIELD4}, // S_JAWZ_SHIELD3 + {SPR_JAWZ, 4, 1, {NULL}, 0, 0, S_JAWZ_SHIELD5}, // S_JAWZ_SHIELD4 + {SPR_JAWZ, 2, 1, {NULL}, 0, 0, S_JAWZ_SHIELD6}, // S_JAWZ_SHIELD5 + {SPR_JAWZ, 4, 1, {NULL}, 0, 0, S_JAWZ_SHIELD7}, // S_JAWZ_SHIELD6 + {SPR_JAWZ, 3, 1, {NULL}, 0, 0, S_JAWZ_SHIELD8}, // S_JAWZ_SHIELD7 + {SPR_JAWZ, 4, 1, {NULL}, 0, 0, S_JAWZ_SHIELD1}, // S_JAWZ_SHIELD8 + + {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_FBLL, 13, 3, {NULL}, 0, 0, S_FIRETRAIL2}, // S_FIRETRAIL1 {SPR_FBLL, 14, 3, {NULL}, 0, 0, S_FIRETRAIL3}, // S_FIRETRAIL2 @@ -14646,8 +14656,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_JAWZ_DEAD, // deathstate - S_NULL, // xdeathstate + S_JAWZ_DEAD1, // deathstate + S_JAWZ_DEAD2, // xdeathstate sfx_shbrk, // deathsound 7*FRACUNIT, // speed 16*FRACUNIT, // radius @@ -14655,7 +14665,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // display offset 100, // mass 1, // damage - sfx_redshl, // activesound + sfx_s3kc0s, // activesound MF_SHOOTABLE, // flags S_NULL // raisestate }, @@ -14673,8 +14683,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_JAWZ_DEAD, // deathstate - S_NULL, // xdeathstate + S_JAWZ_DEAD1, // deathstate + S_JAWZ_DEAD2, // xdeathstate sfx_shbrk, // deathsound 56*FRACUNIT, // speed 16*FRACUNIT, // radius @@ -14682,7 +14692,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // display offset 100, // mass 1, // damage - sfx_redshl, // activesound + sfx_s3kc0s, // activesound MF_SHOOTABLE, // flags S_NULL // raisestate }, @@ -14700,8 +14710,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_JAWZ_DEAD, // deathstate - S_NULL, // xdeathstate + S_JAWZ_DEAD1, // deathstate + S_JAWZ_DEAD2, // xdeathstate sfx_None, // deathsound 10*FRACUNIT, // speed 16*FRACUNIT, // radius diff --git a/src/info.h b/src/info.h index 3a02f63c..ed1c53a7 100644 --- a/src/info.h +++ b/src/info.h @@ -165,6 +165,7 @@ void A_RemoteAction(); void A_ToggleFlameJet(); void A_ItemPop(); // SRB2kart void A_JawzChase(); // SRB2kart +void A_JawzExplode(); // SRB2kart void A_MineExplode(); // SRB2kart void A_OrbitNights(); void A_GhostMe(); @@ -3173,19 +3174,26 @@ typedef enum state S_JAWZ4, S_JAWZ5, S_JAWZ6, + S_JAWZ7, + S_JAWZ8, S_JAWZ_DUD1, S_JAWZ_DUD2, S_JAWZ_DUD3, S_JAWZ_DUD4, S_JAWZ_DUD5, S_JAWZ_DUD6, + S_JAWZ_DUD7, + S_JAWZ_DUD8, S_JAWZ_SHIELD1, S_JAWZ_SHIELD2, S_JAWZ_SHIELD3, S_JAWZ_SHIELD4, S_JAWZ_SHIELD5, S_JAWZ_SHIELD6, - S_JAWZ_DEAD, + S_JAWZ_SHIELD7, + S_JAWZ_SHIELD8, + S_JAWZ_DEAD1, + S_JAWZ_DEAD2, //} S_FIRETRAIL1, diff --git a/src/k_kart.c b/src/k_kart.c index b5486c77..0bda1187 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -367,23 +367,23 @@ boolean K_IsPlayerLosing(player_t *player) static INT32 K_KartItemOddsRace[NUMKARTRESULTS][9] = { //P-Odds 0 1 2 3 4 5 6 7 8 - /*Sneaker*/ {20, 0, 0, 3, 6, 6, 0, 0, 0 }, // Sneaker - /*Rocket Sneaker*/ { 0, 0, 0, 0, 0, 3, 5, 4, 0 }, // Rocket Sneaker + /*Sneaker*/ {20, 0, 0, 3, 6, 5, 0, 0, 0 }, // Sneaker + /*Rocket Sneaker*/ { 0, 0, 0, 0, 0, 3, 4, 5, 0 }, // Rocket Sneaker /*Invincibility*/ { 0, 0, 0, 0, 0, 1, 6, 9,16 }, // Invincibility /*Banana*/ { 0, 8, 4, 2, 1, 0, 0, 0, 0 }, // Banana - /*Eggman Monitor*/ { 0, 4, 2, 1, 0, 0, 0, 0, 0 }, // Eggman Monitor - /*Orbinaut*/ { 0, 6, 4, 3, 2, 0, 0, 0, 0 }, // Orbinaut + /*Eggman Monitor*/ { 0, 4, 3, 2, 0, 0, 0, 0, 0 }, // Eggman Monitor + /*Orbinaut*/ { 0, 6, 5, 4, 2, 0, 0, 0, 0 }, // Orbinaut /*Jawz*/ { 0, 0, 3, 2, 2, 1, 0, 0, 0 }, // Jawz /*Mine*/ { 0, 1, 1, 2, 1, 0, 0, 0, 0 }, // Mine /*Ballhog*/ { 0, 0, 1, 2, 1, 0, 0, 0, 0 }, // Ballhog - /*Self-Propelled Bomb*/ { 0, 0, 0, 1, 2, 3, 3, 2, 1 }, // Self-Propelled Bomb + /*Self-Propelled Bomb*/ { 0, 0, 1, 1, 2, 3, 4, 3, 2 }, // Self-Propelled Bomb /*Grow*/ { 0, 0, 0, 0, 0, 0, 1, 1, 2 }, // Grow - /*Shrink*/ { 0, 0, 0, 0, 0, 0, 1, 2, 2 }, // Shrink + /*Shrink*/ { 0, 0, 0, 0, 0, 0, 1, 1, 2 }, // Shrink /*Lightning Shield*/ { 0, 1, 2, 0, 0, 0, 0, 0, 0 }, // Lightning Shield - /*Hyudoro*/ { 0, 0, 2, 2, 1, 0, 0, 0, 0 }, // Hyudoro + /*Hyudoro*/ { 0, 0, 0, 0, 1, 2, 1, 0, 0 }, // Hyudoro /*Pogo Spring*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Pogo Spring /*Kitchen Sink*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Kitchen Sink - /*Sneaker x3*/ { 0, 0, 0, 0, 3, 8, 7, 4, 0 }, // Sneaker x3 + /*Sneaker x3*/ { 0, 0, 0, 0, 3, 7, 7, 4, 0 }, // Sneaker x3 /*Banana x3*/ { 0, 0, 1, 1, 0, 0, 0, 0, 0 }, // Banana x3 /*Banana x10*/ { 0, 0, 0, 0, 1, 0, 0, 0, 0 }, // Banana x10 /*Orbinaut x3*/ { 0, 0, 0, 1, 1, 1, 0, 0, 0 }, // Orbinaut x3 @@ -409,9 +409,9 @@ static INT32 K_KartItemOddsBattle[NUMKARTRESULTS][6] = /*Hyudoro*/ { 0, 0, 1, 1, 0, 0 }, // Hyudoro /*Pogo Spring*/ { 0, 0, 1, 2, 0, 0 }, // Pogo Spring /*Kitchen Sink*/ { 0, 0, 0, 0, 0, 0 }, // Kitchen Sink - /*Sneaker x3*/ { 3, 0, 0, 0, 0, 2 }, // Sneaker x3 + /*Sneaker x3*/ { 2, 0, 0, 0, 0, 2 }, // Sneaker x3 /*Banana x3*/ { 0, 2, 2, 1, 1, 2 }, // Banana x3 - /*Banana x10*/ { 0, 0, 0, 0, 0, 0 }, // Banana x10 + /*Banana x10*/ { 1, 0, 0, 0, 0, 0 }, // Banana x10 /*Orbinaut x3*/ { 0, 3, 1, 1, 0, 2 }, // Orbinaut x3 /*Jawz x2*/ { 3, 2, 0, 0, 0, 2 } // Jawz x2 }; diff --git a/src/p_enemy.c b/src/p_enemy.c index b7349fdb..08aeabcd 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -189,6 +189,7 @@ void A_RemoteAction(mobj_t *actor); void A_ToggleFlameJet(mobj_t *actor); void A_ItemPop(mobj_t *actor); // SRB2kart void A_JawzChase(mobj_t *actor); // SRB2kart +void A_JawzExplode(mobj_t *actor); // SRB2kart void A_MineExplode(mobj_t *actor); // SRB2kart void A_OrbitNights(mobj_t *actor); void A_GhostMe(mobj_t *actor); @@ -8085,7 +8086,7 @@ void A_ToggleFlameJet(mobj_t* actor) } } -//{ SRB2kart - A_ItemPop, A_JawzChase and A_MineExplode +//{ SRB2kart - A_ItemPop, A_JawzChase, A_JawzExplode, and A_MineExplode void A_ItemPop(mobj_t *actor) { mobj_t *remains; @@ -8258,6 +8259,44 @@ void A_JawzChase(mobj_t *actor) } +void A_JawzExplode(mobj_t *actor) +{ + INT32 shrapnel = 2; + mobj_t *truc; + +#ifdef HAVE_BLUA + if (LUA_CallAction("A_JawzExplode", actor)) + return; +#endif + + truc = P_SpawnMobj(actor->x, actor->y, actor->z, MT_BOOMEXPLODE); + truc->scale = actor->scale; + truc->color = SKINCOLOR_RED; + + while (shrapnel) + { + INT32 speed, speed2; + + truc = P_SpawnMobj(actor->x + P_RandomRange(-8, 8)*FRACUNIT, actor->y + P_RandomRange(-8, 8)*FRACUNIT, + actor->z + P_RandomRange(0, 8)*FRACUNIT, MT_BOOMPARTICLE); + truc->scale = actor->scale; + + speed = FixedMul(7*FRACUNIT, actor->scale)>>FRACBITS; + truc->momx = P_RandomRange(-speed, speed)*FRACUNIT; + truc->momy = P_RandomRange(-speed, speed)*FRACUNIT; + + speed = FixedMul(5*FRACUNIT, actor->scale)>>FRACBITS; + speed2 = FixedMul(15*FRACUNIT, actor->scale)>>FRACBITS; + truc->momz = P_RandomRange(speed, speed2)*FRACUNIT; + truc->tics = TICRATE*2; + truc->color = SKINCOLOR_RED; + + shrapnel--; + } + + return; +} + void A_MineExplode(mobj_t *actor) { mobj_t *mo2; diff --git a/src/p_inter.c b/src/p_inter.c index 84e567bf..9a07e933 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -443,7 +443,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) return; else { - mobj_t *boom = P_SpawnMobj(special->target->x, special->target->y, special->target->z, MT_BOOMPARTICLE); + mobj_t *boom = P_SpawnMobj(special->target->x, special->target->y, special->target->z, MT_BOOMEXPLODE); boom->scale = special->target->scale; boom->destscale = special->target->scale; boom->momz = 5*FRACUNIT; @@ -2106,7 +2106,6 @@ 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)) { @@ -2118,21 +2117,21 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source) } else target->target->player->kartstuff[k_itemamount]--; - - if (!target->target->player->kartstuff[k_itemamount]) - target->target->player->kartstuff[k_itemheld] = 0; } else if ((target->type == MT_GREENSHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_ORBINAUT) // orbit items || (target->type == MT_JAWZ_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_JAWZ)) { - if (target->lastlook > 0) + if (target->lastlook != 0) target->target->player->kartstuff[k_itemamount] = target->lastlook-1; else target->target->player->kartstuff[k_itemamount]--; - - if (!target->target->player->kartstuff[k_itemamount]) - target->target->player->kartstuff[k_itemheld] = 0; } + + if (target->target->player->kartstuff[k_itemamount] < 0) + target->target->player->kartstuff[k_itemamount] = 0; + + if (!target->target->player->kartstuff[k_itemamount]) + target->target->player->kartstuff[k_itemheld] = 0; } } // diff --git a/src/p_mobj.c b/src/p_mobj.c index fb1da70a..e6255d07 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -7463,13 +7463,16 @@ void P_MobjThinker(mobj_t *mobj) break; //{ SRB2kart Items - Death States case MT_GREENITEM: - case MT_JAWZ: - case MT_JAWZ_DUD: case MT_BANANA: case MT_FAKEITEM: if (mobj->z <= mobj->floorz) P_RemoveMobj(mobj); break; + case MT_JAWZ: + case MT_JAWZ_DUD: + if (mobj->z <= mobj->floorz) + P_SetMobjState(mobj, mobj->info->xdeathstate); + break; case MT_SSMINE: case MT_BLUEEXPLOSION: if (mobj->health > -100) diff --git a/src/sounds.c b/src/sounds.c index 5f09e525..a06a3608 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -493,7 +493,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3k8f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k90", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k91", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k92", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Kart Hyudoro use + {"s3k92", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Kart Hyudoro use {"s3k93", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k94", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k95", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, @@ -543,7 +543,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3kbel", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3kbfs", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3kbfl", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kc0s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"s3kc0s", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Kart Jawz {"s3kc0l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3kc1s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3kc1l", 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, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // SS Mine deployed + {"cdfm39", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // SS 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}, @@ -703,7 +703,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"kc2c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"kc2d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"kc2e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"kc2f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Pogo Spring use + {"kc2f", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Pogo Spring use {"kc30", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"kc31", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"kc32", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, @@ -726,7 +726,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"kc43", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"kc44", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"kc45", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"kc46", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Shrink use + {"kc46", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Shrink use {"kc47", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"kc48", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Vote picked {"kc49", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, @@ -743,10 +743,10 @@ sfxinfo_t S_sfx[NUMSFX] = {"kc54", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"kc55", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"kc56", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"kc57", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // SPB locked in + {"kc57", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // SPB locked in {"kc58", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"kc59", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Shrink - {"kc5a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Grow + {"kc59", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Shrink + {"kc5a", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Grow {"kc5b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"kc5c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"kc5d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, From 71e00b23fa87a0fa7ad1f549d2e793cb13fc997d Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 18 Jun 2018 21:53:57 -0400 Subject: [PATCH 056/293] Tiiiiny adjustment --- src/k_kart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 0bda1187..d1a4998e 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -368,7 +368,7 @@ static INT32 K_KartItemOddsRace[NUMKARTRESULTS][9] = { //P-Odds 0 1 2 3 4 5 6 7 8 /*Sneaker*/ {20, 0, 0, 3, 6, 5, 0, 0, 0 }, // Sneaker - /*Rocket Sneaker*/ { 0, 0, 0, 0, 0, 3, 4, 5, 0 }, // Rocket Sneaker + /*Rocket Sneaker*/ { 0, 0, 0, 0, 0, 3, 5, 5, 0 }, // Rocket Sneaker /*Invincibility*/ { 0, 0, 0, 0, 0, 1, 6, 9,16 }, // Invincibility /*Banana*/ { 0, 8, 4, 2, 1, 0, 0, 0, 0 }, // Banana /*Eggman Monitor*/ { 0, 4, 3, 2, 0, 0, 0, 0, 0 }, // Eggman Monitor @@ -383,7 +383,7 @@ static INT32 K_KartItemOddsRace[NUMKARTRESULTS][9] = /*Hyudoro*/ { 0, 0, 0, 0, 1, 2, 1, 0, 0 }, // Hyudoro /*Pogo Spring*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Pogo Spring /*Kitchen Sink*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Kitchen Sink - /*Sneaker x3*/ { 0, 0, 0, 0, 3, 7, 7, 4, 0 }, // Sneaker x3 + /*Sneaker x3*/ { 0, 0, 0, 0, 3, 7, 6, 4, 0 }, // Sneaker x3 /*Banana x3*/ { 0, 0, 1, 1, 0, 0, 0, 0, 0 }, // Banana x3 /*Banana x10*/ { 0, 0, 0, 0, 1, 0, 0, 0, 0 }, // Banana x10 /*Orbinaut x3*/ { 0, 0, 0, 1, 1, 1, 0, 0, 0 }, // Orbinaut x3 From 794274fe6e8026f9cdc170d5c633ca4ae8bb7344 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 18 Jun 2018 22:11:41 -0400 Subject: [PATCH 057/293] The S3K sounds missing in vanilla --- src/sounds.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sounds.c b/src/sounds.c index a06a3608..8bb1ff52 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -557,7 +557,8 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3kc5l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3kc6s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3kc6l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kc7", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"s3kc7s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"s3kc7l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3kc8s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3kc8l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3kc9s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, From 969401d7a162454e76f052bea9e3ad53e744bb75 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 18 Jun 2018 22:29:52 -0400 Subject: [PATCH 058/293] Spindash go sound for boosters --- src/k_kart.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index d1a4998e..bc08a079 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2283,7 +2283,7 @@ static void K_DoHyudoroSteal(player_t *player) void K_DoSneaker(player_t *player, boolean doPFlag) { if (!player->kartstuff[k_floorboost] || player->kartstuff[k_floorboost] == 3) - S_StartSound(player->mo, sfx_mush); + S_StartSound(player->mo, sfx_s23c); player->kartstuff[k_sneakertimer] = sneakertime; @@ -2710,7 +2710,7 @@ static void K_KartDrift(player_t *player, boolean onground) && onground) { player->kartstuff[k_driftboost] = 20; - S_StartSound(player->mo, sfx_mush); + S_StartSound(player->mo, sfx_s23c); player->kartstuff[k_driftcharge] = 0; } else if ((player->kartstuff[k_drift] != -5 && player->kartstuff[k_drift] != 5) @@ -2719,7 +2719,7 @@ static void K_KartDrift(player_t *player, boolean onground) && onground) { player->kartstuff[k_driftboost] = 50; - S_StartSound(player->mo, sfx_mush); + S_StartSound(player->mo, sfx_s23c); player->kartstuff[k_driftcharge] = 0; } @@ -3499,7 +3499,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) if (player->kartstuff[k_boostcharge] >= 35 && player->kartstuff[k_boostcharge] <= 50) { if (!player->kartstuff[k_floorboost] || player->kartstuff[k_floorboost] == 3) - S_StartSound(player->mo, sfx_sboost); + S_StartSound(player->mo, sfx_s23c); 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 } From 5ef58e30bde21fa6cf0f799ec37f71375149a3ea Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 18 Jun 2018 22:31:57 -0400 Subject: [PATCH 059/293] Fuck --- src/sounds.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sounds.h b/src/sounds.h index fe762c2e..778037d4 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -629,7 +629,8 @@ typedef enum sfx_s3kc5l, sfx_s3kc6s, sfx_s3kc6l, - sfx_s3kc7, + sfx_s3kc7s, + sfx_s3kc7l, sfx_s3kc8s, sfx_s3kc8l, sfx_s3kc9s, From 8d6a2b7f4f3da6888a336e0b011e0a90baf0d85c Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 18 Jun 2018 22:43:23 -0400 Subject: [PATCH 060/293] Hyudoro HUD fix Really minor gripe, but if you stole an item it wouldn't show up until you finished taking it. --- src/k_kart.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index bc08a079..3b15b9e0 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3956,13 +3956,17 @@ static void K_drawKartItem(void) // The only actual reason is to make sneakers line up this way in the code below // This shouldn't have any actual baring over how it functions // Hyudoro is first, because we're drawing it on top of the player's current item - if (stplyr->kartstuff[k_stealingtimer] > 0 || stplyr->kartstuff[k_stolentimer] > 0) + if (stplyr->kartstuff[k_stolentimer] > 0) { if (leveltime & 2) localpatch = kp_hyudoro; else if (!(leveltime & 2)) localpatch = kp_nodraw; } + else if ((stplyr->kartstuff[k_stealingtimer] > 0) && (leveltime & 2)) + { + localpatch = kp_hyudoro; + } else if (stplyr->kartstuff[k_rocketsneakertimer] > 1) { if (leveltime & 1) From a8aec0b9e17c15e8562784666d24284631c0e436 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 19 Jun 2018 20:20:06 -0400 Subject: [PATCH 061/293] Hundreds of tweaks - SPB multiplier depending on 1st-2nd distance - Removed the Battle-only k_poweritemtimer (hold over from when you could easily get invuln items all of the time), replaced it with a 2 invincibility item cap in ALL modes. - Spinout is affected by boosters, *properly* - Can no longer strafe while spinning out on speed bumps - Messed with how other items interact with speed bumps, again. - Old bounce code has been ported for non-players - Fixed Karma players being able to do anything after the round has ended. - Fixed sneaker and spinout timer weirdness - Fixed Mines still being hold-use - Fixed rubber-burn turn not working - Removed redundant k_spinout and unused k_boosting variables - Filled out the Color_Opposite table with Kart's new colors. Not really relevant right now (besides some extra Lua functionality) since nothing uses it, but will be nice for if we do the signpost from the sky idea. --- src/d_player.h | 3 - src/doomdata.h | 4 +- src/g_game.c | 48 +++++----- src/k_kart.c | 195 ++++++++++++++++++++++++----------------- src/k_kart.h | 1 + src/lua_mathlib.c | 5 +- src/p_enemy.c | 4 +- src/p_inter.c | 6 +- src/p_map.c | 219 ++++++++++++++++++++++++++++++++++------------ src/p_mobj.c | 4 +- src/p_spec.c | 2 +- src/p_user.c | 33 +++---- src/r_draw.c | 2 +- 13 files changed, 330 insertions(+), 196 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index d02a3947..bf4e91bf 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -282,9 +282,7 @@ typedef enum k_voices, // Used to stop the player saying more voices than it should k_tauntvoices, // Used to specifically stop taunt voice spam - k_boosting, // Determines if you're currently shroom-boosting k_floorboost, // Prevents Sneaker sounds for a breif duration when triggered by a floor panel - k_spinout, // Separate confirmation to prevent endless wipeout loops k_spinouttype, // Determines whether to thrust forward or not while spinning out; 0 = move forwards, 1 = stay still k_drift, // Drifting Left or Right, plus a bigger counter = sharper turn @@ -319,7 +317,6 @@ typedef enum k_eggmanheld, // Eggman monitor held, separate from k_itemheld so it doesn't stop you from getting items k_spinouttimer, // Spin-out from a banana peel or oil slick (was "pw_bananacam") k_justbumped, // Prevent players from endlessly bumping into each other - k_poweritemtimer, // Battle mode, how long before you're allowed another power item (Invincibility, Grow) k_comebacktimer, // Battle mode, how long before you become a bomb after death k_sadtimer, // How long you've been sad diff --git a/src/doomdata.h b/src/doomdata.h index e916a151..1b91c94d 100644 --- a/src/doomdata.h +++ b/src/doomdata.h @@ -207,8 +207,8 @@ typedef struct #define ZSHIFT 4 -extern const char *Color_Names[MAXSKINCOLORS]; -extern const UINT8 Color_Opposite[MAXSKINCOLORS*2]; +//extern const char *Color_Names[MAXSKINCOLORS]; +//extern const UINT8 Color_Opposite[MAXSKINCOLORS*2]; #define NUMMAPS 1035 diff --git a/src/g_game.c b/src/g_game.c index de47d643..0e1648c8 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1320,7 +1320,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) cmd->driftturn = (INT16)(cmd->driftturn - (mousex*(mirrormode ? -1 : 1)*8)); } - // Bounce pad strafing + // Speed bump strafing if (!demoplayback && ((player->pflags & PF_FORCESTRAFE) || (player->kartstuff[k_pogospring]))) { if (turnright) @@ -1334,25 +1334,6 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) } } - //{ SRB2kart - Drift support - // limit turning to angleturn[1] to stop mouselook letting you look too fast - if (cmd->angleturn > angleturn[1]) - cmd->angleturn = angleturn[1]; - else if (cmd->angleturn < -angleturn[1]) - cmd->angleturn = -angleturn[1]; - - if (cmd->driftturn > angleturn[1]) - cmd->driftturn = angleturn[1]; - else if (cmd->driftturn < -angleturn[1]) - cmd->driftturn = -angleturn[1]; - - if (player->mo) - cmd->angleturn = K_GetKartTurnValue(player, cmd->angleturn); - - // SRB2kart - no additional angle if not moving - if ((player->mo && player->speed > 0) || (leveltime > 140 && cmd->buttons & BT_ACCELERATE && cmd->buttons & BT_BRAKE) || (player->spectator || objectplacing)) - lang += (cmd->angleturn<<16); - if (player->spectator || objectplacing) // SRB2Kart: spectators need special controls { if (InputDown(gc_accelerate, ssplayer) || (cv_usejoystick.value && axis > 0)) @@ -1508,6 +1489,29 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) cmd->sidemove = (SINT8)(cmd->sidemove + side); } + //{ SRB2kart - Drift support + // Not grouped with the rest of turn stuff because it needs to know what buttons you're pressing for rubber-burn turn + // limit turning to angleturn[1] to stop mouselook letting you look too fast + if (cmd->angleturn > angleturn[1]) + cmd->angleturn = angleturn[1]; + else if (cmd->angleturn < -angleturn[1]) + cmd->angleturn = -angleturn[1]; + + if (cmd->driftturn > angleturn[1]) + cmd->driftturn = angleturn[1]; + else if (cmd->driftturn < -angleturn[1]) + cmd->driftturn = -angleturn[1]; + + if (player->mo) + cmd->angleturn = K_GetKartTurnValue(player, cmd->angleturn); + + // SRB2kart - no additional angle if not moving + if (((player->mo && player->speed > 0) // Moving + || (leveltime > 140 && (cmd->buttons & BT_ACCELERATE && cmd->buttons & BT_BRAKE)) // Rubber-burn turn + || (player->spectator || objectplacing)) // Not a physical player + && !(player->kartstuff[k_spinouttimer] && player->kartstuff[k_sneakertimer])) // Spinning and boosting cancels out spinout + lang += (cmd->angleturn<<16); + cmd->angleturn = (INT16)(lang >> 16); if (!hu_stopped) @@ -2290,7 +2294,6 @@ void G_PlayerReborn(INT32 player) // SRB2kart INT32 starpostwp; - INT32 offroad; INT32 balloon; INT32 comebackpoints; @@ -2347,7 +2350,6 @@ void G_PlayerReborn(INT32 player) // SRB2kart starpostwp = players[player].kartstuff[k_starpostwp]; - offroad = players[player].kartstuff[k_offroad]; balloon = players[player].kartstuff[k_balloon]; comebackpoints = players[player].kartstuff[k_comebackpoints]; @@ -2405,8 +2407,6 @@ void G_PlayerReborn(INT32 player) // SRB2kart p->kartstuff[k_starpostwp] = starpostwp; // TODO: get these out of kartstuff, it causes desync - p->kartstuff[k_offroad] = offroad; - p->kartstuff[k_balloon] = balloon; p->kartstuff[k_comebackpoints] = comebackpoints; p->kartstuff[k_comebacktimer] = comebacktime; diff --git a/src/k_kart.c b/src/k_kart.c index 3b15b9e0..7b1ced80 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -86,7 +86,7 @@ const char *KartColor_Names[MAXSKINCOLORS] = "Dark Green", // 44 // SKINCOLOR_DARKGREEN "Swamp", // 45 // SKINCOLOR_SWAMP "Frost", // 46 // SKINCOLOR_FROST - "Slate", // 47 // SKINCOLOR_SLATEBLUE + "Slate", // 47 // SKINCOLOR_SLATE "Light Blue", // 48 // SKINCOLOR_LIGHTBLUE "Cyan", // 49 // SKINCOLOR_CYAN "Cerulean", // 50 // SKINCOLOR_CERULEAN @@ -105,6 +105,75 @@ const char *KartColor_Names[MAXSKINCOLORS] = "Indigo" // 63 // SKINCOLOR_INDIGO }; +// 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_BLACK,8, // 02 // SKINCOLOR_WHITE + SKINCOLOR_DARKGREY,8, // 03 // SKINCOLOR_SILVER + SKINCOLOR_CLOUDY,8, // 04 // SKINCOLOR_CLOUDY + SKINCOLOR_GREY,8, // 05 // SKINCOLOR_GREY + SKINCOLOR_SILVER,8, // 06 // SKINCOLOR_DARKGREY + SKINCOLOR_WHITE,8, // 07 // SKINCOLOR_BLACK + SKINCOLOR_SWAMP,8, // 08 // SKINCOLOR_SALMON + SKINCOLOR_ARMY,8, // 09 // SKINCOLOR_PINK + SKINCOLOR_DARKGREEN,8, // 10 // SKINCOLOR_LIGHTRED + SKINCOLOR_UGLYGREEN,8, // 11 // SKINCOLOR_SHINYRED + SKINCOLOR_GREEN,8, // 12 // SKINCOLOR_RED + SKINCOLOR_DARKARMY,8, // 13 // SKINCOLOR_DARKPINK + SKINCOLOR_LIGHTGREEN,8, // 14 // SKINCOLOR_DARKRED + SKINCOLOR_NAVY,8, // 15 // SKINCOLOR_DAWN + SKINCOLOR_BLUE,8, // 16 // SKINCOLOR_ORANGE + SKINCOLOR_SHINYBLUE,8, // 17 // SKINCOLOR_SHINYORANGE + SKINCOLOR_LIGHTBLUE,8, // 18 // SKINCOLOR_DARKORANGE + SKINCOLOR_STEELBLUE,8, // 19 // SKINCOLOR_GOLDENBROWN + SKINCOLOR_STEELBLUE,8, // 20 // SKINCOLOR_ROSEWOOD + SKINCOLOR_SLATE,8, // 21 // SKINCOLOR_DARKROSEWOOD + SKINCOLOR_LEATHER,8, // 22 // SKINCOLOR_SEPIA + SKINCOLOR_BROWN,8, // 23 // SKINCOLOR_BEIGE + SKINCOLOR_BEIGE,8, // 24 // SKINCOLOR_BROWN + SKINCOLOR_SEPIA,8, // 25 // SKINCOLOR_LEATHER + SKINCOLOR_INDIGO,8, // 26 // SKINCOLOR_YELLOW + SKINCOLOR_BROWN,8, // 27 // SKINCOLOR_PEACH + SKINCOLOR_DARKBLUE,8, // 28 // SKINCOLOR_LIGHTORANGE + SKINCOLOR_SEPIA,8, // 29 // SKINCOLOR_CARAMEL + SKINCOLOR_LAVENDER,8, // 30 // SKINCOLOR_GOLD + SKINCOLOR_BEIGE,8, // 31 // SKINCOLOR_SHINYCARAMEL + SKINCOLOR_PURPLE,8, // 32 // SKINCOLOR_VOMIT + SKINCOLOR_BYZANTIUM,8, // 33 // SKINCOLOR_GARDEN + SKINCOLOR_LAVENDER,8, // 34 // SKINCOLOR_LIGHTARMY + SKINCOLOR_LAVENDER,8, // 35 // SKINCOLOR_ARMY + SKINCOLOR_PURPLE,8, // 36 // SKINCOLOR_PISTACHIO + SKINCOLOR_LILAC,8, // 37 // SKINCOLOR_ROBOHOOD + SKINCOLOR_LILAC,8, // 38 // SKINCOLOR_OLIVE + SKINCOLOR_LAVENDER,8, // 39 // SKINCOLOR_DARKARMY + SKINCOLOR_DARKRED,8, // 40 // SKINCOLOR_LIGHTGREEN + SKINCOLOR_SHINYRED,8, // 41 // SKINCOLOR_UGLYGREEN + SKINCOLOR_SHINYRED,8, // 42 // SKINCOLOR_NEONGREEN + SKINCOLOR_RED,8, // 43 // SKINCOLOR_GREEN + SKINCOLOR_LIGHTRED,8, // 44 // SKINCOLOR_DARKGREEN + SKINCOLOR_SALMON,8, // 45 // SKINCOLOR_SWAMP + SKINCOLOR_DARKRED,8, // 46 // SKINCOLOR_FROST + SKINCOLOR_PINK,8, // 47 // SKINCOLOR_SLATE + SKINCOLOR_LIGHTORANGE,8, // 48 // SKINCOLOR_LIGHTBLUE + SKINCOLOR_CARAMEL,8, // 49 // SKINCOLOR_CYAN + SKINCOLOR_GOLD,8, // 50 // SKINCOLOR_CERULEAN + SKINCOLOR_SHINYCARAMEL,8,// 51 // SKINCOLOR_TURQUOISE + SKINCOLOR_RED,8, // 52 // SKINCOLOR_TEAL + SKINCOLOR_PEACH,8, // 53 // SKINCOLOR_STEELBLUE + SKINCOLOR_ORANGE,8, // 54 // SKINCOLOR_BLUE + SKINCOLOR_SHINYORANGE,8, // 55 // SKINCOLOR_SHINYBLUE + SKINCOLOR_DAWN,8, // 56 // SKINCOLOR_NAVY + SKINCOLOR_LIGHTORANGE,8, // 57 // SKINCOLOR_DARKBLUE + SKINCOLOR_SLATE,8, // 58 // SKINCOLOR_JETBLACK + SKINCOLOR_YELLOW,4, // 59 // SKINCOLOR_LILAC + SKINCOLOR_YELLOW,8, // 60 // SKINCOLOR_PURPLE + SKINCOLOR_GOLD,8, // 61 // SKINCOLOR_LAVENDER + SKINCOLOR_GARDEN,8, // 62 // SKINCOLOR_BYZANTIUM + SKINCOLOR_YELLOW,8 // 63 // SKINCOLOR_INDIGO +}; + 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, 0, 0, 0, 1, 1, 2, 2, 4, 6, 8, 10}, // SKINCOLOR_IVORY @@ -376,7 +445,7 @@ static INT32 K_KartItemOddsRace[NUMKARTRESULTS][9] = /*Jawz*/ { 0, 0, 3, 2, 2, 1, 0, 0, 0 }, // Jawz /*Mine*/ { 0, 1, 1, 2, 1, 0, 0, 0, 0 }, // Mine /*Ballhog*/ { 0, 0, 1, 2, 1, 0, 0, 0, 0 }, // Ballhog - /*Self-Propelled Bomb*/ { 0, 0, 1, 1, 2, 3, 4, 3, 2 }, // Self-Propelled Bomb + /*Self-Propelled Bomb*/ { 0, 0, 1, 1, 1, 1, 2, 2, 2 }, // Self-Propelled Bomb /*Grow*/ { 0, 0, 0, 0, 0, 0, 1, 1, 2 }, // Grow /*Shrink*/ { 0, 0, 0, 0, 0, 0, 1, 1, 2 }, // Shrink /*Lightning Shield*/ { 0, 1, 2, 0, 0, 0, 0, 0, 0 }, // Lightning Shield @@ -474,7 +543,7 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, player_t *player, boolean const INT32 distvar = (64*14); INT32 newodds; INT32 i; - UINT8 pingame = 0, pexiting = 0; + UINT8 pingame = 0, pexiting = 0, pinvin = 0; SINT8 first = -1; SINT8 second = -1; INT32 secondist = 0; @@ -486,19 +555,24 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, player_t *player, boolean for (i = 0; i < MAXPLAYERS; i++) { - if (playeringame[i] && !players[i].spectator) - { - pingame++; - if (players[i].mo) - { - if (players[i].kartstuff[k_position] == 1 && first == -1) - first = i; - if (players[i].kartstuff[k_position] == 2 && second == -1) - second = i; - } - } + if (!playeringame[i] || players[i].spectator) + continue; + + pingame++; if (players[i].exiting) pexiting++; + if (players[i].mo) + { + if (players[i].kartstuff[k_position] == 1 && first == -1) + first = i; + if (players[i].kartstuff[k_position] == 2 && second == -1) + second = i; + if (players[i].kartstuff[k_itemtype] == KITEM_INVINCIBILITY + || players[i].kartstuff[k_itemtype] == KITEM_GROW + || players[i].kartstuff[k_invincibilitytimer] + || players[i].kartstuff[k_growshrinktimer] > 0) + pinvin++; + } } if (first != -1 && second != -1) // calculate 2nd's distance from 1st, for SPB @@ -525,8 +599,7 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, player_t *player, boolean case KITEM_INVINCIBILITY: if (franticitems) newodds *= 2; if (mashed) newodds /= 2; - if ((!cv_invincibility.value) - || (player->kartstuff[k_poweritemtimer])) newodds = 0; + if ((!cv_invincibility.value) || (pinvin > 2)) newodds = 0; break; case KITEM_BANANA: if (!cv_banana.value) newodds = 0; @@ -558,13 +631,14 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, player_t *player, boolean if ((!cv_selfpropelledbomb.value) || (indirectitemcooldown > 0) || (pexiting > 0) - || (secondist <= distvar*4)) newodds = 0; + || (secondist/distvar < 4)) + newodds = 0; + newodds *= min((secondist/distvar)-3, 3); break; case KITEM_GROW: if (franticitems) newodds *= 2; if (mashed) newodds /= 2; - if ((!cv_grow.value) - || (player->kartstuff[k_poweritemtimer])) newodds = 0; + if ((!cv_grow.value) || (pinvin > 2)) newodds = 0; break; case KITEM_SHRINK: if (franticitems) newodds *= 2; @@ -1218,7 +1292,7 @@ static fixed_t K_GetKartBoostPower(player_t *player, boolean speed) // 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) - boostpower = FixedDiv(boostpower, player->kartstuff[k_offroad] + FRACUNIT); + boostpower = FixedDiv(boostpower, player->kartstuff[k_offroad] + FRACUNIT); if (player->kartstuff[k_growshrinktimer] > 0) { // Grow @@ -1334,15 +1408,6 @@ fixed_t K_3dKartMovement(player_t *player, boolean onground, fixed_t forwardmove if (!onground) return 0; // If the player isn't on the ground, there is no change in speed - if (forwardmove <= 0 && player->kartstuff[k_brakestop] < 6) // Don't start reversing with brakes until you've made a stop first - { - if (player->speed < 8*FRACUNIT) - player->kartstuff[k_brakestop]++; - return 0; - } - else if (forwardmove > 0) - player->kartstuff[k_brakestop] = 0; - // ACCELCODE!!!1!11! oldspeed = R_PointToDist2(0, 0, player->rmomx, player->rmomy); // FixedMul(P_AproxDistance(player->rmomx, player->rmomy), player->mo->scale); newspeed = FixedDiv(FixedDiv(FixedMul(oldspeed, accelmax - p_accel) + FixedMul(p_speed, p_accel), accelmax), ORIG_FRICTION); @@ -1373,7 +1438,7 @@ void K_SpinPlayer(player_t *player, mobj_t *source) if (player->health <= 0) return; - if (player->powers[pw_flashing] > 0 || player->kartstuff[k_squishedtimer] > 0 || (player->kartstuff[k_spinouttimer] > 0 && player->kartstuff[k_spinout] > 0) + if (player->powers[pw_flashing] > 0 || player->kartstuff[k_squishedtimer] > 0 || player->kartstuff[k_spinouttimer] > 0 || player->kartstuff[k_invincibilitytimer] > 0 || player->kartstuff[k_growshrinktimer] > 0 || player->kartstuff[k_hyudorotimer] > 0 || (G_BattleGametype() && ((player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer]) || player->kartstuff[k_comebackmode] == 1))) return; @@ -1381,7 +1446,7 @@ void K_SpinPlayer(player_t *player, mobj_t *source) if (source && source != player->mo && source->player) K_PlayHitEmSound(source); - player->kartstuff[k_sneakertimer] = 0; + //player->kartstuff[k_sneakertimer] = 0; player->kartstuff[k_driftboost] = 0; if (G_BattleGametype()) @@ -1409,24 +1474,19 @@ void K_SpinPlayer(player_t *player, mobj_t *source) if (player->kartstuff[k_spinouttype] <= 0) { - if (player->kartstuff[k_spinouttype] == 0) - player->kartstuff[k_spinouttimer] = 3*TICRATE/2; // Explosion/Banana Wipeout - else - player->kartstuff[k_spinouttimer] = 3*TICRATE/2; // Oil Slick Wipeout + player->kartstuff[k_spinouttimer] = 3*TICRATE/2; // Banana Spinout - // At Wipeout, playerspeed is increased to 1/4 their regular speed, moving them forward + // At spinout, player speed is increased to 1/4 their regular speed, moving them forward if (player->speed < K_GetKartSpeed(player, true)/4) P_InstaThrust(player->mo, player->mo->angle, FixedMul(K_GetKartSpeed(player, true)/4, player->mo->scale)); S_StartSound(player->mo, sfx_slip); } else - player->kartstuff[k_spinouttimer] = 1*TICRATE; // ? Whipeout + player->kartstuff[k_spinouttimer] = 1*TICRATE; // Wipeout player->powers[pw_flashing] = K_GetKartFlashing(); - player->kartstuff[k_spinout] = player->kartstuff[k_spinouttimer]; - if (player->mo->state != &states[S_KART_SPIN]) P_SetPlayerMobjState(player->mo, S_KART_SPIN); @@ -1490,7 +1550,7 @@ void K_ExplodePlayer(player_t *player, mobj_t *source) // A bit of a hack, we ju if (player->health <= 0) return; - if (player->powers[pw_flashing] > 0 || player->kartstuff[k_squishedtimer] > 0 || (player->kartstuff[k_spinouttimer] > 0 && player->kartstuff[k_spinout] > 0) + if (player->powers[pw_flashing] > 0 || player->kartstuff[k_squishedtimer] > 0 || player->kartstuff[k_spinouttimer] > 0 || player->kartstuff[k_invincibilitytimer] > 0 || player->kartstuff[k_growshrinktimer] > 0 || player->kartstuff[k_hyudorotimer] > 0 || (G_BattleGametype() && ((player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer]) || player->kartstuff[k_comebackmode] == 1))) return; @@ -1526,7 +1586,6 @@ void K_ExplodePlayer(player_t *player, mobj_t *source) // A bit of a hack, we ju player->kartstuff[k_spinouttype] = 1; player->kartstuff[k_spinouttimer] = 2*TICRATE+(TICRATE/2); - player->kartstuff[k_spinout] = player->kartstuff[k_spinouttimer]; player->powers[pw_flashing] = K_GetKartFlashing(); @@ -1559,17 +1618,15 @@ void K_StealBalloon(player_t *player, player_t *victim, boolean force) if (player->health <= 0 || victim->health <= 0) return; - if (force) - ; - else + if (!force) { if (victim->kartstuff[k_balloon] <= 0) // || player->kartstuff[k_balloon] >= cv_kartballoons.value+2 return; - if ((player->powers[pw_flashing] > 0 || player->kartstuff[k_squishedtimer] > 0 || (player->kartstuff[k_spinouttimer] > 0 && player->kartstuff[k_spinout] > 0) + if ((player->powers[pw_flashing] > 0 || player->kartstuff[k_squishedtimer] > 0 || player->kartstuff[k_spinouttimer] > 0 || player->kartstuff[k_invincibilitytimer] > 0 || player->kartstuff[k_growshrinktimer] > 0 || player->kartstuff[k_hyudorotimer] > 0 || (player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer])) - || (victim->powers[pw_flashing] > 0 || victim->kartstuff[k_squishedtimer] > 0 || (victim->kartstuff[k_spinouttimer] > 0 && victim->kartstuff[k_spinout] > 0) + || (victim->powers[pw_flashing] > 0 || victim->kartstuff[k_squishedtimer] > 0 || victim->kartstuff[k_spinouttimer] > 0 || victim->kartstuff[k_invincibilitytimer] > 0 || victim->kartstuff[k_growshrinktimer] > 0 || victim->kartstuff[k_hyudorotimer] > 0)) return; } @@ -2360,17 +2417,17 @@ void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed) thrust = FixedMul(thrust, 5*FRACUNIT/4); else if (mo->player->kartstuff[k_invincibilitytimer]) thrust = FixedMul(thrust, 9*FRACUNIT/8); - mo->momz = FixedMul(FINESINE(ANGLE_22h>>ANGLETOFINESHIFT), FixedMul(thrust, mo->scale)); } else { - thrust = P_AproxDistance(mo->momx,mo->momy); - if (thrust < 8< 16<momx, mo->momy)/2, 5*FRACUNIT/2); + if (thrust < 16<momz = FixedMul(FINESINE(ANGLE_22h>>ANGLETOFINESHIFT), FixedMul(thrust, mo->scale)); + if (thrust > 32<momz = FixedMul(FINESINE(ANGLE_22h>>ANGLETOFINESHIFT), FixedMul(thrust, mo->scale)); } else mo->momz = FixedMul(vertispeed, mo->scale); @@ -2424,10 +2481,8 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) player->mo->colorized = false; } - if (player->kartstuff[k_spinout] && P_IsObjectOnGround(player->mo)) - player->kartstuff[k_spinout]--; - - if (player->kartstuff[k_spinouttimer] && (P_IsObjectOnGround(player->mo) || player->kartstuff[k_spinouttype])) + if (player->kartstuff[k_spinouttimer] + && (P_IsObjectOnGround(player->mo) || player->kartstuff[k_spinouttype] == 1)) player->kartstuff[k_spinouttimer]--; else if (!comeback) player->kartstuff[k_comebacktimer] = comebacktime; @@ -2438,13 +2493,13 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) comebackshowninfo = true; // client has already seen the message } - if (player->kartstuff[k_spinout] == 0 && player->kartstuff[k_spinouttimer] == 0 && player->powers[pw_flashing] == K_GetKartFlashing()) + if (player->kartstuff[k_spinouttimer] == 0 && player->powers[pw_flashing] == K_GetKartFlashing()) player->powers[pw_flashing]--; if (player->kartstuff[k_attractiontimer]) player->kartstuff[k_attractiontimer]--; - if (player->kartstuff[k_sneakertimer] && (P_IsObjectOnGround(player->mo) && !player->kartstuff[k_spinouttimer])) + if (player->kartstuff[k_sneakertimer]) player->kartstuff[k_sneakertimer]--; if (player->kartstuff[k_floorboost]) @@ -2497,9 +2552,6 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) player->kartstuff[k_deathsentence]--; } - if (player->kartstuff[k_poweritemtimer]) - player->kartstuff[k_poweritemtimer]--; - if (player->kartstuff[k_lapanimation]) player->kartstuff[k_lapanimation]--; @@ -2758,8 +2810,7 @@ static void K_KartDrift(player_t *player, boolean onground) } // Incease/decrease the drift value to continue drifting in that direction - if (player->kartstuff[k_spinouttimer] == 0 && player->kartstuff[k_jmp] == 1 && onground - && player->kartstuff[k_drift] != 0) + if (player->kartstuff[k_spinouttimer] == 0 && player->kartstuff[k_jmp] == 1 && onground && player->kartstuff[k_drift] != 0) { fixed_t driftadditive = 24; @@ -3219,7 +3270,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) P_SetTarget(&player->mo->hnext, mo); } } - else if (!(cmd->buttons & BT_ATTACK) && HOLDING_ITEM && player->kartstuff[k_itemheld]) + else if (ATTACK_IS_DOWN && player->kartstuff[k_itemheld]) { K_ThrowKartItem(player, false, MT_SSMINE, 1, true); K_PlayTauntSound(player->mo); @@ -3343,25 +3394,9 @@ void K_MoveKartPlayer(player_t *player, boolean onground) if (!player->kartstuff[k_itemamount] && !player->kartstuff[k_itemheld]) player->kartstuff[k_itemtype] = KITEM_NONE; - // Sneaker Boost - if (((player->kartstuff[k_sneakertimer] > 0 && player->kartstuff[k_boosting] == 0) - || (player->kartstuff[k_sneakertimer] > 0 && ATTACK_IS_DOWN && NO_HYUDORO)) && onground) - { - player->kartstuff[k_boosting] = 1; - } - else if (player->kartstuff[k_sneakertimer] == 0 && player->kartstuff[k_boosting] == 1) - player->kartstuff[k_boosting] = 0; - // Grow - Make the player grow! /*if (player->kartstuff[k_growshrinktimer] > 1) player->mo->destscale = (mapheaderinfo[gamemap-1]->mobj_scale)*3/2;*/ - - if (G_BattleGametype() - && (player->kartstuff[k_itemtype] == KITEM_INVINCIBILITY - || player->kartstuff[k_itemtype] == KITEM_GROW - || player->kartstuff[k_invincibilitytimer] - || player->kartstuff[k_growshrinktimer] > 0)) - player->kartstuff[k_poweritemtimer] = 10*TICRATE; if (player->kartstuff[k_itemtype] == KITEM_SPB || player->kartstuff[k_itemtype] == KITEM_SHRINK diff --git a/src/k_kart.h b/src/k_kart.h index 32dbbbd6..1728740e 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -11,6 +11,7 @@ UINT8 colortranslations[MAXSKINCOLORS][16]; extern const char *KartColor_Names[MAXSKINCOLORS]; +extern const UINT8 KartColor_Opposite[MAXSKINCOLORS*2]; void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor); void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color); UINT8 K_GetKartColorByName(const char *name); diff --git a/src/lua_mathlib.c b/src/lua_mathlib.c index 96d50b77..50a194c8 100644 --- a/src/lua_mathlib.c +++ b/src/lua_mathlib.c @@ -16,6 +16,7 @@ #include "tables.h" #include "p_local.h" #include "doomstat.h" // for ALL7EMERALDS +#include "k_kart.h" // KartColor_Opposite #include "lua_script.h" #include "lua_libs.h" @@ -191,8 +192,8 @@ static int lib_coloropposite(lua_State *L) UINT8 colornum = (UINT8)luaL_checkinteger(L, 1); if (colornum >= MAXSKINCOLORS) return luaL_error(L, "skincolor %d out of range (0 - %d).", colornum, MAXSKINCOLORS-1); - lua_pushinteger(L, Color_Opposite[colornum*2]); // push color - lua_pushinteger(L, Color_Opposite[colornum*2+1]); // push frame + lua_pushinteger(L, KartColor_Opposite[colornum*2]); // push color + lua_pushinteger(L, KartColor_Opposite[colornum*2+1]); // push frame return 2; } diff --git a/src/p_enemy.c b/src/p_enemy.c index 08aeabcd..228c2dec 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -4043,8 +4043,8 @@ void A_SignPlayer(mobj_t *actor) return; // Set the sign to be an appropriate background color for this player's skincolor. - actor->color = Color_Opposite[actor->target->player->skincolor*2]; - actor->frame += Color_Opposite[actor->target->player->skincolor*2+1]; + actor->color = KartColor_Opposite[actor->target->player->skincolor*2]; + actor->frame += KartColor_Opposite[actor->target->player->skincolor*2+1]; // spawn an overlay of the player's face. ov = P_SpawnMobj(actor->x, actor->y, actor->z, MT_OVERLAY); diff --git a/src/p_inter.c b/src/p_inter.c index 9a07e933..aac513b1 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -429,6 +429,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) return; if (player->kartstuff[k_balloon] <= 0) return; + if (special->target->player->exiting || player->exiting) + return; if (special->target->player->kartstuff[k_comebacktimer] || special->target->player->kartstuff[k_spinouttimer] @@ -3184,8 +3186,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da //{ SRB2kart - special damage sources - player->kartstuff[k_sneakertimer] = 0; - // Shrink if (damage == 64) { @@ -3222,6 +3222,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da { player->kartstuff[k_growshrinktimer] = 2; } + player->kartstuff[k_sneakertimer] = 0; // Invincible or not, we still need this. //P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_LIGHTNING); S_StartSound(player->mo, sfx_kc59); @@ -3271,6 +3272,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da || inflictor->type == MT_FAKEITEM || inflictor->type == MT_FAKESHIELD || inflictor->player)) { + player->kartstuff[k_sneakertimer] = 0; player->kartstuff[k_spinouttype] = 1; K_SpinPlayer(player, source); damage = player->mo->health - 1; diff --git a/src/p_map.c b/src/p_map.c index e6c07afa..01a16242 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -3137,11 +3137,11 @@ static void P_HitSlideLine(line_t *ld) } // -// P_HitBounceLine +// P_PlayerHitBounceLine // -// Adjusts the xmove / ymove so that the next move will bounce off the wall. +// HitBounceLine, for players // -static void P_HitBounceLine(line_t *ld) +static void P_PlayerHitBounceLine(line_t *ld) { INT32 side; angle_t lineangle; @@ -3164,6 +3164,47 @@ static void P_HitBounceLine(line_t *ld) tmymove += FixedMul(movelen, FINESINE(lineangle)); } +// +// P_HitBounceLine +// +// Adjusts the xmove / ymove so that the next move will bounce off the wall. +// +static void P_HitBounceLine(line_t *ld) +{ + angle_t lineangle, moveangle, deltaangle; + fixed_t movelen; + + if (ld->slopetype == ST_HORIZONTAL) + { + tmymove = -tmymove; + return; + } + + if (ld->slopetype == ST_VERTICAL) + { + tmxmove = -tmxmove; + return; + } + + lineangle = R_PointToAngle2(0, 0, ld->dx, ld->dy); + + if (lineangle >= ANGLE_180) + lineangle -= ANGLE_180; + + moveangle = R_PointToAngle2(0, 0, tmxmove, tmymove); + deltaangle = moveangle + 2*(lineangle - moveangle); + + lineangle >>= ANGLETOFINESHIFT; + deltaangle >>= ANGLETOFINESHIFT; + + movelen = P_AproxDistance(tmxmove, tmymove); + + tmxmove = FixedMul(movelen, FINECOSINE(deltaangle)); + tmymove = FixedMul(movelen, FINESINE(deltaangle)); + + deltaangle = R_PointToAngle2(0, 0, tmxmove, tmymove); +} + // // PTR_SlideCameraTraverse // @@ -3782,18 +3823,20 @@ stairstep: } // -// P_BounceMove +// P_PlayerBounceMove // -// The momx / momy move is bad, so try to bounce off a wall. +// Bounce move, for players. // -void P_BounceMove(mobj_t *mo) + +void P_PlayerBounceMove(mobj_t *mo) { fixed_t leadx, leady; fixed_t trailx, traily; - //fixed_t newx, newy; - //INT32 hitcount; fixed_t mmomx = 0, mmomy = 0; + if (!mo->player) + return; + if (mo->eflags & MFE_JUSTBOUNCEDWALL) { P_SlideMove(mo, true); @@ -3801,22 +3844,14 @@ void P_BounceMove(mobj_t *mo) } slidemo = mo; - //hitcount = 0; -/*retry: - if (++hitcount == 3) - goto bounceback; // don't loop forever*/ + mmomx = mo->player->rmomx; + mmomy = mo->player->rmomy; - if (mo->player) + if (mo->player->kartstuff[k_drift] != 0) // SRB2kart { - mmomx = mo->player->rmomx; - mmomy = mo->player->rmomy; - - if (mo->player->kartstuff[k_drift] != 0) // SRB2kart - { - mo->player->kartstuff[k_drift] = 0; - mo->player->kartstuff[k_driftcharge] = 0; - } + mo->player->kartstuff[k_drift] = 0; + mo->player->kartstuff[k_driftcharge] = 0; } else { @@ -3853,8 +3888,107 @@ void P_BounceMove(mobj_t *mo) P_PathTraverse(trailx, leady, trailx + mmomx, leady + mmomy, PT_ADDLINES, PTR_SlideTraverse); P_PathTraverse(leadx, traily, leadx + mmomx, traily + mmomy, PT_ADDLINES, PTR_SlideTraverse); + // Now continue along the wall. + // First calculate remainder. + bestslidefrac = FRACUNIT - bestslidefrac; + + if (bestslidefrac > FRACUNIT) + bestslidefrac = FRACUNIT; + + if (bestslidefrac <= 0) + return; + + tmxmove = FixedMul(mmomx, (FRACUNIT - (FRACUNIT>>2) - (FRACUNIT>>3))); + tmymove = FixedMul(mmomy, (FRACUNIT - (FRACUNIT>>2) - (FRACUNIT>>3))); + + { + mobj_t *fx = P_SpawnMobj(mo->x, mo->y, mo->z, MT_BUMP); + if (mo->eflags & MFE_VERTICALFLIP) + fx->eflags |= MFE_VERTICALFLIP; + else + fx->eflags &= ~MFE_VERTICALFLIP; + fx->scale = mo->scale; + + S_StartSound(mo, sfx_s3k49); + } + + P_PlayerHitBounceLine(bestslideline); + mo->eflags |= MFE_JUSTBOUNCEDWALL; + + mo->momx = tmxmove; + mo->momy = tmymove; + mo->player->cmomx = tmxmove; + mo->player->cmomy = tmymove; + + P_TryMove(mo, mo->x + tmxmove, mo->y + tmymove, true); +} + +// +// P_BounceMove +// +// The momx / momy move is bad, so try to bounce off a wall. +// +void P_BounceMove(mobj_t *mo) +{ + fixed_t leadx, leady; + fixed_t trailx, traily; + fixed_t newx, newy; + INT32 hitcount; + fixed_t mmomx = 0, mmomy = 0; + + if (mo->eflags & MFE_JUSTBOUNCEDWALL) + { + P_SlideMove(mo, true); + return; + } + + if (mo->player) + { + P_PlayerBounceMove(mo); + return; + } + + slidemo = mo; + hitcount = 0; + +retry: + if (++hitcount == 3) + goto bounceback; // don't loop forever + + mmomx = mo->momx; + mmomy = mo->momy; + + // trace along the three leading corners + if (mo->momx > 0) + { + leadx = mo->x + mo->radius; + trailx = mo->x - mo->radius; + } + else + { + leadx = mo->x - mo->radius; + trailx = mo->x + mo->radius; + } + + if (mo->momy > 0) + { + leady = mo->y + mo->radius; + traily = mo->y - mo->radius; + } + else + { + leady = mo->y - mo->radius; + traily = mo->y + mo->radius; + } + + bestslidefrac = FRACUNIT + 1; + + P_PathTraverse(leadx, leady, leadx + mmomx, leady + mmomy, PT_ADDLINES, PTR_SlideTraverse); + P_PathTraverse(trailx, leady, trailx + mmomx, leady + mmomy, PT_ADDLINES, PTR_SlideTraverse); + P_PathTraverse(leadx, traily, leadx + mmomx, traily + mmomy, PT_ADDLINES, PTR_SlideTraverse); + // move up to the wall - /*if (bestslidefrac == FRACUNIT + 1) + if (bestslidefrac == FRACUNIT + 1) { // the move must have hit the middle, so bounce straight back bounceback: @@ -3864,22 +3998,12 @@ bounceback: mo->momy *= -1; mo->momx = FixedMul(mo->momx, (FRACUNIT - (FRACUNIT>>2) - (FRACUNIT>>3))); mo->momy = FixedMul(mo->momy, (FRACUNIT - (FRACUNIT>>2) - (FRACUNIT>>3))); - - if (mo->player) - { - mo->player->cmomx *= -1; - mo->player->cmomy *= -1; - mo->player->cmomx = FixedMul(mo->player->cmomx, - (FRACUNIT - (FRACUNIT>>2) - (FRACUNIT>>3))); - mo->player->cmomy = FixedMul(mo->player->cmomy, - (FRACUNIT - (FRACUNIT>>2) - (FRACUNIT>>3))); - } } return; - }*/ + } // fudge a bit to make sure it doesn't hit - /*bestslidefrac -= 0x800; + bestslidefrac -= 0x800; if (bestslidefrac > 0) { newx = FixedMul(mmomx, bestslidefrac); @@ -3887,7 +4011,7 @@ bounceback: if (!P_TryMove(mo, mo->x + newx, mo->y + newy, true)) goto bounceback; - }*/ + } // Now continue along the wall. // First calculate remainder. @@ -3919,34 +4043,15 @@ bounceback: { tmxmove = FixedMul(mmomx, (FRACUNIT - (FRACUNIT>>2) - (FRACUNIT>>3))); tmymove = FixedMul(mmomy, (FRACUNIT - (FRACUNIT>>2) - (FRACUNIT>>3))); - if (mo->player) - { - mobj_t *fx = P_SpawnMobj(mo->x, mo->y, mo->z, MT_BUMP); - if (mo->eflags & MFE_VERTICALFLIP) - fx->eflags |= MFE_VERTICALFLIP; - else - fx->eflags &= ~MFE_VERTICALFLIP; - fx->scale = mo->scale; - - S_StartSound(mo, sfx_s3k49); - } } - P_HitBounceLine(bestslideline); - mo->eflags |= MFE_JUSTBOUNCEDWALL; + P_HitBounceLine(bestslideline); // clip the moves mo->momx = tmxmove; mo->momy = tmymove; - if (mo->player) - { - mo->player->cmomx = tmxmove; - mo->player->cmomy = tmymove; - } - - /*if (!P_TryMove(mo, mo->x + tmxmove, mo->y + tmymove, true)) - goto retry;*/ - P_TryMove(mo, mo->x + tmxmove, mo->y + tmymove, true); + if (!P_TryMove(mo, mo->x + tmxmove, mo->y + tmymove, true)) + goto retry; } // diff --git a/src/p_mobj.c b/src/p_mobj.c index e6255d07..55c5c5ff 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2907,7 +2907,7 @@ static void P_PlayerZMovement(mobj_t *mo) mo->tics = -1; } else if ((mo->player->pflags & PF_JUMPED || (mo->player->pflags & (PF_SPINNING|PF_USEDOWN)) != (PF_SPINNING|PF_USEDOWN) - || mo->player->powers[pw_tailsfly]) && (mo->player->kartstuff[k_spinouttimer] == 0)) // SRB2kart + || mo->player->powers[pw_tailsfly]) && (mo->player->kartstuff[k_spinouttimer] == 0)) // SRB2kart { K_KartMoveAnimation(mo->player); } @@ -9907,7 +9907,7 @@ void P_SpawnPlayer(INT32 playernum) fixed_t newy; mobj_t *mo; - if (leveltime < 1 /*|| pcount <= 1*/) // Start of the map? + if (leveltime < 1 && !p->spectator /*|| pcount <= 1*/) // Start of the map? p->kartstuff[k_balloon] = cv_kartballoons.value; // Reset those balloons! if (p->kartstuff[k_balloon] <= 1) diff --git a/src/p_spec.c b/src/p_spec.c index 37797a9c..474c73bf 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3753,7 +3753,7 @@ DoneSection2: // Process Section 3 switch (special) { - case 1: // SRB2kart: bounce pad + case 1: // SRB2kart: Speed Bumps if (roversector || P_MobjReadyToTrigger(player->mo, sector)) { if (player->mo->eflags & MFE_SPRUNG) diff --git a/src/p_user.c b/src/p_user.c index a3d5bfdd..901ad958 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4015,7 +4015,6 @@ static void P_DoSpinDash(player_t *player, ticcmd_t *cmd) // SRB2kart - unused. // void P_DoJumpShield(player_t *player) { - return; // SRB2kart - Would be useful for feathers, but those are impossible to balance, so nuts to it. if (player->pflags & PF_THOKKED) return; @@ -4707,6 +4706,8 @@ static void P_3dMovement(player_t *player) if (player->exiting || player->pflags & PF_STASIS || player->kartstuff[k_spinouttimer]) // pw_introcam? { cmd->forwardmove = cmd->sidemove = 0; + if (player->kartstuff[k_sneakertimer]) + cmd->forwardmove = 50; if (player->pflags & PF_GLIDING) { if (!player->skidtime) @@ -4797,7 +4798,7 @@ static void P_3dMovement(player_t *player) cmd->forwardmove = 0; // Do not let the player control movement if not onground. - // SRB2Kart: feather and speed bumps are supposed to control like you're on the ground + // SRB2Kart: pogo spring and speed bumps are supposed to control like you're on the ground onground = (P_IsObjectOnGround(player->mo) || (player->kartstuff[k_pogospring])); player->aiming = cmd->aiming<buttons & BT_BRAKE && !cmd->forwardmove) // SRB2kart - braking isn't instant movepushforward /= 64; + if (cmd->forwardmove > 0) + player->kartstuff[k_brakestop] = 0; + else if (player->kartstuff[k_brakestop] < 6) // Don't start reversing with brakes until you've made a stop first + { + if (player->speed < 8*FRACUNIT) + player->kartstuff[k_brakestop]++; + movepushforward = 0; + } + #ifdef ESLOPE totalthrust.x += P_ReturnThrustX(player->mo, movepushangle, movepushforward); totalthrust.y += P_ReturnThrustY(player->mo, movepushangle, movepushforward); @@ -4834,7 +4844,7 @@ static void P_3dMovement(player_t *player) } // Sideways movement - if (cmd->sidemove != 0 && !(player->exiting || (P_PlayerInPain(player)))) + if (cmd->sidemove != 0 && !(player->exiting || player->kartstuff[k_spinouttimer])) { if (cmd->sidemove > 0) movepushside = (cmd->sidemove * FRACUNIT/128) + FixedDiv(player->speed, K_GetKartSpeed(player, true)); @@ -6543,23 +6553,6 @@ static void P_MovePlayer(player_t *player) // MOVEMENT CODE // ////////////////////// - //{ SRB2kart slip net - - if (player->kartstuff[k_spinouttimer] > 0 && player->kartstuff[k_spinout] == 0) - { - K_SpinPlayer(player, NULL); // Here just for in-level oil spills now - } - // If you have one but not the other, we should get rid of the one we have - else if (player->kartstuff[k_spinouttimer] == 0 && player->kartstuff[k_spinout] > 0) - player->kartstuff[k_spinout] = 0; - - // If somehow the power has gotten larger than the timer, it should be lowered back to it - if (player->kartstuff[k_spinouttimer] > player->kartstuff[k_spinout]) - player->kartstuff[k_spinouttimer] = player->kartstuff[k_spinout]; - - //} - - if (twodlevel || player->mo->flags2 & MF2_TWOD) // 2d-level, so special control applies. P_2dMovement(player); else diff --git a/src/r_draw.c b/src/r_draw.c index 5703f781..2e651ae3 100644 --- a/src/r_draw.c +++ b/src/r_draw.c @@ -175,7 +175,6 @@ const char *Color_Names[MAXSKINCOLORS] = "Yellow", // SKINCOLOR_YELLOW "Gold" // SKINCOLOR_GOLD }; -*/ const UINT8 Color_Opposite[MAXSKINCOLORS*2] = { @@ -206,6 +205,7 @@ const UINT8 Color_Opposite[MAXSKINCOLORS*2] = SKINCOLOR_NONE,8, // SKINCOLOR_YELLOW SKINCOLOR_NONE,8 // SKINCOLOR_GOLD }; +*/ CV_PossibleValue_t Color_cons_t[MAXSKINCOLORS+1]; From aed30519d4413e14c26f114e67f29e73d4c35ec5 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 23 Jun 2018 18:47:32 +0100 Subject: [PATCH 062/293] Fix HWR_ProjectSprite to check properly whether the displayed player's mobj or its subsector exists, to avoid a crash when checking for fake planes. (also use viewplayer since its available to use, silly hardware code) Also tweaked a weird splitscreen check in HWR_DrawSpriteShadow; still investigating whether stplyr is ever not player 2 when it's player 2's view, but this looks better for now --- src/hardware/hw_main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index a5fe6b67..5d9c2993 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -3941,7 +3941,7 @@ static void HWR_DrawSpriteShadow(gr_vissprite_t *spr, GLPatch_t *gpatch, float t angle_t shadowdir; // Set direction - if (splitscreen && stplyr != &players[displayplayer]) + if (splitscreen && stplyr == &players[secondarydisplayplayer]) shadowdir = localangle2 + FixedAngle(cv_cam2_rotate.value); else shadowdir = localangle + FixedAngle(cv_cam_rotate.value); @@ -5302,7 +5302,10 @@ static void HWR_ProjectSprite(mobj_t *thing) } heightsec = thing->subsector->sector->heightsec; - phs = players[displayplayer].mo->subsector->sector->heightsec; + if (viewplayer->mo && viewplayer->mo->subsector) + phs = viewplayer->mo->subsector->sector->heightsec; + else + phs = -1; if (heightsec != -1 && phs != -1) // only clip things which are in special sectors { From 16e1569af1ef5ae24b34e4529757348ba430cb6d Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Sun, 24 Jun 2018 22:15:22 -0400 Subject: [PATCH 063/293] Lakitu murder & countdown improvements (I'm not SevenethSentienel! I just don't feel like logging out!) --- src/d_netcmd.c | 2 +- src/d_player.h | 6 +- src/dehacked.c | 11 +- src/doomstat.h | 1 + src/g_game.c | 7 +- src/info.c | 17 ++- src/info.h | 9 +- src/k_kart.c | 304 ++++++++++++++----------------------------------- src/k_kart.h | 2 +- src/p_enemy.c | 2 +- src/p_mobj.c | 6 +- src/p_setup.c | 2 +- src/p_spec.c | 2 +- src/p_user.c | 27 +++-- src/st_stuff.c | 8 +- 15 files changed, 142 insertions(+), 264 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 412de131..ab5852ed 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -1157,7 +1157,7 @@ UINT8 CanChangeSkin(INT32 playernum) return true; // Can change skin during initial countdown. - if (leveltime < 4*TICRATE) + if (leveltime < starttime) return true; if (G_TagGametype()) diff --git a/src/d_player.h b/src/d_player.h index bf4e91bf..cb60ee6f 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -274,10 +274,10 @@ typedef enum k_nextcheck, // Next checkpoint distance; for p_user.c (was "pw_ncd") k_waypoint, // Waypoints. k_starpostwp, // Temporarily stores player waypoint for... some reason. Used when respawning and finishing. - k_lakitu, // Timer for Lakitu to carry and drop the player + k_respawn, // Timer for the DEZ laser respawn effect k_throwdir, // Held dir of controls; 1 = forward, 0 = none, -1 = backward (was "player->heldDir") - k_lapanimation, // Used to make a swoopy lap lakitu, maybe other effects in the future + //k_lapanimation, // Used to make a swoopy lap lakitu, maybe other effects in the future k_cardanimation, // Used to determine the position of some full-screen Battle Mode graphics k_voices, // Used to stop the player saying more voices than it should k_tauntvoices, // Used to specifically stop taunt voice spam @@ -289,7 +289,7 @@ 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 Lakitu drops you + k_boostcharge, // Charge-up for boosting at the start of the race, or when dropping from respawn 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 diff --git a/src/dehacked.c b/src/dehacked.c index 299ec4b3..7b53d593 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6437,9 +6437,8 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_BATTLEBALLOON2", "S_BATTLEBALLOON3", - // Lakitu - "S_LAKITU1", - "S_LAKITU2", + // DEZ respawn laser + "S_DEZLASER", // Pokey "S_POKEY1", @@ -7165,7 +7164,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_BATTLEBALLOON", // Battle Mode balloon - "MT_LAKITU", + "MT_DEZLASER", "MT_POKEY", // Huh, thought this was a default asset for some reason, guess not. @@ -7565,10 +7564,10 @@ static const char *const KARTSTUFF_LIST[] = { "NEXTCHECK", "WAYPOINT", "STARPOSTWP", - "LAKITU", + "RESPAWN", "THROWDIR", - "LAPANIMATION", + //"LAPANIMATION", "CARDANIMATION", "VOICES", "TAUNTVOICES", diff --git a/src/doomstat.h b/src/doomstat.h index cf87ad97..33ce04c9 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -409,6 +409,7 @@ extern UINT16 spacetimetics; extern UINT16 extralifetics; // SRB2kart +extern tic_t starttime; extern INT32 hyudorotime; extern INT32 stealtime; extern INT32 sneakertime; diff --git a/src/g_game.c b/src/g_game.c index 0e1648c8..c73db542 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -207,6 +207,7 @@ UINT16 spacetimetics = 11*TICRATE + (TICRATE/2); UINT16 extralifetics = 4*TICRATE; // SRB2kart +tic_t starttime = 6*TICRATE + (3*TICRATE/4); INT32 hyudorotime = 7*TICRATE; INT32 stealtime = TICRATE/2; INT32 sneakertime = TICRATE + (TICRATE/3); @@ -1507,7 +1508,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) // SRB2kart - no additional angle if not moving if (((player->mo && player->speed > 0) // Moving - || (leveltime > 140 && (cmd->buttons & BT_ACCELERATE && cmd->buttons & BT_BRAKE)) // Rubber-burn turn + || (leveltime > starttime && (cmd->buttons & BT_ACCELERATE && cmd->buttons & BT_BRAKE)) // Rubber-burn turn || (player->spectator || objectplacing)) // Not a physical player && !(player->kartstuff[k_spinouttimer] && player->kartstuff[k_sneakertimer])) // Spinning and boosting cancels out spinout lang += (cmd->angleturn<<16); @@ -2435,8 +2436,8 @@ void G_PlayerReborn(INT32 player) P_RestoreMusic(p); - if (leveltime > 157 && !p->spectator) - p->kartstuff[k_lakitu] = 48; // Lakitu Spawner + if (leveltime > (starttime + (TICRATE/2)) && !p->spectator) + p->kartstuff[k_respawn] = 48; // Respawn effect if (gametype == GT_COOP) P_FindEmerald(); // scan for emeralds to hunt for diff --git a/src/info.c b/src/info.c index aa7267f6..642aaa44 100644 --- a/src/info.c +++ b/src/info.c @@ -57,7 +57,7 @@ char sprnames[NUMSPRITES + 1][5] = //SRB2kart Sprites "SPRG","BSPR","RNDM","RPOP","KFRE","KINV","KINF","DRIF","DUST","FITM", "BANA","GSHE","JAWZ","SSMN","KRBM","BLIG","LIGH","SINK","SITR","KBLN", - "LAKI","POKE","AUDI","DECO","DOOD","SNES","GBAS","SPRS","BUZB","CHOM", + "DEZL","POKE","AUDI","DECO","DOOD","SNES","GBAS","SPRS","BUZB","CHOM", "SACO","CRAB","SHAD","BUMP","FLEN","CLAS","PSHW","ARRO","ITEM","ITMI", "ITMN","PBOM" }; @@ -2763,8 +2763,7 @@ state_t states[NUMSTATES] = {SPR_KBLN, FF_FULLBRIGHT|1, -1, {NULL}, 0, 0, S_BATTLEBALLOON2}, // S_BATTLEBALLOON2 {SPR_KBLN, FF_FULLBRIGHT|2, -1, {NULL}, 0, 0, S_BATTLEBALLOON3}, // S_BATTLEBALLOON3 - {SPR_LAKI, 0, 64, {NULL}, 1, 0, S_LAKITU2}, // S_LAKITU1 - {SPR_LAKI, 1, 35, {NULL}, 0, 0, S_NULL}, // S_LAKITU2 + {SPR_DEZL, 0|FF_FULLBRIGHT, 8, {NULL}, 0, 0, S_NULL}, // S_DEZLASER {SPR_POKE, 0, 2, {A_MoveAbsolute}, 0, 2, S_POKEY2}, // S_POKEY1 {SPR_POKE, 1, 2, {A_MoveAbsolute}, 0, 2, S_POKEY3}, // S_POKEY2 @@ -15075,9 +15074,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_LAKITU + { // MT_DEZLASER -1, // doomednum - S_LAKITU1, // spawnstate + S_DEZLASER, // spawnstate 1000, // spawnhealth S_NULL, // seestate sfx_None, // seesound @@ -15092,13 +15091,13 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL, // xdeathstate sfx_None, // deathsound 8, // speed - 64*FRACUNIT, // radius - 57*FRACUNIT, // height - 0, // display offset + 42*FRACUNIT, // radius + 8*FRACUNIT, // height + 1, // display offset 16, // mass 0, // damage sfx_None, // activesound - MF_NOGRAVITY, // flags + MF_NOBLOCKMAP|MF_NOCLIPHEIGHT|MF_NOCLIPTHING|MF_NOGRAVITY|MF_SCENERY, // flags S_NULL // raisestate }, diff --git a/src/info.h b/src/info.h index ed1c53a7..519b55e1 100644 --- a/src/info.h +++ b/src/info.h @@ -600,7 +600,7 @@ typedef enum sprite SPR_SITR, // Kitchen Sink Trail SPR_KBLN, // Battle Mode Balloon - SPR_LAKI, // Lakitu + SPR_DEZL, // DEZ Laser respawn // Additional Kart Objects SPR_POKE, // Pokey @@ -3279,9 +3279,8 @@ typedef enum state S_BATTLEBALLOON2, S_BATTLEBALLOON3, - // Lakitu - S_LAKITU1, - S_LAKITU2, + // DEZ Laser respawn + S_DEZLASER, // Pokey S_POKEY1, @@ -4024,7 +4023,7 @@ typedef enum mobj_type MT_BATTLEBALLOON, // Battle Mode balloons - MT_LAKITU, + MT_DEZLASER, MT_POKEY, // Huh, thought this was a default asset for some reason, guess not. diff --git a/src/k_kart.c b/src/k_kart.c index 7b1ced80..0ab13627 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -919,8 +919,8 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid) || (mobj2->player && mobj2->player->playerstate != PST_LIVE)) return; - if ((mobj1->player && mobj1->player->kartstuff[k_lakitu]) - || (mobj2->player && mobj2->player->kartstuff[k_lakitu])) + if ((mobj1->player && mobj1->player->kartstuff[k_respawn]) + || (mobj2->player && mobj2->player->kartstuff[k_respawn])) return; // Don't bump if you've recently bumped @@ -1100,51 +1100,45 @@ static void K_UpdateOffroad(player_t *player) player->kartstuff[k_offroad] = 0; } -/** \brief Calculates the lakitu timer and drop-boosting +/** \brief Calculates the respawn timer and drop-boosting \param player player object passed from K_KartPlayerThink \return void */ -void K_LakituChecker(player_t *player) +void K_RespawnChecker(player_t *player) { ticcmd_t *cmd = &player->cmd; - /*if (player->kartstuff[k_lakitu] == 44) + if (player->kartstuff[k_respawn] > 3) { - mobj_t *mo; - angle_t newangle; - fixed_t newx; - fixed_t newy; - fixed_t newz; - newangle = player->mo->angle; - newx = player->mo->x + P_ReturnThrustX(player->mo, newangle, 0); - newy = player->mo->y + P_ReturnThrustY(player->mo, newangle, 0); - if (player->mo->eflags & MFE_VERTICALFLIP) - newz = player->mo->z - 128*(mapheaderinfo[gamemap-1]->mobj_scale); - else - newz = player->mo->z + 64*(mapheaderinfo[gamemap-1]->mobj_scale); - mo = P_SpawnMobj(newx, newy, newz, MT_LAKITU); - if (mo) - { - if (player->mo->eflags & MFE_VERTICALFLIP) - mo->eflags |= MFE_VERTICALFLIP; - mo->angle = newangle+ANGLE_180; - P_SetTarget(&mo->target, player->mo); - } - }*/ - - if (player->kartstuff[k_lakitu] > 3) - { - player->kartstuff[k_lakitu]--; + player->kartstuff[k_respawn]--; player->mo->momz = 0; player->powers[pw_flashing] = 2; player->powers[pw_nocontrol] = 2; - if (leveltime % 15 == 0) - S_StartSound(player->mo, sfx_lkt3); + if (leveltime % 8 == 0) + { + mobj_t *mo; + fixed_t newz; + + S_StartSound(player->mo, sfx_s3kcas); + + if (player->mo->eflags & MFE_VERTICALFLIP) + newz = player->mo->z + player->mo->height; + else + newz = player->mo->z; + mo = P_SpawnMobj(player->mo->x, player->mo->y, newz, MT_DEZLASER); + if (mo) + { + if (player->mo->eflags & MFE_VERTICALFLIP) + mo->eflags |= MFE_VERTICALFLIP; + P_SetTarget(&mo->target, player->mo); + mo->momz = (8*FRACUNIT)*P_MobjFlip(player->mo); + } + } } - // That's enough pointless fishing for now. - if (player->kartstuff[k_lakitu] > 0 && player->kartstuff[k_lakitu] <= 3) + + if (player->kartstuff[k_respawn] > 0 && player->kartstuff[k_respawn] <= 3) { if (!P_IsObjectOnGround(player->mo)) { @@ -1154,12 +1148,12 @@ void K_LakituChecker(player_t *player) if (cmd->buttons & BT_ACCELERATE) { player->powers[pw_flashing] = 0; - player->kartstuff[k_lakitu] = 0; + player->kartstuff[k_respawn] = 0; } } else { - player->kartstuff[k_lakitu]--; + player->kartstuff[k_respawn]--; // Quick! You only have three tics to boost! if (cmd->buttons & BT_ACCELERATE) K_DoSneaker(player, true); @@ -1240,7 +1234,7 @@ static void K_PlayOvertakeSound(mobj_t *source) return; // 4 seconds from before race begins, 10 seconds afterwards - if (leveltime < 14*TICRATE) + if (leveltime < starttime+(10*TICRATE)) return; S_StartSound(source, sfx_slow); @@ -2552,8 +2546,8 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) player->kartstuff[k_deathsentence]--; } - if (player->kartstuff[k_lapanimation]) - player->kartstuff[k_lapanimation]--; + /*if (player->kartstuff[k_lapanimation]) + player->kartstuff[k_lapanimation]--;*/ if (G_BattleGametype() && (player->exiting || player->kartstuff[k_comebacktimer])) { @@ -2606,9 +2600,9 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) else player->kartstuff[k_jmp] = 0; - // Lakitu Checker - if (player->kartstuff[k_lakitu]) - K_LakituChecker(player); + // Respawn Checker + if (player->kartstuff[k_respawn]) + K_RespawnChecker(player); // Roulette Code K_KartItemRoulette(player, cmd); @@ -2639,7 +2633,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) S_StopSoundByID(player->mo, sfx_smkinv); // Plays the music after the starting countdown. - if (P_IsLocalPlayer(player) && leveltime == 158) + if (P_IsLocalPlayer(player) && leveltime == (starttime + (TICRATE/2))) S_ChangeMusicInternal(mapmusname, true); } @@ -2960,7 +2954,7 @@ static void K_KartUpdatePosition(player_t *player) } } - if (leveltime < 4*TICRATE || oldposition == 0) + if (leveltime < starttime || oldposition == 0) oldposition = position; if (oldposition != position) // Changed places? @@ -3493,7 +3487,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) // Quick Turning // You can't turn your kart when you're not moving. // So now it's time to burn some rubber! - if (player->speed < 2 && leveltime > 140 && cmd->buttons & BT_ACCELERATE && cmd->buttons & BT_BRAKE && cmd->driftturn != 0) + if (player->speed < 2 && leveltime > starttime && cmd->buttons & BT_ACCELERATE && cmd->buttons & BT_BRAKE && cmd->driftturn != 0) { if (leveltime % 20 == 0) S_StartSound(player->mo, sfx_mkslid); @@ -3513,22 +3507,24 @@ void K_MoveKartPlayer(player_t *player, boolean onground) player->mo->momy = 0; } - // Play the stop light's sounds - if ((leveltime == (TICRATE-4)*2) || (leveltime == (TICRATE-2)*3)) - S_StartSound(NULL, sfx_lkt1); - if (leveltime == (TICRATE)*4) - S_StartSound(NULL, sfx_lkt2); + // Play the starting countdown sounds + if ((leveltime == starttime-(3*TICRATE)) || (leveltime == starttime-(2*TICRATE)) || (leveltime == starttime-TICRATE)) + S_StartSound(NULL, sfx_s3ka7); + if (leveltime == starttime) + S_StartSound(NULL, sfx_s3kad); + // Start charging once you're given the opportunity. - if (leveltime >= 70 && leveltime <= 140 && cmd->buttons & BT_ACCELERATE) + if (leveltime >= starttime-(2*TICRATE) && leveltime <= starttime && cmd->buttons & BT_ACCELERATE) player->kartstuff[k_boostcharge]++; - if (leveltime >= 70 && leveltime <= 140 && !(cmd->buttons & BT_ACCELERATE)) + if (leveltime >= starttime-(2*TICRATE) && leveltime <= starttime && !(cmd->buttons & BT_ACCELERATE)) player->kartstuff[k_boostcharge] = 0; + // Increase your size while charging your engine. - if (leveltime < 150) + if (leveltime < starttime+10) player->mo->destscale = (mapheaderinfo[gamemap-1]->mobj_scale) + (player->kartstuff[k_boostcharge]*131); // Determine the outcome of your charge. - if (leveltime > 140 && player->kartstuff[k_boostcharge]) + if (leveltime > starttime && player->kartstuff[k_boostcharge]) { // Get an instant boost! if (player->kartstuff[k_boostcharge] >= 35 && player->kartstuff[k_boostcharge] <= 50) @@ -3602,7 +3598,6 @@ void K_CheckBalloons(void) //{ SRB2kart HUD Code -#define NUMLAKIFRAMES 13 #define NUMPOSNUMS 10 #define NUMPOSFRAMES 7 // White, three blues, three reds @@ -3620,8 +3615,7 @@ static patch_t *kp_karmasticker; static patch_t *kp_splitkarmabomb; static patch_t *kp_timeoutsticker; -static patch_t *kp_lakitustart[NUMLAKIFRAMES]; -static patch_t *kp_lakitulaps[17]; +static patch_t *kp_startcountdown[8]; static patch_t *kp_positionnum[NUMPOSNUMS][NUMPOSFRAMES]; static patch_t *kp_winnernum[NUMPOSFRAMES]; @@ -3687,39 +3681,15 @@ void K_LoadKartHUDGraphics(void) kp_splitkarmabomb = W_CachePatchName("K_SPTKRM", PU_HUDGFX); kp_timeoutsticker = W_CachePatchName("K_STTOUT", PU_HUDGFX); - // Lakitu Start-up Frames - kp_lakitustart[0] = W_CachePatchName("K_LAKISA", PU_HUDGFX); - kp_lakitustart[1] = W_CachePatchName("K_LAKISB", PU_HUDGFX); - kp_lakitustart[2] = W_CachePatchName("K_LAKISC", PU_HUDGFX); - kp_lakitustart[3] = W_CachePatchName("K_LAKISD", PU_HUDGFX); - kp_lakitustart[4] = W_CachePatchName("K_LAKISE", PU_HUDGFX); - kp_lakitustart[5] = W_CachePatchName("K_LAKISF", PU_HUDGFX); - kp_lakitustart[6] = W_CachePatchName("K_LAKISG", PU_HUDGFX); - kp_lakitustart[7] = W_CachePatchName("K_LAKISH", PU_HUDGFX); - kp_lakitustart[8] = W_CachePatchName("K_LAKISI", PU_HUDGFX); - kp_lakitustart[9] = W_CachePatchName("K_LAKISJ", PU_HUDGFX); - kp_lakitustart[10] = W_CachePatchName("K_LAKISK", PU_HUDGFX); - kp_lakitustart[11] = W_CachePatchName("K_LAKISL", PU_HUDGFX); - kp_lakitustart[12] = W_CachePatchName("K_LAKISM", PU_HUDGFX); - - // Lakitu Lap Frames - kp_lakitulaps[0] = W_CachePatchName("K_LAKIL2", PU_HUDGFX); - kp_lakitulaps[1] = W_CachePatchName("K_LAKIL3", PU_HUDGFX); - kp_lakitulaps[2] = W_CachePatchName("K_LAKIL4", PU_HUDGFX); - kp_lakitulaps[3] = W_CachePatchName("K_LAKIL5", PU_HUDGFX); - kp_lakitulaps[4] = W_CachePatchName("K_LAKIL6", PU_HUDGFX); - kp_lakitulaps[5] = W_CachePatchName("K_LAKIL7", PU_HUDGFX); - kp_lakitulaps[6] = W_CachePatchName("K_LAKIL8", PU_HUDGFX); - kp_lakitulaps[7] = W_CachePatchName("K_LAKIL9", PU_HUDGFX); - kp_lakitulaps[8] = W_CachePatchName("K_LAKILF", PU_HUDGFX); - kp_lakitulaps[9] = W_CachePatchName("K_LAKIF1", PU_HUDGFX); - kp_lakitulaps[10] = W_CachePatchName("K_LAKIF2", PU_HUDGFX); - kp_lakitulaps[11] = W_CachePatchName("K_LAKIF3", PU_HUDGFX); - kp_lakitulaps[12] = W_CachePatchName("K_LAKIF4", PU_HUDGFX); - kp_lakitulaps[13] = W_CachePatchName("K_LAKIF5", PU_HUDGFX); - kp_lakitulaps[14] = W_CachePatchName("K_LAKIF6", PU_HUDGFX); - kp_lakitulaps[15] = W_CachePatchName("K_LAKIF7", PU_HUDGFX); - kp_lakitulaps[16] = W_CachePatchName("K_LAKIF8", PU_HUDGFX); + // Starting countdown + kp_startcountdown[0] = W_CachePatchName("K_CNT3A", PU_HUDGFX); + kp_startcountdown[1] = W_CachePatchName("K_CNT2A", PU_HUDGFX); + kp_startcountdown[2] = W_CachePatchName("K_CNT1A", PU_HUDGFX); + kp_startcountdown[3] = W_CachePatchName("K_CNTGOA", PU_HUDGFX); + kp_startcountdown[4] = W_CachePatchName("K_CNT3B", PU_HUDGFX); + kp_startcountdown[5] = W_CachePatchName("K_CNT2B", PU_HUDGFX); + kp_startcountdown[6] = W_CachePatchName("K_CNT1B", PU_HUDGFX); + kp_startcountdown[7] = W_CachePatchName("K_CNTGOB", PU_HUDGFX); // Position numbers for (i = 0; i < NUMPOSNUMS; i++) @@ -3802,7 +3772,7 @@ INT32 LAPS_X, LAPS_Y; // Lap Sticker INT32 SPDM_X, SPDM_Y; // Speedometer INT32 POSI_X, POSI_Y; // Position Number INT32 FACE_X, FACE_Y; // Top-four Faces -INT32 LAKI_X, LAKI_Y; // Lakitu +INT32 STCD_X, STCD_Y; // Starting countdown INT32 CHEK_Y; // CHECK graphic INT32 MINI_X, MINI_Y; // Minimap INT32 SPBW_X, SPBW_Y; // SPB warning @@ -3862,9 +3832,9 @@ static void K_initKartHUD(void) // Top-Four Faces FACE_X = 9; // 9 FACE_Y = 92; // 92 - // Lakitu - LAKI_X = 136; // 138 - LAKI_Y = 58 - 200; // 58 + // Starting countdown + STCD_X = BASEVIDWIDTH/2; // 9 + STCD_Y = BASEVIDHEIGHT/2; // 92 // CHECK graphic CHEK_Y = BASEVIDHEIGHT; // 200 // Minimap @@ -3883,6 +3853,8 @@ static void K_initKartHUD(void) POSI_Y = (BASEVIDHEIGHT/2)- 2; + STCD_Y = BASEVIDHEIGHT/4; + MINI_Y = (BASEVIDHEIGHT/2); SPBW_Y = (BASEVIDHEIGHT/2)-8; @@ -3897,6 +3869,8 @@ static void K_initKartHUD(void) POSI_X = (BASEVIDWIDTH/2)-3; + STCD_X = BASEVIDWIDTH/4; + MINI_X = (3*BASEVIDWIDTH/4); MINI_Y = (3*BASEVIDHEIGHT/4); @@ -4072,7 +4046,7 @@ static void K_drawKartTimestamp(void) // TIME_Y = 6; // 6 INT32 TIME_XB; - INT32 splitflags = K_calcSplitFlags(V_SNAPTOTOP|V_SNAPTOLEFT); + INT32 splitflags = K_calcSplitFlags(V_SNAPTOTOP|V_SNAPTORIGHT); V_DrawScaledPatch(TIME_X, TIME_Y, V_HUDTRANS|splitflags, kp_timestickerwide); @@ -4829,115 +4803,20 @@ static void K_drawBattleFullscreen(void) } } -static void K_drawStartLakitu(void) +static void K_drawStartCountdown(void) { - patch_t *localpatch = kp_nodraw; + INT32 pnum = 0; // 3 - fixed_t adjustY; - tic_t numFrames = 32; // Number of frames for the animation - fixed_t finalOffset = 206; // Number of pixels to offset the patch (This is actually 200, the 6 is a buffer for the parabola) + if (leveltime >= starttime-(2*TICRATE)) // 2 + pnum++; + if (leveltime >= starttime-TICRATE) // 1 + pnum++; + if (leveltime >= starttime) // GO! + pnum++; + if ((leveltime % (2*5)) / 5) // blink + pnum += 4; - if (leveltime < 52) localpatch = kp_lakitustart[0]; - if (leveltime >= 52 && leveltime < 56) localpatch = kp_lakitustart[1]; - if (leveltime >= 56 && leveltime < 60) localpatch = kp_lakitustart[2]; - if (leveltime >= 60 && leveltime < 64) localpatch = kp_lakitustart[3]; - if (leveltime >= 64 && leveltime < 91) localpatch = kp_lakitustart[4]; - if (leveltime >= 91 && leveltime < 95) localpatch = kp_lakitustart[5]; - if (leveltime >= 95 && leveltime < 99) localpatch = kp_lakitustart[6]; - if (leveltime >= 99 && leveltime < 103) localpatch = kp_lakitustart[7]; - if (leveltime >= 103 && leveltime < 130) localpatch = kp_lakitustart[8]; - if (leveltime >= 130 && leveltime < 134) localpatch = kp_lakitustart[9]; - if (leveltime >= 134 && leveltime < 138) localpatch = kp_lakitustart[10]; - if (leveltime >= 138 && leveltime < 142) localpatch = kp_lakitustart[11]; - if (leveltime >= 142 && leveltime < 178) localpatch = kp_lakitustart[12]; - - if (leveltime <= numFrames) - adjustY = (finalOffset - 1) - FixedMul((finalOffset), FRACUNIT / (leveltime + 3)); - else if (leveltime >= 146) - { - fixed_t templeveltime = leveltime - 145; - adjustY = (finalOffset - 1) - FixedMul((finalOffset), FRACUNIT / (numFrames + 3 - templeveltime)); - } - else - adjustY = 200; - - if (mirrormode) - V_DrawSmallScaledPatch(320-LAKI_X, LAKI_Y + adjustY, V_SNAPTOTOP|V_FLIP, localpatch); - else - V_DrawSmallScaledPatch(LAKI_X, LAKI_Y + adjustY, V_SNAPTOTOP, localpatch); -} - -static void K_drawLapLakitu(void) -{ - patch_t *localpatch = kp_nodraw; - - fixed_t swoopTimer = 80 - stplyr->kartstuff[k_lapanimation]; // Starts at 80, goes down by 1 per frame - fixed_t adjustY; - fixed_t numFrames = 32; // Number of frames for the animation - fixed_t finalOffset = 206; // Number of pixels to offset the patch (This is actually 200, the 6 is a buffer for the parabola) - boolean finishLine = false; - - if (stplyr->laps < (UINT8)(cv_numlaps.value - 1)) - { - switch (stplyr->laps) - { - case 1: localpatch = kp_lakitulaps[0]; break; - case 2: localpatch = kp_lakitulaps[1]; break; - case 3: localpatch = kp_lakitulaps[2]; break; - case 4: localpatch = kp_lakitulaps[3]; break; - case 5: localpatch = kp_lakitulaps[4]; break; - case 6: localpatch = kp_lakitulaps[5]; break; - case 7: localpatch = kp_lakitulaps[6]; break; - case 8: localpatch = kp_lakitulaps[7]; break; - } - } - else if (stplyr->laps == (UINT8)(cv_numlaps.value - 1)) - localpatch = kp_lakitulaps[8]; - else - { - // Change flag frame every 4 frames - switch (leveltime % 32) - { - case 0: case 1: case 2: case 3: - localpatch = kp_lakitulaps[9]; break; - case 4: case 5: case 6: case 7: - localpatch = kp_lakitulaps[10]; break; - case 8: case 9: case 10: case 11: - localpatch = kp_lakitulaps[11]; break; - case 12: case 13: case 14: case 15: - localpatch = kp_lakitulaps[12]; break; - case 16: case 17: case 18: case 19: - localpatch = kp_lakitulaps[13]; break; - case 20: case 21: case 22: case 23: - localpatch = kp_lakitulaps[14]; break; - case 24: case 25: case 26: case 27: - localpatch = kp_lakitulaps[15]; break; - case 28: case 29: case 30: case 31: - localpatch = kp_lakitulaps[16]; break; - } - finishLine = true; - finalOffset = 226; - } - - if (swoopTimer <= numFrames) - adjustY = (finalOffset - 1) - FixedMul((finalOffset), FRACUNIT / (swoopTimer + 3)); - else if (swoopTimer >= 48) - { - fixed_t templeveltime = swoopTimer - 47; - adjustY = (finalOffset - 1) - FixedMul((finalOffset), FRACUNIT / (numFrames + 3 - templeveltime)); - } - else - { - if (finishLine) - adjustY = 220; - else - adjustY = 200; - } - - if (mirrormode) - V_DrawSmallScaledPatch(320-(LAKI_X+14+(swoopTimer/4)), LAKI_Y + adjustY, V_SNAPTOTOP|V_FLIP, localpatch); - else - V_DrawSmallScaledPatch(LAKI_X+14+(swoopTimer/4), LAKI_Y + adjustY, V_SNAPTOTOP, localpatch); + V_DrawScaledPatch(STCD_X - (SHORT(kp_startcountdown[pnum]->width)/2), STCD_Y - (SHORT(kp_startcountdown[pnum]->height)/2), 0, kp_startcountdown[pnum]); } static void K_drawCheckpointDebugger(void) @@ -4970,21 +4849,9 @@ void K_drawKartHUD(void) return; } - // Draw Lakitu - // This is done first so that regardless of HUD layers, - // he'll appear to be in the 'real world' - if (!splitscreen) - { - if (leveltime < 178) - K_drawStartLakitu(); - - if (stplyr->kartstuff[k_lapanimation]) - K_drawLapLakitu(); - - // Draw the CHECK indicator before the other items too, so it's overlapped by everything else - if (cv_kartcheck.value) - K_drawKartPlayerCheck(); - } + // Draw the CHECK indicator before the other items, so it's overlapped by everything else + if (cv_kartcheck.value && !splitscreen) + K_drawKartPlayerCheck(); if (splitscreen == 0 && cv_kartminimap.value) K_drawKartMinimap(); // 3P splitscreen is handled above @@ -5036,6 +4903,11 @@ void K_drawKartHUD(void) } } + // Draw the starting countdown after everything else. + if (leveltime >= starttime-(3*TICRATE) + && leveltime < starttime+TICRATE) + K_drawStartCountdown(); + if (cv_kartdebugcheckpoint.value) K_drawCheckpointDebugger(); } diff --git a/src/k_kart.h b/src/k_kart.h index 1728740e..f8a363af 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -20,7 +20,7 @@ void K_RegisterKartStuff(void); boolean K_IsPlayerLosing(player_t *player); void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid); -void K_LakituChecker(player_t *player); +void K_RespawnChecker(player_t *player); void K_KartMoveAnimation(player_t *player); void K_KartPlayerThink(player_t *player, ticcmd_t *cmd); void K_KartPlayerAfterThink(player_t *player); diff --git a/src/p_enemy.c b/src/p_enemy.c index 228c2dec..a0056fec 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -850,7 +850,7 @@ void A_Look(mobj_t *actor) if (!P_LookForPlayers(actor, locvar1 & 65535, false , FixedMul((locvar1 >> 16)*FRACUNIT, actor->scale))) return; - if (leveltime < 4*TICRATE) // SRB2kart - no looking before race starts + if (leveltime < starttime) // SRB2kart - no looking before race starts return; // go into chase state diff --git a/src/p_mobj.c b/src/p_mobj.c index 55c5c5ff..2249165f 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -10046,7 +10046,7 @@ void P_MovePlayerToSpawn(INT32 playernum, mapthing_t *mthing) z = ceiling - mobjinfo[MT_PLAYER].height; if (mthing->options >> ZSHIFT) z -= ((mthing->options >> ZSHIFT) << FRACBITS); - if (p->kartstuff[k_lakitu]) + if (p->kartstuff[k_respawn]) z -= 128*FRACUNIT; } else @@ -10054,7 +10054,7 @@ void P_MovePlayerToSpawn(INT32 playernum, mapthing_t *mthing) z = floor; if (mthing->options >> ZSHIFT) z += ((mthing->options >> ZSHIFT) << FRACBITS); - if (p->kartstuff[k_lakitu]) + if (p->kartstuff[k_respawn]) z += 128*FRACUNIT; } @@ -10116,7 +10116,7 @@ void P_MovePlayerToStarpost(INT32 playernum) #endif sector->ceilingheight; - z = (p->starpostz + 128) << FRACBITS; // Lakitu spawns you off the ground + z = (p->starpostz + 128) << FRACBITS; // Respawn off the ground if (z < floor) z = floor; else if (z > ceiling - mobjinfo[MT_PLAYER].height) diff --git a/src/p_setup.c b/src/p_setup.c index 575452e9..cf2ad8e1 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2659,7 +2659,7 @@ boolean P_SetupLevel(boolean skipprecip) S_Start(); // SRB2 Kart - Yes this is weird, but we don't want the music to start until after the countdown is finished // but we do still need the mapmusname to be changed - if (leveltime < 158) + if (leveltime < (starttime + (TICRATE/2))) S_StopMusic(); // Let's fade to black here diff --git a/src/p_spec.c b/src/p_spec.c index 474c73bf..1e2934a6 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4151,7 +4151,7 @@ DoneSection2: if (player->starpostcount >= numstarposts/2) // srb2kart: must have touched *enough* starposts (was originally "(player->starpostnum == numstarposts)") { player->laps++; - player->kartstuff[k_lapanimation] = 80; + //player->kartstuff[k_lapanimation] = 80; if (player->pflags & PF_NIGHTSMODE) player->drillmeter += 48*20; diff --git a/src/p_user.c b/src/p_user.c index 901ad958..08f08b62 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1188,7 +1188,7 @@ void P_RestoreMusic(player_t *player) // Item - Invincibility else if (player->kartstuff[k_invincibilitytimer] > 1 && player->playerstate == PST_LIVE) S_ChangeMusicInternal("kinvnc", false); - else if (leveltime > 157) + else if (leveltime > (starttime + (TICRATE/2))) { // Event - Final Lap if (G_RaceGametype() && player->laps >= (UINT8)(cv_numlaps.value - 1)) @@ -7863,7 +7863,7 @@ static void P_DeathThink(player_t *player) // Force respawn if idle for more than 30 seconds in shooter modes. if (player->deadtimer > 30*TICRATE && !G_RaceGametype()) player->playerstate = PST_REBORN; - else if (player->lives > 0 && !G_IsSpecialStage(gamemap) && leveltime >= 140) // Don't allow "click to respawn" in special stages! + else if (player->lives > 0 && !G_IsSpecialStage(gamemap) && leveltime >= starttime) // Don't allow "click to respawn" in special stages! { // SRB2kart-- But wait, why'd we add this? :eggthinking: /*if (player->spectator) @@ -7872,7 +7872,7 @@ static void P_DeathThink(player_t *player) player->spectator = false; }*/ - //player->kartstuff[k_lakitu] = 48; // See G_PlayerReborn in g_game.c + //player->kartstuff[k_respawn] = 48; // See G_PlayerReborn in g_game.c // SRB2kart - spawn automatically after 1 second if (player->deadtimer > cv_respawntime.value*TICRATE) @@ -7937,9 +7937,9 @@ static void P_DeathThink(player_t *player) // Keep time rolling if (!(countdown2 && !countdown) && !player->exiting && !(player->pflags & PF_TIMEOVER)) { - if (leveltime >= 4*TICRATE) + if (leveltime >= starttime) { - player->realtime = leveltime - 4*TICRATE; + player->realtime = leveltime - starttime; if (player == &players[consoleplayer]) { if (player->spectator || !circuitmap) @@ -8136,7 +8136,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall subsector_t *newsubsec; fixed_t f1, f2; - cameranoclip = (player->pflags & (PF_NOCLIP|PF_NIGHTSMODE)) || (player->mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT)); // Noclipping player camera noclips too!! + cameranoclip = (player->pflags & (PF_NOCLIP|PF_NIGHTSMODE)) || (player->mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT) || (leveltime < 3*TICRATE)); // Noclipping player camera noclips too!! if (!(player->climbing || (player->pflags & PF_NIGHTSMODE) || player->playerstate == PST_DEAD)) { @@ -8270,7 +8270,14 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall lookback = camspin4; } - if (player->exiting) // SRB2Kart: Leave the camera behind while exiting, for dramatic effect! + if (leveltime < 3*TICRATE) // Whoooshy camera! + { + const INT32 introcam = (3*TICRATE - leveltime) * 3; + camrotate += 3*introcam/2; + camdist += (introcam * mapheaderinfo[gamemap-1]->mobj_scale); + camheight += (introcam * mapheaderinfo[gamemap-1]->mobj_scale); + } + else if (player->exiting) // SRB2Kart: Leave the camera behind while exiting, for dramatic effect! camstill = true; else if (lookback) // SRB2kart - Camera flipper { @@ -9270,7 +9277,7 @@ void P_PlayerThink(player_t *player) playerdeadview = false; // SRB2kart 010217 - if (leveltime < 4*TICRATE) + if (leveltime < starttime) player->powers[pw_nocontrol] = 2; /* if ((gametype == GT_RACE || gametype == GT_COMPETITION) && leveltime < 4*TICRATE) @@ -9284,9 +9291,9 @@ void P_PlayerThink(player_t *player) // Synchronizes the "real" amount of time spent in the level. if (!player->exiting) { - if (leveltime >= 4*TICRATE) + if (leveltime >= starttime) { - player->realtime = leveltime - 4*TICRATE; + player->realtime = leveltime - starttime; if (player == &players[consoleplayer]) { if (player->spectator || !circuitmap) diff --git a/src/st_stuff.c b/src/st_stuff.c index 33f7a275..78a6278c 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1488,13 +1488,13 @@ static void ST_drawMatchHUD(void) // SRB2kart - unused. static inline void ST_drawRaceHUD(void) { - if (leveltime > TICRATE && leveltime <= 2*TICRATE) + if (leveltime > starttime-(3*TICRATE) && leveltime <= starttime-(2*TICRATE)) V_DrawScaledPatch(SCX((BASEVIDWIDTH - SHORT(race3->width))/2), (INT32)(SCY(BASEVIDHEIGHT/2)), V_NOSCALESTART, race3); - else if (leveltime > 2*TICRATE && leveltime <= 3*TICRATE) + else if (leveltime > starttime-(2*TICRATE) && leveltime <= starttime-TICRATE) V_DrawScaledPatch(SCX((BASEVIDWIDTH - SHORT(race2->width))/2), (INT32)(SCY(BASEVIDHEIGHT/2)), V_NOSCALESTART, race2); - else if (leveltime > 3*TICRATE && leveltime <= 4*TICRATE) + else if (leveltime > starttime-TICRATE && leveltime <= starttime) V_DrawScaledPatch(SCX((BASEVIDWIDTH - SHORT(race1->width))/2), (INT32)(SCY(BASEVIDHEIGHT/2)), V_NOSCALESTART, race1); - else if (leveltime > 4*TICRATE && leveltime <= 5*TICRATE) + else if (leveltime > starttime && leveltime <= starttime+TICRATE) V_DrawScaledPatch(SCX((BASEVIDWIDTH - SHORT(racego->width))/2), (INT32)(SCY(BASEVIDHEIGHT/2)), V_NOSCALESTART, racego); if (circuitmap) From aa4398f7b931532f127cac56c74732a97eb6236c Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Mon, 25 Jun 2018 01:20:22 -0400 Subject: [PATCH 064/293] Noclip camera It doesn't FEEL like it noclips, but... --- src/p_user.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index 08f08b62..858966e1 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8136,7 +8136,13 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall subsector_t *newsubsec; fixed_t f1, f2; - cameranoclip = (player->pflags & (PF_NOCLIP|PF_NIGHTSMODE)) || (player->mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT) || (leveltime < 3*TICRATE)); // Noclipping player camera noclips too!! +#if 1 + cameranoclip = true; // We like camera noclip! +#else + cameranoclip = ((player->pflags & (PF_NOCLIP|PF_NIGHTSMODE)) + || (player->mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT)) + || (leveltime < 3*TICRATE)); // Noclipping player camera noclips too!! +#endif if (!(player->climbing || (player->pflags & PF_NIGHTSMODE) || player->playerstate == PST_DEAD)) { From ab645042135fa408fee908aca6e7a6b4d2719d48 Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Mon, 25 Jun 2018 01:36:21 -0400 Subject: [PATCH 065/293] Kitchen sink is back Haven't tested yet --- src/k_kart.c | 29 +++++++++++++++++++++++------ src/p_inter.c | 7 +------ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 0ab13627..84c865c6 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -658,11 +658,9 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, player_t *player, boolean case KITEM_POGOSPRING: if (!cv_pogospring.value) newodds = 0; break; - /*case KITEM_KITCHENSINK: - if (franticitems) newodds *= 2; - if (mashed) newodds /= 2; - if (!cv_kitchensink.value) newodds = 0; - break;*/ + case KITEM_KITCHENSINK: + newodds = 0; // Not obtained via normal means. + break; case KRITEM_TRIPLESNEAKER: if (franticitems) newodds *= 2; if (mashed) newodds /= 2; @@ -2297,7 +2295,17 @@ static void K_DoHyudoroSteal(player_t *player) prandom = P_RandomFixed(); S_StartSound(player->mo, sfx_s3k92); - if ((G_RaceGametype() && player->kartstuff[k_position] == 1) || numplayers == 0) // No-one can be stolen from? Get longer invisibility for nothing + if (P_RandomChance(FRACUNIT/256)) // BEHOLD THE KITCHEN SINK + { + player->kartstuff[k_hyudorotimer] = hyudorotime; + player->kartstuff[k_stealingtimer] = stealtime; + + player->kartstuff[k_itemtype] = KITEM_KITCHENSINK; + player->kartstuff[k_itemamount] = 1; + player->kartstuff[k_itemheld] = 0; + return; + } + else if ((G_RaceGametype() && player->kartstuff[k_position] == 1) || numplayers == 0) // No-one can be stolen from? Oh well... { player->kartstuff[k_hyudorotimer] = hyudorotime; player->kartstuff[k_stealingtimer] = stealtime; @@ -3371,6 +3379,15 @@ void K_MoveKartPlayer(player_t *player, boolean onground) player->kartstuff[k_itemamount]--; } break; + case KITEM_KITCHENSINK: + if (ATTACK_IS_DOWN && !HOLDING_ITEM && NO_HYUDORO) + { + K_ThrowKartItem(player, false, MT_SINK, 1, true); + K_PlayTauntSound(player->mo); + player->kartstuff[k_itemamount]--; + player->kartstuff[k_itemheld] = 0; + } + break; case KITEM_SAD: if (ATTACK_IS_DOWN && !HOLDING_ITEM && NO_HYUDORO && !player->kartstuff[k_sadtimer]) diff --git a/src/p_inter.c b/src/p_inter.c index aac513b1..aced4ca5 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2122,12 +2122,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source) } else if ((target->type == MT_GREENSHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_ORBINAUT) // orbit items || (target->type == MT_JAWZ_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_JAWZ)) - { - if (target->lastlook != 0) - target->target->player->kartstuff[k_itemamount] = target->lastlook-1; - else - target->target->player->kartstuff[k_itemamount]--; - } + target->target->player->kartstuff[k_itemamount]--; if (target->target->player->kartstuff[k_itemamount] < 0) target->target->player->kartstuff[k_itemamount] = 0; From 18b3d2d14c5294d0f2fdf9e57ba5770f12dbf5ba Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Mon, 25 Jun 2018 06:58:23 -0400 Subject: [PATCH 066/293] Spinout type is now passed through K_SpinPlayer This means we don't have to reset spinouttype's value immediately after using it, which means no more wipeout timer garbage. --- src/k_kart.c | 20 +++++++++++--------- src/k_kart.h | 2 +- src/lua_baselib.c | 3 ++- src/p_inter.c | 12 +++--------- src/p_map.c | 16 ++++++++-------- src/p_spec.c | 3 +-- src/p_user.c | 2 +- 7 files changed, 27 insertions(+), 31 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 84c865c6..afeae691 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1425,7 +1425,7 @@ fixed_t K_3dKartMovement(player_t *player, boolean onground, fixed_t forwardmove return finalspeed; } -void K_SpinPlayer(player_t *player, mobj_t *source) +void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type) { if (player->health <= 0) return; @@ -1464,6 +1464,8 @@ void K_SpinPlayer(player_t *player, mobj_t *source) player->kartstuff[k_comebacktimer] = comebacktime; + player->kartstuff[k_spinouttype] = type; + if (player->kartstuff[k_spinouttype] <= 0) { player->kartstuff[k_spinouttimer] = 3*TICRATE/2; // Banana Spinout @@ -1482,8 +1484,6 @@ void K_SpinPlayer(player_t *player, mobj_t *source) if (player->mo->state != &states[S_KART_SPIN]) P_SetPlayerMobjState(player->mo, S_KART_SPIN); - player->kartstuff[k_spinouttype] = 0; - return; } @@ -1523,7 +1523,7 @@ void K_SquishPlayer(player_t *player, mobj_t *source) player->kartstuff[k_comebacktimer] = comebacktime; - player->kartstuff[k_squishedtimer] = TICRATE; + player->kartstuff[k_squishedtimer] = 2*TICRATE; player->powers[pw_flashing] = K_GetKartFlashing(); @@ -1584,8 +1584,6 @@ void K_ExplodePlayer(player_t *player, mobj_t *source) // A bit of a hack, we ju if (player->mo->state != &states[S_KART_SPIN]) P_SetPlayerMobjState(player->mo, S_KART_SPIN); - player->kartstuff[k_spinouttype] = 0; - P_PlayRinglossSound(player->mo); if (P_IsLocalPlayer(player)) @@ -2483,9 +2481,13 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) player->mo->colorized = false; } - if (player->kartstuff[k_spinouttimer] - && (P_IsObjectOnGround(player->mo) || player->kartstuff[k_spinouttype] == 1)) - player->kartstuff[k_spinouttimer]--; + if (player->kartstuff[k_spinouttimer]) + { + if (P_IsObjectOnGround(player->mo) || player->kartstuff[k_spinouttype] == 1) + player->kartstuff[k_spinouttimer]--; + if (player->kartstuff[k_spinouttimer] == 0) + player->kartstuff[k_spinouttype] = 0; // Reset type + } else if (!comeback) player->kartstuff[k_comebacktimer] = comebacktime; else if (player->kartstuff[k_comebacktimer]) diff --git a/src/k_kart.h b/src/k_kart.h index f8a363af..cb7dce21 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -24,7 +24,7 @@ void K_RespawnChecker(player_t *player); void K_KartMoveAnimation(player_t *player); void K_KartPlayerThink(player_t *player, ticcmd_t *cmd); void K_KartPlayerAfterThink(player_t *player); -void K_SpinPlayer(player_t *player, mobj_t *source); +void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type); void K_SquishPlayer(player_t *player, mobj_t *source); void K_ExplodePlayer(player_t *player, mobj_t *source); void K_StealBalloon(player_t *player, player_t *victim, boolean force); diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 930feb55..1ec57030 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -2012,12 +2012,13 @@ static int lib_kSpinPlayer(lua_State *L) { player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); mobj_t *source = *((mobj_t **)luaL_checkudata(L, 2, META_MOBJ)); + INT32 type = (INT32)luaL_checkinteger(L, 3); NOHUD if (!player) return LUA_ErrInvalid(L, "player_t"); if (!source) return LUA_ErrInvalid(L, "mobj_t"); - K_SpinPlayer(player, source); + K_SpinPlayer(player, source, type); return 0; } diff --git a/src/p_inter.c b/src/p_inter.c index aced4ca5..9e313384 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -3189,16 +3189,12 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da // Don't flip out while super! if (!player->kartstuff[k_invincibilitytimer] && player->kartstuff[k_growshrinktimer] <= 0) { - // Start slipping! - K_SpinPlayer(player, source); - // Start shrinking! player->mo->scalespeed = FRACUNIT/TICRATE; player->mo->destscale = 6*(mapheaderinfo[gamemap-1]->mobj_scale)/8; // Wipeout - player->kartstuff[k_spinouttype] = 1; - K_SpinPlayer(player, source); + K_SpinPlayer(player, source, 1); damage = player->mo->health - 1; P_RingDamage(player, inflictor, source, damage); P_PlayerRingBurst(player, 5); @@ -3268,8 +3264,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da || inflictor->player)) { player->kartstuff[k_sneakertimer] = 0; - player->kartstuff[k_spinouttype] = 1; - K_SpinPlayer(player, source); + K_SpinPlayer(player, source, 1); damage = player->mo->health - 1; P_RingDamage(player, inflictor, source, damage); P_PlayerRingBurst(player, 5); @@ -3282,8 +3277,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da } else { - player->kartstuff[k_spinouttype] = -1; - K_SpinPlayer(player, source); + K_SpinPlayer(player, source, 0); } return true; } diff --git a/src/p_map.c b/src/p_map.c index 01a16242..b91d628a 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -844,7 +844,7 @@ static boolean PIT_CheckThing(mobj_t *thing) if (tmthing->state == &states[S_MINEEXPLOSION1]) K_ExplodePlayer(thing->player, tmthing->target); else - K_SpinPlayer(thing->player, tmthing->target); + K_SpinPlayer(thing->player, tmthing->target, 0); } return true; // This doesn't collide with anything, but we want it to effect the player anyway. @@ -877,7 +877,7 @@ static boolean PIT_CheckThing(mobj_t *thing) if (thing->type == MT_PLAYER) { // Player Damage - K_SpinPlayer(thing->player, tmthing->target); + K_SpinPlayer(thing->player, tmthing->target, 0); // This Item Damage if (tmthing->eflags & MFE_VERTICALFLIP) @@ -1140,7 +1140,7 @@ static boolean PIT_CheckThing(mobj_t *thing) return true; // Player Damage - K_SpinPlayer(tmthing->player, thing->target); + K_SpinPlayer(tmthing->player, thing->target, 0); // Other Item Damage if (thing->eflags & MFE_VERTICALFLIP) @@ -1170,7 +1170,7 @@ static boolean PIT_CheckThing(mobj_t *thing) if (thing->state == &states[S_MINEEXPLOSION1]) K_ExplodePlayer(tmthing->player, thing->target); else - K_SpinPlayer(tmthing->player, thing->target); + K_SpinPlayer(tmthing->player, thing->target, 0); return true; } @@ -1648,7 +1648,7 @@ static boolean PIT_CheckThing(mobj_t *thing) if (G_BattleGametype() && tmthing->player->kartstuff[k_pogospring]) { K_StealBalloon(tmthing->player, thing->player, false); - K_SpinPlayer(thing->player, tmthing); + K_SpinPlayer(thing->player, tmthing, 0); } } else if (P_IsObjectOnGround(tmthing) && thing->momz < 0) @@ -1657,7 +1657,7 @@ static boolean PIT_CheckThing(mobj_t *thing) if (G_BattleGametype() && thing->player->kartstuff[k_pogospring]) { K_StealBalloon(thing->player, tmthing->player, false); - K_SpinPlayer(tmthing->player, thing); + K_SpinPlayer(tmthing->player, thing, 0); } } else @@ -1668,12 +1668,12 @@ static boolean PIT_CheckThing(mobj_t *thing) if (thing->player->kartstuff[k_sneakertimer] && !(tmthing->player->kartstuff[k_sneakertimer])) { K_StealBalloon(thing->player, tmthing->player, false); - K_SpinPlayer(tmthing->player, thing); + K_SpinPlayer(tmthing->player, thing, 0); } else if (tmthing->player->kartstuff[k_sneakertimer] && !(thing->player->kartstuff[k_sneakertimer])) { K_StealBalloon(tmthing->player, thing->player, false); - K_SpinPlayer(thing->player, tmthing); + K_SpinPlayer(thing->player, tmthing, 0); } } diff --git a/src/p_spec.c b/src/p_spec.c index 1e2934a6..dddde55c 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3983,8 +3983,7 @@ DoneSection2: case 7: // SRB2kart 190117 - Oil Slick if (roversector || P_MobjReadyToTrigger(player->mo, sector)) { - player->kartstuff[k_spinouttype] = -1; - K_SpinPlayer(player, NULL); + K_SpinPlayer(player, NULL, 0); } break; diff --git a/src/p_user.c b/src/p_user.c index 858966e1..6540255b 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7675,7 +7675,7 @@ void P_NukeEnemies(mobj_t *inflictor, mobj_t *source, fixed_t radius) continue; if (mo->type == MT_PLAYER) // Players wipe out in Kart - K_SpinPlayer(mo->player, source); + K_SpinPlayer(mo->player, source, 0); //} else P_DamageMobj(mo, inflictor, source, 1000); From d726f82000767626414d351df685e82d816a73f3 Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Mon, 25 Jun 2018 07:28:27 -0400 Subject: [PATCH 067/293] Fix up the sink some --- src/info.c | 4 ++-- src/k_kart.c | 2 +- src/p_mobj.c | 8 ++++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/info.c b/src/info.c index 642aaa44..3befd920 100644 --- a/src/info.c +++ b/src/info.c @@ -14998,7 +14998,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_SINK, // spawnstate 105, // spawnhealth S_NULL, // seestate - sfx_None, // seesound + sfx_tossed, // seesound 8, // reactiontime sfx_None, // attacksound 256*FRACUNIT, // painstate @@ -15016,7 +15016,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_bomb, // activesound - MF_BOUNCE|MF_FLOAT|MF_NOCLIPTHING|MF_MISSILE|MF_SHOOTABLE, // flags + MF_BOUNCE|MF_SHOOTABLE, // flags S_NULL // raisestate }, diff --git a/src/k_kart.c b/src/k_kart.c index afeae691..74cf713a 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2113,7 +2113,7 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map { if (player->kartstuff[k_throwdir] == 1) dir = 2; - else if (player->kartstuff[k_throwdir] == -1) + else if (player->kartstuff[k_throwdir] == -1 && mapthing != MT_SINK) dir = -1; else dir = 1; diff --git a/src/p_mobj.c b/src/p_mobj.c index 2249165f..f1c2b15e 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1404,6 +1404,7 @@ 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); default: break; @@ -8123,6 +8124,8 @@ void P_MobjThinker(mobj_t *mobj) mobj->threshold--; break; case MT_SINK: + if (mobj->momx || mobj->momy) + P_SpawnGhostMobj(mobj); if (mobj->z <= mobj->floorz) { S_StartSound(mobj, mobj->info->deathsound); @@ -9071,12 +9074,13 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) case MT_BIGMACE: case MT_SMALLMACE: case MT_FALLINGROCK: //case MT_RANDOMITEM: + case MT_BATTLEBALLOON: case MT_BANANA: case MT_BANANA_SHIELD: + case MT_FAKEITEM: case MT_FAKESHIELD: case MT_GREENITEM: case MT_GREENSHIELD: case MT_JAWZ: case MT_JAWZ_DUD: case MT_JAWZ_SHIELD: - case MT_BATTLEBALLOON: case MT_FIREBALL: - case MT_FAKEITEM: case MT_FAKESHIELD: case MT_SSMINE: case MT_SSMINE_SHIELD: + case MT_FIREBALL: case MT_SINK: P_SpawnShadowMobj(mobj); default: break; From 6b222c493534c28eeee10f34d3175ef6114e72eb Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Mon, 25 Jun 2018 07:41:49 -0400 Subject: [PATCH 068/293] Fix wheels lingering after comeback --- src/p_mobj.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/p_mobj.c b/src/p_mobj.c index f1c2b15e..6a9efc02 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9343,6 +9343,18 @@ void P_RemoveMobj(mobj_t *mobj) if (mobj->type == MT_SHADOW) P_RemoveShadow(mobj); + if (mobj->type == MT_KARMAHITBOX) + { + mobj_t *cur = mobj->hnext; + + while (cur && !P_MobjWasRemoved(cur)) + { + mobj_t *prev = cur; // Kind of a dumb var, but we need to set cur before we remove the mobj + cur = cur->hnext; + P_RemoveMobj(prev); + } + } + mobj->health = 0; // Just because // unlink from sector and block lists From 7fdc9c80357c62b37c293f11d6e4805c97d7923d Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Mon, 25 Jun 2018 09:18:30 -0400 Subject: [PATCH 069/293] Intro camera can noclip, fix several compile errors --- src/doomdef.h | 4 ++++ src/doomstat.h | 1 + src/g_game.c | 3 +++ src/k_kart.c | 13 +++++++------ src/m_menu.c | 7 ++++--- src/p_local.h | 1 + src/p_map.c | 11 +++++++---- src/p_mobj.c | 20 +++++++++++--------- src/p_user.c | 16 ++++++++-------- 9 files changed, 46 insertions(+), 30 deletions(-) diff --git a/src/doomdef.h b/src/doomdef.h index 175838c0..6c2325c9 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -540,4 +540,8 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; /// \note Required for proper collision with moving sloped surfaces that have sector specials on them. #define SECTORSPECIALSAFTERTHINK +/// SRB2Kart: Camera always has noclip. +/// \note Kind of problematic. If we decide to keep this on, we'll need serious map changes. +//#define NOCLIPCAM + #endif // __DOOMDEF__ diff --git a/src/doomstat.h b/src/doomstat.h index 33ce04c9..aac49c60 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -409,6 +409,7 @@ extern UINT16 spacetimetics; extern UINT16 extralifetics; // SRB2kart +extern tic_t introtime; extern tic_t starttime; extern INT32 hyudorotime; extern INT32 stealtime; diff --git a/src/g_game.c b/src/g_game.c index c73db542..4b692ed9 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -207,6 +207,7 @@ UINT16 spacetimetics = 11*TICRATE + (TICRATE/2); UINT16 extralifetics = 4*TICRATE; // SRB2kart +tic_t introtime = 108; tic_t starttime = 6*TICRATE + (3*TICRATE/4); INT32 hyudorotime = 7*TICRATE; INT32 stealtime = TICRATE/2; @@ -2974,6 +2975,8 @@ boolean G_IsSpecialStage(INT32 mapnum) #if 0 if (gametype == GT_COOP && modeattacking != ATTACKING_RECORD && mapnum >= sstage_start && mapnum <= sstage_end) return true; +#else + (void)mapnum; #endif return false; } diff --git a/src/k_kart.c b/src/k_kart.c index 74cf713a..17153459 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -538,7 +538,7 @@ static void K_KartGetItemResult(player_t *player, SINT8 getitem) \return void */ -static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, player_t *player, boolean mashed) +static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, boolean mashed) { const INT32 distvar = (64*14); INT32 newodds; @@ -771,7 +771,7 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd) for (j = 0; j < NUMKARTRESULTS; j++) { - if (K_KartGetItemOdds(i, j, player, mashed) > 0) + if (K_KartGetItemOdds(i, j, mashed) > 0) { available = 1; break; @@ -810,8 +810,8 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd) UINT8 wantedpos = (player->kartstuff[k_balloon]-avgballoon)+2; // 0 is two balloons below average, 2 is average, 4 is two balloons above average if (wantedpos > 4) wantedpos = 4; - if (wantedpos < 0) - wantedpos = 0; + /*if (wantedpos < 0) + wantedpos = 0;*/ useodds = disttable[(wantedpos * distlen) / 5]; } } @@ -853,7 +853,7 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd) //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, player, mashed); chance++) \ + for (chance = 0; chance < K_KartGetItemOdds(pos, itemnum, mashed); chance++) \ spawnchance[numchoices++] = itemnum SETITEMRESULT(useodds, KITEM_SNEAKER); // Sneaker @@ -2438,7 +2438,9 @@ void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed) void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source) { if (banana->hnext) + { K_KillBananaChain(banana->hnext, inflictor, source); + } if (banana->health) { @@ -3715,7 +3717,6 @@ void K_LoadKartHUDGraphics(void) { for (j = 0; j < NUMPOSFRAMES; j++) { - //if (i > 4 && j < 4 && j != 0) continue; // We don't need blue numbers for ranks past 4th sprintf(buffer, "K_POSN%d%d", i, j); kp_positionnum[i][j] = (patch_t *) W_CachePatchName(buffer, PU_HUDGFX); } diff --git a/src/m_menu.c b/src/m_menu.c index cd8da4e6..bd4d0260 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -4332,14 +4332,15 @@ static char *M_GetConditionString(condition_t cond) case UC_EXTRAEMBLEM: return va("Get \"%s\" emblem", extraemblems[cond.requirement-1].name); default: - return ""; + return NULL; } } #define NUMCHECKLIST 23 static void M_DrawChecklist(void) { - INT32 i, line = 0, c, lastid; + UINT32 i, line = 0, c; + INT32 lastid; for (i = 0; i < MAXUNLOCKABLES; i++) { @@ -4366,7 +4367,7 @@ static void M_DrawChecklist(void) ++line; - if (cond.id != lastid) + if (lastid == -1 || cond.id != (UINT32)lastid) { V_DrawString(16, (line*8), V_MONOSPACE|V_ALLOWLOWERCASE|(achieved ? V_YELLOWMAP : 0), "*"); V_DrawString(32, (line*8), V_MONOSPACE|V_ALLOWLOWERCASE|(achieved ? V_YELLOWMAP : 0), str); diff --git a/src/p_local.h b/src/p_local.h index 8a4bfa7b..0d8ad716 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -338,6 +338,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff); boolean P_Move(mobj_t *actor, fixed_t speed); boolean P_TeleportMove(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z); void P_SlideMove(mobj_t *mo, boolean forceslide); +void P_BouncePlayerMove(mobj_t *mo); void P_BounceMove(mobj_t *mo); boolean P_CheckSight(mobj_t *t1, mobj_t *t2); void P_CheckHoopPosition(mobj_t *hoopthing, fixed_t x, fixed_t y, fixed_t z, fixed_t radius); diff --git a/src/p_map.c b/src/p_map.c index b91d628a..6b3af53c 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2516,10 +2516,13 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam) fixed_t tryx = thiscam->x; fixed_t tryy = thiscam->y; +#ifndef NOCLIPCAM if ((thiscam == &camera && (players[displayplayer].pflags & PF_NOCLIP)) || (thiscam == &camera2 && (players[secondarydisplayplayer].pflags & PF_NOCLIP)) || (thiscam == &camera3 && (players[thirddisplayplayer].pflags & PF_NOCLIP)) - || (thiscam == &camera4 && (players[fourthdisplayplayer].pflags & PF_NOCLIP))) + || (thiscam == &camera4 && (players[fourthdisplayplayer].pflags & PF_NOCLIP)) + || (leveltime < introtime)) +#endif { // Noclipping player camera noclips too!! floatok = true; thiscam->floorz = thiscam->z; @@ -3823,12 +3826,12 @@ stairstep: } // -// P_PlayerBounceMove +// P_BouncePlayerMove // // Bounce move, for players. // -void P_PlayerBounceMove(mobj_t *mo) +void P_BouncePlayerMove(mobj_t *mo) { fixed_t leadx, leady; fixed_t trailx, traily; @@ -3944,7 +3947,7 @@ void P_BounceMove(mobj_t *mo) if (mo->player) { - P_PlayerBounceMove(mo); + P_BouncePlayerMove(mo); return; } diff --git a/src/p_mobj.c b/src/p_mobj.c index 6a9efc02..9c2531b9 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3678,7 +3678,7 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled dummy.y = thiscam->y; dummy.z = thiscam->z; dummy.height = thiscam->height; - if (!resetcalled && !(player->pflags & PF_NOCLIP) && !P_CheckSight(&dummy, player->mo)) // TODO: "P_CheckCameraSight" instead. + if (!resetcalled && !(player->pflags & PF_NOCLIP || leveltime < introtime) && !P_CheckSight(&dummy, player->mo)) // TODO: "P_CheckCameraSight" instead. P_ResetCamera(player, thiscam); else P_SlideCameraMove(thiscam); @@ -3699,7 +3699,8 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled // adjust height thiscam->z += thiscam->momz + player->mo->pmomz; - if (!itsatwodlevel && !(player->pflags & PF_NOCLIP)) +#ifndef NOCLIPCAM + if (!itsatwodlevel && !(player->pflags & PF_NOCLIP || leveltime < introtime)) { // clip movement if (thiscam->z <= thiscam->floorz) // hit the floor @@ -3739,6 +3740,7 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled } } } +#endif } if (itsatwodlevel @@ -9337,13 +9339,7 @@ void P_RemoveMobj(mobj_t *mobj) iquetail = (iquetail+1)&(ITEMQUESIZE-1); } - if (mobj->type == MT_OVERLAY) - P_RemoveOverlay(mobj); - - if (mobj->type == MT_SHADOW) - P_RemoveShadow(mobj); - - if (mobj->type == MT_KARMAHITBOX) + if (mobj->type == MT_KARMAHITBOX) // Remove linked list objects for certain types { mobj_t *cur = mobj->hnext; @@ -9355,6 +9351,12 @@ void P_RemoveMobj(mobj_t *mobj) } } + if (mobj->type == MT_OVERLAY) + P_RemoveOverlay(mobj); + + if (mobj->type == MT_SHADOW) + P_RemoveShadow(mobj); + mobj->health = 0; // Just because // unlink from sector and block lists diff --git a/src/p_user.c b/src/p_user.c index 6540255b..103b85a9 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8136,12 +8136,12 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall subsector_t *newsubsec; fixed_t f1, f2; -#if 1 +#ifdef NOCLIPCAM cameranoclip = true; // We like camera noclip! #else cameranoclip = ((player->pflags & (PF_NOCLIP|PF_NIGHTSMODE)) - || (player->mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT)) - || (leveltime < 3*TICRATE)); // Noclipping player camera noclips too!! + || (player->mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT)) // Noclipping player camera noclips too!! + || (leveltime < introtime)); // Kart intro cam #endif if (!(player->climbing || (player->pflags & PF_NIGHTSMODE) || player->playerstate == PST_DEAD)) @@ -8276,12 +8276,12 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall lookback = camspin4; } - if (leveltime < 3*TICRATE) // Whoooshy camera! + if (leveltime < introtime) // Whoooshy camera! { - const INT32 introcam = (3*TICRATE - leveltime) * 3; - camrotate += 3*introcam/2; - camdist += (introcam * mapheaderinfo[gamemap-1]->mobj_scale); - camheight += (introcam * mapheaderinfo[gamemap-1]->mobj_scale); + const INT32 introcam = (introtime - leveltime); + camrotate += introcam*5; + camdist += (introcam * mapheaderinfo[gamemap-1]->mobj_scale)*3; + camheight += (introcam * mapheaderinfo[gamemap-1]->mobj_scale)*2; } else if (player->exiting) // SRB2Kart: Leave the camera behind while exiting, for dramatic effect! camstill = true; From 11aaad183742b33ab21808d30a6d37c68900e63b Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Mon, 25 Jun 2018 10:18:29 -0400 Subject: [PATCH 070/293] Tweaked item odds in battle Karma items can hand out x10 banana, and being ahead in Battle is way more focused on removing just your defensive options than making all of your options Orbinaut/Banana/Eggman (there'll still be a lot of those, but it doesn't lower the chance of the other items too badly). --- src/k_kart.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 17153459..178997f1 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -439,13 +439,13 @@ static INT32 K_KartItemOddsRace[NUMKARTRESULTS][9] = /*Sneaker*/ {20, 0, 0, 3, 6, 5, 0, 0, 0 }, // Sneaker /*Rocket Sneaker*/ { 0, 0, 0, 0, 0, 3, 5, 5, 0 }, // Rocket Sneaker /*Invincibility*/ { 0, 0, 0, 0, 0, 1, 6, 9,16 }, // Invincibility - /*Banana*/ { 0, 8, 4, 2, 1, 0, 0, 0, 0 }, // Banana + /*Banana*/ { 0, 9, 4, 2, 1, 0, 0, 0, 0 }, // Banana /*Eggman Monitor*/ { 0, 4, 3, 2, 0, 0, 0, 0, 0 }, // Eggman Monitor /*Orbinaut*/ { 0, 6, 5, 4, 2, 0, 0, 0, 0 }, // Orbinaut /*Jawz*/ { 0, 0, 3, 2, 2, 1, 0, 0, 0 }, // Jawz - /*Mine*/ { 0, 1, 1, 2, 1, 0, 0, 0, 0 }, // Mine + /*Mine*/ { 0, 0, 1, 2, 1, 0, 0, 0, 0 }, // Mine /*Ballhog*/ { 0, 0, 1, 2, 1, 0, 0, 0, 0 }, // Ballhog - /*Self-Propelled Bomb*/ { 0, 0, 1, 1, 1, 1, 2, 2, 2 }, // Self-Propelled Bomb + /*Self-Propelled Bomb*/ { 0, 0, 1, 1, 1, 2, 2, 3, 2 }, // Self-Propelled Bomb /*Grow*/ { 0, 0, 0, 0, 0, 0, 1, 1, 2 }, // Grow /*Shrink*/ { 0, 0, 0, 0, 0, 0, 1, 1, 2 }, // Shrink /*Lightning Shield*/ { 0, 1, 2, 0, 0, 0, 0, 0, 0 }, // Lightning Shield @@ -462,26 +462,26 @@ static INT32 K_KartItemOddsRace[NUMKARTRESULTS][9] = static INT32 K_KartItemOddsBattle[NUMKARTRESULTS][6] = { //P-Odds 0 1 2 3 4 5 - /*Sneaker*/ { 3, 1, 2, 2, 0, 2 }, // Sneaker + /*Sneaker*/ { 3, 2, 2, 1, 0, 2 }, // Sneaker /*Rocket Sneaker*/ { 0, 0, 0, 0, 0, 0 }, // Rocket Sneaker /*Invincibility*/ { 4, 2, 1, 0, 0, 2 }, // Invincibility - /*Banana*/ { 0, 0, 2, 3, 6, 0 }, // Banana - /*Eggman Monitor*/ { 0, 0, 2, 2, 3, 0 }, // Eggman Monitor - /*Orbinaut*/ { 0, 0, 3, 5,10, 0 }, // Orbinaut - /*Jawz*/ { 3, 3, 2, 1, 0, 2 }, // Jawz - /*Mine*/ { 0, 3, 2, 1, 0, 2 }, // Mine - /*Ballhog*/ { 0, 2, 1, 1, 0, 2 }, // Ballhog + /*Banana*/ { 0, 0, 2, 3, 3, 0 }, // Banana + /*Eggman Monitor*/ { 0, 0, 2, 3, 5, 0 }, // Eggman Monitor + /*Orbinaut*/ { 0, 0, 3, 4, 5, 0 }, // Orbinaut + /*Jawz*/ { 1, 3, 2, 2, 2, 2 }, // Jawz + /*Mine*/ { 1, 3, 2, 2, 2, 2 }, // Mine + /*Ballhog*/ { 1, 2, 1, 1, 1, 2 }, // Ballhog /*Self-Propelled Bomb*/ { 0, 0, 0, 0, 0, 0 }, // Self-Propelled Bomb /*Grow*/ { 4, 2, 0, 0, 0, 2 }, // Grow /*Shrink*/ { 0, 0, 0, 0, 0, 0 }, // Shrink /*Lightning Shield*/ { 0, 0, 0, 0, 0, 0 }, // Lightning Shield /*Hyudoro*/ { 0, 0, 1, 1, 0, 0 }, // Hyudoro - /*Pogo Spring*/ { 0, 0, 1, 2, 0, 0 }, // Pogo Spring + /*Pogo Spring*/ { 0, 0, 1, 1, 0, 0 }, // Pogo Spring /*Kitchen Sink*/ { 0, 0, 0, 0, 0, 0 }, // Kitchen Sink /*Sneaker x3*/ { 2, 0, 0, 0, 0, 2 }, // Sneaker x3 - /*Banana x3*/ { 0, 2, 2, 1, 1, 2 }, // Banana x3 - /*Banana x10*/ { 1, 0, 0, 0, 0, 0 }, // Banana x10 - /*Orbinaut x3*/ { 0, 3, 1, 1, 0, 2 }, // Orbinaut x3 + /*Banana x3*/ { 0, 1, 2, 2, 2, 1 }, // Banana x3 + /*Banana x10*/ { 1, 0, 0, 0, 0, 1 }, // Banana x10 + /*Orbinaut x3*/ { 0, 3, 1, 0, 0, 2 }, // Orbinaut x3 /*Jawz x2*/ { 3, 2, 0, 0, 0, 2 } // Jawz x2 }; @@ -705,7 +705,7 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd) INT32 spawnchance[NUMKARTRESULTS * NUMKARTODDS]; INT32 chance = 0, numchoices = 0; INT32 avgballoon = 0; - UINT8 oddsvalid[9]; + boolean oddsvalid[9]; UINT8 disttable[14]; UINT8 distlen = 0; boolean mashed = false; @@ -761,11 +761,11 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd) for (i = 0; i < 9; i++) { INT32 j; - UINT8 available = 0; + boolean available = false; if (G_BattleGametype() && i > 5) { - oddsvalid[i] = 0; + oddsvalid[i] = false; break; } @@ -773,7 +773,7 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd) { if (K_KartGetItemOdds(i, j, mashed) > 0) { - available = 1; + available = true; break; } } From 501bfae9ac9954cf6bd95e78aed3f22bc22b4eee Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Mon, 25 Jun 2018 17:12:01 -0400 Subject: [PATCH 071/293] Revert MT_FIREBALL to vanilla, remove MT_FIRETRAIL, MT_BALLHOG added, bigger Jawz explosions --- src/dehacked.c | 8 ++--- src/info.c | 86 +++++++++++++++++++++++--------------------------- src/info.h | 9 ++---- src/k_kart.c | 4 +-- src/p_enemy.c | 4 +-- src/p_inter.c | 2 +- src/p_map.c | 14 ++++---- src/p_mobj.c | 18 +++++------ src/p_user.c | 2 +- 9 files changed, 65 insertions(+), 82 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 7b53d593..50ac71e3 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -5807,15 +5807,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_FIREBALL2", "S_FIREBALL3", "S_FIREBALL4", - "S_FIREBALL5", - "S_FIREBALL6", - "S_FIREBALL7", "S_FIREBALLEXP1", "S_FIREBALLEXP2", "S_FIREBALLEXP3", - "S_FIREBALLEXP4", - "S_FIREBALLEXP5", - "S_FIREBALLEXP6", "S_SHELL", "S_SHELL1", "S_SHELL2", @@ -7155,6 +7149,8 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_BOOMEXPLODE", "MT_BOOMPARTICLE", + "MT_BALLHOG", // Ballhog + "MT_BLUELIGHTNING", // Grow/shrink stuff "MT_BLUEEXPLOSION", "MT_LIGHTNING", diff --git a/src/info.c b/src/info.c index 3befd920..f6f3a013 100644 --- a/src/info.c +++ b/src/info.c @@ -2125,19 +2125,13 @@ state_t states[NUMSTATES] = {SPR_FFWR, 3, 3, {NULL}, 0, 0, S_FIREFLOWER1}, // S_FIREFLOWER4 // Thrown Mario Fireball - {SPR_FBLL, FF_FULLBRIGHT, 3, {NULL}, MT_FIRETRAIL, 0, S_FIREBALL2}, // S_FIREBALL1 - {SPR_FBLL, FF_FULLBRIGHT|1, 3, {NULL}, MT_FIRETRAIL, 0, S_FIREBALL3}, // S_FIREBALL2 - {SPR_FBLL, FF_FULLBRIGHT|2, 3, {NULL}, MT_FIRETRAIL, 0, S_FIREBALL4}, // S_FIREBALL3 - {SPR_FBLL, FF_FULLBRIGHT|3, 3, {NULL}, MT_FIRETRAIL, 0, S_FIREBALL5}, // S_FIREBALL4 - {SPR_FBLL, FF_FULLBRIGHT|4, 3, {NULL}, MT_FIRETRAIL, 0, S_FIREBALL6}, // S_FIREBALL5 - {SPR_FBLL, FF_FULLBRIGHT|5, 3, {NULL}, MT_FIRETRAIL, 0, S_FIREBALL7}, // S_FIREBALL6 - {SPR_FBLL, FF_FULLBRIGHT|6, 3, {NULL}, MT_FIRETRAIL, 0, S_FIREBALL1}, // S_FIREBALL7 - {SPR_FBLL, FF_FULLBRIGHT|7, 3, {NULL}, 0, 0, S_FIREBALLEXP2}, // S_FIREBALLEXP1 - {SPR_FBLL, FF_FULLBRIGHT|8, 3, {NULL}, 0, 0, S_FIREBALLEXP3}, // S_FIREBALLEXP2 - {SPR_FBLL, FF_FULLBRIGHT|9, 3, {NULL}, 0, 0, S_FIREBALLEXP4}, // S_FIREBALLEXP3 - {SPR_FBLL, FF_FULLBRIGHT|10, 3, {NULL}, 0, 0, S_FIREBALLEXP5}, // S_FIREBALLEXP4 - {SPR_FBLL, FF_FULLBRIGHT|11, 3, {NULL}, 0, 0, S_FIREBALLEXP6}, // S_FIREBALLEXP5 - {SPR_FBLL, FF_FULLBRIGHT|12, 3, {NULL}, 0, 0, S_NULL}, // S_FIREBALLEXP6 + {SPR_FBLL, FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_FIREBALL2}, // S_FIREBALL1 + {SPR_FBLL, FF_FULLBRIGHT|1, 3, {NULL}, 0, 0, S_FIREBALL3}, // S_FIREBALL2 + {SPR_FBLL, FF_FULLBRIGHT|2, 3, {NULL}, 0, 0, S_FIREBALL4}, // S_FIREBALL3 + {SPR_FBLL, FF_FULLBRIGHT|3, 3, {NULL}, 0, 0, S_FIREBALL1}, // S_FIREBALL4 + {SPR_FBLL, FF_FULLBRIGHT|4, 3, {NULL}, 0, 0, S_FIREBALLEXP2}, // S_FIREBALLEXP1 + {SPR_FBLL, FF_FULLBRIGHT|5, 3, {NULL}, 0, 0, S_FIREBALLEXP3}, // S_FIREBALLEXP2 + {SPR_FBLL, FF_FULLBRIGHT|6, 3, {NULL}, 0, 0, S_NULL}, // S_FIREBALLEXP3 // Turtle Shell {SPR_SHLL, 0, -1, {NULL}, 0, 0, S_NULL}, // S_SHELL @@ -12022,7 +12016,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { // MT_FIREBALL -1, // doomednum S_FIREBALL1, // spawnstate - 140, // spawnhealth + 1000, // spawnhealth S_FIREBALLEXP1, // seestate sfx_None, // seesound 8, // reactiontime @@ -12034,15 +12028,15 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_FIREBALLEXP1, // missilestate S_FIREBALLEXP1, // deathstate S_FIREBALLEXP1, // xdeathstate - sfx_None, // deathsound - 0, // speed - 16*FRACUNIT, // radius - 32*FRACUNIT, // height + sfx_mario1, // deathsound + 10*FRACUNIT, // speed + 4*FRACUNIT, // radius + 8*FRACUNIT, // height 0, // display offset 100, // mass 1, // damage sfx_None, // activesound - MF_SHOOTABLE|MF_BOUNCE, // flags + MF_NOBLOCKMAP|MF_FIRE|MF_MISSILE, // flags S_NULL // raisestate }, @@ -14615,33 +14609,6 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_FIRETRAIL - -1, // doomednum - S_FIRETRAIL1, // 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 - 20*FRACUNIT, // radius - 16*FRACUNIT, // height - 0, // display offset - 100, // mass - 0, // damage - sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_SCENERY, // flags - S_NULL // raisestate - }, - { // MT_JAWZ -1, // doomednum S_JAWZ1, // spawnstate @@ -14912,6 +14879,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_BALLHOG + -1, // doomednum + S_FIREBALL1, // spawnstate + 140, // 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_FIREBALLEXP1, // deathstate + S_NULL, // xdeathstate + sfx_mario1, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + 1, // damage + sfx_None, // activesound + MF_SHOOTABLE|MF_BOUNCE, // flags + S_NULL // raisestate + }, + { // MT_BLUELIGHTNING -1, // doomednum S_BLUELIGHTNING1, // spawnstate diff --git a/src/info.h b/src/info.h index 519b55e1..1db9cc94 100644 --- a/src/info.h +++ b/src/info.h @@ -2649,15 +2649,9 @@ typedef enum state S_FIREBALL2, S_FIREBALL3, S_FIREBALL4, - S_FIREBALL5, - S_FIREBALL6, - S_FIREBALL7, S_FIREBALLEXP1, S_FIREBALLEXP2, S_FIREBALLEXP3, - S_FIREBALLEXP4, - S_FIREBALLEXP5, - S_FIREBALLEXP6, S_SHELL, S_SHELL1, S_SHELL2, @@ -3999,7 +3993,6 @@ typedef enum mobj_type MT_GREENSHIELD, // Orbinaut stuff MT_GREENITEM, - MT_FIRETRAIL, MT_JAWZ, // Jawz stuff MT_JAWZ_DUD, @@ -4014,6 +4007,8 @@ typedef enum mobj_type MT_BOOMEXPLODE, MT_BOOMPARTICLE, + MT_BALLHOG, // Ballhog + MT_BLUELIGHTNING, // Grow/shrink stuff MT_BLUEEXPLOSION, MT_LIGHTNING, diff --git a/src/k_kart.c b/src/k_kart.c index 178997f1..96477779 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2128,7 +2128,7 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map if (missile) // Shootables { - if (mapthing == MT_FIREBALL) // Messy + if (mapthing == MT_BALLHOG) // Messy { if (dir == -1) { @@ -3288,7 +3288,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_FIREBALL, 1, false); + K_ThrowKartItem(player, true, MT_BALLHOG, 1, false); S_StartSound(player->mo, sfx_mario7); K_PlayTauntSound(player->mo); } diff --git a/src/p_enemy.c b/src/p_enemy.c index a0056fec..f6634e5d 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -8270,7 +8270,7 @@ void A_JawzExplode(mobj_t *actor) #endif truc = P_SpawnMobj(actor->x, actor->y, actor->z, MT_BOOMEXPLODE); - truc->scale = actor->scale; + truc->scale = actor->scale*2; truc->color = SKINCOLOR_RED; while (shrapnel) @@ -8279,7 +8279,7 @@ void A_JawzExplode(mobj_t *actor) truc = P_SpawnMobj(actor->x + P_RandomRange(-8, 8)*FRACUNIT, actor->y + P_RandomRange(-8, 8)*FRACUNIT, actor->z + P_RandomRange(0, 8)*FRACUNIT, MT_BOOMPARTICLE); - truc->scale = actor->scale; + truc->scale = actor->scale*2; speed = FixedMul(7*FRACUNIT, actor->scale)>>FRACBITS; truc->momx = P_RandomRange(-speed, speed)*FRACUNIT; diff --git a/src/p_inter.c b/src/p_inter.c index 9e313384..117c2459 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2080,7 +2080,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source) || target->type == MT_JAWZ || target->type == MT_JAWZ_DUD || target->type == MT_JAWZ_SHIELD || target->type == MT_BANANA || target->type == MT_BANANA_SHIELD || target->type == MT_FAKEITEM || target->type == MT_FAKESHIELD - || target->type == MT_FIREBALL)) // kart dead items + || target->type == MT_BALLHOG)) // kart dead items target->flags |= MF_NOGRAVITY; // Don't drop Tails 03-08-2000 else target->flags &= ~MF_NOGRAVITY; // lose it if you for whatever reason have it, I'm looking at you shields diff --git a/src/p_map.c b/src/p_map.c index 6b3af53c..7cc315ef 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -702,7 +702,7 @@ static boolean PIT_CheckThing(mobj_t *thing) else if (thing->type == MT_GREENITEM || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD || thing->type == MT_GREENSHIELD || thing->type == MT_JAWZ_SHIELD || thing->type == MT_BANANA || thing->type == MT_BANANA_SHIELD - || thing->type == MT_FIREBALL) + || thing->type == MT_BALLHOG) { // Other Item Damage if (thing->eflags & MFE_VERTICALFLIP) @@ -850,7 +850,7 @@ static boolean PIT_CheckThing(mobj_t *thing) return true; // This doesn't collide with anything, but we want it to effect the player anyway. } else if (tmthing->type == MT_BANANA_SHIELD || tmthing->type == MT_BANANA - || tmthing->type == MT_FIREBALL) + || tmthing->type == MT_BALLHOG) { // see if it went over / under if (tmthing->z > thing->z + thing->height) @@ -868,7 +868,7 @@ static boolean PIT_CheckThing(mobj_t *thing) && (tmthing->target == thing->target)) // Don't hit each other if you have the same target return true; - if (tmthing->type == MT_FIREBALL && thing->type == MT_FIREBALL) + if (tmthing->type == MT_BALLHOG && thing->type == MT_BALLHOG) return true; // Fireballs don't collide with eachother if (thing->player && thing->player->powers[pw_flashing]) @@ -894,7 +894,7 @@ static boolean PIT_CheckThing(mobj_t *thing) else if (thing->type == MT_BANANA || thing->type == MT_BANANA_SHIELD || thing->type == MT_GREENITEM || thing->type == MT_GREENSHIELD || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD || thing->type == MT_JAWZ_SHIELD - || thing->type == MT_FIREBALL) + || thing->type == MT_BALLHOG) { // Other Item Damage if (thing->eflags & MFE_VERTICALFLIP) @@ -975,7 +975,7 @@ static boolean PIT_CheckThing(mobj_t *thing) if (thing->type == MT_GREENITEM // When these items collide with the fake item, just the fake item is destroyed || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD || thing->type == MT_SSMINE - || thing->type == MT_BANANA || thing->type == MT_FIREBALL) + || thing->type == MT_BANANA || thing->type == MT_BALLHOG) { // This Item Damage if (tmthing->eflags & MFE_VERTICALFLIP) @@ -1089,7 +1089,7 @@ static boolean PIT_CheckThing(mobj_t *thing) || thing->type == MT_BANANA_SHIELD || thing->type == MT_BANANA || thing->type == MT_SSMINE_SHIELD || thing->type == MT_SSMINE || thing->type == MT_MINEEXPLOSION - || thing->type == MT_SINK || thing->type == MT_FIREBALL + || thing->type == MT_SINK || thing->type == MT_BALLHOG )) { // see if it went over / under @@ -1131,7 +1131,7 @@ static boolean PIT_CheckThing(mobj_t *thing) P_InstaThrust(thing, R_PointToAngle2(tmthing->x, tmthing->y, thing->x, thing->y)+ANGLE_90, 16*FRACUNIT); } else if (thing->type == MT_BANANA_SHIELD || thing->type == MT_BANANA - || thing->type == MT_FIREBALL) + || thing->type == MT_BALLHOG) { if ((thing->target == tmthing) && (thing->threshold > 0)) return true; diff --git a/src/p_mobj.c b/src/p_mobj.c index 9c2531b9..c328ee2e 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1724,7 +1724,7 @@ void P_XYMovement(mobj_t *mo) P_PushableCheckBustables(mo); //{ SRB2kart - Fireball - if (mo->type == MT_FIREBALL) + if (mo->type == MT_BALLHOG) { mo->health--; if (mo->health == 0) @@ -1862,7 +1862,7 @@ void P_XYMovement(mobj_t *mo) // draw damage on wall //SPLAT TEST ---------------------------------------------------------- #ifdef WALLSPLATS - if (blockingline && mo->type != MT_REDRING //&& mo->type != MT_FIREBALL + if (blockingline && mo->type != MT_REDRING && mo->type != MT_FIREBALL && !(mo->flags2 & (MF2_AUTOMATIC|MF2_RAILRING|MF2_BOUNCERING|MF2_EXPLOSION|MF2_SCATTER))) // set by last P_TryMove() that failed { @@ -1998,7 +1998,7 @@ void P_XYMovement(mobj_t *mo) #endif //{ SRB2kart stuff - if (mo->type == MT_GREENITEM || mo->type == MT_JAWZ_DUD || mo->type == MT_JAWZ || mo->type == MT_FIREBALL) //(mo->type == MT_JAWZ && !mo->tracer)) + if (mo->type == MT_GREENITEM || mo->type == MT_JAWZ_DUD || mo->type == MT_JAWZ || mo->type == MT_BALLHOG) //(mo->type == MT_JAWZ && !mo->tracer)) return; if (mo->player && mo->player->kartstuff[k_spinouttimer] && mo->player->speed <= mo->player->normalspeed/2) @@ -2333,7 +2333,7 @@ static boolean P_ZMovement(mobj_t *mo) case MT_GREENITEM: case MT_JAWZ: case MT_JAWZ_DUD: - case MT_FIREBALL: + case MT_BALLHOG: // Remove stuff from death pits. if (P_CheckDeathPitCollide(mo)) { @@ -7324,7 +7324,7 @@ void P_MobjThinker(mobj_t *mobj) P_PushableThinker(mobj); // Extinguish fire objects in water. (Yes, it's extraordinarily rare to have a pushable flame object, but Brak uses such a case.) - if (mobj->flags & MF_FIRE && mobj->type != MT_PUMA //&& mobj->type != MT_FIREBALL + if (mobj->flags & MF_FIRE && mobj->type != MT_PUMA && mobj->type != MT_FIREBALL && (mobj->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER))) { P_KillMobj(mobj, NULL, NULL); @@ -8119,9 +8119,7 @@ void P_MobjThinker(mobj_t *mobj) if (mobj->threshold > 0) mobj->threshold--; break; - case MT_FIREBALL: - var1 = MT_FIRETRAIL; - A_SmokeTrailer(mobj); + case MT_BALLHOG: if (mobj->threshold > 0) mobj->threshold--; break; @@ -8348,7 +8346,7 @@ void P_MobjThinker(mobj_t *mobj) P_MobjCheckWater(mobj); // Extinguish fire objects in water - if (mobj->flags & MF_FIRE && mobj->type != MT_PUMA //&& mobj->type != MT_FIREBALL + if (mobj->flags & MF_FIRE && mobj->type != MT_PUMA && mobj->type != MT_FIREBALL && (mobj->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER))) { P_KillMobj(mobj, NULL, NULL); @@ -9082,7 +9080,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) case MT_GREENITEM: case MT_GREENSHIELD: case MT_JAWZ: case MT_JAWZ_DUD: case MT_JAWZ_SHIELD: case MT_SSMINE: case MT_SSMINE_SHIELD: - case MT_FIREBALL: case MT_SINK: + case MT_BALLHOG: case MT_SINK: P_SpawnShadowMobj(mobj); default: break; diff --git a/src/p_user.c b/src/p_user.c index 103b85a9..f4d489ca 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7657,7 +7657,7 @@ void P_NukeEnemies(mobj_t *inflictor, mobj_t *source, fixed_t radius) || mo->type == MT_GREENSHIELD || mo->type == MT_JAWZ_SHIELD || mo->type == MT_BANANA || mo->type == MT_BANANA_SHIELD || mo->type == MT_FAKEITEM || mo->type == MT_FAKESHIELD - || mo->type == MT_FIREBALL) + || mo->type == MT_BALLHOG) { if (mo->eflags & MFE_VERTICALFLIP) mo->z -= mo->height; From cfaff6d2a828c5bdd3541aea92308af1bfa4f640 Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Mon, 25 Jun 2018 18:17:03 -0400 Subject: [PATCH 072/293] Ballhog stuff --- src/dehacked.c | 10 ---------- src/info.c | 33 ++++++++++++++++----------------- src/info.h | 21 +++++++++++---------- src/k_kart.c | 37 +++++++++++++++++++++++++------------ 4 files changed, 52 insertions(+), 49 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 50ac71e3..d6d8b413 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6348,16 +6348,6 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_JAWZ_DEAD2", //} - "S_FIRETRAIL1", - "S_FIRETRAIL2", - "S_FIRETRAIL3", - "S_FIRETRAIL4", - "S_FIRETRAIL5", - "S_FIRETRAIL6", - "S_FIRETRAIL7", - "S_FIRETRAIL8", - "S_FIRETRAIL9", - // Special Stage Mine "S_SSMINE1", "S_SSMINE2", diff --git a/src/info.c b/src/info.c index f6f3a013..bf02e0c4 100644 --- a/src/info.c +++ b/src/info.c @@ -56,10 +56,10 @@ char sprnames[NUMSPRITES + 1][5] = "SRBJ","SRBK","SRBL","SRBM","SRBN","SRBO", //SRB2kart Sprites "SPRG","BSPR","RNDM","RPOP","KFRE","KINV","KINF","DRIF","DUST","FITM", - "BANA","GSHE","JAWZ","SSMN","KRBM","BLIG","LIGH","SINK","SITR","KBLN", - "DEZL","POKE","AUDI","DECO","DOOD","SNES","GBAS","SPRS","BUZB","CHOM", - "SACO","CRAB","SHAD","BUMP","FLEN","CLAS","PSHW","ARRO","ITEM","ITMI", - "ITMN","PBOM" + "BANA","GSHE","JAWZ","SSMN","KRBM","BHOG","BLIG","LIGH","SINK","SITR", + "KBLN","DEZL","POKE","AUDI","DECO","DOOD","SNES","GBAS","SPRS","BUZB", + "CHOM","SACO","CRAB","SHAD","BUMP","FLEN","CLAS","PSHW","ARRO","ITEM", + "ITMI","ITMN","PBOM" }; // Doesn't work with g++, needs actionf_p1 (don't modify this comment) @@ -2680,16 +2680,6 @@ 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_FBLL, 13, 3, {NULL}, 0, 0, S_FIRETRAIL2}, // S_FIRETRAIL1 - {SPR_FBLL, 14, 3, {NULL}, 0, 0, S_FIRETRAIL3}, // S_FIRETRAIL2 - {SPR_FBLL, 15, 3, {NULL}, 0, 0, S_FIRETRAIL4}, // S_FIRETRAIL3 - {SPR_FBLL, 16, 3, {NULL}, 0, 0, S_FIRETRAIL5}, // S_FIRETRAIL4 - {SPR_FBLL, 17, 3, {NULL}, 0, 0, S_FIRETRAIL6}, // S_FIRETRAIL5 - {SPR_FBLL, 18, 3, {NULL}, 0, 0, S_FIRETRAIL7}, // S_FIRETRAIL6 - {SPR_FBLL, 19, 3, {NULL}, 0, 0, S_FIRETRAIL8}, // S_FIRETRAIL7 - {SPR_FBLL, 20, 3, {NULL}, 0, 0, S_FIRETRAIL9}, // S_FIRETRAIL8 - {SPR_FBLL, 21, 3, {NULL}, 0, 0, S_NULL}, // S_FIRETRAIL9 - {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 @@ -2737,6 +2727,15 @@ state_t states[NUMSTATES] = {SPR_KRBM, FF_FULLBRIGHT|8, 5, {NULL}, 0, 0, S_SLOWBOOM10}, // S_SLOWBOOM9 {SPR_KRBM, FF_FULLBRIGHT|9, 5, {NULL}, 0, 0, S_NULL}, // S_SLOWBOOM10 + {SPR_BHOG, 0, 3, {NULL}, 0, 0, S_BALLHOG2}, // S_BALLHOG1 + {SPR_BHOG, 1, 1, {NULL}, 0, 0, S_BALLHOG3}, // S_BALLHOG2 + {SPR_BHOG, 2, 2, {NULL}, 0, 0, S_BALLHOG4}, // S_BALLHOG3 + {SPR_BHOG, 3, 3, {NULL}, 0, 0, S_BALLHOG5}, // S_BALLHOG4 + {SPR_BHOG, 4, 3, {NULL}, 0, 0, S_BALLHOG6}, // S_BALLHOG5 + {SPR_BHOG, 5, 2, {NULL}, 0, 0, S_BALLHOG7}, // S_BALLHOG6 + {SPR_BHOG, 6, 1, {NULL}, 0, 0, S_BALLHOG8}, // S_BALLHOG7 + {SPR_BHOG, 7, 1, {NULL}, 0, 0, S_BALLHOG1}, // S_BALLHOG8 + {SPR_BLIG, 0, 2, {NULL}, 0, 0, S_BLUELIGHTNING2}, // S_BLUELIGHTNING1 {SPR_BLIG, 1, 2, {NULL}, 0, 0, S_BLUELIGHTNING3}, // S_BLUELIGHTNING2 {SPR_BLIG, 2, 2, {NULL}, 0, 0, S_BLUELIGHTNING4}, // S_BLUELIGHTNING3 @@ -2757,7 +2756,7 @@ state_t states[NUMSTATES] = {SPR_KBLN, FF_FULLBRIGHT|1, -1, {NULL}, 0, 0, S_BATTLEBALLOON2}, // S_BATTLEBALLOON2 {SPR_KBLN, FF_FULLBRIGHT|2, -1, {NULL}, 0, 0, S_BATTLEBALLOON3}, // S_BATTLEBALLOON3 - {SPR_DEZL, 0|FF_FULLBRIGHT, 8, {NULL}, 0, 0, S_NULL}, // S_DEZLASER + {SPR_DEZL, FF_FULLBRIGHT|FF_PAPERSPRITE, 8, {NULL}, 0, 0, S_NULL}, // S_DEZLASER {SPR_POKE, 0, 2, {A_MoveAbsolute}, 0, 2, S_POKEY2}, // S_POKEY1 {SPR_POKE, 1, 2, {A_MoveAbsolute}, 0, 2, S_POKEY3}, // S_POKEY2 @@ -14881,7 +14880,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { // MT_BALLHOG -1, // doomednum - S_FIREBALL1, // spawnstate + S_BALLHOG1, // spawnstate 140, // spawnhealth S_NULL, // seestate sfx_None, // seesound @@ -14892,7 +14891,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_FIREBALLEXP1, // deathstate + S_NULL, // deathstate S_NULL, // xdeathstate sfx_mario1, // deathsound 0, // speed diff --git a/src/info.h b/src/info.h index 1db9cc94..85882854 100644 --- a/src/info.h +++ b/src/info.h @@ -594,6 +594,7 @@ typedef enum sprite SPR_JAWZ, // Jawz SPR_SSMN, // SS Mine SPR_KRBM, // SS Mine BOOM + SPR_BHOG, // Ballhog SPR_BLIG, // Self-Propelled Bomb SPR_LIGH, // Grow/shrink beams (Metallic Maddness) SPR_SINK, // Kitchen Sink @@ -3190,16 +3191,6 @@ typedef enum state S_JAWZ_DEAD2, //} - S_FIRETRAIL1, - S_FIRETRAIL2, - S_FIRETRAIL3, - S_FIRETRAIL4, - S_FIRETRAIL5, - S_FIRETRAIL6, - S_FIRETRAIL7, - S_FIRETRAIL8, - S_FIRETRAIL9, - // Special Stage Mine S_SSMINE1, S_SSMINE2, @@ -3249,6 +3240,16 @@ typedef enum state S_SLOWBOOM9, S_SLOWBOOM10, + // Ballhog + S_BALLHOG1, + S_BALLHOG2, + S_BALLHOG3, + S_BALLHOG4, + S_BALLHOG5, + S_BALLHOG6, + S_BALLHOG7, + S_BALLHOG8, + // Self-Propelled Bomb - just an explosion for now... S_BLUELIGHTNING1, S_BLUELIGHTNING2, diff --git a/src/k_kart.c b/src/k_kart.c index 96477779..aac36241 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1116,22 +1116,32 @@ void K_RespawnChecker(player_t *player) player->powers[pw_nocontrol] = 2; if (leveltime % 8 == 0) { - mobj_t *mo; - fixed_t newz; - + INT32 i; S_StartSound(player->mo, sfx_s3kcas); - if (player->mo->eflags & MFE_VERTICALFLIP) - newz = player->mo->z + player->mo->height; - else - newz = player->mo->z; - mo = P_SpawnMobj(player->mo->x, player->mo->y, newz, MT_DEZLASER); - if (mo) + for (i = 0; i < 8; i++) { + mobj_t *mo; + angle_t newangle; + fixed_t newx, newy, newz; + + newangle = FixedAngle(((360/8)*i)*FRACUNIT); + newx = player->mo->x + P_ReturnThrustX(player->mo, newangle, 31*FRACUNIT); + newy = player->mo->y + P_ReturnThrustY(player->mo, newangle, 31*FRACUNIT); if (player->mo->eflags & MFE_VERTICALFLIP) - mo->eflags |= MFE_VERTICALFLIP; - P_SetTarget(&mo->target, player->mo); - mo->momz = (8*FRACUNIT)*P_MobjFlip(player->mo); + newz = player->mo->z + player->mo->height; + else + newz = player->mo->z; + + mo = P_SpawnMobj(newx, newy, newz, MT_DEZLASER); + if (mo) + { + if (player->mo->eflags & MFE_VERTICALFLIP) + mo->eflags |= MFE_VERTICALFLIP; + P_SetTarget(&mo->target, player->mo); + mo->angle = newangle+ANGLE_90; + mo->momz = (8*FRACUNIT)*P_MobjFlip(player->mo); + } } } } @@ -1231,6 +1241,9 @@ static void K_PlayOvertakeSound(mobj_t *source) if (source->player && source->player->kartstuff[k_voices]) // Prevents taunt sounds from playing every time the button is pressed return; + if (!G_RaceGametype()) // Only in race + return; + // 4 seconds from before race begins, 10 seconds afterwards if (leveltime < starttime+(10*TICRATE)) return; From 520262924646e48a2384ea3453b42c0bda1e9318 Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Mon, 25 Jun 2018 21:51:01 -0400 Subject: [PATCH 073/293] x1.5 SPB odds Make normal items slightly more like frantic. If frantic sucks after this then we can just remove its multiplier in that --- src/k_kart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index aac36241..5fe80dc1 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -445,7 +445,7 @@ static INT32 K_KartItemOddsRace[NUMKARTRESULTS][9] = /*Jawz*/ { 0, 0, 3, 2, 2, 1, 0, 0, 0 }, // Jawz /*Mine*/ { 0, 0, 1, 2, 1, 0, 0, 0, 0 }, // Mine /*Ballhog*/ { 0, 0, 1, 2, 1, 0, 0, 0, 0 }, // Ballhog - /*Self-Propelled Bomb*/ { 0, 0, 1, 1, 1, 2, 2, 3, 2 }, // Self-Propelled Bomb + /*Self-Propelled Bomb*/ { 0, 0, 1, 1, 2, 3, 4, 5, 4 }, // Self-Propelled Bomb /*Grow*/ { 0, 0, 0, 0, 0, 0, 1, 1, 2 }, // Grow /*Shrink*/ { 0, 0, 0, 0, 0, 0, 1, 1, 2 }, // Shrink /*Lightning Shield*/ { 0, 1, 2, 0, 0, 0, 0, 0, 0 }, // Lightning Shield From c0aa630c6352d5663d3656f2ff69f3774f6b927a Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Tue, 26 Jun 2018 10:14:59 -0400 Subject: [PATCH 074/293] Fade-in intro Also made flashing not-local, again. --- src/d_clisrv.c | 2 +- src/g_game.c | 2 +- src/hardware/hw_draw.c | 42 +++++++++++++++++++++++------------------- src/hardware/hw_main.h | 2 +- src/k_kart.c | 12 ++++++++++-- src/lua_hudlib.c | 25 +++++++++++++++++++++++++ src/m_menu.c | 2 +- src/p_user.c | 29 +++++++++++++++-------------- src/v_video.c | 37 +++++++++++++++++++++++-------------- src/v_video.h | 2 +- 10 files changed, 101 insertions(+), 54 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 0d3b9141..43c728b7 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1166,7 +1166,7 @@ static inline void CL_DrawConnectionStatus(void) INT32 ccstime = I_GetTime(); // Draw background fade - V_DrawFadeScreen(); + V_DrawFadeScreen(0xFF00, 16); // Draw the bottom box. M_DrawTextBox(BASEVIDWIDTH/2-128-8, BASEVIDHEIGHT-24-8, 32, 1); diff --git a/src/g_game.c b/src/g_game.c index 4b692ed9..618df06e 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -207,7 +207,7 @@ UINT16 spacetimetics = 11*TICRATE + (TICRATE/2); UINT16 extralifetics = 4*TICRATE; // SRB2kart -tic_t introtime = 108; +tic_t introtime = 108+5; // plus 5 for white fade tic_t starttime = 6*TICRATE + (3*TICRATE/4); INT32 hyudorotime = 7*TICRATE; INT32 stealtime = TICRATE/2; diff --git a/src/hardware/hw_draw.c b/src/hardware/hw_draw.c index c142e74c..5bf00527 100644 --- a/src/hardware/hw_draw.c +++ b/src/hardware/hw_draw.c @@ -576,29 +576,33 @@ void HWR_DrawFlatFill (INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatlumpnum // | /| // |/ | // 0--1 -void HWR_FadeScreenMenuBack(UINT32 color, INT32 height) +void HWR_FadeScreenMenuBack(UINT16 color, UINT8 strength) { - FOutVector v[4]; - FSurfaceInfo Surf; + FOutVector v[4]; + FSurfaceInfo Surf; - // setup some neat-o translucency effect - if (!height) //cool hack 0 height is full height - height = vid.height; + v[0].x = v[3].x = -1.0f; + v[2].x = v[1].x = 1.0f; + v[0].y = v[1].y = -1.0f; + v[2].y = v[3].y = 1.0f; + v[0].z = v[1].z = v[2].z = v[3].z = 1.0f; - v[0].x = v[3].x = -1.0f; - v[2].x = v[1].x = 1.0f; - v[0].y = v[1].y = 1.0f-((height<<1)/(float)vid.height); - v[2].y = v[3].y = 1.0f; - v[0].z = v[1].z = v[2].z = v[3].z = 1.0f; + v[0].sow = v[3].sow = 0.0f; + v[2].sow = v[1].sow = 1.0f; + v[0].tow = v[1].tow = 1.0f; + v[2].tow = v[3].tow = 0.0f; - v[0].sow = v[3].sow = 0.0f; - v[2].sow = v[1].sow = 1.0f; - v[0].tow = v[1].tow = 1.0f; - v[2].tow = v[3].tow = 0.0f; - - Surf.FlatColor.rgba = UINT2RGBA(color); - Surf.FlatColor.s.alpha = (UINT8)((0xff/2) * ((float)height / vid.height)); //calum: varies console alpha - HWD.pfnDrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest); + if (color & 0xFF00) // Do COLORMAP fade. + { + Surf.FlatColor.rgba = UINT2RGBA(0x01010160); + Surf.FlatColor.s.alpha = (strength*8); + } + else // Do TRANSMAP** fade. + { + Surf.FlatColor.rgba = pLocalPalette[color].rgba; + Surf.FlatColor.s.alpha = (UINT8)(strength*25.5f); + } + HWD.pfnDrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest); } // Draw the console background with translucency support diff --git a/src/hardware/hw_main.h b/src/hardware/hw_main.h index fce17062..0459205b 100644 --- a/src/hardware/hw_main.h +++ b/src/hardware/hw_main.h @@ -33,7 +33,7 @@ void HWR_Shutdown(void); void HWR_clearAutomap(void); void HWR_drawAMline(const fline_t *fl, INT32 color); -void HWR_FadeScreenMenuBack(UINT32 color, INT32 height); +void HWR_FadeScreenMenuBack(UINT16 color, UINT8 strength); void HWR_DrawConsoleBack(UINT32 color, INT32 height); void HWR_RenderSkyboxView(INT32 viewnumber, player_t *player); void HWR_RenderPlayerView(INT32 viewnumber, player_t *player); diff --git a/src/k_kart.c b/src/k_kart.c index 5fe80dc1..ca36f55d 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4786,7 +4786,7 @@ static void K_drawBattleFullscreen(void) if (stplyr->exiting) { if (stplyr == &players[displayplayer]) - V_DrawFadeScreen(); + V_DrawFadeScreen(0xFF00, 16); if (stplyr->kartstuff[k_balloon]) V_DrawFixedPatch(x< maxstrength) + return luaL_error(L, "%s fade strength %d out of range (0 - %d)", ((color & 0xFF00) ? "COLORMAP" : "TRANSMAP"), strength, maxstrength); + + if (strength == maxstrength) // Allow as a shortcut for drawfill... + { + V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, ((color & 0xFF00) ? 31 : color)); + return 0; + } + + V_DrawFadeScreen(color, strength); + return 0; +} + static int libd_drawString(lua_State *L) { fixed_t x = luaL_checkinteger(L, 1); @@ -568,6 +592,7 @@ static luaL_Reg lib_draw[] = { {"drawNum", libd_drawNum}, {"drawPaddedNum", libd_drawPaddedNum}, {"drawFill", libd_drawFill}, + {"fadeScreen", libd_fadeScreen}, {"drawString", libd_drawString}, {"stringWidth", libd_stringWidth}, {"getColormap", libd_getColormap}, diff --git a/src/m_menu.c b/src/m_menu.c index bd4d0260..6126da07 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2677,7 +2677,7 @@ void M_Drawer(void) { // now that's more readable with a faded background (yeah like Quake...) if (!WipeInAction) - V_DrawFadeScreen(); + V_DrawFadeScreen(0xFF00, 16); if (currentMenu->drawroutine) currentMenu->drawroutine(); // call current menu Draw routine diff --git a/src/p_user.c b/src/p_user.c index f4d489ca..f601967c 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8184,6 +8184,11 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall camrotate = cv_cam4_rotate.value; else camrotate = 0; + if (leveltime < introtime) // Whoooshy camera! + { + const INT32 introcam = (introtime - leveltime); + camrotate += introcam*5; + } thiscam->angle = focusangle + FixedAngle(camrotate*FRACUNIT); P_ResetCamera(player, thiscam); return true; @@ -9555,21 +9560,17 @@ void P_PlayerThink(player_t *player) player->losstime--; // Flash player after being hit. - if (!(player->pflags & PF_NIGHTSMODE)) + 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. + || (G_BattleGametype() && player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer]) + || leveltime < starttime)) // Level intro { - // SRB2kart - fixes Hyudoro not flashing when it should. Grow doesn't flash either. Flashing is local. - if ((player == &players[displayplayer] - || (splitscreen && player == &players[secondarydisplayplayer]) - || (splitscreen > 1 && player == &players[thirddisplayplayer]) - || (splitscreen > 2 && player == &players[fourthdisplayplayer])) - && player->kartstuff[k_hyudorotimer] == 0 && player->kartstuff[k_growshrinktimer] <= 0 - && (player->kartstuff[k_comebacktimer] == 0 || (G_RaceGametype() || player->kartstuff[k_balloon] > 0))) - { - if (player->powers[pw_flashing] > 0 && player->powers[pw_flashing] < K_GetKartFlashing() && (leveltime & 1)) - player->mo->flags2 |= MF2_DONTDRAW; - else - player->mo->flags2 &= ~MF2_DONTDRAW; - } + if (player->powers[pw_flashing] > 0 && player->powers[pw_flashing] < K_GetKartFlashing() + && (leveltime & 1)) + player->mo->flags2 |= MF2_DONTDRAW; + else + player->mo->flags2 &= ~MF2_DONTDRAW; } else if (player->mo->tracer) { diff --git a/src/v_video.c b/src/v_video.c index 6435e413..11294896 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -953,25 +953,34 @@ void V_DrawPatchFill(patch_t *pat) // // Fade all the screen buffer, so that the menu is more readable, // especially now that we use the small hufont in the menus... +// If color is 0x00 to 0xFF, draw transtable (strength range 0-9). +// Else, use COLORMAP lump (strength range 0-31). +// IF YOU ARE NOT CAREFUL, THIS CAN AND WILL CRASH! +// I have kept the safety checks out of this function; +// the v.fadeScreen Lua interface handles those. // -void V_DrawFadeScreen(void) +void V_DrawFadeScreen(UINT16 color, UINT8 strength) { - const UINT8 *fadetable = (UINT8 *)colormaps + 16*256; - const UINT8 *deststop = screens[0] + vid.rowbytes * vid.height; - UINT8 *buf = screens[0]; - #ifdef HWRENDER - if (rendermode != render_soft && rendermode != render_none) - { - HWR_FadeScreenMenuBack(0x01010160, 0); // hack, 0 means full height - return; - } + if (rendermode != render_soft && rendermode != render_none) + { + HWR_FadeScreenMenuBack(color, strength); + return; + } #endif - // heavily simplified -- we don't need to know x or y - // position when we're doing a full screen fade - for (; buf < deststop; ++buf) - *buf = fadetable[*buf]; + { + const UINT8 *fadetable = ((color & 0xFF00) // Color is not palette index? + ? ((UINT8 *)colormaps + strength*256) // Do COLORMAP fade. + : ((UINT8 *)transtables + ((9-strength)< Date: Tue, 26 Jun 2018 11:33:54 -0400 Subject: [PATCH 075/293] Disable viewheight cvar and vanilla's irrelevant first person HUD stuff, move Viewpoint HUD to a nicer spot --- src/k_kart.c | 5 +++-- src/m_cheat.c | 2 +- src/p_local.h | 4 ++-- src/p_mobj.c | 6 +++--- src/p_saveg.c | 2 +- src/p_user.c | 10 +++++----- src/r_main.c | 2 +- src/st_stuff.c | 8 ++++---- 8 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index ca36f55d..421ef469 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4867,7 +4867,8 @@ void K_drawKartHUD(void) // This is handled by console/menu values K_initKartHUD(); - if (leveltime < 15 && stplyr == &players[displayplayer]) // Draw a white fade on level opening + // Draw a white fade on level opening + if (leveltime < 15 && stplyr == &players[displayplayer]) { if (leveltime < 5) V_DrawFill(0,0,BASEVIDWIDTH,BASEVIDHEIGHT,120); // Pure white on first three frames, to hide SRB2's awful level load artifacts @@ -4875,7 +4876,7 @@ void K_drawKartHUD(void) V_DrawFadeScreen(120, 15-leveltime); // Then gradually fade out from there } - if (splitscreen == 2) // Player 4 in 3P is basically the minimap :p + if (splitscreen == 2) // Player 4 in 3P is the minimap :p K_drawKartMinimap(); // Draw full screen stuff that turns off the rest of the HUD diff --git a/src/m_cheat.c b/src/m_cheat.c index fed76edd..ec602017 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -1149,7 +1149,7 @@ void OP_ObjectplaceMovement(player_t *player) // make sure viewz follows player if in 1st person mode //player->deltaviewheight = 0; - player->viewheight = FixedMul(cv_viewheight.value << FRACBITS, player->mo->scale); + player->viewheight = FixedMul(32 << FRACBITS, player->mo->scale); if (player->mo->eflags & MFE_VERTICALFLIP) player->viewz = player->mo->z + player->mo->height - player->viewheight; else diff --git a/src/p_local.h b/src/p_local.h index 0d8ad716..cc4c5df5 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -25,7 +25,7 @@ #define FLOATSPEED (FRACUNIT*4) -#define VIEWHEIGHTS "41" +//#define VIEWHEIGHTS "41" // Maximum player score. #define MAXSCORE 999999990 @@ -209,7 +209,7 @@ void P_PlayLivesJingle(player_t *player); extern mapthing_t *itemrespawnque[ITEMQUESIZE]; extern tic_t itemrespawntime[ITEMQUESIZE]; extern size_t iquehead, iquetail; -extern consvar_t cv_gravity, cv_viewheight; +extern consvar_t cv_gravity/*, cv_viewheight*/; void P_RespawnSpecials(void); diff --git a/src/p_mobj.c b/src/p_mobj.c index c328ee2e..2631654c 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -38,8 +38,8 @@ #include "k_kart.h" // protos. -static CV_PossibleValue_t viewheight_cons_t[] = {{16, "MIN"}, {56, "MAX"}, {0, NULL}}; -consvar_t cv_viewheight = {"viewheight", VIEWHEIGHTS, 0, viewheight_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +//static CV_PossibleValue_t viewheight_cons_t[] = {{16, "MIN"}, {56, "MAX"}, {0, NULL}}; +//consvar_t cv_viewheight = {"viewheight", VIEWHEIGHTS, 0, viewheight_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; #ifdef WALLSPLATS consvar_t cv_splats = {"splats", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; #endif @@ -9972,7 +9972,7 @@ void P_AfterPlayerSpawn(INT32 playernum) else if (playernum == fourthdisplayplayer) localangle4 = mobj->angle; - p->viewheight = cv_viewheight.value<viewheight = 32<mo->eflags & MFE_VERTICALFLIP) p->viewz = p->mo->z + p->mo->height - p->viewheight; diff --git a/src/p_saveg.c b/src/p_saveg.c index dae613cc..5526344f 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -436,7 +436,7 @@ static void P_NetUnArchivePlayers(void) if (flags & AWAYVIEW) players[i].awayviewmobj = (mobj_t *)(size_t)READUINT32(save_p); - players[i].viewheight = cv_viewheight.value<bob/2, FINESINE(angle)); // move viewheight - player->viewheight = FixedMul(cv_viewheight.value << FRACBITS, mo->scale); // default eye view height + player->viewheight = FixedMul(32 << FRACBITS, mo->scale); // default eye view height /*if (player->playerstate == PST_LIVE) { @@ -8099,9 +8099,9 @@ void P_ResetCamera(player_t *player, camera_t *thiscam) x = player->mo->x - P_ReturnThrustX(player->mo, thiscam->angle, player->mo->radius); y = player->mo->y - P_ReturnThrustY(player->mo, thiscam->angle, player->mo->radius); if (player->mo->eflags & MFE_VERTICALFLIP) - z = player->mo->z + player->mo->height - (cv_viewheight.value<mo->z + player->mo->height - (32<mo->z + (cv_viewheight.value<mo->z + (32<x = x; @@ -8462,7 +8462,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall } #endif // bad 2D camera code - pviewheight = FixedMul(cv_viewheight.value<scale); + pviewheight = FixedMul(32<scale); if (mo->eflags & MFE_VERTICALFLIP) z = mo->z + mo->height - pviewheight - camheight; @@ -9952,7 +9952,7 @@ void P_PlayerAfterThink(player_t *player) { // defaults to make sure 1st person cam doesn't do anything weird on startup //player->deltaviewheight = 0; - player->viewheight = FixedMul(cv_viewheight.value << FRACBITS, player->mo->scale); + player->viewheight = FixedMul(32 << FRACBITS, player->mo->scale); if (player->mo->eflags & MFE_VERTICALFLIP) player->viewz = player->mo->z + player->mo->height - player->viewheight; else diff --git a/src/r_main.c b/src/r_main.c index 6e1823e4..b66e47ce 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -1548,7 +1548,7 @@ void R_RegisterEngineStuff(void) // Default viewheight is changeable, // initialized to standard viewheight - CV_RegisterVar(&cv_viewheight); + //CV_RegisterVar(&cv_viewheight); #ifdef HWRENDER // GL-specific Commands diff --git a/src/st_stuff.c b/src/st_stuff.c index 78a6278c..75092d9a 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1897,18 +1897,18 @@ static void ST_overlayDrawer(void) strlcpy(name, player_names[stplyr-players], 13); // Show name of player being displayed - V_DrawCenteredString((BASEVIDWIDTH/6), BASEVIDHEIGHT-80, 0, M_GetText("Viewpoint:")); - V_DrawCenteredString((BASEVIDWIDTH/6), BASEVIDHEIGHT-64, V_ALLOWLOWERCASE, name); + V_DrawCenteredString((BASEVIDWIDTH/2), BASEVIDHEIGHT-40, 0, M_GetText("Viewpoint:")); + V_DrawCenteredString((BASEVIDWIDTH/2), BASEVIDHEIGHT-32, V_ALLOWLOWERCASE, name); } // This is where we draw all the fun cheese if you have the chasecam off! - if ((stplyr == &players[displayplayer] && !camera.chase) + /*if ((stplyr == &players[displayplayer] && !camera.chase) || ((splitscreen && stplyr == &players[secondarydisplayplayer]) && !camera2.chase) || ((splitscreen > 1 && stplyr == &players[thirddisplayplayer]) && !camera3.chase) || ((splitscreen > 2 && stplyr == &players[fourthdisplayplayer]) && !camera4.chase)) { ST_drawFirstPersonHUD(); - } + }*/ } #ifdef HAVE_BLUA From 920ce3807fa1d3c77f396be32d1a4b9eba3ef6f2 Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Tue, 26 Jun 2018 12:02:14 -0400 Subject: [PATCH 076/293] Some fun sound changes - Peelout sound for sneaker boosts - Flicky grab sound for stealing balloons - Adaptive sounds for start boosts (drift boost for sub-optimal boosts, sneaker boost for good boosts, super transform sound for the frame perfect boost) - Orbinaut rollling sound --- src/info.c | 2 +- src/k_kart.c | 18 +++++++++++++----- src/sounds.c | 16 ++++++++-------- src/st_stuff.c | 2 ++ 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/src/info.c b/src/info.c index bf02e0c4..0b56a513 100644 --- a/src/info.c +++ b/src/info.c @@ -14603,7 +14603,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // display offset 100, // mass 1, // damage - sfx_grnshl, // activesound + sfx_s3k96, // activesound MF_SHOOTABLE|MF_BOUNCE, // flags S_NULL // raisestate }, diff --git a/src/k_kart.c b/src/k_kart.c index 421ef469..6c254bed 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -731,7 +731,7 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd) // This makes the roulette produce the random noises. if ((player->kartstuff[k_itemroulette] % 3) == 1 && P_IsLocalPlayer(player)) - S_StartSound(NULL,sfx_mkitm1 + ((player->kartstuff[k_itemroulette] / 3) % 8)); + S_StartSound(NULL, sfx_mkitm1 + ((player->kartstuff[k_itemroulette] / 3) % 8)); roulettestop = (TICRATE*1) + (3*(pingame - player->kartstuff[k_position])); @@ -1666,6 +1666,8 @@ void K_StealBalloon(player_t *player, player_t *victim, boolean force) else P_SetMobjState(newmo, S_BATTLEBALLOON1); + S_StartSound(player->mo, sfx_3db06); + player->kartstuff[k_balloon]++; player->kartstuff[k_comebackpoints] = 0; player->powers[pw_flashing] = K_GetKartFlashing(); @@ -2353,7 +2355,7 @@ static void K_DoHyudoroSteal(player_t *player) void K_DoSneaker(player_t *player, boolean doPFlag) { if (!player->kartstuff[k_floorboost] || player->kartstuff[k_floorboost] == 3) - S_StartSound(player->mo, sfx_s23c); + S_StartSound(player->mo, sfx_cdfm01); player->kartstuff[k_sneakertimer] = sneakertime; @@ -3563,10 +3565,16 @@ void K_MoveKartPlayer(player_t *player, boolean onground) // Get an instant boost! if (player->kartstuff[k_boostcharge] >= 35 && player->kartstuff[k_boostcharge] <= 50) { - if (!player->kartstuff[k_floorboost] || player->kartstuff[k_floorboost] == 3) - S_StartSound(player->mo, sfx_s23c); - 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) + { + 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 + } } // You overcharged your engine? Those things are expensive!!! else if (player->kartstuff[k_boostcharge] > 50) diff --git a/src/sounds.c b/src/sounds.c index 8bb1ff52..94753eea 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -343,7 +343,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"s239", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s23a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s23b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s23c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"s23c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Drift boost {"s23d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s23e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s23f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, @@ -378,7 +378,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"s25c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s25d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s25e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s25f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"s25f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Perfect start boost {"s260", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s261", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s262", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, @@ -497,7 +497,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3k93", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k94", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k95", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k96", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"s3k96", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Kart Orbinaut {"s3k97", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k98", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k99", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, @@ -514,13 +514,13 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3ka4", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3ka5", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3ka6", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3ka7", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"s3ka7", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Kart 3,2,1 {"s3ka8", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3ka9", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3kaa", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3kab", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3kac", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kad", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"s3kad", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Kart GO! {"s3kae", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3kaf", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3kb0", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, @@ -563,7 +563,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3kc8l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3kc9s", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3kc9l", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3kcas", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"s3kcas", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Kart respawn {"s3kcal", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3kcbs", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3kcbl", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, @@ -601,14 +601,14 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3kdbl", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // 3D Blast sounds (the "missing" ones are direct copies of S3K's, no minor differences what-so-ever) - {"3db06", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"3db06", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Bumper stolen {"3db09", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"3db14", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"3db16", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Sonic CD sounds {"cdfm00", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"cdfm01", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"cdfm01", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Sneaker boost {"cdfm02", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"cdfm03", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"cdfm04", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, diff --git a/src/st_stuff.c b/src/st_stuff.c index 75092d9a..a19bada6 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -812,6 +812,7 @@ static void ST_drawLevelTitle(void) V_DrawCenteredString(subttlxpos, lvlttly+48, V_ALLOWLOWERCASE, subttl); } +/* static void ST_drawFirstPersonHUD(void) { player_t *player = stplyr; @@ -913,6 +914,7 @@ static void ST_drawFirstPersonHUD(void) V_DrawScaledPatch(SCX((BASEVIDWIDTH/2) - (SHORT(p->width)/2) + SHORT(p->leftoffset)), SCY(60 - SHORT(p->topoffset)), V_NOSCALESTART|V_OFFSET|V_TRANSLUCENT, p); } +*/ /* // [21:42] <+Rob> Beige - Lavender - Steel Blue - Peach - Orange - Purple - Silver - Yellow - Pink - Red - Blue - Green - Cyan - Gold From a4b45936d3eb5b5f902936fba5d749affc44ba31 Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Tue, 26 Jun 2018 12:05:54 -0400 Subject: [PATCH 077/293] Autoload sonicitems.wad for convenience --- src/d_main.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index b12dcdbf..9f201492 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -930,17 +930,19 @@ static void IdentifyVersion(void) // Add the weapons //D_AddFile(va(pandf,srb2waddir,"rings.dta")); -#ifdef USE_PATCH_DTA - // Add our crappy patches to fix our bugs - D_AddFile(va(pandf,srb2waddir,"patch.dta")); -#endif - // SRB2kart - Add graphics (temp) // The command for md5 checks is "W_VerifyFileMD5" - looks for ASSET_HASH_SRB2_SRB in config.h.in D_AddFile(va(pandf,srb2waddir,"gfx.kart")); D_AddFile(va(pandf,srb2waddir,"chars.kart")); D_AddFile(va(pandf,srb2waddir,"maps.kart")); D_AddFile(va(pandf,srb2waddir,"sounds.kart")); +#ifdef USE_PATCH_DTA + // Add our crappy patches to fix our bugs + D_AddFile(va(pandf,srb2waddir,"patch.dta")); +#endif + + D_AddFile(va(pandf,srb2waddir,"sonicitems.wad")); // Temporary. Remove before merging into master. + #if !defined (HAVE_SDL) || defined (HAVE_MIXER) { #if defined (DC) && 0 @@ -1253,7 +1255,7 @@ void D_SRB2Main(void) // ...except it does if they slip maps in there, and that's what W_VerifyNMUSlumps is for. #endif //ifndef DEVELOP - mainwads = 4; // there are 4 wads not to unload + mainwads = 5; // there are 4 wads not to unload (5 with temp sonicitems.wad) #ifdef USE_PATCH_DTA ++mainwads; // patch.dta adds one more #endif From 0f36c6a96dee1a5b3053347dd888fc5e0a67a1cc Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Tue, 26 Jun 2018 12:11:43 -0400 Subject: [PATCH 078/293] Final lap sound --- src/p_spec.c | 9 +++++++-- src/sounds.c | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index dddde55c..7cfc0a63 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4181,8 +4181,13 @@ DoneSection2: //except the time! player->starposttime = player->realtime; - if (P_IsLocalPlayer(player) && (player->laps <= (UINT8)(cv_numlaps.value - 1))) - S_StartSound(NULL, sfx_s221); + if (P_IsLocalPlayer(player)) + { + if (player->laps == (UINT8)(cv_numlaps.value - 1)) + S_StartSound(NULL, sfx_s3k68); + else if (player->laps < (UINT8)(cv_numlaps.value - 1)) + S_StartSound(NULL, sfx_s221); + } // //player->starpostangle = player->starposttime = player->starpostnum = 0; diff --git a/src/sounds.c b/src/sounds.c index 94753eea..6223458d 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -451,7 +451,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"s3k65", false, 255, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Blue Spheres {"s3k66", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k67", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s3k68", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"s3k68", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Kart final lap {"s3k69", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k6a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s3k6b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, From 415c0952740f8dd0587f07e0688286ebf60a6e27 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 26 Jun 2018 17:46:04 +0100 Subject: [PATCH 079/293] fix the multiplayer menu not allowing the full max length for player names unlike the "name" console command --- src/m_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_menu.c b/src/m_menu.c index 0ab77157..79ac6800 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -6543,7 +6543,7 @@ static void M_HandleSetupMultiPlayer(INT32 choice) if (choice < 32 || choice > 127 || itemOn != 0) break; l = strlen(setupm_name); - if (l < MAXPLAYERNAME-1) + if (l < MAXPLAYERNAME) { S_StartSound(NULL,sfx_menu1); // Tails setupm_name[l] =(char)choice; From 10346f5ea90da7b0bd7382f48fa6cec6949bcc6d Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Tue, 26 Jun 2018 16:12:42 -0400 Subject: [PATCH 080/293] First person fun --- src/info.c | 2 +- src/info.h | 2 ++ src/k_kart.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+), 1 deletion(-) diff --git a/src/info.c b/src/info.c index 0b56a513..6c8c7160 100644 --- a/src/info.c +++ b/src/info.c @@ -59,7 +59,7 @@ char sprnames[NUMSPRITES + 1][5] = "BANA","GSHE","JAWZ","SSMN","KRBM","BHOG","BLIG","LIGH","SINK","SITR", "KBLN","DEZL","POKE","AUDI","DECO","DOOD","SNES","GBAS","SPRS","BUZB", "CHOM","SACO","CRAB","SHAD","BUMP","FLEN","CLAS","PSHW","ARRO","ITEM", - "ITMI","ITMN","PBOM" + "ITMI","ITMN","PBOM","VIEW" }; // Doesn't work with g++, needs actionf_p1 (don't modify this comment) diff --git a/src/info.h b/src/info.h index 85882854..d65bb7e5 100644 --- a/src/info.h +++ b/src/info.h @@ -629,6 +629,8 @@ typedef enum sprite SPR_PBOM, // player bomb + SPR_VIEW, // First person view sprites; this is a sprite so that it can be replaced by a specialized MD2 draw! + SPR_FIRSTFREESLOT, SPR_LASTFREESLOT = SPR_FIRSTFREESLOT + NUMSPRITEFREESLOTS - 1, NUMSPRITES diff --git a/src/k_kart.c b/src/k_kart.c index 6c254bed..f3959a7c 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3703,6 +3703,8 @@ static patch_t *kp_check[6]; static patch_t *kp_spbwarning[2]; +static patch_t *kp_fpview[3]; + void K_LoadKartHUDGraphics(void) { INT32 i, j; @@ -3803,6 +3805,11 @@ void K_LoadKartHUDGraphics(void) // SPB warning kp_spbwarning[0] = W_CachePatchName("K_SPBW1", PU_HUDGFX); kp_spbwarning[1] = W_CachePatchName("K_SPBW2", PU_HUDGFX); + + // First person mode + kp_fpview[0] = W_CachePatchName("VIEWA0", PU_HUDGFX); + kp_fpview[1] = W_CachePatchName("VIEWB0D0", PU_HUDGFX); + kp_fpview[2] = W_CachePatchName("VIEWC0E0", PU_HUDGFX); } //} @@ -4860,6 +4867,71 @@ static void K_drawStartCountdown(void) V_DrawScaledPatch(STCD_X - (SHORT(kp_startcountdown[pnum]->width)/2), STCD_Y - (SHORT(kp_startcountdown[pnum]->height)/2), 0, kp_startcountdown[pnum]); } +static void K_drawKartFirstPerson(void) +{ + static INT32 pnum1 = 0, pnum2 = 0, pnum3 = 0, pnum4 = 0; + INT32 pn = 0, target = 0, splitflags = K_calcSplitFlags(V_SNAPTOBOTTOM); + INT32 x = BASEVIDWIDTH/2, y = BASEVIDHEIGHT; + ticcmd_t *cmd = &stplyr->cmd; + + if (stplyr == &players[secondarydisplayplayer] && splitscreen) + pn = pnum2; + else if (stplyr == &players[thirddisplayplayer] && splitscreen > 1) + pn = pnum3; + else if (stplyr == &players[fourthdisplayplayer] && splitscreen > 2) + pn = pnum4; + else + pn = pnum1; + + if (splitscreen) + { + y /= 2; + if (splitscreen > 1) + x /= 2; + } + + if (stplyr->speed < FixedMul(stplyr->runspeed, stplyr->mo->scale) && (leveltime & 1)) + y++; + + if (cmd->driftturn > 400) // strong left turn + target = 2; + else if (cmd->driftturn < -400) // strong right turn + target = -2; + else if (cmd->driftturn > 0) // weak left turn + target = 1; + else if (cmd->driftturn < 0) // weak right turn + target = -1; + else // forward + target = 0; + + if (pn < target) + pn++; + else if (pn > target) + pn--; + + if (pn > 2) + pn = 2; + if (pn < -2) + pn = -2; + + if (pn < 0) + splitflags |= V_FLIP; // right turn + + if (splitscreen) + V_DrawSmallScaledPatch(x, y, splitflags, kp_fpview[abs(pn)]); + else + V_DrawScaledPatch(x, y, splitflags, kp_fpview[abs(pn)]); + + if (stplyr == &players[secondarydisplayplayer] && splitscreen) + pnum2 = pn; + else if (stplyr == &players[thirddisplayplayer] && splitscreen > 1) + pnum3 = pn; + else if (stplyr == &players[fourthdisplayplayer] && splitscreen > 2) + pnum4 = pn; + else + pnum1 = pn; +} + static void K_drawCheckpointDebugger(void) { if ((numstarposts/2 + stplyr->starpostnum) >= numstarposts) @@ -4875,6 +4947,13 @@ void K_drawKartHUD(void) // This is handled by console/menu values K_initKartHUD(); + // Draw that fun first person HUD! + if ((stplyr == &players[displayplayer] && !camera.chase) + || ((splitscreen && stplyr == &players[secondarydisplayplayer]) && !camera2.chase) + || ((splitscreen > 1 && stplyr == &players[thirddisplayplayer]) && !camera3.chase) + || ((splitscreen > 2 && stplyr == &players[fourthdisplayplayer]) && !camera4.chase)) + K_drawKartFirstPerson(); + // Draw a white fade on level opening if (leveltime < 15 && stplyr == &players[displayplayer]) { From d8a86a8d744f13f6206b1aefa25ce1bb2047323a Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 26 Jun 2018 21:41:05 +0100 Subject: [PATCH 081/293] Fix OpenGL completely missing the ability to alter FOF wall pegging by lower unpegged flag. Stupid OpenGL. Sorry in advance Lat'! --- src/hardware/hw_main.c | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index a5fe6b67..1caf84fe 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -2182,27 +2182,34 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) } else if (drawtextured) { -#ifdef ESLOPE // P.S. this is better-organized than the old version - fixed_t offs = sides[(newline ? newline : rover->master)->sidenum[0]].rowoffset; - grTex = HWR_GetTexture(texnum); - - wallVerts[3].t = (*rover->topheight - h + offs) * grTex->scaleY; - wallVerts[2].t = (*rover->topheight - hS + offs) * grTex->scaleY; - wallVerts[0].t = (*rover->topheight - l + offs) * grTex->scaleY; - wallVerts[1].t = (*rover->topheight - lS + offs) * grTex->scaleY; -#else - grTex = HWR_GetTexture(texnum); + fixed_t texturevpeg; + // Wow, how was this missing from OpenGL for so long? + // ...Oh well, anyway, Lower Unpegged now changes pegging of FOFs like in software + // -- Monster Iestyn 26/06/18 if (newline) { - wallVerts[3].t = wallVerts[2].t = (*rover->topheight - h + sides[newline->sidenum[0]].rowoffset) * grTex->scaleY; - wallVerts[0].t = wallVerts[1].t = (h - l + (*rover->topheight - h + sides[newline->sidenum[0]].rowoffset)) * grTex->scaleY; + texturevpeg = sides[newline->sidenum[0]].rowoffset; + if (newline->flags & ML_DONTPEGBOTTOM) + texturevpeg -= *rover->topheight - *rover->bottomheight; } else { - wallVerts[3].t = wallVerts[2].t = (*rover->topheight - h + sides[rover->master->sidenum[0]].rowoffset) * grTex->scaleY; - wallVerts[0].t = wallVerts[1].t = (h - l + (*rover->topheight - h + sides[rover->master->sidenum[0]].rowoffset)) * grTex->scaleY; + texturevpeg = sides[rover->master->sidenum[0]].rowoffset; + if (gr_linedef->flags & ML_DONTPEGBOTTOM) + texturevpeg -= *rover->topheight - *rover->bottomheight; } + + grTex = HWR_GetTexture(texnum); + +#ifdef ESLOPE + wallVerts[3].t = (*rover->topheight - h + texturevpeg) * grTex->scaleY; + wallVerts[2].t = (*rover->topheight - hS + texturevpeg) * grTex->scaleY; + wallVerts[0].t = (*rover->topheight - l + texturevpeg) * grTex->scaleY; + wallVerts[1].t = (*rover->topheight - lS + texturevpeg) * grTex->scaleY; +#else + wallVerts[3].t = wallVerts[2].t = (*rover->topheight - h + texturevpeg) * grTex->scaleY; + wallVerts[0].t = wallVerts[1].t = (*rover->topheight - l + texturevpeg) * grTex->scaleY; #endif wallVerts[0].s = wallVerts[3].s = cliplow * grTex->scaleX; From 88f8b4d852bf55ad5a2b4367c37877a33e8dd3d9 Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Tue, 26 Jun 2018 16:46:47 -0400 Subject: [PATCH 082/293] Extend mobj->colorized to work on... well, mobjs Previously would only work on players. Now karma items should be easier to spot as intended! --- src/hardware/hw_main.c | 13 +++++-------- src/r_things.c | 26 ++++++++++---------------- 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 189953cd..b6fd37c9 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -5430,15 +5430,12 @@ static void HWR_ProjectSprite(mobj_t *thing) else if (thing->color) { // New colormap stuff for skins Tails 06-07-2002 - if (thing->skin && thing->sprite == SPR_PLAY) // This thing is a player! + if (thing->colorized) + vis->colormap = R_GetTranslationColormap(TC_RAINBOW, thing->color, GTC_CACHE); + else if (thing->skin && thing->sprite == SPR_PLAY) // This thing is a player! { - if (thing->colorized) - vis->colormap = R_GetTranslationColormap(TC_RAINBOW, thing->color, GTC_CACHE); - else - { - size_t skinnum = (skin_t*)thing->skin-skins; - vis->colormap = R_GetTranslationColormap((INT32)skinnum, thing->color, GTC_CACHE); - } + size_t skinnum = (skin_t*)thing->skin-skins; + vis->colormap = R_GetTranslationColormap((INT32)skinnum, thing->color, GTC_CACHE); } else { diff --git a/src/r_things.c b/src/r_things.c index 2bd4ff86..2b9810fc 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -826,15 +826,12 @@ static void R_DrawVisSprite(vissprite_t *vis) { colfunc = transtransfunc; dc_transmap = vis->transmap; - if (vis->mobj->skin && vis->mobj->sprite == SPR_PLAY) // MT_GHOST LOOKS LIKE A PLAYER SO USE THE PLAYER TRANSLATION TABLES. >_> + if (vis->mobj->colorized) + dc_translation = R_GetTranslationColormap(TC_RAINBOW, vis->mobj->color, GTC_CACHE); + else if (vis->mobj->skin && vis->mobj->sprite == SPR_PLAY) // MT_GHOST LOOKS LIKE A PLAYER SO USE THE PLAYER TRANSLATION TABLES. >_> { - if (vis->mobj->colorized) - dc_translation = R_GetTranslationColormap(TC_RAINBOW, vis->mobj->color, GTC_CACHE); - else - { - size_t skinnum = (skin_t*)vis->mobj->skin-skins; - dc_translation = R_GetTranslationColormap((INT32)skinnum, vis->mobj->color, GTC_CACHE); - } + size_t skinnum = (skin_t*)vis->mobj->skin-skins; + dc_translation = R_GetTranslationColormap((INT32)skinnum, vis->mobj->color, GTC_CACHE); } else // Use the defaults dc_translation = R_GetTranslationColormap(TC_DEFAULT, vis->mobj->color, GTC_CACHE); @@ -850,15 +847,12 @@ static void R_DrawVisSprite(vissprite_t *vis) colfunc = transcolfunc; // New colormap stuff for skins Tails 06-07-2002 - if (vis->mobj->skin && vis->mobj->sprite == SPR_PLAY) // This thing is a player! + if (vis->mobj->colorized) + dc_translation = R_GetTranslationColormap(TC_RAINBOW, vis->mobj->color, GTC_CACHE); + else if (vis->mobj->skin && vis->mobj->sprite == SPR_PLAY) // This thing is a player! { - if (vis->mobj->colorized) - dc_translation = R_GetTranslationColormap(TC_RAINBOW, vis->mobj->color, GTC_CACHE); - else - { - size_t skinnum = (skin_t*)vis->mobj->skin-skins; - dc_translation = R_GetTranslationColormap((INT32)skinnum, vis->mobj->color, GTC_CACHE); - } + size_t skinnum = (skin_t*)vis->mobj->skin-skins; + dc_translation = R_GetTranslationColormap((INT32)skinnum, vis->mobj->color, GTC_CACHE); } else // Use the defaults dc_translation = R_GetTranslationColormap(TC_DEFAULT, vis->mobj->color, GTC_CACHE); From fb2a6b53c28870ba2e8956445f4371bba49db865 Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Tue, 26 Jun 2018 18:04:07 -0400 Subject: [PATCH 083/293] Fixed a bit of redundancy, pointed out by Sryder --- src/hardware/hw_main.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index b6fd37c9..54691872 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -5438,12 +5438,7 @@ static void HWR_ProjectSprite(mobj_t *thing) vis->colormap = R_GetTranslationColormap((INT32)skinnum, thing->color, GTC_CACHE); } else - { - if (vis->mobj && vis->mobj->colorized) - vis->colormap = R_GetTranslationColormap(TC_RAINBOW, vis->mobj->color ? vis->mobj->color : SKINCOLOR_CYAN, GTC_CACHE); - else - vis->colormap = R_GetTranslationColormap(TC_DEFAULT, vis->mobj->color ? vis->mobj->color : SKINCOLOR_CYAN, GTC_CACHE); - } + vis->colormap = R_GetTranslationColormap(TC_DEFAULT, thing->color, GTC_CACHE); } else vis->colormap = colormaps; From 89abdb5fea0c52ccc337930acc52e79ebc8005fc Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Tue, 26 Jun 2018 21:19:36 -0400 Subject: [PATCH 084/293] Fix countdown in splits --- src/k_kart.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index f3959a7c..776b30b7 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4853,7 +4853,7 @@ static void K_drawBattleFullscreen(void) static void K_drawStartCountdown(void) { - INT32 pnum = 0; // 3 + INT32 pnum = 0, splitflags = K_calcSplitFlags(0); // 3 if (leveltime >= starttime-(2*TICRATE)) // 2 pnum++; @@ -4864,7 +4864,10 @@ static void K_drawStartCountdown(void) if ((leveltime % (2*5)) / 5) // blink pnum += 4; - V_DrawScaledPatch(STCD_X - (SHORT(kp_startcountdown[pnum]->width)/2), STCD_Y - (SHORT(kp_startcountdown[pnum]->height)/2), 0, kp_startcountdown[pnum]); + if (splitscreen) + V_DrawSmallScaledPatch(STCD_X - (SHORT(kp_startcountdown[pnum]->width)/4), STCD_Y - (SHORT(kp_startcountdown[pnum]->height)/4), splitflags, kp_startcountdown[pnum]); + else + V_DrawScaledPatch(STCD_X - (SHORT(kp_startcountdown[pnum]->width)/2), STCD_Y - (SHORT(kp_startcountdown[pnum]->height)/2), splitflags, kp_startcountdown[pnum]); } static void K_drawKartFirstPerson(void) From bd5c2d0720234171e3c5ec30b83910fe04724ed6 Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Wed, 27 Jun 2018 10:10:53 -0400 Subject: [PATCH 085/293] Use patch.kart instead, almost finished Ballhog --- src/d_main.c | 34 +++++++++++++++++----------------- src/doomdef.h | 3 +++ src/info.c | 16 ++++++++-------- src/p_map.c | 2 +- src/p_mobj.c | 17 ++++++++++------- src/sounds.c | 2 +- 6 files changed, 40 insertions(+), 34 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 9f201492..6455c328 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -930,19 +930,21 @@ static void IdentifyVersion(void) // Add the weapons //D_AddFile(va(pandf,srb2waddir,"rings.dta")); +#ifdef USE_PATCH_DTA + // Add our crappy patches to fix our bugs + D_AddFile(va(pandf,srb2waddir,"patch.dta")); +#endif + // SRB2kart - Add graphics (temp) // The command for md5 checks is "W_VerifyFileMD5" - looks for ASSET_HASH_SRB2_SRB in config.h.in D_AddFile(va(pandf,srb2waddir,"gfx.kart")); D_AddFile(va(pandf,srb2waddir,"chars.kart")); D_AddFile(va(pandf,srb2waddir,"maps.kart")); D_AddFile(va(pandf,srb2waddir,"sounds.kart")); -#ifdef USE_PATCH_DTA - // Add our crappy patches to fix our bugs - D_AddFile(va(pandf,srb2waddir,"patch.dta")); +#ifdef USE_PATCH_KART + D_AddFile(va(pandf,srb2waddir,"patch.kart")); #endif - D_AddFile(va(pandf,srb2waddir,"sonicitems.wad")); // Temporary. Remove before merging into master. - #if !defined (HAVE_SDL) || defined (HAVE_MIXER) { #if defined (DC) && 0 @@ -1241,25 +1243,23 @@ void D_SRB2Main(void) #ifndef DEVELOP // md5s last updated 12/14/14 // Check MD5s of autoloaded files - W_VerifyFileMD5(0, ASSET_HASH_SRB2_SRB); // srb2.srb/srb2.wad - W_VerifyFileMD5(1, ASSET_HASH_GFX_DTA); // gfx.kart - W_VerifyFileMD5(2, ASSET_HASH_CHARS_DTA); // chars.kart - W_VerifyFileMD5(3, ASSET_HASH_MAPS_DTA); // maps.kart - // sounds.kart - since music is large, we'll ignore it for now. - + mainwads = 0; + W_VerifyFileMD5(mainwads, ASSET_HASH_SRB2_SRB); mainwads++; // srb2.srb/srb2.wad #ifdef USE_PATCH_DTA - W_VerifyFileMD5(4, ASSET_HASH_PATCH_DTA); // patch.dta + W_VerifyFileMD5(mainwads, ASSET_HASH_PATCH_DTA); mainwads++; // patch.dta +#endif + W_VerifyFileMD5(mainwads, ASSET_HASH_GFX_KART); mainwads++; // gfx.kart + W_VerifyFileMD5(mainwads, ASSET_HASH_CHARS_KART); mainwads++; // chars.kart + W_VerifyFileMD5(mainwads, ASSET_HASH_MAPS_KART); mainwads++; // maps.kart + //W_VerifyFileMD5(mainwads, ASSET_HASH_SOUNDS_KART); mainwads++; // sounds.kart - doesn't trigger modifiedgame, doesn't need an MD5...? +#ifdef USE_PATCH_KART + W_VerifyFileMD5(mainwads, ASSET_HASH_PATCH_KART); mainwads++; // patch.kart #endif // don't check music.dta because people like to modify it, and it doesn't matter if they do // ...except it does if they slip maps in there, and that's what W_VerifyNMUSlumps is for. #endif //ifndef DEVELOP - mainwads = 5; // there are 4 wads not to unload (5 with temp sonicitems.wad) -#ifdef USE_PATCH_DTA - ++mainwads; // patch.dta adds one more -#endif - cht_Init(); //---------------------------------------------------- READY SCREEN diff --git a/src/doomdef.h b/src/doomdef.h index 6c2325c9..7729801d 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -161,6 +161,9 @@ extern FILE *logstream; // Comment or uncomment this as necessary. //#define USE_PATCH_DTA +// Kart has it's own, as well. +#define USE_PATCH_KART + // Modification options // If you want to take advantage of the Master Server's ability to force clients to update // to the latest version, fill these out. Otherwise, just comment out UPDATE_ALERT and leave diff --git a/src/info.c b/src/info.c index 6c8c7160..606904a4 100644 --- a/src/info.c +++ b/src/info.c @@ -2727,14 +2727,14 @@ state_t states[NUMSTATES] = {SPR_KRBM, FF_FULLBRIGHT|8, 5, {NULL}, 0, 0, S_SLOWBOOM10}, // S_SLOWBOOM9 {SPR_KRBM, FF_FULLBRIGHT|9, 5, {NULL}, 0, 0, S_NULL}, // S_SLOWBOOM10 - {SPR_BHOG, 0, 3, {NULL}, 0, 0, S_BALLHOG2}, // S_BALLHOG1 - {SPR_BHOG, 1, 1, {NULL}, 0, 0, S_BALLHOG3}, // S_BALLHOG2 - {SPR_BHOG, 2, 2, {NULL}, 0, 0, S_BALLHOG4}, // S_BALLHOG3 - {SPR_BHOG, 3, 3, {NULL}, 0, 0, S_BALLHOG5}, // S_BALLHOG4 - {SPR_BHOG, 4, 3, {NULL}, 0, 0, S_BALLHOG6}, // S_BALLHOG5 - {SPR_BHOG, 5, 2, {NULL}, 0, 0, S_BALLHOG7}, // S_BALLHOG6 - {SPR_BHOG, 6, 1, {NULL}, 0, 0, S_BALLHOG8}, // S_BALLHOG7 - {SPR_BHOG, 7, 1, {NULL}, 0, 0, S_BALLHOG1}, // S_BALLHOG8 + {SPR_BHOG, 0, 3, {A_PlaySound}, sfx_s1bd, 1, S_BALLHOG2}, // S_BALLHOG1 + {SPR_BHOG, FF_FULLBRIGHT|1, 1, {NULL}, 0, 0, S_BALLHOG3}, // S_BALLHOG2 + {SPR_BHOG, FF_FULLBRIGHT|2, 2, {NULL}, 0, 0, S_BALLHOG4}, // S_BALLHOG3 + {SPR_BHOG, FF_FULLBRIGHT|3, 3, {NULL}, 0, 0, S_BALLHOG5}, // S_BALLHOG4 + {SPR_BHOG, FF_FULLBRIGHT|4, 3, {NULL}, 0, 0, S_BALLHOG6}, // S_BALLHOG5 + {SPR_BHOG, 5, 2, {NULL}, 0, 0, S_BALLHOG7}, // S_BALLHOG6 + {SPR_BHOG, 6, 1, {NULL}, 0, 0, S_BALLHOG8}, // S_BALLHOG7 + {SPR_BHOG, 7, 1, {NULL}, 0, 0, S_BALLHOG1}, // S_BALLHOG8 {SPR_BLIG, 0, 2, {NULL}, 0, 0, S_BLUELIGHTNING2}, // S_BLUELIGHTNING1 {SPR_BLIG, 1, 2, {NULL}, 0, 0, S_BLUELIGHTNING3}, // S_BLUELIGHTNING2 diff --git a/src/p_map.c b/src/p_map.c index 7cc315ef..af8e7b4f 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -3840,7 +3840,7 @@ void P_BouncePlayerMove(mobj_t *mo) if (!mo->player) return; - if (mo->eflags & MFE_JUSTBOUNCEDWALL) + if ((mo->eflags & MFE_JUSTBOUNCEDWALL) || (mo->player->spectator)) { P_SlideMove(mo, true); return; diff --git a/src/p_mobj.c b/src/p_mobj.c index 2631654c..b828c72b 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1761,9 +1761,11 @@ void P_XYMovement(mobj_t *mo) { P_BounceMove(mo); xmove = ymove = 0; - //S_StartSound(mo, mo->info->activesound); - //{ SRB2kart - Green Shell, Fireball - if (mo->type == MT_GREENITEM) + S_StartSound(mo, mo->info->activesound); + + //{ SRB2kart - Orbinaut, Ballhog + // Bump sparks + if (mo->type == MT_GREENITEM || mo->type == MT_BALLHOG) { mobj_t *fx; fx = P_SpawnMobj(mo->x, mo->y, mo->z, MT_BUMP); @@ -1772,6 +1774,10 @@ void P_XYMovement(mobj_t *mo) else fx->eflags &= ~MFE_VERTICALFLIP; fx->scale = mo->scale; + } + + if (mo->type == MT_GREENITEM) // Orbinaut speed decreasing + { if (mo->health > 1) { S_StartSound(mo, mo->info->attacksound); @@ -1788,10 +1794,6 @@ void P_XYMovement(mobj_t *mo) P_InstaThrust(mo, R_PointToAngle2(mo->x, mo->y, mo->x + xmove, mo->y + ymove)+ANGLE_90, 16*FRACUNIT); } } - if (mo->type == MT_FIREBALL) - S_StartSound(mo, mo->info->attacksound); - else - S_StartSound(mo, mo->info->activesound); //} // Bounce ring algorithm @@ -8120,6 +8122,7 @@ void P_MobjThinker(mobj_t *mobj) mobj->threshold--; break; case MT_BALLHOG: + P_SpawnGhostMobj(mobj)->fuse = 2; if (mobj->threshold > 0) mobj->threshold--; break; diff --git a/src/sounds.c b/src/sounds.c index 6223458d..32532612 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -294,7 +294,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"s1ba", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s1bb", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s1bc", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"s1bd", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"s1bd", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Ballhog bounce {"s1be", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s1bf", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"s1c0", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, From 06646252c1747dfd07862575e58c8295c1074285 Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Wed, 27 Jun 2018 10:37:19 -0400 Subject: [PATCH 086/293] Up ghost tics on ballhog --- src/p_mobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index b828c72b..23fa23bf 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8122,7 +8122,7 @@ void P_MobjThinker(mobj_t *mobj) mobj->threshold--; break; case MT_BALLHOG: - P_SpawnGhostMobj(mobj)->fuse = 2; + P_SpawnGhostMobj(mobj)->fuse = 3; if (mobj->threshold > 0) mobj->threshold--; break; From c6ef29f91c68a64fb4d94884e2467c19fb95c0a3 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 27 Jun 2018 15:38:02 +0100 Subject: [PATCH 087/293] Test commit please ignore (no, actually, what I'm doing here is pushing my very first change: A .bat for the gitignore, so that I can keep my compilation script in the same folder as executables.) --- bin/Mingw/Release/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/Mingw/Release/.gitignore b/bin/Mingw/Release/.gitignore index 834f313e..3458ff76 100644 --- a/bin/Mingw/Release/.gitignore +++ b/bin/Mingw/Release/.gitignore @@ -1,3 +1,4 @@ *.exe *.mo r_opengl.dll +*.bat From 18f74e880a4ce5c90eb3fff1f0f3280669475339 Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Wed, 27 Jun 2018 13:14:22 -0400 Subject: [PATCH 088/293] ssplayer -> viewnumber --- src/r_bsp.c | 10 +++++----- src/r_bsp.h | 2 +- src/r_main.c | 18 ++++++++---------- src/r_things.c | 18 +++++++++--------- src/r_things.h | 2 +- 5 files changed, 24 insertions(+), 26 deletions(-) diff --git a/src/r_bsp.c b/src/r_bsp.c index 234d6ee0..56f159c2 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -855,7 +855,7 @@ static void R_AddPolyObjects(subsector_t *sub) drawseg_t *firstseg; -static void R_Subsector(size_t num, UINT8 ssplayer) +static void R_Subsector(size_t num, UINT8 viewnumber) { INT32 count, floorlightlevel, ceilinglightlevel, light; seg_t *line; @@ -1213,7 +1213,7 @@ static void R_Subsector(size_t num, UINT8 ssplayer) // Either you must pass the fake sector and handle validcount here, on the // real sector, or you must account for the lighting in some other way, // like passing it as an argument. - R_AddSprites(sub->sector, (floorlightlevel+ceilinglightlevel)/2, ssplayer); + R_AddSprites(sub->sector, (floorlightlevel+ceilinglightlevel)/2, viewnumber); firstseg = NULL; @@ -1419,7 +1419,7 @@ INT32 R_GetPlaneLight(sector_t *sector, fixed_t planeheight, boolean underside) // // killough 5/2/98: reformatted, removed tail recursion -void R_RenderBSPNode(INT32 bspnum, UINT8 ssplayer) +void R_RenderBSPNode(INT32 bspnum, UINT8 viewnumber) { node_t *bsp; INT32 side; @@ -1430,7 +1430,7 @@ void R_RenderBSPNode(INT32 bspnum, UINT8 ssplayer) // Decide which side the view point is on. side = R_PointOnSide(viewx, viewy, bsp); // Recursively divide front space. - R_RenderBSPNode(bsp->children[side], ssplayer); + R_RenderBSPNode(bsp->children[side], viewnumber); // Possibly divide back space. @@ -1448,5 +1448,5 @@ void R_RenderBSPNode(INT32 bspnum, UINT8 ssplayer) portalcullsector = NULL; } - R_Subsector(bspnum == -1 ? 0 : bspnum & ~NF_SUBSECTOR, ssplayer); + R_Subsector(bspnum == -1 ? 0 : bspnum & ~NF_SUBSECTOR, viewnumber); } diff --git a/src/r_bsp.h b/src/r_bsp.h index db340221..f493a8a6 100644 --- a/src/r_bsp.h +++ b/src/r_bsp.h @@ -37,7 +37,7 @@ extern INT32 doorclosed; void R_ClearClipSegs(void); void R_PortalClearClipSegs(INT32 start, INT32 end); void R_ClearDrawSegs(void); -void R_RenderBSPNode(INT32 bspnum, UINT8 ssplayer); +void R_RenderBSPNode(INT32 bspnum, UINT8 viewnumber); void R_AddPortal(INT32 line1, INT32 line2, INT32 x1, INT32 x2); #ifdef POLYOBJECTS diff --git a/src/r_main.c b/src/r_main.c index b66e47ce..5ce8c020 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -1335,18 +1335,16 @@ void R_RenderPlayerView(player_t *player) { portal_pair *portal; const boolean skybox = (skyboxmo[0] && cv_skybox.value); - UINT8 ssplayer; + UINT8 viewnumber; if (player == &players[secondarydisplayplayer] && splitscreen) - ssplayer = 2; + viewnumber = 1; else if (player == &players[thirddisplayplayer] && splitscreen > 1) - ssplayer = 3; + viewnumber = 2; else if (player == &players[fourthdisplayplayer] && splitscreen > 2) - ssplayer = 4; - else if (splitscreen) - ssplayer = 1; + viewnumber = 3; else - ssplayer = 0; + viewnumber = 0; if (cv_homremoval.value && player == &players[displayplayer]) // if this is display player 1 { @@ -1383,7 +1381,7 @@ void R_RenderPlayerView(player_t *player) R_ClearVisibleFloorSplats(); #endif - R_RenderBSPNode((INT32)numnodes - 1, ssplayer); + R_RenderBSPNode((INT32)numnodes - 1, viewnumber); R_ClipSprites(); R_DrawPlanes(); #ifdef FLOORSPLATS @@ -1416,7 +1414,7 @@ void R_RenderPlayerView(player_t *player) mytotal = 0; ProfZeroTimer(); #endif - R_RenderBSPNode((INT32)numnodes - 1, ssplayer); + R_RenderBSPNode((INT32)numnodes - 1, viewnumber); R_ClipSprites(); #ifdef TIMING RDMSR(0x10, &mycount); @@ -1441,7 +1439,7 @@ void R_RenderPlayerView(player_t *player) validcount++; - R_RenderBSPNode((INT32)numnodes - 1, ssplayer); + R_RenderBSPNode((INT32)numnodes - 1, viewnumber); R_ClipSprites(); //R_DrawPlanes(); //R_DrawMasked(); diff --git a/src/r_things.c b/src/r_things.c index 2b9810fc..524be5a4 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1670,7 +1670,7 @@ static void R_ProjectPrecipitationSprite(precipmobj_t *thing) // R_AddSprites // During BSP traversal, this adds sprites by sector. // -void R_AddSprites(sector_t *sec, INT32 lightlevel, UINT8 ssplayer) +void R_AddSprites(sector_t *sec, INT32 lightlevel, UINT8 viewnumber) { mobj_t *thing; precipmobj_t *precipthing; // Tails 08-25-2002 @@ -1716,19 +1716,19 @@ void R_AddSprites(sector_t *sec, INT32 lightlevel, UINT8 ssplayer) if (splitscreen) { if (thing->eflags & MFE_DRAWONLYFORP1) - if (ssplayer != 1) + if (viewnumber != 0) continue; if (thing->eflags & MFE_DRAWONLYFORP2) - if (ssplayer != 2) + if (viewnumber != 1) continue; if (thing->eflags & MFE_DRAWONLYFORP3 && splitscreen > 1) - if (ssplayer != 3) + if (viewnumber != 2) continue; if (thing->eflags & MFE_DRAWONLYFORP4 && splitscreen > 2) - if (ssplayer != 4) + if (viewnumber != 3) continue; } @@ -1749,19 +1749,19 @@ void R_AddSprites(sector_t *sec, INT32 lightlevel, UINT8 ssplayer) if (splitscreen) { if (thing->eflags & MFE_DRAWONLYFORP1) - if (ssplayer != 1) + if (viewnumber != 0) continue; if (thing->eflags & MFE_DRAWONLYFORP2) - if (ssplayer != 2) + if (viewnumber != 1) continue; if (thing->eflags & MFE_DRAWONLYFORP3 && splitscreen > 1) - if (ssplayer != 3) + if (viewnumber != 2) continue; if (thing->eflags & MFE_DRAWONLYFORP4 && splitscreen > 2) - if (ssplayer != 4) + if (viewnumber != 3) continue; } diff --git a/src/r_things.h b/src/r_things.h index c7d4989c..bd734ddd 100644 --- a/src/r_things.h +++ b/src/r_things.h @@ -55,7 +55,7 @@ void R_DelSpriteDefs(UINT16 wadnum); #endif //SoM: 6/5/2000: Light sprites correctly! -void R_AddSprites(sector_t *sec, INT32 lightlevel, UINT8 ssplayer); +void R_AddSprites(sector_t *sec, INT32 lightlevel, UINT8 viewnumber); void R_InitSprites(void); void R_ClearSprites(void); void R_ClipSprites(void); From dd04d68c09e8bf842ce9f51347332c4b923e63d1 Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Wed, 27 Jun 2018 15:58:43 -0400 Subject: [PATCH 089/293] Held item changes --- src/k_kart.c | 238 ++++++++++++++++++++++++++++++++++++++++------ src/k_kart.h | 1 + src/lua_baselib.c | 11 +++ src/p_inter.c | 6 ++ src/p_mobj.c | 103 -------------------- 5 files changed, 227 insertions(+), 132 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 776b30b7..72447698 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2083,7 +2083,7 @@ void K_DriftDustHandling(mobj_t *spawner) } } -static mobj_t *K_FindLastTrailMobj(player_t *player) // YUCK, i hate this! +static mobj_t *K_FindLastTrailMobj(player_t *player) { mobj_t *trail = player->mo->hnext; @@ -2473,6 +2473,165 @@ void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source) } } +void K_RepairOrbitChain(mobj_t *orbit) +{ + mobj_t *cachenext = orbit->hnext; + + // First, repair the chain + if (orbit->hnext && !P_MobjWasRemoved(orbit->hnext)) + { + P_SetTarget(&orbit->hnext->hprev, orbit->hprev); + P_SetTarget(&orbit->hnext, NULL); + } + + if (orbit->hprev && !P_MobjWasRemoved(orbit->hprev)) + { + P_SetTarget(&orbit->hprev->hnext, cachenext); + P_SetTarget(&orbit->hprev, NULL); + } + + // Then recount to make sure item amount is correct + if (orbit->target && orbit->target->player) + { + mobj_t *cur = NULL; + mobj_t *prev = NULL; + INT32 num = 0; + + if (orbit->target->hnext) + cur = orbit->target->hnext; + + while (cur && !P_MobjWasRemoved(cur) && cur != orbit->target->player->mo) + { + num++; + prev = cur; + cur = cur->hnext; + if (num > orbit->target->player->kartstuff[k_itemamount]) + P_RemoveMobj(prev); + } + + if (orbit->target->player->kartstuff[k_itemamount] != num) + orbit->target->player->kartstuff[k_itemamount] = num; + } +} + +static void K_MoveHeldObjects(player_t *player) +{ + if (!player->mo) + return; + + if (!player->mo->hnext) + return; + + switch (player->mo->hnext->type) + { + case MT_GREENSHIELD: // Kart orbit items + case MT_JAWZ_SHIELD: + { + mobj_t *cur = player->mo->hnext; + + while (cur && !P_MobjWasRemoved(cur) && cur != player->mo) + { + const fixed_t radius = FixedHypot(player->mo->radius, player->mo->radius) + FixedHypot(cur->radius, cur->radius); // mobj's distance from its Target, or Radius. + fixed_t z; + + cur->angle -= ANGLE_90; + cur->angle += FixedAngle(cur->info->speed); + + // If the player is on the ceiling, then flip your items as well. + if (player && player->mo->eflags & MFE_VERTICALFLIP) + cur->eflags |= MFE_VERTICALFLIP; + else + cur->eflags &= ~MFE_VERTICALFLIP; + + // Shrink your items if the player shrunk too. + cur->scale = player->mo->scale; + + if (P_MobjFlip(cur) > 0) + z = player->mo->z; + else + z = player->mo->z + player->mo->height - cur->height; + + 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->flags &= ~MF_NOCLIPTHING; + if (!P_TryMove(cur, player->mo->x + cur->momx, player->mo->y + cur->momy, true)) + P_SlideMove(cur, true); + if (P_IsObjectOnGround(player->mo)) + { + if (P_MobjFlip(cur) > 0) + { + if (cur->floorz > player->mo->z - cur->height) + z = cur->floorz; + } + else + { + if (cur->ceilingz < player->mo->z + player->mo->height + cur->height) + z = cur->ceilingz - cur->height; + } + } + cur->z = z; + cur->momx = cur->momy = 0; + cur->angle += ANGLE_90; + + cur = cur->hnext; + } + } + break; + case MT_BANANA_SHIELD: // Kart trailing items + case MT_SSMINE_SHIELD: + case MT_FAKESHIELD: + { + mobj_t *cur = player->mo->hnext; + mobj_t *targ = player->mo; + + while (cur && !P_MobjWasRemoved(cur) && cur != player->mo) + { + const fixed_t spacing = FixedMul(3*cur->info->radius/2, player->mo->scale); + angle_t ang; + fixed_t targx; + fixed_t targy; + fixed_t targz; + fixed_t speed; + fixed_t dist = spacing; + + if (cur != player->mo->hnext) + { + targ = cur->hprev; + dist = spacing/2; + } + + if (!targ || P_MobjWasRemoved(targ)) + continue; + + ang = targ->angle; + targx = targ->x + P_ReturnThrustX(cur, ang + ANGLE_180, dist); + targy = targ->y + P_ReturnThrustY(cur, ang + ANGLE_180, dist); + targz = targ->z; + speed = FixedMul(R_PointToDist2(cur->x, cur->y, targx, targy), 3*FRACUNIT/4); + if (P_IsObjectOnGround(targ)) + targz = cur->floorz; + + cur->angle = R_PointToAngle2(cur->x, cur->y, targx, targy); + + if (speed > dist) + P_InstaThrust(cur, cur->angle, speed-dist); + + P_SetObjectMomZ(cur, FixedMul(targz - cur->z, 3*FRACUNIT/4) - gravity, false); + + if (R_PointToDist2(cur->x, cur->y, targx, targy) > 768*FRACUNIT) + P_TeleportMove(cur, targx, targy, cur->z); + + cur = cur->hnext; + } + } + break; + default: + break; + } +} + /** \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 @@ -2675,6 +2834,9 @@ void K_KartPlayerAfterThink(player_t *player) if (!(player->mo->state->frame & FF_FULLBRIGHT)) player->mo->frame &= ~FF_FULLBRIGHT; } + + // Move held objects (Bananas, Orbinaut, etc) + K_MoveHeldObjects(player); } // Returns false if this player being placed here causes them to collide with any other player @@ -3187,31 +3349,40 @@ void K_MoveKartPlayer(player_t *player, boolean onground) case KITEM_ORBINAUT: if (ATTACK_IS_DOWN && !HOLDING_ITEM && NO_HYUDORO) { + angle_t newangle; + fixed_t newx; + fixed_t newy; INT32 moloop; + mobj_t *mo; + mobj_t *prev = NULL; + //K_PlayTauntSound(player->mo); player->kartstuff[k_itemheld] = 1; player->pflags |= PF_ATTACKDOWN; - //K_PlayTauntSound(player->mo); S_StartSound(player->mo, sfx_s3k3a); for (moloop = 0; moloop < player->kartstuff[k_itemamount]; moloop++) { - angle_t newangle; - fixed_t newx; - fixed_t newy; - mobj_t *mo; - - newangle = player->mo->angle; - newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, 64*FRACUNIT); - newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, 64*FRACUNIT); + 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_GREENSHIELD); - if (mo) + mo->angle = newangle; + mo->threshold = 10; + mo->movecount = player->kartstuff[k_itemamount]; + mo->lastlook = moloop+1; + P_SetTarget(&mo->target, player->mo); + if (moloop > 0) { - mo->threshold = 10; - mo->lastlook = moloop+1; - P_SetTarget(&mo->target, player->mo); - mo->angle = FixedAngle(((360/player->kartstuff[k_itemamount])*moloop)*FRACUNIT) + ANGLE_90; + P_SetTarget(&mo->hprev, prev); + if (prev != NULL) + P_SetTarget(&prev->hnext, mo); } + else + P_SetTarget(&player->mo->hnext, mo); + if (moloop == player->kartstuff[k_itemamount]-1) // Complete loop for orbit items + P_SetTarget(&mo->hnext, player->mo); + prev = mo; } } else if (ATTACK_IS_DOWN && player->kartstuff[k_itemheld]) // Orbinaut x3 thrown @@ -3228,31 +3399,40 @@ void K_MoveKartPlayer(player_t *player, boolean onground) case KITEM_JAWZ: if (ATTACK_IS_DOWN && !HOLDING_ITEM && NO_HYUDORO) { + angle_t newangle; + fixed_t newx; + fixed_t newy; INT32 moloop; + mobj_t *mo; + mobj_t *prev = NULL; + //K_PlayTauntSound(player->mo); player->kartstuff[k_itemheld] = 1; player->pflags |= PF_ATTACKDOWN; - //K_PlayTauntSound(player->mo); S_StartSound(player->mo, sfx_s3k3a); for (moloop = 0; moloop < player->kartstuff[k_itemamount]; moloop++) { - angle_t newangle; - fixed_t newx; - fixed_t newy; - mobj_t *mo; - - newangle = player->mo->angle; - newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, 64*FRACUNIT); - newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, 64*FRACUNIT); + 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); - if (mo) + mo->angle = newangle; + mo->threshold = 10; + mo->movecount = player->kartstuff[k_itemamount]; + mo->lastlook = moloop+1; + P_SetTarget(&mo->target, player->mo); + if (moloop > 0) { - mo->threshold = 10; - mo->lastlook = moloop+1; - P_SetTarget(&mo->target, player->mo); - mo->angle = FixedAngle(((360/player->kartstuff[k_itemamount])*moloop)*FRACUNIT) + ANGLE_90; + P_SetTarget(&mo->hprev, prev); + if (prev != NULL) + P_SetTarget(&prev->hnext, mo); } + else + P_SetTarget(&player->mo->hnext, mo); + if (moloop == player->kartstuff[k_itemamount]-1) // Complete loop for orbit items + P_SetTarget(&mo->hnext, player->mo); + prev = mo; } } else if (ATTACK_IS_DOWN && HOLDING_ITEM && player->kartstuff[k_itemheld]) // Jawz thrown diff --git a/src/k_kart.h b/src/k_kart.h index cb7dce21..f046652a 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -36,6 +36,7 @@ void K_DriftDustHandling(mobj_t *spawner); void K_DoSneaker(player_t *player, boolean doPFlag); void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed); void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source); +void K_RepairOrbitChain(mobj_t *orbit); boolean K_CheckPlayersRespawnColliding(INT32 playernum, fixed_t x, fixed_t y); INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue); void K_StripItems(player_t *player); diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 1ec57030..9a47bf9d 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -2149,6 +2149,16 @@ static int lib_kKillBananaChain(lua_State *L) return 0; } +static int lib_kRepairOrbitChain(lua_State *L) +{ + mobj_t *orbit = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); + NOHUD + if (!orbit) + return LUA_ErrInvalid(L, "mobj_t"); + K_RepairOrbitChain(orbit); + return 0; +} + static int lib_kMomentumToFacing(lua_State *L) { player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); @@ -2377,6 +2387,7 @@ static luaL_Reg lib[] = { {"K_DoSneaker",lib_kDoSneaker}, {"K_DoPogoSpring",lib_kDoPogoSpring}, {"K_KillBananaChain",lib_kKillBananaChain}, + {"K_RepairOrbitChain",lib_kRepairOrbitChain}, {"K_MomentumToFacing",lib_kMomentumToFacing}, {"K_GetKartSpeed",lib_kGetKartSpeed}, {"K_GetKartAccel",lib_kGetKartAccel}, diff --git a/src/p_inter.c b/src/p_inter.c index 117c2459..e7b5fcb7 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2122,7 +2122,13 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source) } else if ((target->type == MT_GREENSHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_ORBINAUT) // orbit items || (target->type == MT_JAWZ_SHIELD && target->target->player->kartstuff[k_itemtype] == KITEM_JAWZ)) + { target->target->player->kartstuff[k_itemamount]--; + if (target->lastlook != 0) + { + K_RepairOrbitChain(target); + } + } if (target->target->player->kartstuff[k_itemamount] < 0) target->target->player->kartstuff[k_itemamount] = 0; diff --git a/src/p_mobj.c b/src/p_mobj.c index 23fa23bf..44683b64 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6697,63 +6697,6 @@ void P_MobjThinker(mobj_t *mobj) if (mobj->health > 0 && mobj->target && mobj->target->player && mobj->target->player->health > 0 && !mobj->target->player->spectator) { - fixed_t z; - const fixed_t radius = FixedHypot(mobj->target->radius, mobj->target->radius) + FixedHypot(mobj->radius, mobj->radius); // mobj's distance from its Target, or Radius. - - mobj->angle -= ANGLE_90; - mobj->angle += FixedAngle(mobj->info->speed); - - // If the player is on the ceiling, then flip your items as well. - if (mobj->target->player && mobj->target->eflags & MFE_VERTICALFLIP) - { - mobj->eflags |= MFE_VERTICALFLIP; - } - else - { - mobj->eflags &= ~MFE_VERTICALFLIP; - } - - // Shrink your items if the player shrunk too. - if (mobj->target->player) - mobj->scale = mobj->target->scale; - - if (P_MobjFlip(mobj) > 0) - { - z = mobj->target->z; - } - else - { - z = mobj->target->z + mobj->target->height - mobj->height; - } - - mobj->flags |= MF_NOCLIPTHING; // temporarily make them noclip other objects so they can't hit anyone while in the player - P_TeleportMove(mobj, mobj->target->x, mobj->target->y, z); - mobj->momx = FixedMul(FINECOSINE(mobj->angle>>ANGLETOFINESHIFT),radius); - mobj->momy = FixedMul(FINESINE(mobj->angle>>ANGLETOFINESHIFT), radius); - mobj->flags &= ~MF_NOCLIPTHING; - if (!P_TryMove(mobj, mobj->target->x + mobj->momx, mobj->target->y + mobj->momy, true)) - P_SlideMove(mobj, true); - if (P_IsObjectOnGround(mobj->target)) - { - if (P_MobjFlip(mobj) > 0) - { - if (mobj->floorz > mobj->target->z - mobj->height) - { - z = mobj->floorz; - } - } - else - { - if (mobj->ceilingz < mobj->target->z + mobj->target->height + mobj->height) - { - z = mobj->ceilingz - mobj->height; - } - } - } - mobj->z = z; - mobj->momx = mobj->momy = 0; - mobj->angle += ANGLE_90; - // Was this so hard? if ((mobj->type == MT_GREENSHIELD && mobj->target->player->kartstuff[k_itemtype] != KITEM_ORBINAUT) || (mobj->type == MT_JAWZ_SHIELD && mobj->target->player->kartstuff[k_itemtype] != KITEM_JAWZ) @@ -6779,52 +6722,6 @@ void P_MobjThinker(mobj_t *mobj) if (mobj->health > 0 && mobj->target && mobj->target->player && mobj->target->player->health > 0 && !mobj->target->player->spectator) { - if (mobj->lastlook == 1) - { - const fixed_t spacing = FixedMul(3*mobj->info->radius/2, mobj->target->scale); - mobj_t *cur = mobj; - mobj_t *targ = mobj->target; - - while (cur && !P_MobjWasRemoved(cur)) - { - angle_t ang; - fixed_t targx; - fixed_t targy; - fixed_t targz; - fixed_t speed; - fixed_t dist = spacing; - - if (cur != mobj) - { - targ = cur->hprev; - dist = spacing/2; - } - - if (!targ || P_MobjWasRemoved(targ)) - continue; - - ang = targ->angle; - targx = targ->x + P_ReturnThrustX(cur, ang + ANGLE_180, dist); - targy = targ->y + P_ReturnThrustY(cur, ang + ANGLE_180, dist); - targz = targ->z; - speed = FixedMul(R_PointToDist2(cur->x, cur->y, targx, targy), 3*FRACUNIT/4); - if (P_IsObjectOnGround(targ)) - targz = cur->floorz; - - cur->angle = R_PointToAngle2(cur->x, cur->y, targx, targy); - - if (speed > dist) - P_InstaThrust(cur, cur->angle, speed-dist); - - P_SetObjectMomZ(cur, FixedMul(targz - cur->z, 3*FRACUNIT/4) - gravity, false); - - if (R_PointToDist2(cur->x, cur->y, targx, targy) > 768*FRACUNIT) - P_TeleportMove(cur, targx, targy, cur->z); - - cur = cur->hnext; - } - } - // Was this so hard? if ((mobj->type == MT_BANANA_SHIELD && mobj->target->player->kartstuff[k_itemtype] != KITEM_BANANA) || (mobj->type == MT_SSMINE_SHIELD && mobj->target->player->kartstuff[k_itemtype] != KITEM_MINE) From f9426716075e5a8961053f1aded5ccb5468fd3f5 Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 28 Jun 2018 01:20:19 +0100 Subject: [PATCH 090/293] First substantial commit! * PRETTY SURE I fixed that bastardacious issue with multiple shield items disappearing at once. Done via introducing lastlook to store the updated count. * Fix an issue with incorrect scale setting for shield items. * Clean up a bunch of weird shit with regards to setting of hnext/hprev chains. (Why does the player go on the opposite end to the direction you enter the chain from...) * Repair hnext chain on mobjremoval as well. May or may not remove the need for overlay/shadow thinkers; too tired/excited to dig into that atm. --- src/k_kart.c | 71 ++++++++++++++++++---------------------------------- src/p_mobj.c | 20 +++++++++++++-- 2 files changed, 42 insertions(+), 49 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 72447698..aa18c863 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2085,9 +2085,9 @@ void K_DriftDustHandling(mobj_t *spawner) static mobj_t *K_FindLastTrailMobj(player_t *player) { - mobj_t *trail = player->mo->hnext; + mobj_t *trail; - if (!player || !trail) + if (!player || !(trail = player->mo) || !player->mo->hnext) return NULL; while (trail->hnext && !P_MobjWasRemoved(trail->hnext)) @@ -2493,20 +2493,19 @@ void K_RepairOrbitChain(mobj_t *orbit) // Then recount to make sure item amount is correct if (orbit->target && orbit->target->player) { - mobj_t *cur = NULL; - mobj_t *prev = NULL; INT32 num = 0; - if (orbit->target->hnext) - cur = orbit->target->hnext; + mobj_t *cur = orbit->target->hnext; + mobj_t *prev = NULL; - while (cur && !P_MobjWasRemoved(cur) && cur != orbit->target->player->mo) + while (cur && !P_MobjWasRemoved(cur)) { - num++; prev = cur; cur = cur->hnext; - if (num > orbit->target->player->kartstuff[k_itemamount]) + if (++num > orbit->target->player->kartstuff[k_itemamount]) P_RemoveMobj(prev); + else + prev->movedir = num; } if (orbit->target->player->kartstuff[k_itemamount] != num) @@ -2529,7 +2528,7 @@ static void K_MoveHeldObjects(player_t *player) { mobj_t *cur = player->mo->hnext; - while (cur && !P_MobjWasRemoved(cur) && cur != player->mo) + while (cur && !P_MobjWasRemoved(cur)) { const fixed_t radius = FixedHypot(player->mo->radius, player->mo->radius) + FixedHypot(cur->radius, cur->radius); // mobj's distance from its Target, or Radius. fixed_t z; @@ -2544,7 +2543,7 @@ static void K_MoveHeldObjects(player_t *player) cur->eflags &= ~MFE_VERTICALFLIP; // Shrink your items if the player shrunk too. - cur->scale = player->mo->scale; + P_SetScale(cur, (cur->destscale = player->mo->scale)); if (P_MobjFlip(cur) > 0) z = player->mo->z; @@ -2586,7 +2585,7 @@ static void K_MoveHeldObjects(player_t *player) mobj_t *cur = player->mo->hnext; mobj_t *targ = player->mo; - while (cur && !P_MobjWasRemoved(cur) && cur != player->mo) + while (cur && !P_MobjWasRemoved(cur)) { const fixed_t spacing = FixedMul(3*cur->info->radius/2, player->mo->scale); angle_t ang; @@ -3285,7 +3284,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) fixed_t newy; INT32 moloop; mobj_t *mo; - mobj_t *prev = NULL; + mobj_t *prev = player->mo; //K_PlayTauntSound(player->mo); player->kartstuff[k_itemheld] = 1; @@ -3301,14 +3300,8 @@ void K_MoveKartPlayer(player_t *player, boolean onground) mo->movecount = player->kartstuff[k_itemamount]; mo->lastlook = moloop+1; P_SetTarget(&mo->target, player->mo); - if (moloop > 0) - { - P_SetTarget(&mo->hprev, prev); - if (prev != NULL) - P_SetTarget(&prev->hnext, mo); - } - else - P_SetTarget(&player->mo->hnext, mo); + P_SetTarget(&mo->hprev, prev); + P_SetTarget(&prev->hnext, mo); prev = mo; } } @@ -3353,8 +3346,8 @@ void K_MoveKartPlayer(player_t *player, boolean onground) fixed_t newx; fixed_t newy; INT32 moloop; - mobj_t *mo; - mobj_t *prev = NULL; + mobj_t *mo = NULL; + mobj_t *prev = player->mo; //K_PlayTauntSound(player->mo); player->kartstuff[k_itemheld] = 1; @@ -3370,18 +3363,10 @@ void K_MoveKartPlayer(player_t *player, boolean onground) mo->angle = newangle; mo->threshold = 10; mo->movecount = player->kartstuff[k_itemamount]; - mo->lastlook = moloop+1; + mo->movedir = mo->lastlook = moloop+1; P_SetTarget(&mo->target, player->mo); - if (moloop > 0) - { - P_SetTarget(&mo->hprev, prev); - if (prev != NULL) - P_SetTarget(&prev->hnext, mo); - } - else - P_SetTarget(&player->mo->hnext, mo); - if (moloop == player->kartstuff[k_itemamount]-1) // Complete loop for orbit items - P_SetTarget(&mo->hnext, player->mo); + P_SetTarget(&mo->hprev, prev); + P_SetTarget(&prev->hnext, mo); prev = mo; } } @@ -3403,8 +3388,8 @@ void K_MoveKartPlayer(player_t *player, boolean onground) fixed_t newx; fixed_t newy; INT32 moloop; - mobj_t *mo; - mobj_t *prev = NULL; + mobj_t *mo = NULL; + mobj_t *prev = player->mo; //K_PlayTauntSound(player->mo); player->kartstuff[k_itemheld] = 1; @@ -3420,18 +3405,10 @@ void K_MoveKartPlayer(player_t *player, boolean onground) mo->angle = newangle; mo->threshold = 10; mo->movecount = player->kartstuff[k_itemamount]; - mo->lastlook = moloop+1; + mo->movedir = mo->lastlook = moloop+1; P_SetTarget(&mo->target, player->mo); - if (moloop > 0) - { - P_SetTarget(&mo->hprev, prev); - if (prev != NULL) - P_SetTarget(&prev->hnext, mo); - } - else - P_SetTarget(&player->mo->hnext, mo); - if (moloop == player->kartstuff[k_itemamount]-1) // Complete loop for orbit items - P_SetTarget(&mo->hnext, player->mo); + P_SetTarget(&mo->hprev, prev); + P_SetTarget(&prev->hnext, mo); prev = mo; } } diff --git a/src/p_mobj.c b/src/p_mobj.c index 44683b64..a89961a0 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6700,7 +6700,7 @@ void P_MobjThinker(mobj_t *mobj) // Was this so hard? if ((mobj->type == MT_GREENSHIELD && mobj->target->player->kartstuff[k_itemtype] != KITEM_ORBINAUT) || (mobj->type == MT_JAWZ_SHIELD && mobj->target->player->kartstuff[k_itemtype] != KITEM_JAWZ) - || (mobj->lastlook > 0 && mobj->target->player->kartstuff[k_itemamount] < mobj->lastlook) + || (mobj->movedir > 0 && mobj->target->player->kartstuff[k_itemamount] < mobj->movedir) || (!mobj->target->player->kartstuff[k_itemheld])) { P_RemoveMobj(mobj); @@ -9276,7 +9276,23 @@ void P_RemoveMobj(mobj_t *mobj) // // Remove any references to other mobjs. P_SetTarget(&mobj->target, P_SetTarget(&mobj->tracer, NULL)); - P_SetTarget(&mobj->hprev, P_SetTarget(&mobj->hnext, NULL)); + + // repair hnext chain + { + mobj_t *cachenext = mobj->hnext; + + if (mobj->hnext && !P_MobjWasRemoved(mobj->hnext)) + { + P_SetTarget(&mobj->hnext->hprev, mobj->hprev); + P_SetTarget(&mobj->hnext, NULL); + } + + if (mobj->hprev && !P_MobjWasRemoved(mobj->hprev)) + { + P_SetTarget(&mobj->hprev->hnext, cachenext); + P_SetTarget(&mobj->hprev, NULL); + } + } // free block // DBG: set everything in mobj_t to 0xFF instead of leaving it. debug memory error. From a81eff08844fe64875872be9544cff6658d78702 Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Wed, 27 Jun 2018 20:51:02 -0400 Subject: [PATCH 091/293] Don't play start countdown several times in splitscreen --- src/k_kart.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index aa18c863..ea14cefd 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3701,10 +3701,13 @@ void K_MoveKartPlayer(player_t *player, boolean onground) } // Play the starting countdown sounds - if ((leveltime == starttime-(3*TICRATE)) || (leveltime == starttime-(2*TICRATE)) || (leveltime == starttime-TICRATE)) - S_StartSound(NULL, sfx_s3ka7); - if (leveltime == starttime) - S_StartSound(NULL, sfx_s3kad); + if (player == &players[displayplayer]) // Don't play louder in splitscreen + { + if ((leveltime == starttime-(3*TICRATE)) || (leveltime == starttime-(2*TICRATE)) || (leveltime == starttime-TICRATE)) + S_StartSound(NULL, sfx_s3ka7); + if (leveltime == starttime) + S_StartSound(NULL, sfx_s3kad); + } // Start charging once you're given the opportunity. if (leveltime >= starttime-(2*TICRATE) && leveltime <= starttime && cmd->buttons & BT_ACCELERATE) From c815e3b791778ecca3005de67d076387f78666f1 Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Wed, 27 Jun 2018 21:02:22 -0400 Subject: [PATCH 092/293] Fix player afterimages not using correct angle on bounce pads or spinout --- src/p_user.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index 21a95582..3570e78a 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1543,7 +1543,11 @@ mobj_t *P_SpawnGhostMobj(mobj_t *mobj) ghost->color = mobj->color; ghost->colorized = mobj->colorized; // Kart: they should also be colorized if their origin is - ghost->angle = mobj->angle; + if (mobj->player) + ghost->angle = mobj->player->frameangle; + else + ghost->angle = mobj->angle; + ghost->sprite = mobj->sprite; ghost->frame = mobj->frame; ghost->tics = -1; From dcec24605ea0276304d7362aa008dd31534ac0f7 Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 28 Jun 2018 15:47:56 +0100 Subject: [PATCH 093/293] * AN OPPORTUNITY FOR GAMETYPE CHANGES ON THE VOTE SCREEN! * Super important to allow dedicated servers to continue forever without needing to add Terminal. * To facilitate understanding, add gametype dog-ears to the vote screen! * To do the above, add V_DrawDiag! Works in GL, too!! * Unrelated shit! * Fix a buffer overrun in the randmapbuffer! * Disable spectating in splitscreen... Not 100% sure, but in 2p battle, if you spectate, you just lose one balloon and respawn... * Improve all the string drawing functions' behaviour - both with being SLIGHTLY clipped by the edge of the screen, and when confronted with drawing off the base 320*200 internal area --- src/d_netcmd.c | 23 ++++-- src/doomstat.h | 2 +- src/g_game.c | 45 +++++++++-- src/g_game.h | 2 + src/hardware/hw_draw.c | 92 +++++++++++++++++++++++ src/hardware/hw_main.h | 1 + src/k_kart.c | 2 +- src/p_saveg.c | 10 ++- src/v_video.c | 164 +++++++++++++++++++++++++++++++++++------ src/v_video.h | 2 + src/y_inter.c | 60 +++++++++++---- 11 files changed, 351 insertions(+), 52 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index ab5852ed..82cbc4bf 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -1963,13 +1963,23 @@ void D_SetupVote(void) char buf[8]; char *p = buf; INT32 i; + INT16 gt = gametype; for (i = 0; i < 4; i++) { - if (i == 3) - WRITEUINT16(p, G_RandMap(G_TOLFlag(gametype), prevmap, true, false)); + if (i == 2) // sometimes a different gametype + { + WRITEUINT16(p, G_RandMap(G_TOLFlag(gt = G_SometimesGetDifferentGametype()), prevmap, false, false)); + WRITEUINT16(p, gt); + } else - WRITEUINT16(p, G_RandMap(G_TOLFlag(gametype), prevmap, false, false)); + { + if (i == 3) // unknown-random + WRITEUINT16(p, G_RandMap(G_TOLFlag(gametype), prevmap, true, false)); + else + WRITEUINT16(p, G_RandMap(G_TOLFlag(gametype), prevmap, false, false)); + WRITEUINT16(p, gametype); + } } SendNetXCmd(XD_SETUPVOTE, buf, p - buf); @@ -4618,9 +4628,10 @@ static void Got_SetupVotecmd(UINT8 **cp, INT32 playernum) for (i = 0; i < 4; i++) { - votelevels[i] = (INT16)READUINT16(*cp); - if (!mapheaderinfo[votelevels[i]]) - P_AllocMapHeader(votelevels[i]); + votelevels[i][0] = (INT16)READUINT16(*cp); + votelevels[i][1] = (INT16)READUINT16(*cp); + if (!mapheaderinfo[votelevels[i][0]]) + P_AllocMapHeader(votelevels[i][0]); } G_SetGamestate(GS_VOTING); diff --git a/src/doomstat.h b/src/doomstat.h index aac49c60..cf299816 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -455,7 +455,7 @@ extern boolean legitimateexit; extern boolean comebackshowninfo; extern tic_t curlap, bestlap; -extern INT16 votelevels[4]; +extern INT16 votelevels[4][2]; extern SINT8 votes[MAXPLAYERS]; extern SINT8 pickedvote; diff --git a/src/g_game.c b/src/g_game.c index 618df06e..548c26cd 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -250,7 +250,7 @@ boolean franticitems; // Frantic items currently enabled? boolean comeback; // Battle Mode's karma comeback is on/off // Voting system -INT16 votelevels[4]; // Levels that were rolled by the host +INT16 votelevels[4][2]; // Levels that were rolled by the host SINT8 votes[MAXPLAYERS]; // Each player's vote SINT8 pickedvote; // What vote the host rolls @@ -264,7 +264,7 @@ boolean legitimateexit; // Did this client actually finish the match? boolean comebackshowninfo; // Have you already seen the "ATTACK OR PROTECT" message? tic_t curlap; // Current lap time tic_t bestlap; // Best lap time -static INT16 randmapbuffer[NUMMAPS]; // Buffer for maps RandMap is allowed to roll +static INT16 randmapbuffer[NUMMAPS+1]; // Buffer for maps RandMap is allowed to roll tic_t hidetime; @@ -3026,7 +3026,7 @@ boolean G_GametypeHasSpectators(void) #if 0 return (gametype != GT_COOP && gametype != GT_COMPETITION && gametype != GT_RACE); #else - return true; + return (!splitscreen);//true; #endif } @@ -3040,6 +3040,37 @@ boolean G_BattleGametype(void) return (gametype == GT_MATCH); } +// +// G_SometimesGetDifferentGametype +// +// I pity the fool who adds more gametypes later, because it'll require some element of randomisation which needs to be synched... +// +INT16 G_SometimesGetDifferentGametype(void) +{ + if (randmapbuffer[NUMMAPS] != -1) + return gametype; + + randmapbuffer[NUMMAPS] = gametype; + + if (gametype == GT_MATCH) + return GT_RACE; + return GT_MATCH; +} + +// +// G_GetGametypeColor +// +// Pretty and consistent ^u^ +// +UINT8 G_GetGametypeColor(INT16 gt) +{ + if (gt == GT_MATCH) + return 128; // red + if (gt == GT_RACE) + return 215; // sky blue + return 247; // FALLBACK +} + // // G_RaceGametype // @@ -3152,7 +3183,7 @@ INT16 G_RandMap(INT16 tolflags, INT16 pprevmap, boolean dontadd, boolean ignoreb return G_RandMap(tolflags, pprevmap, dontadd, true); // If there's no matches, (An incredibly silly function chain, buuut... :V) ix = 0; // Sorry, none match. You get MAP01. - for (bufx = 0; bufx < NUMMAPS; bufx++) + for (bufx = 0; bufx < NUMMAPS+1; bufx++) randmapbuffer[bufx] = -1; // if we're having trouble finding a map we should probably clear it } else @@ -3160,7 +3191,7 @@ INT16 G_RandMap(INT16 tolflags, INT16 pprevmap, boolean dontadd, boolean ignoreb ix = okmaps[M_RandomKey(numokmaps)]; if (!dontadd) { - for (bufx = NUMMAPS; bufx > 0; bufx--) + for (bufx = NUMMAPS-1; bufx > 0; bufx--) randmapbuffer[bufx] = randmapbuffer[bufx-1]; randmapbuffer[0] = ix; } @@ -3293,7 +3324,7 @@ static void G_DoCompleted(void) if (randmapbuffer[TOLMaps(G_TOLFlag(gametype))-4] != -1) // we're getting pretty full, so lets clear it { - for (i = 0; i < NUMMAPS; i++) + for (i = 0; i < NUMMAPS+1; i++) randmapbuffer[i] = -1; } @@ -3947,7 +3978,7 @@ void G_DeferedInitNew(boolean pultmode, const char *mapname, INT32 pickedchar, U COM_BufAddText("stopdemo\n"); ghosts = NULL; - for (i = 0; i < NUMMAPS; i++) + for (i = 0; i < NUMMAPS+1; i++) randmapbuffer[i] = -1; // this leave the actual game if needed diff --git a/src/g_game.h b/src/g_game.h index f59641fb..e5635847 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -183,6 +183,8 @@ boolean G_GametypeUsesLives(void); boolean G_GametypeHasTeams(void); boolean G_GametypeHasSpectators(void); boolean G_BattleGametype(void); +INT16 G_SometimesGetDifferentGametype(void); +UINT8 G_GetGametypeColor(INT16 gt); boolean G_RaceGametype(void); boolean G_TagGametype(void); void G_ExitLevel(void); diff --git a/src/hardware/hw_draw.c b/src/hardware/hw_draw.c index 5bf00527..dc064b95 100644 --- a/src/hardware/hw_draw.c +++ b/src/hardware/hw_draw.c @@ -904,6 +904,98 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color) PF_Modulated|PF_NoTexture|PF_NoDepthTest); } +// -----------------+ +// HWR_DrawDiag : draw flat coloured rectangle, with no texture +// -----------------+ +void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color) +{ + FOutVector v[4]; + FSurfaceInfo Surf; + float fx, fy, fw, fh; + + if (wh < 0) + return; // consistency w/ software + +// 3--2 +// | /| +// |/ | +// 0--1 + + fx = (float)x; + fy = (float)y; + fw = fh = (float)wh; + + if (!(color & V_NOSCALESTART)) + { + float dupx = (float)vid.dupx, dupy = (float)vid.dupy; + + fx *= dupx; + fy *= dupy; + fw *= dupx; + fh *= dupy; + + if (vid.width != BASEVIDWIDTH * vid.dupx) + { + if (color & V_SNAPTORIGHT) + fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)); + else if (!(color & V_SNAPTOLEFT)) + fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 2; + } + if (vid.height != BASEVIDHEIGHT * dupy) + { + // same thing here + if (color & V_SNAPTOBOTTOM) + fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)); + else if (!(color & V_SNAPTOTOP)) + fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 2; + } + } + + if (fx >= vid.width || fy >= vid.height) + return; + if (fx < 0) + { + fw += fx; + fx = 0; + } + if (fy < 0) + { + fh += fy; + fy = 0; + } + + if (fw <= 0 || fh <= 0) + return; + /*if (fx + fw > vid.width) -- oh gee oh boy oh shit + fw = (float)vid.width - fx;*/ + if (fy + fh > vid.height) + fh = (float)vid.height - fy; + + fx = -1 + fx / (vid.width / 2); + fy = 1 - fy / (vid.height / 2); + fw = fw / (vid.width / 2); + fh = fh / (vid.height / 2); + + v[0].x = v[2].x = v[3].x = fx; + v[1].x = fx + fw; + v[0].y = v[1].y = fy; + v[2].y = v[3].y = fy - fh; + + //Hurdler: do we still use this argb color? if not, we should remove it + v[0].argb = v[1].argb = v[2].argb = v[3].argb = 0xff00ff00; //; + v[0].z = v[1].z = v[2].z = v[3].z = 1.0f; + + v[0].sow = v[3].sow = 0.0f; + v[2].sow = v[1].sow = 1.0f; + v[0].tow = v[1].tow = 0.0f; + v[2].tow = v[3].tow = 1.0f; + + Surf.FlatColor = V_GetColor(color); + + HWD.pfnDrawPolygon(&Surf, v, 4, + PF_Modulated|PF_NoTexture|PF_NoDepthTest); +} + #ifdef HAVE_PNG #ifndef _MSC_VER diff --git a/src/hardware/hw_main.h b/src/hardware/hw_main.h index 0459205b..5af88dcd 100644 --- a/src/hardware/hw_main.h +++ b/src/hardware/hw_main.h @@ -52,6 +52,7 @@ void HWR_CreatePlanePolygons(INT32 bspnum); void HWR_CreateStaticLightmaps(INT32 bspnum); void HWR_PrepLevelCache(size_t pnumtextures); void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color); +void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color); void HWR_DrawPic(INT32 x,INT32 y,lumpnum_t lumpnum); void HWR_AddCommands(void); diff --git a/src/k_kart.c b/src/k_kart.c index ea14cefd..85f552d4 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -5120,7 +5120,7 @@ void K_drawKartHUD(void) // Draw a white fade on level opening if (leveltime < 15 && stplyr == &players[displayplayer]) { - if (leveltime < 5) + if (leveltime <= 5) V_DrawFill(0,0,BASEVIDWIDTH,BASEVIDHEIGHT,120); // Pure white on first three frames, to hide SRB2's awful level load artifacts else V_DrawFadeScreen(120, 15-leveltime); // Then gradually fade out from there diff --git a/src/p_saveg.c b/src/p_saveg.c index 5526344f..58d5b991 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -3209,7 +3209,10 @@ static void P_NetArchiveMisc(void) WRITEINT16(save_p, lastmap); for (i = 0; i < 4; i++) - WRITEINT16(save_p, votelevels[i]); + { + WRITEINT16(save_p, votelevels[i][0]); + WRITEINT16(save_p, votelevels[i][1]); + } for (i = 0; i < MAXPLAYERS; i++) WRITESINT8(save_p, votes[i]); @@ -3306,7 +3309,10 @@ static inline boolean P_NetUnArchiveMisc(void) lastmap = READINT16(save_p); for (i = 0; i < 4; i++) - votelevels[i] = READINT16(save_p); + { + votelevels[i][0] = READINT16(save_p); + votelevels[i][1] = READINT16(save_p); + } for (i = 0; i < MAXPLAYERS; i++) votes[i] = READSINT8(save_p); diff --git a/src/v_video.c b/src/v_video.c index 11294896..e1cf2164 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -837,7 +837,104 @@ void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c) c &= 255; for (;(--h >= 0) && dest < deststop; dest += vid.width) - memset(dest, (UINT8)(c&255), w * vid.bpp); + memset(dest, c, w * vid.bpp); +} + +// +// Fills a triangle of pixels with a single color, NOTE: scaled to screen size +// +// ... +// .. <-- this shape only for now, i'm afraid +// . +// +void V_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 c) +{ + UINT8 *dest; + const UINT8 *deststop; + INT32 w, h, wait = 0; + + if (rendermode == render_none) + return; + +#ifdef HWRENDER + if (rendermode != render_soft && !con_startup) + { + HWR_DrawDiag(x, y, wh, c); + return; + } +#endif + + if (!(c & V_NOSCALESTART)) + { + INT32 dupx = vid.dupx, dupy = vid.dupy; + + x *= dupx; + y *= dupy; + wh *= dupx; + + // Center it if necessary + if (vid.width != BASEVIDWIDTH * dupx) + { + // dupx adjustments pretend that screen width is BASEVIDWIDTH * dupx, + // so center this imaginary screen + if (c & V_SNAPTORIGHT) + x += (vid.width - (BASEVIDWIDTH * dupx)); + else if (!(c & V_SNAPTOLEFT)) + x += (vid.width - (BASEVIDWIDTH * dupx)) / 2; + } + if (vid.height != BASEVIDHEIGHT * dupy) + { + // same thing here + if (c & V_SNAPTOBOTTOM) + y += (vid.height - (BASEVIDHEIGHT * dupy)); + else if (!(c & V_SNAPTOTOP)) + y += (vid.height - (BASEVIDHEIGHT * dupy)) / 2; + } + } + + if (x >= vid.width || y >= vid.height) + return; // off the screen + + if (y < 0) + { + wh += y; + y = 0; + } + + w = h = wh; + + if (x < 0) + { + w += x; + x = 0; + } + + if (w <= 0 || h <= 0) + return; // zero width/height wouldn't draw anything + if (x + w > vid.width) + { + wait = w - (vid.width - x); + w = vid.width - x; + } + if (y + w > vid.height) + h = vid.height - y; + + if (h > w) + h = w; + + dest = screens[0] + y*vid.width + x; + deststop = screens[0] + vid.rowbytes * vid.height; + + c &= 255; + + for (;(--h >= 0) && dest < deststop; dest += vid.width) + { + memset(dest, c, w * vid.bpp); + if (wait) + wait--; + else + w--; + } } // @@ -1144,7 +1241,7 @@ char *V_WordWrap(INT32 x, INT32 w, INT32 option, const char *string) // void V_DrawString(INT32 x, INT32 y, INT32 option, const char *string) { - INT32 w, c, cx = x, cy = y, dupx, dupy, scrwidth = BASEVIDWIDTH, center = 0; + INT32 w, c, cx = x, cy = y, dupx, dupy, scrwidth, center = 0, left = 0; const char *ch = string; INT32 charflags = 0; const UINT8 *colormap = NULL; @@ -1160,7 +1257,11 @@ void V_DrawString(INT32 x, INT32 y, INT32 option, const char *string) scrwidth = vid.width; } else + { dupx = dupy = 1; + scrwidth = vid.width/vid.dupx; + left = (scrwidth - BASEVIDWIDTH)/2; + } charflags = (option & V_CHARCOLORMASK); @@ -1221,9 +1322,9 @@ void V_DrawString(INT32 x, INT32 y, INT32 option, const char *string) else w = SHORT(hu_font[c]->width) * dupx; - if (cx + w > scrwidth) + if (cx > scrwidth) break; - if (cx < 0) //left boundary check + if (cx+left + w < 0) //left boundary check { cx += w; continue; @@ -1239,7 +1340,7 @@ void V_DrawString(INT32 x, INT32 y, INT32 option, const char *string) // SRB2kart void V_DrawKartString(INT32 x, INT32 y, INT32 option, const char *string) { - INT32 w, c, cx = x, cy = y, dupx, dupy, scrwidth = BASEVIDWIDTH, center = 0; + INT32 w, c, cx = x, cy = y, dupx, dupy, scrwidth, center = 0, left = 0; const char *ch = string; INT32 charflags = 0; const UINT8 *colormap = NULL; @@ -1255,7 +1356,11 @@ void V_DrawKartString(INT32 x, INT32 y, INT32 option, const char *string) scrwidth = vid.width; } else + { dupx = dupy = 1; + scrwidth = vid.width/vid.dupx; + left = (scrwidth - BASEVIDWIDTH)/2; + } charflags = (option & V_CHARCOLORMASK); @@ -1316,9 +1421,9 @@ void V_DrawKartString(INT32 x, INT32 y, INT32 option, const char *string) else w = SHORT(kart_font[c]->width) * dupx; - if (cx + w > scrwidth) + if (cx > scrwidth) break; - if (cx < 0) //left boundary check + if (cx+left + w < 0) //left boundary check { cx += w; continue; @@ -1350,7 +1455,7 @@ void V_DrawRightAlignedString(INT32 x, INT32 y, INT32 option, const char *string // void V_DrawSmallString(INT32 x, INT32 y, INT32 option, const char *string) { - INT32 w, c, cx = x, cy = y, dupx, dupy, scrwidth = BASEVIDWIDTH, center = 0; + INT32 w, c, cx = x, cy = y, dupx, dupy, scrwidth, center = 0, left = 0; const char *ch = string; INT32 charflags = 0; const UINT8 *colormap = NULL; @@ -1366,7 +1471,11 @@ void V_DrawSmallString(INT32 x, INT32 y, INT32 option, const char *string) scrwidth = vid.width; } else + { dupx = dupy = 1; + scrwidth = vid.width/vid.dupx; + left = (scrwidth - BASEVIDWIDTH)/2; + } charflags = (option & V_CHARCOLORMASK); @@ -1425,9 +1534,9 @@ void V_DrawSmallString(INT32 x, INT32 y, INT32 option, const char *string) } else w = SHORT(hu_font[c]->width) * dupx / 2; - if (cx + w > scrwidth) + if (cx > scrwidth) break; - if (cx < 0) //left boundary check + if (cx+left + w < 0) //left boundary check { cx += w; continue; @@ -1452,7 +1561,7 @@ void V_DrawRightAlignedSmallString(INT32 x, INT32 y, INT32 option, const char *s // void V_DrawThinString(INT32 x, INT32 y, INT32 option, const char *string) { - INT32 w, c, cx = x, cy = y, dupx, dupy, scrwidth = BASEVIDWIDTH; + INT32 w, c, cx = x, cy = y, dupx, dupy, scrwidth, left = 0; const char *ch = string; INT32 charflags = 0; const UINT8 *colormap = NULL; @@ -1468,7 +1577,11 @@ void V_DrawThinString(INT32 x, INT32 y, INT32 option, const char *string) scrwidth = vid.width; } else + { dupx = dupy = 1; + scrwidth = vid.width/vid.dupx; + left = (scrwidth - BASEVIDWIDTH)/2; + } charflags = (option & V_CHARCOLORMASK); @@ -1525,9 +1638,9 @@ void V_DrawThinString(INT32 x, INT32 y, INT32 option, const char *string) else w = (SHORT(tny_font[c]->width) * dupx); - if (cx + w > scrwidth) + if (cx > scrwidth) break; - if (cx < 0) //left boundary check + if (cx+left + w < 0) //left boundary check { cx += w; continue; @@ -1550,7 +1663,7 @@ void V_DrawRightAlignedThinString(INT32 x, INT32 y, INT32 option, const char *st void V_DrawStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string) { fixed_t cx = x, cy = y; - INT32 w, c, dupx, dupy, scrwidth = BASEVIDWIDTH, center = 0; + INT32 w, c, dupx, dupy, scrwidth, center = 0, left = 0; const char *ch = string; INT32 spacewidth = 4, charwidth = 0; @@ -1564,7 +1677,11 @@ void V_DrawStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string) scrwidth = vid.width; } else + { dupx = dupy = 1; + scrwidth = vid.width/vid.dupx; + left = (scrwidth - BASEVIDWIDTH)/2; + } switch (option & V_SPACINGMASK) { @@ -1618,9 +1735,9 @@ void V_DrawStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *string) else w = SHORT(hu_font[c]->width) * dupx; - if ((cx>>FRACBITS) + w > scrwidth) + if ((cx>>FRACBITS) > scrwidth) break; - if (cx < 0) //left boundary check + if (cx+left + w < 0) //left boundary check { cx += w<width) * dupx; - if ((cx>>FRACBITS) + w > scrwidth) + if ((cx>>FRACBITS) > scrwidth) break; V_DrawSciencePatch(cx, cy, option, cred_font[c], FRACUNIT); @@ -1756,7 +1873,7 @@ INT32 V_CreditStringWidth(const char *string) // void V_DrawLevelTitle(INT32 x, INT32 y, INT32 option, const char *string) { - INT32 w, c, cx = x, cy = y, dupx, dupy, scrwidth = BASEVIDWIDTH; + INT32 w, c, cx = x, cy = y, dupx, dupy, scrwidth, left = 0; const char *ch = string; if (option & V_NOSCALESTART) @@ -1766,7 +1883,11 @@ void V_DrawLevelTitle(INT32 x, INT32 y, INT32 option, const char *string) scrwidth = vid.width; } else + { dupx = dupy = 1; + scrwidth = vid.width/vid.dupx; + left = (scrwidth - BASEVIDWIDTH)/2; + } for (;;) { @@ -1788,11 +1909,10 @@ void V_DrawLevelTitle(INT32 x, INT32 y, INT32 option, const char *string) } w = SHORT(lt_font[c]->width) * dupx; - if (cx + w > scrwidth) - break; - //left boundary check - if (cx < 0) + if (cx > scrwidth) + break; + if (cx + left < 0) //left boundary check { cx += w; continue; diff --git a/src/v_video.h b/src/v_video.h index c7e1f74c..02e8bbca 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -139,6 +139,8 @@ void V_DrawScaledPic (INT32 px1, INT32 py1, INT32 scrn, INT32 lumpnum); // fill a box with a single color void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c); +// fill a triangle with a single color +void V_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 c); // fill a box with a flat as a pattern void V_DrawFlatFill(INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatnum); diff --git a/src/y_inter.c b/src/y_inter.c index 4ad895d5..d2359d3b 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -173,6 +173,8 @@ static void Y_UnloadData(void); typedef struct { char str[40]; + UINT8 gtc; + const char *gts; patch_t *pic; } y_votelvlinfo; @@ -2185,9 +2187,7 @@ void Y_VoteDrawer(void) { char str[40]; patch_t *pic; - UINT8 sizeadd = selected[i]; - UINT8 j; - UINT8 color; + UINT8 sizeadd = selected[i], j, color, gtc = levelinfo[i].gtc; if (i == 3) { @@ -2262,11 +2262,26 @@ void Y_VoteDrawer(void) V_DrawSmallScaledPatch(BASEVIDWIDTH-100, y, V_SNAPTORIGHT, pic); V_DrawRightAlignedThinString(BASEVIDWIDTH-20, 40+y, V_SNAPTORIGHT, str); + { + INT32 w = 0; + if (levelinfo[i].gts) + { + w = V_StringWidth(levelinfo[i].gts, V_SNAPTORIGHT)+2; + V_DrawFill(BASEVIDWIDTH-100, y+9, w+1, 2, V_SNAPTORIGHT|31); + V_DrawFill(BASEVIDWIDTH-100, y, w, 10, V_SNAPTORIGHT|gtc); + V_DrawString(BASEVIDWIDTH-99, y+1, V_SNAPTORIGHT, levelinfo[i].gts); + } + V_DrawDiag(BASEVIDWIDTH-100+w+1, y, 11, V_SNAPTORIGHT|31); + V_DrawDiag(BASEVIDWIDTH-100+w, y, 10, V_SNAPTORIGHT|gtc); + } + y += 50; } else { V_DrawTinyScaledPatch(BASEVIDWIDTH-60, y, V_SNAPTORIGHT, pic); + V_DrawDiag(BASEVIDWIDTH-60, y, 8, V_SNAPTORIGHT|31); + V_DrawDiag(BASEVIDWIDTH-60, y, 6, V_SNAPTORIGHT|gtc); y += 25; } @@ -2284,6 +2299,7 @@ void Y_VoteDrawer(void) if ((playeringame[i] && !players[i].spectator) && votes[i] != -1) { patch_t *pic; + UINT8 gtc = levelinfo[votes[i]].gtc; if (votes[i] == 3 && (i != pickedvote || voteendtic == -1)) pic = randomlvl; @@ -2300,6 +2316,8 @@ void Y_VoteDrawer(void) } V_DrawTinyScaledPatch(x, y, V_SNAPTOLEFT, pic); + V_DrawDiag(x, y, 8, V_SNAPTOLEFT|31); + V_DrawDiag(x, y, 6, V_SNAPTOLEFT|gtc); if (players[i].skincolor == 0) V_DrawSmallScaledPatch(x+24, y+9, V_SNAPTOLEFT, faceprefix[players[i].skin]); @@ -2564,40 +2582,51 @@ void Y_StartVote(void) for (i = 0; i < 4; i++) { lumpnum_t lumpnum; + INT16 j; // set up the str - if (strlen(mapheaderinfo[votelevels[i]]->zonttl) > 0) + if (strlen(mapheaderinfo[votelevels[i][0]]->zonttl) > 0) { - if (strlen(mapheaderinfo[votelevels[i]]->actnum) > 0) + if (strlen(mapheaderinfo[votelevels[i][0]]->actnum) > 0) snprintf(levelinfo[i].str, sizeof levelinfo[i].str, "%.32s %.32s %s", - mapheaderinfo[votelevels[i]]->lvlttl, mapheaderinfo[votelevels[i]]->zonttl, mapheaderinfo[votelevels[i]]->actnum); + mapheaderinfo[votelevels[i][0]]->lvlttl, mapheaderinfo[votelevels[i][0]]->zonttl, mapheaderinfo[votelevels[i][0]]->actnum); else snprintf(levelinfo[i].str, sizeof levelinfo[i].str, "%.32s %.32s", - mapheaderinfo[votelevels[i]]->lvlttl, mapheaderinfo[votelevels[i]]->zonttl); + mapheaderinfo[votelevels[i][0]]->lvlttl, mapheaderinfo[votelevels[i][0]]->zonttl); } else { - if (strlen(mapheaderinfo[votelevels[i]]->actnum) > 0) + if (strlen(mapheaderinfo[votelevels[i][0]]->actnum) > 0) snprintf(levelinfo[i].str, sizeof levelinfo[i].str, "%.32s %s", - mapheaderinfo[votelevels[i]]->lvlttl, mapheaderinfo[votelevels[i]]->actnum); + mapheaderinfo[votelevels[i][0]]->lvlttl, mapheaderinfo[votelevels[i][0]]->actnum); else snprintf(levelinfo[i].str, sizeof levelinfo[i].str, "%.32s", - mapheaderinfo[votelevels[i]]->lvlttl); + mapheaderinfo[votelevels[i][0]]->lvlttl); } levelinfo[i].str[sizeof levelinfo[i].str - 1] = '\0'; - lumpnum = W_CheckNumForName(va("%sP", G_BuildMapName(votelevels[i]+1))); + // set up the gtc and gts + levelinfo[i].gtc = G_GetGametypeColor(votelevels[i][1]); + levelinfo[i].gts = NULL; + for (j = 0; gametype_cons_t[j].strvalue; j++) + { + if (gametype_cons_t[j].value == votelevels[i][1]) + levelinfo[i].gts = gametype_cons_t[j].strvalue; + } + + // set up the pic + lumpnum = W_CheckNumForName(va("%sP", G_BuildMapName(votelevels[i][0]+1))); if (lumpnum != LUMPERROR) - levelinfo[i].pic = W_CachePatchName(va("%sP", G_BuildMapName(votelevels[i]+1)), PU_STATIC); + levelinfo[i].pic = W_CachePatchName(va("%sP", G_BuildMapName(votelevels[i][0]+1)), PU_STATIC); else levelinfo[i].pic = W_CachePatchName("BLANKLVL", PU_STATIC); } @@ -2691,6 +2720,11 @@ void Y_SetupVoteFinish(SINT8 pick, SINT8 level) } pickedvote = pick; - nextmap = votelevels[level]; + nextmap = votelevels[level][0]; + if (gametype != votelevels[level][1]) + { + //CONS_Printf("yer dun\n"); -- if we want to do anything else special for a gametype switch, it'd be here + gametype = votelevels[level][1]; + } timer = 0; } From a50a67b2735a9616179d65f96714a88ca620e0ac Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 28 Jun 2018 19:07:04 +0100 Subject: [PATCH 094/293] * Modified, maybe-improved title. May need to be selectively reverted, but... * To go with this, have the HUD fade in as the title goes away. * After complaints, only do dogear gametype indicators on the voting screen for levels which don't match the prevailing gametype, and use thin font to intrude on the level pic less. * Make the voting screen background a different graphic in battle. * Improve behaviour of DrawDiag in GL. --- src/hardware/hw_draw.c | 28 ++++++++++-------- src/k_kart.c | 25 +++++++++++++--- src/st_stuff.c | 65 +++++++++++++++++++++++------------------- src/v_video.c | 7 +++-- src/v_video.h | 2 ++ src/y_inter.c | 49 +++++++++++++++++-------------- 6 files changed, 105 insertions(+), 71 deletions(-) diff --git a/src/hardware/hw_draw.c b/src/hardware/hw_draw.c index dc064b95..6d4d70d0 100644 --- a/src/hardware/hw_draw.c +++ b/src/hardware/hw_draw.c @@ -292,9 +292,9 @@ void HWR_DrawFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale, { FSurfaceInfo Surf; Surf.FlatColor.s.red = Surf.FlatColor.s.green = Surf.FlatColor.s.blue = 0xff; - if (alphalevel == 13) Surf.FlatColor.s.alpha = softwaretranstogl_lo[cv_translucenthud.value]; - else if (alphalevel == 14) Surf.FlatColor.s.alpha = softwaretranstogl[cv_translucenthud.value]; - else if (alphalevel == 15) Surf.FlatColor.s.alpha = softwaretranstogl_hi[cv_translucenthud.value]; + if (alphalevel == 13) Surf.FlatColor.s.alpha = softwaretranstogl_lo[hudtrans]; + else if (alphalevel == 14) Surf.FlatColor.s.alpha = softwaretranstogl[hudtrans]; + else if (alphalevel == 15) Surf.FlatColor.s.alpha = softwaretranstogl_hi[hudtrans]; else Surf.FlatColor.s.alpha = softwaretranstogl[10-alphalevel]; flags |= PF_Modulated; HWD.pfnDrawPolygon(&Surf, v, 4, flags); @@ -446,9 +446,9 @@ void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscal { FSurfaceInfo Surf; Surf.FlatColor.s.red = Surf.FlatColor.s.green = Surf.FlatColor.s.blue = 0xff; - if (alphalevel == 13) Surf.FlatColor.s.alpha = softwaretranstogl_lo[cv_translucenthud.value]; - else if (alphalevel == 14) Surf.FlatColor.s.alpha = softwaretranstogl[cv_translucenthud.value]; - else if (alphalevel == 15) Surf.FlatColor.s.alpha = softwaretranstogl_hi[cv_translucenthud.value]; + if (alphalevel == 13) Surf.FlatColor.s.alpha = softwaretranstogl_lo[hudtrans]; + else if (alphalevel == 14) Surf.FlatColor.s.alpha = softwaretranstogl[hudtrans]; + else if (alphalevel == 15) Surf.FlatColor.s.alpha = softwaretranstogl_hi[hudtrans]; else Surf.FlatColor.s.alpha = softwaretranstogl[10-alphalevel]; flags |= PF_Modulated; HWD.pfnDrawPolygon(&Surf, v, 4, flags); @@ -911,7 +911,7 @@ void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color) { FOutVector v[4]; FSurfaceInfo Surf; - float fx, fy, fw, fh; + float fx, fy, fw, fh, fwait = 0; if (wh < 0) return; // consistency w/ software @@ -966,8 +966,11 @@ void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color) if (fw <= 0 || fh <= 0) return; - /*if (fx + fw > vid.width) -- oh gee oh boy oh shit - fw = (float)vid.width - fx;*/ + if (fx + fw > vid.width) + { + fwait = fw - ((float)vid.width - fx); + fw = (float)vid.width - fx; + } if (fy + fh > vid.height) fh = (float)vid.height - fy; @@ -976,10 +979,11 @@ void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color) fw = fw / (vid.width / 2); fh = fh / (vid.height / 2); - v[0].x = v[2].x = v[3].x = fx; - v[1].x = fx + fw; + v[0].x = v[3].x = fx; + v[2].x = v[1].x = fx + fw; v[0].y = v[1].y = fy; - v[2].y = v[3].y = fy - fh; + v[3].y = fy - fh; + v[2].y = fy - fwait; //Hurdler: do we still use this argb color? if not, we should remove it v[0].argb = v[1].argb = v[2].argb = v[3].argb = 0xff00ff00; //; diff --git a/src/k_kart.c b/src/k_kart.c index 85f552d4..28b7dad4 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4091,6 +4091,13 @@ static void K_initKartHUD(void) } } } + + if (timeinmap > 113) + hudtrans = cv_translucenthud.value; + else if (timeinmap > 105) + hudtrans = ((((INT32)timeinmap) - 105)*cv_translucenthud.value)/(113-105); + else + hudtrans = 0; } INT32 K_calcSplitFlags(INT32 snapflags) @@ -4845,8 +4852,7 @@ static void K_drawKartMinimap(void) patch_t *AutomapPic; INT32 i = 0; INT32 x, y; - const INT32 minimaptrans = ((10-cv_kartminimap.value)<width/2); y = MINI_Y - (AutomapPic->height/2); - if (splitscreen) - splitflags = 0; + if (timeinmap > 105) + { + minimaptrans = (splitscreen ? 10 : cv_kartminimap.value); + if (timeinmap <= 113) + minimaptrans = ((((INT32)timeinmap) - 105)*minimaptrans)/(113-105); + if (!minimaptrans) + return; + } + else + return; + + minimaptrans = ((10-minimaptrans)<width), y, splitflags|V_FLIP, AutomapPic); diff --git a/src/st_stuff.c b/src/st_stuff.c index a19bada6..2b3c770a 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -755,23 +755,27 @@ static void ST_drawLevelTitle(void) char *zonttl = mapheaderinfo[gamemap-1]->zonttl; // SRB2kart char *actnum = mapheaderinfo[gamemap-1]->actnum; INT32 lvlttlxpos; - INT32 subttlxpos = BASEVIDWIDTH/2; INT32 ttlnumxpos; INT32 zonexpos; + INT32 dupcalc = (vid.width/vid.dupx); + UINT8 gtc = G_GetGametypeColor(gametype); + INT32 sub = 0; + INT32 lvlttly = 145; + INT32 zoney = 169; + INT32 lvlw; - INT32 lvlttly; - INT32 zoney; - - if (!(timeinmap > 2 && timeinmap-3 < 110)) + if (timeinmap > 113) return; - if (strlen(actnum) > 0) - lvlttlxpos = ((BASEVIDWIDTH/2) - (V_LevelNameWidth(lvlttl)/2)) - V_LevelNameWidth(actnum); - else - lvlttlxpos = ((BASEVIDWIDTH/2) - (V_LevelNameWidth(lvlttl)/2)); + lvlw = V_LevelNameWidth(lvlttl); - ttlnumxpos = lvlttlxpos + V_LevelNameWidth(lvlttl); - if (strlen(zonttl) > 0) + if (strlen(actnum) > 0) + lvlttlxpos = ((BASEVIDWIDTH/2) - (lvlw/2)) - V_LevelNameWidth(actnum); + else + lvlttlxpos = ((BASEVIDWIDTH/2) - (lvlw/2)); + + ttlnumxpos = lvlttlxpos + lvlw; + if (zonttl[0]) zonexpos = ttlnumxpos - V_LevelNameWidth(zonttl); // SRB2kart else zonexpos = ttlnumxpos - V_LevelNameWidth(M_GetText("ZONE")); @@ -779,25 +783,29 @@ static void ST_drawLevelTitle(void) if (lvlttlxpos < 0) lvlttlxpos = 0; - // There's no consistent algorithm that can accurately define the old positions - // so I just ended up resorting to a single switct statement to define them - switch (timeinmap-3) + if (timeinmap > 105) { - case 0: zoney = 200; lvlttly = 0; break; - case 1: zoney = 188; lvlttly = 12; break; - case 2: zoney = 176; lvlttly = 24; break; - case 3: zoney = 164; lvlttly = 36; break; - case 4: zoney = 152; lvlttly = 48; break; - case 5: zoney = 140; lvlttly = 60; break; - case 6: zoney = 128; lvlttly = 72; break; - case 105: zoney = 80; lvlttly = 104; break; - case 106: zoney = 56; lvlttly = 128; break; - case 107: zoney = 32; lvlttly = 152; break; - case 108: zoney = 8; lvlttly = 176; break; - case 109: zoney = 0; lvlttly = 200; break; - default: zoney = 104; lvlttly = 80; break; + INT32 count = (113 - (INT32)(timeinmap)); + sub = dupcalc; + while (count-- > 0) + sub >>= 1; + sub = -sub; } + { + dupcalc = (dupcalc - BASEVIDWIDTH)>>1; + INT32 h = lvlttly + V_LevelNameHeight(lvlttl) + 2; + V_DrawFill(sub - dupcalc, h+9, lvlttlxpos + lvlw + 1 - dupcalc, 2, 31); + V_DrawDiag(sub + lvlttlxpos + lvlw + 1, h, 11, 31); + V_DrawFill(sub - dupcalc, h, lvlttlxpos + lvlw - dupcalc, 10, gtc); + V_DrawDiag(sub + lvlttlxpos + lvlw, h, 10, gtc); + V_DrawString(sub + lvlttlxpos, h+1, V_ALLOWLOWERCASE, subttl); + } + + ttlnumxpos += sub; + lvlttlxpos += sub; + zonexpos += sub; + if (strlen(actnum) > 0) V_DrawLevelTitle(ttlnumxpos+12, zoney, 0, actnum); @@ -807,9 +815,6 @@ static void ST_drawLevelTitle(void) V_DrawLevelTitle(zonexpos, zoney, 0, zonttl); else if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE)) V_DrawLevelTitle(zonexpos, zoney, 0, M_GetText("ZONE")); - - if (lvlttly+48 < 200) - V_DrawCenteredString(subttlxpos, lvlttly+48, V_ALLOWLOWERCASE, subttl); } /* diff --git a/src/v_video.c b/src/v_video.c index e1cf2164..c1ca4ea7 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -305,6 +305,7 @@ void VID_BlitLinearScreen(const UINT8 *srcptr, UINT8 *destptr, INT32 width, INT3 //static UINT8 hudplusalpha[11] = { 10, 8, 6, 4, 2, 0, 0, 0, 0, 0, 0}; static UINT8 hudminusalpha[11] = { 10, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5}; +UINT8 hudtrans = 0; static const UINT8 *v_colormap = NULL; static const UINT8 *v_translevel = NULL; @@ -359,11 +360,11 @@ void V_DrawFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_t if ((alphalevel = ((scrn & V_ALPHAMASK) >> V_ALPHASHIFT))) { if (alphalevel == 13) - alphalevel = hudminusalpha[cv_translucenthud.value]; + alphalevel = hudminusalpha[hudtrans]; else if (alphalevel == 14) - alphalevel = 10 - cv_translucenthud.value; + alphalevel = 10 - hudtrans; /*else if (alphalevel == 15) - alphalevel = hudplusalpha[cv_translucenthud.value];*/ + alphalevel = hudplusalpha[hudtrans];*/ if (alphalevel >= 10) return; // invis diff --git a/src/v_video.h b/src/v_video.h index 02e8bbca..2c28fd8a 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -43,6 +43,8 @@ const char *GetPalette(void); extern RGBA_t *pLocalPalette; +extern UINT8 hudtrans; + // Retrieve the ARGB value from a palette color index #define V_GetColor(color) (pLocalPalette[color&0xFF]) diff --git a/src/y_inter.c b/src/y_inter.c index d2359d3b..33d62157 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -2187,7 +2187,7 @@ void Y_VoteDrawer(void) { char str[40]; patch_t *pic; - UINT8 sizeadd = selected[i], j, color, gtc = levelinfo[i].gtc; + UINT8 sizeadd = selected[i], j, color; if (i == 3) { @@ -2262,17 +2262,14 @@ void Y_VoteDrawer(void) V_DrawSmallScaledPatch(BASEVIDWIDTH-100, y, V_SNAPTORIGHT, pic); V_DrawRightAlignedThinString(BASEVIDWIDTH-20, 40+y, V_SNAPTORIGHT, str); + if (levelinfo[i].gts) { - INT32 w = 0; - if (levelinfo[i].gts) - { - w = V_StringWidth(levelinfo[i].gts, V_SNAPTORIGHT)+2; - V_DrawFill(BASEVIDWIDTH-100, y+9, w+1, 2, V_SNAPTORIGHT|31); - V_DrawFill(BASEVIDWIDTH-100, y, w, 10, V_SNAPTORIGHT|gtc); - V_DrawString(BASEVIDWIDTH-99, y+1, V_SNAPTORIGHT, levelinfo[i].gts); - } - V_DrawDiag(BASEVIDWIDTH-100+w+1, y, 11, V_SNAPTORIGHT|31); - V_DrawDiag(BASEVIDWIDTH-100+w, y, 10, V_SNAPTORIGHT|gtc); + INT32 w = V_ThinStringWidth(levelinfo[i].gts, V_SNAPTORIGHT)+1; + V_DrawFill(BASEVIDWIDTH-100, y+10, w+1, 2, V_SNAPTORIGHT|31); + V_DrawFill(BASEVIDWIDTH-100, y, w, 11, V_SNAPTORIGHT|levelinfo[i].gtc); + V_DrawDiag(BASEVIDWIDTH-100+w+1, y, 12, V_SNAPTORIGHT|31); + V_DrawDiag(BASEVIDWIDTH-100+w, y, 11, V_SNAPTORIGHT|levelinfo[i].gtc); + V_DrawThinString(BASEVIDWIDTH-99, y+1, V_SNAPTORIGHT, levelinfo[i].gts); } y += 50; @@ -2280,8 +2277,11 @@ void Y_VoteDrawer(void) else { V_DrawTinyScaledPatch(BASEVIDWIDTH-60, y, V_SNAPTORIGHT, pic); - V_DrawDiag(BASEVIDWIDTH-60, y, 8, V_SNAPTORIGHT|31); - V_DrawDiag(BASEVIDWIDTH-60, y, 6, V_SNAPTORIGHT|gtc); + if (levelinfo[i].gts) + { + V_DrawDiag(BASEVIDWIDTH-60, y, 8, V_SNAPTORIGHT|31); + V_DrawDiag(BASEVIDWIDTH-60, y, 6, V_SNAPTORIGHT|levelinfo[i].gtc); + } y += 25; } @@ -2299,7 +2299,6 @@ void Y_VoteDrawer(void) if ((playeringame[i] && !players[i].spectator) && votes[i] != -1) { patch_t *pic; - UINT8 gtc = levelinfo[votes[i]].gtc; if (votes[i] == 3 && (i != pickedvote || voteendtic == -1)) pic = randomlvl; @@ -2316,8 +2315,11 @@ void Y_VoteDrawer(void) } V_DrawTinyScaledPatch(x, y, V_SNAPTOLEFT, pic); - V_DrawDiag(x, y, 8, V_SNAPTOLEFT|31); - V_DrawDiag(x, y, 6, V_SNAPTOLEFT|gtc); + if (levelinfo[votes[i]].gts) + { + V_DrawDiag(x, y, 8, V_SNAPTOLEFT|31); + V_DrawDiag(x, y, 6, V_SNAPTOLEFT|levelinfo[votes[i]].gtc); + } if (players[i].skincolor == 0) V_DrawSmallScaledPatch(x+24, y+9, V_SNAPTOLEFT, faceprefix[players[i].skin]); @@ -2552,8 +2554,8 @@ void Y_StartVote(void) I_Error("voteendtic is dirty"); #endif - widebgpatch = W_CachePatchName("INTERSCW", PU_STATIC); - bgpatch = W_CachePatchName("INTERSCR", PU_STATIC); + widebgpatch = W_CachePatchName(((gametype == GT_MATCH) ? "BATTLSCW" : "INTERSCW"), PU_STATIC); + bgpatch = W_CachePatchName(((gametype == GT_MATCH) ? "BATTLSCR" : "INTERSCR"), PU_STATIC); cursor = W_CachePatchName("M_CURSOR", PU_STATIC); cursor1 = W_CachePatchName("P1CURSOR", PU_STATIC); cursor2 = W_CachePatchName("P2CURSOR", PU_STATIC); @@ -2615,12 +2617,15 @@ void Y_StartVote(void) levelinfo[i].str[sizeof levelinfo[i].str - 1] = '\0'; // set up the gtc and gts - levelinfo[i].gtc = G_GetGametypeColor(votelevels[i][1]); levelinfo[i].gts = NULL; - for (j = 0; gametype_cons_t[j].strvalue; j++) + if (i == 2 && votelevels[i][1] != votelevels[0][1]) { - if (gametype_cons_t[j].value == votelevels[i][1]) - levelinfo[i].gts = gametype_cons_t[j].strvalue; + levelinfo[i].gtc = G_GetGametypeColor(votelevels[i][1]); + for (j = 0; gametype_cons_t[j].strvalue; j++) + { + if (gametype_cons_t[j].value == votelevels[i][1]) + levelinfo[i].gts = gametype_cons_t[j].strvalue; + } } // set up the pic From dcb0461a60256192a2f29f5bee08866874b6b62e Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 28 Jun 2018 23:58:26 +0100 Subject: [PATCH 095/293] * Repair dehacked lists for compiling with DEBUGMODE=1. * Fix that rat-ass nasty crash with respawning from spectator mode! * Flying ghost kart for spectator mode! It's silly and fun... * Allow for .bat files to be .gitignored in the Debug compilation folder too! --- bin/Mingw/Debug/.gitignore | 1 + src/dehacked.c | 17 +++++++++++++---- src/k_kart.c | 4 +++- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/bin/Mingw/Debug/.gitignore b/bin/Mingw/Debug/.gitignore index 834f313e..3458ff76 100644 --- a/bin/Mingw/Debug/.gitignore +++ b/bin/Mingw/Debug/.gitignore @@ -1,3 +1,4 @@ *.exe *.mo r_opengl.dll +*.bat diff --git a/src/dehacked.c b/src/dehacked.c index d6d8b413..3eb64bd0 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6397,6 +6397,16 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_SLOWBOOM9", "S_SLOWBOOM10", + // Ballhog + "S_BALLHOG1", + "S_BALLHOG2", + "S_BALLHOG3", + "S_BALLHOG4", + "S_BALLHOG5", + "S_BALLHOG6", + "S_BALLHOG7", + "S_BALLHOG8", + // Self-Propelled Bomb - just an explosion for now... "S_BLUELIGHTNING1", "S_BLUELIGHTNING2", @@ -7124,7 +7134,6 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_GREENSHIELD", // Orbinaut stuff "MT_GREENITEM", - "MT_FIRETRAIL", "MT_JAWZ", // Jawz stuff "MT_JAWZ_DUD", @@ -7558,9 +7567,7 @@ static const char *const KARTSTUFF_LIST[] = { "VOICES", "TAUNTVOICES", - "BOOSTING", "FLOORBOOST", - "SPINOUT", "SPINOUTTYPE", "DRIFT", @@ -7576,10 +7583,12 @@ static const char *const KARTSTUFF_LIST[] = { "ITEMROULETTE", "ROULETTETYPE", + // Item held stuff "ITEMTYPE", "ITEMAMOUNT", "ITEMHELD", + // Some items use timers for their duration or effects "ATTRACTIONTIMER", "HYUDOROTIMER", "STEALINGTIMER", @@ -7593,10 +7602,10 @@ static const char *const KARTSTUFF_LIST[] = { "EGGMANHELD", "SPINOUTTIMER", "JUSTBUMPED", - "POWERITEMTIMER", "COMEBACKTIMER", "SADTIMER", + // Battle Mode vars "BALLOON", "COMEBACKPOINTS", "COMEBACKMODE", diff --git a/src/k_kart.c b/src/k_kart.c index 28b7dad4..a1f32698 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -5070,7 +5070,9 @@ static void K_drawKartFirstPerson(void) x /= 2; } - if (stplyr->speed < FixedMul(stplyr->runspeed, stplyr->mo->scale) && (leveltime & 1)) + if (stplyr->spectator || !stplyr->mo) + splitflags |= FF_TRANS50; + else if (stplyr->speed < FixedMul(stplyr->runspeed, stplyr->mo->scale) && (leveltime & 1)) y++; if (cmd->driftturn > 400) // strong left turn From 94cb3821f682a7e187e855bbf54c4c830df80282 Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Thu, 28 Jun 2018 19:07:12 -0400 Subject: [PATCH 096/293] Chaotix big ring replacement (Sev *actually* did this, not Sal! She's very proud :p) --- src/dehacked.c | 21 ++++++++++++++------- src/info.c | 32 ++++++++++++++++++++------------ src/info.h | 22 +++++++++++++++------- src/p_mobj.c | 4 ++++ 4 files changed, 53 insertions(+), 26 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index d6d8b413..4cc42434 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6505,12 +6505,19 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit // D00Dkart - Diddy Kong Racing Balloon "S_DOOD_BALLOON", - // D00Dkart - Big Ring - "S_DOOD_RING1", - "S_DOOD_RING2", - "S_DOOD_RING3", - "S_DOOD_RING4", - "S_DOOD_RING5", + // Chaotix Big Ring + "S_BIGRING01", + "S_BIGRING02", + "S_BIGRING03", + "S_BIGRING04", + "S_BIGRING05", + "S_BIGRING06", + "S_BIGRING07", + "S_BIGRING08", + "S_BIGRING09", + "S_BIGRING10", + "S_BIGRING11", + "S_BIGRING12", // SNES Objects "S_SNES_DONUTBUSH1", @@ -7186,7 +7193,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_DOOD_FLOWER4", "MT_DOOD_BOX", "MT_DOOD_BALLOON", - "MT_DOOD_RING", + "MT_BIGRING", "MT_SNES_DONUTBUSH1", "MT_SNES_DONUTBUSH2", diff --git a/src/info.c b/src/info.c index 606904a4..cf9e7bb2 100644 --- a/src/info.c +++ b/src/info.c @@ -58,8 +58,8 @@ char sprnames[NUMSPRITES + 1][5] = "SPRG","BSPR","RNDM","RPOP","KFRE","KINV","KINF","DRIF","DUST","FITM", "BANA","GSHE","JAWZ","SSMN","KRBM","BHOG","BLIG","LIGH","SINK","SITR", "KBLN","DEZL","POKE","AUDI","DECO","DOOD","SNES","GBAS","SPRS","BUZB", - "CHOM","SACO","CRAB","SHAD","BUMP","FLEN","CLAS","PSHW","ARRO","ITEM", - "ITMI","ITMN","PBOM","VIEW" + "CHOM","SACO","CRAB","SHAD","BRNG","BUMP","FLEN","CLAS","PSHW","ARRO", + "ITEM","ITMI","ITMN","PBOM","VIEW" }; // Doesn't work with g++, needs actionf_p1 (don't modify this comment) @@ -2835,12 +2835,20 @@ state_t states[NUMSTATES] = {SPR_DOOD, 11, -1, {NULL}, 0, 0, S_NULL}, // S_DOOD_BALLOON - {SPR_DOOD, 12, 4, {NULL}, 0, 0, S_DOOD_RING2}, // S_DOOD_RING1 - {SPR_DOOD, 13, 4, {NULL}, 0, 0, S_DOOD_RING3}, // S_DOOD_RING2 - {SPR_DOOD, 14, 4, {NULL}, 0, 0, S_DOOD_RING4}, // S_DOOD_RING3 - {SPR_DOOD, 15, 4, {NULL}, 0, 0, S_DOOD_RING5}, // S_DOOD_RING4 - {SPR_DOOD, 16, 4, {NULL}, 0, 0, S_DOOD_RING1}, // S_DOOD_RING5 + {SPR_BRNG, 0, 2, {NULL}, 0, 0, S_BIGRING02}, // S_BIGRING01 + {SPR_BRNG, 1, 2, {NULL}, 0, 0, S_BIGRING03}, // S_BIGRING02 + {SPR_BRNG, 2, 2, {NULL}, 0, 0, S_BIGRING04}, // S_BIGRING03 + {SPR_BRNG, 3, 2, {NULL}, 0, 0, S_BIGRING05}, // S_BIGRING04 + {SPR_BRNG, 4, 2, {NULL}, 0, 0, S_BIGRING06}, // S_BIGRING05 + {SPR_BRNG, 5, 2, {NULL}, 0, 0, S_BIGRING07}, // S_BIGRING06 + {SPR_BRNG, 6, 2, {NULL}, 0, 0, S_BIGRING08}, // S_BIGRING05 + {SPR_BRNG, 7, 2, {NULL}, 0, 0, S_BIGRING09}, // S_BIGRING05 + {SPR_BRNG, 8, 2, {NULL}, 0, 0, S_BIGRING10}, // S_BIGRING05 + {SPR_BRNG, 9, 2, {NULL}, 0, 0, S_BIGRING11}, // S_BIGRING10 + {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 @@ -15877,9 +15885,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_DOOD_RING + { // MT_BIGRING 2808, // doomednum - S_DOOD_RING1, // spawnstate + S_BIGRING01, // spawnstate 1000, // spawnhealth S_NULL, // seestate sfx_None, // seesound @@ -15894,13 +15902,13 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL, // xdeathstate sfx_None, // deathsound 0, // speed - 1048576, // radius - 2097152, // height + 26*FRACUNIT, // radius + 62*FRACUNIT, // height 0, // display offset 100, // mass 0, // damage sfx_None, // activesound - 33554944, // flags + MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_RUNSPAWNFUNC, // flags S_NULL // raisestate }, diff --git a/src/info.h b/src/info.h index d65bb7e5..611e337e 100644 --- a/src/info.h +++ b/src/info.h @@ -616,6 +616,7 @@ typedef enum sprite SPR_SACO, // Sapphire Coast Fauna SPR_CRAB, // Crystal Abyss mobs SPR_SHAD, // TD shadows + SPR_BRNG, // Chaotix Big Ring SPR_BUMP, // Player/shell bump SPR_FLEN, // Shell hit graphics stuff @@ -3360,12 +3361,19 @@ typedef enum state // D00Dkart - Diddy Kong Racing Balloon S_DOOD_BALLOON, - // D00Dkart - Big Ring - S_DOOD_RING1, - S_DOOD_RING2, - S_DOOD_RING3, - S_DOOD_RING4, - S_DOOD_RING5, + // Chaotix Big Ring + S_BIGRING01, + S_BIGRING02, + S_BIGRING03, + S_BIGRING04, + S_BIGRING05, + S_BIGRING06, + S_BIGRING07, + S_BIGRING08, + S_BIGRING09, + S_BIGRING10, + S_BIGRING11, + S_BIGRING12, // SNES Objects S_SNES_DONUTBUSH1, @@ -4057,7 +4065,7 @@ typedef enum mobj_type MT_DOOD_FLOWER4, MT_DOOD_BOX, MT_DOOD_BALLOON, - MT_DOOD_RING, + MT_BIGRING, MT_SNES_DONUTBUSH1, MT_SNES_DONUTBUSH2, diff --git a/src/p_mobj.c b/src/p_mobj.c index a89961a0..ec9be7bf 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8964,6 +8964,10 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) } } break; + case MT_BIGRING: + mobj->destscale = 3*FRACUNIT; + P_SetScale(mobj, 3*FRACUNIT); + break; default: break; } From 495e9034ae6bfceb07625a16908871cb2d793197 Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Thu, 28 Jun 2018 19:35:52 -0400 Subject: [PATCH 097/293] Fun quit messages Press the 'N' key to unlock the Golden Kart! --- src/m_menu.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 6126da07..e77c0a1b 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2972,26 +2972,26 @@ void M_Init(void) quitmsg[QUITMSG1] = M_GetText("What would Tails say if\nhe saw you quitting the game?\n\n(Press 'Y' to quit)"); quitmsg[QUITMSG2] = M_GetText("Hey!\nWhere do ya think you're goin'?\n\n(Press 'Y' to quit)"); quitmsg[QUITMSG3] = M_GetText("Forget your studies!\nPlay some more!\n\n(Press 'Y' to quit)"); - quitmsg[QUITMSG4] = M_GetText("You're trying to say you\nlike Sonic 2K6 better than\nthis, right?\n\n(Press 'Y' to quit)"); + quitmsg[QUITMSG4] = M_GetText("You're trying to say you\nlike Team Sonic Racing better than\nthis, aren't you?\n\n(Press 'Y' to quit)"); quitmsg[QUITMSG5] = M_GetText("Don't leave yet -- there's a\nsuper emerald around that corner!\n\n(Press 'Y' to quit)"); quitmsg[QUITMSG6] = M_GetText("You'd rather work than play?\n\n(Press 'Y' to quit)"); quitmsg[QUITMSG7] = M_GetText("Go ahead and leave. See if I care...\n*sniffle*\n\n(Press 'Y' to quit)"); quitmsg[QUIT2MSG] = M_GetText("If you leave now,\nEggman will take over the world!\n\n(Press 'Y' to quit)"); - quitmsg[QUIT2MSG1] = M_GetText("Don't quit!\nThere are animals\nto save!\n\n(Press 'Y' to quit)"); - quitmsg[QUIT2MSG2] = M_GetText("Aw c'mon, just bop\na few more robots!\n\n(Press 'Y' to quit)"); + quitmsg[QUIT2MSG1] = M_GetText("On your mark,\nget set,\nhit the 'N' key!\n\n(Press 'Y' to quit)"); + quitmsg[QUIT2MSG2] = M_GetText("Aw c'mon, just\na few more laps!\n\n(Press 'Y' to quit)"); quitmsg[QUIT2MSG3] = M_GetText("Did you get all those Chaos Emeralds?\n\n(Press 'Y' to quit)"); - quitmsg[QUIT2MSG4] = M_GetText("If you leave, I'll use\nmy spin attack on you!\n\n(Press 'Y' to quit)"); + quitmsg[QUIT2MSG4] = M_GetText("If you leave, I'll use\nmy Jawz on you!\n\n(Press 'Y' to quit)"); quitmsg[QUIT2MSG5] = M_GetText("Don't go!\nYou might find the hidden\nlevels!\n\n(Press 'Y' to quit)"); quitmsg[QUIT2MSG6] = M_GetText("Hit the 'N' key, Sonic!\nThe 'N' key!\n\n(Press 'Y' to quit)"); quitmsg[QUIT3MSG] = M_GetText("Are you really going to give up?\nWe certainly would never give you up.\n\n(Press 'Y' to quit)"); quitmsg[QUIT3MSG1] = M_GetText("Come on, just ONE more netgame!\n\n(Press 'Y' to quit)"); - quitmsg[QUIT3MSG2] = M_GetText("Press 'N' to unlock\nthe Ultimate Cheat!\n\n(Press 'Y' to quit)"); - quitmsg[QUIT3MSG3] = M_GetText("Why don't you go back and try\njumping on that house to\nsee what happens?\n\n(Press 'Y' to quit)"); + quitmsg[QUIT3MSG2] = M_GetText("Press 'N' to unlock\nthe Golden Kart!\n\n(Press 'Y' to quit)"); + quitmsg[QUIT3MSG3] = M_GetText("Couldn't handle\nthe banana meta?\n\n\n(Press 'Y' to quit)"); quitmsg[QUIT3MSG4] = M_GetText("Every time you press 'Y', an\nSRB2Kart Developer cries...\n\n(Press 'Y' to quit)"); - quitmsg[QUIT3MSG5] = M_GetText("You'll be back to play soon, though...\n......right?\n\n(Press 'Y' to quit)"); - quitmsg[QUIT3MSG6] = M_GetText("Aww, is Egg Rock Zone too\ndifficult for you?\n\n(Press 'Y' to quit)"); + quitmsg[QUIT3MSG5] = M_GetText("You'll be back to play soon, though...\n...right?\n\n(Press 'Y' to quit)"); + quitmsg[QUIT3MSG6] = M_GetText("Aww, is Eggman's Nightclub too\ndifficult for you?\n\n(Press 'Y' to quit)"); #ifdef HWRENDER // Permanently hide some options based on render mode From 041e31efdc2b0ef18cc926ad24e327028d8395fc Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Thu, 28 Jun 2018 20:54:06 -0400 Subject: [PATCH 098/293] Splitscreen items (also fixed Big Ring flags) --- src/info.c | 4 +- src/k_kart.c | 202 +++++++++++++++++++++++++++++---------------------- 2 files changed, 119 insertions(+), 87 deletions(-) diff --git a/src/info.c b/src/info.c index cf9e7bb2..4e3078e6 100644 --- a/src/info.c +++ b/src/info.c @@ -15887,7 +15887,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { // MT_BIGRING 2808, // doomednum - S_BIGRING01, // spawnstate + S_BIGRING01, // spawnstate 1000, // spawnhealth S_NULL, // seestate sfx_None, // seesound @@ -15908,7 +15908,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_RUNSPAWNFUNC, // flags + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOGRAVITY|MF_SCENERY, // flags S_NULL // raisestate }, diff --git a/src/k_kart.c b/src/k_kart.c index a1f32698..48dddaee 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3836,28 +3836,27 @@ static patch_t *kp_battlelose; static patch_t *kp_battlewait; static patch_t *kp_battleinfo; -static patch_t *kp_itembg; -static patch_t *kp_itembgdark; -static patch_t *kp_itemmulsticker; +static patch_t *kp_itembg[4]; +static patch_t *kp_itemmulsticker[2]; static patch_t *kp_itemx; -static patch_t *kp_sneaker; -static patch_t *kp_rocketsneaker; -static patch_t *kp_invincibility[7]; -static patch_t *kp_banana; -static patch_t *kp_eggman; -static patch_t *kp_orbinaut; -static patch_t *kp_jawz; -static patch_t *kp_mine; -static patch_t *kp_ballhog; -static patch_t *kp_selfpropelledbomb; -static patch_t *kp_grow; -static patch_t *kp_shrink; -static patch_t *kp_lightningshield; -static patch_t *kp_hyudoro; -static patch_t *kp_pogospring; -static patch_t *kp_kitchensink; -static patch_t *kp_sadface; +static patch_t *kp_sneaker[2]; +static patch_t *kp_rocketsneaker[2]; +static patch_t *kp_invincibility[13]; +static patch_t *kp_banana[2]; +static patch_t *kp_eggman[2]; +static patch_t *kp_orbinaut[2]; +static patch_t *kp_jawz[2]; +static patch_t *kp_mine[2]; +static patch_t *kp_ballhog[2]; +static patch_t *kp_selfpropelledbomb[2]; +static patch_t *kp_grow[2]; +static patch_t *kp_shrink[2]; +static patch_t *kp_lightningshield[2]; +static patch_t *kp_hyudoro[2]; +static patch_t *kp_pogospring[2]; +static patch_t *kp_kitchensink[2]; +static patch_t *kp_sadface[2]; static patch_t *kp_check[6]; @@ -3928,32 +3927,59 @@ void K_LoadKartHUDGraphics(void) kp_battleinfo = W_CachePatchName("K_BINFO", PU_HUDGFX); // Kart Item Windows - kp_itembg = W_CachePatchName("K_ITBG", PU_HUDGFX); - kp_itembgdark = W_CachePatchName("K_ITBGD", PU_HUDGFX); - kp_itemmulsticker = W_CachePatchName("K_ITMUL", PU_HUDGFX); + kp_itembg[0] = W_CachePatchName("K_ITBG", PU_HUDGFX); + kp_itembg[1] = W_CachePatchName("K_ITBGD", PU_HUDGFX); + kp_itemmulsticker[0] = W_CachePatchName("K_ITMUL", PU_HUDGFX); kp_itemx = W_CachePatchName("K_ITX", PU_HUDGFX); - kp_sneaker = W_CachePatchName("K_ITSHOE", PU_HUDGFX); - kp_rocketsneaker = W_CachePatchName("K_ITRSHE", PU_HUDGFX); + kp_sneaker[0] = W_CachePatchName("K_ITSHOE", PU_HUDGFX); + kp_rocketsneaker[0] = W_CachePatchName("K_ITRSHE", PU_HUDGFX); for (i = 0; i < 7; i++) { sprintf(buffer, "K_ITINV%d", i+1); kp_invincibility[i] = (patch_t *) W_CachePatchName(buffer, PU_HUDGFX); } - kp_banana = W_CachePatchName("K_ITBANA", PU_HUDGFX); - kp_eggman = W_CachePatchName("K_ITEGGM", PU_HUDGFX); - kp_orbinaut = W_CachePatchName("K_ITORBN", PU_HUDGFX); - kp_jawz = W_CachePatchName("K_ITJAWZ", PU_HUDGFX); - kp_mine = W_CachePatchName("K_ITMINE", PU_HUDGFX); - kp_ballhog = W_CachePatchName("K_ITBHOG", PU_HUDGFX); - kp_selfpropelledbomb = W_CachePatchName("K_ITSPB", PU_HUDGFX); - kp_grow = W_CachePatchName("K_ITGROW", PU_HUDGFX); - kp_shrink = W_CachePatchName("K_ITSHRK", PU_HUDGFX); - kp_lightningshield = W_CachePatchName("K_ITLITS", PU_HUDGFX); - kp_hyudoro = W_CachePatchName("K_ITHYUD", PU_HUDGFX); - kp_pogospring = W_CachePatchName("K_ITPOGO", PU_HUDGFX); - kp_kitchensink = W_CachePatchName("K_ITSINK", PU_HUDGFX); - kp_sadface = W_CachePatchName("K_ITSAD", PU_HUDGFX); + kp_banana[0] = W_CachePatchName("K_ITBANA", PU_HUDGFX); + kp_eggman[0] = W_CachePatchName("K_ITEGGM", PU_HUDGFX); + kp_orbinaut[0] = W_CachePatchName("K_ITORBN", PU_HUDGFX); + kp_jawz[0] = W_CachePatchName("K_ITJAWZ", PU_HUDGFX); + kp_mine[0] = W_CachePatchName("K_ITMINE", PU_HUDGFX); + kp_ballhog[0] = W_CachePatchName("K_ITBHOG", PU_HUDGFX); + kp_selfpropelledbomb[0] = W_CachePatchName("K_ITSPB", PU_HUDGFX); + kp_grow[0] = W_CachePatchName("K_ITGROW", PU_HUDGFX); + kp_shrink[0] = W_CachePatchName("K_ITSHRK", PU_HUDGFX); + kp_lightningshield[0] = W_CachePatchName("K_ITLITS", PU_HUDGFX); + kp_hyudoro[0] = W_CachePatchName("K_ITHYUD", PU_HUDGFX); + kp_pogospring[0] = W_CachePatchName("K_ITPOGO", PU_HUDGFX); + kp_kitchensink[0] = W_CachePatchName("K_ITSINK", PU_HUDGFX); + kp_sadface[0] = W_CachePatchName("K_ITSAD", PU_HUDGFX); + + // Splitscreen + kp_itembg[2] = W_CachePatchName("K_ISBG", PU_HUDGFX); + kp_itembg[3] = W_CachePatchName("K_ISBGD", PU_HUDGFX); + kp_itemmulsticker[1] = W_CachePatchName("K_ISMUL", PU_HUDGFX); + + kp_sneaker[1] = W_CachePatchName("K_ISSHOE", PU_HUDGFX); + kp_rocketsneaker[1] = W_CachePatchName("K_ISRSHE", PU_HUDGFX); + for (i = 0; i < 6; i++) + { + sprintf(buffer, "K_ISINV%d", i+1); + kp_invincibility[i+7] = (patch_t *) W_CachePatchName(buffer, PU_HUDGFX); + } + kp_banana[1] = W_CachePatchName("K_ISBANA", PU_HUDGFX); + kp_eggman[1] = W_CachePatchName("K_ISEGGM", PU_HUDGFX); + kp_orbinaut[1] = W_CachePatchName("K_ISORBN", PU_HUDGFX); + kp_jawz[1] = W_CachePatchName("K_ISJAWZ", PU_HUDGFX); + kp_mine[1] = W_CachePatchName("K_ISMINE", PU_HUDGFX); + kp_ballhog[1] = W_CachePatchName("K_ISBHOG", PU_HUDGFX); + kp_selfpropelledbomb[1] = W_CachePatchName("K_ISSPB", PU_HUDGFX); + kp_grow[1] = W_CachePatchName("K_ISGROW", PU_HUDGFX); + kp_shrink[1] = W_CachePatchName("K_ISSHRK", PU_HUDGFX); + kp_lightningshield[1] = W_CachePatchName("K_ISLITS", PU_HUDGFX); + kp_hyudoro[1] = W_CachePatchName("K_ISHYUD", PU_HUDGFX); + kp_pogospring[1] = W_CachePatchName("K_ISPOGO", PU_HUDGFX); + kp_kitchensink[1] = W_CachePatchName("K_ISSINK", PU_HUDGFX); + kp_sadface[1] = W_CachePatchName("K_ISSAD", PU_HUDGFX); // CHECK indicators for (i = 0; i < 6; i++) @@ -4055,7 +4081,7 @@ static void K_initKartHUD(void) if (splitscreen) // Splitscreen { ITEM_X = 5; - ITEM_Y = 0; + ITEM_Y = 3; LAPS_Y = (BASEVIDHEIGHT/2)-24; @@ -4069,8 +4095,8 @@ static void K_initKartHUD(void) if (splitscreen > 1) // 3P/4P Small Splitscreen { - ITEM_X = 0; - ITEM_Y = 0; + ITEM_X = -9; + ITEM_Y = -8; LAPS_X = 3; LAPS_Y = (BASEVIDHEIGHT/2)-13; @@ -4145,9 +4171,10 @@ static void K_drawKartItem(void) // Why write V_DrawScaledPatch calls over and over when they're all the same? // Set to 'no item' just in case. + const UINT8 offset = ((splitscreen > 1) ? 1 : 0); patch_t *localpatch = kp_nodraw; - patch_t *localbg = kp_itembg; - patch_t *localinv = kp_invincibility[(leveltime % (7*3)) / 3]; + patch_t *localbg = ((splitscreen > 1) ? kp_itembg[2] : kp_itembg[0]); + patch_t *localinv = ((splitscreen > 1) ? kp_invincibility[((leveltime % (6*3)) / 3) + 7] : kp_invincibility[(leveltime % (7*3)) / 3]); INT32 splitflags = K_calcSplitFlags(V_SNAPTOTOP|V_SNAPTOLEFT); if (stplyr->kartstuff[k_itemroulette]) @@ -4155,22 +4182,22 @@ static void K_drawKartItem(void) switch((stplyr->kartstuff[k_itemroulette] % (13*3)) / 3) { // Each case is handled in threes, to give three frames of in-game time to see the item on the roulette - case 0: localpatch = kp_sneaker; break; // Sneaker - case 1: localpatch = kp_banana; break; // Banana - case 2: localpatch = kp_orbinaut; break; // Orbinaut - case 3: localpatch = kp_mine; break; // Mine - case 4: localpatch = kp_grow; break; // Grow - case 5: localpatch = kp_hyudoro; break; // Hyudoro - case 6: localpatch = kp_rocketsneaker; break; // Rocket Sneaker - case 7: localpatch = kp_jawz; break; // Jawz - case 8: localpatch = kp_selfpropelledbomb; break; // Self-Propelled Bomb - case 9: localpatch = kp_shrink; break; // Shrink - case 10: localpatch = localinv; break; // Invincibility - case 11: localpatch = kp_eggman; break; // Eggman Monitor - case 12: localpatch = kp_ballhog; break; // Ballhog - case 13: localpatch = kp_lightningshield; break; // Lightning Shield - //case 14: localpatch = kp_pogospring; break; // Pogo Spring - //case 15: localpatch = kp_kitchensink; break; // Kitchen Sink + case 0: localpatch = kp_sneaker[offset]; break; // Sneaker + case 1: localpatch = kp_banana[offset]; break; // Banana + case 2: localpatch = kp_orbinaut[offset]; break; // Orbinaut + case 3: localpatch = kp_mine[offset]; break; // Mine + case 4: localpatch = kp_grow[offset]; break; // Grow + case 5: localpatch = kp_hyudoro[offset]; break; // Hyudoro + case 6: localpatch = kp_rocketsneaker[offset]; break; // Rocket Sneaker + case 7: localpatch = kp_jawz[offset]; break; // Jawz + case 8: localpatch = kp_selfpropelledbomb[offset]; break; // Self-Propelled Bomb + case 9: localpatch = kp_shrink[offset]; break; // Shrink + case 10: localpatch = localinv; break; // Invincibility + case 11: localpatch = kp_eggman[offset]; break; // Eggman Monitor + case 12: localpatch = kp_ballhog[offset]; break; // Ballhog + case 13: localpatch = kp_lightningshield[offset]; break; // Lightning Shield + //case 14: localpatch = kp_pogospring[offset]; break; // Pogo Spring + //case 15: localpatch = kp_kitchensink[offset]; break; // Kitchen Sink default: break; } } @@ -4183,32 +4210,32 @@ static void K_drawKartItem(void) if (stplyr->kartstuff[k_stolentimer] > 0) { if (leveltime & 2) - localpatch = kp_hyudoro; + localpatch = kp_hyudoro[offset]; else if (!(leveltime & 2)) localpatch = kp_nodraw; } else if ((stplyr->kartstuff[k_stealingtimer] > 0) && (leveltime & 2)) { - localpatch = kp_hyudoro; + localpatch = kp_hyudoro[offset]; } else if (stplyr->kartstuff[k_rocketsneakertimer] > 1) { if (leveltime & 1) - localpatch = kp_rocketsneaker; + localpatch = kp_rocketsneaker[offset]; else if (!(leveltime & 1)) localpatch = kp_nodraw; } else if (stplyr->kartstuff[k_growshrinktimer] > 1) { if (leveltime & 1) - localpatch = kp_grow; + localpatch = kp_grow[offset]; else if (!(leveltime & 1)) localpatch = kp_nodraw; } else if (stplyr->kartstuff[k_sadtimer] > 0) { if (leveltime & 2) - localpatch = kp_sadface; + localpatch = kp_sadface[offset]; else if (!(leveltime & 2)) localpatch = kp_nodraw; } @@ -4219,23 +4246,23 @@ static void K_drawKartItem(void) switch(stplyr->kartstuff[k_itemtype]) { - case KITEM_SNEAKER: localpatch = kp_sneaker; break; - case KITEM_ROCKETSNEAKER: localpatch = kp_rocketsneaker; break; - case KITEM_INVINCIBILITY: localpatch = localinv; localbg = kp_itembgdark; break; - case KITEM_BANANA: localpatch = kp_banana; break; - case KITEM_EGGMAN: localpatch = kp_eggman; break; - case KITEM_ORBINAUT: localpatch = kp_orbinaut; break; - case KITEM_JAWZ: localpatch = kp_jawz; break; - case KITEM_MINE: localpatch = kp_mine; break; - case KITEM_BALLHOG: localpatch = kp_ballhog; break; - case KITEM_SPB: localpatch = kp_selfpropelledbomb; break; - case KITEM_GROW: localpatch = kp_grow; break; - case KITEM_SHRINK: localpatch = kp_shrink; break; - case KITEM_LIGHTNINGSHIELD: localpatch = kp_lightningshield; break; - case KITEM_HYUDORO: localpatch = kp_hyudoro; break; - case KITEM_POGOSPRING: localpatch = kp_pogospring; break; - case KITEM_KITCHENSINK: localpatch = kp_kitchensink; break; - case KITEM_SAD: localpatch = kp_sadface; break; + case KITEM_SNEAKER: localpatch = kp_sneaker[offset]; break; + case KITEM_ROCKETSNEAKER: localpatch = kp_rocketsneaker[offset]; break; + case KITEM_INVINCIBILITY: localpatch = localinv; localbg = kp_itembg[offset+1]; break; + case KITEM_BANANA: localpatch = kp_banana[offset]; break; + case KITEM_EGGMAN: localpatch = kp_eggman[offset]; break; + case KITEM_ORBINAUT: localpatch = kp_orbinaut[offset]; break; + case KITEM_JAWZ: localpatch = kp_jawz[offset]; break; + case KITEM_MINE: localpatch = kp_mine[offset]; break; + case KITEM_BALLHOG: localpatch = kp_ballhog[offset]; break; + case KITEM_SPB: localpatch = kp_selfpropelledbomb[offset]; break; + case KITEM_GROW: localpatch = kp_grow[offset]; break; + case KITEM_SHRINK: localpatch = kp_shrink[offset]; break; + case KITEM_LIGHTNINGSHIELD: localpatch = kp_lightningshield[offset]; break; + case KITEM_HYUDORO: localpatch = kp_hyudoro[offset]; break; + case KITEM_POGOSPRING: localpatch = kp_pogospring[offset]; break; + case KITEM_KITCHENSINK: localpatch = kp_kitchensink[offset]; break; + case KITEM_SAD: localpatch = kp_sadface[offset]; break; default: return; } } @@ -4246,10 +4273,15 @@ static void K_drawKartItem(void) // Then, the numbers: if (stplyr->kartstuff[k_itemamount] > 1 && !stplyr->kartstuff[k_itemroulette]) { - V_DrawScaledPatch(ITEM_X+9, ITEM_Y+24, V_HUDTRANS|splitflags, kp_itemmulsticker); + V_DrawScaledPatch(ITEM_X, ITEM_Y, V_HUDTRANS|splitflags, kp_itemmulsticker[offset]); V_DrawScaledPatch(ITEM_X, ITEM_Y, V_HUDTRANS|splitflags, localpatch); - V_DrawScaledPatch(ITEM_X+28, ITEM_Y+41, V_HUDTRANS|splitflags, kp_itemx); - V_DrawKartString(ITEM_X+38, ITEM_Y+36, V_HUDTRANS|splitflags, va("%d", stplyr->kartstuff[k_itemamount])); + if (splitscreen > 1) + V_DrawString(ITEM_X+24, ITEM_Y+31, V_ALLOWLOWERCASE|V_HUDTRANS|splitflags, va("x%d", stplyr->kartstuff[k_itemamount])); + else + { + V_DrawScaledPatch(ITEM_X+28, ITEM_Y+41, V_HUDTRANS|splitflags, kp_itemx); + V_DrawKartString(ITEM_X+38, ITEM_Y+36, V_HUDTRANS|splitflags, va("%d", stplyr->kartstuff[k_itemamount])); + } } else V_DrawScaledPatch(ITEM_X, ITEM_Y, V_HUDTRANS|splitflags, localpatch); From 25cd3cc093de6cd4cfc3b6065fa7c2ed899ca27f Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Thu, 28 Jun 2018 21:19:58 -0400 Subject: [PATCH 099/293] A minor tweak --- src/p_setup.c | 2 +- src/p_user.c | 50 ++++++++++++++++++++++++++------------------------ 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index cf2ad8e1..0d646edc 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2660,7 +2660,7 @@ boolean P_SetupLevel(boolean skipprecip) // SRB2 Kart - Yes this is weird, but we don't want the music to start until after the countdown is finished // but we do still need the mapmusname to be changed if (leveltime < (starttime + (TICRATE/2))) - S_StopMusic(); + S_ChangeMusicInternal("kstart", false); //S_StopMusic(); // Let's fade to black here // But only if we didn't do the special stage wipe diff --git a/src/p_user.c b/src/p_user.c index 3570e78a..409ba09f 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1165,38 +1165,40 @@ void P_RestoreMusic(player_t *player) S_SpeedMusic(1.0f); // SRB2kart - We have some different powers than vanilla, some of which tweak the music. - if (splitscreen != 0 && G_RaceGametype() - && (players[consoleplayer].exiting - || players[secondarydisplayplayer].exiting - || players[thirddisplayplayer].exiting - || players[fourthdisplayplayer].exiting)) - S_ChangeMusicInternal("karwin", true); - else if (splitscreen == 0 && G_RaceGametype() && player->exiting) - { - if (player->kartstuff[k_position] == 1) - S_ChangeMusicInternal("karwin", true); - else if (K_IsPlayerLosing(player)) - S_ChangeMusicInternal("karlos", true); - else - S_ChangeMusicInternal("karok", true); - } + // Event - Race Start + if (leveltime < (starttime + (TICRATE/2))) + S_ChangeMusicInternal("kstart", false); //S_StopMusic(); + // Item - Grow + else if (player->kartstuff[k_growshrinktimer] > 1 && player->playerstate == PST_LIVE) + S_ChangeMusicInternal("kgrow", true); + // Item - Invincibility + else if (player->kartstuff[k_invincibilitytimer] > 1 && player->playerstate == PST_LIVE) + S_ChangeMusicInternal("kinvnc", false); else { - // Item - Grow - if (player->kartstuff[k_growshrinktimer] > 1 && player->playerstate == PST_LIVE) - S_ChangeMusicInternal("kgrow", true); - // Item - Invincibility - else if (player->kartstuff[k_invincibilitytimer] > 1 && player->playerstate == PST_LIVE) - S_ChangeMusicInternal("kinvnc", false); - else if (leveltime > (starttime + (TICRATE/2))) + // Event - Race Finish + if (splitscreen != 0 && G_RaceGametype() + && (players[consoleplayer].exiting + || players[secondarydisplayplayer].exiting + || players[thirddisplayplayer].exiting + || players[fourthdisplayplayer].exiting)) + S_ChangeMusicInternal("karwin", true); + else if (splitscreen == 0 && G_RaceGametype() && player->exiting) + { + if (player->kartstuff[k_position] == 1) + S_ChangeMusicInternal("karwin", true); + else if (K_IsPlayerLosing(player)) + S_ChangeMusicInternal("karlos", true); + else + S_ChangeMusicInternal("karok", true); + } + else { // Event - Final Lap if (G_RaceGametype() && player->laps >= (UINT8)(cv_numlaps.value - 1)) S_SpeedMusic(1.2f); S_ChangeMusic(mapmusname, mapmusflags, true); } - else - S_StopMusic(); } } From d2a8414dee95739307de2fa1c9711ba8faabaf18 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 29 Jun 2018 14:14:24 +0100 Subject: [PATCH 100/293] * Properly handle gametype changes when a different-gametype level pops up on the voting screen. * Defer the change until you're actually modifying the map, in service of the following. * Reset score. * Call that gametype change function. * Collary of the above: Don't reset score if you're `map mapxx`ing in the console, unless it's `force`'d. * Fix the basic, obvious issues that'd prevent us shipping with the new level title system. * Correct the non-green resolution support, which was ALMOST there but which I accidentially fucked up one of the signs on. * Adjust the subttl position if it'd get overwritten. * Draw the gametype with the subttl. * Adjust the gametype constants for easier gametype_cons_t array access. --- src/d_clisrv.c | 3 ++- src/d_netcmd.c | 62 +++++++++++++++----------------------------------- src/doomstat.h | 20 ++++++++-------- src/g_game.c | 21 ++++++++++++----- src/hu_stuff.c | 14 +----------- src/st_stuff.c | 26 +++++++++++++-------- src/y_inter.c | 15 ++++-------- 7 files changed, 65 insertions(+), 96 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 43c728b7..b4a6c2d4 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3705,7 +3705,8 @@ static void HandlePacketFromAwayNode(SINT8 node) if (client) { maketic = gametic = neededtic = (tic_t)LONG(netbuffer->u.servercfg.gametic); - gametype = netbuffer->u.servercfg.gametype; + if ((gametype = netbuffer->u.servercfg.gametype) >= NUMGAMETYPES) + I_Error("Bad gametype in cliserv!"); modifiedgame = netbuffer->u.servercfg.modifiedgame; for (j = 0; j < MAXPLAYERS; j++) adminplayers[j] = netbuffer->u.servercfg.adminplayers[j]; diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 82cbc4bf..9ad7e4ba 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -447,6 +447,7 @@ consvar_t cv_mute = {"mute", "Off", CV_NETVAR|CV_CALL, CV_OnOff, Mute_OnChange, consvar_t cv_sleep = {"cpusleep", "-1", CV_SAVE, sleeping_cons_t, NULL, -1, NULL, NULL, 0, 0, NULL}; INT16 gametype = GT_RACE; // SRB2kart +INT16 deferredgametype = GT_RACE; // SRB2kart UINT8 splitscreen = 0; boolean circuitmap = true; // SRB2kart INT32 adminplayers[MAXPLAYERS]; @@ -2117,7 +2118,6 @@ static void Command_Map_f(void) // Don't do any variable setting here. Wait until you get your // map packet first to avoid sending the same info twice! newgametype = gametype_cons_t[j].value; - break; } @@ -2135,26 +2135,23 @@ static void Command_Map_f(void) } } + if (!(i = COM_CheckParm("-force")) && newgametype == gametype) // SRB2Kart + newresetplayers = false; // if not forcing and gametypes is the same + // don't use a gametype the map doesn't support - if (cv_debug || COM_CheckParm("-force") || cv_skipmapcheck.value) + if (cv_debug || i || cv_skipmapcheck.value) ; // The player wants us to trek on anyway. Do so. // G_TOLFlag handles both multiplayer gametype and ignores it for !multiplayer // Alternatively, bail if the map header is completely missing anyway. - else if (!mapheaderinfo[newmapnum-1] - || !(mapheaderinfo[newmapnum-1]->typeoflevel & G_TOLFlag(newgametype))) + else { - char gametypestring[32] = "Single Player"; - - if (multiplayer) - for (i = 0; gametype_cons_t[i].strvalue != NULL; i++) - if (gametype_cons_t[i].value == newgametype) - { - strcpy(gametypestring, gametype_cons_t[i].strvalue); - break; - } - - CONS_Alert(CONS_WARNING, M_GetText("%s doesn't support %s mode!\n(Use -force to override)\n"), mapname, gametypestring); - return; + if (!mapheaderinfo[newmapnum-1] + || !(mapheaderinfo[newmapnum-1]->typeoflevel & G_TOLFlag(newgametype))) + { + CONS_Alert(CONS_WARNING, M_GetText("%s doesn't support %s mode!\n(Use -force to override)\n"), mapname, + (multiplayer ? gametype_cons_t[newgametype].strvalue : "Single Player")); + return; + } } // Prevent warping to locked levels @@ -4044,24 +4041,12 @@ static void Command_ShowGametype_f(void) INT32 j; const char *gametypestr = NULL; - if (!(netgame || multiplayer)) // print "Single player" instead of "Co-op" + if (!(netgame || multiplayer)) // print "Single player" instead of "Race" { - CONS_Printf(M_GetText("Current gametype is %s\n"), M_GetText("Single player")); + CONS_Printf(M_GetText("Current gametype is %s\n"), "Single Player"); return; } - // find name string for current gametype - for (j = 0; gametype_cons_t[j].strvalue; j++) - { - if (gametype_cons_t[j].value == gametype) - { - gametypestr = gametype_cons_t[j].strvalue; - break; - } - } - if (gametypestr) - CONS_Printf(M_GetText("Current gametype is %s\n"), gametypestr); - else // string for current gametype was not found above (should never happen) - CONS_Printf(M_GetText("Unknown gametype set (%d)\n"), gametype); + CONS_Printf(M_GetText("Current gametype is %s\n"), gametype_cons_t[gametype].strvalue); } /** Plays the intro. @@ -4195,19 +4180,8 @@ static void TimeLimit_OnChange(void) void D_GameTypeChanged(INT32 lastgametype) { if (netgame) - { - INT32 j; - const char *oldgt = NULL, *newgt = NULL; - for (j = 0; gametype_cons_t[j].strvalue; j++) - { - if (gametype_cons_t[j].value == lastgametype) - oldgt = gametype_cons_t[j].strvalue; - if (gametype_cons_t[j].value == gametype) - newgt = gametype_cons_t[j].strvalue; - } - if (oldgt && newgt) - CONS_Printf(M_GetText("Gametype was changed from %s to %s\n"), oldgt, newgt); - } + CONS_Printf(M_GetText("Gametype was changed from %s to %s\n"), gametype_cons_t[lastgametype].strvalue, gametype_cons_t[gametype].strvalue); + // Only do the following as the server, not as remote admin. // There will always be a server, and this only needs to be done once. if (server && (multiplayer || netgame)) diff --git a/src/doomstat.h b/src/doomstat.h index cf299816..433cfbd7 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -76,7 +76,7 @@ extern boolean addedtogame; // true after the server has added you // Only true if >1 player. netgame => multiplayer but not (multiplayer=>netgame) extern boolean multiplayer; -extern INT16 gametype; +extern INT16 gametype, deferredgametype; extern UINT8 splitscreen; extern boolean circuitmap; // Does this level have 'circuit mode'? extern boolean fromlevelselect; @@ -303,21 +303,19 @@ enum TypeOfLevel }; // Gametypes -enum GameType +enum GameType // SRB2Kart { - GT_COOP = 0, // also used in single player - GT_COMPETITION, // Classic "Race" - GT_RACE, + GT_RACE = 0, // also used in record attack + GT_MATCH, // battle, but renaming would be silly + NUMGAMETYPES, - GT_MATCH, + // the following have been left in on account of just not wanting to deal with removing all the checks for them + GT_COOP, + GT_COMPETITION, GT_TEAMMATCH, - GT_TAG, GT_HIDEANDSEEK, - - GT_CTF, // capture the flag - - NUMGAMETYPES + GT_CTF }; // If you alter this list, update gametype_cons_t in m_menu.c diff --git a/src/g_game.c b/src/g_game.c index 548c26cd..1ca67918 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3379,7 +3379,11 @@ void G_NextLevel(void) && !modeattacking && !skipstats && (multiplayer || netgame)) gameaction = ga_startvote; else + { + if (gamestate != GS_VOTING) + deferredgametype = gametype; gameaction = ga_worlddone; + } } static void G_DoWorldDone(void) @@ -3387,7 +3391,7 @@ static void G_DoWorldDone(void) if (server) { // SRB2kart: don't reset player between maps - D_MapChange(nextmap+1, gametype, ultimatemode, false, 0, false, false); + D_MapChange(nextmap+1, deferredgametype, ultimatemode, (deferredgametype != gametype), 0, false, false); } gameaction = ga_nothing; @@ -4032,7 +4036,8 @@ void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, boolean if (!demoplayback && !netgame) // Netgame sets random seed elsewhere, demo playback sets seed just before us! P_SetRandSeed(M_RandomizedSeed()); // Use a more "Random" random seed - if (resetplayer) + //SRB2Kart - Score is literally the only thing you SHOULDN'T reset at all times + //if (resetplayer) { // Clear a bunch of variables tokenlist = token = sstimer = redscore = bluescore = lastmap = 0; @@ -4045,7 +4050,7 @@ void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, boolean players[i].starpostx = players[i].starposty = players[i].starpostz = 0; players[i].starpostcount = 0; // srb2kart - if (netgame || multiplayer) + /*if (netgame || multiplayer) { players[i].lives = cv_startinglives.value; players[i].continues = 0; @@ -4061,13 +4066,18 @@ void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, boolean players[i].continues = 1; } + players[i].xtralife = 0;*/ + // The latter two should clear by themselves, but just in case players[i].pflags &= ~(PF_TAGIT|PF_TAGGED|PF_FULLSTASIS); // Clear cheatcodes too, just in case. players[i].pflags &= ~(PF_GODMODE|PF_NOCLIP|PF_INVIS); - players[i].score = players[i].xtralife = 0; + if (resetplayer) // SRB2Kart + { + players[i].score = 0; + } } // Reset unlockable triggers @@ -5601,8 +5611,7 @@ void G_DoPlayDemo(char *defdemoname) memset(playeringame,0,sizeof(playeringame)); playeringame[0] = true; P_SetRandSeed(randseed); - //G_InitNew(false, G_BuildMapName(gamemap), false, true); // resetplayer needs to be false to retain score - G_InitNew(false, G_BuildMapName(gamemap), true, true); // ...but uh, for demos? doing that makes them start in different positions depending on the last demo you watched + G_InitNew(false, G_BuildMapName(gamemap), true, true); // Doesn't matter whether you reset or not here, given changes to resetplayer. // Set skin SetPlayerSkin(0, skin); diff --git a/src/hu_stuff.c b/src/hu_stuff.c index c3c04bed..61b8ce72 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -1123,19 +1123,7 @@ static void HU_DrawCEcho(void) static void HU_drawGametype(void) { - INT32 i = 0; - - for (i = 0; gametype_cons_t[i].strvalue; i++) - { - if (gametype_cons_t[i].value == gametype) - { - if (splitscreen) - V_DrawString(4, 184, 0, gametype_cons_t[i].strvalue); - else - V_DrawString(4, 192, 0, gametype_cons_t[i].strvalue); - return; - } - } + V_DrawString(4, (splitscreen ? 184 : 192), 0, gametype_cons_t[gametype].strvalue); } // diff --git a/src/st_stuff.c b/src/st_stuff.c index 2b3c770a..87d29556 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -774,11 +774,14 @@ static void ST_drawLevelTitle(void) else lvlttlxpos = ((BASEVIDWIDTH/2) - (lvlw/2)); - ttlnumxpos = lvlttlxpos + lvlw; - if (zonttl[0]) - zonexpos = ttlnumxpos - V_LevelNameWidth(zonttl); // SRB2kart - else - zonexpos = ttlnumxpos - V_LevelNameWidth(M_GetText("ZONE")); + zonexpos = ttlnumxpos = lvlttlxpos + lvlw; + if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE)) + { + if (zonttl[0]) + zonexpos -= V_LevelNameWidth(zonttl); // SRB2kart + else + zonexpos -= V_LevelNameWidth(M_GetText("ZONE")); + } if (lvlttlxpos < 0) lvlttlxpos = 0; @@ -795,11 +798,14 @@ static void ST_drawLevelTitle(void) { dupcalc = (dupcalc - BASEVIDWIDTH)>>1; INT32 h = lvlttly + V_LevelNameHeight(lvlttl) + 2; - V_DrawFill(sub - dupcalc, h+9, lvlttlxpos + lvlw + 1 - dupcalc, 2, 31); - V_DrawDiag(sub + lvlttlxpos + lvlw + 1, h, 11, 31); - V_DrawFill(sub - dupcalc, h, lvlttlxpos + lvlw - dupcalc, 10, gtc); - V_DrawDiag(sub + lvlttlxpos + lvlw, h, 10, gtc); - V_DrawString(sub + lvlttlxpos, h+1, V_ALLOWLOWERCASE, subttl); + V_DrawFill(sub - dupcalc, h+9, ttlnumxpos+dupcalc + 1, 2, 31); + V_DrawDiag(sub + ttlnumxpos + 1, h, 11, 31); + V_DrawFill(sub - dupcalc, h, ttlnumxpos+dupcalc, 10, gtc); + V_DrawDiag(sub + ttlnumxpos, h, 10, gtc); + if (subttl[0]) + V_DrawRightAlignedString(sub + zonexpos - 8, h+1, V_ALLOWLOWERCASE, va("%s - %s", gametype_cons_t[gametype].strvalue, subttl)); + else + V_DrawRightAlignedString(sub + zonexpos - 8, h+1, V_ALLOWLOWERCASE, gametype_cons_t[gametype].strvalue); } ttlnumxpos += sub; diff --git a/src/y_inter.c b/src/y_inter.c index 33d62157..fb1f612b 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -2617,16 +2617,13 @@ void Y_StartVote(void) levelinfo[i].str[sizeof levelinfo[i].str - 1] = '\0'; // set up the gtc and gts - levelinfo[i].gts = NULL; if (i == 2 && votelevels[i][1] != votelevels[0][1]) { levelinfo[i].gtc = G_GetGametypeColor(votelevels[i][1]); - for (j = 0; gametype_cons_t[j].strvalue; j++) - { - if (gametype_cons_t[j].value == votelevels[i][1]) - levelinfo[i].gts = gametype_cons_t[j].strvalue; - } + levelinfo[i].gts = gametype_cons_t[votelevels[i][1]].strvalue; } + else + levelinfo[i].gts = NULL; // gtc is never accessed in this case // set up the pic lumpnum = W_CheckNumForName(va("%sP", G_BuildMapName(votelevels[i][0]+1))); @@ -2726,10 +2723,6 @@ void Y_SetupVoteFinish(SINT8 pick, SINT8 level) pickedvote = pick; nextmap = votelevels[level][0]; - if (gametype != votelevels[level][1]) - { - //CONS_Printf("yer dun\n"); -- if we want to do anything else special for a gametype switch, it'd be here - gametype = votelevels[level][1]; - } + deferredgametype = votelevels[level][1]; timer = 0; } From 9a9e1ad81e99573cc0fbe68351278468c8e8739c Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 29 Jun 2018 17:49:02 +0100 Subject: [PATCH 101/293] * Rework min/max cvars to allow for "named" values! They probably won't work if they're inside the range, but... * Combine the numlaps and usemapnumlaps functionality on the menu into basenumlaps, which numlaps is set to every race start, except when it's map default value (0) in which case it loads the map's lap count. --- src/command.c | 76 +++++++++++++++++++++++++++++++++----------------- src/d_netcmd.c | 20 +++++++++++-- src/d_netcmd.h | 2 +- src/m_menu.c | 15 +++++----- src/p_setup.c | 7 +++-- 5 files changed, 81 insertions(+), 39 deletions(-) diff --git a/src/command.c b/src/command.c index a1f0a46b..b8f48bc5 100644 --- a/src/command.c +++ b/src/command.c @@ -1088,32 +1088,42 @@ static void Setvalue(consvar_t *var, const char *valstr, boolean stealth) if (var->PossibleValue[0].strvalue && !stricmp(var->PossibleValue[0].strvalue, "MIN")) // bounded cvar { +#define MINVAL 0 +#define MAXVAL 1 INT32 i; - // search for maximum - for (i = 1; var->PossibleValue[i].strvalue; i++) - if (!stricmp(var->PossibleValue[i].strvalue, "MAX")) - break; + #ifdef PARANOIA - if (!var->PossibleValue[i].strvalue) + if (!var->PossibleValue[MAXVAL].strvalue) I_Error("Bounded cvar \"%s\" without maximum!\n", var->name); #endif - if ((v != INT32_MIN && v < var->PossibleValue[0].value) || !stricmp(valstr, "MIN")) + // search for other + for (i = MAXVAL+1; var->PossibleValue[i].strvalue; i++) + if (!stricmp(var->PossibleValue[i].strvalue, valstr)) + { + var->value = var->PossibleValue[i].value; + var->string = var->PossibleValue[i].strvalue; + goto finish; + } + + if ((v != INT32_MIN && v < var->PossibleValue[MINVAL].value) || !stricmp(valstr, "MIN")) { - v = var->PossibleValue[0].value; - valstr = var->PossibleValue[0].strvalue; + v = var->PossibleValue[MINVAL].value; + valstr = var->PossibleValue[MINVAL].strvalue; override = true; overrideval = v; } - else if ((v != INT32_MIN && v > var->PossibleValue[i].value) || !stricmp(valstr, "MAX")) + else if ((v != INT32_MIN && v > var->PossibleValue[MAXVAL].value) || !stricmp(valstr, "MAX")) { - v = var->PossibleValue[i].value; - valstr = var->PossibleValue[i].strvalue; + v = var->PossibleValue[MAXVAL].value; + valstr = var->PossibleValue[MAXVAL].strvalue; override = true; overrideval = v; } if (v == INT32_MIN) goto badinput; +#undef MINVAL +#undef MAXVAL } else { @@ -1453,7 +1463,6 @@ void CV_AddValue(consvar_t *var, INT32 increment) if (var->PossibleValue) { -#define MINVAL 0 if (var == &cv_nextmap) { // Special case for the nextmap variable, used only directly from the menu @@ -1490,21 +1499,40 @@ void CV_AddValue(consvar_t *var, INT32 increment) return; } } +#define MINVAL 0 +#define MAXVAL 1 else if (var->PossibleValue[MINVAL].strvalue && !strcmp(var->PossibleValue[MINVAL].strvalue, "MIN")) - { - // search the next to last - for (max = 0; var->PossibleValue[max+1].strvalue; max++) - ; + { // SRB2Kart +#ifdef PARANOIA + if (!var->PossibleValue[MAXVAL].strvalue) + I_Error("Bounded cvar \"%s\" without maximum!\n", var->name); +#endif - if (newvalue < var->PossibleValue[MINVAL].value) // add the max+1 - newvalue += var->PossibleValue[max].value - var->PossibleValue[MINVAL].value + 1; + if (newvalue < var->PossibleValue[MINVAL].value || newvalue > var->PossibleValue[MAXVAL].value) + { + INT32 currentindice = -1, newindice; + for (max = MAXVAL+1; var->PossibleValue[max].strvalue; max++) + if (var->PossibleValue[max].value == var->value) + currentindice = max; - newvalue = var->PossibleValue[MINVAL].value + (newvalue - var->PossibleValue[MINVAL].value) - % (var->PossibleValue[max].value - var->PossibleValue[MINVAL].value + 1); + if (currentindice == -1 && max != MAXVAL+1) + newindice = ((increment > 0) ? MAXVAL : max) + increment; + else + newindice = currentindice + increment; - CV_SetValue(var, newvalue); -#undef MINVAL + if (newindice >= max || newindice <= MAXVAL) + { + newvalue = var->PossibleValue[((increment > 0) ? MINVAL : MAXVAL)].value; + CV_SetValue(var, newvalue); + } + else + CV_Set(var, var->PossibleValue[newindice].strvalue); + } + else + CV_SetValue(var, newvalue); } +#undef MINVAL +#undef MAXVAL else { INT32 currentindice = -1, newindice; @@ -1514,8 +1542,6 @@ void CV_AddValue(consvar_t *var, INT32 increment) if (var->PossibleValue[max].value == var->value) currentindice = max; - max--; - if (var == &cv_chooseskin) { // Special case for the chooseskin variable, used only directly from the menu @@ -1578,7 +1604,7 @@ void CV_AddValue(consvar_t *var, INT32 increment) var->value); #endif - newindice = (currentindice + increment + max + 1) % (max+1); + newindice = (currentindice + increment + max) % max; CV_Set(var, var->PossibleValue[newindice].strvalue); } } diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 9ad7e4ba..fbd1dc6c 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -109,6 +109,7 @@ static void Color4_OnChange(void); static void DummyConsvar_OnChange(void); static void SoundTest_OnChange(void); +static void BaseNumLaps_OnChange(void); static void KartFrantic_OnChange(void); static void KartSpeed_OnChange(void); static void KartMirror_OnChange(void); @@ -408,10 +409,11 @@ consvar_t cv_pointlimit = {"pointlimit", "0", CV_NETVAR|CV_CALL|CV_NOINIT, point static CV_PossibleValue_t timelimit_cons_t[] = {{0, "MIN"}, {30, "MAX"}, {0, NULL}}; consvar_t cv_timelimit = {"timelimit", "0", CV_NETVAR|CV_CALL|CV_NOINIT, timelimit_cons_t, TimeLimit_OnChange, 0, NULL, NULL, 0, 0, NULL}; -static CV_PossibleValue_t numlaps_cons_t[] = {{0, "MIN"}, {50, "MAX"}, {0, NULL}}; +static CV_PossibleValue_t numlaps_cons_t[] = {{1, "MIN"}, {50, "MAX"}, {0, NULL}}; consvar_t cv_numlaps = {"numlaps", "3", CV_NETVAR|CV_CALL|CV_NOINIT, numlaps_cons_t, NumLaps_OnChange, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_usemapnumlaps = {"usemaplaps", "Yes", CV_NETVAR|CV_CHEAT, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; +static CV_PossibleValue_t basenumlaps_cons_t[] = {{1, "MIN"}, {50, "MAX"}, {0, "Map default"}, {0, NULL}}; +consvar_t cv_basenumlaps = {"basenumlaps", "Map default", CV_NETVAR|CV_CALL|CV_CHEAT, basenumlaps_cons_t, BaseNumLaps_OnChange, 0, NULL, NULL, 0, 0, NULL}; // log elemental hazards -- not a netvar, is local to current player consvar_t cv_hazardlog = {"hazardlog", "Yes", 0, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -585,7 +587,7 @@ void D_RegisterServerCommands(void) CV_RegisterVar(&cv_friendlyfire); CV_RegisterVar(&cv_pointlimit); CV_RegisterVar(&cv_numlaps); - CV_RegisterVar(&cv_usemapnumlaps); + CV_RegisterVar(&cv_basenumlaps); CV_RegisterVar(&cv_hazardlog); @@ -5197,6 +5199,18 @@ static void Command_ShowTime_f(void) } // SRB2Kart: On change messages +static void BaseNumLaps_OnChange(void) +{ + if (gamestate == GS_LEVEL) + { + if (cv_basenumlaps.value) + CONS_Printf(M_GetText("Number of laps will be changed to map defaults next round.\n")); + else + CONS_Printf(M_GetText("Number of laps will be changed to %d next round.\n"), cv_basenumlaps.value); + } +} + + static void KartFrantic_OnChange(void) { if (cv_kartfrantic.value != franticitems && gamestate == GS_LEVEL) diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 78815cb1..50b03a9d 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -77,7 +77,7 @@ extern consvar_t cv_friendlyfire; extern consvar_t cv_pointlimit; extern consvar_t cv_timelimit; extern consvar_t cv_numlaps; -extern consvar_t cv_usemapnumlaps; +extern consvar_t cv_basenumlaps; extern UINT32 timelimitintics; extern consvar_t cv_allowexitlevel; diff --git a/src/m_menu.c b/src/m_menu.c index e77c0a1b..3b16c678 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1452,16 +1452,15 @@ static menuitem_t OP_GameOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "Frantic Items", &cv_kartfrantic, 40}, {IT_STRING | IT_CVAR, NULL, "Mirror Mode", &cv_kartmirror, 50}, - {IT_STRING | IT_CVAR, NULL, "Number of Laps", &cv_numlaps, 70}, - {IT_STRING | IT_CVAR, NULL, "Use Default Lap Counts", &cv_usemapnumlaps, 80}, - {IT_STRING | IT_CVAR, NULL, "Exit Countdown Timer", &cv_countdowntime, 90}, + {IT_STRING | IT_CVAR, NULL, "Number of Laps", &cv_basenumlaps, 70}, + {IT_STRING | IT_CVAR, NULL, "Exit Countdown Timer", &cv_countdowntime, 80}, - //{IT_STRING | IT_CVAR, NULL, "Time Limit", &cv_timelimit, 110}, - {IT_STRING | IT_CVAR, NULL, "Starting Balloons", &cv_kartballoons, 110}, - {IT_STRING | IT_CVAR, NULL, "Karma Comeback", &cv_kartcomeback, 120}, + //{IT_STRING | IT_CVAR, NULL, "Time Limit", &cv_timelimit, 100}, + {IT_STRING | IT_CVAR, NULL, "Starting Balloons", &cv_kartballoons, 100}, + {IT_STRING | IT_CVAR, NULL, "Karma Comeback", &cv_kartcomeback, 110}, - {IT_STRING | IT_CVAR, NULL, "Force Character #", &cv_forceskin, 140}, - {IT_STRING | IT_CVAR, NULL, "Restrict Character Changes", &cv_restrictskinchange, 150}, + {IT_STRING | IT_CVAR, NULL, "Force Character #", &cv_forceskin, 130}, + {IT_STRING | IT_CVAR, NULL, "Restrict Character Changes", &cv_restrictskinchange, 140}, }; static menuitem_t OP_ServerOptionsMenu[] = diff --git a/src/p_setup.c b/src/p_setup.c index 0d646edc..a3939a38 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2875,8 +2875,11 @@ boolean P_SetupLevel(boolean skipprecip) CONS_Printf(M_GetText("No player currently available to become IT. Awaiting available players.\n")); } - else if (G_RaceGametype() && server && cv_usemapnumlaps.value) - CV_StealthSetValue(&cv_numlaps, mapheaderinfo[gamemap - 1]->numlaps); + else if (G_RaceGametype() && server) + CV_StealthSetValue(&cv_numlaps, + (cv_basenumlaps.value) + ? cv_basenumlaps.value + : mapheaderinfo[gamemap - 1]->numlaps); // =========== // landing point for netgames. From 754a7daa993c761466879e3ffd55a7d909d53061 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Fri, 29 Jun 2018 20:15:42 -0400 Subject: [PATCH 102/293] GO! interupts the start ambience --- src/k_kart.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 48dddaee..5348dc13 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3706,14 +3706,20 @@ void K_MoveKartPlayer(player_t *player, boolean onground) if ((leveltime == starttime-(3*TICRATE)) || (leveltime == starttime-(2*TICRATE)) || (leveltime == starttime-TICRATE)) S_StartSound(NULL, sfx_s3ka7); if (leveltime == starttime) + { S_StartSound(NULL, sfx_s3kad); + S_StopMusic(); // The GO! sound stops the level start ambience + } } // Start charging once you're given the opportunity. - if (leveltime >= starttime-(2*TICRATE) && leveltime <= starttime && cmd->buttons & BT_ACCELERATE) - player->kartstuff[k_boostcharge]++; - if (leveltime >= starttime-(2*TICRATE) && leveltime <= starttime && !(cmd->buttons & BT_ACCELERATE)) - player->kartstuff[k_boostcharge] = 0; + if (leveltime >= starttime-(2*TICRATE) && leveltime <= starttime) + { + if (cmd->buttons & BT_ACCELERATE) + player->kartstuff[k_boostcharge]++; + else + player->kartstuff[k_boostcharge] = 0; + } // Increase your size while charging your engine. if (leveltime < starttime+10) From 0ba127c435b94f11f3e9d5d7203b53420c8feaff Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Fri, 29 Jun 2018 22:17:36 -0400 Subject: [PATCH 103/293] Unused vars --- src/d_netcmd.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index fbd1dc6c..2229c11e 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -4040,9 +4040,6 @@ static void Command_ModDetails_f(void) // static void Command_ShowGametype_f(void) { - INT32 j; - const char *gametypestr = NULL; - if (!(netgame || multiplayer)) // print "Single player" instead of "Race" { CONS_Printf(M_GetText("Current gametype is %s\n"), "Single Player"); From ba779c665780f6195b0667bfce8e773bb3c95a00 Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 30 Jun 2018 16:01:03 +0100 Subject: [PATCH 104/293] * Completely revamp a bunch of menu stuff! * Improve control menus significantly - a more layout-neutral, gameplay importance based order, with spacing, and less depth to get to the important stuff. * Port over the improved MP main menu from internal, including flattening the IP connect onto its level. * Allow for selecting the number of splitscreen players using a menu option, rather than three seperate menu choices. * Improve the layout of all of the level/gametype select menus slightly. * (unrelated) Make fourth player area in 3p splitscreen use the tiling background instead of a pure black area. * (unrelated) Tweak minimap ordering slightly. --- src/k_kart.c | 49 ++-- src/m_menu.c | 657 ++++++++++++++++++++++++++----------------------- src/m_menu.h | 4 +- src/r_main.c | 21 +- src/st_stuff.c | 30 +-- 5 files changed, 411 insertions(+), 350 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 48dddaee..75fa07eb 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4885,6 +4885,7 @@ static void K_drawKartMinimap(void) INT32 i = 0; INT32 x, y; INT32 minimaptrans, splitflags = (splitscreen ? 0 : V_SNAPTORIGHT); + boolean dop1later = false; // Draw the HUD only when playing in a level. // hu_stuff needs this, unlike st_stuff. @@ -4936,37 +4937,39 @@ static void K_drawKartMinimap(void) x -= SHORT(AutomapPic->leftoffset); y -= SHORT(AutomapPic->topoffset); - // Player's tiny icons on the Automap. - for (i = 0; i < MAXPLAYERS; i++) + // Player's tiny icons on the Automap. (drawn opposite direction so player 1 is drawn last in splitscreen) + for (i = MAXPLAYERS-1; i >= 0; i--) { - if (i == displayplayer && !splitscreen) - continue; // Do displayplayer later - if (players[i].mo && !players[i].spectator) + if (!playeringame[i]) + continue; + if (!players[i].mo || players[i].spectator) + continue; + + if (!splitscreen && i == displayplayer) { - if (G_BattleGametype() && players[i].kartstuff[k_balloon] <= 0) - continue; - - if (players[i].kartstuff[k_hyudorotimer] > 0) - { - if ((players[i].kartstuff[k_hyudorotimer] < 1*TICRATE/2 - || players[i].kartstuff[k_hyudorotimer] > hyudorotime-(1*TICRATE/2)) - && !(leveltime & 1)) - ; - else - continue; - } - - K_drawKartMinimapHead(&players[i], x, y, splitflags, AutomapPic); + dop1later = true; // Do displayplayer later + continue; } + + if (G_BattleGametype() && players[i].kartstuff[k_balloon] <= 0) + continue; + if (players[i].kartstuff[k_hyudorotimer] > 0) + { + if (!((players[i].kartstuff[k_hyudorotimer] < 1*TICRATE/2 + || players[i].kartstuff[k_hyudorotimer] > hyudorotime-(1*TICRATE/2)) + && !(leveltime & 1))) + continue; + } + + K_drawKartMinimapHead(&players[i], x, y, splitflags, AutomapPic); } - if (splitscreen) - return; // Don't need this for splits + if (!dop1later) + return; // Don't need this splitflags &= ~V_HUDTRANSHALF; splitflags |= V_HUDTRANS; - if (stplyr->mo && !stplyr->spectator) - K_drawKartMinimapHead(stplyr, x, y, splitflags, AutomapPic); + K_drawKartMinimapHead(stplyr, x, y, splitflags, AutomapPic); } static void K_drawBattleFullscreen(void) diff --git a/src/m_menu.c b/src/m_menu.c index 3b16c678..064487b9 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -259,13 +259,8 @@ static menu_t SP_TimeAttackDef, SP_ReplayDef, SP_GuestReplayDef, SP_GhostDef; #ifndef NONET static void M_StartServerMenu(INT32 choice); static void M_ConnectMenu(INT32 choice); -static void M_ConnectIPMenu(INT32 choice); #endif static void M_StartSplitServerMenu(INT32 choice); -#ifndef NOFOURPLAYER -static void M_Start3PServerMenu(INT32 choice); -static void M_Start4PServerMenu(INT32 choice); -#endif static void M_StartServer(INT32 choice); #ifndef NONET static void M_Refresh(INT32 choice); @@ -284,11 +279,9 @@ static void M_SetupMultiPlayer4(INT32 choice); // Controls menu_t OP_ControlsDef, /*OP_ControlListDef,*/ OP_MoveControlsDef; menu_t /*OP_MPControlsDef, OP_CameraControlsDef, OP_MiscControlsDef,*/ OP_CustomControlsDef, OP_SpectateControlsDef; -menu_t OP_P1ControlsDef, OP_P2ControlsDef; menu_t OP_MouseOptionsDef, OP_Mouse2OptionsDef; menu_t OP_Joystick1Def, OP_Joystick2Def; #ifndef NOFOURPLAYER -menu_t OP_P3ControlsDef, OP_P4ControlsDef; menu_t OP_Joystick3Def, OP_Joystick4Def; #endif static void M_VideoModeMenu(INT32 choice); @@ -335,7 +328,7 @@ static void M_DrawChecklist(void); static void M_DrawEmblemHints(void); static void M_DrawPauseMenu(void); static void M_DrawServerMenu(void); -static void M_DrawLevelSelectMenu(void); +static void M_DrawSplitServerMenu(void); static void M_DrawImageDef(void); static void M_DrawLoad(void); static void M_DrawLevelStats(void); @@ -352,7 +345,7 @@ static void M_OGL_DrawColorMenu(void); #endif #ifndef NONET static void M_DrawConnectMenu(void); -static void M_DrawConnectIPMenu(void); +static void M_DrawMPMainMenu(void); static void M_DrawRoomMenu(void); #endif static void M_DrawJoystick(void); @@ -447,6 +440,10 @@ consvar_t cv_ghost_staff = {"ghost_staff", "Show", CV_SAVE, ghost2_cons_ //Console variables used solely in the menu system. //todo: add a way to use non-console variables in the menu // or make these consvars legitimate like color or skin. +static CV_PossibleValue_t dummysplitplayers_cons_t[] = {{2, "Two"}, {3, "Three"}, {4, "Four"}, {0, NULL}}; +#ifndef NOFOURPLAYER +static consvar_t cv_dummysplitplayers = {"dummysplitplayers", "Two", CV_HIDEN, dummysplitplayers_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +#endif static CV_PossibleValue_t dummyteam_cons_t[] = {{0, "Spectator"}, {1, "Red"}, {2, "Blue"}, {0, NULL}}; static CV_PossibleValue_t dummyscramble_cons_t[] = {{0, "Random"}, {1, "Points"}, {0, NULL}}; static CV_PossibleValue_t ringlimit_cons_t[] = {{0, "MIN"}, {9999, "MAX"}, {0, NULL}}; @@ -608,8 +605,8 @@ static menuitem_t MISC_ChangeTeamMenu[] = static menuitem_t MISC_ChangeLevelMenu[] = { - {IT_STRING|IT_CVAR, NULL, "Game Type", &cv_newgametype, 30}, - {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 60}, + {IT_STRING|IT_CVAR, NULL, "Game Type", &cv_newgametype, 68}, + {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 78}, {IT_WHITESTRING|IT_CALL, NULL, "Change Level", M_ChangeLevel, 120}, }; @@ -684,9 +681,8 @@ static menuitem_t SR_MainMenu[] = static menuitem_t SR_LevelSelectMenu[] = { - {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 60}, - - {IT_WHITESTRING|IT_CALL, NULL, "Start", M_LevelSelectWarp, 120}, + {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 78}, + {IT_WHITESTRING|IT_CALL, NULL, "Start", M_LevelSelectWarp, 130}, }; static menuitem_t SR_UnlockChecklistMenu[] = @@ -731,9 +727,8 @@ static menuitem_t SP_LoadGameMenu[] = // Single Player Level Select static menuitem_t SP_LevelSelectMenu[] = { - {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 60}, - - {IT_WHITESTRING|IT_CALL, NULL, "Start", M_LevelSelectWarp, 120}, + {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 78}, + {IT_WHITESTRING|IT_CALL, NULL, "Start", M_LevelSelectWarp, 130}, }; // Single Player Time Attack @@ -908,52 +903,72 @@ menuitem_t PlayerMenu[32] = // Multiplayer and all of its submenus // ----------------------------------- // Prefix: MP_ + +#ifdef NONET +#define IT_NETCALL IT_DISABLED +#define IT_NETHANDLER IT_DISABLED +#define M_StartServerMenu NULL +#define M_ConnectMenu NULL +#define M_HandleConnectIP NULL +#else +#define IT_NETCALL (IT_STRING|IT_CALL) +#define IT_NETHANDLER (IT_STRING|IT_KEYHANDLER) +#endif + static menuitem_t MP_MainMenu[] = { -#ifndef NONET - {IT_CALL | IT_STRING, NULL, "HOST GAME", M_StartServerMenu, 10}, - {IT_CALL | IT_STRING, NULL, "JOIN GAME (Search)", M_ConnectMenu, 30}, - {IT_CALL | IT_STRING, NULL, "JOIN GAME (Specify IP)", M_ConnectIPMenu, 40}, -#endif - - {IT_CALL | IT_STRING, NULL, "TWO PLAYER GAME", M_StartSplitServerMenu, 60}, - -#ifdef NOFOURPLAYER - {IT_CALL | IT_STRING, NULL, "SETUP PLAYER 1", M_SetupMultiPlayer, 80}, - {IT_CALL | IT_STRING, NULL, "SETUP PLAYER 2", M_SetupMultiPlayer2, 90}, -#else - {IT_CALL | IT_STRING, NULL, "THREE PLAYER GAME", M_Start3PServerMenu, 70}, - {IT_CALL | IT_STRING, NULL, "FOUR PLAYER GAME", M_Start4PServerMenu, 80}, - - {IT_CALL | IT_STRING, NULL, "SETUP PLAYER 1", M_SetupMultiPlayer, 100}, - {IT_CALL | IT_STRING, NULL, "SETUP PLAYER 2", M_SetupMultiPlayer2, 110}, - {IT_CALL | IT_STRING, NULL, "SETUP PLAYER 3", M_SetupMultiPlayer3, 120}, - {IT_CALL | IT_STRING, NULL, "SETUP PLAYER 4", M_SetupMultiPlayer4, 130}, + {IT_HEADER, NULL, "Host a game", NULL, 0}, + {IT_NETCALL, NULL, "Internet/LAN...", M_StartServerMenu, 10}, + {IT_STRING|IT_CALL, NULL, "Splitscreen...", M_StartSplitServerMenu, 18}, + {IT_HEADER, NULL, "Join a game", NULL, 32}, + {IT_NETCALL, NULL, "Server browser...", M_ConnectMenu, 42}, + {IT_NETHANDLER, NULL, "Specify IPv4 address:", M_HandleConnectIP, 50}, + {IT_HEADER, NULL, "Player setup", NULL, 80}, + {IT_STRING|IT_CALL, NULL, "Player 1...", M_SetupMultiPlayer, 90}, + {IT_STRING|IT_CALL, NULL, "Player 2... ", M_SetupMultiPlayer2, 98}, +#ifndef NOFOURPLAYER + {IT_STRING|IT_CALL, NULL, "Player 3...", M_SetupMultiPlayer3, 106}, + {IT_STRING|IT_CALL, NULL, "Player 4... ", M_SetupMultiPlayer4, 114}, #endif }; +#undef IT_NETCALL +#undef IT_NETHANDLER +#ifdef NONET +#undef M_StartServerMenu +#undef M_ConnectMenu +#undef M_HandleConnectIP +#endif + static menuitem_t MP_ServerMenu[] = { - {IT_STRING|IT_CVAR, NULL, "Game Type", &cv_newgametype, 10}, + {IT_STRING|IT_CVAR, NULL, "Game Type", &cv_newgametype, 10}, #ifndef NONET - {IT_STRING|IT_CALL, NULL, "Room...", M_RoomMenu, 20}, - {IT_STRING|IT_CVAR|IT_CV_STRING, NULL, "Server Name", &cv_servername, 30}, + {IT_STRING|IT_CALL, NULL, "Room...", M_RoomMenu, 20}, + {IT_STRING|IT_CVAR|IT_CV_STRING, NULL, "Server Name", &cv_servername, 30}, #endif - {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 80}, + {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 78}, - {IT_WHITESTRING|IT_CALL, NULL, "Start", M_StartServer, 130}, + {IT_WHITESTRING|IT_CALL, NULL, "Start", M_StartServer, 130}, }; -enum +// Separated splitscreen and normal servers. +static menuitem_t MP_SplitServerMenu[] = { - mp_server_gametype = 0, -#ifndef NONET - mp_server_room, - mp_server_name, + {IT_STRING|IT_CVAR, NULL, "Game Type", &cv_newgametype, 10}, +#ifndef NOFOURPLAYER + {IT_STRING|IT_CVAR, NULL, "Number of players", &cv_dummysplitplayers, 20}, #endif - mp_server_level, - mp_server_start + {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 78}, + {IT_WHITESTRING|IT_CALL, NULL, "Start", M_StartServer, 130}, +}; + +static menuitem_t MP_PlayerSetupMenu[] = +{ + {IT_KEYHANDLER | IT_STRING, NULL, "Name", M_HandleSetupMultiPlayer, 0}, + {IT_KEYHANDLER | IT_STRING, NULL, "Character", M_HandleSetupMultiPlayer, 16}, // Tails 01-18-2001 + {IT_KEYHANDLER | IT_STRING, NULL, "Color", M_HandleSetupMultiPlayer, 152}, }; #ifndef NONET @@ -1007,28 +1022,8 @@ static menuitem_t MP_RoomMenu[] = {IT_DISABLED, NULL, "", M_ChooseRoom, 153}, {IT_DISABLED, NULL, "", M_ChooseRoom, 162}, }; - -static menuitem_t MP_ConnectIPMenu[] = -{ - {IT_KEYHANDLER | IT_STRING, NULL, " IP Address:", M_HandleConnectIP, 0}, -}; #endif -// Separated splitscreen and normal servers. -static menuitem_t MP_SplitServerMenu[] = -{ - {IT_STRING|IT_CVAR, NULL, "Game Type", &cv_newgametype, 10}, - {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 80}, - {IT_WHITESTRING|IT_CALL, NULL, "Start", M_StartServer, 130}, -}; - -static menuitem_t MP_PlayerSetupMenu[] = -{ - {IT_KEYHANDLER | IT_STRING, NULL, "Name", M_HandleSetupMultiPlayer, 0}, - {IT_KEYHANDLER | IT_STRING, NULL, "Character", M_HandleSetupMultiPlayer, 16}, // Tails 01-18-2001 - {IT_KEYHANDLER | IT_STRING, NULL, "Color", M_HandleSetupMultiPlayer, 152}, -}; - // ------------------------------------ // Options and most (?) of its submenus // ------------------------------------ @@ -1052,113 +1047,61 @@ static menuitem_t OP_MainMenu[] = static menuitem_t OP_ControlsMenu[] = { - {IT_SUBMENU | IT_STRING, NULL, "Player 1 Controls...", &OP_P1ControlsDef, 10}, - {IT_SUBMENU | IT_STRING, NULL, "Player 2 Controls...", &OP_P2ControlsDef, 20}, + {IT_CALL | IT_STRING, NULL, "Player 1 Controls...", M_Setup1PControlsMenu, 10}, + {IT_CALL | IT_STRING, NULL, "Player 2 Controls...", M_Setup2PControlsMenu, 20}, #ifdef NOFOURPLAYER {IT_STRING | IT_CVAR, NULL, "Controls per key", &cv_controlperkey, 40}, #else - {IT_SUBMENU | IT_STRING, NULL, "Player 3 Controls...", &OP_P3ControlsDef, 30}, - {IT_SUBMENU | IT_STRING, NULL, "Player 4 Controls...", &OP_P4ControlsDef, 40}, + {IT_CALL | IT_STRING, NULL, "Player 3 Controls...", &M_Setup3PControlsMenu, 30}, + {IT_CALL | IT_STRING, NULL, "Player 4 Controls...", &M_Setup4PControlsMenu, 40}, {IT_STRING | IT_CVAR, NULL, "Controls per key", &cv_controlperkey, 60}, #endif }; -static menuitem_t OP_P1ControlsMenu[] = -{ - {IT_CALL | IT_STRING, NULL, "Control Configuration...", M_Setup1PControlsMenu, 10}, - //{IT_SUBMENU | IT_STRING, NULL, "Mouse Options...", &OP_MouseOptionsDef, 20}, - {IT_SUBMENU | IT_STRING, NULL, "Joystick Options...", &OP_Joystick1Def , 20}, - - {IT_STRING | IT_CVAR, NULL, "Camera" , &cv_chasecam , 40}, - {IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair , 50}, - - //{IT_STRING | IT_CVAR, NULL, "Analog Control", &cv_useranalog, 80}, -}; - -static menuitem_t OP_P2ControlsMenu[] = -{ - {IT_CALL | IT_STRING, NULL, "Control Configuration...", M_Setup2PControlsMenu, 10}, - //{IT_SUBMENU | IT_STRING, NULL, "Second Mouse Options...", &OP_Mouse2OptionsDef, 20}, - {IT_SUBMENU | IT_STRING, NULL, "Second Joystick Options...", &OP_Joystick2Def , 20}, - - {IT_STRING | IT_CVAR, NULL, "Camera" , &cv_chasecam2 , 40}, - {IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair2, 50}, - - //{IT_STRING | IT_CVAR, NULL, "Analog Control", &cv_useranalog2, 70}, -}; - -#ifndef NOFOURPLAYER -static menuitem_t OP_P3ControlsMenu[] = -{ - {IT_CALL | IT_STRING, NULL, "Control Configuration...", M_Setup3PControlsMenu, 10}, - {IT_SUBMENU | IT_STRING, NULL, "Third Joystick Options...", &OP_Joystick3Def , 20}, - - {IT_STRING | IT_CVAR, NULL, "Camera" , &cv_chasecam3 , 40}, - {IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair3, 50}, - - //{IT_STRING | IT_CVAR, NULL, "Analog Control", &cv_useranalog3, 60}, -}; - -static menuitem_t OP_P4ControlsMenu[] = -{ - {IT_CALL | IT_STRING, NULL, "Control Configuration...", M_Setup4PControlsMenu, 10}, - {IT_SUBMENU | IT_STRING, NULL, "Fourth Joystick Options...", &OP_Joystick4Def , 20}, - - {IT_STRING | IT_CVAR, NULL, "Camera" , &cv_chasecam4 , 40}, - {IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair4, 50}, - - //{IT_STRING | IT_CVAR, NULL, "Analog Control", &cv_useranalog4, 60}, -}; -#endif - -/*static menuitem_t OP_ControlListMenu[] = -{ - {IT_SUBMENU | IT_STRING, NULL, "Kart Controls...", &OP_MoveControlsDef, 10}, -// {IT_SUBMENU | IT_STRING, NULL, "Multiplayer Controls...", &OP_MPControlsDef, 20}, -// {IT_SUBMENU | IT_STRING, NULL, "Camera Controls...", &OP_CameraControlsDef, 20}, -// {IT_SUBMENU | IT_STRING, NULL, "Miscellaneous Controls...", &OP_MiscControlsDef, 20}, -};*/ - static menuitem_t OP_MoveControlsMenu[] = { - {IT_CALL | IT_STRING2, NULL, "Aim Forward", M_ChangeControl, gc_aimforward }, - {IT_CALL | IT_STRING2, NULL, "Aim Backward", M_ChangeControl, gc_aimbackward}, - {IT_CALL | IT_STRING2, NULL, "Turn Left", M_ChangeControl, gc_turnleft }, - {IT_CALL | IT_STRING2, NULL, "Turn Right", M_ChangeControl, gc_turnright }, - {IT_CALL | IT_STRING2, NULL, "Accelerate", M_ChangeControl, gc_accelerate }, - {IT_CALL | IT_STRING2, NULL, "Drift", M_ChangeControl, gc_drift }, - {IT_CALL | IT_STRING2, NULL, "Brake", M_ChangeControl, gc_brake }, - {IT_CALL | IT_STRING2, NULL, "Use/Throw Item", M_ChangeControl, gc_fire }, - {IT_CALL | IT_STRING2, NULL, "Look Backward", M_ChangeControl, gc_lookback }, + {IT_CONTROL, NULL, "Accelerate", M_ChangeControl, gc_accelerate }, + {IT_CONTROL, NULL, "Turn Left", M_ChangeControl, gc_turnleft }, + {IT_CONTROL, NULL, "Turn Right", M_ChangeControl, gc_turnright }, + {IT_CONTROL, NULL, "Drift", M_ChangeControl, gc_drift }, + {IT_CONTROL, NULL, "Brake", M_ChangeControl, gc_brake }, + {IT_CONTROL, NULL, "Use/Throw Item", M_ChangeControl, gc_fire }, + {IT_CONTROL, NULL, "Aim Forward", M_ChangeControl, gc_aimforward }, + {IT_CONTROL, NULL, "Aim Backward", M_ChangeControl, gc_aimbackward}, + {IT_CONTROL, NULL, "Look Backward", M_ChangeControl, gc_lookback }, - {IT_CALL | IT_STRING2, NULL, "Talk key", M_ChangeControl, gc_talkkey }, - {IT_CALL | IT_STRING2, NULL, "Team-Talk key", M_ChangeControl, gc_teamkey }, - {IT_CALL | IT_STRING2, NULL, "Rankings/Scores", M_ChangeControl, gc_scores }, + {IT_SPACE, NULL, "", NULL, 76}, + {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, "Pause", M_ChangeControl, gc_pause }, + {IT_CONTROL, NULL, "Console", M_ChangeControl, gc_console }, - {IT_CALL | IT_STRING2, NULL, "Pause", M_ChangeControl, gc_pause }, - {IT_CALL | IT_STRING2, NULL, "Console", M_ChangeControl, gc_console }, - - {IT_SUBMENU | IT_STRING, NULL, "Spectator Controls...", &OP_SpectateControlsDef, 112}, - {IT_SUBMENU | IT_STRING, NULL, "Custom Lua Actions...", &OP_CustomControlsDef, 120}, + {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}, }; static menuitem_t OP_SpectateControlsMenu[] = { - {IT_CALL | IT_STRING2, NULL, "Spectate", M_ChangeControl, gc_spectate }, - {IT_CALL | IT_STRING2, NULL, "Look Up", M_ChangeControl, gc_lookup }, - {IT_CALL | IT_STRING2, NULL, "Look Down", M_ChangeControl, gc_lookdown }, - {IT_CALL | IT_STRING2, NULL, "Center View", M_ChangeControl, gc_centerview}, - {IT_CALL | IT_STRING2, NULL, "Reset Camera", M_ChangeControl, gc_camreset }, - {IT_CALL | IT_STRING2, NULL, "Toggle Chasecam", M_ChangeControl, gc_camtoggle }, + {IT_CONTROL, NULL, "Become Spectator", M_ChangeControl, gc_spectate }, + {IT_CONTROL, NULL, "Look Up", M_ChangeControl, gc_lookup }, + {IT_CONTROL, NULL, "Look Down", M_ChangeControl, gc_lookdown }, + {IT_CONTROL, NULL, "Center View", M_ChangeControl, gc_centerview}, + {IT_CONTROL, NULL, "Reset Camera", M_ChangeControl, gc_camreset }, + {IT_CONTROL, NULL, "Toggle Chasecam", M_ChangeControl, gc_camtoggle }, + + {IT_STRING | IT_CVAR, NULL, "Chasecam" , &cv_chasecam , 52}, + {IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair, 60}, }; static menuitem_t OP_CustomControlsMenu[] = { - {IT_CALL | IT_STRING2, NULL, "Custom Action 1", M_ChangeControl, gc_custom1}, - {IT_CALL | IT_STRING2, NULL, "Custom Action 2", M_ChangeControl, gc_custom2}, - {IT_CALL | IT_STRING2, NULL, "Custom Action 3", M_ChangeControl, gc_custom3}, + {IT_CONTROL, NULL, "Custom Action 1", M_ChangeControl, gc_custom1}, + {IT_CONTROL, NULL, "Custom Action 2", M_ChangeControl, gc_custom2}, + {IT_CONTROL, NULL, "Custom Action 3", M_ChangeControl, gc_custom3}, }; // Obsolete thanks to Kart @@ -1200,7 +1143,7 @@ static menuitem_t OP_MiscControlsMenu[] = static menuitem_t OP_Joystick1Menu[] = { - {IT_STRING | IT_CALL, NULL, "Select Joystick..." , M_Setup1PJoystickMenu, 10}, + {IT_STRING | IT_CALL, NULL, "Select Gamepad..." , M_Setup1PJoystickMenu, 10}, {IT_STRING | IT_CVAR, NULL, "Aim Forward/Back" , &cv_aimaxis , 30}, {IT_STRING | IT_CVAR, NULL, "Turn Left/Right" , &cv_turnaxis , 40}, {IT_STRING | IT_CVAR, NULL, "Accelerate" , &cv_moveaxis , 50}, @@ -1212,7 +1155,7 @@ static menuitem_t OP_Joystick1Menu[] = static menuitem_t OP_Joystick2Menu[] = { - {IT_STRING | IT_CALL, NULL, "Select Joystick..." , M_Setup2PJoystickMenu, 10}, + {IT_STRING | IT_CALL, NULL, "Select Gamepad..." , M_Setup2PJoystickMenu, 10}, {IT_STRING | IT_CVAR, NULL, "Aim Forward/Back" , &cv_aimaxis2 , 30}, {IT_STRING | IT_CVAR, NULL, "Turn Left/Right" , &cv_turnaxis2 , 40}, {IT_STRING | IT_CVAR, NULL, "Accelerate" , &cv_moveaxis2 , 50}, @@ -1225,7 +1168,7 @@ static menuitem_t OP_Joystick2Menu[] = #ifndef NOFOURPLAYER static menuitem_t OP_Joystick3Menu[] = { - {IT_STRING | IT_CALL, NULL, "Select Joystick..." , M_Setup3PJoystickMenu, 10}, + {IT_STRING | IT_CALL, NULL, "Select Gamepad..." , M_Setup3PJoystickMenu, 10}, {IT_STRING | IT_CVAR, NULL, "Aim Forward/Back" , &cv_aimaxis3 , 30}, {IT_STRING | IT_CVAR, NULL, "Turn Left/Right" , &cv_turnaxis3 , 40}, {IT_STRING | IT_CVAR, NULL, "Accelerate" , &cv_moveaxis3 , 50}, @@ -1237,7 +1180,7 @@ static menuitem_t OP_Joystick3Menu[] = static menuitem_t OP_Joystick4Menu[] = { - {IT_STRING | IT_CALL, NULL, "Select Joystick..." , M_Setup4PJoystickMenu, 10}, + {IT_STRING | IT_CALL, NULL, "Select Gamepad..." , M_Setup4PJoystickMenu, 10}, {IT_STRING | IT_CVAR, NULL, "Aim Forward/Back" , &cv_aimaxis4 , 30}, {IT_STRING | IT_CVAR, NULL, "Turn Left/Right" , &cv_turnaxis4 , 40}, {IT_STRING | IT_CVAR, NULL, "Accelerate" , &cv_moveaxis4 , 50}, @@ -1259,7 +1202,7 @@ static menuitem_t OP_JoystickSetMenu[] = {IT_CALL | IT_NOTHING, "", NULL, M_AssignJoystick, '6'}, }; -static menuitem_t OP_MouseOptionsMenu[] = +/*static menuitem_t OP_MouseOptionsMenu[] = { {IT_STRING | IT_CVAR, NULL, "Use Mouse", &cv_usemouse, 10}, @@ -1285,7 +1228,7 @@ static menuitem_t OP_Mouse2OptionsMenu[] = NULL, "Mouse X Speed", &cv_mousesens2, 60}, {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Mouse Y Speed", &cv_mouseysens2, 70}, -}; +};*/ static menuitem_t OP_VideoOptionsMenu[] = { @@ -1300,13 +1243,13 @@ static menuitem_t OP_VideoOptionsMenu[] = NULL, "Gamma", &cv_usegamma, 50}, {IT_STRING | IT_CVAR, NULL, "Draw Distance", &cv_drawdist, 70}, - {IT_STRING | IT_CVAR, NULL, "NiGHTS Draw Dist", &cv_drawdist_nights, 80}, - {IT_STRING | IT_CVAR, NULL, "Precip Draw Dist", &cv_drawdist_precip, 90}, - {IT_STRING | IT_CVAR, NULL, "Precip Density", &cv_precipdensity, 100}, - {IT_STRING | IT_CVAR, NULL, "Skyboxes", &cv_skybox, 110}, + //{IT_STRING | IT_CVAR, NULL, "NiGHTS Draw Dist", &cv_drawdist_nights, 80}, + {IT_STRING | IT_CVAR, NULL, "Weather Draw Dist.", &cv_drawdist_precip, 80}, + {IT_STRING | IT_CVAR, NULL, "Weather Density", &cv_precipdensity, 90}, + {IT_STRING | IT_CVAR, NULL, "Skyboxes", &cv_skybox, 100}, - {IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 130}, - {IT_STRING | IT_CVAR, NULL, "Vertical Sync", &cv_vidwait, 140}, + {IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 120}, + {IT_STRING | IT_CVAR, NULL, "Vertical Sync", &cv_vidwait, 130}, }; static menuitem_t OP_VideoModeMenu[] = @@ -1581,17 +1524,9 @@ menu_t SR_MainDef = 0, NULL }; -menu_t SR_LevelSelectDef = -{ - 0, - sizeof (SR_LevelSelectMenu)/sizeof (menuitem_t), - &SR_MainDef, - SR_LevelSelectMenu, - M_DrawLevelSelectMenu, - 40, 40, - 0, - NULL -}; + +menu_t SR_LevelSelectDef = MAPICONMENUSTYLE(NULL, SR_LevelSelectMenu, &SR_MainDef); + menu_t SR_UnlockChecklistDef = { NULL, @@ -1757,8 +1692,30 @@ menu_t SP_PlayerDef = }; // Multiplayer -menu_t MP_MainDef = DEFAULTMENUSTYLE("M_MULTI", MP_MainMenu, &MainDef, 60, 40); +menu_t MP_MainDef = +{ + "M_MULTI", + sizeof (MP_MainMenu)/sizeof (menuitem_t), + &MainDef, + MP_MainMenu, + M_DrawMPMainMenu, + 42, 40, + 0, + M_CancelConnect +}; menu_t MP_ServerDef = MAPICONMENUSTYLE("M_MULTI", MP_ServerMenu, &MP_MainDef); +//menu_t MP_SplitServerDef = MAPICONMENUSTYLE("M_MULTI", MP_SplitServerMenu, &MP_MainDef); +menu_t MP_SplitServerDef = +{ + "M_MULTI", + sizeof (MP_SplitServerMenu)/sizeof (menuitem_t), + &MP_MainDef, + MP_SplitServerMenu, + M_DrawSplitServerMenu, + 42,40, + 0, + NULL +}; #ifndef NONET menu_t MP_ConnectDef = { @@ -1771,17 +1728,6 @@ menu_t MP_ConnectDef = 0, M_CancelConnect }; -menu_t MP_ConnectIPDef = -{ - "M_MULTI", - sizeof (MP_ConnectIPMenu)/sizeof (menuitem_t), - &MP_MainDef, - MP_ConnectIPMenu, - M_DrawConnectIPMenu, - 27,40, - 0, - M_CancelConnect -}; menu_t MP_RoomDef = { "M_MULTI", @@ -1794,9 +1740,6 @@ menu_t MP_RoomDef = NULL }; #endif -menu_t MP_SplitServerDef = MAPICONMENUSTYLE("M_MULTI", MP_SplitServerMenu, &MP_MainDef); -menu_t MP_3PServerDef = MAPICONMENUSTYLE("M_MULTI", MP_SplitServerMenu, &MP_MainDef); -menu_t MP_4PServerDef = MAPICONMENUSTYLE("M_MULTI", MP_SplitServerMenu, &MP_MainDef); menu_t MP_PlayerSetupDef = { NULL, //"M_SPLAYR" @@ -1830,6 +1773,7 @@ menu_t OP_MoveControlsDef = CONTROLMENUSTYLE(OP_MoveControlsMenu, &OP_ControlsDe //menu_t OP_MiscControlsDef = CONTROLMENUSTYLE(OP_MiscControlsMenu, &OP_ControlListDef); menu_t OP_CustomControlsDef = CONTROLMENUSTYLE(OP_CustomControlsMenu, &OP_MoveControlsDef); menu_t OP_SpectateControlsDef = CONTROLMENUSTYLE(OP_SpectateControlsMenu, &OP_MoveControlsDef); +/* menu_t OP_P1ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_P1ControlsMenu, &OP_ControlsDef, 60, 30); menu_t OP_P2ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_P2ControlsMenu, &OP_ControlsDef, 60, 30); #ifndef NOFOURPLAYER @@ -1838,11 +1782,12 @@ menu_t OP_P4ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_P4ControlsMenu, &OP_Co #endif menu_t OP_MouseOptionsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_MouseOptionsMenu, &OP_P1ControlsDef, 60, 30); menu_t OP_Mouse2OptionsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_Mouse2OptionsMenu, &OP_P2ControlsDef, 60, 30); -menu_t OP_Joystick1Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick1Menu, &OP_P1ControlsDef, 60, 30); -menu_t OP_Joystick2Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick2Menu, &OP_P2ControlsDef, 60, 30); +*/ +menu_t OP_Joystick1Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick1Menu, &OP_MoveControlsDef, 60, 30); +menu_t OP_Joystick2Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick2Menu, &OP_MoveControlsDef, 60, 30); #ifndef NOFOURPLAYER -menu_t OP_Joystick3Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick3Menu, &OP_P3ControlsDef, 60, 30); -menu_t OP_Joystick4Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick4Menu, &OP_P4ControlsDef, 60, 30); +menu_t OP_Joystick3Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick3Menu, &OP_MoveControlsDef, 60, 30); +menu_t OP_Joystick4Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick4Menu, &OP_MoveControlsDef, 60, 30); #endif menu_t OP_JoystickSetDef = { @@ -2959,6 +2904,9 @@ void M_Init(void) return; // Menu hacks +#ifndef NOFOURPLAYER + CV_RegisterVar(&cv_dummysplitplayers); +#endif CV_RegisterVar(&cv_dummyteam); CV_RegisterVar(&cv_dummyscramble); CV_RegisterVar(&cv_dummyrings); @@ -3091,7 +3039,7 @@ static void M_DrawSlider(INT32 x, INT32 y, const consvar_t *cv) // draw the slider cursor p = W_CachePatchName("M_SLIDEC", PU_CACHE); - V_DrawMappedPatch(x + ((SLIDER_RANGE-1)*8*range)/100, y, 0, p, yellowmap); + V_DrawMappedPatch(x - 4 + (((SLIDER_RANGE)*8 + 4)*range)/100, y, 0, p, yellowmap); } // @@ -3284,7 +3232,7 @@ static void M_DrawGenericMenu(void) /* FALLTHRU */ case IT_NOTHING: case IT_DYBIGSPACE: - y += LINEHEIGHT; + y = currentMenu->y+currentMenu->menuitems[i].alphaKey;//+= LINEHEIGHT; break; case IT_BIGSLIDER: M_DrawThermo(x, y, (consvar_t *)currentMenu->menuitems[i].itemaction); @@ -4439,27 +4387,6 @@ static void M_DrawEmblemHints(void) M_DrawGenericMenu(); } -static void M_DrawLevelSelectMenu(void) -{ - M_DrawGenericMenu(); - - if (cv_nextmap.value) - { - lumpnum_t lumpnum; - patch_t *PictureOfLevel; - - // A 160x100 image of the level as entry MAPxxP - lumpnum = W_CheckNumForName(va("%sP", G_BuildMapName(cv_nextmap.value))); - - if (lumpnum != LUMPERROR) - PictureOfLevel = W_CachePatchName(va("%sP", G_BuildMapName(cv_nextmap.value)), PU_CACHE); - else - PictureOfLevel = W_CachePatchName("BLANKLVL", PU_CACHE); - - V_DrawSmallScaledPatch(200, 110, 0, PictureOfLevel); - } -} - static void M_DrawSkyRoom(void) { INT32 i, y = 0; @@ -6578,15 +6505,16 @@ static void M_StartServer(INT32 choice) { UINT8 ssplayers = 0; - if (currentMenu == &MP_SplitServerDef) - ssplayers = 1; - else if (currentMenu == &MP_3PServerDef) - ssplayers = 2; - else if (currentMenu == &MP_4PServerDef) - ssplayers = 3; - (void)choice; - if (ssplayers < 2) + + if (currentMenu == &MP_SplitServerDef) + ssplayers = +#ifdef NOFOURPLAYER + 1; +#else + cv_dummysplitplayers.value-1; +#endif + else netgame = true; multiplayer = true; @@ -6632,23 +6560,18 @@ static void M_DrawServerMenu(void) // Room name if (currentMenu == &MP_ServerDef) { +#define mp_server_room 1 if (ms_RoomId < 0) V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, currentMenu->y + MP_ServerMenu[mp_server_room].alphaKey, V_YELLOWMAP, (itemOn == mp_server_room) ? "" : ""); + highlightflags, (itemOn == mp_connect_room) ? "" : ""); + highlightflags, (itemOn == mp_server_room) ? "" : ""); - else - V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, currentMenu->y + MP_ServerMenu[mp_server_room].alphaKey, - highlightflags, room_list[menuRoomIndex].name); -#undef mp_server_room - } -#endif - + INT32 x, y, w, i, oldval, trans = 0, dupadjust = ((vid.width/vid.dupx) - BASEVIDWIDTH)>>1; // A 160x100 image of the level as entry MAPxxP lumpnum = W_CheckNumForName(va("%sP", G_BuildMapName(cv_nextmap.value))); @@ -6725,7 +6714,8 @@ static void M_DrawServerMenu(void) else PictureOfLevel = W_CachePatchName("BLANKLVL", PU_CACHE); - x = BASEVIDWIDTH - currentMenu->x - (SHORT(PictureOfLevel->width)/2); + w = (SHORT(PictureOfLevel->width)/4); + x = BASEVIDWIDTH/2 - w; y = currentMenu->y + 130 + 8 - (SHORT(PictureOfLevel->height)/2); V_DrawSmallScaledPatch(x, y, 0, PictureOfLevel); @@ -6733,14 +6723,12 @@ static void M_DrawServerMenu(void) V_DrawDiag(x, y, 10, G_GetGametypeColor(cv_newgametype.value));*/ y += SHORT(PictureOfLevel->height)/8; - i = cv_nextmap.value - 1; + trans = (leftfade ? V_TRANSLUCENT : 0); + #define horizspac 2 do { - if (currentMenu == &MP_SplitServerDef && (trans += V_20TRANS) > V_90TRANS) - break; - oldval = i; do { @@ -6749,7 +6737,7 @@ static void M_DrawServerMenu(void) i = NUMMAPS-1; if (i == oldval) - goto mainmenu; + return; if(!mapheaderinfo[i]) continue; // Don't allocate the header. That just makes memory usage skyrocket. @@ -6768,8 +6756,9 @@ static void M_DrawServerMenu(void) V_DrawTinyScaledPatch(x, y, trans, PictureOfLevel); } while (x > horizspac-dupadjust); - x = BASEVIDWIDTH + horizspac - currentMenu->x; + x = BASEVIDWIDTH/2 + w + horizspac; i = cv_nextmap.value - 1; + trans = (rightfade ? V_TRANSLUCENT : 0); while (x < BASEVIDWIDTH+dupadjust-horizspac) { @@ -6781,7 +6770,7 @@ static void M_DrawServerMenu(void) i = 0; if (i == oldval) - goto mainmenu; + return; if(!mapheaderinfo[i]) continue; // Don't allocate the header. That just makes memory usage skyrocket. @@ -6796,22 +6785,38 @@ static void M_DrawServerMenu(void) else PictureOfLevel = W_CachePatchName("BLANKLVL", PU_CACHE); - V_DrawTinyScaledPatch(x, y, 0, PictureOfLevel); + V_DrawTinyScaledPatch(x, y, trans, PictureOfLevel); x += horizspac + SHORT(PictureOfLevel->width)/4; } #undef horizspac +} -mainmenu: +static void M_DrawServerMenu(void) +{ + M_DrawLevelSelectOnly((currentMenu == &MP_SplitServerDef), false); M_DrawGenericMenu(); - if (currentMenu != &MP_SplitServerDef) - return; - +#ifndef NONET + // Room name + if (currentMenu == &MP_ServerDef) + { +#define mp_server_room 1 + if (ms_RoomId < 0) + V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, currentMenu->y + MP_ServerMenu[mp_server_room].alphaKey, + highlightflags, (itemOn == mp_server_room) ? "