Add ML_BOUNCY flag to Bonus Time executor to execute BEFORE the capsule is destroyed and player has enough spheres
This commit is contained in:
parent
296d527993
commit
62a6fe845d
|
@ -1420,13 +1420,15 @@ void P_RunNightsLapExecutors(mobj_t *actor)
|
|||
//
|
||||
// P_RunNightsBonusTimeExecutors
|
||||
//
|
||||
void P_RunNightsBonusTimeExecutors(mobj_t *actor)
|
||||
void P_RunNightsBonusTimeExecutors(mobj_t *actor, boolean preblowup)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < numlines; i++)
|
||||
{
|
||||
if (lines[i].special == 329 || lines[i].special == 330)
|
||||
if ((lines[i].special == 329 || lines[i].special == 330)
|
||||
&& ((preblowup && (lines[i].flags & ML_BOUNCY))
|
||||
|| (!preblowup && !(lines[i].flags & ML_BOUNCY))))
|
||||
P_RunTriggerLinedef(&lines[i], actor, NULL);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ void P_ChangeSectorTag(UINT32 sector, INT16 newtag);
|
|||
void P_RunNightserizeExecutors(mobj_t *actor);
|
||||
void P_RunDeNightserizeExecutors(mobj_t *actor);
|
||||
void P_RunNightsLapExecutors(mobj_t *actor);
|
||||
void P_RunNightsBonusTimeExecutors(mobj_t *actor);
|
||||
void P_RunNightsBonusTimeExecutors(mobj_t *actor, boolean preblowup);
|
||||
|
||||
ffloor_t *P_GetFFloorByID(sector_t *sec, UINT16 id);
|
||||
|
||||
|
|
|
@ -6014,6 +6014,9 @@ static void P_DoNiGHTSCapsule(player_t *player)
|
|||
{
|
||||
if (player->spheres > 0)
|
||||
{
|
||||
if (player->capsule->extravalue1 <= 0 && player->spheres >= player->capsule->health)
|
||||
P_RunNightsBonusTimeExecutors(player->mo, true);
|
||||
|
||||
player->spheres--;
|
||||
player->capsule->health--;
|
||||
player->capsule->extravalue1++;
|
||||
|
@ -6099,7 +6102,7 @@ static void P_DoNiGHTSCapsule(player_t *player)
|
|||
P_SetTarget(&players[i].capsule, NULL); // Remove capsule from everyone now that it is dead!
|
||||
S_StartScreamSound(player->mo, sfx_ngdone);
|
||||
P_SwitchSpheresBonusMode(true);
|
||||
P_RunNightsBonusTimeExecutors(player->mo);
|
||||
P_RunNightsBonusTimeExecutors(player->mo, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue