mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-12 14:55:36 +00:00
- ActorCoughItem.
This commit is contained in:
parent
cd8e8e4f67
commit
a85a1e497f
5 changed files with 30 additions and 37 deletions
|
@ -826,7 +826,7 @@ int PachinkoCheckWin(DSWActor* actor)
|
||||||
DoMatchEverything(Player+myconnectindex, sp->hitag, ON);
|
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);
|
PlaySound(DIGI_PALARM, actor, v3df_none);
|
||||||
|
|
||||||
// Can't win any more now!
|
// Can't win any more now!
|
||||||
|
@ -1714,7 +1714,7 @@ int DoSailorGirl(DSWActor* actor)
|
||||||
|
|
||||||
if (choose > 750 && alreadythrew < 3)
|
if (choose > 750 && alreadythrew < 3)
|
||||||
{
|
{
|
||||||
ActorCoughItem(actor->GetSpriteIndex());
|
ActorCoughItem(actor);
|
||||||
alreadythrew++;
|
alreadythrew++;
|
||||||
PlaySound(DIGI_LANI060, actor, v3df_dontpan, CHAN_AnimeMad);
|
PlaySound(DIGI_LANI060, actor, v3df_dontpan, CHAN_AnimeMad);
|
||||||
}
|
}
|
||||||
|
@ -1772,7 +1772,7 @@ int NullSailorGirl(DSWActor* actor)
|
||||||
|
|
||||||
if (choose > 750 && alreadythrew < 3)
|
if (choose > 750 && alreadythrew < 3)
|
||||||
{
|
{
|
||||||
ActorCoughItem(actor->GetSpriteIndex());
|
ActorCoughItem(actor);
|
||||||
alreadythrew++;
|
alreadythrew++;
|
||||||
PlaySound(DIGI_LANI060, actor, v3df_dontpan, CHAN_AnimeMad);
|
PlaySound(DIGI_LANI060, actor, v3df_dontpan, CHAN_AnimeMad);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5575,7 +5575,7 @@ void DoPlayerBeginDie(PLAYERp pp)
|
||||||
|
|
||||||
pp->tilt_dest = 0;
|
pp->tilt_dest = 0;
|
||||||
|
|
||||||
ActorCoughItem(pp->PlayerSprite);
|
ActorCoughItem(pp->Actor());
|
||||||
|
|
||||||
if (numplayers > 1)
|
if (numplayers > 1)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1636,11 +1636,11 @@ void PreMapCombineFloors(void)
|
||||||
BFSSearch search(numsectors, BoundList[i].offset->sectnum);
|
BFSSearch search(numsectors, BoundList[i].offset->sectnum);
|
||||||
for (unsigned dasect; (dasect = search.GetNext()) != BFSSearch::EOL;)
|
for (unsigned dasect; (dasect = search.GetNext()) != BFSSearch::EOL;)
|
||||||
{
|
{
|
||||||
SectIterator it(dasect);
|
SWSectIterator it(dasect);
|
||||||
while ((j = it.NextIndex()) >= 0)
|
while (auto jActor = it.Next())
|
||||||
{
|
{
|
||||||
sprite[j].x += dx;
|
jActor->s().x += dx;
|
||||||
sprite[j].y += dy;
|
jActor->s().y += dy;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto& wal : wallsofsector(dasect))
|
for (auto& wal : wallsofsector(dasect))
|
||||||
|
@ -1735,8 +1735,7 @@ void TraverseSectors(short start_sect)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void
|
void SpriteSetupPost(void)
|
||||||
SpriteSetupPost(void)
|
|
||||||
{
|
{
|
||||||
SPRITEp ds;
|
SPRITEp ds;
|
||||||
USERp u;
|
USERp u;
|
||||||
|
@ -1780,8 +1779,7 @@ SpriteSetupPost(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void SpriteSetup(void)
|
||||||
SpriteSetup(void)
|
|
||||||
{
|
{
|
||||||
short num;
|
short num;
|
||||||
int cz,fz;
|
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];
|
SPRITEp sp = &actor->s();
|
||||||
USERp u = User[SpriteNum].Data();
|
USERp u = actor->u();
|
||||||
short New,choose;
|
short choose;
|
||||||
SPRITEp np;
|
SPRITEp np;
|
||||||
|
DSWActor* actorNew = nullptr;
|
||||||
|
|
||||||
|
|
||||||
switch (u->ID)
|
switch (u->ID)
|
||||||
{
|
{
|
||||||
case SAILORGIRL_R0:
|
case SAILORGIRL_R0:
|
||||||
ASSERT(sp->sectnum >= 0);
|
ASSERT(sp->sectnum >= 0);
|
||||||
New = COVERinsertsprite(sp->sectnum, STAT_SPAWN_ITEMS);
|
actorNew = InsertActor(sp->sectnum, STAT_SPAWN_ITEMS);
|
||||||
ASSERT(New >= 0);
|
np = &actorNew->s();
|
||||||
np = &sprite[New];
|
|
||||||
np->cstat = np->extra = 0;
|
np->cstat = np->extra = 0;
|
||||||
np->x = sp->x;
|
np->x = sp->x;
|
||||||
np->y = sp->y;
|
np->y = sp->y;
|
||||||
|
@ -3868,9 +3866,8 @@ int ActorCoughItem(short SpriteNum)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
ASSERT(sp->sectnum >= 0);
|
ASSERT(sp->sectnum >= 0);
|
||||||
New = COVERinsertsprite(sp->sectnum, STAT_SPAWN_ITEMS);
|
actorNew = InsertActor(sp->sectnum, STAT_SPAWN_ITEMS);
|
||||||
ASSERT(New >= 0);
|
np = &actorNew->s();
|
||||||
np = &sprite[New];
|
|
||||||
np->cstat = np->extra = 0;
|
np->cstat = np->extra = 0;
|
||||||
np->x = sp->x;
|
np->x = sp->x;
|
||||||
np->y = sp->y;
|
np->y = sp->y;
|
||||||
|
@ -3897,9 +3894,8 @@ int ActorCoughItem(short SpriteNum)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
ASSERT(sp->sectnum >= 0);
|
ASSERT(sp->sectnum >= 0);
|
||||||
New = COVERinsertsprite(sp->sectnum, STAT_SPAWN_ITEMS);
|
actorNew = InsertActor(sp->sectnum, STAT_SPAWN_ITEMS);
|
||||||
ASSERT(New >= 0);
|
np = &actorNew->s();
|
||||||
np = &sprite[New];
|
|
||||||
np->cstat = np->extra = 0;
|
np->cstat = np->extra = 0;
|
||||||
np->x = sp->x;
|
np->x = sp->x;
|
||||||
np->y = sp->y;
|
np->y = sp->y;
|
||||||
|
@ -3929,9 +3925,8 @@ int ActorCoughItem(short SpriteNum)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
ASSERT(sp->sectnum >= 0);
|
ASSERT(sp->sectnum >= 0);
|
||||||
New = COVERinsertsprite(sp->sectnum, STAT_SPAWN_ITEMS);
|
actorNew = InsertActor(sp->sectnum, STAT_SPAWN_ITEMS);
|
||||||
ASSERT(New >= 0);
|
np = &actorNew->s();
|
||||||
np = &sprite[New];
|
|
||||||
np->cstat = 0;
|
np->cstat = 0;
|
||||||
np->extra = 0;
|
np->extra = 0;
|
||||||
np->x = sp->x;
|
np->x = sp->x;
|
||||||
|
@ -3993,9 +3988,8 @@ int ActorCoughItem(short SpriteNum)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
ASSERT(sp->sectnum >= 0);
|
ASSERT(sp->sectnum >= 0);
|
||||||
New = COVERinsertsprite(sp->sectnum, STAT_SPAWN_ITEMS);
|
actorNew = InsertActor(sp->sectnum, STAT_SPAWN_ITEMS);
|
||||||
ASSERT(New >= 0);
|
np = &actorNew->s();
|
||||||
np = &sprite[New];
|
|
||||||
np->cstat = np->extra = 0;
|
np->cstat = np->extra = 0;
|
||||||
np->x = sp->x;
|
np->x = sp->x;
|
||||||
np->y = sp->y;
|
np->y = sp->y;
|
||||||
|
@ -4052,9 +4046,8 @@ int ActorCoughItem(short SpriteNum)
|
||||||
case PACHINKO4:
|
case PACHINKO4:
|
||||||
|
|
||||||
ASSERT(sp->sectnum >= 0);
|
ASSERT(sp->sectnum >= 0);
|
||||||
New = COVERinsertsprite(sp->sectnum, STAT_SPAWN_ITEMS);
|
actorNew = InsertActor(sp->sectnum, STAT_SPAWN_ITEMS);
|
||||||
ASSERT(New >= 0);
|
np = &actorNew->s();
|
||||||
np = &sprite[New];
|
|
||||||
np->cstat = np->extra = 0;
|
np->cstat = np->extra = 0;
|
||||||
np->x = sp->x;
|
np->x = sp->x;
|
||||||
np->y = sp->y;
|
np->y = sp->y;
|
||||||
|
|
|
@ -52,7 +52,7 @@ void SpriteControl(void);
|
||||||
void DoActorZrange(DSWActor*);
|
void DoActorZrange(DSWActor*);
|
||||||
void PreMapCombineFloors(void);
|
void PreMapCombineFloors(void);
|
||||||
void SpriteSetupPost(void);
|
void SpriteSetupPost(void);
|
||||||
int ActorCoughItem(short SpriteNum);
|
int ActorCoughItem(DSWActor*);
|
||||||
bool ActorSpawn(DSWActor*);
|
bool ActorSpawn(DSWActor*);
|
||||||
int SpawnItemsMatch(short match);
|
int SpawnItemsMatch(short match);
|
||||||
void PicAnimOff(short picnum);
|
void PicAnimOff(short picnum);
|
||||||
|
|
|
@ -5014,7 +5014,7 @@ ActorChooseDeath(short SpriteNum, short Weapon)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ActorCoughItem(SpriteNum);
|
ActorCoughItem(actor);
|
||||||
//UpdateSinglePlayKills(actor);
|
//UpdateSinglePlayKills(actor);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -5201,7 +5201,7 @@ ActorChooseDeath(short SpriteNum, short Weapon)
|
||||||
|
|
||||||
// These guys cough items only if gibbed
|
// These guys cough items only if gibbed
|
||||||
if (u->ID == GORO_RUN_R0 || u->ID == RIPPER2_RUN_R0)
|
if (u->ID == GORO_RUN_R0 || u->ID == RIPPER2_RUN_R0)
|
||||||
ActorCoughItem(SpriteNum);
|
ActorCoughItem(actor);
|
||||||
|
|
||||||
// Blood fountains
|
// Blood fountains
|
||||||
InitBloodSpray(actor,true,-1);
|
InitBloodSpray(actor,true,-1);
|
||||||
|
|
Loading…
Reference in a new issue