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 "player.h"
|
|
|
|
#include "exhumed.h"
|
|
|
|
#include "sound.h"
|
|
|
|
#include "status.h"
|
|
|
|
#include "engine.h"
|
2021-01-01 22:38:15 +00:00
|
|
|
#include "input.h"
|
2020-08-23 14:24:54 +00:00
|
|
|
#include "mapinfo.h"
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-11-22 23:11:37 +00:00
|
|
|
BEGIN_PS_NS
|
|
|
|
|
2019-08-26 03:59:14 +00:00
|
|
|
struct AnimInfo
|
|
|
|
{
|
2019-08-31 07:47:15 +00:00
|
|
|
short a;
|
|
|
|
short repeat;
|
2019-08-26 03:59:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
AnimInfo nItemAnimInfo[] = {
|
2019-08-31 07:47:15 +00:00
|
|
|
{ -1, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ 6, 64 },
|
|
|
|
{ -1, 48 },
|
|
|
|
{ 0, 64 },
|
|
|
|
{ 1, 64 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ 4, 64 },
|
|
|
|
{ 5, 64 },
|
|
|
|
{ 16, 64 },
|
|
|
|
{ 10, 64 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ 8, 64 },
|
|
|
|
{ 9, 64 },
|
|
|
|
{ -1, 40 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ 7, 64 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ 14, 64 },
|
|
|
|
{ 15, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ 17, 48 },
|
|
|
|
{ 18, 48 },
|
|
|
|
{ 19, 48 },
|
|
|
|
{ 20, 48 },
|
|
|
|
{ 24, 64 },
|
|
|
|
{ 21, 64 },
|
|
|
|
{ 23, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ 11, 30 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ -1, 32 },
|
|
|
|
{ -1, 32 }
|
2019-08-26 03:59:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
short nItemMagic[] = { 500, 1000, 100, 500, 400, 200, 700, 0 };
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
short something
|
|
|
|
short x/y repeat
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2021-10-21 08:20:08 +00:00
|
|
|
TArray<DExhumedActor*> Regenerates;
|
2019-08-26 03:59:14 +00:00
|
|
|
short nMagicCount;
|
|
|
|
|
2020-11-29 23:51:56 +00:00
|
|
|
void SerializeItems(FSerializer& arc)
|
|
|
|
{
|
|
|
|
if (arc.BeginObject("items"))
|
|
|
|
{
|
2021-10-21 08:20:08 +00:00
|
|
|
arc("regenerates", Regenerates)
|
2020-11-29 23:51:56 +00:00
|
|
|
("magiccount", nMagicCount)
|
|
|
|
.EndObject();
|
|
|
|
}
|
|
|
|
}
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2021-10-21 07:50:00 +00:00
|
|
|
void BuildItemAnim(DExhumedActor* pActor)
|
2019-08-26 03:59:14 +00:00
|
|
|
{
|
2021-10-21 07:50:00 +00:00
|
|
|
auto pSprite = &pActor->s();
|
2021-09-06 06:33:02 +00:00
|
|
|
|
|
|
|
int nItem = pSprite->statnum - 906;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
|
|
|
if (nItemAnimInfo[nItem].a >= 0)
|
|
|
|
{
|
2021-10-21 07:50:00 +00:00
|
|
|
auto pAnimActor = BuildAnim(pActor, 41, nItemAnimInfo[nItem].a, pSprite->x, pSprite->y, pSprite->z, pSprite->sectnum, nItemAnimInfo[nItem].repeat, 20);
|
2019-08-31 07:47:15 +00:00
|
|
|
|
|
|
|
if (nItem == 44) {
|
2021-10-24 18:21:27 +00:00
|
|
|
pAnimActor->s().cstat |= 2;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
|
2021-10-24 18:21:27 +00:00
|
|
|
ChangeActorStat(pAnimActor, pSprite->statnum);
|
|
|
|
pAnimActor->s().hitag = pSprite->hitag;
|
|
|
|
pSprite->owner = 0;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->owner = -1;
|
|
|
|
pSprite->yrepeat = (uint8_t)nItemAnimInfo[nItem].repeat;
|
|
|
|
pSprite->xrepeat = (uint8_t)nItemAnimInfo[nItem].repeat;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
2021-10-21 07:53:39 +00:00
|
|
|
void DestroyItemAnim(DExhumedActor* actor)
|
2019-08-26 03:59:14 +00:00
|
|
|
{
|
2021-11-08 00:13:54 +00:00
|
|
|
if (actor && actor->s().owner >= 0)
|
2021-10-21 07:53:39 +00:00
|
|
|
DestroyAnim(actor);
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ItemFlash()
|
|
|
|
{
|
2019-10-12 21:09:55 +00:00
|
|
|
TintPalette(16, 16, 16);
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void FillItems(short nPlayer)
|
|
|
|
{
|
2019-08-31 07:47:15 +00:00
|
|
|
for (int i = 0; i < 6; i++)
|
|
|
|
{
|
|
|
|
PlayerList[nPlayer].items[i] = 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
PlayerList[nPlayer].nMagic = 1000;
|
|
|
|
|
|
|
|
if (nPlayer == nLocalPlayer)
|
|
|
|
{
|
|
|
|
ItemFlash();
|
|
|
|
}
|
|
|
|
|
2021-05-13 11:44:58 +00:00
|
|
|
if (PlayerList[nPlayer].nItem == -1) {
|
2021-05-13 16:48:42 +00:00
|
|
|
PlayerList[nPlayer].nItem = 0;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
2020-09-05 10:29:09 +00:00
|
|
|
static bool UseEye(short nPlayer)
|
2019-08-26 03:59:14 +00:00
|
|
|
{
|
2021-05-13 17:15:53 +00:00
|
|
|
if (PlayerList[nPlayer].nInvisible >= 0)
|
|
|
|
PlayerList[nPlayer].nInvisible = 900;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2021-10-21 07:56:04 +00:00
|
|
|
auto pActor = PlayerList[nPlayer].Actor();
|
|
|
|
auto pSprite = &pActor->s();
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->cstat |= 0x8000;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2021-10-21 17:44:53 +00:00
|
|
|
if (PlayerList[nPlayer].pPlayerFloorSprite != nullptr) {
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->cstat |= 0x8000;
|
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 (nPlayer == nLocalPlayer)
|
|
|
|
{
|
|
|
|
ItemFlash();
|
2021-10-21 07:56:04 +00:00
|
|
|
D3PlayFX(StaticSound[kSound31], pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2020-09-05 10:29:09 +00:00
|
|
|
return true;
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
2020-09-05 10:29:09 +00:00
|
|
|
static bool UseMask(short nPlayer)
|
2019-08-26 03:59:14 +00:00
|
|
|
{
|
2019-08-31 07:47:15 +00:00
|
|
|
PlayerList[nPlayer].nMaskAmount = 1350;
|
|
|
|
PlayerList[nPlayer].nAir = 100;
|
|
|
|
|
|
|
|
if (nPlayer == nLocalPlayer)
|
|
|
|
{
|
2021-10-21 07:56:04 +00:00
|
|
|
D3PlayFX(StaticSound[kSound31], PlayerList[nPlayer].Actor());
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2020-09-05 10:29:09 +00:00
|
|
|
return true;
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
2020-09-05 10:29:09 +00:00
|
|
|
bool UseTorch(short nPlayer)
|
2019-08-26 03:59:14 +00:00
|
|
|
{
|
2021-05-13 17:15:53 +00:00
|
|
|
if (!PlayerList[nPlayer].nTorch)
|
2020-09-05 10:29:09 +00:00
|
|
|
{
|
2019-08-31 07:47:15 +00:00
|
|
|
SetTorch(nPlayer, 1);
|
|
|
|
}
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2021-05-13 17:15:53 +00:00
|
|
|
PlayerList[nPlayer].nTorch = 900;
|
2020-09-05 10:29:09 +00:00
|
|
|
return true;
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
2020-09-05 10:29:09 +00:00
|
|
|
bool UseHeart(short nPlayer)
|
2019-08-26 03:59:14 +00:00
|
|
|
{
|
2019-08-31 07:47:15 +00:00
|
|
|
if (PlayerList[nPlayer].nHealth < kMaxHealth) {
|
|
|
|
PlayerList[nPlayer].nHealth = kMaxHealth;
|
|
|
|
|
2020-09-05 10:29:09 +00:00
|
|
|
if (nPlayer == nLocalPlayer)
|
|
|
|
{
|
|
|
|
ItemFlash();
|
2021-10-21 07:56:04 +00:00
|
|
|
D3PlayFX(StaticSound[kSound31], PlayerList[nPlayer].Actor());
|
2020-09-05 10:29:09 +00:00
|
|
|
}
|
|
|
|
return true;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2020-09-05 10:29:09 +00:00
|
|
|
return false;
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// invincibility
|
2020-09-05 10:29:09 +00:00
|
|
|
bool UseScarab(short nPlayer)
|
2019-08-26 03:59:14 +00:00
|
|
|
{
|
2020-10-24 16:03:06 +00:00
|
|
|
if (PlayerList[nPlayer].invincibility >= 0 && PlayerList[nPlayer].invincibility < 900)
|
2019-08-31 07:47:15 +00:00
|
|
|
PlayerList[nPlayer].invincibility = 900;
|
|
|
|
|
|
|
|
if (nPlayer == nLocalPlayer)
|
|
|
|
{
|
|
|
|
ItemFlash();
|
2021-10-21 07:56:04 +00:00
|
|
|
D3PlayFX(StaticSound[kSound31], PlayerList[nPlayer].Actor());
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2020-09-05 10:29:09 +00:00
|
|
|
return true;
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// faster firing
|
2020-09-05 10:29:09 +00:00
|
|
|
static bool UseHand(short nPlayer)
|
2019-08-26 03:59:14 +00:00
|
|
|
{
|
2021-05-13 17:15:53 +00:00
|
|
|
PlayerList[nPlayer].nDouble = 1350;
|
2019-11-20 16:21:32 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
if (nPlayer == nLocalPlayer)
|
|
|
|
{
|
|
|
|
ItemFlash();
|
2021-10-21 07:56:04 +00:00
|
|
|
D3PlayFX(StaticSound[kSound31], PlayerList[nPlayer].Actor());
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2020-09-05 10:29:09 +00:00
|
|
|
return true;
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
2021-11-16 17:45:07 +00:00
|
|
|
void UseItem(short nPlayer, int nItem)
|
2019-08-26 03:59:14 +00:00
|
|
|
{
|
2020-09-05 10:29:09 +00:00
|
|
|
bool didit = false;
|
2019-08-31 07:47:15 +00:00
|
|
|
switch (nItem)
|
|
|
|
{
|
|
|
|
case 0:
|
2020-09-05 10:29:09 +00:00
|
|
|
didit = UseHeart(nPlayer);
|
2019-08-31 07:47:15 +00:00
|
|
|
break;
|
|
|
|
case 1:
|
2020-09-05 10:29:09 +00:00
|
|
|
didit = UseScarab(nPlayer);
|
2019-08-31 07:47:15 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2020-09-05 10:29:09 +00:00
|
|
|
didit = UseTorch(nPlayer);
|
2019-08-31 07:47:15 +00:00
|
|
|
break;
|
|
|
|
case 3:
|
2020-09-05 10:29:09 +00:00
|
|
|
didit = UseHand(nPlayer);
|
2019-08-31 07:47:15 +00:00
|
|
|
break;
|
|
|
|
case 4:
|
2020-09-05 10:29:09 +00:00
|
|
|
didit = UseEye(nPlayer);
|
2019-08-31 07:47:15 +00:00
|
|
|
break;
|
|
|
|
case 5:
|
2020-09-05 10:29:09 +00:00
|
|
|
didit = UseMask(nPlayer);
|
2019-08-31 07:47:15 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2020-09-05 10:29:09 +00:00
|
|
|
if (!didit) return;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
|
|
|
PlayerList[nPlayer].items[nItem]--;
|
|
|
|
int nItemCount = PlayerList[nPlayer].items[nItem];
|
|
|
|
|
|
|
|
int nMagic = nItemMagic[nItem];
|
|
|
|
|
|
|
|
if (!nItemCount)
|
|
|
|
{
|
|
|
|
for (nItem = 0; nItem < 6; nItem++)
|
|
|
|
{
|
|
|
|
if (PlayerList[nPlayer].items[nItem] > 0) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (nItem == 6) {
|
|
|
|
nItem = -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
PlayerList[nPlayer].nMagic -= nMagic;
|
2021-05-13 16:48:42 +00:00
|
|
|
PlayerList[nPlayer].nItem = nItem;
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// TODO - bool return type?
|
2021-11-16 17:45:07 +00:00
|
|
|
int GrabItem(short nPlayer, int nItem)
|
2019-08-26 03:59:14 +00:00
|
|
|
{
|
2019-08-31 07:47:15 +00:00
|
|
|
if (PlayerList[nPlayer].items[nItem] >= 5) {
|
|
|
|
return 0;
|
|
|
|
}
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
PlayerList[nPlayer].items[nItem]++;
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2021-05-13 11:44:58 +00:00
|
|
|
if (PlayerList[nPlayer].nItem < 0 || nItem == PlayerList[nPlayer].nItem) {
|
2021-05-13 16:48:42 +00:00
|
|
|
PlayerList[nPlayer].nItem = nItem;
|
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 1;
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
2021-10-21 08:20:08 +00:00
|
|
|
void DropMagic(DExhumedActor* pActor)
|
2019-08-26 03:59:14 +00:00
|
|
|
{
|
2021-10-21 08:20:08 +00:00
|
|
|
auto pSprite = &pActor->s();
|
2021-09-06 06:33:02 +00:00
|
|
|
|
2019-08-31 07:47:15 +00:00
|
|
|
if (lFinaleStart) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
nMagicCount--;
|
|
|
|
|
|
|
|
if (nMagicCount <= 0)
|
|
|
|
{
|
2021-10-24 18:21:27 +00:00
|
|
|
auto pAnimActor = BuildAnim(
|
|
|
|
nullptr,
|
2019-08-31 07:47:15 +00:00
|
|
|
64,
|
|
|
|
0,
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->x,
|
|
|
|
pSprite->y,
|
|
|
|
pSprite->z,
|
|
|
|
pSprite->sectnum,
|
2019-08-31 07:47:15 +00:00
|
|
|
48,
|
|
|
|
4);
|
|
|
|
|
2021-10-24 18:21:27 +00:00
|
|
|
if (pAnimActor)
|
|
|
|
{
|
|
|
|
AddFlash(pAnimActor->s().sectnum, pAnimActor->s().x, pAnimActor->s().y, pAnimActor->s().z, 128);
|
|
|
|
ChangeActorStat(pAnimActor, 950);
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
nMagicCount = RandomSize(2);
|
|
|
|
}
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void InitItems()
|
|
|
|
{
|
2021-10-21 08:20:08 +00:00
|
|
|
Regenerates.Clear();
|
2019-08-31 07:47:15 +00:00
|
|
|
nMagicCount = 0;
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
2021-10-21 08:20:08 +00:00
|
|
|
void StartRegenerate(DExhumedActor* pActor)
|
2019-08-26 03:59:14 +00:00
|
|
|
{
|
2021-10-21 08:20:08 +00:00
|
|
|
spritetype *pSprite = &pActor->s();
|
2019-08-26 03:59:14 +00:00
|
|
|
|
2021-10-21 08:20:08 +00:00
|
|
|
auto pos = Regenerates.Find(pActor);
|
|
|
|
if (pos >= Regenerates.Size())
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-10-21 08:20:08 +00:00
|
|
|
// ?? CHECKME
|
|
|
|
pSprite->xvel = pSprite->xrepeat;
|
|
|
|
pSprite->zvel = pSprite->shade;
|
|
|
|
pSprite->yvel = pSprite->pal;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Regenerates.Delete(pos);
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pSprite->extra = 1350;
|
|
|
|
|
2021-05-02 13:54:19 +00:00
|
|
|
if (!(currentLevel->gameflags & LEVEL_EX_MULTI))
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
|
|
|
pSprite->ang /= 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
pSprite->cstat = 0x8000;
|
|
|
|
pSprite->xrepeat = 1;
|
|
|
|
pSprite->yrepeat = 1;
|
|
|
|
pSprite->pal = 1;
|
|
|
|
|
2021-10-21 08:20:08 +00:00
|
|
|
Regenerates.Push(pActor);
|
2019-08-26 03:59:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void DoRegenerates()
|
|
|
|
{
|
2021-10-21 08:20:08 +00:00
|
|
|
for(unsigned i = 0; i < Regenerates.Size(); i++)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-10-21 08:20:08 +00:00
|
|
|
auto pActor = Regenerates[i];
|
|
|
|
auto pSprite = &pActor->s();
|
2021-09-06 06:33:02 +00:00
|
|
|
if (pSprite->extra > 0)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->extra--;
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-09-06 06:33:02 +00:00
|
|
|
if (pSprite->extra <= 0)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-10-24 17:11:04 +00:00
|
|
|
BuildAnim(nullptr, 38, 0, pSprite->x, pSprite->y, pSprite->z, pSprite->sectnum, 64, 4);
|
2021-10-21 08:20:08 +00:00
|
|
|
D3PlayFX(StaticSound[kSoundTorchOn], pActor);
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2019-11-13 20:36:24 +00:00
|
|
|
else {
|
|
|
|
continue;
|
|
|
|
}
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-09-06 06:33:02 +00:00
|
|
|
if (pSprite->xrepeat < pSprite->xvel)
|
2019-08-31 07:47:15 +00:00
|
|
|
{
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->xrepeat += 2;
|
|
|
|
pSprite->yrepeat += 2;
|
2019-08-31 07:47:15 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->zvel = 0;
|
|
|
|
pSprite->yrepeat = (uint8_t)pSprite->xvel;
|
|
|
|
pSprite->xrepeat = (uint8_t)pSprite->xvel;
|
|
|
|
pSprite->pal = (uint8_t)pSprite->yvel;
|
|
|
|
pSprite->yvel = pSprite->zvel; // setting to 0
|
|
|
|
pSprite->xvel = pSprite->zvel; // setting to 0
|
2019-08-31 07:47:15 +00:00
|
|
|
|
2021-09-06 06:33:02 +00:00
|
|
|
if (pSprite->statnum == kStatExplodeTrigger) {
|
|
|
|
pSprite->cstat = 0x101;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
|
|
|
else {
|
2021-09-06 06:33:02 +00:00
|
|
|
pSprite->cstat = 0;
|
2019-08-31 07:47:15 +00:00
|
|
|
}
|
2021-10-21 08:20:08 +00:00
|
|
|
Regenerates.Delete(i);
|
|
|
|
i--;
|
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
|