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"
|
2019-08-26 03:59:14 +00:00
|
|
|
#include "engine.h"
|
2020-08-18 07:52:08 +00:00
|
|
|
#include "aistuff.h"
|
2019-08-26 03:59:14 +00:00
|
|
|
#include "sequence.h"
|
|
|
|
#include "exhumed.h"
|
|
|
|
#include "sound.h"
|
|
|
|
#include <assert.h>
|
|
|
|
|
2019-11-22 23:11:37 +00:00
|
|
|
BEGIN_PS_NS
|
|
|
|
|
2019-08-26 03:59:14 +00:00
|
|
|
struct Lava
|
|
|
|
{
|
2019-08-31 07:47:15 +00:00
|
|
|
short nSprite;
|
2020-03-02 21:08:31 +00:00
|
|
|
short nRun;
|
2019-08-31 07:47:15 +00:00
|
|
|
short nAction;
|
|
|
|
short nTarget;
|
|
|
|
short nHealth;
|
2020-03-02 21:08:31 +00:00
|
|
|
short nFrame;
|
2020-11-29 19:30:17 +00:00
|
|
|
short nIndex;
|
2019-08-26 03:59:14 +00:00
|
|
|
};
|
|
|
|
|
2020-11-29 19:30:17 +00:00
|
|
|
TArray<Lava> LavaList;
|
|
|
|
|
|
|
|
FSerializer& Serialize(FSerializer& arc, const char* keyname, Lava& w, Lava* def)
|
|
|
|
{
|
|
|
|
if (arc.BeginObject(keyname))
|
|
|
|
{
|
|
|
|
arc("health", w.nHealth)
|
|
|
|
("frame", w.nFrame)
|
|
|
|
("action", w.nAction)
|
|
|
|
("sprite", w.nSprite)
|
|
|
|
("target", w.nTarget)
|
|
|
|
("run", w.nRun)
|
|
|
|
("channel", w.nIndex)
|
|
|
|
.EndObject();
|
|
|
|
}
|
|
|
|
return arc;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SerializeLavadude(FSerializer& arc)
|
|
|
|
{
|
|
|
|
arc("lavadude", LavaList);
|
|
|
|
}
|
2019-08-26 03:59:14 +00:00
|
|
|
|
|
|
|
|
2020-10-11 09:33:28 +00:00
|
|
|
static actionSeq LavadudeSeq[] = {
|
2019-08-31 07:47:15 +00:00
|
|
|
{0, 1},
|
|
|
|
{0, 1},
|
|
|
|
{1, 0},
|
|
|
|
{10, 0},
|
|
|
|
{19, 0},
|
|
|
|
{28, 1},
|
|
|
|
{29, 1},
|
|
|
|
{33, 0},
|
|
|
|
{42, 1}
|
2019-08-26 03:59:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
void InitLava()
|
|
|
|
{
|
2020-11-29 19:30:17 +00:00
|
|
|
LavaList.Clear();
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int BuildLavaLimb(int nSprite, int edx, int ebx)
|
|
|
|
{
|
2021-09-06 06:33:02 +00:00
|
|
|
auto pSprite = &sprite[nSprite];
|
|
|
|
short nSector = pSprite->sectnum;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
|
|
|
int nLimbSprite = insertsprite(nSector, 118);
|
|
|
|
assert(nLimbSprite >= 0 && nLimbSprite < kMaxSprites);
|
2021-09-06 06:33:02 +00:00
|
|
|
auto pLimbSprite = &sprite[nLimbSprite];
|
|
|
|
|
|
|
|
pLimbSprite->x = pSprite->x;
|
|
|
|
pLimbSprite->y = pSprite->y;
|
|
|
|
pLimbSprite->z = pSprite->z - RandomLong() % ebx;
|
|
|
|
pLimbSprite->cstat = 0;
|
|
|
|
pLimbSprite->shade = -127;
|
|
|
|
pLimbSprite->pal = 1;
|
|
|
|
pLimbSprite->xvel = (RandomSize(5) - 16) << 8;
|
|
|
|
pLimbSprite->yvel = (RandomSize(5) - 16) << 8;
|
|
|
|
pLimbSprite->zvel = 2560 - (RandomSize(5) << 8);
|
|
|
|
pLimbSprite->xoffset = 0;
|
|
|
|
pLimbSprite->yoffset = 0;
|
|
|
|
pLimbSprite->xrepeat = 90;
|
|
|
|
pLimbSprite->yrepeat = 90;
|
|
|
|
pLimbSprite->picnum = (edx & 3) % 3;
|
|
|
|
pLimbSprite->hitag = 0;
|
|
|
|
pLimbSprite->lotag = runlist_HeadRun() + 1;
|
|
|
|
pLimbSprite->clipdist = 0;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
|
|
|
// GrabTimeSlot(3);
|
|
|
|
|
2021-09-06 06:33:02 +00:00
|
|
|
pLimbSprite->extra = -1;
|
|
|
|
pLimbSprite->owner = runlist_AddRunRec(pLimbSprite->lotag - 1, nLimbSprite | 0x160000);
|
|
|
|
pLimbSprite->hitag = runlist_AddRunRec(NewRun, nLimbSprite | 0x160000);
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
return nLimbSprite;
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
2020-08-28 09:02:13 +00:00
|
|
|
void FuncLavaLimb(int a, int, int nRun)
|
2019-08-26 03:59:14 +00:00
|
|
|
{
|
2019-08-31 07:47:15 +00:00
|
|
|
short nSprite = RunData[nRun].nVal;
|
|
|
|
assert(nSprite >= 0 && nSprite < kMaxSprites);
|
2021-09-06 06:33:02 +00:00
|
|
|
auto pSprite = &sprite[nSprite];
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2020-03-02 21:08:31 +00:00
|
|
|
int nMessage = a & kMessageMask;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
|
|
|
switch (nMessage)
|
|
|
|
{
|
|
|
|
case 0x20000:
|
|
|
|
{
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->shade += 3;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-09-06 06:33:02 +00:00
|
|
|
int nRet = movesprite(nSprite, pSprite->xvel << 12, pSprite->yvel << 12, pSprite->zvel, 2560, -2560, CLIPMASK1);
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-09-06 06:33:02 +00:00
|
|
|
if (nRet || pSprite->shade > 100)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->xvel = 0;
|
|
|
|
pSprite->yvel = 0;
|
|
|
|
pSprite->zvel = 0;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-09-06 06:33:02 +00:00
|
|
|
runlist_DoSubRunRec(pSprite->owner);
|
|
|
|
runlist_FreeRun(pSprite->lotag - 1);
|
|
|
|
runlist_SubRunRec(pSprite->hitag);
|
2019-08-31 07:47:15 +00:00
|
|
|
|
|
|
|
mydeletesprite(nSprite);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x90000:
|
|
|
|
{
|
2021-09-06 06:33:02 +00:00
|
|
|
seq_PlotSequence(a & 0xFFFF, (SeqOffsets[kSeqLavag] + 30) + pSprite->picnum, 0, 1);
|
2019-08-31 07:47:15 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
2020-08-28 09:02:13 +00:00
|
|
|
int BuildLava(short nSprite, int x, int y, int, short nSector, short nAngle, int nChannel)
|
2019-08-26 03:59:14 +00:00
|
|
|
{
|
2020-11-29 19:30:17 +00:00
|
|
|
auto nLava = LavaList.Reserve(1);
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-09-06 06:33:02 +00:00
|
|
|
auto pSprite = &sprite[nSprite];
|
2019-08-31 07:47:15 +00:00
|
|
|
if (nSprite == -1)
|
|
|
|
{
|
|
|
|
nSprite = insertsprite(nSector, 118);
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite = &sprite[nSprite];
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-09-06 06:33:02 +00:00
|
|
|
nSector = pSprite->sectnum;
|
|
|
|
nAngle = pSprite->ang;
|
|
|
|
x = pSprite->x;
|
|
|
|
y = pSprite->y;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
|
|
|
changespritestat(nSprite, 118);
|
|
|
|
}
|
|
|
|
|
|
|
|
assert(nSprite >= 0 && nSprite < kMaxSprites);
|
|
|
|
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->x = x;
|
|
|
|
pSprite->y = y;
|
|
|
|
pSprite->z = sector[nSector].floorz;
|
|
|
|
pSprite->cstat = 0x8000;
|
|
|
|
pSprite->xrepeat = 200;
|
|
|
|
pSprite->yrepeat = 200;
|
|
|
|
pSprite->shade = -12;
|
|
|
|
pSprite->pal = 0;
|
|
|
|
pSprite->clipdist = 127;
|
|
|
|
pSprite->xoffset = 0;
|
|
|
|
pSprite->yoffset = 0;
|
|
|
|
pSprite->picnum = seq_GetSeqPicnum(kSeqLavag, LavadudeSeq[3].a, 0);
|
|
|
|
pSprite->xvel = 0;
|
|
|
|
pSprite->yvel = 0;
|
|
|
|
pSprite->zvel = 0;
|
|
|
|
pSprite->ang = nAngle;
|
|
|
|
pSprite->hitag = 0;
|
|
|
|
pSprite->lotag = runlist_HeadRun() + 1;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
|
|
|
// GrabTimeSlot(3);
|
|
|
|
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->extra = -1;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
LavaList[nLava].nAction = 0;
|
|
|
|
LavaList[nLava].nHealth = 4000;
|
|
|
|
LavaList[nLava].nSprite = nSprite;
|
|
|
|
LavaList[nLava].nTarget = -1;
|
2020-11-29 19:30:17 +00:00
|
|
|
LavaList[nLava].nIndex = nChannel;
|
2020-03-02 21:08:31 +00:00
|
|
|
LavaList[nLava].nFrame = 0;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->owner = runlist_AddRunRec(pSprite->lotag - 1, nLava | 0x150000);
|
2020-03-02 21:08:31 +00:00
|
|
|
LavaList[nLava].nRun = runlist_AddRunRec(NewRun, nLava | 0x150000);
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2020-08-23 12:39:14 +00:00
|
|
|
nCreaturesTotal++;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
return nLava | 0x150000;
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void FuncLava(int a, int nDamage, int nRun)
|
|
|
|
{
|
2021-05-12 15:09:07 +00:00
|
|
|
unsigned nLava = RunData[nRun].nVal;
|
|
|
|
assert(nLava < LavaList.Size());
|
2019-08-31 07:47:15 +00:00
|
|
|
|
|
|
|
short nAction = LavaList[nLava].nAction;
|
2020-10-11 09:33:28 +00:00
|
|
|
short nSeq = LavadudeSeq[nAction].a + SeqOffsets[kSeqLavag];
|
2019-08-31 07:47:15 +00:00
|
|
|
short nSprite = LavaList[nLava].nSprite;
|
2021-09-06 06:33:02 +00:00
|
|
|
auto pSprite = &sprite[nSprite];
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2020-03-02 21:08:31 +00:00
|
|
|
int nMessage = a & kMessageMask;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
|
|
|
switch (nMessage)
|
|
|
|
{
|
|
|
|
default:
|
|
|
|
{
|
2020-03-02 21:08:31 +00:00
|
|
|
Printf("unknown msg %d for Lava\n", nMessage);
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x90000:
|
|
|
|
{
|
2020-10-11 09:33:28 +00:00
|
|
|
seq_PlotSequence(a & 0xFFFF, nSeq, LavaList[nLava].nFrame, LavadudeSeq[nAction].b);
|
2021-04-02 08:28:40 +00:00
|
|
|
mytsprite[a & 0xFFFF].owner = -1;
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0xA0000:
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x80000:
|
|
|
|
{
|
|
|
|
if (!nDamage) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-02-27 13:05:55 +00:00
|
|
|
LavaList[nLava].nHealth -= dmgAdjust(nDamage, 3);
|
2019-11-20 16:21:32 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
if (LavaList[nLava].nHealth <= 0)
|
|
|
|
{
|
|
|
|
LavaList[nLava].nHealth = 0;
|
|
|
|
LavaList[nLava].nAction = 5;
|
2020-03-02 21:08:31 +00:00
|
|
|
LavaList[nLava].nFrame = 0;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2020-08-23 12:39:14 +00:00
|
|
|
nCreaturesKilled++;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->cstat &= 0xFEFE;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
short nTarget = a & 0xFFFF;
|
|
|
|
|
|
|
|
if (nTarget >= 0)
|
|
|
|
{
|
|
|
|
if (sprite[nTarget].statnum < 199)
|
|
|
|
{
|
|
|
|
LavaList[nLava].nTarget = nTarget;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (nAction == 3)
|
|
|
|
{
|
|
|
|
if (!RandomSize(2))
|
|
|
|
{
|
|
|
|
LavaList[nLava].nAction = 4;
|
2020-03-02 21:08:31 +00:00
|
|
|
LavaList[nLava].nFrame = 0;
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->cstat = 0;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-02 21:08:31 +00:00
|
|
|
BuildLavaLimb(nSprite, totalmoves, 64000);
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x20000:
|
|
|
|
{
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->picnum = seq_GetSeqPicnum2(nSeq, LavaList[nLava].nFrame);
|
2020-03-02 21:08:31 +00:00
|
|
|
int var_38 = LavaList[nLava].nFrame;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
|
|
|
short nFlag = FrameFlag[SeqBase[nSeq] + var_38];
|
|
|
|
|
|
|
|
int var_1C;
|
|
|
|
|
|
|
|
if (nAction)
|
|
|
|
{
|
|
|
|
seq_MoveSequence(nSprite, nSeq, var_38);
|
|
|
|
|
2020-03-02 21:08:31 +00:00
|
|
|
LavaList[nLava].nFrame++;
|
|
|
|
if (LavaList[nLava].nFrame >= SeqSize[nSeq])
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
|
|
|
var_1C = 1;
|
2020-03-02 21:08:31 +00:00
|
|
|
LavaList[nLava].nFrame = 0;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
var_1C = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
short nTarget = LavaList[nLava].nTarget;
|
|
|
|
|
|
|
|
if (nTarget >= 0 && nAction < 4)
|
|
|
|
{
|
|
|
|
if (!(sprite[nTarget].cstat & 0x101) || sprite[nTarget].sectnum >= 1024)
|
|
|
|
{
|
|
|
|
nTarget = -1;
|
|
|
|
LavaList[nLava].nTarget = -1;
|
|
|
|
}
|
|
|
|
}
|
2019-11-20 16:21:32 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
switch (nAction)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
{
|
|
|
|
if ((nLava & 0x1F) == (totalmoves & 0x1F))
|
|
|
|
{
|
|
|
|
if (nTarget < 0)
|
|
|
|
{
|
|
|
|
nTarget = FindPlayer(nSprite, 76800);
|
|
|
|
}
|
|
|
|
|
|
|
|
PlotCourseToSprite(nSprite, nTarget);
|
|
|
|
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->xvel = bcos(pSprite->ang);
|
|
|
|
pSprite->yvel = bsin(pSprite->ang);
|
2019-08-31 07:47:15 +00:00
|
|
|
|
|
|
|
if (nTarget >= 0 && !RandomSize(1))
|
|
|
|
{
|
|
|
|
LavaList[nLava].nTarget = nTarget;
|
|
|
|
LavaList[nLava].nAction = 2;
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->cstat = 0x101;
|
2020-03-02 21:08:31 +00:00
|
|
|
LavaList[nLava].nFrame = 0;
|
2019-08-31 07:47:15 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-06 06:33:02 +00:00
|
|
|
int x = pSprite->x;
|
|
|
|
int y = pSprite->y;
|
|
|
|
int z = pSprite->z;
|
|
|
|
short nSector = pSprite->sectnum;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-09-06 06:33:02 +00:00
|
|
|
int nVal = movesprite(nSprite, pSprite->xvel << 8, pSprite->yvel << 8, 0, 0, 0, CLIPMASK0);
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-09-06 06:33:02 +00:00
|
|
|
if (nSector != pSprite->sectnum)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
|
|
|
changespritesect(nSprite, nSector);
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->x = x;
|
|
|
|
pSprite->y = y;
|
|
|
|
pSprite->z = z;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->ang = (pSprite->ang + ((RandomWord() & 0x3FF) + 1024)) & kAngleMask;
|
|
|
|
pSprite->xvel = bcos(pSprite->ang);
|
|
|
|
pSprite->yvel = bsin(pSprite->ang);
|
2019-08-31 07:47:15 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!nVal) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2020-03-02 21:08:31 +00:00
|
|
|
if ((nVal & 0xC000) == 0x8000)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->ang = (pSprite->ang + ((RandomWord() & 0x3FF) + 1024)) & kAngleMask;
|
|
|
|
pSprite->xvel = bcos(pSprite->ang);
|
|
|
|
pSprite->yvel = bsin(pSprite->ang);
|
2019-08-31 07:47:15 +00:00
|
|
|
break;
|
|
|
|
}
|
2020-03-02 21:08:31 +00:00
|
|
|
else if ((nVal & 0xC000) == 0xC000)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
|
|
|
if ((nVal & 0x3FFF) == nTarget)
|
|
|
|
{
|
2021-09-06 06:33:02 +00:00
|
|
|
int nAng = getangle(sprite[nTarget].x - pSprite->x, sprite[nTarget].y - pSprite->y);
|
|
|
|
if (AngleDiff(pSprite->ang, nAng) < 64)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
|
|
|
LavaList[nLava].nAction = 2;
|
2020-03-02 21:08:31 +00:00
|
|
|
LavaList[nLava].nFrame = 0;
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->cstat = 0x101;
|
2019-08-31 07:47:15 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
case 6:
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
{
|
|
|
|
if (var_1C)
|
|
|
|
{
|
|
|
|
LavaList[nLava].nAction = 3;
|
2020-03-02 21:08:31 +00:00
|
|
|
LavaList[nLava].nFrame = 0;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
|
|
|
PlotCourseToSprite(nSprite, nTarget);
|
|
|
|
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->cstat |= 0x101;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 3:
|
|
|
|
{
|
2019-10-29 22:44:52 +00:00
|
|
|
if ((nFlag & 0x80) && nTarget > -1)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
|
|
|
int nHeight = GetSpriteHeight(nSprite);
|
2020-03-02 21:08:31 +00:00
|
|
|
GetUpAngle(nSprite, -64000, nTarget, (-(nHeight >> 1)));
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-09-06 06:33:02 +00:00
|
|
|
BuildBullet(nSprite, 10, bcos(pSprite->ang, 8), bsin(pSprite->ang, 8), -1, pSprite->ang, nTarget + 10000, 1);
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
else if (var_1C)
|
|
|
|
{
|
|
|
|
PlotCourseToSprite(nSprite, nTarget);
|
|
|
|
LavaList[nLava].nAction = 7;
|
2020-03-02 21:08:31 +00:00
|
|
|
LavaList[nLava].nFrame = 0;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2019-10-29 22:44:52 +00:00
|
|
|
|
|
|
|
break;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
case 4:
|
|
|
|
{
|
|
|
|
if (var_1C)
|
|
|
|
{
|
|
|
|
LavaList[nLava].nAction = 7;
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->cstat &= 0xFEFE;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 5:
|
|
|
|
{
|
|
|
|
if (nFlag & 0x40)
|
|
|
|
{
|
2020-03-02 21:08:31 +00:00
|
|
|
int nLimbSprite = BuildLavaLimb(nSprite, LavaList[nLava].nFrame, 64000);
|
2019-08-31 07:47:15 +00:00
|
|
|
D3PlayFX(StaticSound[kSound26], nLimbSprite);
|
|
|
|
}
|
|
|
|
|
2020-03-02 21:08:31 +00:00
|
|
|
if (LavaList[nLava].nFrame)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
|
|
|
if (nFlag & 0x80)
|
|
|
|
{
|
|
|
|
int ecx = 0;
|
|
|
|
do
|
|
|
|
{
|
2020-03-02 21:08:31 +00:00
|
|
|
BuildLavaLimb(nSprite, ecx, 64000);
|
2019-08-31 07:47:15 +00:00
|
|
|
ecx++;
|
|
|
|
}
|
|
|
|
while (ecx < 20);
|
2020-11-29 19:30:17 +00:00
|
|
|
runlist_ChangeChannel(LavaList[nLava].nIndex, 1);
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int ecx = 0;
|
|
|
|
|
|
|
|
do
|
|
|
|
{
|
|
|
|
BuildLavaLimb(nSprite, ecx, 256);
|
|
|
|
ecx++;
|
|
|
|
}
|
|
|
|
while (ecx < 30);
|
|
|
|
|
2021-09-06 06:33:02 +00:00
|
|
|
runlist_DoSubRunRec(pSprite->owner);
|
|
|
|
runlist_FreeRun(pSprite->lotag - 1);
|
2020-03-02 21:08:31 +00:00
|
|
|
runlist_SubRunRec(LavaList[nLava].nRun);
|
2019-08-31 07:47:15 +00:00
|
|
|
mydeletesprite(nSprite);
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 7:
|
|
|
|
{
|
|
|
|
if (var_1C)
|
|
|
|
{
|
|
|
|
LavaList[nLava].nAction = 8;
|
2020-03-02 21:08:31 +00:00
|
|
|
LavaList[nLava].nFrame = 0;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 8:
|
|
|
|
{
|
|
|
|
if (var_1C)
|
|
|
|
{
|
|
|
|
LavaList[nLava].nAction = 0;
|
2020-03-02 21:08:31 +00:00
|
|
|
LavaList[nLava].nFrame = 0;
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->cstat = 0x8000;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// loc_31521:
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->pal = 1;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
}
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
2019-11-22 23:11:37 +00:00
|
|
|
END_PS_NS
|