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 "exhumed.h"
|
2020-03-02 21:08:31 +00:00
|
|
|
#include "aistuff.h"
|
2019-08-26 03:59:14 +00:00
|
|
|
#include "engine.h"
|
|
|
|
#include "sequence.h"
|
|
|
|
#include "sound.h"
|
|
|
|
#include <assert.h>
|
|
|
|
|
2019-11-22 23:11:37 +00:00
|
|
|
BEGIN_PS_NS
|
|
|
|
|
2021-10-17 16:23:42 +00:00
|
|
|
static const actionSeq AnubisSeq[] = {
|
2019-08-31 07:47:15 +00:00
|
|
|
{ 0, 0 },
|
|
|
|
{ 8, 0 },
|
|
|
|
{ 16, 0 },
|
|
|
|
{ 24, 0 },
|
|
|
|
{ 32, 0 },
|
|
|
|
{ -1, 0 },
|
|
|
|
{ 46, 1 },
|
|
|
|
{ 46, 1 },
|
|
|
|
{ 47, 1 },
|
|
|
|
{ 49, 1 },
|
|
|
|
{ 49, 1 },
|
|
|
|
{ 40, 1 },
|
|
|
|
{ 42, 1 },
|
|
|
|
{ 41, 1 },
|
|
|
|
{ 43, 1 },
|
2019-08-26 03:59:14 +00:00
|
|
|
};
|
|
|
|
|
2021-11-22 23:35:29 +00:00
|
|
|
void BuildAnubis(DExhumedActor* ap, int x, int y, int z, sectortype* pSector, int nAngle, uint8_t bIsDrummer)
|
2019-08-26 03:59:14 +00:00
|
|
|
{
|
2021-10-17 16:23:42 +00:00
|
|
|
if (ap == nullptr)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-11-22 23:35:29 +00:00
|
|
|
ap = insertActor(pSector, 101);
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-10-17 16:23:42 +00:00
|
|
|
ChangeActorStat(ap, 101);
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2022-01-31 22:33:44 +00:00
|
|
|
x = ap->int_pos().X;
|
|
|
|
y = ap->int_pos().Y;
|
2022-02-02 23:46:04 +00:00
|
|
|
z = ap->sector()->int_floorz();
|
2022-08-16 21:17:01 +00:00
|
|
|
nAngle = ap->int_ang();
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
|
2022-01-31 18:57:12 +00:00
|
|
|
ap->set_int_pos({ x, y, z });
|
2021-12-23 16:12:12 +00:00
|
|
|
ap->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
|
|
|
|
ap->spr.xoffset = 0;
|
|
|
|
ap->spr.shade = -12;
|
|
|
|
ap->spr.yoffset = 0;
|
|
|
|
ap->spr.picnum = 1;
|
2021-12-30 15:51:56 +00:00
|
|
|
ap->spr.pal = ap->sector()->ceilingpal;
|
2021-12-23 16:12:12 +00:00
|
|
|
ap->spr.clipdist = 60;
|
2022-08-16 21:21:10 +00:00
|
|
|
ap->set_int_ang(nAngle);
|
2021-12-23 16:12:12 +00:00
|
|
|
ap->spr.xrepeat = 40;
|
|
|
|
ap->spr.yrepeat = 40;
|
|
|
|
ap->spr.xvel = 0;
|
|
|
|
ap->spr.yvel = 0;
|
|
|
|
ap->spr.zvel = 0;
|
|
|
|
ap->spr.hitag = 0;
|
|
|
|
ap->spr.lotag = runlist_HeadRun() + 1;
|
|
|
|
ap->spr.extra = -1;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
|
|
|
// GrabTimeSlot(3);
|
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
if (bIsDrummer)
|
|
|
|
{
|
2021-10-17 16:23:42 +00:00
|
|
|
auto& nAnubisDrum = Counters[kCountAnubisDrum];
|
2020-11-29 18:15:59 +00:00
|
|
|
ap->nAction = nAnubisDrum + 6;
|
2019-08-31 07:47:15 +00:00
|
|
|
nAnubisDrum++;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
if (nAnubisDrum >= 5) {
|
|
|
|
nAnubisDrum = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-11-29 18:15:59 +00:00
|
|
|
ap->nAction = 0;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2021-10-17 16:23:42 +00:00
|
|
|
ap->nPhase = Counters[kCountAnubis]++;
|
2020-11-29 18:15:59 +00:00
|
|
|
ap->nHealth = 540;
|
|
|
|
ap->nFrame = 0;
|
2021-10-17 16:23:42 +00:00
|
|
|
ap->pTarget = nullptr;
|
2020-11-29 19:16:58 +00:00
|
|
|
ap->nCount = 0;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2022-05-23 22:30:41 +00:00
|
|
|
ap->spr.intowner = runlist_AddRunRec(ap->spr.lotag - 1, ap, 0x90000);
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2021-10-17 16:23:42 +00:00
|
|
|
runlist_AddRunRec(NewRun, ap, 0x90000);
|
2020-08-23 12:39:14 +00:00
|
|
|
nCreaturesTotal++;
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
2021-10-15 19:07:33 +00:00
|
|
|
void AIAnubis::Tick(RunListEvent* ev)
|
2019-08-26 03:59:14 +00:00
|
|
|
{
|
2021-10-17 16:23:42 +00:00
|
|
|
auto ap = ev->pObjActor;
|
2021-10-15 19:07:33 +00:00
|
|
|
int nAction = ap->nAction;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2020-03-02 21:08:31 +00:00
|
|
|
bool bVal = false;
|
|
|
|
|
2021-10-15 19:07:33 +00:00
|
|
|
if (nAction < 11) {
|
2021-10-17 16:23:42 +00:00
|
|
|
Gravity(ap);
|
2021-10-15 19:07:33 +00:00
|
|
|
}
|
2020-03-02 21:08:31 +00:00
|
|
|
|
2021-11-21 19:13:19 +00:00
|
|
|
int nSeq = SeqOffsets[kSeqAnubis] + AnubisSeq[nAction].a;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-17 16:23:42 +00:00
|
|
|
seq_MoveSequence(ap, nSeq, ap->nFrame);
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-12-23 16:12:12 +00:00
|
|
|
ap->spr.picnum = seq_GetSeqPicnum2(nSeq, ap->nFrame);
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 19:07:33 +00:00
|
|
|
ap->nFrame++;
|
|
|
|
if (ap->nFrame >= SeqSize[nSeq])
|
|
|
|
{
|
|
|
|
ap->nFrame = 0;
|
|
|
|
bVal = true;
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-12-07 17:53:02 +00:00
|
|
|
DExhumedActor* pTarget = ap->pTarget;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-11-21 19:13:19 +00:00
|
|
|
int nFrame = SeqBase[nSeq] + ap->nFrame;
|
|
|
|
int nFlag = FrameFlag[nFrame];
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-11-26 13:26:03 +00:00
|
|
|
Collision move;
|
|
|
|
move.setNone();
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 19:07:33 +00:00
|
|
|
if (nAction > 0 && nAction < 11) {
|
2021-10-17 16:23:42 +00:00
|
|
|
move = MoveCreatureWithCaution(ap);
|
2021-10-15 19:07:33 +00:00
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 19:07:33 +00:00
|
|
|
switch (nAction)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
{
|
2021-10-17 16:23:42 +00:00
|
|
|
if ((ap->nPhase & 0x1F) == (totalmoves & 0x1F))
|
2021-10-15 19:07:33 +00:00
|
|
|
{
|
2021-10-17 16:23:42 +00:00
|
|
|
if (pTarget == nullptr) {
|
|
|
|
pTarget = FindPlayer(ap, 100);
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
|
2021-10-17 16:23:42 +00:00
|
|
|
if (pTarget)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-10-17 16:23:42 +00:00
|
|
|
D3PlayFX(StaticSound[kSound8], ap);
|
2021-10-15 19:07:33 +00:00
|
|
|
ap->nAction = 1;
|
|
|
|
ap->nFrame = 0;
|
2021-10-17 16:23:42 +00:00
|
|
|
ap->pTarget = pTarget;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2022-08-16 21:17:01 +00:00
|
|
|
ap->spr.xvel = bcos(ap->int_ang(), -2);
|
|
|
|
ap->spr.yvel = bsin(ap->int_ang(), -2);
|
2021-10-15 19:07:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 1:
|
|
|
|
{
|
2021-10-17 16:23:42 +00:00
|
|
|
if ((ap->nPhase & 0x1F) == (totalmoves & 0x1F) && pTarget)
|
2021-10-15 19:07:33 +00:00
|
|
|
{
|
2021-10-17 16:23:42 +00:00
|
|
|
PlotCourseToSprite(ap, pTarget);
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2022-08-16 21:25:11 +00:00
|
|
|
int nAngle = ap->int_ang() & 0xFFF8;
|
2021-12-23 16:12:12 +00:00
|
|
|
ap->spr.xvel = bcos(nAngle, -2);
|
|
|
|
ap->spr.yvel = bsin(nAngle, -2);
|
2021-10-15 19:07:33 +00:00
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-17 16:23:42 +00:00
|
|
|
switch (move.type)
|
2021-10-15 19:07:33 +00:00
|
|
|
{
|
2021-10-17 16:23:42 +00:00
|
|
|
case kHitSprite:
|
2021-10-15 19:07:33 +00:00
|
|
|
{
|
2021-11-26 13:26:03 +00:00
|
|
|
if (move.actor() == pTarget)
|
2021-10-15 19:07:33 +00:00
|
|
|
{
|
2022-01-31 22:33:44 +00:00
|
|
|
int nAng = getangle(pTarget->int_pos().X - ap->int_pos().X, pTarget->int_pos().Y - ap->int_pos().Y);
|
2022-08-16 21:17:01 +00:00
|
|
|
int nAngDiff = AngleDiff(ap->int_ang(), nAng);
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 19:07:33 +00:00
|
|
|
if (nAngDiff < 64)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-10-15 19:07:33 +00:00
|
|
|
ap->nAction = 2;
|
|
|
|
ap->nFrame = 0;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2021-10-15 19:07:33 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
// else we fall through to 0x8000
|
2021-10-17 16:23:42 +00:00
|
|
|
[[fallthrough]];
|
2021-10-15 19:07:33 +00:00
|
|
|
}
|
2021-10-17 16:23:42 +00:00
|
|
|
case kHitWall:
|
2021-10-15 19:07:33 +00:00
|
|
|
{
|
2022-08-16 21:21:10 +00:00
|
|
|
ap->set_int_ang((ap->int_ang() + 256) & kAngleMask);
|
2022-08-16 21:17:01 +00:00
|
|
|
ap->spr.xvel = bcos(ap->int_ang(), -2);
|
|
|
|
ap->spr.yvel = bsin(ap->int_ang(), -2);
|
2021-10-15 19:07:33 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
default:
|
|
|
|
{
|
|
|
|
if (ap->nCount)
|
|
|
|
{
|
|
|
|
ap->nCount--;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ap->nCount = 60;
|
|
|
|
|
2021-10-17 16:23:42 +00:00
|
|
|
if (pTarget != nullptr) // NOTE: nTarget can be -1. this check wasn't in original code. TODO: demo compatiblity?
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2022-01-31 22:33:44 +00:00
|
|
|
if (cansee(ap->int_pos().X, ap->int_pos().Y, ap->int_pos().Z - GetActorHeight(ap), ap->sector(),
|
|
|
|
pTarget->int_pos().X, pTarget->int_pos().Y, pTarget->int_pos().Z - GetActorHeight(pTarget), pTarget->sector()))
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-12-23 16:12:12 +00:00
|
|
|
ap->spr.xvel = 0;
|
|
|
|
ap->spr.yvel = 0;
|
2022-08-16 21:21:10 +00:00
|
|
|
ap->set_int_ang(GetMyAngle(pTarget->int_pos().X - ap->int_pos().X, pTarget->int_pos().Y - ap->int_pos().Y));
|
2021-10-15 19:07:33 +00:00
|
|
|
|
|
|
|
ap->nAction = 3;
|
|
|
|
ap->nFrame = 0;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-10-15 19:07:33 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 2:
|
|
|
|
{
|
2021-10-17 16:23:42 +00:00
|
|
|
if (pTarget == nullptr)
|
2021-10-15 19:07:33 +00:00
|
|
|
{
|
|
|
|
ap->nAction = 0;
|
|
|
|
ap->nCount = 50;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-10-17 16:23:42 +00:00
|
|
|
if (PlotCourseToSprite(ap, pTarget) >= 768)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-10-15 19:07:33 +00:00
|
|
|
ap->nAction = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (nFlag & 0x80)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-10-17 16:23:42 +00:00
|
|
|
runlist_DamageEnemy(pTarget, ap, 7);
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-15 19:07:33 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 3:
|
|
|
|
{
|
|
|
|
if (bVal)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-10-15 19:07:33 +00:00
|
|
|
ap->nAction = 1;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2022-08-16 21:17:01 +00:00
|
|
|
ap->spr.xvel = bcos(ap->int_ang(), -2);
|
|
|
|
ap->spr.yvel = bsin(ap->int_ang(), -2);
|
2021-10-15 19:07:33 +00:00
|
|
|
ap->nFrame = 0;
|
|
|
|
}
|
|
|
|
else
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-10-15 19:07:33 +00:00
|
|
|
// loc_25718:
|
|
|
|
if (nFlag & 0x80)
|
|
|
|
{
|
2022-08-16 21:17:01 +00:00
|
|
|
BuildBullet(ap, 8, -1, ap->int_ang(), pTarget, 1);
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2021-10-15 19:07:33 +00:00
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 19:07:33 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 4:
|
|
|
|
case 5:
|
|
|
|
{
|
2021-12-23 16:12:12 +00:00
|
|
|
ap->spr.xvel = 0;
|
|
|
|
ap->spr.yvel = 0;
|
2021-10-15 19:07:33 +00:00
|
|
|
|
|
|
|
if (bVal)
|
|
|
|
{
|
|
|
|
ap->nAction = 1;
|
|
|
|
ap->nFrame = 0;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2021-10-15 19:07:33 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 6:
|
|
|
|
case 7:
|
|
|
|
case 8:
|
|
|
|
case 9:
|
|
|
|
case 10:
|
|
|
|
{
|
|
|
|
if (bVal)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-10-15 19:07:33 +00:00
|
|
|
ap->nAction = (RandomSize(3) % 5) + 6;
|
|
|
|
ap->nFrame = 0;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 11:
|
|
|
|
case 12:
|
|
|
|
{
|
|
|
|
if (bVal)
|
|
|
|
{
|
|
|
|
ap->nAction = nAction + 2;
|
|
|
|
ap->nFrame = 0;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-12-23 16:12:12 +00:00
|
|
|
ap->spr.xvel = 0;
|
|
|
|
ap->spr.yvel = 0;
|
2021-10-15 19:07:33 +00:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
case 13:
|
|
|
|
case 14:
|
|
|
|
{
|
2021-12-23 16:12:12 +00:00
|
|
|
ap->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
2021-10-15 19:07:33 +00:00
|
|
|
return;
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 19:07:33 +00:00
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 19:07:33 +00:00
|
|
|
// loc_2564C:
|
2021-10-17 16:23:42 +00:00
|
|
|
if (nAction && pTarget != nullptr)
|
2021-10-15 19:07:33 +00:00
|
|
|
{
|
2021-12-21 22:18:23 +00:00
|
|
|
if (!(pTarget->spr.cstat & CSTAT_SPRITE_BLOCK_ALL))
|
2021-10-15 19:07:33 +00:00
|
|
|
{
|
|
|
|
ap->nAction = 0;
|
|
|
|
ap->nFrame = 0;
|
|
|
|
ap->nCount = 100;
|
2021-10-17 16:23:42 +00:00
|
|
|
ap->pTarget = nullptr;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-12-23 16:12:12 +00:00
|
|
|
ap->spr.xvel = 0;
|
|
|
|
ap->spr.yvel = 0;
|
2021-10-15 19:07:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 19:07:33 +00:00
|
|
|
void AIAnubis::Draw(RunListEvent* ev)
|
|
|
|
{
|
2021-10-17 16:23:42 +00:00
|
|
|
auto ap = ev->pObjActor;
|
|
|
|
if (!ap) return;
|
|
|
|
|
2021-10-17 14:22:25 +00:00
|
|
|
seq_PlotSequence(ev->nParam, SeqOffsets[kSeqAnubis] + AnubisSeq[ap->nAction].a, ap->nFrame, AnubisSeq[ap->nAction].b);
|
2021-10-15 19:07:33 +00:00
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 19:07:33 +00:00
|
|
|
void AIAnubis::RadialDamage(RunListEvent* ev)
|
|
|
|
{
|
2021-10-17 16:23:42 +00:00
|
|
|
auto ap = ev->pObjActor;
|
|
|
|
if (!ap) return;
|
2021-10-15 19:07:33 +00:00
|
|
|
if (ap->nAction < 11)
|
|
|
|
{
|
2021-10-17 16:23:42 +00:00
|
|
|
ev->nDamage = runlist_CheckRadialDamage(ap);
|
2021-10-15 19:07:33 +00:00
|
|
|
Damage(ev);
|
|
|
|
}
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 19:07:33 +00:00
|
|
|
void AIAnubis::Damage(RunListEvent* ev)
|
|
|
|
{
|
2021-10-17 16:23:42 +00:00
|
|
|
auto ap = ev->pObjActor;
|
|
|
|
if (!ap) return;
|
2021-10-15 19:07:33 +00:00
|
|
|
int nAction = ap->nAction;
|
|
|
|
int nDamage = ev->nDamage;
|
|
|
|
|
|
|
|
if (nDamage)
|
|
|
|
{
|
|
|
|
if (ap->nHealth <= 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
ap->nHealth -= dmgAdjust(nDamage);
|
|
|
|
|
|
|
|
if (ap->nHealth > 0)
|
|
|
|
{
|
|
|
|
// loc_258D6:
|
2021-10-17 16:23:42 +00:00
|
|
|
if (ev->pOtherActor == nullptr) {
|
2021-10-15 19:07:33 +00:00
|
|
|
return;
|
|
|
|
}
|
2021-12-23 16:26:44 +00:00
|
|
|
auto statnum = ev->pOtherActor->spr.statnum;
|
2021-10-15 19:07:33 +00:00
|
|
|
|
2021-12-23 16:26:44 +00:00
|
|
|
if (statnum == 100 || statnum < 199)
|
2021-10-15 19:07:33 +00:00
|
|
|
{
|
|
|
|
if (!RandomSize(5)) {
|
2021-10-17 16:23:42 +00:00
|
|
|
ap->pTarget = ev->pOtherActor;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-15 19:07:33 +00:00
|
|
|
if (RandomSize(1))
|
|
|
|
{
|
|
|
|
if (nAction >= 6 && nAction <= 10)
|
|
|
|
{
|
2021-12-30 15:51:56 +00:00
|
|
|
auto pDrumActor = insertActor(ap->sector(), kStatAnubisDrum);
|
2021-12-23 16:26:44 +00:00
|
|
|
|
2022-08-16 21:46:18 +00:00
|
|
|
pDrumActor->spr.pos = { ap->spr.pos.X, ap->spr.pos.Y, pDrumActor->sector()->floorz };
|
2021-12-23 16:26:44 +00:00
|
|
|
pDrumActor->spr.xrepeat = 40;
|
|
|
|
pDrumActor->spr.yrepeat = 40;
|
|
|
|
pDrumActor->spr.shade = -64;
|
2021-10-15 19:07:33 +00:00
|
|
|
|
2021-10-21 15:24:52 +00:00
|
|
|
BuildObject(pDrumActor, 2, 0);
|
2021-10-15 19:07:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ap->nAction = 4;
|
|
|
|
ap->nFrame = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// loc_259B5:
|
2021-10-17 16:23:42 +00:00
|
|
|
D3PlayFX(StaticSound[kSound39], ap);
|
2021-10-15 19:07:33 +00:00
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2021-10-15 19:07:33 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
// he ded.
|
2021-12-23 16:12:12 +00:00
|
|
|
ap->spr.xvel = 0;
|
|
|
|
ap->spr.yvel = 0;
|
|
|
|
ap->spr.zvel = 0;
|
2022-02-02 23:46:04 +00:00
|
|
|
ap->set_int_z(ap->sector()->int_floorz());
|
2021-12-23 16:12:12 +00:00
|
|
|
ap->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
2021-10-15 19:07:33 +00:00
|
|
|
|
|
|
|
ap->nHealth = 0;
|
|
|
|
|
|
|
|
nCreaturesKilled++;
|
|
|
|
|
|
|
|
if (nAction < 11)
|
|
|
|
{
|
2021-10-17 16:23:42 +00:00
|
|
|
DropMagic(ap);
|
2021-10-28 16:08:03 +00:00
|
|
|
ap->nAction = int(ev->isRadialEvent()) + 11;
|
2021-10-15 19:07:33 +00:00
|
|
|
ap->nFrame = 0;
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2021-10-15 19:07:33 +00:00
|
|
|
}
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
2021-10-15 19:07:33 +00:00
|
|
|
|
|
|
|
|
2019-11-22 23:11:37 +00:00
|
|
|
END_PS_NS
|