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
14
src/p_spec.c
14
src/p_spec.c
|
@ -1420,13 +1420,15 @@ void P_RunNightsLapExecutors(mobj_t *actor)
|
||||||
//
|
//
|
||||||
// P_RunNightsBonusTimeExecutors
|
// P_RunNightsBonusTimeExecutors
|
||||||
//
|
//
|
||||||
void P_RunNightsBonusTimeExecutors(mobj_t *actor)
|
void P_RunNightsBonusTimeExecutors(mobj_t *actor, boolean preblowup)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
for (i = 0; i < numlines; 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);
|
P_RunTriggerLinedef(&lines[i], actor, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1574,8 +1576,8 @@ static boolean P_CheckNightsTriggerLine(line_t *triggerline, mobj_t *actor)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get current mare and lap (and check early return for DeNightserize)
|
// Get current mare and lap (and check early return for DeNightserize)
|
||||||
if (perglobal || perglobalinverse
|
if (perglobal || perglobalinverse
|
||||||
|| (specialtype >= 325 && specialtype <= 326 && (fromnonights || fromnights)))
|
|| (specialtype >= 325 && specialtype <= 326 && (fromnonights || fromnights)))
|
||||||
{
|
{
|
||||||
UINT8 playersarenights = 0;
|
UINT8 playersarenights = 0;
|
||||||
|
|
||||||
|
@ -1604,7 +1606,7 @@ static boolean P_CheckNightsTriggerLine(line_t *triggerline, mobj_t *actor)
|
||||||
currentmare = players[i].mare;
|
currentmare = players[i].mare;
|
||||||
currentlap = UINT8_MAX;
|
currentlap = UINT8_MAX;
|
||||||
}
|
}
|
||||||
if (players[i].mare == currentmare
|
if (players[i].mare == currentmare
|
||||||
&& (lap > currentlap || currentlap == UINT8_MAX))
|
&& (lap > currentlap || currentlap == UINT8_MAX))
|
||||||
currentlap = lap;
|
currentlap = lap;
|
||||||
}
|
}
|
||||||
|
@ -1616,7 +1618,7 @@ static boolean P_CheckNightsTriggerLine(line_t *triggerline, mobj_t *actor)
|
||||||
currentmare = players[i].mare;
|
currentmare = players[i].mare;
|
||||||
currentlap = UINT8_MAX;
|
currentlap = UINT8_MAX;
|
||||||
}
|
}
|
||||||
if (players[i].mare == currentmare
|
if (players[i].mare == currentmare
|
||||||
&& (lap < currentlap || currentlap == UINT8_MAX))
|
&& (lap < currentlap || currentlap == UINT8_MAX))
|
||||||
currentlap = lap;
|
currentlap = lap;
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,7 @@ void P_ChangeSectorTag(UINT32 sector, INT16 newtag);
|
||||||
void P_RunNightserizeExecutors(mobj_t *actor);
|
void P_RunNightserizeExecutors(mobj_t *actor);
|
||||||
void P_RunDeNightserizeExecutors(mobj_t *actor);
|
void P_RunDeNightserizeExecutors(mobj_t *actor);
|
||||||
void P_RunNightsLapExecutors(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);
|
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->spheres > 0)
|
||||||
{
|
{
|
||||||
|
if (player->capsule->extravalue1 <= 0 && player->spheres >= player->capsule->health)
|
||||||
|
P_RunNightsBonusTimeExecutors(player->mo, true);
|
||||||
|
|
||||||
player->spheres--;
|
player->spheres--;
|
||||||
player->capsule->health--;
|
player->capsule->health--;
|
||||||
player->capsule->extravalue1++;
|
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!
|
P_SetTarget(&players[i].capsule, NULL); // Remove capsule from everyone now that it is dead!
|
||||||
S_StartScreamSound(player->mo, sfx_ngdone);
|
S_StartScreamSound(player->mo, sfx_ngdone);
|
||||||
P_SwitchSpheresBonusMode(true);
|
P_SwitchSpheresBonusMode(true);
|
||||||
P_RunNightsBonusTimeExecutors(player->mo);
|
P_RunNightsBonusTimeExecutors(player->mo, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue