diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 258ff882c..2704b6dfd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,7 +3,6 @@ # Core sources set(SRB2_CORE_SOURCES am_map.c - b_bot.c command.c comptime.c console.c @@ -53,7 +52,6 @@ set(SRB2_CORE_SOURCES set(SRB2_CORE_HEADERS am_map.h - b_bot.h byteptr.h command.h console.h diff --git a/src/Makefile b/src/Makefile index 553ba41f4..bf29f33b8 100644 --- a/src/Makefile +++ b/src/Makefile @@ -576,7 +576,6 @@ OBJS:=$(i_main_o) \ $(OBJDIR)/i_tcp.o \ $(OBJDIR)/i_time.o \ $(OBJDIR)/lzf.o \ - $(OBJDIR)/b_bot.o \ $(i_net_o) \ $(i_system_o) \ $(i_sound_o) \ diff --git a/src/b_bot.c b/src/b_bot.c deleted file mode 100644 index edaf477ad..000000000 --- a/src/b_bot.c +++ /dev/null @@ -1,273 +0,0 @@ -// SONIC ROBO BLAST 2 -//----------------------------------------------------------------------------- -// Copyright (C) 2007-2016 by John "JTE" Muniz. -// Copyright (C) 2011-2018 by Sonic Team Junior. -// -// This program is free software distributed under the -// terms of the GNU General Public License, version 2. -// See the 'LICENSE' file for more details. -//----------------------------------------------------------------------------- -/// \file b_bot.c -/// \brief Basic bot handling - -#include "doomdef.h" -#include "d_player.h" -#include "g_game.h" -#include "r_main.h" -#include "p_local.h" -#include "b_bot.h" -#include "lua_hook.h" - -// If you want multiple bots, variables like this will -// have to be stuffed in something accessible through player_t. -static boolean lastForward = false; -static boolean lastBlocked = false; -static boolean blocked = false; - -static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd) -{ - boolean forward=false, backward=false, left=false, right=false, jump=false, spin=false; - angle_t angle; - INT16 rangle; - fixed_t dist; - - // We can't follow Sonic if he's not around! - if (!sonic || sonic->health <= 0) - return; - - // Lua can handle it! - if (LUAh_BotAI(sonic, tails, cmd)) - return; - - if (tails->player->pflags & (PF_MACESPIN|PF_ITEMHANG)) - { - dist = P_AproxDistance(tails->x-sonic->x, tails->y-sonic->y); - if (sonic->player->cmd.buttons & BT_DRIFT && sonic->player->pflags & (PF_JUMPED|PF_MACESPIN|PF_ITEMHANG)) - cmd->buttons |= BT_DRIFT; - if (sonic->player->pflags & (PF_MACESPIN|PF_ITEMHANG)) - { - cmd->forwardmove = sonic->player->cmd.forwardmove; - cmd->angleturn = abs((signed)(tails->angle - sonic->angle))>>16; - if (sonic->angle < tails->angle) - cmd->angleturn = -cmd->angleturn; - } else if (dist > FixedMul(512*FRACUNIT, tails->scale)) - cmd->buttons |= BT_DRIFT; - return; - } - - // Gather data about the environment - dist = P_AproxDistance(tails->x-sonic->x, tails->y-sonic->y); - if (tails->player->pflags & PF_STARTDASH) - angle = sonic->angle; - else - angle = R_PointToAngle2(tails->x, tails->y, sonic->x, sonic->y); - - // Decide which direction to turn - angle = (tails->angle - angle); - if (angle < ANGLE_180) { - right = true; // We need to turn right - rangle = AngleFixed(angle)>>FRACBITS; - } else { - left = true; // We need to turn left - rangle = 360-(AngleFixed(angle)>>FRACBITS); - } - - // Decide to move forward if you're finished turning - if (abs(rangle) < 10) { // We're facing the right way? - left = right = false; // Stop turning - forward = true; // and walk forward instead. - } - if (dist < (sonic->radius+tails->radius)*3) // We're close enough? - forward = false; // Stop walking. - - // Decide when to jump - if (!(tails->player->pflags & (PF_JUMPED|PF_JUMPDOWN))) { // We're not jumping yet... - if (forward && lastForward && blocked && lastBlocked) // We've been stopped by a wall or something - jump = true; // Try to jump up - } else if ((tails->player->pflags & (PF_JUMPDOWN|PF_JUMPED)) == (PF_JUMPDOWN|PF_JUMPED)) { // When we're already jumping... - if (lastForward && blocked) // We're still stuck on something? - jump = true; - if (sonic->floorz > tails->floorz) // He's still above us? Jump HIGHER, then! - jump = true; - } - - // Decide when to spin - if (sonic->player->pflags & PF_STARTDASH - && (tails->player->pflags & PF_STARTDASH || (P_AproxDistance(tails->momx, tails->momy) < 2*FRACUNIT && !forward))) - spin = true; - - // Turn the virtual keypresses into ticcmd_t. - B_KeysToTiccmd(tails, cmd, forward, backward, left, right, false, false, jump, spin); - - // Update our status - lastForward = forward; - lastBlocked = blocked; - blocked = false; -} - -void B_BuildTiccmd(player_t *player, ticcmd_t *cmd) -{ - // Can't build a ticcmd if we aren't spawned... - if (!player->mo) - return; - - if (player->playerstate == PST_DEAD) - { - if (B_CheckRespawn(player)) - cmd->buttons |= BT_DRIFT; - return; - } - - // Bot AI isn't programmed in analog. - //CV_SetValue(&cv_analog2, false); - - // Let Lua scripts build ticcmds - if (LUAh_BotTiccmd(player, cmd)) - return; - - // We don't have any main character AI, sorry. D: - if (player-players == consoleplayer) - return; - - // Basic Tails AI - B_BuildTailsTiccmd(players[consoleplayer].mo, player->mo, cmd); -} - -void B_KeysToTiccmd(mobj_t *mo, ticcmd_t *cmd, boolean forward, boolean backward, boolean left, boolean right, boolean strafeleft, boolean straferight, boolean jump, boolean spin) -{ - // Turn the virtual keypresses into ticcmd_t. - if (twodlevel || mo->flags2 & MF2_TWOD) { - if (players[consoleplayer].climbing - || mo->player->pflags & PF_GLIDING) { - // Don't mess with bot inputs during these unhandled movement conditions. - // The normal AI doesn't use abilities, so custom AI should be sending us exactly what it wants anyway. - if (forward) - cmd->forwardmove += MAXPLMOVE<>16; - if (backward) - cmd->forwardmove -= MAXPLMOVE<>16; - if (left || strafeleft) - cmd->sidemove -= MAXPLMOVE<>16; - if (right || straferight) - cmd->sidemove += MAXPLMOVE<>16; - } else { - // In standard 2D mode, interpret "forward" as "the way you're facing" and everything else as "the way you're not facing" - if (left || right) - backward = true; - left = right = false; - if (forward) { - if (mo->angle < ANGLE_90 || mo->angle > ANGLE_270) - right = true; - else - left = true; - } else if (backward) { - if (mo->angle < ANGLE_90 || mo->angle > ANGLE_270) - left = true; - else - right = true; - } - if (left || strafeleft) - cmd->sidemove -= MAXPLMOVE<>16; - if (right || straferight) - cmd->sidemove += MAXPLMOVE<>16; - } - } else { - if (forward) - cmd->forwardmove += MAXPLMOVE<>16; - if (backward) - cmd->forwardmove -= MAXPLMOVE<>16; - if (left) - cmd->angleturn += 1280; - if (right) - cmd->angleturn -= 1280; - if (strafeleft) - cmd->sidemove -= MAXPLMOVE<>16; - if (straferight) - cmd->sidemove += MAXPLMOVE<>16; - } - if (jump) - cmd->buttons |= BT_DRIFT; - if (spin) - cmd->buttons |= BT_BRAKE; -} - -void B_MoveBlocked(player_t *player) -{ - (void)player; - blocked = true; -} - -boolean B_CheckRespawn(player_t *player) -{ - mobj_t *sonic = players[consoleplayer].mo; - mobj_t *tails = player->mo; - - // We can't follow Sonic if he's not around! - if (!sonic || sonic->health <= 0) - return false; - - // Check if Sonic is busy first. - // If he's doing any of these things, he probably doesn't want to see us. - if (sonic->player->pflags & (PF_ROPEHANG|PF_GLIDING|PF_CARRIED|PF_SLIDING|PF_ITEMHANG|PF_MACESPIN|PF_NIGHTSMODE) - || (sonic->player->panim != PA_IDLE && sonic->player->panim != PA_WALK)) - return false; - - // Low ceiling, do not want! - if (sonic->ceilingz - sonic->z < 2*sonic->height) - return false; - - // If you're dead, wait a few seconds to respawn. - if (player->playerstate == PST_DEAD) { - if (player->deadtimer > 4*TICRATE) - return true; - return false; - } - - // If you can't see Sonic, I guess we should? - if (!P_CheckSight(sonic, tails) && P_AproxDistance(P_AproxDistance(tails->x-sonic->x, tails->y-sonic->y), tails->z-sonic->z) > FixedMul(1024*FRACUNIT, tails->scale)) - return true; - return false; -} - -void B_RespawnBot(INT32 playernum) -{ - player_t *player = &players[playernum]; - fixed_t x,y,z; - mobj_t *sonic = players[consoleplayer].mo; - mobj_t *tails; - - if (!sonic || sonic->health <= 0) - return; - - player->bot = 1; - P_SpawnPlayer(playernum); - tails = player->mo; - - x = sonic->x; - y = sonic->y; - if (sonic->eflags & MFE_VERTICALFLIP) { - tails->eflags |= MFE_VERTICALFLIP; - z = sonic->z - FixedMul(512*FRACUNIT,sonic->scale); - if (z < sonic->floorz) - z = sonic->floorz; - } else { - z = sonic->z + sonic->height + FixedMul(512*FRACUNIT,sonic->scale); - if (z > sonic->ceilingz - sonic->height) - z = sonic->ceilingz - sonic->height; - } - - if (sonic->flags2 & MF2_OBJECTFLIP) - tails->flags2 |= MF2_OBJECTFLIP; - if (sonic->flags2 & MF2_TWOD) - tails->flags2 |= MF2_TWOD; - if (sonic->eflags & MFE_UNDERWATER) - tails->eflags |= MFE_UNDERWATER; - player->powers[pw_underwater] = sonic->player->powers[pw_underwater]; - player->powers[pw_spacetime] = sonic->player->powers[pw_spacetime]; - player->powers[pw_gravityboots] = sonic->player->powers[pw_gravityboots]; - player->powers[pw_nocontrol] = sonic->player->powers[pw_nocontrol]; - - P_SetOrigin(tails, x, y, z); - P_SetPlayerMobjState(tails, S_KART_STND1); // SRB2kart - was S_PLAY_FALL1 - P_SetScale(tails, sonic->scale); - tails->destscale = tails->old_scale = sonic->destscale; -} diff --git a/src/b_bot.h b/src/b_bot.h deleted file mode 100644 index 20b2803b6..000000000 --- a/src/b_bot.h +++ /dev/null @@ -1,17 +0,0 @@ -// SONIC ROBO BLAST 2 -//----------------------------------------------------------------------------- -// Copyright (C) 2007-2016 by John "JTE" Muniz. -// Copyright (C) 2012-2018 by Sonic Team Junior. -// -// This program is free software distributed under the -// terms of the GNU General Public License, version 2. -// See the 'LICENSE' file for more details. -//----------------------------------------------------------------------------- -/// \file b_bot.h -/// \brief Basic bot handling - -void B_BuildTiccmd(player_t *player, ticcmd_t *cmd); -void B_KeysToTiccmd(mobj_t *mo, ticcmd_t *cmd, boolean forward, boolean backward, boolean left, boolean right, boolean strafeleft, boolean straferight, boolean jump, boolean spin); -boolean B_CheckRespawn(player_t *player); -void B_MoveBlocked(player_t *player); -void B_RespawnBot(INT32 playernum); diff --git a/src/d_clisrv.c b/src/d_clisrv.c index ac31ce610..71daba3f0 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1337,8 +1337,6 @@ static boolean CL_SendJoin(void) if (splitscreen) localplayers += splitscreen; - else if (botingame) - localplayers++; netbuffer->u.clientcfg.localplayers = localplayers; netbuffer->u.clientcfg._255 = 255; @@ -3047,8 +3045,6 @@ static void Command_connect(void) splitscreen = cv_splitplayers.value-1; SplitScreen_OnChange(); } - botingame = false; - botskin = 0; CL_ConnectToServer(); } @@ -4292,8 +4288,6 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum) { displayplayers[splitscreenplayer] = newplayernum; DEBFILE(va("spawning one of my sister number %d\n", splitscreenplayer)); - if (splitscreenplayer == 1 && botingame) - players[newplayernum].bot = 1; } else { @@ -5940,7 +5934,7 @@ static void CL_SendClientCmd(void) G_MoveTiccmd(&netbuffer->u.clientpak.cmd, &localcmds, 1); netbuffer->u.clientpak.consistancy = SHORT(consistancy[gametic%TICQUEUE]); - if (splitscreen || botingame) // Send a special packet with 2 cmd for splitscreen + if (splitscreen) // Send a special packet with 2 cmd for splitscreen { netbuffer->packettype = (mis ? PT_CLIENT2MIS : PT_CLIENT2CMD); packetsize = sizeof (client2cmd_pak); @@ -6139,7 +6133,7 @@ static void Local_Maketic(INT32 realtics) if (!dedicated) rendergametic = gametic; // translate inputs (keyboard/mouse/joystick) into game controls G_BuildTiccmd(&localcmds, realtics, 1); - if (splitscreen || botingame) + if (splitscreen) { G_BuildTiccmd(&localcmds2, realtics, 2); if (splitscreen > 1) diff --git a/src/d_main.c b/src/d_main.c index 4fa297f25..5f117d0c1 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -956,8 +956,6 @@ void D_StartTitle(void) splitscreen = 0; SplitScreen_OnChange(); - botingame = false; - botskin = 0; cv_debug = 0; emeralds = 0; diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 942823b8c..8ff04f598 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -1672,7 +1672,7 @@ static void SendNameAndColor2(void) char buf[MAXPLAYERNAME+2]; char *p; - if (splitscreen < 1 && !botingame) + if (splitscreen < 1) return; // can happen if skin2/color2/name2 changed if (displayplayers[1] != consoleplayer) @@ -1700,16 +1700,7 @@ static void SendNameAndColor2(void) if (!Playing()) return; - // If you're not in a netgame, merely update the skin, color, and name. - if (botingame) - { - players[secondplaya].skincolor = botcolor; - if (players[secondplaya].mo) - players[secondplaya].mo->color = players[secondplaya].skincolor; - SetPlayerSkinByNum(secondplaya, botskin-1); - return; - } - else if (!netgame) + if (!netgame) { INT32 foundskin; @@ -1723,24 +1714,8 @@ static void SendNameAndColor2(void) if ((foundskin = R_SkinAvailable(cv_skin2.string)) != -1) { - //boolean notsame; - cv_skin2.value = foundskin; - - //notsame = (cv_skin2.value != players[secondplaya].skin); - SetPlayerSkin(secondplaya, cv_skin2.string); - - // SRB2Kart - /*if (notsame) - { - CV_StealthSetValue(&cv_playercolor2, skins[players[secondplaya].skin].prefcolor); - - players[secondplaya].skincolor = (cv_playercolor2.value&0x3F) % MAXSKINCOLORS; - - if (players[secondplaya].mo) - players[secondplaya].mo->color = players[secondplaya].skincolor; - }*/ } else { @@ -1931,15 +1906,7 @@ static void SendNameAndColor4(void) return; // If you're not in a netgame, merely update the skin, color, and name. - if (botingame) - { - players[fourthplaya].skincolor = botcolor; - if (players[fourthplaya].mo) - players[fourthplaya].mo->color = players[fourthplaya].skincolor; - SetPlayerSkinByNum(fourthplaya, botskin-1); - return; - } - else if (!netgame) + if (!netgame) { INT32 foundskin; @@ -1953,24 +1920,8 @@ static void SendNameAndColor4(void) if ((foundskin = R_SkinAvailable(cv_skin4.string)) != -1) { - //boolean notsame; - cv_skin4.value = foundskin; - - //notsame = (cv_skin4.value != players[fourthplaya].skin); - SetPlayerSkin(fourthplaya, cv_skin4.string); - - // SRB2Kart - /*if (notsame) - { - CV_StealthSetValue(&cv_playercolor4, skins[players[fourthplaya].skin].prefcolor); - - players[fourthplaya].skincolor = (cv_playercolor4.value&0x3F) % MAXSKINCOLORS; - - if (players[fourthplaya].mo) - players[fourthplaya].mo->color = players[fourthplaya].skincolor; - }*/ } else { @@ -2165,7 +2116,7 @@ static void Got_WeaponPref(UINT8 **cp,INT32 playernum) void D_SendPlayerConfig(void) { SendNameAndColor(); - if (splitscreen || botingame) + if (splitscreen) SendNameAndColor2(); if (splitscreen > 1) SendNameAndColor3(); @@ -2560,29 +2511,6 @@ void D_MapChange(INT32 mapnum, INT32 newgametype, boolean pencoremode, boolean r return; } - // Kick bot from special stages - if (botskin) - { - if (G_IsSpecialStage(mapnum)) - { - if (botingame) - { - //CL_RemoveSplitscreenPlayer(); - botingame = false; - playeringame[1] = false; - } - } - else if (!botingame) - { - //CL_AddSplitscreenPlayer(); - botingame = true; - displayplayers[1] = 1; - playeringame[1] = true; - players[1].bot = 1; - SendNameAndColor2(); - } - } - chmappending++; if (netgame) WRITEUINT32(buf_p, M_RandomizedSeed()); // random seed @@ -5166,8 +5094,6 @@ void Command_ExitGame_f(void) splitscreen = 0; SplitScreen_OnChange(); - botingame = false; - botskin = 0; cv_debug = 0; emeralds = 0; diff --git a/src/d_player.h b/src/d_player.h index c2a5d32ce..e26acb1ea 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -538,7 +538,6 @@ typedef struct player_s angle_t awayviewaiming; // Used for cut-away view boolean spectator; - UINT8 bot; tic_t jointime; // Timer when player joins game to change skin/color tic_t spectatorreentry; diff --git a/src/dehacked.c b/src/dehacked.c index 9ef15c3a4..32cb9f13f 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -661,30 +661,15 @@ static const struct { {"SINGLEPLAYER",TOL_SP}, {"SINGLE",TOL_SP}, - {"COOP",TOL_COOP}, - {"CO-OP",TOL_COOP}, - - {"COMPETITION",TOL_COMPETITION}, {"RACE",TOL_RACE}, {"MATCH",TOL_MATCH}, {"BATTLE",TOL_MATCH}, // SRB2kart - {"TAG",TOL_TAG}, - {"CTF",TOL_CTF}, {"CUSTOM",TOL_CUSTOM}, - {"2D",TOL_2D}, - {"MARIO",TOL_MARIO}, - {"NIGHTS",TOL_NIGHTS}, {"TV",TOL_TV}, - {"XMAS",TOL_XMAS}, - {"CHRISTMAS",TOL_XMAS}, - {"WINTER",TOL_XMAS}, - - //{"KART",TOL_KART}, // SRB2kart - {NULL, 0} }; @@ -7765,19 +7750,10 @@ struct { // Type of levels {"TOL_SP",TOL_SP}, - {"TOL_COOP",TOL_COOP}, - {"TOL_COMPETITION",TOL_COMPETITION}, {"TOL_RACE",TOL_RACE}, {"TOL_MATCH",TOL_MATCH}, - {"TOL_TAG",TOL_TAG}, - {"TOL_CTF",TOL_CTF}, {"TOL_CUSTOM",TOL_CUSTOM}, - {"TOL_2D",TOL_2D}, - {"TOL_MARIO",TOL_MARIO}, - {"TOL_NIGHTS",TOL_NIGHTS}, {"TOL_TV",TOL_TV}, - {"TOL_XMAS",TOL_XMAS}, - //{"TOL_KART",TOL_KART}, // Level flags {"LF_SCRIPTISFILE",LF_SCRIPTISFILE}, @@ -8547,13 +8523,13 @@ static int lua_enumlib_basic_fallback(lua_State* L) static int lua_enumlib_mariomode_get(lua_State *L) { - lua_pushboolean(L, mariomode != 0); + lua_pushboolean(L, false); return 1; } static int lua_enumlib_twodlevel_get(lua_State *L) { - lua_pushboolean(L, twodlevel); + lua_pushboolean(L, false); return 1; } diff --git a/src/doomstat.h b/src/doomstat.h index fad4d4521..d11a8ee4e 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -301,26 +301,14 @@ extern mapheader_t* mapheaderinfo[NUMMAPS]; enum TypeOfLevel { TOL_SP = 0x01, ///< Single Player - TOL_COOP = 0x02, ///< Cooperative - TOL_COMPETITION = 0x04, ///< Competition TOL_RACE = 0x08, ///< Race // Single Player default = 15 TOL_MATCH = 0x10, ///< Match - TOL_TAG = 0x20, ///< Tag -// Match/Tag default = 48 - - TOL_CTF = 0x40, ///< Capture the Flag -// CTF default = 64 TOL_CUSTOM = 0x80, ///< Custom (Lua-scripted, etc.) - TOL_2D = 0x0100, ///< 2D - TOL_MARIO = 0x0200, ///< Mario - TOL_NIGHTS = 0x0400, ///< NiGHTS TOL_TV = 0x0800, ///< Midnight Channel specific: draw TV like overlay on HUD - TOL_XMAS = 0x1000 ///< Christmas NiGHTS - //TOL_KART = 0x4000 ///< Kart 32768 }; // Gametypes diff --git a/src/g_game.c b/src/g_game.c index aa569c8a8..7eab7b765 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -47,7 +47,6 @@ #include "lua_script.h" // LUA_ArchiveDemo and LUA_UnArchiveDemo #include "lua_hook.h" #include "lua_libs.h" // gL (Lua state) -#include "b_bot.h" #include "m_cond.h" // condition sets #include "md5.h" // demo checksums #include "k_director.h" // SRB2kart @@ -62,10 +61,6 @@ gameaction_t gameaction; gamestate_t gamestate = GS_NULL; UINT8 ultimatemode = false; -boolean botingame; -UINT8 botskin; -UINT8 botcolor; - JoyType_t Joystick; JoyType_t Joystick2; JoyType_t Joystick3; @@ -359,10 +354,6 @@ consvar_t cv_demochangemap = {"netdemo_savemapchange", "Disabled", CV_SAVE, demo static UINT8 *savebuffer; // Analog Control -static void UserAnalog_OnChange(void); -static void UserAnalog2_OnChange(void); -static void UserAnalog3_OnChange(void); -static void UserAnalog4_OnChange(void); static void Analog_OnChange(void); static void Analog2_OnChange(void); static void Analog3_OnChange(void); @@ -448,10 +439,10 @@ consvar_t cv_analog = {"analog", "Off", CV_CALL, CV_OnOff, Analog_OnChange, 0, N consvar_t cv_analog2 = {"analog2", "Off", CV_CALL, CV_OnOff, Analog2_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_analog3 = {"analog3", "Off", CV_CALL, CV_OnOff, Analog3_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_analog4 = {"analog4", "Off", CV_CALL, CV_OnOff, Analog4_OnChange, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_useranalog = {"useranalog", "Off", CV_SAVE|CV_CALL, CV_OnOff, UserAnalog_OnChange, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_useranalog2 = {"useranalog2", "Off", CV_SAVE|CV_CALL, CV_OnOff, UserAnalog2_OnChange, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_useranalog3 = {"useranalog3", "Off", CV_SAVE|CV_CALL, CV_OnOff, UserAnalog3_OnChange, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_useranalog4 = {"useranalog4", "Off", CV_SAVE|CV_CALL, CV_OnOff, UserAnalog4_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_useranalog = {"useranalog", "Off", CV_SAVE|CV_CALL, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_useranalog2 = {"useranalog2", "Off", CV_SAVE|CV_CALL, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_useranalog3 = {"useranalog3", "Off", CV_SAVE|CV_CALL, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_useranalog4 = {"useranalog4", "Off", CV_SAVE|CV_CALL, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_turnaxis = {"joyaxis_turn", "Left X", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_moveaxis = {"joyaxis_move", "None", CV_SAVE, joyaxis_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -598,15 +589,6 @@ void G_ClearRecords(void) } } -// For easy retrieval of records -/*UINT32 G_GetBestScore(INT16 map) -{ - if (!mainrecords[map-1]) - return 0; - - return mainrecords[map-1]->score; -}*/ - tic_t G_GetBestTime(INT16 map) { if (!mainrecords[map-1] || mainrecords[map-1]->time <= 0) @@ -1170,7 +1152,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) player = &players[displayplayers[ssplayer-1]]; if (ssplayer == 2) - thiscam = (player->bot == 2 ? &camera[0] : &camera[ssplayer-1]); + thiscam = &camera[ssplayer-1]; else thiscam = &camera[ssplayer-1]; lang = localangle[ssplayer-1]; @@ -1515,78 +1497,19 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) } -// User has designated that they want -// analog ON, so tell the game to stop -// fudging with it. -static void UserAnalog_OnChange(void) -{ - /*if (cv_useranalog.value) - CV_SetValue(&cv_analog, 1); - else - CV_SetValue(&cv_analog, 0);*/ -} - -static void UserAnalog2_OnChange(void) -{ - if (botingame) - return; - /*if (cv_useranalog2.value) - CV_SetValue(&cv_analog2, 1); - else - CV_SetValue(&cv_analog2, 0);*/ -} - -static void UserAnalog3_OnChange(void) -{ - if (botingame) - return; - /*if (cv_useranalog3.value) - CV_SetValue(&cv_analog3, 1); - else - CV_SetValue(&cv_analog3, 0);*/ -} - -static void UserAnalog4_OnChange(void) -{ - if (botingame) - return; - /*if (cv_useranalog4.value) - CV_SetValue(&cv_analog4, 1); - else - CV_SetValue(&cv_analog4, 0);*/ -} - static void Analog_OnChange(void) { if (!cv_cam_dist.string) return; - // cameras are not initialized at this point - - /* - if (!cv_chasecam.value && cv_analog.value) { - CV_SetValue(&cv_analog, 0); - return; - } - */ - SendWeaponPref(); } static void Analog2_OnChange(void) { - if (!(splitscreen || botingame) || !cv_cam2_dist.string) + if (!splitscreen || !cv_cam2_dist.string) return; - // cameras are not initialized at this point - - /* - if (!cv_chasecam2.value && cv_analog2.value) { - CV_SetValue(&cv_analog2, 0); - return; - } - */ - SendWeaponPref2(); } @@ -1595,15 +1518,6 @@ static void Analog3_OnChange(void) if (splitscreen < 2 || !cv_cam3_dist.string) return; - // cameras are not initialized at this point - - /* - if (!cv_chasecam3.value && cv_analog3.value) { - CV_SetValue(&cv_analog3, 0); - return; - } - */ - SendWeaponPref3(); } @@ -1612,15 +1526,6 @@ static void Analog4_OnChange(void) if (splitscreen < 3 || !cv_cam4_dist.string) return; - // cameras are not initialized at this point - - /* - if (!cv_chasecam4.value && cv_analog4.value) { - CV_SetValue(&cv_analog4, 0); - return; - } - */ - SendWeaponPref4(); } @@ -1667,7 +1572,7 @@ void G_DoLoadLevel(boolean resetplayer) for (i = 0; i < MAXSPLITSCREENPLAYERS; i++) { - if (i > 0 && !(i == 1 && botingame) && splitscreen < i) + if (i > 0 && splitscreen < i) displayplayers[i] = consoleplayer; } @@ -2485,7 +2390,6 @@ void G_PlayerReborn(INT32 player) tic_t jointime; UINT8 splitscreenindex; boolean spectator; - INT16 bot; SINT8 pity; // SRB2kart @@ -2549,7 +2453,6 @@ void G_PlayerReborn(INT32 player) starpostangle = players[player].starpostangle; mare = players[player].mare; - bot = players[player].bot; pity = players[player].pity; if (leveltime <= starttime) // man i really hope this crap works kek but need to reset this somehow at mapstart @@ -2664,8 +2567,6 @@ void G_PlayerReborn(INT32 player) } p->mare = mare; - if (bot) - p->bot = 1; // reset to AI-controlled p->pity = pity; // SRB2kart @@ -3068,44 +2969,25 @@ void G_DoReborn(INT32 playernum) // Make sure objectplace is OFF when you first start the level! OP_ResetObjectplace(); - if (player->bot && playernum != consoleplayer) - { // Bots respawn next to their master. - mobj_t *oldmo = NULL; + // respawn at the start + mobj_t *oldmo = NULL; - // first dissasociate the corpse - if (player->mo) - { - oldmo = player->mo; - // Don't leave your carcass stuck 10-billion feet in the ground! - P_RemoveMobj(player->mo); - } + if (player->spectator) + ; + else if (player->starpostnum || ((mapheaderinfo[gamemap - 1]->levelflags & LF_SECTIONRACE) && player->laps)) // SRB2kart + starpost = true; - B_RespawnBot(playernum); - if (oldmo) - G_ChangePlayerReferences(oldmo, players[playernum].mo); - } - else + // first dissasociate the corpse + if (player->mo) { - // respawn at the start - mobj_t *oldmo = NULL; - - if (player->spectator) - ; - else if (player->starpostnum || ((mapheaderinfo[gamemap - 1]->levelflags & LF_SECTIONRACE) && player->laps)) // SRB2kart - starpost = true; - - // first dissasociate the corpse - if (player->mo) - { - oldmo = player->mo; - // Don't leave your carcass stuck 10-billion feet in the ground! - P_RemoveMobj(player->mo); - } - - G_SpawnPlayer(playernum, starpost); - if (oldmo) - G_ChangePlayerReferences(oldmo, players[playernum].mo); + oldmo = player->mo; + // Don't leave your carcass stuck 10-billion feet in the ground! + P_RemoveMobj(player->mo); } + + G_SpawnPlayer(playernum, starpost); + if (oldmo) + G_ChangePlayerReferences(oldmo, players[playernum].mo); } void G_AddPlayer(INT32 playernum) @@ -4250,9 +4132,6 @@ void G_DeferedInitNew(boolean pencoremode, const char *mapname, INT32 pickedchar if (savedata.lives > 0) { color = savedata.skincolor; - botskin = savedata.botskin; - botcolor = savedata.botcolor; - botingame = (botskin != 0); } else if (splitscreen != ssplayers) { @@ -7742,9 +7621,6 @@ void G_AddGhost(char *defdemoname) case ATTACKING_RECORD: // 1 p += 8; // demo time, lap break; - /*case ATTACKING_NIGHTS: // 2 - p += 8; // demo time left, score - break;*/ default: // 3 break; } diff --git a/src/g_state.h b/src/g_state.h index f9f1babd3..24904e67c 100644 --- a/src/g_state.h +++ b/src/g_state.h @@ -55,7 +55,4 @@ extern gamestate_t gamestate; extern UINT8 ultimatemode; // was sk_insane extern gameaction_t gameaction; -extern boolean botingame; -extern UINT8 botskin, botcolor; - #endif //__G_STATE__ diff --git a/src/k_kart.c b/src/k_kart.c index 787d1abcd..227f2aa30 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1813,7 +1813,7 @@ void K_RespawnChecker(player_t *player) { player->mo->scalespeed = mapobjectscale/TICRATE; player->mo->destscale = (6*mapobjectscale)/8; - if (cv_kartdebugshrink.value && !modeattacking && !player->bot) + if (cv_kartdebugshrink.value && !modeattacking) player->mo->destscale = (6*player->mo->destscale)/8; } @@ -2464,7 +2464,7 @@ static void K_RemoveGrowShrink(player_t *player) player->mo->scalespeed = mapobjectscale/TICRATE; player->mo->destscale = mapobjectscale; - if (cv_kartdebugshrink.value && !modeattacking && !player->bot) + if (cv_kartdebugshrink.value && !modeattacking) player->mo->destscale = (6*player->mo->destscale)/8; } @@ -4178,7 +4178,7 @@ static void K_DoShrink(player_t *user) { players[i].mo->scalespeed = mapobjectscale/TICRATE; players[i].mo->destscale = (6*mapobjectscale)/8; - if (cv_kartdebugshrink.value && !modeattacking && !players[i].bot) + if (cv_kartdebugshrink.value && !modeattacking) players[i].mo->destscale = (6*players[i].mo->destscale)/8; S_StartSound(players[i].mo, sfx_kc59); } @@ -6518,7 +6518,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) K_PlayPowerGloatSound(player->mo); player->mo->scalespeed = mapobjectscale/TICRATE; player->mo->destscale = (3*mapobjectscale)/2; - if (cv_kartdebugshrink.value && !modeattacking && !player->bot) + if (cv_kartdebugshrink.value && !modeattacking) player->mo->destscale = (6*player->mo->destscale)/8; player->kartstuff[k_growshrinktimer] = itemtime+(4*TICRATE); // 12 seconds if (P_IsLocalPlayer(player) && cv_growmusic.value == 1 && cv_birdmusic.value ) @@ -6820,7 +6820,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) { player->mo->scalespeed = mapobjectscale/12; player->mo->destscale = mapobjectscale + (FixedMul(mapobjectscale, player->kartstuff[k_boostcharge]*131)); - if (cv_kartdebugshrink.value && !modeattacking && !player->bot) + if (cv_kartdebugshrink.value && !modeattacking) player->mo->destscale = (6*player->mo->destscale)/8; } diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index 16e72d962..c353e8db0 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -15,7 +15,6 @@ #include "p_mobj.h" #include "g_game.h" #include "r_things.h" -#include "b_bot.h" #include "z_zone.h" #include "m_perfstats.h" @@ -142,19 +141,6 @@ static int lib_addHook(lua_State *L) hook.s.mt = lua_tonumber(L, 2); luaL_argcheck(L, hook.s.mt < NUMMOBJTYPES, 2, "invalid mobjtype_t"); break; - case hook_BotAI: - hook.s.skinname = NULL; - if (lua_isstring(L, 2)) - { // lowercase copy - const char *s = lua_tostring(L, 2); - char *p = hook.s.skinname = ZZ_Alloc(strlen(s)+1); - do { - *p = tolower(*s); - ++p; - } while(*(++s)); - *p = 0; - } - break; case hook_LinedefExecute: // Linedef executor functions { // uppercase copy const char *s = luaL_checkstring(L, 2); @@ -172,6 +158,7 @@ static int lib_addHook(lua_State *L) case hook_PlayerSpin: case hook_PlayerExplode: case hook_PlayerSquish: + case hook_BotAI: default: break; } @@ -1128,49 +1115,6 @@ boolean LUAh_MobjDeath(mobj_t *target, mobj_t *inflictor, mobj_t *source) return hooked; } -// Hook for B_BuildTiccmd -boolean LUAh_BotTiccmd(player_t *bot, ticcmd_t *cmd) -{ - hook_p hookp; - boolean hooked = false; - int HOOKSINDEX; - if (!gL || !(hooksAvailable[hook_BotTiccmd/8] & (1<<(hook_BotTiccmd%8)))) - return false; - - lua_settop(gL, 0); - lua_pushcfunction(gL, LUA_GetErrorMessage); - - lua_getfield(gL, LUA_REGISTRYINDEX, "hooks"); - HOOKSINDEX = lua_gettop(gL); - I_Assert(lua_istable(L, HOOKSINDEX)); - - for (hookp = roothook; hookp; hookp = hookp->next) - if (hookp->type == hook_BotTiccmd) - { - if (lua_gettop(gL) == 2) - { - LUA_PushUserdata(gL, bot, META_PLAYER); - LUA_PushUserdata(gL, cmd, META_TICCMD); - } - lua_rawgeti(gL, HOOKSINDEX, hookp->id); - lua_pushvalue(gL, -3); - lua_pushvalue(gL, -3); - if (lua_pcall(gL, 2, 1, 1)) { - if (!hookp->error || cv_debug & DBG_LUA) - CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1)); - lua_pop(gL, 1); - hookp->error = true; - continue; - } - if (lua_toboolean(gL, -1)) - hooked = true; - lua_pop(gL, 1); - } - - lua_settop(gL, 0); - return hooked; -} - // Hook for G_BuildTicCmd boolean hook_cmd_running = false; boolean LUAh_PlayerCmd(player_t *player, ticcmd_t *cmd) @@ -1217,72 +1161,6 @@ boolean LUAh_PlayerCmd(player_t *player, ticcmd_t *cmd) return hooked; } -// Hook for B_BuildTailsTiccmd by skin name -boolean LUAh_BotAI(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd) -{ - hook_p hookp; - boolean hooked = false; - int HOOKSINDEX; - if (!gL || !(hooksAvailable[hook_BotAI/8] & (1<<(hook_BotAI%8)))) - return false; - - lua_settop(gL, 0); - lua_pushcfunction(gL, LUA_GetErrorMessage); - - lua_getfield(gL, LUA_REGISTRYINDEX, "hooks"); - HOOKSINDEX = lua_gettop(gL); - I_Assert(lua_istable(L, HOOKSINDEX)); - - for (hookp = roothook; hookp; hookp = hookp->next) - if (hookp->type == hook_BotAI - && (hookp->s.skinname == NULL || !strcmp(hookp->s.skinname, ((skin_t*)tails->skin)->name))) - { - if (lua_gettop(gL) == 2) - { - LUA_PushUserdata(gL, sonic, META_MOBJ); - LUA_PushUserdata(gL, tails, META_MOBJ); - } - lua_rawgeti(gL, HOOKSINDEX, hookp->id); - lua_pushvalue(gL, -3); - lua_pushvalue(gL, -3); - if (lua_pcall(gL, 2, 8, 1)) { - if (!hookp->error || cv_debug & DBG_LUA) - CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1)); - lua_pop(gL, 1); - hookp->error = true; - continue; - } - - // This turns forward, backward, left, right, jump, and spin into a proper ticcmd for tails. - if (lua_istable(gL, -8)) { - boolean forward=false, backward=false, left=false, right=false, strafeleft=false, straferight=false, jump=false, spin=false; -#define CHECKFIELD(field) \ - lua_getfield(gL, -8, #field);\ - if (lua_toboolean(gL, -1))\ - field = true;\ - lua_pop(gL, 1); - - CHECKFIELD(forward) - CHECKFIELD(backward) - CHECKFIELD(left) - CHECKFIELD(right) - CHECKFIELD(strafeleft) - CHECKFIELD(straferight) - CHECKFIELD(jump) - CHECKFIELD(spin) -#undef CHECKFIELD - B_KeysToTiccmd(tails, cmd, forward, backward, left, right, strafeleft, straferight, jump, spin); - } else - B_KeysToTiccmd(tails, cmd, lua_toboolean(gL, -8), lua_toboolean(gL, -7), lua_toboolean(gL, -6), lua_toboolean(gL, -5), lua_toboolean(gL, -4), lua_toboolean(gL, -3), lua_toboolean(gL, -2), lua_toboolean(gL, -1)); - - lua_pop(gL, 8); - hooked = true; - } - - lua_settop(gL, 0); - return hooked; -} - // Hook for linedef executors boolean LUAh_LinedefExecute(line_t *line, mobj_t *mo, sector_t *sector) { diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index dd4cf7b03..cc52f38ad 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -40,7 +40,6 @@ int player_axis_setter(lua_State *L); int player_capsule_setter(lua_State *L); int player_awayviewmobj_setter(lua_State *L); int player_awayviewtics_setter(lua_State *L); -int player_bot_noset(lua_State *L); int player_splitscreenindex_noset(lua_State *L); int player_ping_getter(lua_State *L); int player_ping_noset(lua_State *L); @@ -151,7 +150,6 @@ static const udata_field_t player_fields[] = { FIELD(player_t, awayviewtics, udatalib_getter_int32, player_awayviewtics_setter), FIELD(player_t, awayviewaiming, udatalib_getter_angle, udatalib_setter_angle), FIELD(player_t, spectator, udatalib_getter_boolean, udatalib_setter_boolean_nocheck), // ffs - FIELD(player_t, bot, udatalib_getter_uint8, player_bot_noset), FIELD(player_t, jointime, udatalib_getter_tic, udatalib_setter_tic), FIELD(player_t, spectatorreentry, udatalib_getter_tic, udatalib_setter_tic), FIELD(player_t, grieftime, udatalib_getter_tic, udatalib_setter_tic), @@ -217,7 +215,6 @@ NOSET(name) NOSET(cmd) NOSET(powers) NOSET(kartstuff) -NOSET(bot) NOSET(splitscreenindex) NOSET(ping) NOSET(sliproll) @@ -882,4 +879,4 @@ int LUA_PlayerLib(lua_State *L) lua_setglobal(L, "displayplayers"); return 0; -} \ No newline at end of file +} diff --git a/src/m_cheat.c b/src/m_cheat.c index abada4be5..22126bd4f 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -945,9 +945,6 @@ boolean OP_FreezeObjectplace(void) if (!objectplacing) return false; - if ((maptol & TOL_NIGHTS) && (players[consoleplayer].pflags & PF_NIGHTSMODE)) - return false; - return true; } diff --git a/src/p_enemy.c b/src/p_enemy.c index 115c70ba8..c24396f38 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -459,10 +459,7 @@ boolean P_Move(mobj_t *actor, fixed_t speed) I_Assert(movedir < NUMDIRS); tryx = actor->x + FixedMul(speed*xspeed[movedir], actor->scale); - if (twodlevel || actor->flags2 & MF2_TWOD) - tryy = actor->y; - else - tryy = actor->y + FixedMul(speed*yspeed[movedir], actor->scale); + tryy = actor->y + FixedMul(speed*yspeed[movedir], actor->scale); if (actor->type == MT_SKIM && !P_WaterInSector(actor, tryx, tryy)) // bail out if sector lacks water return false; @@ -536,8 +533,6 @@ void P_NewChaseDir(mobj_t *actor) else d[1] = DI_NODIR; - if (twodlevel || actor->flags2 & MF2_TWOD) - d[2] = DI_NODIR; if (deltay < -FixedMul(10*FRACUNIT, actor->scale)) d[2] = DI_SOUTH; else if (deltay > FixedMul(10*FRACUNIT, actor->scale)) @@ -2397,7 +2392,7 @@ void A_1upThinker(mobj_t *actor) for (i = 0; i < MAXPLAYERS; i++) { - if (!playeringame[i] || players[i].bot || players[i].spectator) + if (!playeringame[i] || players[i].spectator) continue; if (!players[i].mo) @@ -2955,9 +2950,7 @@ void A_Invincibility(mobj_t *actor) if (P_IsLocalPlayer(player) && !player->powers[pw_super]) { S_StopMusic(); - if (mariomode) - G_GhostAddColor((INT32) (player - players), GHC_INVINCIBLE); - S_ChangeMusicInternal((mariomode) ? "minvnc" : "invinc", false); + S_ChangeMusicInternal("invinc", false); } } @@ -4498,12 +4491,7 @@ void A_MouseThink(mobj_t *actor) || (actor->eflags & MFE_VERTICALFLIP && actor->z + actor->height == actor->ceilingz)) && !actor->reactiontime) { - if (twodlevel || actor->flags2 & MF2_TWOD) - { - if (P_RandomChance(FRACUNIT/2)) - actor->angle += ANGLE_180; - } - else if (P_RandomChance(FRACUNIT/2)) + if (P_RandomChance(FRACUNIT/2)) actor->angle += ANGLE_90; else actor->angle -= ANGLE_90; diff --git a/src/p_inter.c b/src/p_inter.c index 5f3d33dc6..25ace4f90 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -165,8 +165,6 @@ void P_DoNightsScore(player_t *player) return; // Don't do any fancy shit for failures. dummymo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z+player->mo->height/2, MT_NIGHTSCORE); - if (player->bot) - player = &players[consoleplayer]; if (G_IsSpecialStage(gamemap)) // Global link count? Maybe not a good idea... { @@ -662,9 +660,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) special->momx = special->momy = special->momz = 0; P_GivePlayerRings(player, 1); - - if ((maptol & TOL_NIGHTS) && special->type != MT_FLINGRING) - P_DoNightsScore(player); break; case MT_COIN: @@ -674,9 +669,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) special->momx = special->momy = 0; P_GivePlayerRings(player, 1); - - if ((maptol & TOL_NIGHTS) && special->type != MT_FLINGCOIN) - P_DoNightsScore(player); break; case MT_BLUEBALL: if (!(P_CanPickupItem(player, 0))) @@ -690,9 +682,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) special->scalespeed = FixedDiv(FixedDiv(special->destscale, special->scale), states[special->info->deathstate].tics<scalespeed = 4*FRACUNIT/5; - - if (maptol & TOL_NIGHTS) - P_DoNightsScore(player); break; case MT_AUTOPICKUP: case MT_BOUNCEPICKUP: @@ -742,8 +731,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) // ***************************** // // Special Stage Token case MT_EMMY: - if (player->bot) - return; tokenlist += special->health; if (ALL7EMERALDS(emeralds)) // Got all 7 @@ -760,9 +747,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) // Emerald Hunt case MT_EMERHUNT: - if (player->bot) - return; - if (hunt1 == special) hunt1 = NULL; else if (hunt2 == special) @@ -791,9 +775,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) case MT_EMERALD5: case MT_EMERALD6: case MT_EMERALD7: - if (player->bot) - return; - if (special->threshold) player->powers[pw_emeralds] |= special->info->speed; else @@ -821,7 +802,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) // Secret emblem thingy case MT_EMBLEM: { - if (demo.playback || player->bot) + if (demo.playback) return; emblemlocations[special->health-1].collected = true; @@ -834,16 +815,12 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) // CTF Flags case MT_REDFLAG: case MT_BLUEFLAG: - if (player->bot) - return; if (player->powers[pw_flashing] || player->tossdelay) return; if (!special->spawnpoint) return; if (special->fuse == 1) return; -// if (special->momz > 0) -// return; { UINT8 flagteam = (special->type == MT_REDFLAG) ? 1 : 2; const char *flagtext; @@ -1009,8 +986,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if (playeringame[i] && players[i].pflags & PF_NIGHTSMODE) players[i].drillmeter += TICRATE/2; } - else if (player->bot) - players[consoleplayer].drillmeter += TICRATE/2; else player->drillmeter += TICRATE/2; @@ -1044,9 +1019,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) thinker_t *th; mobj_t *mo2; - if (player->bot) - return; - junk.tag = 649; EV_DoElevator(&junk, bridgeFall, false); @@ -1066,8 +1038,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) } break; case MT_FIREFLOWER: - if (player->bot) - return; player->powers[pw_shield] |= SH_FIREFLOWER; toucher->color = SKINCOLOR_WHITE; G_GhostAddColor(player - players, GHC_FIREFLOWER); @@ -1077,8 +1047,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) // Misc touchables // // *************** // case MT_STARPOST: - if (player->bot) - return; // SRB2kart - 150117 if (player->exiting) //STOP MESSING UP MY STATS FASDFASDF { @@ -1303,7 +1271,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if (player->powers[pw_invulnerability] || player->powers[pw_flashing] || (player->powers[pw_super] && !(ALL7EMERALDS(player->powers[pw_emeralds])))) return; - if (player->powers[pw_shield] || player->bot) //If One-Hit Shield + if (player->powers[pw_shield]) //If One-Hit Shield { P_RemoveShield(player); S_StartSound(toucher, sfx_shldls); // Ba-Dum! Shield loss. @@ -1342,10 +1310,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) return; // SRB2kart - don't need bubbles mucking with the player if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) return; - if (maptol & TOL_NIGHTS) - return; - if (mariomode) - return; else if (toucher->eflags & MFE_VERTICALFLIP) { if (special->z+special->height < toucher->z + toucher->height / 3 @@ -1371,8 +1335,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) return; default: // SOC or script pickup - if (player->bot) - return; P_SetTarget(&special->target, toucher); break; } @@ -1761,8 +1723,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source) // Drop stuff. // This determines the kind of object spawned // during the death frame of a thing. - if (!mariomode // Don't show birds, etc. in Mario Mode Tails 12-23-2001 - && target->flags & MF_ENEMY) + if (target->flags & MF_ENEMY) { if (cv_soniccd.value) item = MT_SEED; @@ -2311,7 +2272,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da return false; // Make sure that boxes cannot be popped by enemies, red rings, etc. - if (target->flags & MF_MONITOR && ((!source || !source->player || source->player->bot) || (inflictor && !inflictor->player))) + if (target->flags & MF_MONITOR && ((!source || !source->player) || (inflictor && !inflictor->player))) return false; } @@ -2380,9 +2341,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da { if (player->exiting) return false; - - if (!(target->player->pflags & (PF_NIGHTSMODE|PF_NIGHTSFALL)) && (maptol & TOL_NIGHTS)) - return false; } if (player->pflags & PF_NIGHTSMODE) // NiGHTS damage handling @@ -2630,9 +2588,7 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings) { ns = FixedMul(((i*FRACUNIT)/16)+2*FRACUNIT, mo->scale); mo->momx = FixedMul(FINECOSINE(fa),ns); - - if (!(twodlevel || (player->mo->flags2 & MF2_TWOD))) - mo->momy = FixedMul(FINESINE(fa),ns); + mo->momy = FixedMul(FINESINE(fa),ns); P_SetObjectMomZ(mo, 8*FRACUNIT, false); mo->fuse = 20*TICRATE; // Adjust fuse for NiGHTS @@ -2654,9 +2610,7 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings) ns = FixedMul(momxy, mo->scale); mo->momx = FixedMul(FINECOSINE(fa),ns); - - if (!(twodlevel || (player->mo->flags2 & MF2_TWOD))) - mo->momy = FixedMul(FINESINE(fa),ns); + mo->momy = FixedMul(FINESINE(fa),ns); ns = momz; P_SetObjectMomZ(mo, ns, false); @@ -2761,9 +2715,7 @@ void P_PlayerWeaponPanelBurst(player_t *player) // >16 ring type spillout ns = FixedMul(3*FRACUNIT, mo->scale); mo->momx = FixedMul(FINECOSINE(fa),ns); - - if (!(twodlevel || (player->mo->flags2 & MF2_TWOD))) - mo->momy = FixedMul(FINESINE(fa),ns); + mo->momy = FixedMul(FINESINE(fa),ns); P_SetObjectMomZ(mo, 4*FRACUNIT, false); @@ -2845,9 +2797,7 @@ void P_PlayerWeaponAmmoBurst(player_t *player) // Spill them! ns = FixedMul(2*FRACUNIT, mo->scale); mo->momx = FixedMul(FINECOSINE(fa), ns); - - if (!(twodlevel || (player->mo->flags2 & MF2_TWOD))) - mo->momy = FixedMul(FINESINE(fa),ns); + mo->momy = FixedMul(FINESINE(fa),ns); P_SetObjectMomZ(mo, 3*FRACUNIT, false); @@ -2961,11 +2911,7 @@ void P_PlayerEmeraldBurst(player_t *player, boolean toss) } momx = FixedMul(FINECOSINE(fa), ns); - - if (!(twodlevel || (player->mo->flags2 & MF2_TWOD))) - momy = FixedMul(FINESINE(fa),ns); - else - momy = 0; + momy = FixedMul(FINESINE(fa),ns); mo = P_SpawnMobj(player->mo->x, player->mo->y, z, MT_FLINGEMERALD); mo->health = 1; diff --git a/src/p_local.h b/src/p_local.h index c8760bbf2..021ebb443 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -57,9 +57,6 @@ #define AIMINGTOSLOPE(aiming) FINESINE((aiming>>ANGLETOFINESHIFT) & FINEMASK) -#define mariomode (maptol & TOL_MARIO) -#define twodlevel (maptol & TOL_2D) - // // P_TICK // diff --git a/src/p_map.c b/src/p_map.c index bd551829d..0d8d29903 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -371,11 +371,6 @@ static boolean PIT_CheckThing(mobj_t *thing) if (!(thing->flags & (MF_SOLID|MF_SPECIAL|MF_PAIN|MF_SHOOTABLE)) || (thing->flags & MF_NOCLIPTHING)) return true; - // Don't collide with your buddies while NiGHTS-flying. - if (tmthing->player && thing->player && (maptol & TOL_NIGHTS) - && ((tmthing->player->pflags & PF_NIGHTSMODE) || (thing->player->pflags & PF_NIGHTSMODE))) - return true; - blockdist = thing->radius + tmthing->radius; if (abs(thing->x - tmx) >= blockdist || abs(thing->y - tmy) >= blockdist) @@ -2165,7 +2160,6 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam) { subsector_t *s = R_PointInSubsector(x, y); boolean retval = true; - boolean itsatwodlevel = false; UINT8 i; floatok = false; @@ -2173,22 +2167,7 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam) if (dedicated) // this crashes so don't even try it return false; - if (twodlevel) - itsatwodlevel = true; - else - { - for (i = 0; i <= splitscreen; i++) - { - if (thiscam == &camera[i] && players[displayplayers[i]].mo - && (players[displayplayers[i]].mo->flags2 & MF2_TWOD)) - { - itsatwodlevel = true; - break; - } - } - } - - if (!itsatwodlevel && players[displayplayers[0]].mo) + if (players[displayplayers[0]].mo) { fixed_t tryx = thiscam->x; fixed_t tryy = thiscam->y; @@ -3179,16 +3158,8 @@ stairstep: P_HitSlideLine(bestslideline); // clip the moves - if ((twodlevel || (mo->flags2 & MF2_TWOD)) && mo->player) - { - mo->momx = tmxmove; - tmymove = 0; - } - else - { - mo->momx = tmxmove; - mo->momy = tmymove; - } + mo->momx = tmxmove; + mo->momy = tmymove; do { if (tmxmove > mo->radius) { diff --git a/src/p_mobj.c b/src/p_mobj.c index 29018489d..e98b9a28b 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -31,7 +31,6 @@ #include "info.h" #include "i_video.h" #include "lua_hook.h" -#include "b_bot.h" #include "p_slopes.h" #include "k_kart.h" @@ -1181,7 +1180,7 @@ static void P_XYFriction(mobj_t *mo, fixed_t oldx, fixed_t oldy) } else if (abs(player->rmomx) < FixedMul(STOPSPEED, mo->scale) && abs(player->rmomy) < FixedMul(STOPSPEED, mo->scale) - && (!(player->cmd.forwardmove && !(twodlevel || mo->flags2 & MF2_TWOD)) && !player->cmd.sidemove && !(player->pflags & PF_SPINNING)) + && (!player->cmd.forwardmove && !player->cmd.sidemove && !(player->pflags & PF_SPINNING)) && !(player->mo->standingslope && (!(player->mo->standingslope->flags & SL_NOPHYSICS)) && (abs(player->mo->standingslope->zdelta) >= FRACUNIT/2)) ) { @@ -1412,10 +1411,6 @@ void P_XYMovement(mobj_t *mo) // blocked move moved = false; - if (player) { - if (player->bot) - B_MoveBlocked(player); - } //{ SRB2kart - Jawz if (mo->type == MT_JAWZ || mo->type == MT_JAWZ_DUD) { @@ -2225,10 +2220,7 @@ static boolean P_ZMovement(mobj_t *mo) || mo->type == MT_CANNONBALLDECOR || mo->type == MT_FALLINGROCK) { - if (maptol & TOL_NIGHTS) - mom.z = -FixedDiv(mom.z, 10*FRACUNIT); - else - mom.z = -FixedMul(mom.z, FixedDiv(17*FRACUNIT,20*FRACUNIT)); + mom.z = -FixedMul(mom.z, FixedDiv(17*FRACUNIT,20*FRACUNIT)); if (mo->type == MT_BIGTUMBLEWEED || mo->type == MT_LITTLETUMBLEWEED) { @@ -2366,12 +2358,7 @@ static boolean P_ZMovement(mobj_t *mo) else // Flags bounce if (mo->type == MT_REDFLAG || mo->type == MT_BLUEFLAG) - { - if (maptol & TOL_NIGHTS) - mo->momz = -FixedDiv(mo->momz, 10*FRACUNIT); - else - mo->momz = -FixedMul(mo->momz, FixedDiv(17*FRACUNIT,20*FRACUNIT)); - } + mo->momz = -FixedMul(mo->momz, FixedDiv(17*FRACUNIT,20*FRACUNIT)); else mo->momz = 0; } @@ -2674,10 +2661,6 @@ nightsdone: } // Ugly ugly billions of braces! Argh! } - // hit the ceiling - if (mariomode) - S_StartSound(mo, sfx_mario1); - if (!mo->player->climbing) mo->momz = 0; } @@ -3245,7 +3228,6 @@ void P_DestroyRobots(void) // Process the mobj-ish required functions of the camera boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled) { - boolean itsatwodlevel = false; boolean flipcam = (player->pflags & PF_FLIPCAM && !(player->pflags & PF_NIGHTSMODE) && player->mo->eflags & MFE_VERTICALFLIP); postimg_t postimg = postimg_none; UINT8 i; @@ -3254,21 +3236,6 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled if (thiscam->subsector == NULL || thiscam->subsector->sector == NULL) return true; - if (twodlevel) - itsatwodlevel = true; - else - { - for (i = 0; i <= splitscreen; i++) - { - if (thiscam == &camera[i] && players[displayplayers[i]].mo - && (players[displayplayers[i]].mo->flags2 & MF2_TWOD)) - { - itsatwodlevel = true; - break; - } - } - } - if (encoremode && !flipcam) postimg = postimg_mirror; else if (!encoremode && flipcam) @@ -3332,8 +3299,7 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled } } - if (!itsatwodlevel) - P_CheckCameraPosition(thiscam->x, thiscam->y, thiscam); + P_CheckCameraPosition(thiscam->x, thiscam->y, thiscam); thiscam->subsector = R_PointInSubsector(thiscam->x, thiscam->y); thiscam->floorz = tmfloorz; @@ -3345,7 +3311,7 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled thiscam->z += thiscam->momz + player->mo->pmomz; #ifndef NOCLIPCAM - if (!itsatwodlevel && !(player->pflags & PF_NOCLIP || leveltime < introtime)) + if (!(player->pflags & PF_NOCLIP || leveltime < introtime)) { // clip movement if (thiscam->z <= thiscam->floorz) // hit the floor @@ -3388,13 +3354,13 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled #endif } - if (itsatwodlevel - || (thiscam->ceilingz - thiscam->z < thiscam->height - && thiscam->ceilingz >= thiscam->z)) + if (thiscam->ceilingz - thiscam->z < thiscam->height + && thiscam->ceilingz >= thiscam->z) { thiscam->ceilingz = thiscam->z + thiscam->height; thiscam->floorz = thiscam->z; } + return false; } @@ -3754,7 +3720,7 @@ boolean P_BossTargetPlayer(mobj_t *actor, boolean closest) if (player->health <= 0) continue; // dead - if (player->pflags & PF_INVIS || player->bot || player->spectator) + if (player->pflags & PF_INVIS || player->spectator) continue; // ignore notarget if (!player->mo || P_MobjWasRemoved(player->mo)) @@ -3796,7 +3762,7 @@ boolean P_SupermanLook4Players(mobj_t *actor) if (players[c].pflags & PF_INVIS) continue; // ignore notarget - if (!players[c].mo || players[c].bot) + if (!players[c].mo) continue; playersinthegame[stop] = &players[c]; @@ -4029,7 +3995,7 @@ static void P_Boss3Thinker(mobj_t *mobj) if (!playeringame[i] || players[i].spectator) continue; - if (!players[i].mo || players[i].bot) + if (!players[i].mo) continue; if (players[i].mo->health <= 0) @@ -4104,7 +4070,7 @@ static void P_Boss3Thinker(mobj_t *mobj) if (!playeringame[i] || players[i].spectator) continue; - if (!players[i].mo || players[i].bot) + if (!players[i].mo) continue; if (players[i].mo->health <= 0) @@ -10629,7 +10595,7 @@ void P_SpawnPlayer(INT32 playernum) p->awayviewtics = 0; // set the scale to the mobj's destscale so settings get correctly set. if we don't, they sometimes don't. - if (cv_kartdebugshrink.value && !modeattacking && !p->bot) + if (cv_kartdebugshrink.value && !modeattacking) mobj->destscale = 6*mobj->destscale/8; P_SetScale(mobj, mobj->destscale); P_FlashPal(p, 0, 0); // Resets diff --git a/src/p_saveg.c b/src/p_saveg.c index 4e5452a06..f11182a9f 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -73,12 +73,6 @@ static inline void P_ArchivePlayer(void) WRITEUINT32(save_p, player->score); WRITEINT32(save_p, pllives); WRITEINT32(save_p, player->continues); - - if (botskin) - { - WRITEUINT8(save_p, botskin); - WRITEUINT8(save_p, botcolor); - } } // @@ -92,16 +86,6 @@ static inline void P_UnArchivePlayer(void) savedata.score = READINT32(save_p); savedata.lives = READINT32(save_p); savedata.continues = READINT32(save_p); - - if (savedata.botcolor) - { - savedata.botskin = READUINT8(save_p); - if (savedata.botskin-1 >= numskins) - savedata.botskin = 0; - savedata.botcolor = READUINT8(save_p); - } - else - savedata.botskin = 0; } // @@ -3206,7 +3190,7 @@ static inline void P_ArchiveMisc(void) lastmapsaved = gamemap; - WRITEUINT16(save_p, (botskin ? (emeralds|(1<<10)) : emeralds)+357); + WRITEUINT16(save_p, emeralds+357); WRITESTRINGN(save_p, timeattackfolder, sizeof(timeattackfolder)); } diff --git a/src/p_setup.c b/src/p_setup.c index b800106a5..516f972ca 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2472,7 +2472,7 @@ boolean P_SetupLevel(boolean skipprecip, boolean reloadinggamestate) P_Initsecnode(); if (netgame || multiplayer) - cv_debug = botskin = 0; + cv_debug = 0; if (metalplayback) G_StopMetalDemo(); @@ -2847,9 +2847,6 @@ boolean P_SetupLevel(boolean skipprecip, boolean reloadinggamestate) players[consoleplayer].continues = savedata.continues; players[consoleplayer].lives = savedata.lives; players[consoleplayer].score = savedata.score; - botskin = savedata.botskin; - botcolor = savedata.botcolor; - botingame = (savedata.botskin != 0); emeralds = savedata.emeralds; savedata.lives = 0; } diff --git a/src/p_spec.c b/src/p_spec.c index 9ceccc296..82c746f1b 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -1955,13 +1955,9 @@ static mobj_t *P_GetObjectTypeInSectorNum(mobjtype_t type, size_t s) static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) { INT32 secnum = -1; - mobj_t *bot = NULL; I_Assert(!mo || !P_MobjWasRemoved(mo)); // If mo is there, mo must be valid! - if (mo && mo->player && botingame) - bot = players[displayplayers[1]].mo; - // note: only commands with linedef types >= 400 && < 500 can be used switch (line->special) { @@ -2084,9 +2080,6 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) { UINT8 i; - if (bot) // This might put poor Tails in a wall if he's too far behind! D: But okay, whatever! >:3 - P_SetOrigin(bot, bot->x + x, bot->y + y, bot->z + z); - for (i = 0; i <= splitscreen; i++) { if (mo->player == &players[displayplayers[i]] && camera[i].chase) @@ -2112,8 +2105,6 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) if (!dest) return; - if (bot) - P_Teleport(bot, dest->x, dest->y, dest->z, (line->flags & ML_NOCLIMB) ? mo->angle : dest->angle, (line->flags & ML_BLOCKMONSTERS) == 0, (line->flags & ML_EFFECT4) == ML_EFFECT4); if (line->flags & ML_BLOCKMONSTERS) P_Teleport(mo, dest->x, dest->y, dest->z, (line->flags & ML_NOCLIMB) ? mo->angle : dest->angle, false, (line->flags & ML_EFFECT4) == ML_EFFECT4); else @@ -2560,18 +2551,6 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) mo->player->cmomx = mo->player->cmomy = 0; P_ResetPlayer(mo->player); P_SetPlayerMobjState(mo, S_KART_STND1); // SRB2kart - was S_PLAY_STND - - // Reset bot too. - if (bot) { - if (line->flags & ML_NOCLIMB) - P_SetOrigin(bot, mo->x, mo->y, mo->z); - bot->momx = bot->momy = bot->momz = 1; - bot->pmomz = 0; - bot->player->rmomx = bot->player->rmomy = 1; - bot->player->cmomx = bot->player->cmomy = 0; - P_ResetPlayer(bot->player); - P_SetPlayerMobjState(bot, S_KART_STND1); // SRB2kart - was S_PLAY_STND - } } break; @@ -2603,14 +2582,6 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) mo->flags2 &= ~MF2_TWOD; else mo->flags2 |= MF2_TWOD; - - // Copy effect to bot if necessary - // (Teleport them to you so they don't break it.) - if (bot && (bot->flags2 & MF2_TWOD) != (mo->flags2 & MF2_TWOD)) - { - bot->flags2 = (bot->flags2 & ~MF2_TWOD) | (mo->flags2 & MF2_TWOD); - P_SetOrigin(bot, mo->x, mo->y, mo->z); - } } break; @@ -2619,8 +2590,6 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) mo->flags2 &= ~MF2_OBJECTFLIP; else mo->flags2 |= MF2_OBJECTFLIP; - if (bot) - bot->flags2 = (bot->flags2 & ~MF2_OBJECTFLIP) | (mo->flags2 & MF2_OBJECTFLIP); break; case 434: // Custom Power @@ -2639,12 +2608,6 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) P_SetTarget(&dummy->target, mo); A_CustomPower(dummy); - - if (bot) - { - P_SetTarget(&dummy->target, bot); - A_CustomPower(dummy); - } P_RemoveMobj(dummy); } break; @@ -2713,8 +2676,6 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) if (line->flags & ML_NOCLIMB) fractime |= 1<<15; //more crazy &ing, as if music stuff wasn't enough mo->player->powers[pw_nocontrol] = fractime; - if (bot) - bot->player->powers[pw_nocontrol] = fractime; } break; @@ -2724,8 +2685,6 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) mo->destscale = FixedDiv(P_AproxDistance(line->dx, line->dy), 100<destscale < FRACUNIT/100) mo->destscale = FRACUNIT/100; - if (mo->player && bot) - bot->destscale = mo->destscale; } break; @@ -3352,7 +3311,7 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers } break; case 11: // Special Stage Damage - Kind of like a mini-P_DamageMobj() - if (player->powers[pw_invulnerability] || player->powers[pw_flashing] || player->powers[pw_super] || player->exiting || player->bot) + if (player->powers[pw_invulnerability] || player->powers[pw_flashing] || player->powers[pw_super] || player->exiting) break; if (!(player->powers[pw_shield] || player->mo->health > 1)) // Don't do anything if no shield or rings anyway @@ -3393,7 +3352,7 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers case 3: // Linedef executor requires all players present // Trigger Linedef Exec (Floor Touch, All Players) /// \todo check continues for proper splitscreen support? for (i = 0; i < MAXPLAYERS; i++) - if (playeringame[i] && !players[i].bot && players[i].mo && players[i].lives > 0) + if (playeringame[i] && players[i].mo && players[i].lives > 0) { if (roversector) { @@ -3451,8 +3410,7 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers case 5: // Linedef executor // Trigger Linedef Exec (Floor Touch) case 6: // Linedef executor (7 Emeralds) // unused case 7: // SRB2kart: Linedef executor (Race Lap) - if (!player->bot) - P_LinedefExecute(sector->tag, player->mo, sector); + P_LinedefExecute(sector->tag, player->mo, sector); break; case 8: // Tells pushable things to check FOFs // Check for Linedef Executor on FOFs break; @@ -3462,7 +3420,7 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers mobj_t *mo2; line_t junk; - if (player->bot || sector->ceilingdata || sector->floordata) + if (sector->ceilingdata || sector->floordata) return; // Find the center of the Eggtrap and release all the pretty animals! @@ -3657,8 +3615,6 @@ DoneSection2: } case 2: // Special stage GOAL sector / Exit Sector / CTF Flag Return - if (player->bot) - break; if (!useNightsSS && G_IsSpecialStage(gamemap) && sstimer > 6) sstimer = 6; // Just let P_Ticker take care of the rest. diff --git a/src/p_user.c b/src/p_user.c index 5c20bbe04..968c7e128 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -41,7 +41,6 @@ #include "st_stuff.h" #include "lua_script.h" #include "lua_hook.h" -#include "b_bot.h" // Objectplace #include "m_cheat.h" // SRB2kart @@ -76,9 +75,7 @@ void P_Thrust(mobj_t *mo, angle_t angle, fixed_t move) angle >>= ANGLETOFINESHIFT; mo->momx += FixedMul(move, FINECOSINE(angle)); - - if (!(twodlevel || (mo->flags2 & MF2_TWOD))) - mo->momy += FixedMul(move, FINESINE(angle)); + mo->momy += FixedMul(move, FINESINE(angle)); } @@ -93,9 +90,7 @@ void P_InstaThrust(mobj_t *mo, angle_t angle, fixed_t move) angle >>= ANGLETOFINESHIFT; mo->momx = FixedMul(move, FINECOSINE(angle)); - - if (!(twodlevel || (mo->flags2 & MF2_TWOD))) - mo->momy = FixedMul(move,FINESINE(angle)); + mo->momy = FixedMul(move,FINESINE(angle)); } void P_InstaThrustEvenIn2D(mobj_t *mo, angle_t angle, fixed_t move) @@ -427,8 +422,6 @@ void P_ResetPlayer(player_t *player) player->powers[pw_tailsfly] = 0; player->onconveyor = 0; player->skidtime = 0; - /*if (player-players == consoleplayer && botingame) - CV_SetValue(&cv_analog2, true);*/ } // @@ -439,9 +432,6 @@ void P_ResetPlayer(player_t *player) // void P_GivePlayerRings(player_t *player, INT32 num_rings) { - if (player->bot) - player = &players[consoleplayer]; - if (!player->mo) return; @@ -493,9 +483,6 @@ void P_AddPlayerScore(player_t *player, UINT32 amount) if (!(G_BattleGametype())) return; - if (player->bot) - player = &players[consoleplayer]; - if (player->exiting) // srb2kart return; @@ -516,8 +503,6 @@ void P_PlayLivesJingle(player_t *player) if (use1upSound) S_StartSound(NULL, sfx_oneup); - else if (mariomode) - S_StartSound(NULL, sfx_marioa); else { if (player) @@ -549,7 +534,7 @@ void P_PlayRinglossSound(mobj_t *source, mobj_t *damager) S_StartSound(NULL, sfx); } else - S_StartSound(source, (mariomode) ? sfx_mario8 : sfx_khurt1 + key); + S_StartSound(source, sfx_khurt1 + key); } else S_StartSound(source, sfx_slip); @@ -2228,11 +2213,6 @@ static void P_MovePlayer(player_t *player) P_3dMovement(player); } - if (maptol & TOL_2D) - runspd = FixedMul(runspd, 2*FRACUNIT/3); - - //P_SkidStuff(player); - ///////////////////////// // MOVEMENT ANIMATIONS // ///////////////////////// @@ -2666,10 +2646,6 @@ boolean P_LookForEnemies(player_t *player) player->mo->z-mo->z) > FixedMul(RING_DIST, player->mo->scale)) continue; // out of range - if ((twodlevel || player->mo->flags2 & MF2_TWOD) - && abs(player->mo->y-mo->y) > player->mo->radius) - continue; // not in your 2d plane - if (mo->type == MT_PLAYER) // Don't chase after other players! continue; @@ -2791,9 +2767,6 @@ static void P_DeathThink(player_t *player) if (player->deadtimer < INT32_MAX) player->deadtimer++; - if (player->bot) // don't allow bots to do any of the below, B_CheckRespawn does all they need for respawning already - goto notrealplayer; - if (player->pflags & PF_TIMEOVER) { player->kartstuff[k_timeovercam]++; @@ -2847,8 +2820,6 @@ static void P_DeathThink(player_t *player) } } -notrealplayer: - if (!player->mo) return; @@ -3844,7 +3815,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall if (player->playerstate != PST_DEAD && !((player->pflags & PF_NIGHTSMODE) && player->exiting)) angle += (focusaiming < ANGLE_180 ? focusaiming/2 : InvAngle(InvAngle(focusaiming)/2)); // overcomplicated version of '((signed)focusaiming)/2;' - if (twodlevel || (mo->flags2 & MF2_TWOD) || (!camstill && !timeover)) // Keep the view still... + if (!camstill && !timeover) // Keep the view still... { G_ClipAimingPitch((INT32 *)&angle); @@ -4194,20 +4165,6 @@ void P_PlayerThink(player_t *player) player->playerstate = PST_DEAD; } - if (player->bot) - { - if (player->playerstate == PST_LIVE || player->playerstate == PST_DEAD) - { - if (B_CheckRespawn(player)) - player->playerstate = PST_REBORN; - } - if (player->playerstate == PST_REBORN) - { - LUAh_PlayerThink(player); - return; - } - } - #ifdef SEENAMES if (netgame && player == &players[displayplayers[0]] && !(leveltime % (TICRATE/5)) && !splitscreen) { @@ -4331,7 +4288,7 @@ void P_PlayerThink(player_t *player) for (i = 0; i < MAXPLAYERS; i++) { - if (!playeringame[i] || players[i].spectator || players[i].bot) + if (!playeringame[i] || players[i].spectator) continue; if (players[i].lives <= 0) continue; @@ -4490,37 +4447,6 @@ void P_PlayerThink(player_t *player) player->powers[pw_flashing] = TICRATE/2 + 1; } - // Even if not NiGHTS, pull in nearby objects when walking around as John Q. Elliot. - if (!objectplacing && !((netgame || multiplayer) && player->spectator) - && maptol & TOL_NIGHTS && (!(player->pflags & PF_NIGHTSMODE) || player->powers[pw_nights_helper])) - { - thinker_t *th; - mobj_t *mo2; - fixed_t x = player->mo->x; - fixed_t y = player->mo->y; - fixed_t z = player->mo->z; - - for (th = thinkercap.next; th != &thinkercap; th = th->next) - { - if (th->function.acp1 != (actionf_p1)P_MobjThinker) - continue; - - mo2 = (mobj_t *)th; - - if (!(mo2->type == MT_NIGHTSWING || mo2->type == MT_RING || mo2->type == MT_COIN - || mo2->type == MT_BLUEBALL)) - continue; - - if (P_AproxDistance(P_AproxDistance(mo2->x - x, mo2->y - y), mo2->z - z) > FixedMul(128*FRACUNIT, player->mo->scale)) - continue; - - // Yay! The thing's in reach! Pull it in! - mo2->flags |= MF_NOCLIP|MF_NOCLIPHEIGHT; - mo2->flags2 |= MF2_NIGHTSPULL; - P_SetTarget(&mo2->tracer, player->mo); - } - } - if (player->linktimer && !player->powers[pw_nights_linkfreeze]) { if (--player->linktimer <= 0) // Link timer @@ -4796,8 +4722,7 @@ void P_PlayerAfterThink(player_t *player) else if (cmd->forwardmove < 0 && player->mo->tracer->target->lastlook > player->mo->tracer->target->movecount) player->mo->tracer->target->lastlook -= 2; - if (!(player->mo->tracer->target->flags & MF_SLIDEME) // Noclimb on chain parameters gives this - && !(twodlevel || player->mo->flags2 & MF2_TWOD)) // why on earth would you want to turn them in 2D mode? + if (!(player->mo->tracer->target->flags & MF_SLIDEME)) // Noclimb on chain parameters gives this { player->mo->tracer->target->health += cmd->sidemove; player->mo->angle += cmd->sidemove< ANGLE_MAX diff --git a/src/r_main.c b/src/r_main.c index dee8ad4fb..8ca149964 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -173,10 +173,6 @@ static CV_PossibleValue_t maxportals_cons_t[] = {{0, "MIN"}, {12, "MAX"}, {0, NU static CV_PossibleValue_t homremoval_cons_t[] = {{0, "No"}, {1, "Yes"}, {2, "Flash"}, {0, NULL}}; static void Fov_OnChange(void); -static void ChaseCam_OnChange(void); -static void ChaseCam2_OnChange(void); -static void ChaseCam3_OnChange(void); -static void ChaseCam4_OnChange(void); static void FlipCam_OnChange(void); static void FlipCam2_OnChange(void); static void FlipCam3_OnChange(void); @@ -189,10 +185,10 @@ void SendWeaponPref4(void); static void Precipstuff_OnChange(void); consvar_t cv_tailspickup = {"tailspickup", "On", CV_NETVAR|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_chasecam = {"chasecam", "On", CV_CALL, CV_OnOff, ChaseCam_OnChange, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_chasecam2 = {"chasecam2", "On", CV_CALL, CV_OnOff, ChaseCam2_OnChange, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_chasecam3 = {"chasecam3", "On", CV_CALL, CV_OnOff, ChaseCam3_OnChange, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_chasecam4 = {"chasecam4", "On", CV_CALL, CV_OnOff, ChaseCam4_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_chasecam = {"chasecam", "On", CV_CALL, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_chasecam2 = {"chasecam2", "On", CV_CALL, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_chasecam3 = {"chasecam3", "On", CV_CALL, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_chasecam4 = {"chasecam4", "On", CV_CALL, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_flipcam = {"flipcam", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_flipcam2 = {"flipcam2", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam2_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_flipcam3 = {"flipcam3", "No", CV_SAVE|CV_CALL|CV_NOINIT, CV_YesNo, FlipCam3_OnChange, 0, NULL, NULL, 0, 0, NULL}; @@ -232,7 +228,7 @@ void SplitScreen_OnChange(void) // recompute screen size R_ExecuteSetViewSize(); - if (!demo.playback && !botingame) + if (!demo.playback) { for (i = 1; i < MAXSPLITSCREENPLAYERS; i++) { @@ -272,47 +268,9 @@ void SplitScreen_OnChange(void) } static void Fov_OnChange(void) { - // Shouldn't be needed with render parity? - //if ((netgame || multiplayer) && !cv_debug && cv_fov.value != 90*FRACUNIT) - // CV_Set(&cv_fov, cv_fov.defaultvalue); - R_SetViewSize(); } -static void ChaseCam_OnChange(void) -{ - /*if (!cv_chasecam.value || !cv_useranalog.value) - CV_SetValue(&cv_analog, 0); - else - CV_SetValue(&cv_analog, 1);*/ -} - -static void ChaseCam2_OnChange(void) -{ - if (botingame) - return; - /*if (!cv_chasecam2.value || !cv_useranalog2.value) - CV_SetValue(&cv_analog2, 0); - else - CV_SetValue(&cv_analog2, 1);*/ -} - -static void ChaseCam3_OnChange(void) -{ - /*if (!cv_chasecam3.value || !cv_useranalog3.value) - CV_SetValue(&cv_analog3, 0); - else - CV_SetValue(&cv_analog3, 1);*/ -} - -static void ChaseCam4_OnChange(void) -{ - /*if (!cv_chasecam4.value || !cv_useranalog4.value) - CV_SetValue(&cv_analog4, 0); - else - CV_SetValue(&cv_analog4, 1);*/ -} - static void FlipCam_OnChange(void) { SendWeaponPref(); diff --git a/src/s_sound.c b/src/s_sound.c index b87aecdfb..41e27406d 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -646,58 +646,6 @@ void S_StartSound(const void *origin, sfxenum_t sfx_id) if (S_SoundDisabled()) return; - if (mariomode) // Sounds change in Mario mode! - { - switch (sfx_id) - { -// case sfx_altow1: -// case sfx_altow2: -// case sfx_altow3: -// case sfx_altow4: -// sfx_id = sfx_mario8; -// break; - case sfx_thok: - sfx_id = sfx_mario7; - break; - case sfx_pop: - sfx_id = sfx_mario5; - break; - case sfx_jump: - sfx_id = sfx_mario6; - break; - case sfx_shield: - sfx_id = sfx_mario3; - break; - case sfx_itemup: - sfx_id = sfx_mario4; - break; -// case sfx_tink: -// sfx_id = sfx_mario1; -// break; -// case sfx_cgot: -// sfx_id = sfx_mario9; -// break; -// case sfx_lose: -// sfx_id = sfx_mario2; -// break; - default: - break; - } - } - if (maptol & TOL_XMAS) // Some sounds change for xmas - { - switch (sfx_id) - { - case sfx_ideya: - case sfx_nbmper: - case sfx_ncitem: - case sfx_ngdone: - ++sfx_id; - default: - break; - } - } - // the volume is handled 8 bits #ifdef HW3SOUND if (hws_mode != HWS_DEFAULT_MODE)