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"
|
|
|
|
#include "exhumed.h"
|
2020-08-18 07:52:08 +00:00
|
|
|
#include "aistuff.h"
|
2019-08-26 03:59:14 +00:00
|
|
|
#include "status.h"
|
|
|
|
#include "player.h"
|
|
|
|
#include "sequence.h"
|
2019-11-24 09:03:19 +00:00
|
|
|
#include "ps_input.h"
|
2019-08-26 03:59:14 +00:00
|
|
|
#include "sound.h"
|
|
|
|
#include <string.h>
|
|
|
|
#include <assert.h>
|
|
|
|
|
2019-11-22 23:11:37 +00:00
|
|
|
BEGIN_PS_NS
|
|
|
|
|
2019-08-26 03:59:14 +00:00
|
|
|
#define kMaxSnakes 50
|
|
|
|
|
|
|
|
int nSnakeCount = 0;
|
|
|
|
int nSnakesFree;
|
|
|
|
|
|
|
|
short SnakeFree[kMaxSnakes];
|
|
|
|
short nPlayerSnake[kMaxPlayers];
|
|
|
|
|
|
|
|
Snake SnakeList[kMaxSnakes];
|
|
|
|
short nSnakePlayer[kMaxSnakes];
|
|
|
|
|
2019-12-26 21:00:04 +00:00
|
|
|
static SavegameHelper sgh("snake",
|
|
|
|
SV(nSnakeCount),
|
|
|
|
SV(nSnakesFree),
|
|
|
|
SA(SnakeFree),
|
|
|
|
SA(nPlayerSnake),
|
|
|
|
SA(SnakeList),
|
|
|
|
SA(nSnakePlayer),
|
|
|
|
nullptr);
|
2019-08-26 03:59:14 +00:00
|
|
|
|
|
|
|
void InitSnakes()
|
|
|
|
{
|
2019-08-31 07:47:15 +00:00
|
|
|
nSnakeCount = 0;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
for (int i = 0; i < kMaxSnakes; i++) {
|
|
|
|
SnakeFree[i] = i;
|
|
|
|
}
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
nSnakesFree = kMaxSnakes;
|
|
|
|
memset(nPlayerSnake, 0, sizeof(nPlayerSnake));
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
short GrabSnake()
|
|
|
|
{
|
2019-08-31 07:47:15 +00:00
|
|
|
nSnakesFree--;
|
|
|
|
return SnakeFree[nSnakesFree];
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void DestroySnake(int nSnake)
|
|
|
|
{
|
2019-08-31 07:47:15 +00:00
|
|
|
short nRun = SnakeList[nSnake].nRun;
|
|
|
|
runlist_SubRunRec(nRun);
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
for (int i = 0; i < kSnakeSprites; i++)
|
|
|
|
{
|
|
|
|
short nSprite = SnakeList[nSnake].nSprites[i];
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
runlist_DoSubRunRec(sprite[nSprite].lotag - 1);
|
|
|
|
runlist_DoSubRunRec(sprite[nSprite].owner);
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
mydeletesprite(nSprite);
|
|
|
|
}
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
SnakeFree[nSnakesFree] = nSnake;
|
|
|
|
nSnakesFree++;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
if (nSnake == nSnakeCam)
|
|
|
|
{
|
|
|
|
nSnakeCam = -1;
|
|
|
|
}
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ExplodeSnakeSprite(int nSprite, short nPlayer)
|
|
|
|
{
|
2019-08-31 07:47:15 +00:00
|
|
|
short nDamage = BulletInfo[kWeaponStaff].nDamage;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
if (nPlayerDouble[nPlayer] > 0) {
|
|
|
|
nDamage *= 2;
|
|
|
|
}
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
// take a copy of this, to revert after call to runlist_RadialDamageEnemy()
|
|
|
|
short nOwner = sprite[nSprite].owner;
|
|
|
|
sprite[nSprite].owner = PlayerList[nPlayer].nSprite;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2020-02-04 21:45:10 +00:00
|
|
|
runlist_RadialDamageEnemy(nSprite, nDamage, BulletInfo[kWeaponStaff].nRadius);
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
sprite[nSprite].owner = nOwner;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
BuildAnim(-1, 23, 0, sprite[nSprite].x, sprite[nSprite].y, sprite[nSprite].z, sprite[nSprite].sectnum, 40, 4);
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
AddFlash(sprite[nSprite].sectnum, sprite[nSprite].x, sprite[nSprite].y, sprite[nSprite].z, 128);
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
StopSpriteSound(nSprite);
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int BuildSnake(short nPlayer, short zVal)
|
|
|
|
{
|
2019-08-31 07:47:15 +00:00
|
|
|
if (!nSnakesFree)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
zVal -= 1280;
|
|
|
|
|
|
|
|
short nPlayerSprite = PlayerList[nPlayer].nSprite;
|
|
|
|
short nViewSect = nPlayerViewSect[nPlayer];
|
|
|
|
short nPic = seq_GetSeqPicnum(kSeqSnakBody, 0, 0);
|
|
|
|
|
|
|
|
int x = sprite[nPlayerSprite].x;
|
|
|
|
int y = sprite[nPlayerSprite].y;
|
|
|
|
int z = (sprite[nPlayerSprite].z + zVal) - 2560;
|
|
|
|
short nAngle = sprite[nPlayerSprite].ang;
|
|
|
|
|
2019-12-02 16:34:59 +00:00
|
|
|
short hitsect, hitsprite;
|
2019-08-31 07:47:15 +00:00
|
|
|
int hitx, hity, hitz;
|
|
|
|
|
|
|
|
short nSprite;
|
|
|
|
|
|
|
|
vec3_t pos = { x, y, z };
|
|
|
|
hitdata_t hitData;
|
2019-11-18 19:38:19 +00:00
|
|
|
hitscan(&pos, sprite[nPlayerSprite].sectnum, Cos(nAngle), Sin(nAngle), 0, &hitData, CLIPMASK1);
|
2019-08-31 07:47:15 +00:00
|
|
|
|
|
|
|
hitx = hitData.pos.x;
|
|
|
|
hity = hitData.pos.y;
|
|
|
|
hitz = hitData.pos.z;
|
|
|
|
hitsect = hitData.sect;
|
|
|
|
hitsprite = hitData.sprite;
|
|
|
|
|
|
|
|
int nSqrt = ksqrt(((hity - y) * (hity - y)) + ((hitx - x) * (hitx - x)));
|
|
|
|
|
2019-11-18 19:38:19 +00:00
|
|
|
if (nSqrt < (sintable[512] >> 4))
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
|
|
|
BackUpBullet(&hitx, &hity, nAngle);
|
|
|
|
nSprite = insertsprite(hitsect, 202);
|
|
|
|
sprite[nSprite].x = hitx;
|
|
|
|
sprite[nSprite].y = hity;
|
|
|
|
sprite[nSprite].z = hitz;
|
|
|
|
|
|
|
|
ExplodeSnakeSprite(nSprite, nPlayer);
|
|
|
|
mydeletesprite(nSprite);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
short nTarget;
|
|
|
|
|
2019-11-18 19:38:19 +00:00
|
|
|
if (hitsprite >= 0 && sprite[hitsprite].statnum >= 90 && sprite[hitsprite].statnum <= 199) {
|
|
|
|
nTarget = hitsprite;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
else {
|
2019-11-18 19:38:19 +00:00
|
|
|
nTarget = sPlayerInput[nPlayer].nTarget;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
short nSnake = GrabSnake();
|
2019-08-26 03:59:14 +00:00
|
|
|
|
|
|
|
// GrabTimeSlot(3);
|
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
short var_24;
|
|
|
|
|
|
|
|
for (int i = 0; i < kSnakeSprites; i++)
|
|
|
|
{
|
|
|
|
nSprite = insertsprite(nViewSect, 202);
|
|
|
|
assert(nSprite >= 0 && nSprite < kMaxSprites);
|
|
|
|
|
|
|
|
sprite[nSprite].owner = nPlayerSprite;
|
|
|
|
sprite[nSprite].picnum = nPic;
|
|
|
|
|
2019-11-18 19:38:19 +00:00
|
|
|
if (i == 0)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
|
|
|
sprite[nSprite].x = sprite[nPlayerSprite].x;
|
|
|
|
sprite[nSprite].y = sprite[nPlayerSprite].y;
|
|
|
|
sprite[nSprite].z = sprite[nPlayerSprite].z + zVal;
|
|
|
|
sprite[nSprite].xrepeat = 32;
|
|
|
|
sprite[nSprite].yrepeat = 32;
|
|
|
|
nViewSect = sprite[nSprite].sectnum;
|
|
|
|
var_24 = nSprite;
|
|
|
|
}
|
2019-11-18 19:38:19 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
sprite[nSprite].x = sprite[var_24].x;
|
|
|
|
sprite[nSprite].y = sprite[var_24].y;
|
|
|
|
sprite[nSprite].z = sprite[var_24].z;
|
|
|
|
sprite[nSprite].xrepeat = 40 - 3*i;
|
|
|
|
sprite[nSprite].yrepeat = 40 - 3*i;
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
|
|
|
|
sprite[nSprite].clipdist = 10;
|
|
|
|
sprite[nSprite].cstat = 0;
|
|
|
|
sprite[nSprite].shade = -64;
|
|
|
|
sprite[nSprite].pal = 0;
|
|
|
|
sprite[nSprite].xoffset = 0;
|
|
|
|
sprite[nSprite].yoffset = 0;
|
|
|
|
sprite[nSprite].ang = sprite[nPlayerSprite].ang;
|
|
|
|
sprite[nSprite].xvel = 0;
|
|
|
|
sprite[nSprite].yvel = 0;
|
|
|
|
sprite[nSprite].zvel = 0;
|
|
|
|
sprite[nSprite].hitag = 0;
|
|
|
|
sprite[nSprite].extra = -1;
|
|
|
|
sprite[nSprite].lotag = runlist_HeadRun() + 1;
|
|
|
|
|
|
|
|
SnakeList[nSnake].nSprites[i] = nSprite;
|
|
|
|
|
|
|
|
sprite[nSprite].owner = runlist_AddRunRec(sprite[nSprite].lotag - 1, ((nSnake << 8) | i) | 0x110000);
|
|
|
|
}
|
|
|
|
|
|
|
|
SnakeList[nSnake].nRun = runlist_AddRunRec(NewRun, nSnake | 0x110000);
|
|
|
|
SnakeList[nSnake].c[1] = 2;
|
|
|
|
SnakeList[nSnake].c[5] = 5;
|
|
|
|
SnakeList[nSnake].c[2] = 4;
|
|
|
|
SnakeList[nSnake].c[3] = 6;
|
|
|
|
SnakeList[nSnake].c[4] = 7;
|
|
|
|
SnakeList[nSnake].c[6] = 6;
|
|
|
|
SnakeList[nSnake].c[7] = 7;
|
|
|
|
SnakeList[nSnake].nEnemy = nTarget;
|
|
|
|
SnakeList[nSnake].sC = 1200;
|
|
|
|
SnakeList[nSnake].sE = 0;
|
|
|
|
nSnakePlayer[nSnake] = nPlayer;
|
|
|
|
nPlayerSnake[nPlayer] = nSnake;
|
|
|
|
|
|
|
|
if (bSnakeCam)
|
|
|
|
{
|
|
|
|
if (nSnakeCam < 0) {
|
|
|
|
nSnakeCam = nSnake;
|
|
|
|
}
|
|
|
|
}
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-09-21 15:47:55 +00:00
|
|
|
D3PlayFX(StaticSound[kSound6], var_24);
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
return nSprite;
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int FindSnakeEnemy(short nSnake)
|
|
|
|
{
|
2019-08-31 07:47:15 +00:00
|
|
|
short nPlayer = nSnakePlayer[nSnake];
|
|
|
|
short nPlayerSprite = PlayerList[nPlayer].nSprite;
|
|
|
|
|
|
|
|
short nSprite = SnakeList[nSnake].nSprites[0]; // CHECKME
|
|
|
|
|
|
|
|
short nAngle = sprite[nSprite].ang;
|
|
|
|
short nSector = sprite[nSprite].sectnum;
|
|
|
|
|
|
|
|
int esi = 2048;
|
|
|
|
|
|
|
|
int nEnemy = -1;
|
|
|
|
|
|
|
|
for (int i = headspritesect[nSector]; i >= 0; i = nextspritesect[i])
|
|
|
|
{
|
2019-11-18 19:38:19 +00:00
|
|
|
if (sprite[i].statnum >= 90 && sprite[i].statnum < 150 && (sprite[i].cstat & 0x101))
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2019-11-18 19:38:19 +00:00
|
|
|
if (i != nPlayerSprite && !(sprite[i].cstat & 0x8000))
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
|
|
|
int nAngle2 = (nAngle - GetAngleToSprite(nSprite, i)) & kAngleMask;
|
|
|
|
if (nAngle2 < esi)
|
|
|
|
{
|
|
|
|
nEnemy = i;
|
|
|
|
esi = nAngle2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-18 19:38:19 +00:00
|
|
|
if (nEnemy != -1)
|
|
|
|
{
|
|
|
|
SnakeList[nSnake].nEnemy = nEnemy;
|
|
|
|
}
|
|
|
|
else
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
|
|
|
SnakeList[nSnake].nEnemy--;
|
|
|
|
if (SnakeList[nSnake].nEnemy < -25)
|
|
|
|
{
|
|
|
|
nEnemy = nPlayerSprite;
|
|
|
|
SnakeList[nSnake].nEnemy = nPlayerSprite;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nEnemy;
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
2019-12-02 16:34:59 +00:00
|
|
|
void FuncSnake(int a, int UNUSED(nDamage), int nRun)
|
2019-08-26 03:59:14 +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:
|
|
|
|
{
|
|
|
|
short nSnake = RunData[nRun].nVal;
|
|
|
|
assert(nSnake >= 0 && nSnake < kMaxSnakes);
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
short nSprite = SnakeList[nSnake].nSprites[0];
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
seq_MoveSequence(nSprite, SeqOffsets[kSeqSnakehed], 0);
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
short nEnemySprite = SnakeList[nSnake].nEnemy;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
int nMov;
|
|
|
|
int zVal;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-11-18 19:38:19 +00:00
|
|
|
if (nEnemySprite < 0)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2019-11-18 19:38:19 +00:00
|
|
|
SEARCH_ENEMY:
|
|
|
|
nMov = movesprite(nSprite,
|
|
|
|
600 * Cos(sprite[nSprite].ang),
|
|
|
|
600 * Sin(sprite[nSprite].ang),
|
|
|
|
Sin(SnakeList[nSnake].sE) >> 5,
|
|
|
|
0, 0, CLIPMASK1);
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-11-18 19:38:19 +00:00
|
|
|
FindSnakeEnemy(nSnake);
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-11-18 19:38:19 +00:00
|
|
|
zVal = 0;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-11-18 19:38:19 +00:00
|
|
|
if (!(sprite[nEnemySprite].cstat&0x101))
|
|
|
|
{
|
2019-08-31 07:47:15 +00:00
|
|
|
SnakeList[nSnake].nEnemy = -1;
|
2019-11-18 19:38:19 +00:00
|
|
|
goto SEARCH_ENEMY;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-11-18 19:38:19 +00:00
|
|
|
zVal = sprite[nSprite].z;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-11-18 19:38:19 +00:00
|
|
|
nMov = AngleChase(nSprite, nEnemySprite, 1200, SnakeList[nSnake].sE, 32);
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-11-18 19:38:19 +00:00
|
|
|
zVal = sprite[nSprite].z - zVal;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
if (nMov)
|
|
|
|
{
|
|
|
|
short nPlayer = nSnakePlayer[nSnake];
|
|
|
|
ExplodeSnakeSprite(SnakeList[nSnake].nSprites[0], nPlayer);
|
2019-11-20 16:21:32 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
nPlayerSnake[nPlayer] = -1;
|
|
|
|
nSnakePlayer[nSnake] = -1;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
DestroySnake(nSnake);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
short nAngle = sprite[nSprite].ang;
|
2019-11-18 19:38:19 +00:00
|
|
|
int var_30 = -(64 * Cos(nAngle));
|
2019-08-31 07:47:15 +00:00
|
|
|
int var_34 = -(64 * Sin(nAngle));
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
int var_20 = SnakeList[nSnake].sE;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
SnakeList[nSnake].sE = (SnakeList[nSnake].sE + 64) & 0x7FF;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
int var_28 = (nAngle + 512) & kAngleMask;
|
|
|
|
short nSector = sprite[nSprite].sectnum;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
int x = sprite[nSprite].x;
|
|
|
|
int y = sprite[nSprite].y;
|
|
|
|
int z = sprite[nSprite].z;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
for (int i = 7; i > 0; i--)
|
|
|
|
{
|
|
|
|
int nSprite2 = SnakeList[nSnake].nSprites[i];
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
sprite[nSprite2].ang = nAngle;
|
|
|
|
sprite[nSprite2].x = x;
|
|
|
|
sprite[nSprite2].y = y;
|
|
|
|
sprite[nSprite2].z = z;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
mychangespritesect(nSprite2, nSector);
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-11-18 19:38:19 +00:00
|
|
|
int eax = (Sin(var_20) * SnakeList[nSnake].c[i]) >> 9;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-11-18 19:38:19 +00:00
|
|
|
movesprite(nSprite2, var_30 + var_30 * i + eax * Cos(var_28), var_30 + var_34 * i + eax * Sin(var_28),
|
|
|
|
-zVal*(i-1), 0, 0, CLIPMASK1);
|
2019-11-20 16:21:32 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
var_20 = (var_20 + 128) & kAngleMask;
|
|
|
|
}
|
|
|
|
}
|
2019-11-18 19:38:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0x90000:
|
|
|
|
{
|
|
|
|
short nSnake = RunData[nRun].nVal;
|
|
|
|
short nSprite = a & 0xFFFF;
|
|
|
|
|
|
|
|
if ((nSnake & 0xFF) == 0) {
|
|
|
|
seq_PlotSequence(nSprite, SeqOffsets[kSeqSnakehed], 0, 0);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
seq_PlotSequence(nSprite, SeqOffsets[kSeqSnakBody], 0, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
tsprite[nSprite].owner = -1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case 0xA0000:
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
default:
|
|
|
|
{
|
2020-03-02 21:08:31 +00:00
|
|
|
Printf("unknown msg %x for bullet\n", nMessage);
|
2019-11-18 19:38:19 +00:00
|
|
|
break;
|
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
|