- ActorCoughItem.

This commit is contained in:
Christoph Oelckers 2021-11-03 21:01:26 +01:00
parent cd8e8e4f67
commit a85a1e497f
5 changed files with 30 additions and 37 deletions

View file

@ -826,7 +826,7 @@ int PachinkoCheckWin(DSWActor* actor)
DoMatchEverything(Player+myconnectindex, sp->hitag, ON);
}
ActorCoughItem(actor->GetSpriteIndex()); // I WON! I WON!
ActorCoughItem(actor); // I WON! I WON!
PlaySound(DIGI_PALARM, actor, v3df_none);
// Can't win any more now!
@ -1714,7 +1714,7 @@ int DoSailorGirl(DSWActor* actor)
if (choose > 750 && alreadythrew < 3)
{
ActorCoughItem(actor->GetSpriteIndex());
ActorCoughItem(actor);
alreadythrew++;
PlaySound(DIGI_LANI060, actor, v3df_dontpan, CHAN_AnimeMad);
}
@ -1772,7 +1772,7 @@ int NullSailorGirl(DSWActor* actor)
if (choose > 750 && alreadythrew < 3)
{
ActorCoughItem(actor->GetSpriteIndex());
ActorCoughItem(actor);
alreadythrew++;
PlaySound(DIGI_LANI060, actor, v3df_dontpan, CHAN_AnimeMad);
}

View file

@ -5575,7 +5575,7 @@ void DoPlayerBeginDie(PLAYERp pp)
pp->tilt_dest = 0;
ActorCoughItem(pp->PlayerSprite);
ActorCoughItem(pp->Actor());
if (numplayers > 1)
{

View file

@ -1636,11 +1636,11 @@ void PreMapCombineFloors(void)
BFSSearch search(numsectors, BoundList[i].offset->sectnum);
for (unsigned dasect; (dasect = search.GetNext()) != BFSSearch::EOL;)
{
SectIterator it(dasect);
while ((j = it.NextIndex()) >= 0)
SWSectIterator it(dasect);
while (auto jActor = it.Next())
{
sprite[j].x += dx;
sprite[j].y += dy;
jActor->s().x += dx;
jActor->s().y += dy;
}
for (auto& wal : wallsofsector(dasect))
@ -1735,8 +1735,7 @@ void TraverseSectors(short start_sect)
#endif
void
SpriteSetupPost(void)
void SpriteSetupPost(void)
{
SPRITEp ds;
USERp u;
@ -1780,8 +1779,7 @@ SpriteSetupPost(void)
}
void
SpriteSetup(void)
void SpriteSetup(void)
{
short num;
int cz,fz;
@ -3814,21 +3812,21 @@ void SetupItemForJump(DSWActor* spawner, DSWActor* actor)
}
}
int ActorCoughItem(short SpriteNum)
int ActorCoughItem(DSWActor* actor)
{
SPRITEp sp = &sprite[SpriteNum];
USERp u = User[SpriteNum].Data();
short New,choose;
SPRITEp sp = &actor->s();
USERp u = actor->u();
short choose;
SPRITEp np;
DSWActor* actorNew = nullptr;
switch (u->ID)
{
case SAILORGIRL_R0:
ASSERT(sp->sectnum >= 0);
New = COVERinsertsprite(sp->sectnum, STAT_SPAWN_ITEMS);
ASSERT(New >= 0);
np = &sprite[New];
actorNew = InsertActor(sp->sectnum, STAT_SPAWN_ITEMS);
np = &actorNew->s();
np->cstat = np->extra = 0;
np->x = sp->x;
np->y = sp->y;
@ -3868,9 +3866,8 @@ int ActorCoughItem(short SpriteNum)
return 0;
ASSERT(sp->sectnum >= 0);
New = COVERinsertsprite(sp->sectnum, STAT_SPAWN_ITEMS);
ASSERT(New >= 0);
np = &sprite[New];
actorNew = InsertActor(sp->sectnum, STAT_SPAWN_ITEMS);
np = &actorNew->s();
np->cstat = np->extra = 0;
np->x = sp->x;
np->y = sp->y;
@ -3897,9 +3894,8 @@ int ActorCoughItem(short SpriteNum)
return 0;
ASSERT(sp->sectnum >= 0);
New = COVERinsertsprite(sp->sectnum, STAT_SPAWN_ITEMS);
ASSERT(New >= 0);
np = &sprite[New];
actorNew = InsertActor(sp->sectnum, STAT_SPAWN_ITEMS);
np = &actorNew->s();
np->cstat = np->extra = 0;
np->x = sp->x;
np->y = sp->y;
@ -3929,9 +3925,8 @@ int ActorCoughItem(short SpriteNum)
return 0;
ASSERT(sp->sectnum >= 0);
New = COVERinsertsprite(sp->sectnum, STAT_SPAWN_ITEMS);
ASSERT(New >= 0);
np = &sprite[New];
actorNew = InsertActor(sp->sectnum, STAT_SPAWN_ITEMS);
np = &actorNew->s();
np->cstat = 0;
np->extra = 0;
np->x = sp->x;
@ -3993,9 +3988,8 @@ int ActorCoughItem(short SpriteNum)
return 0;
ASSERT(sp->sectnum >= 0);
New = COVERinsertsprite(sp->sectnum, STAT_SPAWN_ITEMS);
ASSERT(New >= 0);
np = &sprite[New];
actorNew = InsertActor(sp->sectnum, STAT_SPAWN_ITEMS);
np = &actorNew->s();
np->cstat = np->extra = 0;
np->x = sp->x;
np->y = sp->y;
@ -4052,9 +4046,8 @@ int ActorCoughItem(short SpriteNum)
case PACHINKO4:
ASSERT(sp->sectnum >= 0);
New = COVERinsertsprite(sp->sectnum, STAT_SPAWN_ITEMS);
ASSERT(New >= 0);
np = &sprite[New];
actorNew = InsertActor(sp->sectnum, STAT_SPAWN_ITEMS);
np = &actorNew->s();
np->cstat = np->extra = 0;
np->x = sp->x;
np->y = sp->y;

View file

@ -52,7 +52,7 @@ void SpriteControl(void);
void DoActorZrange(DSWActor*);
void PreMapCombineFloors(void);
void SpriteSetupPost(void);
int ActorCoughItem(short SpriteNum);
int ActorCoughItem(DSWActor*);
bool ActorSpawn(DSWActor*);
int SpawnItemsMatch(short match);
void PicAnimOff(short picnum);

View file

@ -5014,7 +5014,7 @@ ActorChooseDeath(short SpriteNum, short Weapon)
}
break;
default:
ActorCoughItem(SpriteNum);
ActorCoughItem(actor);
//UpdateSinglePlayKills(actor);
break;
}
@ -5201,7 +5201,7 @@ ActorChooseDeath(short SpriteNum, short Weapon)
// These guys cough items only if gibbed
if (u->ID == GORO_RUN_R0 || u->ID == RIPPER2_RUN_R0)
ActorCoughItem(SpriteNum);
ActorCoughItem(actor);
// Blood fountains
InitBloodSpray(actor,true,-1);