- QueueFootPrint + QueuefloorBlood.

This commit is contained in:
Christoph Oelckers 2021-11-03 23:00:56 +01:00
parent 01d2967378
commit 83d0930a2e
4 changed files with 46 additions and 42 deletions

View file

@ -577,7 +577,7 @@ typedef enum {WATER_FOOT, BLOOD_FOOT} FOOT_TYPE;
extern FOOT_TYPE FootMode; extern FOOT_TYPE FootMode;
ANIMATOR QueueFloorBlood; // Weapon.c ANIMATOR QueueFloorBlood; // Weapon.c
int QueueFootPrint(short hit_sprite); // Weapon.c int QueueFootPrint(DSWActor*); // Weapon.c
void QueueLoWangs(DSWActor*); // Weapon.c void QueueLoWangs(DSWActor*); // Weapon.c
int SpawnShell(DSWActor* actor, int ShellNum); // JWeapon.c int SpawnShell(DSWActor* actor, int ShellNum); // JWeapon.c
void UnlockKeyLock(short key_num, DSWActor* actor); // JSector.c void UnlockKeyLock(short key_num, DSWActor* actor); // JSector.c

View file

@ -7135,7 +7135,6 @@ void InitMultiPlayerInfo(void)
int DoFootPrints(DSWActor* actor) int DoFootPrints(DSWActor* actor)
{ {
USER* u = actor->u(); USER* u = actor->u();
int SpriteNum = u->SpriteNum;
if (u->PlayerP) if (u->PlayerP)
{ {
@ -7147,7 +7146,7 @@ int DoFootPrints(DSWActor* actor)
if (u->PlayerP->NumFootPrints > 0) if (u->PlayerP->NumFootPrints > 0)
{ {
QueueFootPrint(SpriteNum); QueueFootPrint(actor);
} }
} }

View file

@ -80,7 +80,7 @@ short HoleQueue[MAX_HOLE_QUEUE];
short WallBloodQueueHead=0; short WallBloodQueueHead=0;
DSWActor* WallBloodQueue[MAX_WALLBLOOD_QUEUE]; DSWActor* WallBloodQueue[MAX_WALLBLOOD_QUEUE];
short FloorBloodQueueHead=0; short FloorBloodQueueHead=0;
short FloorBloodQueue[MAX_FLOORBLOOD_QUEUE]; DSWActor* FloorBloodQueue[MAX_FLOORBLOOD_QUEUE];
short GenericQueueHead=0; short GenericQueueHead=0;
DSWActor* GenericQueue[MAX_GENERIC_QUEUE]; DSWActor* GenericQueue[MAX_GENERIC_QUEUE];
short LoWangsQueueHead=0; short LoWangsQueueHead=0;
@ -19954,8 +19954,8 @@ void SpriteQueueDelete(DSWActor* actor)
WallBloodQueue[i] = nullptr; WallBloodQueue[i] = nullptr;
for (i = 0; i < MAX_FLOORBLOOD_QUEUE; i++) for (i = 0; i < MAX_FLOORBLOOD_QUEUE; i++)
if (FloorBloodQueue[i] == SpriteNum) if (FloorBloodQueue[i] == actor)
FloorBloodQueue[i] = -1; FloorBloodQueue[i] = nullptr;
for (i = 0; i < MAX_GENERIC_QUEUE; i++) for (i = 0; i < MAX_GENERIC_QUEUE; i++)
if (GenericQueue[i] == actor) if (GenericQueue[i] == actor)
@ -19988,7 +19988,7 @@ void QueueReset(void)
WallBloodQueue[i] = nullptr; WallBloodQueue[i] = nullptr;
for (i = 0; i < MAX_FLOORBLOOD_QUEUE; i++) for (i = 0; i < MAX_FLOORBLOOD_QUEUE; i++)
FloorBloodQueue[i] = -1; FloorBloodQueue[i] = nullptr;
for (i = 0; i < MAX_GENERIC_QUEUE; i++) for (i = 0; i < MAX_GENERIC_QUEUE; i++)
GenericQueue[i] = nullptr; GenericQueue[i] = nullptr;
@ -20121,7 +20121,7 @@ int QueueHole(short hit_sect, short hit_wall, int hit_x, int hit_y, int hit_z)
return SpriteNum; return SpriteNum;
} }
#define FLOORBLOOD_RATE 30 enum { FLOORBLOOD_RATE = 30 };
ANIMATOR DoFloorBlood; ANIMATOR DoFloorBlood;
STATE s_FloorBlood1[] = STATE s_FloorBlood1[] =
{ {
@ -20132,11 +20132,10 @@ STATE s_FloorBlood1[] =
int QueueFloorBlood(DSWActor* actor) int QueueFloorBlood(DSWActor* actor)
{ {
USER* u = actor->u(); USER* u = actor->u();
int hit_sprite = u->SpriteNum; SPRITEp hsp = &actor->s();
SPRITEp hsp = &sprite[hit_sprite];
short SpriteNum;
SPRITEp sp; SPRITEp sp;
SECTORp sectp = &sector[hsp->sectnum]; SECTORp sectp = &sector[hsp->sectnum];
DSWActor* spawnedActor = nullptr;
if (TEST(sectp->extra, SECTFX_SINK)||TEST(sectp->extra, SECTFX_CURRENT)) if (TEST(sectp->extra, SECTFX_SINK)||TEST(sectp->extra, SECTFX_CURRENT))
@ -20154,15 +20153,15 @@ int QueueFloorBlood(DSWActor* actor)
if (TestDontStickSector(hsp->sectnum)) if (TestDontStickSector(hsp->sectnum))
return -1; // Not on special sectors you don't return -1; // Not on special sectors you don't
if (FloorBloodQueue[FloorBloodQueueHead] != -1) if (FloorBloodQueue[FloorBloodQueueHead] != nullptr)
KillSprite(FloorBloodQueue[FloorBloodQueueHead]); KillActor(FloorBloodQueue[FloorBloodQueueHead]);
FloorBloodQueue[FloorBloodQueueHead] = SpriteNum = FloorBloodQueue[FloorBloodQueueHead] = spawnedActor =
SpawnSprite(STAT_SKIP4, FLOORBLOOD1, s_FloorBlood1, hsp->sectnum, hsp->x, hsp->y, hsp->z, hsp->ang, 0); SpawnActor(STAT_SKIP4, FLOORBLOOD1, s_FloorBlood1, hsp->sectnum, hsp->x, hsp->y, hsp->z, hsp->ang, 0);
FloorBloodQueueHead = (FloorBloodQueueHead+1) & (MAX_FLOORBLOOD_QUEUE-1); FloorBloodQueueHead = (FloorBloodQueueHead+1) & (MAX_FLOORBLOOD_QUEUE-1);
sp = &sprite[SpriteNum]; sp = &spawnedActor->s();
// Stupid hack to fix the blood under the skull to not show through // Stupid hack to fix the blood under the skull to not show through
// x,y repeat of floor blood MUST be smaller than the sprite above it or clipping probs. // x,y repeat of floor blood MUST be smaller than the sprite above it or clipping probs.
if (u->ID == GORE_Head) if (u->ID == GORE_Head)
@ -20187,13 +20186,16 @@ int QueueFloorBlood(DSWActor* actor)
RESET(sp->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN); RESET(sp->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
RESET(u->Flags, SPR_SHADOW); RESET(u->Flags, SPR_SHADOW);
return SpriteNum; return spawnedActor->GetSpriteIndex();
} }
#define FOOTPRINT1 2490 enum
#define FOOTPRINT2 2491 {
#define FOOTPRINT3 2492 FOOTPRINT1 = 2490,
#define FOOTPRINT_RATE 30 FOOTPRINT2 = 2491,
FOOTPRINT3 = 2492,
FOOTPRINT_RATE = 30,
};
ANIMATOR DoFootPrint; ANIMATOR DoFootPrint;
STATE s_FootPrint1[] = STATE s_FootPrint1[] =
{ {
@ -20208,12 +20210,12 @@ STATE s_FootPrint3[] =
{FOOTPRINT3, FOOTPRINT_RATE, NullAnimator, &s_FootPrint3[0]}, {FOOTPRINT3, FOOTPRINT_RATE, NullAnimator, &s_FootPrint3[0]},
}; };
int QueueFootPrint(short hit_sprite) int QueueFootPrint(DSWActor* actor)
{ {
SPRITEp hsp = &sprite[hit_sprite]; SPRITEp hsp = &actor->s();
short SpriteNum; DSWActor* spawnedActor;
SPRITEp sp; SPRITEp sp;
USERp u = User[hit_sprite].Data(); USERp u = actor->u();
USERp nu; USERp nu;
short rnd_num=0; short rnd_num=0;
bool Found=false; bool Found=false;
@ -20248,20 +20250,20 @@ int QueueFootPrint(short hit_sprite)
return -1; // Not on special sectors you don't return -1; // Not on special sectors you don't
// So, are we like, done checking now!? // So, are we like, done checking now!?
if (FloorBloodQueue[FloorBloodQueueHead] != -1) if (FloorBloodQueue[FloorBloodQueueHead] != nullptr)
KillSprite(FloorBloodQueue[FloorBloodQueueHead]); KillActor(FloorBloodQueue[FloorBloodQueueHead]);
rnd_num = RandomRange(1024); rnd_num = RandomRange(1024);
if (rnd_num > 683) if (rnd_num > 683)
FloorBloodQueue[FloorBloodQueueHead] = SpriteNum = FloorBloodQueue[FloorBloodQueueHead] = spawnedActor =
SpawnSprite(STAT_WALLBLOOD_QUEUE, FOOTPRINT1, s_FootPrint1, hsp->sectnum, hsp->x, hsp->y, hsp->z, hsp->ang, 0); SpawnActor(STAT_WALLBLOOD_QUEUE, FOOTPRINT1, s_FootPrint1, hsp->sectnum, hsp->x, hsp->y, hsp->z, hsp->ang, 0);
else if (rnd_num > 342) else if (rnd_num > 342)
FloorBloodQueue[FloorBloodQueueHead] = SpriteNum = FloorBloodQueue[FloorBloodQueueHead] = spawnedActor =
SpawnSprite(STAT_WALLBLOOD_QUEUE, FOOTPRINT2, s_FootPrint2, hsp->sectnum, hsp->x, hsp->y, hsp->z, hsp->ang, 0); SpawnActor(STAT_WALLBLOOD_QUEUE, FOOTPRINT2, s_FootPrint2, hsp->sectnum, hsp->x, hsp->y, hsp->z, hsp->ang, 0);
else else
FloorBloodQueue[FloorBloodQueueHead] = SpriteNum = FloorBloodQueue[FloorBloodQueueHead] = spawnedActor =
SpawnSprite(STAT_WALLBLOOD_QUEUE, FOOTPRINT3, s_FootPrint3, hsp->sectnum, hsp->x, hsp->y, hsp->z, hsp->ang, 0); SpawnActor(STAT_WALLBLOOD_QUEUE, FOOTPRINT3, s_FootPrint3, hsp->sectnum, hsp->x, hsp->y, hsp->z, hsp->ang, 0);
FloorBloodQueueHead = (FloorBloodQueueHead+1) & (MAX_FLOORBLOOD_QUEUE-1); FloorBloodQueueHead = (FloorBloodQueueHead+1) & (MAX_FLOORBLOOD_QUEUE-1);
@ -20270,8 +20272,8 @@ int QueueFootPrint(short hit_sprite)
u->PlayerP->NumFootPrints--; u->PlayerP->NumFootPrints--;
sp = &sprite[SpriteNum]; sp = &spawnedActor->s();
nu = User[SpriteNum].Data(); nu = spawnedActor->u();
sp->hitag = 0; sp->hitag = 0;
sp->xrepeat = 48; sp->xrepeat = 48;
sp->yrepeat = 54; sp->yrepeat = 54;
@ -20305,14 +20307,17 @@ int QueueFootPrint(short hit_sprite)
SET(sp->cstat, CSTAT_SPRITE_ONE_SIDED); SET(sp->cstat, CSTAT_SPRITE_ONE_SIDED);
RESET(sp->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN); RESET(sp->cstat, CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
return SpriteNum; return 0;
} }
#define WALLBLOOD1 2500 enum
#define WALLBLOOD2 2501 {
#define WALLBLOOD3 2502 WALLBLOOD1 = 2500,
#define WALLBLOOD4 2503 WALLBLOOD2 = 2501,
#define WALLBLOOD_RATE 30 WALLBLOOD3 = 2502,
WALLBLOOD4 = 2503,
WALLBLOOD_RATE = 30,
};
ANIMATOR DoWallBlood; ANIMATOR DoWallBlood;
STATE s_WallBlood1[] = STATE s_WallBlood1[] =
{ {

View file

@ -65,7 +65,7 @@ extern short HoleQueue[MAX_HOLE_QUEUE];
extern short WallBloodQueueHead; extern short WallBloodQueueHead;
extern DSWActor* WallBloodQueue[MAX_WALLBLOOD_QUEUE]; extern DSWActor* WallBloodQueue[MAX_WALLBLOOD_QUEUE];
extern short FloorBloodQueueHead; extern short FloorBloodQueueHead;
extern short FloorBloodQueue[MAX_FLOORBLOOD_QUEUE]; extern DSWActor* FloorBloodQueue[MAX_FLOORBLOOD_QUEUE];
extern short GenericQueueHead; extern short GenericQueueHead;
extern DSWActor* GenericQueue[MAX_GENERIC_QUEUE]; extern DSWActor* GenericQueue[MAX_GENERIC_QUEUE];
extern short LoWangsQueueHead; extern short LoWangsQueueHead;