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
|
|
|
|
|
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
|
|
|
};
|
|
|
|
|
2021-10-17 19:06:56 +00:00
|
|
|
DExhumedActor* BuildLavaLimb(DExhumedActor* pActor, int move, int ebx)
|
2019-08-26 03:59:14 +00:00
|
|
|
{
|
2021-10-17 19:06:56 +00:00
|
|
|
auto pSprite = &pActor->s();
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-11-22 23:13:30 +00:00
|
|
|
auto pLimbActor = insertActor(pSprite->sector(), 118);
|
2021-10-17 19:06:56 +00:00
|
|
|
auto pLimbSprite = &pLimbActor->s();
|
2021-09-06 06:33:02 +00:00
|
|
|
|
2021-12-22 10:57:10 +00:00
|
|
|
pLimbSprite->pos.X = pSprite->pos.X;
|
2021-09-06 06:33:02 +00:00
|
|
|
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;
|
2021-10-17 19:06:56 +00:00
|
|
|
pLimbSprite->picnum = (move & 3) % 3;
|
2021-09-06 06:33:02 +00:00
|
|
|
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;
|
2021-10-17 19:06:56 +00:00
|
|
|
pLimbSprite->owner = runlist_AddRunRec(pLimbSprite->lotag - 1, pLimbActor, 0x160000);
|
|
|
|
pLimbSprite->hitag = runlist_AddRunRec(NewRun, pLimbActor, 0x160000);
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2021-10-17 19:06:56 +00:00
|
|
|
return pLimbActor;
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
2021-10-15 19:25:17 +00:00
|
|
|
void AILavaDudeLimb::Tick(RunListEvent* ev)
|
2019-08-26 03:59:14 +00:00
|
|
|
{
|
2021-10-17 19:06:56 +00:00
|
|
|
auto pActor = ev->pObjActor;
|
|
|
|
if (!pActor) return;
|
|
|
|
auto pSprite = &pActor->s();
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 19:25:17 +00:00
|
|
|
pSprite->shade += 3;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-17 19:06:56 +00:00
|
|
|
auto coll = movesprite(pActor, pSprite->xvel << 12, pSprite->yvel << 12, pSprite->zvel, 2560, -2560, CLIPMASK1);
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-17 19:06:56 +00:00
|
|
|
if (coll.type || pSprite->shade > 100)
|
2021-10-15 19:25:17 +00:00
|
|
|
{
|
|
|
|
pSprite->xvel = 0;
|
|
|
|
pSprite->yvel = 0;
|
|
|
|
pSprite->zvel = 0;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 19:25:17 +00:00
|
|
|
runlist_DoSubRunRec(pSprite->owner);
|
|
|
|
runlist_FreeRun(pSprite->lotag - 1);
|
|
|
|
runlist_SubRunRec(pSprite->hitag);
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-17 19:06:56 +00:00
|
|
|
DeleteActor(pActor);
|
2021-10-15 19:25:17 +00:00
|
|
|
}
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 19:25:17 +00:00
|
|
|
void AILavaDudeLimb::Draw(RunListEvent* ev)
|
|
|
|
{
|
2021-10-17 19:06:56 +00:00
|
|
|
auto pActor = ev->pObjActor;
|
|
|
|
if (!pActor) return;
|
2021-12-21 22:18:23 +00:00
|
|
|
seq_PlotSequence(ev->nParam, (SeqOffsets[kSeqLavag] + 30) + pActor->spr.picnum, 0, 1);
|
2021-10-15 19:25:17 +00:00
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2021-11-22 23:13:30 +00:00
|
|
|
void BuildLava(DExhumedActor* pActor, int x, int y, int, sectortype* pSector, int nAngle, int nChannel)
|
2019-08-26 03:59:14 +00:00
|
|
|
{
|
2021-10-17 19:06:56 +00:00
|
|
|
spritetype* pSprite;
|
|
|
|
if (pActor == nullptr)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-11-22 23:13:30 +00:00
|
|
|
pActor = insertActor(pSector, 118);
|
2021-10-17 19:06:56 +00:00
|
|
|
pSprite = &pActor->s();
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-10-17 19:06:56 +00:00
|
|
|
pSprite = &pActor->s();
|
2021-11-22 23:13:30 +00:00
|
|
|
pSector = pSprite->sector();
|
2021-09-06 06:33:02 +00:00
|
|
|
nAngle = pSprite->ang;
|
2021-12-22 10:57:10 +00:00
|
|
|
x = pSprite->pos.X;
|
2021-09-06 06:33:02 +00:00
|
|
|
y = pSprite->y;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-17 19:06:56 +00:00
|
|
|
ChangeActorStat(pActor, 118);
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
|
2021-12-22 10:57:10 +00:00
|
|
|
pSprite->pos.X = x;
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->y = y;
|
2021-11-22 23:13:30 +00:00
|
|
|
pSprite->z = pSector->floorz;
|
2021-12-18 11:36:53 +00:00
|
|
|
pSprite->cstat = CSTAT_SPRITE_INVISIBLE;
|
2021-09-06 06:33:02 +00:00
|
|
|
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
|
|
|
|
2021-10-23 16:41:05 +00:00
|
|
|
pActor->nAction = 0;
|
|
|
|
pActor->nHealth = 4000;
|
2021-10-17 19:06:56 +00:00
|
|
|
pActor->pTarget = nullptr;
|
|
|
|
pActor->nCount = nChannel;
|
2021-10-23 16:41:05 +00:00
|
|
|
pActor->nFrame = 0;
|
2021-10-17 19:06:56 +00:00
|
|
|
pActor->nPhase = Counters[kCountLava]++;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2021-10-17 19:06:56 +00:00
|
|
|
pSprite->owner = runlist_AddRunRec(pSprite->lotag - 1, pActor, 0x150000);
|
|
|
|
pActor->nRun = runlist_AddRunRec(NewRun, pActor, 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
|
|
|
}
|
|
|
|
|
2021-10-15 19:25:17 +00:00
|
|
|
void AILavaDude::Draw(RunListEvent* ev)
|
2019-08-26 03:59:14 +00:00
|
|
|
{
|
2021-10-17 19:06:56 +00:00
|
|
|
auto pActor = ev->pObjActor;
|
|
|
|
if (!pActor) return;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-11-21 19:34:15 +00:00
|
|
|
int nAction = pActor->nAction;
|
|
|
|
int nSeq = LavadudeSeq[nAction].a + SeqOffsets[kSeqLavag];
|
2021-10-15 19:25:17 +00:00
|
|
|
|
2021-10-23 16:41:05 +00:00
|
|
|
seq_PlotSequence(ev->nParam, nSeq, pActor->nFrame, LavadudeSeq[nAction].b);
|
2021-12-04 18:08:50 +00:00
|
|
|
ev->pTSprite->ownerActor = nullptr;
|
2021-10-15 19:25:17 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
void AILavaDude::Damage(RunListEvent* ev)
|
|
|
|
{
|
2021-10-17 19:06:56 +00:00
|
|
|
auto pActor = ev->pObjActor;
|
|
|
|
if (!pActor) return;
|
2021-10-15 19:25:17 +00:00
|
|
|
|
2021-11-21 19:34:15 +00:00
|
|
|
int nAction = pActor->nAction;
|
2021-10-17 19:06:56 +00:00
|
|
|
auto pSprite = &pActor->s();
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 19:25:17 +00:00
|
|
|
if (!ev->nDamage)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-10-15 19:25:17 +00:00
|
|
|
return;
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-23 16:41:05 +00:00
|
|
|
pActor->nHealth -= dmgAdjust(ev->nDamage, 3);
|
2021-10-15 19:25:17 +00:00
|
|
|
|
2021-10-23 16:41:05 +00:00
|
|
|
if (pActor->nHealth <= 0)
|
2021-10-15 19:25:17 +00:00
|
|
|
{
|
2021-10-23 16:41:05 +00:00
|
|
|
pActor->nHealth = 0;
|
|
|
|
pActor->nAction = 5;
|
|
|
|
pActor->nFrame = 0;
|
2021-10-15 19:25:17 +00:00
|
|
|
|
|
|
|
nCreaturesKilled++;
|
|
|
|
|
2021-12-18 17:40:25 +00:00
|
|
|
pSprite->cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
2021-10-15 19:25:17 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-10-17 19:06:56 +00:00
|
|
|
auto pTarget = ev->pOtherActor;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-17 19:06:56 +00:00
|
|
|
if (pTarget)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-12-21 22:18:23 +00:00
|
|
|
if (pTarget->spr.statnum < 199)
|
2021-10-15 19:25:17 +00:00
|
|
|
{
|
2021-10-17 19:06:56 +00:00
|
|
|
pActor->pTarget = pTarget;
|
2021-10-15 19:25:17 +00:00
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
|
2021-10-15 19:25:17 +00:00
|
|
|
if (nAction == 3)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-10-15 19:25:17 +00:00
|
|
|
if (!RandomSize(2))
|
|
|
|
{
|
2021-10-23 16:41:05 +00:00
|
|
|
pActor->nAction = 4;
|
|
|
|
pActor->nFrame = 0;
|
2021-10-15 19:25:17 +00:00
|
|
|
pSprite->cstat = 0;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2021-10-15 19:25:17 +00:00
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-17 19:06:56 +00:00
|
|
|
BuildLavaLimb(pActor, totalmoves, 64000);
|
2021-10-15 19:25:17 +00:00
|
|
|
}
|
|
|
|
}
|
2019-11-20 16:21:32 +00:00
|
|
|
|
2021-10-15 19:25:17 +00:00
|
|
|
void AILavaDude::Tick(RunListEvent* ev)
|
|
|
|
{
|
2021-10-17 19:06:56 +00:00
|
|
|
auto pActor = ev->pObjActor;
|
|
|
|
if (!pActor) return;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-11-21 19:34:15 +00:00
|
|
|
int nAction = pActor->nAction;
|
|
|
|
int nSeq = LavadudeSeq[nAction].a + SeqOffsets[kSeqLavag];
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-17 19:06:56 +00:00
|
|
|
auto pSprite = &pActor->s();
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-23 16:41:05 +00:00
|
|
|
pSprite->picnum = seq_GetSeqPicnum2(nSeq, pActor->nFrame);
|
|
|
|
int var_38 = pActor->nFrame;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-11-21 19:34:15 +00:00
|
|
|
int nFlag = FrameFlag[SeqBase[nSeq] + var_38];
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-11-14 14:03:50 +00:00
|
|
|
int var_1C = 0;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 19:25:17 +00:00
|
|
|
if (nAction)
|
|
|
|
{
|
2021-10-17 19:06:56 +00:00
|
|
|
seq_MoveSequence(pActor, nSeq, var_38);
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-23 16:41:05 +00:00
|
|
|
pActor->nFrame++;
|
|
|
|
if (pActor->nFrame >= SeqSize[nSeq])
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-10-15 19:25:17 +00:00
|
|
|
var_1C = 1;
|
2021-10-23 16:41:05 +00:00
|
|
|
pActor->nFrame = 0;
|
2021-10-15 19:25:17 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
var_1C = 0;
|
|
|
|
}
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-12-07 17:53:02 +00:00
|
|
|
DExhumedActor* pTarget = pActor->pTarget;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-17 19:06:56 +00:00
|
|
|
if (pTarget && nAction < 4)
|
2021-10-15 19:25:17 +00:00
|
|
|
{
|
2021-12-21 22:18:23 +00:00
|
|
|
if (!(pTarget->spr.cstat & CSTAT_SPRITE_BLOCK_ALL) || pTarget->spr.statnum == MAXSTATUS)
|
2021-10-15 19:25:17 +00:00
|
|
|
{
|
2021-10-17 19:06:56 +00:00
|
|
|
pTarget = nullptr;
|
|
|
|
pActor->pTarget = nullptr;
|
2021-10-15 19:25:17 +00:00
|
|
|
}
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 19:25:17 +00:00
|
|
|
switch (nAction)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
{
|
2021-10-17 19:06:56 +00:00
|
|
|
if ((pActor->nPhase & 0x1F) == (totalmoves & 0x1F))
|
2021-10-15 19:25:17 +00:00
|
|
|
{
|
2021-10-17 19:06:56 +00:00
|
|
|
if (pTarget == nullptr)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-10-17 19:06:56 +00:00
|
|
|
pTarget = FindPlayer(pActor, 76800);
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
|
2021-10-17 19:06:56 +00:00
|
|
|
PlotCourseToSprite(pActor, pTarget);
|
2021-10-15 19:25:17 +00:00
|
|
|
|
|
|
|
pSprite->xvel = bcos(pSprite->ang);
|
|
|
|
pSprite->yvel = bsin(pSprite->ang);
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-17 19:06:56 +00:00
|
|
|
if (pTarget && !RandomSize(1))
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-10-17 19:06:56 +00:00
|
|
|
pActor->pTarget = pTarget;
|
2021-10-23 16:41:05 +00:00
|
|
|
pActor->nAction = 2;
|
2021-12-18 17:40:25 +00:00
|
|
|
pSprite->cstat = CSTAT_SPRITE_BLOCK_ALL;
|
2021-10-23 16:41:05 +00:00
|
|
|
pActor->nFrame = 0;
|
2021-10-15 19:25:17 +00:00
|
|
|
break;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2021-10-15 19:25:17 +00:00
|
|
|
}
|
2019-11-20 16:21:32 +00:00
|
|
|
|
2021-12-22 10:57:10 +00:00
|
|
|
int x = pSprite->pos.X;
|
2021-10-15 19:25:17 +00:00
|
|
|
int y = pSprite->y;
|
|
|
|
int z = pSprite->z;
|
2021-11-22 23:13:30 +00:00
|
|
|
auto pSector =pSprite->sector();
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-17 19:06:56 +00:00
|
|
|
auto coll = movesprite(pActor, pSprite->xvel << 8, pSprite->yvel << 8, 0, 0, 0, CLIPMASK0);
|
2021-10-15 19:25:17 +00:00
|
|
|
|
2021-11-22 23:13:30 +00:00
|
|
|
if (pSector != pSprite->sector())
|
2021-10-15 19:25:17 +00:00
|
|
|
{
|
2021-11-22 23:13:30 +00:00
|
|
|
ChangeActorSect(pActor, pSector);
|
2021-12-22 10:57:10 +00:00
|
|
|
pSprite->pos.X = x;
|
2021-10-15 19:25:17 +00:00
|
|
|
pSprite->y = y;
|
|
|
|
pSprite->z = z;
|
|
|
|
|
|
|
|
pSprite->ang = (pSprite->ang + ((RandomWord() & 0x3FF) + 1024)) & kAngleMask;
|
|
|
|
pSprite->xvel = bcos(pSprite->ang);
|
|
|
|
pSprite->yvel = bsin(pSprite->ang);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2021-10-17 19:06:56 +00:00
|
|
|
if (coll.type == kHitNone) {
|
2021-10-15 19:25:17 +00:00
|
|
|
break;
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-17 19:06:56 +00:00
|
|
|
if (coll.type == kHitWall)
|
2021-10-15 19:25:17 +00:00
|
|
|
{
|
|
|
|
pSprite->ang = (pSprite->ang + ((RandomWord() & 0x3FF) + 1024)) & kAngleMask;
|
|
|
|
pSprite->xvel = bcos(pSprite->ang);
|
|
|
|
pSprite->yvel = bsin(pSprite->ang);
|
|
|
|
break;
|
|
|
|
}
|
2021-10-17 19:06:56 +00:00
|
|
|
else if (coll.type == kHitSprite)
|
2021-10-15 19:25:17 +00:00
|
|
|
{
|
2021-11-26 13:26:03 +00:00
|
|
|
if (coll.actor() == pTarget)
|
2021-10-15 19:25:17 +00:00
|
|
|
{
|
2021-12-22 10:57:10 +00:00
|
|
|
int nAng = getangle(pTarget->spr.pos.X - pSprite->pos.X, pTarget->spr.y - pSprite->y);
|
2021-10-15 19:25:17 +00:00
|
|
|
if (AngleDiff(pSprite->ang, nAng) < 64)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-10-23 16:41:05 +00:00
|
|
|
pActor->nAction = 2;
|
|
|
|
pActor->nFrame = 0;
|
2021-12-18 17:40:25 +00:00
|
|
|
pSprite->cstat = CSTAT_SPRITE_BLOCK_ALL;
|
2019-08-31 07:47:15 +00:00
|
|
|
break;
|
|
|
|
}
|
2021-10-15 19:25:17 +00:00
|
|
|
}
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 19:25:17 +00:00
|
|
|
break;
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 19:25:17 +00:00
|
|
|
case 1:
|
|
|
|
case 6:
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 19:25:17 +00:00
|
|
|
case 2:
|
|
|
|
{
|
|
|
|
if (var_1C)
|
|
|
|
{
|
2021-10-23 16:41:05 +00:00
|
|
|
pActor->nAction = 3;
|
|
|
|
pActor->nFrame = 0;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-17 19:06:56 +00:00
|
|
|
PlotCourseToSprite(pActor, pTarget);
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-12-18 17:40:25 +00:00
|
|
|
pSprite->cstat |= CSTAT_SPRITE_BLOCK_ALL;
|
2021-10-15 19:25:17 +00:00
|
|
|
}
|
2019-10-29 22:44:52 +00:00
|
|
|
|
2021-10-15 19:25:17 +00:00
|
|
|
break;
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 19:25:17 +00:00
|
|
|
case 3:
|
|
|
|
{
|
2021-10-17 19:06:56 +00:00
|
|
|
if ((nFlag & 0x80) && pTarget)
|
2021-10-15 19:25:17 +00:00
|
|
|
{
|
2021-10-17 19:06:56 +00:00
|
|
|
int nHeight = GetActorHeight(pActor);
|
|
|
|
GetUpAngle(pActor, -64000, pTarget, (-(nHeight >> 1)));
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-17 19:06:56 +00:00
|
|
|
BuildBullet(pActor, 10, -1, pSprite->ang, pTarget, 1);
|
2021-10-15 19:25:17 +00:00
|
|
|
}
|
|
|
|
else if (var_1C)
|
|
|
|
{
|
2021-10-17 19:06:56 +00:00
|
|
|
PlotCourseToSprite(pActor, pTarget);
|
2021-10-23 16:41:05 +00:00
|
|
|
pActor->nAction = 7;
|
|
|
|
pActor->nFrame = 0;
|
2021-10-15 19:25:17 +00:00
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 19:25:17 +00:00
|
|
|
break;
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 19:25:17 +00:00
|
|
|
case 4:
|
|
|
|
{
|
|
|
|
if (var_1C)
|
|
|
|
{
|
2021-10-23 16:41:05 +00:00
|
|
|
pActor->nAction = 7;
|
2021-12-18 17:40:25 +00:00
|
|
|
pSprite->cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
2021-10-15 19:25:17 +00:00
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 19:25:17 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 5:
|
|
|
|
{
|
|
|
|
if (nFlag & 0x40)
|
|
|
|
{
|
2021-10-17 19:06:56 +00:00
|
|
|
auto pLimbSprite = BuildLavaLimb(pActor, pActor->nFrame, 64000);
|
|
|
|
D3PlayFX(StaticSound[kSound26], pLimbSprite);
|
2021-10-15 19:25:17 +00:00
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-23 16:41:05 +00:00
|
|
|
if (pActor->nFrame)
|
2021-10-15 19:25:17 +00:00
|
|
|
{
|
|
|
|
if (nFlag & 0x80)
|
|
|
|
{
|
|
|
|
int ecx = 0;
|
|
|
|
do
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-10-17 19:06:56 +00:00
|
|
|
BuildLavaLimb(pActor, ecx, 64000);
|
2021-10-15 19:25:17 +00:00
|
|
|
ecx++;
|
|
|
|
} while (ecx < 20);
|
2021-10-17 19:06:56 +00:00
|
|
|
runlist_ChangeChannel(pActor->nCount, 1);
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2021-10-15 19:25:17 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int ecx = 0;
|
|
|
|
|
|
|
|
do
|
|
|
|
{
|
2021-10-17 19:06:56 +00:00
|
|
|
BuildLavaLimb(pActor, ecx, 256);
|
2021-10-15 19:25:17 +00:00
|
|
|
ecx++;
|
|
|
|
} while (ecx < 30);
|
|
|
|
|
|
|
|
runlist_DoSubRunRec(pSprite->owner);
|
|
|
|
runlist_FreeRun(pSprite->lotag - 1);
|
2021-10-23 16:41:05 +00:00
|
|
|
runlist_SubRunRec(pActor->nRun);
|
2021-10-17 19:06:56 +00:00
|
|
|
DeleteActor(pActor);
|
2021-10-15 19:25:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 7:
|
|
|
|
{
|
|
|
|
if (var_1C)
|
|
|
|
{
|
2021-10-23 16:41:05 +00:00
|
|
|
pActor->nAction = 8;
|
|
|
|
pActor->nFrame = 0;
|
2021-10-15 19:25:17 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 19:25:17 +00:00
|
|
|
case 8:
|
|
|
|
{
|
|
|
|
if (var_1C)
|
|
|
|
{
|
2021-10-23 16:41:05 +00:00
|
|
|
pActor->nAction = 0;
|
|
|
|
pActor->nFrame = 0;
|
2021-12-18 11:36:53 +00:00
|
|
|
pSprite->cstat = CSTAT_SPRITE_INVISIBLE;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2021-10-15 19:25:17 +00:00
|
|
|
break;
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2021-10-15 19:25:17 +00:00
|
|
|
|
|
|
|
// loc_31521:
|
|
|
|
pSprite->pal = 1;
|
|
|
|
}
|
|
|
|
|
2019-11-22 23:11:37 +00:00
|
|
|
END_PS_NS
|