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-08-18 07:52:08 +00:00
|
|
|
#include "aistuff.h"
|
2019-08-26 03:59:14 +00:00
|
|
|
#include "exhumed.h"
|
|
|
|
#include "engine.h"
|
|
|
|
#include "sequence.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 RoachSeq[] = {
|
2020-03-02 21:08:31 +00:00
|
|
|
{24, 0},
|
|
|
|
{0, 0},
|
|
|
|
{0, 0},
|
|
|
|
{16, 0},
|
|
|
|
{8, 0},
|
|
|
|
{32, 1},
|
|
|
|
{42, 1}
|
|
|
|
};
|
2019-08-26 03:59:14 +00:00
|
|
|
|
|
|
|
struct Roach
|
|
|
|
{
|
2019-08-31 07:47:15 +00:00
|
|
|
short nHealth;
|
2020-11-29 19:47:55 +00:00
|
|
|
short nFrame;
|
2019-11-15 20:42:46 +00:00
|
|
|
short nAction;
|
2019-08-31 07:47:15 +00:00
|
|
|
short nSprite;
|
|
|
|
short nTarget;
|
2020-11-29 19:47:55 +00:00
|
|
|
short nRun;
|
|
|
|
short nCount;
|
|
|
|
short nIndex;
|
2019-08-26 03:59:14 +00:00
|
|
|
};
|
|
|
|
|
2019-11-15 20:42:46 +00:00
|
|
|
// TODO - make nType a bool?
|
2021-10-18 16:54:35 +00:00
|
|
|
void BuildRoach(int nType, DExhumedActor* pActor, int x, int y, int z, short nSector, int angle)
|
2019-08-26 03:59:14 +00:00
|
|
|
{
|
2021-10-18 16:54:35 +00:00
|
|
|
spritetype* pSprite;
|
|
|
|
if (pActor == nullptr)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-10-18 16:54:35 +00:00
|
|
|
pActor = insertActor(nSector, 105);
|
|
|
|
pSprite = &pActor->s();
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-10-18 16:54:35 +00:00
|
|
|
ChangeActorStat(pActor, 105);
|
|
|
|
pSprite = &pActor->s();
|
2021-09-06 06:33:02 +00:00
|
|
|
x = pSprite->x;
|
|
|
|
y = pSprite->y;
|
|
|
|
z = sector[pSprite->sectnum].floorz;
|
|
|
|
angle = pSprite->ang;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->x = x;
|
|
|
|
pSprite->y = y;
|
|
|
|
pSprite->z = z;
|
|
|
|
pSprite->cstat = 0x101;
|
|
|
|
pSprite->shade = -12;
|
|
|
|
pSprite->xoffset = 0;
|
|
|
|
pSprite->yoffset = 0;
|
|
|
|
pSprite->picnum = 1;
|
|
|
|
pSprite->pal = sector[pSprite->sectnum].ceilingpal;
|
|
|
|
pSprite->clipdist = 60;
|
|
|
|
pSprite->ang = angle;
|
|
|
|
pSprite->xrepeat = 40;
|
|
|
|
pSprite->yrepeat = 40;
|
|
|
|
pSprite->xvel = 0;
|
|
|
|
pSprite->yvel = 0;
|
|
|
|
pSprite->zvel = 0;
|
|
|
|
pSprite->hitag = 0;
|
|
|
|
pSprite->lotag = runlist_HeadRun() + 1;
|
|
|
|
pSprite->extra = -1;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-11-13 16:50:52 +00:00
|
|
|
// GrabTimeSlot(3);
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-11-15 20:42:46 +00:00
|
|
|
if (nType)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-10-18 16:54:35 +00:00
|
|
|
pActor->nAction = 0;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-10-18 16:54:35 +00:00
|
|
|
pActor->nAction = 1;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2021-10-18 16:54:35 +00:00
|
|
|
pActor->nFrame = 0;
|
|
|
|
pActor->nCount = 0;
|
|
|
|
pActor->pTarget = nullptr;
|
|
|
|
pActor->nHealth = 600;
|
|
|
|
pActor->nPhase = Counters[kCountRoach]++;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2021-10-18 16:54:35 +00:00
|
|
|
pSprite->owner = runlist_AddRunRec(pSprite->lotag - 1, pActor, 0x1C0000);
|
|
|
|
pActor->nRun = runlist_AddRunRec(NewRun, pActor, 0x1C0000);
|
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-18 16:54:35 +00:00
|
|
|
void GoRoach(spritetype* pSprite)
|
2019-08-26 03:59:14 +00:00
|
|
|
{
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->xvel = bcos(pSprite->ang, -1) - bcos(pSprite->ang, -3);
|
|
|
|
pSprite->yvel = bsin(pSprite->ang, -1) - bsin(pSprite->ang, -3);
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
2021-10-15 21:07:38 +00:00
|
|
|
void AIRoach::Draw(RunListEvent* ev)
|
2019-08-26 03:59:14 +00:00
|
|
|
{
|
2021-10-18 16:54:35 +00:00
|
|
|
auto pActor = ev->pObjActor;
|
|
|
|
if (!pActor) return;
|
2021-10-24 10:10:18 +00:00
|
|
|
short nAction = pActor->nAction;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-24 10:10:18 +00:00
|
|
|
seq_PlotSequence(ev->nParam, RoachSeq[nAction].a + SeqOffsets[kSeqRoach], pActor->nFrame, RoachSeq[nAction].b);
|
2021-10-15 21:07:38 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
void AIRoach::RadialDamage(RunListEvent* ev)
|
|
|
|
{
|
2021-10-18 16:54:35 +00:00
|
|
|
auto pActor = ev->pObjActor;
|
|
|
|
if (!pActor) return;
|
|
|
|
|
|
|
|
ev->nDamage = runlist_CheckRadialDamage(pActor);
|
2021-10-15 21:07:38 +00:00
|
|
|
Damage(ev);
|
|
|
|
}
|
|
|
|
|
|
|
|
void AIRoach::Damage(RunListEvent* ev)
|
|
|
|
{
|
2021-10-18 16:54:35 +00:00
|
|
|
auto pActor = ev->pObjActor;
|
|
|
|
if (!pActor) return;
|
2021-10-15 21:07:38 +00:00
|
|
|
|
2021-10-18 16:54:35 +00:00
|
|
|
auto pSprite = &pActor->s();
|
2021-10-24 10:10:18 +00:00
|
|
|
short nAction = pActor->nAction;
|
2020-03-02 21:08:31 +00:00
|
|
|
|
2021-10-15 21:07:38 +00:00
|
|
|
if (ev->nDamage)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-10-24 10:10:18 +00:00
|
|
|
if (pActor->nHealth <= 0) {
|
2019-08-31 07:47:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-10-24 10:10:18 +00:00
|
|
|
pActor->nHealth -= dmgAdjust(ev->nDamage);
|
|
|
|
if (pActor->nHealth <= 0)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-10-15 21:07:38 +00:00
|
|
|
pSprite->xvel = 0;
|
|
|
|
pSprite->yvel = 0;
|
|
|
|
pSprite->zvel = 0;
|
|
|
|
pSprite->cstat &= 0xFEFE;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-24 10:10:18 +00:00
|
|
|
pActor->nHealth = 0;
|
2021-10-15 21:07:38 +00:00
|
|
|
|
|
|
|
if (nAction < 5)
|
|
|
|
{
|
2021-10-18 16:54:35 +00:00
|
|
|
DropMagic(pActor);
|
2021-10-24 10:10:18 +00:00
|
|
|
pActor->nAction = 5;
|
|
|
|
pActor->nFrame = 0;
|
2021-10-15 21:07:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
nCreaturesKilled++; // NOTE: This was incrementing in original code. Bug?
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2021-10-15 21:07:38 +00:00
|
|
|
else
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-10-18 16:54:35 +00:00
|
|
|
auto pSprite2 = ev->pOtherActor;
|
|
|
|
if (pSprite2)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-10-18 16:54:35 +00:00
|
|
|
if (pSprite2->s().statnum < 199) {
|
|
|
|
pActor->pTarget = pSprite2;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
|
2021-10-15 21:07:38 +00:00
|
|
|
if (nAction == 0)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-10-24 10:10:18 +00:00
|
|
|
pActor->nAction = 2;
|
2021-10-18 16:54:35 +00:00
|
|
|
GoRoach(pSprite);
|
2021-10-24 10:10:18 +00:00
|
|
|
pActor->nFrame = 0;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-10-15 21:07:38 +00:00
|
|
|
if (!RandomSize(4))
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-10-24 10:10:18 +00:00
|
|
|
pActor->nAction = 4;
|
|
|
|
pActor->nFrame = 0;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-10-15 21:07:38 +00:00
|
|
|
}
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 21:07:38 +00:00
|
|
|
void AIRoach::Tick(RunListEvent* ev)
|
|
|
|
{
|
2021-10-18 16:54:35 +00:00
|
|
|
auto pActor = ev->pObjActor;
|
|
|
|
if (!pActor) return;
|
2021-10-15 21:07:38 +00:00
|
|
|
|
2021-10-18 16:54:35 +00:00
|
|
|
auto pSprite = &pActor->s();
|
2021-10-24 10:10:18 +00:00
|
|
|
short nAction = pActor->nAction;
|
2021-10-15 21:07:38 +00:00
|
|
|
bool bVal = false;
|
|
|
|
|
2021-10-18 16:54:35 +00:00
|
|
|
Gravity(pActor);
|
2021-10-15 21:07:38 +00:00
|
|
|
|
2021-10-24 10:10:18 +00:00
|
|
|
int nSeq = SeqOffsets[kSeqRoach] + RoachSeq[pActor->nAction].a;
|
2021-10-15 21:07:38 +00:00
|
|
|
|
2021-10-24 10:10:18 +00:00
|
|
|
pSprite->picnum = seq_GetSeqPicnum2(nSeq, pActor->nFrame);
|
2021-10-18 16:54:35 +00:00
|
|
|
seq_MoveSequence(pActor, nSeq, pActor->nFrame);
|
2021-10-15 21:07:38 +00:00
|
|
|
|
2021-10-24 10:10:18 +00:00
|
|
|
pActor->nFrame++;
|
|
|
|
if (pActor->nFrame >= SeqSize[nSeq])
|
2021-10-15 21:07:38 +00:00
|
|
|
{
|
|
|
|
bVal = true;
|
2021-10-24 10:10:18 +00:00
|
|
|
pActor->nFrame = 0;
|
2021-10-15 21:07:38 +00:00
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-24 10:10:18 +00:00
|
|
|
int nFlag = FrameFlag[SeqBase[nSeq] + pActor->nFrame];
|
2021-10-18 16:54:35 +00:00
|
|
|
auto pTarget = pActor->pTarget;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 21:07:38 +00:00
|
|
|
if (nAction > 5) {
|
|
|
|
return;
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 21:07:38 +00:00
|
|
|
switch (nAction)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
{
|
2021-10-24 10:10:18 +00:00
|
|
|
if (pActor->nFrame == 1)
|
2021-10-15 21:07:38 +00:00
|
|
|
{
|
2021-10-24 10:10:18 +00:00
|
|
|
pActor->nCount--;
|
|
|
|
if (pActor->nCount <= 0)
|
2021-10-15 21:07:38 +00:00
|
|
|
{
|
2021-10-24 10:10:18 +00:00
|
|
|
pActor->nCount = RandomSize(6);
|
2021-10-15 21:07:38 +00:00
|
|
|
}
|
|
|
|
else
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-10-24 10:10:18 +00:00
|
|
|
pActor->nFrame = 0;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2021-10-15 21:07:38 +00:00
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-18 16:54:35 +00:00
|
|
|
if (((pActor->nPhase & 0xF) == (totalmoves & 0xF)) && pTarget == nullptr)
|
2021-10-15 21:07:38 +00:00
|
|
|
{
|
2021-10-18 16:54:35 +00:00
|
|
|
auto pTarget = FindPlayer(pActor, 50);
|
|
|
|
if (pTarget)
|
2021-10-15 21:07:38 +00:00
|
|
|
{
|
2021-10-24 10:10:18 +00:00
|
|
|
pActor->nAction = 2;
|
|
|
|
pActor->nFrame = 0;
|
2021-10-18 16:54:35 +00:00
|
|
|
pActor->pTarget = pTarget;
|
|
|
|
GoRoach(pSprite);
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2021-10-15 21:07:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 21:07:38 +00:00
|
|
|
case 1:
|
|
|
|
{
|
|
|
|
// partly the same as case 0.
|
2021-10-18 16:54:35 +00:00
|
|
|
if (((pActor->nPhase & 0xF) == (totalmoves & 0xF)) && pTarget == nullptr)
|
2021-10-15 21:07:38 +00:00
|
|
|
{
|
2021-10-18 16:54:35 +00:00
|
|
|
auto pTarget = FindPlayer(pActor, 100);
|
|
|
|
if (pTarget)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-10-24 10:10:18 +00:00
|
|
|
pActor->nAction = 2;
|
|
|
|
pActor->nFrame = 0;
|
2021-10-18 16:54:35 +00:00
|
|
|
pActor->pTarget = pTarget;
|
|
|
|
GoRoach(pSprite);
|
2021-10-15 21:07:38 +00:00
|
|
|
}
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 21:07:38 +00:00
|
|
|
return;
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 21:07:38 +00:00
|
|
|
case 2:
|
|
|
|
{
|
2021-10-18 16:54:35 +00:00
|
|
|
if ((totalmoves & 0xF) == (pActor->nPhase & 0xF))
|
2021-10-15 21:07:38 +00:00
|
|
|
{
|
2021-10-18 16:54:35 +00:00
|
|
|
PlotCourseToSprite(pActor, pTarget);
|
|
|
|
GoRoach(pSprite);
|
2021-10-15 21:07:38 +00:00
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-18 16:54:35 +00:00
|
|
|
auto nMov = MoveCreatureWithCaution(pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-18 16:54:35 +00:00
|
|
|
if (nMov.type == kHitSprite)
|
2021-10-15 21:07:38 +00:00
|
|
|
{
|
2021-10-18 16:54:35 +00:00
|
|
|
if (nMov.actor == pTarget)
|
2021-10-15 21:07:38 +00:00
|
|
|
{
|
|
|
|
// repeated below
|
2021-10-24 10:10:18 +00:00
|
|
|
pActor->nIndex = RandomSize(2) + 1;
|
|
|
|
pActor->nAction = 3;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 21:07:38 +00:00
|
|
|
pSprite->xvel = 0;
|
|
|
|
pSprite->yvel = 0;
|
2021-10-18 16:54:35 +00:00
|
|
|
pSprite->ang = GetMyAngle(pTarget->s().x - pSprite->x, pTarget->s().y - pSprite->y);
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-24 10:10:18 +00:00
|
|
|
pActor->nFrame = 0;
|
2021-10-15 21:07:38 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pSprite->ang = (pSprite->ang + 256) & kAngleMask;
|
2021-10-18 16:54:35 +00:00
|
|
|
GoRoach(pSprite);
|
2021-10-15 21:07:38 +00:00
|
|
|
}
|
|
|
|
}
|
2021-10-18 16:54:35 +00:00
|
|
|
else if (nMov.type == kHitWall)
|
2021-10-15 21:07:38 +00:00
|
|
|
{
|
|
|
|
pSprite->ang = (pSprite->ang + 256) & kAngleMask;
|
2021-10-18 16:54:35 +00:00
|
|
|
GoRoach(pSprite);
|
2021-10-15 21:07:38 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-10-24 10:10:18 +00:00
|
|
|
if (pActor->nCount != 0)
|
2021-10-15 21:07:38 +00:00
|
|
|
{
|
2021-10-24 10:10:18 +00:00
|
|
|
pActor->nCount--;
|
2021-10-15 21:07:38 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// same as above
|
2021-10-24 10:10:18 +00:00
|
|
|
pActor->nIndex = RandomSize(2) + 1;
|
|
|
|
pActor->nAction = 3;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 21:07:38 +00:00
|
|
|
pSprite->xvel = 0;
|
|
|
|
pSprite->yvel = 0;
|
2021-10-18 16:54:35 +00:00
|
|
|
pSprite->ang = GetMyAngle(pTarget->s().x - pSprite->x, pTarget->s().y - pSprite->y);
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-24 10:10:18 +00:00
|
|
|
pActor->nFrame = 0;
|
2021-10-15 21:07:38 +00:00
|
|
|
}
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-18 16:54:35 +00:00
|
|
|
if (pTarget && !(pTarget->s().cstat & 0x101))
|
2021-10-15 21:07:38 +00:00
|
|
|
{
|
2021-10-24 10:10:18 +00:00
|
|
|
pActor->nAction = 1;
|
|
|
|
pActor->nFrame = 0;
|
|
|
|
pActor->nCount = 100;
|
2021-10-18 16:54:35 +00:00
|
|
|
pActor->pTarget = nullptr;
|
2021-10-15 21:07:38 +00:00
|
|
|
pSprite->xvel = 0;
|
|
|
|
pSprite->yvel = 0;
|
|
|
|
}
|
2019-11-13 16:50:52 +00:00
|
|
|
|
2021-10-15 21:07:38 +00:00
|
|
|
return;
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 21:07:38 +00:00
|
|
|
case 3:
|
|
|
|
{
|
|
|
|
if (bVal)
|
|
|
|
{
|
2021-10-24 10:10:18 +00:00
|
|
|
pActor->nIndex--;
|
|
|
|
if (pActor->nIndex <= 0)
|
2021-10-15 21:07:38 +00:00
|
|
|
{
|
2021-10-24 10:10:18 +00:00
|
|
|
pActor->nAction = 2;
|
2021-10-18 16:54:35 +00:00
|
|
|
GoRoach(pSprite);
|
2021-10-24 10:10:18 +00:00
|
|
|
pActor->nFrame = 0;
|
|
|
|
pActor->nCount = RandomSize(7);
|
2021-10-15 21:07:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (nFlag & 0x80)
|
|
|
|
{
|
2021-10-18 16:54:35 +00:00
|
|
|
BuildBullet(pActor, 13, -1, pSprite->ang, pTarget, 1);
|
2021-10-15 21:07:38 +00:00
|
|
|
}
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 21:07:38 +00:00
|
|
|
return;
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 21:07:38 +00:00
|
|
|
case 4:
|
|
|
|
{
|
|
|
|
if (bVal)
|
|
|
|
{
|
2021-10-24 10:10:18 +00:00
|
|
|
pActor->nAction = 2;
|
|
|
|
pActor->nFrame = 0;
|
2021-10-15 21:07:38 +00:00
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 21:07:38 +00:00
|
|
|
return;
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-10-15 21:07:38 +00:00
|
|
|
case 5:
|
|
|
|
{
|
|
|
|
if (bVal)
|
|
|
|
{
|
|
|
|
pSprite->cstat = 0;
|
2021-10-24 10:10:18 +00:00
|
|
|
pActor->nAction = 6;
|
|
|
|
pActor->nFrame = 0;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2021-10-15 21:07:38 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
2021-10-15 21:07:38 +00:00
|
|
|
|
|
|
|
void FuncRoach(int nObject, int nMessage, int nDamage, int nRun)
|
|
|
|
{
|
|
|
|
AIRoach ai;
|
|
|
|
runlist_DispatchEvent(&ai, nObject, nMessage, nDamage, nRun);
|
|
|
|
}
|
|
|
|
|
2019-11-22 23:11:37 +00:00
|
|
|
END_PS_NS
|