2019-11-20 16:21:32 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 2010-2019 EDuke32 developers and contributors
|
|
|
|
Copyright (C) 2019 sirlemonhead, Nuke.YKT
|
|
|
|
This file is part of PCExhumed.
|
|
|
|
PCExhumed 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"
|
2020-09-06 10:44:58 +00:00
|
|
|
#include "automap.h"
|
2019-08-26 03:59:14 +00:00
|
|
|
#include "aistuff.h"
|
|
|
|
#include "player.h"
|
|
|
|
#include "view.h"
|
|
|
|
#include "engine.h"
|
|
|
|
#include "sound.h"
|
|
|
|
#include "exhumed.h"
|
2021-01-01 22:38:15 +00:00
|
|
|
#include "input.h"
|
2019-12-27 09:52:40 +00:00
|
|
|
#include "mapinfo.h"
|
2019-12-25 23:21:04 +00:00
|
|
|
#include "gamecontrol.h"
|
2020-04-28 21:11:33 +00:00
|
|
|
#include "v_video.h"
|
2020-08-23 06:22:59 +00:00
|
|
|
#include "status.h"
|
2019-08-26 03:59:14 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
2020-09-08 16:28:41 +00:00
|
|
|
#include "statusbar.h"
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-11-22 23:11:37 +00:00
|
|
|
BEGIN_PS_NS
|
|
|
|
|
2019-08-26 03:59:14 +00:00
|
|
|
enum
|
|
|
|
{
|
2019-08-31 07:47:15 +00:00
|
|
|
kTagRamses = 61,
|
2019-08-26 03:59:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
int initx, inity, initz;
|
2021-11-07 19:14:44 +00:00
|
|
|
short inita;
|
|
|
|
int initsect;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
|
|
|
short nCurChunkNum = 0;
|
|
|
|
|
2021-09-17 13:33:07 +00:00
|
|
|
DExhumedActor* nBodyGunSprite[50];
|
2019-08-26 03:59:14 +00:00
|
|
|
int movefifoend;
|
|
|
|
int movefifopos;
|
|
|
|
|
|
|
|
short nCurBodyGunNum;
|
|
|
|
|
2021-11-09 16:32:50 +00:00
|
|
|
int SectSoundSect[kMaxSectors] = { 0 };
|
2019-08-26 03:59:14 +00:00
|
|
|
short SectSound[kMaxSectors] = { 0 };
|
|
|
|
short SectFlag[kMaxSectors] = { 0 };
|
|
|
|
int SectDepth[kMaxSectors] = { 0 };
|
|
|
|
int SectAbove[kMaxSectors] = { 0 };
|
|
|
|
short SectDamage[kMaxSectors] = { 0 };
|
|
|
|
short SectSpeed[kMaxSectors] = { 0 };
|
|
|
|
int SectBelow[kMaxSectors] = { 0 };
|
|
|
|
|
2021-10-17 16:23:42 +00:00
|
|
|
int Counters[kNumCounters];
|
|
|
|
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2020-08-18 08:28:19 +00:00
|
|
|
uint8_t bIsVersion6 = true;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-04-30 14:21:37 +00:00
|
|
|
uint8_t LoadLevel(MapRecord* map)
|
2019-08-26 03:59:14 +00:00
|
|
|
{
|
2021-05-02 13:54:19 +00:00
|
|
|
if (map->gameflags & LEVEL_EX_COUNTDOWN)
|
2020-08-23 06:22:59 +00:00
|
|
|
{
|
|
|
|
lCountDown = 81000;
|
|
|
|
nAlarmTicks = 30;
|
|
|
|
nRedTicks = 0;
|
|
|
|
nClockVal = 0;
|
|
|
|
nEnergyTowers = 0;
|
|
|
|
}
|
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
initspritelists();
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
|
|
|
|
// init stuff
|
|
|
|
{
|
|
|
|
StopAllSounds();
|
2020-08-23 12:39:14 +00:00
|
|
|
nCreaturesKilled = 0;
|
|
|
|
nCreaturesTotal = 0;
|
2019-08-31 07:47:15 +00:00
|
|
|
nFreeze = 0;
|
2021-10-21 22:08:40 +00:00
|
|
|
pSpiritSprite = nullptr;
|
2021-02-18 10:46:36 +00:00
|
|
|
PlayClock = 0;
|
2021-10-17 16:23:42 +00:00
|
|
|
memset(Counters, 0, sizeof(Counters));
|
2019-08-31 07:47:15 +00:00
|
|
|
|
|
|
|
InitQueens();
|
|
|
|
InitRats();
|
|
|
|
InitBullets();
|
|
|
|
InitWeapons();
|
|
|
|
InitAnims();
|
|
|
|
InitSnakes();
|
|
|
|
InitLights();
|
2020-09-06 08:42:39 +00:00
|
|
|
ClearAutomap();
|
2019-08-31 07:47:15 +00:00
|
|
|
InitObjects();
|
|
|
|
InitPushBlocks();
|
2021-10-18 16:57:16 +00:00
|
|
|
InitPlayer();
|
2019-08-31 07:47:15 +00:00
|
|
|
InitItems();
|
|
|
|
|
2021-05-02 13:54:19 +00:00
|
|
|
if (map->gameflags & LEVEL_EX_COUNTDOWN) {
|
2019-08-31 07:47:15 +00:00
|
|
|
InitEnergyTile();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-02 13:54:19 +00:00
|
|
|
if (map->gameflags & LEVEL_EX_ALTSOUND)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
|
|
|
nSwitchSound = 35;
|
|
|
|
nStoneSound = 23;
|
|
|
|
nElevSound = 51;
|
|
|
|
nStopSound = 35;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
nSwitchSound = 33;
|
|
|
|
nStoneSound = 23;
|
|
|
|
nElevSound = 23;
|
|
|
|
nStopSound = 66;
|
|
|
|
}
|
|
|
|
|
2019-08-27 06:08:18 +00:00
|
|
|
vec3_t startPos;
|
2020-09-22 19:44:33 +00:00
|
|
|
engineLoadBoard(currentLevel->fileName, 0, &startPos, &inita, &initsect);
|
2019-08-27 06:08:18 +00:00
|
|
|
initx = startPos.x;
|
|
|
|
inity = startPos.y;
|
|
|
|
initz = startPos.z;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
int i;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
for (i = 0; i < kMaxPlayers; i++)
|
|
|
|
{
|
2021-10-21 20:39:17 +00:00
|
|
|
PlayerList[i].pActor = nullptr;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2020-07-14 22:06:19 +00:00
|
|
|
psky_t* pSky = tileSetupSky(DEFAULTPSKY);
|
2019-08-27 06:08:18 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
pSky->tileofs[0] = 0;
|
|
|
|
pSky->tileofs[1] = 0;
|
|
|
|
pSky->tileofs[2] = 0;
|
|
|
|
pSky->tileofs[3] = 0;
|
2019-08-27 06:08:18 +00:00
|
|
|
pSky->yoffs = 256;
|
2021-05-08 20:08:05 +00:00
|
|
|
pSky->yoffs2 = 256;
|
2019-08-27 06:08:18 +00:00
|
|
|
pSky->lognumtiles = 2;
|
2019-08-31 19:20:01 +00:00
|
|
|
pSky->horizfrac = 65536;
|
|
|
|
pSky->yscale = 65536;
|
|
|
|
parallaxtype = 2;
|
2020-12-06 19:25:23 +00:00
|
|
|
g_visibility = 1024;
|
2019-08-31 19:20:01 +00:00
|
|
|
flash = 0;
|
2019-08-31 07:47:15 +00:00
|
|
|
precache();
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
LoadObjects();
|
2020-08-18 08:28:19 +00:00
|
|
|
return true;
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
2021-04-30 14:21:37 +00:00
|
|
|
void InitLevel(MapRecord* map)
|
2020-08-23 06:22:59 +00:00
|
|
|
{
|
|
|
|
StopCD();
|
2021-04-30 14:21:37 +00:00
|
|
|
currentLevel = map;
|
|
|
|
if (!LoadLevel(map)) {
|
|
|
|
I_Error("Cannot load %s...\n", map->fileName.GetChars());
|
2020-08-23 06:22:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for (int i = 0; i < nTotalPlayers; i++)
|
|
|
|
{
|
|
|
|
SetSavePoint(i, initx, inity, initz, initsect, inita);
|
|
|
|
RestartPlayer(i);
|
|
|
|
InitPlayerKeys(i);
|
|
|
|
}
|
2020-09-04 19:59:38 +00:00
|
|
|
EndLevel = 0;
|
2020-08-23 06:22:59 +00:00
|
|
|
ResetView();
|
|
|
|
ResetEngine();
|
|
|
|
totalmoves = 0;
|
|
|
|
GrabPalette();
|
|
|
|
ResetMoveFifo();
|
|
|
|
lPlayerXVel = 0;
|
|
|
|
lPlayerYVel = 0;
|
|
|
|
movefifopos = movefifoend;
|
|
|
|
|
2021-05-11 23:58:42 +00:00
|
|
|
if (!mus_redbook && map->music.IsNotEmpty()) Mus_Play(map->music, true); // Allow non-CD music if defined for the current level
|
2021-05-02 13:54:19 +00:00
|
|
|
playCDtrack(map->cdSongId, true);
|
2020-09-08 16:28:41 +00:00
|
|
|
setLevelStarted(currentLevel);
|
2020-08-23 06:22:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void InitNewGame()
|
|
|
|
{
|
|
|
|
bCamera = false;
|
|
|
|
PlayerCount = 0;
|
|
|
|
|
|
|
|
for (int i = 0; i < nTotalPlayers; i++)
|
|
|
|
{
|
|
|
|
int nPlayer = GrabPlayer();
|
|
|
|
if (nPlayer < 0) {
|
|
|
|
I_Error("Can't create local player\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
InitPlayerInventory(nPlayer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-08-26 03:59:14 +00:00
|
|
|
void SetBelow(short nCurSector, short nBelowSector)
|
|
|
|
{
|
2019-08-31 07:47:15 +00:00
|
|
|
SectBelow[nCurSector] = nBelowSector;
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SetAbove(short nCurSector, short nAboveSector)
|
|
|
|
{
|
2019-08-31 07:47:15 +00:00
|
|
|
SectAbove[nCurSector] = nAboveSector;
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
2021-11-09 16:27:54 +00:00
|
|
|
void SnapSectors(int nSectorA, int nSectorB, int b)
|
2019-08-26 03:59:14 +00:00
|
|
|
{
|
2019-08-31 07:47:15 +00:00
|
|
|
// edx - nSectorA
|
|
|
|
// eax - nSectorB
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2021-11-09 16:27:54 +00:00
|
|
|
int nWallA = sector[nSectorA].wallptr;
|
|
|
|
int nWallB = sector[nSectorB].wallptr;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2021-11-09 16:27:54 +00:00
|
|
|
int num1 = sector[nSectorA].wallnum;
|
|
|
|
int num2 = sector[nSectorB].wallnum;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
int nCount = 0;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
while (num1 > nCount)
|
|
|
|
{
|
2021-11-17 23:59:02 +00:00
|
|
|
int dx = nWallB;
|
2019-11-20 16:21:32 +00:00
|
|
|
|
2021-11-17 23:59:02 +00:00
|
|
|
int bestx = 0x7FFFFFF;
|
|
|
|
int besty = bestx;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
int x = wall[nWallA].x;
|
|
|
|
int y = wall[nWallA].y;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2021-11-17 23:59:02 +00:00
|
|
|
walltype* bestwall = nullptr;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-11-20 16:21:32 +00:00
|
|
|
int nCount2 = 0;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
while (nCount2 < num2)
|
|
|
|
{
|
2021-11-17 23:59:02 +00:00
|
|
|
auto wal = &wall[dx];
|
|
|
|
int thisx = x - wal->x;
|
|
|
|
int thisy = y - wal->y;
|
|
|
|
int thisdist = abs(thisx) + abs(thisy);
|
|
|
|
int bestdist = abs(bestx) + abs(besty);
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2021-11-17 23:59:02 +00:00
|
|
|
if (thisdist < bestdist)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-11-17 23:59:02 +00:00
|
|
|
bestx = thisx;
|
|
|
|
besty = thisy;
|
|
|
|
bestwall = wal;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
dx++;
|
|
|
|
nCount2++;
|
|
|
|
}
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2021-11-18 00:15:18 +00:00
|
|
|
dragpoint(bestwall, bestwall->x + bestx, bestwall->y + besty);
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
nCount++;
|
|
|
|
nWallA++;
|
|
|
|
}
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
if (b) {
|
|
|
|
sector[nSectorB].ceilingz = sector[nSectorA].floorz;
|
|
|
|
}
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
if (SectFlag[nSectorA] & 0x1000) {
|
|
|
|
SnapBobs(nSectorA, nSectorB);
|
|
|
|
}
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void InitSectFlag()
|
|
|
|
{
|
2019-08-31 07:47:15 +00:00
|
|
|
for (int i = 0; i < kMaxSectors; i++)
|
|
|
|
{
|
|
|
|
SectSoundSect[i] = -1;
|
|
|
|
SectSound[i] = -1;
|
|
|
|
SectAbove[i] = -1;
|
|
|
|
SectBelow[i] = -1;
|
|
|
|
SectDepth[i] = 0;
|
|
|
|
SectFlag[i] = 0;
|
|
|
|
SectSpeed[i] = 0;
|
|
|
|
SectDamage[i] = 0;
|
|
|
|
}
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
2021-10-21 22:08:40 +00:00
|
|
|
void ProcessSpriteTag(DExhumedActor* pActor, short nLotag, short nHitag)
|
2019-08-26 03:59:14 +00:00
|
|
|
{
|
2021-10-17 16:23:42 +00:00
|
|
|
auto pSprite = &pActor->s();
|
2020-02-04 21:45:10 +00:00
|
|
|
int nChannel = runlist_AllocChannel(nHitag % 1000);
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2020-02-04 21:45:10 +00:00
|
|
|
int nSpeed = nLotag / 1000;
|
|
|
|
if (!nSpeed) {
|
|
|
|
nSpeed = 1;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
|
2020-02-04 21:45:10 +00:00
|
|
|
int nVal = nHitag;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2020-02-04 21:45:10 +00:00
|
|
|
if (nLotag >= 900 && nLotag <= 949)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-10-21 16:28:06 +00:00
|
|
|
ProcessTrailSprite(pActor, nLotag, nHitag);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// handle tags 6 to 60
|
2020-02-04 21:45:10 +00:00
|
|
|
switch (nLotag)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
|
|
|
case 8: // M-60 ammo belt
|
|
|
|
{
|
2020-02-04 21:45:10 +00:00
|
|
|
nVal = 3 * (nHitag / 3);
|
2019-08-31 07:47:15 +00:00
|
|
|
// fall through to 6,7 etc
|
2021-12-14 11:05:24 +00:00
|
|
|
[[fallthrough]];
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
case 6:
|
|
|
|
case 7:
|
|
|
|
case 9:
|
|
|
|
case 10:
|
|
|
|
case 11:
|
|
|
|
case 15:
|
|
|
|
case 17:
|
|
|
|
case 18:
|
|
|
|
case 19:
|
|
|
|
case 20:
|
|
|
|
case 21:
|
|
|
|
case 22:
|
|
|
|
case 23:
|
|
|
|
case 24:
|
|
|
|
case 26:
|
|
|
|
case 28:
|
|
|
|
case 29:
|
|
|
|
case 30:
|
|
|
|
case 31:
|
|
|
|
case 32:
|
|
|
|
case 33:
|
|
|
|
case 34:
|
|
|
|
case 35:
|
|
|
|
case 36:
|
|
|
|
case 37:
|
|
|
|
case 39:
|
|
|
|
case 40:
|
|
|
|
case 41:
|
|
|
|
case 42:
|
|
|
|
case 43:
|
|
|
|
case 44:
|
|
|
|
case 45:
|
|
|
|
case 46:
|
|
|
|
case 47:
|
|
|
|
case 48:
|
|
|
|
case 49:
|
|
|
|
case 50:
|
|
|
|
case 51:
|
|
|
|
case 52:
|
|
|
|
case 53:
|
|
|
|
case 54:
|
|
|
|
case 55:
|
|
|
|
case 56:
|
|
|
|
case 57:
|
|
|
|
case 58:
|
|
|
|
case 60:
|
|
|
|
{
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->hitag = nVal;
|
2021-10-21 07:50:00 +00:00
|
|
|
ChangeActorStat(pActor, nLotag + 900);
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->cstat &= 0xFEFE;
|
2021-10-21 07:50:00 +00:00
|
|
|
BuildItemAnim(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 12: // berry twig
|
|
|
|
{
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->hitag = 40;
|
2021-10-21 07:50:00 +00:00
|
|
|
ChangeActorStat(pActor, nLotag + 900);
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->cstat &= 0xFEFE;
|
2021-10-21 07:50:00 +00:00
|
|
|
BuildItemAnim(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 13: // blood bowl
|
|
|
|
{
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->hitag = 160;
|
2021-10-21 07:50:00 +00:00
|
|
|
ChangeActorStat(pActor, nLotag + 900);
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->cstat &= 0xFEFE;
|
2021-10-21 07:50:00 +00:00
|
|
|
BuildItemAnim(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 14: // venom bowl
|
|
|
|
{
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->hitag = -200;
|
2021-10-21 07:50:00 +00:00
|
|
|
ChangeActorStat(pActor, nLotag + 900);
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->cstat &= 0xFEFE;
|
2021-10-21 07:50:00 +00:00
|
|
|
BuildItemAnim(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 16:
|
|
|
|
// reserved
|
2021-10-20 21:05:27 +00:00
|
|
|
DeleteActor(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
case 25:
|
|
|
|
case 59:
|
|
|
|
{
|
|
|
|
// extra life or checkpoint scarab. Delete for multiplayer
|
|
|
|
if (nNetPlayerCount != 0)
|
|
|
|
{
|
2021-10-20 21:05:27 +00:00
|
|
|
DeleteActor(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->hitag = nVal;
|
2021-10-21 07:50:00 +00:00
|
|
|
ChangeActorStat(pActor, nLotag + 900);
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->cstat &= 0xFEFE;
|
2021-10-21 07:50:00 +00:00
|
|
|
BuildItemAnim(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 27:
|
|
|
|
{
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->hitag = 1;
|
2021-10-21 07:50:00 +00:00
|
|
|
ChangeActorStat(pActor, 9 + 900);
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->cstat &= 0xFEFE;
|
2021-10-21 07:50:00 +00:00
|
|
|
BuildItemAnim(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 38: // raw energy
|
|
|
|
{
|
|
|
|
nVal++;
|
|
|
|
nVal--; // CHECKME ??
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->hitag = nVal;
|
2021-10-21 07:50:00 +00:00
|
|
|
ChangeActorStat(pActor, nLotag + 900);
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->cstat &= 0xFEFE;
|
2021-10-21 07:50:00 +00:00
|
|
|
BuildItemAnim(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-04 21:45:10 +00:00
|
|
|
int v6 = nLotag % 1000;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2020-08-22 18:14:00 +00:00
|
|
|
if (!userConfig.nomonsters || v6 < 100 || v6 > 118)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
|
|
|
if (v6 > 999) {
|
2021-10-20 21:05:27 +00:00
|
|
|
DeleteActor(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (v6)
|
|
|
|
{
|
|
|
|
case 999:
|
|
|
|
{
|
2021-09-06 06:33:02 +00:00
|
|
|
AddFlicker(pSprite->sectnum, nSpeed);
|
2019-08-31 07:47:15 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 998:
|
|
|
|
{
|
2021-09-06 06:33:02 +00:00
|
|
|
AddGlow(pSprite->sectnum, nSpeed);
|
2019-08-31 07:47:15 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 118: // Anubis with drum
|
|
|
|
{
|
2020-08-22 18:14:00 +00:00
|
|
|
if (userConfig.nomonsters) {
|
2021-10-20 21:05:27 +00:00
|
|
|
DeleteActor(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-10-17 16:23:42 +00:00
|
|
|
BuildAnubis(pActor, 0, 0, 0, 0, 0, 1);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 117:
|
|
|
|
{
|
2020-08-22 18:14:00 +00:00
|
|
|
if (userConfig.nomonsters) {
|
2021-10-20 21:05:27 +00:00
|
|
|
DeleteActor(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-10-24 11:20:50 +00:00
|
|
|
BuildWasp(pActor, 0, 0, 0, 0, 0, false);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 116:
|
|
|
|
{
|
2021-10-17 21:06:15 +00:00
|
|
|
BuildRat(pActor, 0, 0, 0, 0, -1);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 115: // Rat (eating)
|
|
|
|
{
|
2021-10-17 21:06:15 +00:00
|
|
|
BuildRat(pActor, 0, 0, 0, 0, 0);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 113:
|
|
|
|
{
|
2021-10-26 19:10:51 +00:00
|
|
|
BuildQueen(pActor, 0, 0, 0, 0, 0, nChannel);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 112:
|
|
|
|
{
|
2021-10-18 16:57:16 +00:00
|
|
|
BuildScorp(pActor, 0, 0, 0, 0, 0, nChannel);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 111:
|
|
|
|
{
|
2020-08-22 18:14:00 +00:00
|
|
|
if (userConfig.nomonsters) {
|
2021-10-20 21:05:27 +00:00
|
|
|
DeleteActor(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-10-19 17:53:42 +00:00
|
|
|
BuildSet(pActor, 0, 0, 0, 0, 0, nChannel);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 108:
|
|
|
|
{
|
2020-08-22 18:14:00 +00:00
|
|
|
if (userConfig.nomonsters) {
|
2021-10-20 21:05:27 +00:00
|
|
|
DeleteActor(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-10-17 19:06:56 +00:00
|
|
|
BuildLava(pActor, 0, 0, 0, 0, 0, nChannel);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 107:
|
|
|
|
{
|
2020-08-22 18:14:00 +00:00
|
|
|
if (userConfig.nomonsters) {
|
2021-10-20 21:05:27 +00:00
|
|
|
DeleteActor(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-10-17 22:28:59 +00:00
|
|
|
BuildRex(pActor, 0, 0, 0, 0, 0, nChannel);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
2019-11-20 16:21:32 +00:00
|
|
|
case 106:
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2020-08-22 18:14:00 +00:00
|
|
|
if (userConfig.nomonsters) {
|
2021-10-20 21:05:27 +00:00
|
|
|
DeleteActor(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-10-23 11:02:43 +00:00
|
|
|
BuildFish(pActor, 0, 0, 0, 0, 0);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 105:
|
|
|
|
{
|
2020-08-22 18:14:00 +00:00
|
|
|
if (userConfig.nomonsters) {
|
2021-10-20 21:05:27 +00:00
|
|
|
DeleteActor(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-10-18 16:57:16 +00:00
|
|
|
BuildSpider(pActor, 0, 0, 0, 0, 0);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 104:
|
|
|
|
{
|
2020-08-22 18:14:00 +00:00
|
|
|
if (userConfig.nomonsters) {
|
2021-10-20 21:05:27 +00:00
|
|
|
DeleteActor(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-10-18 16:54:35 +00:00
|
|
|
BuildRoach(1, pActor, 0, 0, 0, 0, 0);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 103:
|
|
|
|
{
|
2020-08-22 18:14:00 +00:00
|
|
|
if (userConfig.nomonsters) {
|
2021-10-20 21:05:27 +00:00
|
|
|
DeleteActor(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-10-18 16:54:35 +00:00
|
|
|
BuildRoach(0, pActor, 0, 0, 0, 0, 0);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 102:
|
|
|
|
{
|
2020-08-22 18:14:00 +00:00
|
|
|
if (userConfig.nomonsters) {
|
2021-10-20 21:05:27 +00:00
|
|
|
DeleteActor(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-10-17 20:03:08 +00:00
|
|
|
BuildLion(pActor, 0, 0, 0, 0, 0);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 101:
|
|
|
|
{
|
2020-08-22 18:14:00 +00:00
|
|
|
if (userConfig.nomonsters) {
|
2021-10-20 21:05:27 +00:00
|
|
|
DeleteActor(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-10-17 23:05:38 +00:00
|
|
|
BuildMummy(pActor, 0, 0, 0, 0, 0);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 100:
|
|
|
|
{
|
2020-08-22 18:14:00 +00:00
|
|
|
if (userConfig.nomonsters) {
|
2021-10-20 21:05:27 +00:00
|
|
|
DeleteActor(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-10-17 16:23:42 +00:00
|
|
|
BuildAnubis(pActor, 0, 0, 0, 0, 0, 0);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 99: // underwater type 2
|
|
|
|
{
|
2021-11-09 16:27:54 +00:00
|
|
|
int nSector =pSprite->sectnum;
|
2020-02-04 21:45:10 +00:00
|
|
|
SetAbove(nSector, nHitag);
|
2019-08-31 07:47:15 +00:00
|
|
|
SectFlag[nSector] |= kSectUnderwater;
|
|
|
|
|
2021-10-20 21:05:27 +00:00
|
|
|
DeleteActor(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 98:
|
|
|
|
{
|
2021-11-09 16:27:54 +00:00
|
|
|
int nSector =pSprite->sectnum;
|
2020-02-04 21:45:10 +00:00
|
|
|
SetBelow(nSector, nHitag);
|
|
|
|
SnapSectors(nSector, nHitag, 1);
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-20 21:05:27 +00:00
|
|
|
DeleteActor(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 97:
|
|
|
|
{
|
2021-09-06 06:33:02 +00:00
|
|
|
AddSectorBob(pSprite->sectnum, nHitag, 1);
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-20 21:05:27 +00:00
|
|
|
DeleteActor(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 96: // Lava sector
|
|
|
|
{
|
2020-02-04 21:45:10 +00:00
|
|
|
int nDamage = nHitag / 4;
|
|
|
|
if (!nDamage) {
|
|
|
|
nDamage = 1;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
|
2021-11-09 16:27:54 +00:00
|
|
|
int nSector =pSprite->sectnum;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2020-02-04 21:45:10 +00:00
|
|
|
SectDamage[nSector] = nDamage;
|
2019-08-31 07:47:15 +00:00
|
|
|
SectFlag[nSector] |= kSectLava;
|
|
|
|
|
2021-10-20 21:05:27 +00:00
|
|
|
DeleteActor(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 95:
|
|
|
|
{
|
2021-09-06 06:33:02 +00:00
|
|
|
AddSectorBob(pSprite->sectnum, nHitag, 0);
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-20 21:05:27 +00:00
|
|
|
DeleteActor(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 94: // water
|
|
|
|
{
|
2021-11-09 16:27:54 +00:00
|
|
|
int nSector =pSprite->sectnum;
|
2020-02-04 21:45:10 +00:00
|
|
|
SectDepth[nSector] = nHitag << 8;
|
2019-11-20 16:21:32 +00:00
|
|
|
|
2021-10-20 21:05:27 +00:00
|
|
|
DeleteActor(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 93:
|
|
|
|
{
|
2021-10-18 21:53:37 +00:00
|
|
|
BuildBubbleMachine(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 90:
|
|
|
|
{
|
2021-10-21 15:24:52 +00:00
|
|
|
BuildObject(pActor, 3, nHitag);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 79:
|
|
|
|
case 89:
|
|
|
|
{
|
2021-11-09 16:27:54 +00:00
|
|
|
int nSector =pSprite->sectnum;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2020-02-04 21:45:10 +00:00
|
|
|
SectSpeed[nSector] = nSpeed;
|
2021-09-06 06:33:02 +00:00
|
|
|
SectFlag[nSector] |= pSprite->ang;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-20 21:05:27 +00:00
|
|
|
DeleteActor(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 88:
|
|
|
|
{
|
2021-10-21 09:26:47 +00:00
|
|
|
AddFlow(pSprite->sectnum, nSpeed, 0, pSprite->ang);
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-20 21:05:27 +00:00
|
|
|
DeleteActor(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 80: // underwater
|
|
|
|
{
|
2021-11-09 16:27:54 +00:00
|
|
|
int nSector =pSprite->sectnum;
|
2019-08-31 07:47:15 +00:00
|
|
|
SectFlag[nSector] |= kSectUnderwater;
|
|
|
|
|
2021-10-20 21:05:27 +00:00
|
|
|
DeleteActor(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 78:
|
|
|
|
{
|
2021-10-21 09:26:47 +00:00
|
|
|
AddFlow(pSprite->sectnum, nSpeed, 1, pSprite->ang);
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-11-09 16:27:54 +00:00
|
|
|
int nSector =pSprite->sectnum;
|
2019-08-31 07:47:15 +00:00
|
|
|
SectFlag[nSector] |= 0x8000;
|
|
|
|
|
2021-10-20 21:05:27 +00:00
|
|
|
DeleteActor(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 77:
|
|
|
|
{
|
2021-10-21 11:09:29 +00:00
|
|
|
int nArrow = BuildArrow(pActor, nSpeed);
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 16:37:39 +00:00
|
|
|
runlist_AddRunRec(sRunChannels[nChannel].a, nArrow, 0x1F0000);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 76: // Explosion Trigger (Exploding Fire Cauldron)
|
|
|
|
{
|
2021-10-21 15:24:52 +00:00
|
|
|
BuildObject(pActor, 0, nHitag);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 75: // Explosion Target (Cauldrons, fireballs and grenades will destroy nearby 75 sprites)
|
|
|
|
{
|
2021-10-21 15:24:52 +00:00
|
|
|
BuildObject(pActor, 1, nHitag);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 71:
|
|
|
|
{
|
2021-10-21 11:09:29 +00:00
|
|
|
int nFireball = BuildFireBall(pActor, nHitag, nSpeed);
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 16:37:39 +00:00
|
|
|
runlist_AddRunRec(sRunChannels[nChannel].a, nFireball, 0x1F0000);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 70:
|
|
|
|
{
|
2021-10-21 16:28:06 +00:00
|
|
|
BuildDrip(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 63:
|
|
|
|
{
|
2021-10-21 07:50:00 +00:00
|
|
|
ChangeActorStat(pActor, 405);
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->cstat = 0x8000;
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 62:
|
|
|
|
{
|
2021-10-21 08:41:41 +00:00
|
|
|
nNetStartSprite[nNetStartSprites] = pActor;
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->cstat = 0x8000;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
|
|
|
nNetStartSprites++;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
case kTagRamses: // Ramses head
|
|
|
|
{
|
2021-10-21 22:08:40 +00:00
|
|
|
pSpiritSprite = pActor;
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->cstat |= 0x8000;
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
default: // TODO - checkme!
|
|
|
|
{
|
2021-10-20 21:05:27 +00:00
|
|
|
DeleteActor(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-20 21:05:27 +00:00
|
|
|
DeleteActor(pActor);
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ExamineSprites()
|
|
|
|
{
|
2019-08-31 07:47:15 +00:00
|
|
|
nNetStartSprites = 0;
|
|
|
|
nCurStartSprite = 0;
|
|
|
|
|
2021-10-19 18:03:11 +00:00
|
|
|
ExhumedLinearSpriteIterator it;
|
|
|
|
while (auto ac = it.Next())
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-10-19 18:03:11 +00:00
|
|
|
auto pSprite = &ac->s();
|
2021-09-06 06:33:02 +00:00
|
|
|
|
|
|
|
int nStatus = pSprite->statnum;
|
2019-08-31 07:47:15 +00:00
|
|
|
if (!nStatus)
|
|
|
|
{
|
2021-11-16 17:45:07 +00:00
|
|
|
int lotag = pSprite->lotag;
|
|
|
|
int hitag = pSprite->hitag;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
|
|
|
if ((nStatus < kMaxStatus) && lotag)
|
|
|
|
{
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->lotag = 0;
|
|
|
|
pSprite->hitag = 0;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-21 22:08:40 +00:00
|
|
|
ProcessSpriteTag(ac, lotag, hitag);
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-10-19 18:03:11 +00:00
|
|
|
ChangeActorStat(ac, 0);
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (nNetPlayerCount)
|
|
|
|
{
|
2021-10-21 08:41:41 +00:00
|
|
|
auto pActor = insertActor(initsect, 0);
|
|
|
|
auto pSprite = &pActor->s();
|
2021-09-06 06:33:02 +00:00
|
|
|
|
|
|
|
pSprite->x = initx;
|
|
|
|
pSprite->y = inity;
|
|
|
|
pSprite->z = initz;
|
|
|
|
pSprite->cstat = 0x8000;
|
2021-10-21 08:41:41 +00:00
|
|
|
nNetStartSprite[nNetStartSprites] = pActor;
|
2019-08-31 07:47:15 +00:00
|
|
|
nNetStartSprites++;
|
|
|
|
}
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void LoadObjects()
|
|
|
|
{
|
2019-08-31 07:47:15 +00:00
|
|
|
runlist_InitRun();
|
|
|
|
runlist_InitChan();
|
|
|
|
InitLink();
|
|
|
|
InitPoint();
|
|
|
|
InitSlide();
|
|
|
|
InitSwitch();
|
|
|
|
InitElev();
|
|
|
|
InitWallFace();
|
|
|
|
InitSectFlag();
|
|
|
|
|
|
|
|
for (int nSector = 0; nSector < numsectors; nSector++)
|
|
|
|
{
|
2021-11-07 22:52:45 +00:00
|
|
|
auto sectp = §or[nSector];
|
2021-11-16 17:45:07 +00:00
|
|
|
int hitag = sectp->hitag;
|
|
|
|
int lotag = sectp->lotag;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-11-07 22:52:45 +00:00
|
|
|
sectp->hitag = 0;
|
|
|
|
sectp->lotag = 0;
|
|
|
|
sectp->extra = -1;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
|
|
|
if (hitag || lotag)
|
|
|
|
{
|
2021-11-07 22:52:45 +00:00
|
|
|
sectp->lotag = runlist_HeadRun() + 1;
|
|
|
|
sectp->hitag = lotag;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
|
|
|
runlist_ProcessSectorTag(nSector, lotag, hitag);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (int nWall = 0; nWall < numwalls; nWall++)
|
|
|
|
{
|
|
|
|
wall[nWall].extra = -1;
|
|
|
|
|
2021-11-16 17:45:07 +00:00
|
|
|
int lotag = wall[nWall].lotag;
|
|
|
|
int hitag = wall[nWall].hitag;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
|
|
|
wall[nWall].lotag = 0;
|
|
|
|
|
|
|
|
if (hitag || lotag)
|
|
|
|
{
|
|
|
|
wall[nWall].lotag = runlist_HeadRun() + 1;
|
|
|
|
runlist_ProcessWallTag(nWall, lotag, hitag);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ExamineSprites();
|
|
|
|
PostProcess();
|
|
|
|
InitRa();
|
|
|
|
InitChunks();
|
|
|
|
|
2020-01-03 21:56:02 +00:00
|
|
|
for (int nChannel = 0; nChannel < kMaxChannels; nChannel++)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2020-01-03 21:56:02 +00:00
|
|
|
runlist_ChangeChannel(nChannel, 0);
|
|
|
|
runlist_ReadyChannel(nChannel);
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
nCamerax = initx;
|
|
|
|
nCameray = inity;
|
|
|
|
nCameraz = initz;
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
2020-11-30 00:08:19 +00:00
|
|
|
void SerializeInit(FSerializer& arc)
|
|
|
|
{
|
|
|
|
if (arc.BeginObject("init"))
|
|
|
|
{
|
|
|
|
arc("initx", initx)
|
|
|
|
("inity", inity)
|
|
|
|
("initz", initz)
|
|
|
|
("inita", inita)
|
|
|
|
("initsect", initsect)
|
|
|
|
("curchunk", nCurChunkNum)
|
|
|
|
.Array("bodygunsprite", nBodyGunSprite, countof(nBodyGunSprite))
|
|
|
|
("curbodygun", nCurBodyGunNum)
|
|
|
|
.Array("soundsect", SectSoundSect, numsectors)
|
|
|
|
.Array("sectsound", SectSound, numsectors)
|
|
|
|
.Array("sectflag", SectFlag, numsectors)
|
|
|
|
.Array("sectdepth", SectDepth, numsectors)
|
|
|
|
.Array("sectabove", SectAbove, numsectors)
|
|
|
|
.Array("sectdamage", SectDamage, numsectors)
|
|
|
|
.Array("sectspeed", SectSpeed, numsectors)
|
|
|
|
.Array("sectbelow", SectBelow, numsectors)
|
2021-10-17 16:23:42 +00:00
|
|
|
.Array("counters", Counters, kNumCounters)
|
2020-11-30 00:08:19 +00:00
|
|
|
.EndObject();
|
|
|
|
}
|
|
|
|
}
|
2019-12-26 21:00:04 +00:00
|
|
|
|
2019-11-22 23:11:37 +00:00
|
|
|
END_PS_NS
|