Nights LE checkpoint

This commit is contained in:
mazmazz 2018-03-30 14:22:59 -04:00
parent 01f1e7fc33
commit 56d7f9ed38
3 changed files with 57 additions and 2 deletions

View file

@ -905,7 +905,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
P_SetTarget(&thing->target, tmthing);
}
// Respawn rings and items
// NiGHTS lap logic
if ((tmthing->type == MT_NIGHTSDRONE || thing->type == MT_NIGHTSDRONE)
&& (tmthing->player || thing->player))
{
@ -921,8 +921,11 @@ static boolean PIT_CheckThing(mobj_t *thing)
^ (droneobj->extravalue1 >= 90 && droneobj->extravalue1 <= 270)
))
{
// Reload all the fancy ring stuff!
// Respawn rings and items
P_ReloadRings();
// \todo store current lap in player mobj
P_RunNightsLapExecutors(pl->mo);
}
droneobj->extravalue1 = pl->anotherflyangle;
droneobj->extravalue2 = (INT32)leveltime + TICRATE;

View file

@ -5487,6 +5487,48 @@ static void P_RunLevelLoadExecutors(void)
}
}
//
// P_RunNightserizeExecutors
//
static void P_RunNightserizeExecutors(mobj_t *actor)
{
size_t i;
for (i = 0; i < numlines; i++)
{
if (lines[i].special == 323 || lines[i].special == 324)
P_RunTriggerLinedef(&lines[i], actor, NULL);
}
}
//
// P_RunDeNightserizeExecutors
//
static void P_RunDeNightserizeExecutors(mobj_t *actor)
{
size_t i;
for (i = 0; i < numlines; i++)
{
if (lines[i].special == 325 || lines[i].special == 326)
P_RunTriggerLinedef(&lines[i], actor, NULL);
}
}
//
// P_RunNightsLapExecutors
//
static void P_RunNightsLapExecutors(mobj_t *actor)
{
size_t i;
for (i = 0; i < numlines; i++)
{
if (lines[i].special == 327 || lines[i].special == 328)
P_RunTriggerLinedef(&lines[i], actor, NULL);
}
}
/** Before things are loaded, initialises certain stuff in case they're needed
* by P_ResetDynamicSlopes or P_LoadThings. This was split off from
* P_SpawnSpecials, in case you couldn't tell.
@ -6408,6 +6450,12 @@ void P_SpawnSpecials(INT32 fromnetsave)
}
break;
// NiGHTS trigger executors
case 323:
case 324:
case 325:
break;
case 399: // Linedef execute on map load
// This is handled in P_RunLevelLoadExecutors.
break;

View file

@ -636,6 +636,8 @@ static void P_DeNightserizePlayer(player_t *player)
// Restore from drowning music
P_RestoreMusic(player);
P_RunDeNightserizeExecutors();
}
//
@ -771,6 +773,8 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
}
player->powers[pw_carry] = CR_NIGHTSMODE;
P_RunNightserizeExecutors(player->mo);
}
pflags_t P_GetJumpFlags(player_t *player)