2019-08-27 06:08:18 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 2010 EDuke32 developers and contributors
|
|
|
|
|
|
|
|
This file is part of EDuke32.
|
|
|
|
|
|
|
|
EDuke32 is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License version 2
|
|
|
|
as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
2019-11-22 23:11:37 +00:00
|
|
|
#include "ns.h"
|
2019-08-27 06:08:18 +00:00
|
|
|
#include "compat.h"
|
|
|
|
#include "build.h"
|
|
|
|
#include "exhumed.h"
|
2020-07-11 23:22:43 +00:00
|
|
|
#include "player.h"
|
2019-11-26 15:37:47 +00:00
|
|
|
#include "view.h"
|
2020-01-28 10:20:30 +00:00
|
|
|
#include "mapinfo.h"
|
2020-08-22 18:34:58 +00:00
|
|
|
#include "aistuff.h"
|
2021-01-01 22:38:15 +00:00
|
|
|
#include "input.h"
|
2020-08-22 19:13:11 +00:00
|
|
|
#include "cheathandler.h"
|
2020-08-29 15:49:15 +00:00
|
|
|
#include "gamestate.h"
|
2021-02-18 11:14:32 +00:00
|
|
|
#include "gamefuncs.h"
|
2019-08-27 06:08:18 +00:00
|
|
|
|
2019-11-22 23:11:37 +00:00
|
|
|
BEGIN_PS_NS
|
|
|
|
|
2020-11-29 11:23:31 +00:00
|
|
|
void GameInterface::WarpToCoords(int x, int y, int z, int ang, int horz)
|
2020-07-11 23:22:43 +00:00
|
|
|
{
|
|
|
|
Player *nPlayer = &PlayerList[nLocalPlayer];
|
2021-10-19 18:03:11 +00:00
|
|
|
spritetype *pSprite = &nPlayer->Actor()->s();
|
2020-07-11 23:22:43 +00:00
|
|
|
|
2021-01-30 00:22:46 +00:00
|
|
|
pSprite->ox = pSprite->x = x;
|
|
|
|
pSprite->oy = pSprite->y = y;
|
|
|
|
pSprite->oz = pSprite->z = z;
|
2020-07-11 23:22:43 +00:00
|
|
|
|
2020-11-29 11:23:31 +00:00
|
|
|
if (ang != INT_MIN)
|
2020-08-04 12:33:17 +00:00
|
|
|
{
|
2020-11-29 11:23:31 +00:00
|
|
|
nPlayer->angle.oang = nPlayer->angle.ang = buildang(ang);
|
2020-08-04 12:33:17 +00:00
|
|
|
}
|
|
|
|
|
2020-11-29 11:23:31 +00:00
|
|
|
if (horz != INT_MIN)
|
2020-08-04 12:33:17 +00:00
|
|
|
{
|
2020-11-29 11:23:31 +00:00
|
|
|
nPlayer->horizon.ohoriz = nPlayer->horizon.horiz = buildhoriz(horz);
|
2020-08-04 12:33:17 +00:00
|
|
|
}
|
2020-07-11 23:22:43 +00:00
|
|
|
}
|
2019-08-27 06:08:18 +00:00
|
|
|
|
2020-08-22 18:34:58 +00:00
|
|
|
static int osdcmd_doors(CCmdFuncPtr parm)
|
|
|
|
{
|
|
|
|
for (int i = 0; i < kMaxChannels; i++)
|
|
|
|
{
|
|
|
|
// CHECKME - does this toggle?
|
|
|
|
if (sRunChannels[i].c == 0) {
|
|
|
|
runlist_ChangeChannel(i, 1);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
runlist_ChangeChannel(i, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return CCMD_OK;
|
|
|
|
}
|
2019-08-27 06:08:18 +00:00
|
|
|
|
2020-08-22 18:34:58 +00:00
|
|
|
static int osdcmd_spawn(CCmdFuncPtr parm)
|
|
|
|
{
|
|
|
|
if (parm->numparms != 1) return CCMD_SHOWHELP;
|
|
|
|
auto c = parm->parms[0];
|
2021-11-07 10:28:06 +00:00
|
|
|
auto sectp = §or[initsect];
|
|
|
|
if (!stricmp(c, "anubis")) BuildAnubis(nullptr, initx, inity, sectp->floorz, initsect, inita, false);
|
|
|
|
else if (!stricmp(c, "spider")) BuildSpider(nullptr, initx, inity, sectp->floorz, initsect, inita);
|
|
|
|
else if (!stricmp(c, "mummy")) BuildMummy(nullptr, initx, inity, sectp->floorz, initsect, inita);
|
2021-10-21 10:51:16 +00:00
|
|
|
else if (!stricmp(c, "fish")) BuildFish(nullptr, initx, inity, initz + PlayerList[nLocalPlayer].eyelevel, initsect, inita);
|
2021-11-07 10:28:06 +00:00
|
|
|
else if (!stricmp(c, "lion")) BuildLion(nullptr, initx, inity, sectp->floorz, initsect, inita);
|
|
|
|
else if (!stricmp(c, "lava")) BuildLava(nullptr, initx, inity, sectp->floorz, initsect, inita, nNetPlayerCount);
|
|
|
|
else if (!stricmp(c, "rex")) BuildRex(nullptr, initx, inity, sectp->floorz, initsect, inita, nNetPlayerCount);
|
|
|
|
else if (!stricmp(c, "set")) BuildSet(nullptr, initx, inity, sectp->floorz, initsect, inita, nNetPlayerCount);
|
|
|
|
else if (!stricmp(c, "queen")) BuildQueen(nullptr, initx, inity, sectp->floorz, initsect, inita, nNetPlayerCount);
|
|
|
|
else if (!stricmp(c, "roach")) BuildRoach(0, nullptr, initx, inity, sectp->floorz, initsect, inita);
|
|
|
|
else if (!stricmp(c, "roach2")) BuildRoach(1, nullptr, initx, inity, sectp->floorz, initsect, inita);
|
|
|
|
else if (!stricmp(c, "wasp")) BuildWasp(nullptr, initx, inity, sectp->floorz - 25600, initsect, inita, false);
|
|
|
|
else if (!stricmp(c, "scorp")) BuildScorp(nullptr, initx, inity, sectp->floorz, initsect, inita, nNetPlayerCount);
|
|
|
|
else if (!stricmp(c, "rat")) BuildRat(nullptr, initx, inity, sectp->floorz, initsect, inita);
|
2020-08-22 18:34:58 +00:00
|
|
|
else Printf("Unknown creature type %s\n", c);
|
|
|
|
return CCMD_OK;
|
|
|
|
}
|
2019-08-27 06:08:18 +00:00
|
|
|
|
2020-11-29 11:23:31 +00:00
|
|
|
void GameInterface::ToggleThirdPerson()
|
2020-08-29 15:49:15 +00:00
|
|
|
{
|
2020-11-29 11:23:31 +00:00
|
|
|
if (gamestate != GS_LEVEL) return;
|
2020-08-29 15:49:15 +00:00
|
|
|
if (!nFreeze)
|
|
|
|
{
|
2020-09-27 05:46:04 +00:00
|
|
|
bCamera = !bCamera;
|
2019-08-27 06:08:18 +00:00
|
|
|
|
2020-11-30 20:31:47 +00:00
|
|
|
if (bCamera)
|
2020-09-27 06:08:32 +00:00
|
|
|
{
|
2020-08-29 15:49:15 +00:00
|
|
|
GrabPalette();
|
2021-02-18 11:14:32 +00:00
|
|
|
cameradist = 0;
|
|
|
|
cameraclock = INT_MIN;
|
2020-09-27 06:08:32 +00:00
|
|
|
}
|
|
|
|
}
|
2020-08-29 15:49:15 +00:00
|
|
|
}
|
|
|
|
|
2020-09-02 23:32:51 +00:00
|
|
|
|
2020-08-22 18:34:58 +00:00
|
|
|
int32_t registerosdcommands(void)
|
|
|
|
{
|
|
|
|
//if (VOLUMEONE)
|
|
|
|
C_RegisterFunction("doors", "opens/closes doors", osdcmd_doors);
|
|
|
|
C_RegisterFunction("spawn","spawn <creaturetype>: spawns a creature",osdcmd_spawn);
|
2020-07-11 23:22:43 +00:00
|
|
|
|
2019-08-27 06:08:18 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-08-31 09:08:38 +00:00
|
|
|
|
2019-11-22 23:11:37 +00:00
|
|
|
END_PS_NS
|