diff --git a/src/p_floor.c b/src/p_floor.c index f798174a..1375bcd5 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -1813,10 +1813,19 @@ void T_ThwompSector(levelspecthink_t *thwomp) sector_t *actionsector; INT32 secnum; + // Put up a timer before you start falling down. + // I could of used rowoffset, but the FOF actually + // modifies the textures's Y offset. It doesn't with + // textureoffset, so Effect 4 can be ignored as usual. // SRB2kart 16/04/10 + if (thwomp->sourceline->flags & ML_EFFECT1 + && leveltime < (unsigned)(sides[thwomp->sourceline->sidenum[0]].textureoffset>>FRACBITS)) + thwomp->direction = 0; + // If you just crashed down, wait a second before coming back up. if (--thwomp->distance > 0) { - sides[thwomp->sourceline->sidenum[0]].midtexture = sides[thwomp->sourceline->sidenum[0]].bottomtexture; + // SRB2kart 16/04/10 + sides[thwomp->sourceline->sidenum[0]].midtexture = sides[thwomp->sourceline->sidenum[0]].toptexture; return; } @@ -1931,6 +1940,9 @@ void T_ThwompSector(levelspecthink_t *thwomp) thinker_t *th; mobj_t *mo; + thwomp->direction = -1; // SRB2kart 16/04/10 + + /* // scan the thinkers to find players! for (th = thinkercap.next; th != &thinkercap; th = th->next) { @@ -1945,6 +1957,7 @@ void T_ThwompSector(levelspecthink_t *thwomp) break; } } + */ thwomp->sector->ceilspeed = 0; thwomp->sector->floorspeed = 0; @@ -2841,7 +2854,7 @@ INT32 EV_DoElevator(line_t *line, elevator_e elevtype, boolean customspeed) return rtn; } -void EV_CrumbleChain(sector_t *sec, ffloor_t *rover) +void EV_CrumbleChain(sector_t *sec, ffloor_t *rover, INT32 sound) { size_t i; size_t leftmostvertex = 0, rightmostvertex = 0; @@ -2859,7 +2872,9 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover) // soundorg z height never gets set normally, so MEH. sec->soundorg.z = sec->floorheight; - S_StartSound(&sec->soundorg, sfx_crumbl); + + if (sound) // SRB2kart 16/04/10 + S_StartSound(&sec->soundorg, sfx_crumbl); // Find the outermost vertexes in the subsector for (i = 0; i < sec->linecount; i++) diff --git a/src/p_setup.c b/src/p_setup.c index f2b0c49d..148b45a7 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -218,6 +218,8 @@ static void P_ClearSingleMapHeaderInfo(INT16 i) mapheaderinfo[num]->levelflags = 0; DEH_WriteUndoline("MENUFLAGS", va("%d", mapheaderinfo[num]->menuflags), UNDO_NONE); mapheaderinfo[num]->menuflags = 0; + DEH_WriteUndoline("AUTOMAP", va("%d", mapheaderinfo[num].automap), UNDO_NONE); // SRB2kart 16/04/10 + mapheaderinfo[num].automap = false; // TODO grades support for delfile (pfft yeah right) P_DeleteGrades(num); // an even further impossibility, delfile custom opts support @@ -967,6 +969,7 @@ static void P_LoadThings(lumpnum_t lumpnum) } } +/* // SRB2kart 16/04/10 static inline void P_SpawnEmblems(void) { INT32 i, color; @@ -1002,9 +1005,13 @@ static inline void P_SpawnEmblems(void) emblemmobj->frame &= ~FF_TRANSMASK; } } +*/ static void P_SpawnSecretItems(boolean loademblems) { + (void)loademblems; // SRB2kart 16/04/10 + return; //no secret items here! + // Now let's spawn those funky emblem things! Tails 12-08-2002 if (netgame || multiplayer || (modifiedgame && !savemoddata)) // No cheating!! return; @@ -2061,6 +2068,9 @@ static void P_LevelInitStuff(void) players[i].aiming = 0; players[i].pflags &= ~PF_TIMEOVER; + memset(players[i].checkpointtimes, 0, sizeof(players[i].checkpointtimes)); // SRB2kart 16/04/10 + players[i].playerahead = 0; + players[i].losstime = 0; players[i].timeshit = 0; @@ -2429,7 +2439,10 @@ boolean P_SetupLevel(boolean skipprecip) // As oddly named as this is, this handles music only. // We should be fine starting it here. - S_Start(); + if (leveltime < 157) // SRB2kart 16/04/10 + S_StopMusic(); + if (leveltime > 157) + S_Start(); // Let's fade to black here if (rendermode != render_none) @@ -2586,7 +2599,7 @@ boolean P_SetupLevel(boolean skipprecip) { players[i].mo = NULL; - if (players[i].starposttime) + if (players[i].starpostnum) // .starposttime // SRB2kart 16/04/10 { G_SpawnPlayer(i, true); P_ClearStarPost(players[i].starpostnum); diff --git a/src/p_spec.c b/src/p_spec.c index 8228c60b..86b4f371 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -203,6 +203,8 @@ static animdef_t harddefs[] = {true, "ERFANX4", "ERFANX1", 1}, {true, "DISCOD4", "DISCOD1", 15}, {true, "DANCE4", "DANCE1", 8}, + {true, "LGHTNNG2", "LGHTNNG1", 2}, // SRB2kart 16/04/10 + {true, "EFZFAN4", "EFZFAN1", 2}, // {true, "SKY135", "SKY132", 2}, {true, "APPLMS4", "APPLMS1", 2}, {true, "APBOXW3", "APBOXW1", 2}, @@ -2370,6 +2372,9 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) if (!dest) return; + if (mo->player) // SRB2kart 16/04/10 + mo->player->powers[pw_ramp] = 0; // + if (bot) P_Teleport(bot, dest->x, dest->y, dest->z, (line->flags & ML_NOCLIMB) ? mo->angle : dest->angle, (line->flags & ML_BLOCKMONSTERS) == 0, (line->flags & ML_EFFECT4) == ML_EFFECT4); if (line->flags & ML_BLOCKMONSTERS) @@ -2879,7 +2884,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) return; } - EV_CrumbleChain(sec, rover); + EV_CrumbleChain(sec, rover, 1); // SRB2kart 16/04/10 } } break; @@ -3115,6 +3120,9 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) case 491: PolyTranslucency(line); break; + case 492: // DeNiGHTserize player // SRB2kart 16/04/10 + mo->player->nightstime = 0; + break; #endif default: @@ -3679,6 +3687,10 @@ DoneSection2: P_InstaThrust(player->mo, player->mo->angle, linespeed); + player->cmd.forwardmove = 1; // SRB2kart 16/04/10 + player->powers[pw_exspeed] = 60; // + P_SetPlayerMobjState(player->mo, S_PLAY_SPD1); // + if (GETSECSPECIAL(sector->special, 3) == 6 && (player->charability2 == CA2_SPINDASH)) { if (!(player->pflags & PF_SPINNING)) @@ -3907,15 +3919,17 @@ DoneSection2: P_SetTarget(&player->mo->tracer, waypoint); player->speed = speed; - player->pflags |= PF_SPINNING; + player->powers[pw_tailsfly] = 0; // SRB2kart 16/04/10 + player->pflags &= ~PF_SPINNING; // player->pflags &= ~PF_JUMPED; player->pflags &= ~PF_GLIDING; player->climbing = 0; - if (!(player->mo->state >= &states[S_PLAY_ATK1] && player->mo->state <= &states[S_PLAY_ATK4])) + // SRB2kart 16/04/10 + if (!(player->mo->state >= &states[S_PLAY_KARTRUN1] && player->mo->state <= &states[S_PLAY_KARTRUN2])) { - P_SetPlayerMobjState(player->mo, S_PLAY_ATK1); - S_StartSound(player->mo, sfx_spin); + P_SetPlayerMobjState(player->mo, S_PLAY_KARTRUN1); + S_StartSound(player->mo, sfx_spin); // Do we want/need this? -Zarro } } break; @@ -3981,18 +3995,23 @@ DoneSection2: P_SetTarget(&player->mo->tracer, waypoint); player->speed = speed; - player->pflags |= PF_SPINNING; + player->powers[pw_tailsfly] = 0; // SRB2kart 16/04/10 + player->pflags &= ~PF_SPINNING; // player->pflags &= ~PF_JUMPED; - if (!(player->mo->state >= &states[S_PLAY_ATK1] && player->mo->state <= &states[S_PLAY_ATK4])) + // SRB2kart 16/04/10 + if (!(player->mo->state >= &states[S_PLAY_KARTRUN1] && player->mo->state <= &states[S_PLAY_KARTRUN2])) { - P_SetPlayerMobjState(player->mo, S_PLAY_ATK1); - S_StartSound(player->mo, sfx_spin); + P_SetPlayerMobjState(player->mo, S_PLAY_KARTRUN1); + S_StartSound(player->mo, sfx_spin); // Do we want/need this? -Zarro } } break; case 10: // Finish Line + if (gametype == GT_RACE) // SRB2kart 16/04/10 + if (player->starpostnum == numstarposts || player->exiting) // Must have touched all the starposts + player->starpostwp = player->powers[pw_waypoint] = 0; // if (gametype == GT_RACE && !player->exiting) { if (player->starpostnum == numstarposts) // Must have touched all the starposts @@ -4004,12 +4023,43 @@ DoneSection2: if (player->laps >= (UINT8)cv_numlaps.value) CONS_Printf(M_GetText("%s has finished the race.\n"), player_names[player-players]); - else + if (player->laps == (unsigned)(cv_numlaps.value - 1)) // SRB2kart 16/04/10 + CONS_Printf(M_GetText("%s started the final lap\n"), player_names[player-players]); // + if (player->laps < (unsigned)(cv_numlaps.value - 1)) CONS_Printf(M_GetText("%s started lap %u\n"), player_names[player-players], (UINT32)player->laps+1); - // Reset starposts (checkpoints) info + // Reset starposts (checkpoints) info // SRB2kart 16/04/10 ~ + player->starpostangle = player->starpostnum = player->starpostbit = 0; + player->starpostx = player->starposty = player->starpostz = 0; + //except the time! + player->starposttime = player->realtime; + if (((numstarposts+1)*player->laps - 1) < 256) //SIGSEGV prevention + player->checkpointtimes[(numstarposts+1)*player->laps - 1] = player->realtime; + player->playerahead = P_CheckPlayerAhead(player, (numstarposts+1)*player->laps - 1); + + if (P_IsLocalPlayer(player)) + { + if (player->laps < (unsigned)(cv_numlaps.value - 1)) + { + S_StartSound(NULL, sfx_mlap); + player->airtime = -64; // ? + } + else if (player->laps == (unsigned)(cv_numlaps.value - 1)) + { + player->airtime = -64; // ? + + if (!splitscreen || (splitscreen && !players[consoleplayer].exiting + && !players[secondarydisplayplayer].exiting)) + { + player->powers[pw_sounds] = 1; + S_ChangeMusic(mus_chrsel, false); + } + } + } // SRB2kart 16/04/10 ~ + /* player->starpostangle = player->starposttime = player->starpostnum = 0; player->starpostx = player->starposty = player->starpostz = 0; + */ P_ResetStarposts(); // Play the starpost sound for 'consistency' @@ -4027,9 +4077,22 @@ DoneSection2: { if (P_IsLocalPlayer(player)) { + if (!splitscreen) // SRB2kart 16/04/10 ~ + { + if (player->position == 1) + S_ChangeMusic(mus_mwin, true); + else if (player->position == 2 || player->position == 3) + S_ChangeMusic(mus_mok, true); + else if (player->position >= 4) + S_ChangeMusic(mus_mlose, true); + } + else + S_ChangeMusic(mus_mwin, true); // SRB2kart 16/04/10 ~ + /* HU_SetCEchoFlags(0); HU_SetCEchoDuration(5); HU_DoCEcho("FINISHED!"); + */ } P_DoPlayerExit(player); @@ -4061,6 +4124,11 @@ DoneSection2: if (player->cmd.buttons & BT_USE) break; + // SRB2kart 16/04/10 + if (player->mo->state == &states[S_PLAY_PAIN] || player->mo->state == &states[S_PLAY_KARTPAIN] + || player->mo->state == &states[S_PLAY_KARTSPAIN] || player->mo->state == &states[S_PLAY_RPAIN]) + break; + if (!(player->pflags & PF_SLIDING) && player->mo->state == &states[player->mo->info->painstate]) break; @@ -7435,7 +7503,15 @@ void T_Pusher(pusher_t *p) if (thing->player && thing->player->pflags & PF_ROPEHANG) continue; - if (thing->player && (thing->state == &states[thing->info->painstate]) && (thing->player->powers[pw_flashing] > (flashingtics/4)*3 && thing->player->powers[pw_flashing] <= flashingtics)) + //if (thing->player && (thing->state == &states[thing->info->painstate]) + //&& (thing->player->powers[pw_flashing] > (flashingtics/4)*3 + //&& thing->player->powers[pw_flashing] <= flashingtics)) + + // SRB2kart 16/04/10 + if (thing->player && (thing->state == &states[S_PLAY_PAIN] || thing->state == &states[S_PLAY_KARTPAIN] + || thing->state == &states[S_PLAY_KARTSPAIN] || thing->state == &states[S_PLAY_RPAIN]) + && (thing->player->powers[pw_flashing] > (flashingtics/4)*3 + && thing->player->powers[pw_flashing] <= flashingtics)) continue; inFOF = touching = moved = false; diff --git a/src/p_spec.h b/src/p_spec.h index 7b6a5655..e32bf149 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -314,7 +314,7 @@ result_e T_MovePlane(sector_t *sector, fixed_t speed, fixed_t dest, boolean crus INT32 floorOrCeiling, INT32 direction); INT32 EV_DoFloor(line_t *line, floor_e floortype); INT32 EV_DoElevator(line_t *line, elevator_e elevtype, boolean customspeed); -void EV_CrumbleChain(sector_t *sec, ffloor_t *rover); +void EV_CrumbleChain(sector_t *sec, ffloor_t *rover, INT32 sound); // SRB2kart 16/04/10 INT32 EV_BounceSector(sector_t *sector, fixed_t momz, line_t *sourceline); // Some other special 3dfloor types