DEFINE_ACTION_FUNCTION(AActor, A_BrainDie) { // [RH] If noexit, then don't end the level. if ((deathmatch || alwaysapplydmflags) && (dmflags & DF_NO_EXIT)) return; // New dmflag: Kill all boss spawned monsters before ending the level. if (dmflags2 & DF2_KILLBOSSMONST) { int count; // Repeat until we have no more boss-spawned monsters. do // (e.g. Pain Elementals can spawn more to kill upon death.) { TThinkerIterator<AActor> it; AActor *mo; count = 0; while ((mo = it.Next())) { if (mo->health > 0 && mo->flags4 & MF4_BOSSSPAWNED) { P_DamageMobj(mo, self, self, mo->health, NAME_None, DMG_NO_ARMOR|DMG_FORCED|DMG_THRUSTLESS|DMG_NO_FACTOR); count++; } } } while (count != 0); } G_ExitLevel (0, false); }
void P_Ticker(void) { int i; if (paused) { return; } for (i = 0; i < MAXPLAYERS; i++) { if (playeringame[i]) { P_PlayerThink(&players[i]); } } if (TimerGame) { if (!--TimerGame) { G_ExitLevel(); } } P_RunThinkers(); P_UpdateSpecials(); P_AmbientSound(); leveltime++; }
DEFINE_ACTION_FUNCTION(AActor, A_SubEntityDeath) { if (CheckBossDeath (self)) { G_ExitLevel (0, false); } }
// // P_PlayerInSpecialSector // Called every tic frame // that the player origin is in a special sector // void P_PlayerInSpecialSector(player_t * player) { sector_t *sector; sector = player->mo->subsector->sector; // Falling, not all the way down yet? if (player->mo->z != sector->floorheight) return; // Has hitten ground. switch (sector->special) { case 5: // HELLSLIME DAMAGE if (!player->powers[pw_ironfeet]) if (!(leveltime & 0x1f)) P_DamageMobj(player->mo, NULL, NULL, 10); break; case 7: // NUKAGE DAMAGE if (!player->powers[pw_ironfeet]) if (!(leveltime & 0x1f)) P_DamageMobj(player->mo, NULL, NULL, 5); break; case 16: // SUPER HELLSLIME DAMAGE case 4: // STROBE HURT if (!player->powers[pw_ironfeet] || (P_Random() < 5)) { if (!(leveltime & 0x1f)) P_DamageMobj(player->mo, NULL, NULL, 20); } break; case 9: // SECRET SECTOR player->secretcount++; sector->special = 0; break; case 11: // EXIT SUPER DAMAGE! (for E1M8 finale) player->cheats &= ~CF_GODMODE; if (!(leveltime & 0x1f)) P_DamageMobj(player->mo, NULL, NULL, 20); if (player->health <= 10) G_ExitLevel(); break; default: I_Error("P_PlayerInSpecialSector: " "unknown special %i", sector->special); break; }; }
/* * G_Frame * * The main game module "think" function, called once per server frame. * Nothing would happen in Quake land if this weren't called. */ static void G_Frame(void) { int i; g_edict_t *ent; g_level.frame_num++; g_level.time = g_level.frame_num * gi.server_frame; // check for level change after running intermission if (g_level.intermission_time) { if (g_level.time > g_level.intermission_time + INTERMISSION) { G_ExitLevel(); return; } } // treat each object in turn // even the world gets a chance to think ent = &g_game.edicts[0]; for (i = 0; i < ge.num_edicts; i++, ent++) { if (!ent->in_use) continue; g_level.current_entity = ent; // update old origin for interpolation if (!(ent->s.effects & EF_LIGHTNING)) VectorCopy(ent->s.origin, ent->s.old_origin); if (ent->ground_entity) { // check for ground entities going away if (ent->ground_entity->link_count != ent->ground_entity_link_count) ent->ground_entity = NULL; } if (i > 0 && i <= sv_max_clients->integer) G_ClientBeginFrame(ent); else G_RunEntity(ent); } // see if a vote has passed G_CheckVote(); // inspect and enforce gameplay rules G_CheckRules(); // see if a match should end G_CheckMatchEnd(); // see if an arena round should start G_CheckRoundStart(); // see if an arena round should end G_CheckRoundEnd(); // build the player_state_t structures for all players G_EndClientFrames(); }
void A_SubEntityDeath (AActor *self) { if (CheckBossDeath (self)) { G_ExitLevel (0, false); } }
// // [denis] D_DoomWadReboot // change wads at runtime // on 404, returns a vector of bad files // std::vector<size_t> D_DoomWadReboot (std::vector<std::string> wadnames, std::vector<std::string> patch_files) { std::vector<size_t> fails; if (modifiedgame && (gameinfo.flags & GI_SHAREWARE)) I_FatalError ("\nYou cannot switch WAD with the shareware version. Register!"); SV_SendReconnectSignal(); G_ExitLevel(0, 0); DThinker::DestroyAllThinkers(); Z_Init(); wadfiles.clear(); std::string custwad; if(wadnames.size()) custwad = wadnames[0]; D_AddDefWads(custwad); for(size_t i = 0; i < wadnames.size(); i++) { std::string file = BaseFileSearch(wadnames[i], ".WAD"); if(file.length()) wadfiles.push_back(file); else { Printf (PRINT_HIGH, "could not find WAD: %s\n", wadnames[i].c_str()); fails.push_back(i); } } if(wadnames.size() > 1) modifiedgame = true; wadhashes = W_InitMultipleFiles (wadfiles); SV_InitMultipleFiles (wadfiles); // get skill / episode / map from parms strcpy (startmap, (gameinfo.flags & GI_MAPxx) ? "MAP01" : "E1M1"); D_InitStrings (); D_DoDefDehackedPatch(patch_files); G_SetLevelStrings (); S_ParseSndInfo(); R_Init(); P_Init(); return fails; }
void P_UpdateSpecials () { // LEVEL TIMER if (deathmatch && timelimit) { if (level.maptime >= (int)(timelimit * TICRATE * 60)) { Printf ("%s\n", GStrings("TXT_TIMELIMIT")); G_ExitLevel(0, false); } } }
// // D_Shutdown // // Called to shutdown subsystems when unloading a set of WAD resource files. // Should be called prior to D_Init when loading a new set of WADs. // void STACK_ARGS D_Shutdown() { if (gamestate == GS_LEVEL) G_ExitLevel(0, 0); // [ML] 9/11/10: Reset custom wad level information from MAPINFO et al. for (size_t i = 0; i < wadlevelinfos.size(); i++) { if (wadlevelinfos[i].snapshot) { delete wadlevelinfos[i].snapshot; wadlevelinfos[i].snapshot = NULL; } } wadlevelinfos.clear(); wadclusterinfos.clear(); F_EndFinale(); ST_Shutdown(); R_ShutdownViewBorder(); // stop sound effects and music S_Stop(); // shutdown automap AM_Stop(); DThinker::DestroyAllThinkers(); UndoDehPatch(); GStrings.FreeData(); // close all open WAD files W_Close(); V_UnloadFonts(); R_Shutdown(); HU_Shutdown(); C_ShutdownConsoleBackground(); R_ShutdownTextureManager(); // reset the Zone memory manager Z_Close(); }
static CMD(ExitLevel) { if(gamestate != GS_LEVEL) { return; } if(demoplayback) { return; } if(!param[0]) { G_ExitLevel(); } else { G_SecretExitLevel(datoi(param[0])); } }
void AProgLevelEnder::Tick () { if (special2 == 0) { // fade out over .66 second special1 += 255 / (TICRATE*2/3); if (++special1 >= 255) { special1 = 255; special2 = 1; G_ExitLevel (0, false); } } else { // fade in over two seconds special1 -= 255 / (TICRATE*2); if (special1 <= 0) { Destroy (); } } }
// // [Toke - CTF] SV_FlagScore // Event of a player capturing the flag // void SV_FlagScore (player_t &player, flag_t f) { TEAMpoints[player.userinfo.team]++; SV_CTFEvent (f, SCORE_CAPTURE, player); int time_held = I_MSTime() - CTFdata[f].pickup_time; SV_BroadcastPrintf (PRINT_HIGH, "%s has captured the %s flag (held for %s)\n", player.userinfo.netname, team_names[f], CTF_TimeMSG(time_held)); player.flags[f] = false; // take scoring player's flag CTFdata[f].flagger = 0; CTF_SpawnFlag(f); // checks to see if a team won a game if(TEAMpoints[player.userinfo.team] >= sv_scorelimit && sv_scorelimit != 0) { SV_BroadcastPrintf (PRINT_HIGH, "%s team wins!\n", team_names[player.userinfo.team]); G_ExitLevel (0, 1); } }
DEFINE_ACTION_FUNCTION(AActor, A_BrainDie) { // [RH] If noexit, then don't end the level. if ((deathmatch || alwaysapplydmflags) && (dmflags & DF_NO_EXIT)) return; // New dmflag: Kill all boss spawned monsters before ending the level. if (dmflags2 & DF2_KILLBOSSMONST) { TThinkerIterator<AActor> it; AActor *mo; while ((mo = it.Next())) { if (mo->flags4 & MF4_BOSSSPAWNED) { P_DamageMobj(mo, self, self, mo->health, NAME_None, DMG_NO_ARMOR|DMG_FORCED|DMG_THRUSTLESS|DMG_NO_FACTOR); } } } G_ExitLevel (0, false); }
// // P_PlayerInSpecialSector // Called every tic frame // that the player origin is in a special sector // void P_PlayerInSpecialSector (player_t *player, sector_t * sector) { if (sector == NULL) { // Falling, not all the way down yet? sector = player->mo->Sector; if (!player->mo->isAtZ(sector->LowestFloorAt(player->mo)) && !player->mo->waterlevel) { return; } } // Has hit ground. AInventory *ironfeet; // [RH] Apply any customizable damage if (sector->damageamount > 0) { // Allow subclasses. Better would be to implement it as armor and let that reduce // the damage as part of the normal damage procedure. Unfortunately, I don't have // different damage types yet, so that's not happening for now. for (ironfeet = player->mo->Inventory; ironfeet != NULL; ironfeet = ironfeet->Inventory) { if (ironfeet->IsKindOf (RUNTIME_CLASS(APowerIronFeet))) break; } if (sector->Flags & SECF_ENDGODMODE) player->cheats &= ~CF_GODMODE; if ((ironfeet == NULL || pr_playerinspecialsector() < sector->leakydamage)) { if (sector->Flags & SECF_HAZARD) { player->hazardcount += sector->damageamount; player->hazardtype = sector->damagetype; player->hazardinterval = sector->damageinterval; } else if (level.time % sector->damageinterval == 0) { if (!(player->cheats & (CF_GODMODE|CF_GODMODE2))) P_DamageMobj(player->mo, NULL, NULL, sector->damageamount, sector->damagetype); if ((sector->Flags & SECF_ENDLEVEL) && player->health <= 10 && (!deathmatch || !(dmflags & DF_NO_EXIT))) { G_ExitLevel(0, false); } if (sector->Flags & SECF_DMGTERRAINFX) { P_HitWater(player->mo, player->mo->Sector, player->mo->Pos(), false, true, true); } } } } else if (sector->damageamount < 0) { if (level.time % sector->damageinterval == 0) { P_GiveBody(player->mo, -sector->damageamount, 100); } } if (sector->isSecret()) { sector->ClearSecret(); P_GiveSecret(player->mo, true, true, int(sector - sectors)); } }
// // P_UseSpecialLine // Called when a thing uses a special line. // Only the front sides of lines are usable. // boolean P_UseSpecialLine(mobj_t *thing, line_t *line, int side) { if (side) return false; //jff 02/04/98 add check here for generalized floor/ceil mover { // pointer to line function is NULL by default, set non-null if // line special is push or switch generalized linedef type boolean (*linefunc)(line_t *line) = NULL; // check each range of generalized linedefs if ((unsigned)line->special >= GenFloorBase) { if (!thing->player) if ((line->special & FloorChange) || !(line->special & FloorModel)) return false; // FloorModel is "Allow Monsters" if FloorChange is 0 if (!line->tag && ((line->special & 6) != 6)) //jff 2/27/98 all non-manual return false; // generalized types require tag linefunc = EV_DoGenFloor; } else if ((unsigned)line->special >= GenCeilingBase) { if (!thing->player) if ((line->special & CeilingChange) || !(line->special & CeilingModel)) return false; // CeilingModel is "Allow Monsters" if CeilingChange is 0 if (!line->tag && ((line->special & 6) != 6)) //jff 2/27/98 all non-manual return false; // generalized types require tag linefunc = EV_DoGenCeiling; } else if ((unsigned)line->special >= GenDoorBase) { if (!thing->player) { if (!(line->special & DoorMonster)) return false; // monsters disallowed from this door if (line->flags & ML_SECRET) // they can't open secret doors either return false; } if (!line->tag && ((line->special & 6) != 6)) //jff 3/2/98 all non-manual return false; // generalized types require tag linefunc = EV_DoGenDoor; } else if ((unsigned)line->special >= GenLockedBase) { if (!thing->player) return false; // monsters disallowed from unlocking doors if (!P_CanUnlockGenDoor(line, thing->player)) return false; if (!line->tag && ((line->special & 6) != 6)) //jff 2/27/98 all non-manual return false; // generalized types require tag linefunc = EV_DoGenLockedDoor; } else if ((unsigned)line->special >= GenLiftBase) { if (!thing->player) if (!(line->special & LiftMonster)) return false; // monsters disallowed if (!line->tag && ((line->special & 6) != 6)) //jff 2/27/98 all non-manual return false; // generalized types require tag linefunc = EV_DoGenLift; } else if ((unsigned)line->special >= GenStairsBase) { if (!thing->player) if (!(line->special & StairMonster)) return false; // monsters disallowed if (!line->tag && ((line->special & 6) != 6)) //jff 2/27/98 all non-manual return false; // generalized types require tag linefunc = EV_DoGenStairs; } else if ((unsigned)line->special >= GenCrusherBase) { if (!thing->player) if (!(line->special & CrusherMonster)) return false; // monsters disallowed if (!line->tag && ((line->special & 6) != 6)) //jff 2/27/98 all non-manual return false; // generalized types require tag linefunc = EV_DoGenCrusher; } if (linefunc) switch ((line->special & TriggerType) >> TriggerTypeShift) { case PushOnce: if (!side) if (linefunc(line)) line->special = 0; return true; case PushMany: if (!side) linefunc(line); return true; case SwitchOnce: if (linefunc(line)) P_ChangeSwitchTexture(line, 0); return true; case SwitchMany: if (linefunc(line)) P_ChangeSwitchTexture(line, 1); return true; default: // if not a switch/push type, do nothing here return false; } } // Switches that other things can activate. if (!thing->player) { // never open secret doors if (line->flags & ML_SECRET) return false; switch (line->special) { case DR_Door_OpenWaitClose_AlsoMonsters: case D1_Door_Blue_OpenStay: case D1_Door_Red_OpenStay: case D1_Door_Yellow_OpenStay: //jff 3/5/98 add ability to use teleporters for monsters case SR_Teleport_AlsoMonsters: case S1_Teleport_AlsoMonsters: break; default: return false; } } if (!P_CheckTag(line)) // jff 2/27/98 disallow zero tag on some types return false; // do something switch (line->special) { // MANUALS case DR_Door_OpenWaitClose_AlsoMonsters: case DR_Door_Blue_OpenWaitClose: case DR_Door_Yellow_OpenWaitClose: case DR_Door_Red_OpenWaitClose: case D1_Door_OpenStay: case D1_Door_Blue_OpenStay: case D1_Door_Red_OpenStay: case D1_Door_Yellow_OpenStay: case DR_Door_OpenWaitClose_Fast: if (nomonsters && (line->flags & ML_TRIGGER666)) { line_t junk; junk.tag = 666; EV_DoFloor(&junk, lowerFloorToLowest); line->flags &= ~ML_TRIGGER666; } case D1_Door_OpenStay_Fast: EV_VerticalDoor(line, thing); break; // Switches case S1_Stairs_RaiseBy8: if (EV_BuildStairs(line, build8)) P_ChangeSwitchTexture(line, 0); break; case S1_Floor_RaiseDonut_ChangesTexture: if (EV_DoDonut(line)) P_ChangeSwitchTexture(line, 0); break; case S1_ExitLevel: if (thing->player && thing->player->health <= 0) { S_StartSound(thing, sfx_noway); return false; } P_ChangeSwitchTexture(line, 0); G_ExitLevel(); break; case S1_Floor_RaiseBy32_ChangesTexture: if (EV_DoPlat(line, raiseAndChange, 32)) P_ChangeSwitchTexture(line, 0); break; case S1_Floor_RaiseBy24_ChangesTexture: if (EV_DoPlat(line, raiseAndChange, 24)) P_ChangeSwitchTexture(line, 0); break; case S1_Floor_RaiseToNextHighestFloor: if (EV_DoFloor(line, raiseFloorToNearest)) P_ChangeSwitchTexture(line, 0); break; case S1_Floor_RaiseToNextHighestFloor_ChangesTexture: if (EV_DoPlat(line, raiseToNearestAndChange, 0)) P_ChangeSwitchTexture(line, 0); break; case S1_Lift_LowerWaitRaise: if (EV_DoPlat(line, downWaitUpStay, 0)) P_ChangeSwitchTexture(line, 0); break; case S1_Floor_LowerToLowestFloor: if (EV_DoFloor(line, lowerFloorToLowest)) P_ChangeSwitchTexture(line, 0); if (nomonsters && (line->flags & ML_TRIGGER666)) { line_t junk; junk.tag = 666; EV_DoFloor(&junk, lowerFloorToLowest); junk.tag = 667; EV_DoFloor(&junk, raiseToTexture); line->flags &= ~ML_TRIGGER666; } break; case S1_Door_OpenWaitClose: if (EV_DoDoor(line, doorNormal)) P_ChangeSwitchTexture(line, 0); break; case S1_Ceiling_LowerToFloor: if (EV_DoCeiling(line, lowerToFloor)) P_ChangeSwitchTexture(line, 0); break; case S1_Floor_LowerTo8AboveHighestFloor: if (EV_DoFloor(line, turboLower)) P_ChangeSwitchTexture(line, 0); break; case S1_Ceiling_LowerTo8AboveFloor_PerpetualSlowCrusherDamage: if (EV_DoCeiling(line, crushAndRaise)) P_ChangeSwitchTexture(line, 0); break; case S1_Door_CloseStay: if (EV_DoDoor(line, doorClose)) P_ChangeSwitchTexture(line, 0); break; case S1_ExitLevel_GoesToSecretLevel: if (thing->player && thing->player->health <= 0) { S_StartSound(thing, sfx_noway); return false; } P_ChangeSwitchTexture(line, 0); G_SecretExitLevel(); break; case S1_Floor_RaiseTo8BelowLowestCeiling_Crushes: if (EV_DoFloor(line, raiseFloorCrush)) P_ChangeSwitchTexture(line, 0); break; case S1_Floor_RaiseToLowestCeiling: if (EV_DoFloor(line, raiseFloor)) P_ChangeSwitchTexture(line, 0); break; case S1_Floor_LowerToHighestFloor: if (EV_DoFloor(line, lowerFloor)) P_ChangeSwitchTexture(line, 0); break; case S1_Door_OpenStay: if (EV_DoDoor(line, doorOpen)) P_ChangeSwitchTexture(line, 0); break; case S1_Door_OpenWaitClose_Fast: if (EV_DoDoor(line, doorBlazeRaise)) P_ChangeSwitchTexture(line, 0); break; case S1_Door_OpenStay_Fast: if (EV_DoDoor(line, doorBlazeOpen)) P_ChangeSwitchTexture(line, 0); break; case S1_Door_CloseStay_Fast: if (EV_DoDoor(line, doorBlazeClose)) P_ChangeSwitchTexture(line, 0); break; case S1_Lift_LowerWaitRaise_Fast: if (EV_DoPlat(line, blazeDWUS, 0)) P_ChangeSwitchTexture(line, 0); break; case S1_Stairs_RaiseBy16_Fast: if (EV_BuildStairs(line, turbo16)) P_ChangeSwitchTexture(line, 0); break; case S1_Floor_RaiseToNextHighestFloor_Fast: if (EV_DoFloor(line, raiseFloorTurbo)) P_ChangeSwitchTexture(line, 0); break; case S1_Door_Blue_OpenStay_Fast: case S1_Door_Red_OpenStay_Fast: case S1_Door_Yellow_OpenStay_Fast: if (EV_DoLockedDoor(line, doorBlazeOpen, thing)) P_ChangeSwitchTexture(line, 0); break; case S1_Floor_RaiseBy512: if (EV_DoFloor(line, raiseFloor512)) P_ChangeSwitchTexture(line, 0); break; // Extended switches case S1_Floor_RaiseByShortestLowerTexture: if (EV_DoFloor(line, raiseToTexture)) P_ChangeSwitchTexture(line, 0); break; case S1_Floor_LowerToLowestFloor_ChangesTexture: if (EV_DoFloor(line, lowerAndChange)) P_ChangeSwitchTexture(line, 0); break; case S1_Floor_RaiseBy24_ChangesTextureAndEffect: if (EV_DoFloor(line, raiseFloor24AndChange)) P_ChangeSwitchTexture(line, 0); break; case S1_Floor_RaiseBy24: if (EV_DoFloor(line, raiseFloor24)) P_ChangeSwitchTexture(line, 0); break; case S1_Lift_PerpetualLowestAndHighestFloors: if (EV_DoPlat(line, perpetualRaise, 0)) P_ChangeSwitchTexture(line, 0); break; case S1_Lift_Stop: EV_StopPlat(line); P_ChangeSwitchTexture(line, 0); break; case S1_Crusher_Start_Fast: if (EV_DoCeiling(line, fastCrushAndRaise)) P_ChangeSwitchTexture(line, 0); break; case S1_Crusher_Start_Silent: if (EV_DoCeiling(line, silentCrushAndRaise)) P_ChangeSwitchTexture(line, 0); break; case S1_Ceiling_RaiseToHighestCeiling: if (EV_DoCeiling(line, raiseToHighest) || EV_DoFloor(line, lowerFloorToLowest)) P_ChangeSwitchTexture(line, 0); break; case S1_Ceiling_LowerTo8AboveFloor: if (EV_DoCeiling(line, lowerAndCrush)) P_ChangeSwitchTexture(line, 0); break; case S1_Crusher_Stop: if (EV_CeilingCrushStop(line)) P_ChangeSwitchTexture(line, 0); break; case S1_Light_ChangeToBrightestAdjacent: EV_LightTurnOn(line, 0); P_ChangeSwitchTexture(line, 0); break; case S1_Light_ChangeTo35: EV_LightTurnOn(line, 35); P_ChangeSwitchTexture(line, 0); break; case S1_Light_ChangeTo255: EV_LightTurnOn(line, 255); P_ChangeSwitchTexture(line, 0); break; case S1_Light_StartBlinking: EV_StartLightStrobing(line); P_ChangeSwitchTexture(line, 0); break; case S1_Light_ChangeToDarkestAdjacent: EV_TurnTagLightsOff(line); P_ChangeSwitchTexture(line, 0); break; case S1_Teleport_AlsoMonsters: if (EV_Teleport(line, side, thing)) P_ChangeSwitchTexture(line, 0); break; case S1_Door_CloseWaitOpen_30Seconds: if (EV_DoDoor(line, doorClose30ThenOpen)) P_ChangeSwitchTexture(line, 0); break; case S1_Ceiling_LowerToLowestCeiling: if (EV_DoCeiling(line, lowerToLowest)) P_ChangeSwitchTexture(line, 0); break; case S1_Ceiling_LowerToHighestFloor: if (EV_DoCeiling(line, lowerToMaxFloor)) P_ChangeSwitchTexture(line, 0); break; case S1_Teleport_AlsoMonsters_Silent_SameAngle: if (EV_SilentTeleport(line, side, thing)) P_ChangeSwitchTexture(line, 0); break; case S1_Floor_LowerToNearestFloor: if (EV_DoFloor(line, lowerFloorToNearest)) P_ChangeSwitchTexture(line, 0); break; case SR_Floor_RaiseByShortestLowerTexture: if (EV_DoFloor(line, raiseToTexture)) P_ChangeSwitchTexture(line, 1); break; case SR_Floor_LowerToLowestFloor_ChangesTexture: if (EV_DoFloor(line, lowerAndChange)) P_ChangeSwitchTexture(line, 1); break; case SR_Floor_RaiseBy512: if (EV_DoFloor(line, raiseFloor512)) P_ChangeSwitchTexture(line, 1); break; case SR_Floor_RaiseBy512_ChangesTextureAndEffect: if (EV_DoFloor(line, raiseFloor24AndChange)) P_ChangeSwitchTexture(line, 1); break; case SR_Floor_RaiseBy24: if (EV_DoFloor(line, raiseFloor24)) P_ChangeSwitchTexture(line, 1); break; case SR_Lift_PerpetualLowestAndHighestFloors: EV_DoPlat(line, perpetualRaise, 0); P_ChangeSwitchTexture(line, 1); break; case SR_Lift_Stop: EV_StopPlat(line); P_ChangeSwitchTexture(line, 1); break; case SR_Crusher_Start_Fast: if (EV_DoCeiling(line, fastCrushAndRaise)) P_ChangeSwitchTexture(line, 1); break; case SR_Crusher_Start: if (EV_DoCeiling(line, crushAndRaise)) P_ChangeSwitchTexture(line, 1); break; case SR_Crusher_Start_Silent: if (EV_DoCeiling(line, silentCrushAndRaise)) P_ChangeSwitchTexture(line, 1); break; case SR_Ceiling_RaiseToHighestCeiling: if (EV_DoCeiling(line, raiseToHighest) || EV_DoFloor(line, lowerFloorToLowest)) P_ChangeSwitchTexture(line, 1); break; case SR_Ceiling_LowerTo8AboveFloor: if (EV_DoCeiling(line, lowerAndCrush)) P_ChangeSwitchTexture(line, 1); break; case SR_Crusher_Stop: if (EV_CeilingCrushStop(line)) P_ChangeSwitchTexture(line, 1); break; case SR_Floor_RaiseDonut_ChangesTexture: if (EV_DoDonut(line)) P_ChangeSwitchTexture(line, 1); break; case SR_Light_ChangeToBrightestAdjacent: EV_LightTurnOn(line, 0); P_ChangeSwitchTexture(line, 1); break; case SR_Light_StartBlinking: EV_StartLightStrobing(line); P_ChangeSwitchTexture(line, 1); break; case SR_Light_ChangeToDarkestAdjacent: EV_TurnTagLightsOff(line); P_ChangeSwitchTexture(line, 1); break; case SR_Teleport_AlsoMonsters: if (EV_Teleport(line, side, thing)) P_ChangeSwitchTexture(line, 1); break; case SR_Door_CloseWaitOpen_30Seconds: if (EV_DoDoor(line, doorClose30ThenOpen)) P_ChangeSwitchTexture(line, 1); break; case SR_Ceiling_LowerToLowestCeiling: if (EV_DoCeiling(line, lowerToLowest)) P_ChangeSwitchTexture(line, 1); break; case SR_Ceiling_LowerToHighestFloor: if (EV_DoCeiling(line, lowerToMaxFloor)) P_ChangeSwitchTexture(line, 1); break; case SR_Teleport_AlsoMonsters_Silent_SameAngle: if (EV_SilentTeleport(line, side, thing)) P_ChangeSwitchTexture(line, 1); break; case SR_Lift_RaiseToCeiling_Instantly: if (EV_DoPlat(line, toggleUpDn, 0)) P_ChangeSwitchTexture(line, 1); break; case SR_Floor_LowerToNearestFloor: if (EV_DoFloor(line, lowerFloorToNearest)) P_ChangeSwitchTexture(line, 1); break; case SR_Stairs_RaiseBy8: if (EV_BuildStairs(line, build8)) P_ChangeSwitchTexture(line, 1); break; case SR_Stairs_RaiseBy16_Fast: if (EV_BuildStairs(line, turbo16)) P_ChangeSwitchTexture(line, 1); break; // Buttons (retriggerable switches) case SR_Door_CloseStay: if (EV_DoDoor(line, doorClose)) P_ChangeSwitchTexture(line, 1); break; case SR_Ceiling_LowerToFloor: if (EV_DoCeiling(line, lowerToFloor)) P_ChangeSwitchTexture(line, 1); break; case SR_Floor_LowerToHighestFloor: if (EV_DoFloor(line, lowerFloor)) P_ChangeSwitchTexture(line, 1); break; case SR_Floor_LowerToLowestFloor: if (EV_DoFloor(line, lowerFloorToLowest)) P_ChangeSwitchTexture(line, 1); break; case SR_Door_OpenStay: if (EV_DoDoor(line, doorOpen)) P_ChangeSwitchTexture(line, 1); break; case SR_Lift_LowerWaitRaise: if (EV_DoPlat(line, downWaitUpStay, 1)) P_ChangeSwitchTexture(line, 1); break; case SR_Door_OpenWaitClose: if (EV_DoDoor(line, doorNormal)) P_ChangeSwitchTexture(line, 1); else if (thing->player) S_StartSound(thing, sfx_oof); break; case SR_Floor_RaiseToLowestCeiling: if (EV_DoFloor(line, raiseFloor)) P_ChangeSwitchTexture(line, 1); break; case SR_Floor_RaiseBy24_ChangesTexture: if (EV_DoPlat(line, raiseAndChange, 24)) P_ChangeSwitchTexture(line, 1); break; case SR_Floor_RaiseBy32_ChangesTexture: if (EV_DoPlat(line, raiseAndChange, 32)) P_ChangeSwitchTexture(line, 1); break; case SR_Floor_RaiseTo8BelowLowestCeiling_Crushes: if (EV_DoFloor(line, raiseFloorCrush)) P_ChangeSwitchTexture(line, 1); break; case SR_Floor_RaiseToNextHighestFloor_ChangesTexture: if (EV_DoPlat(line, raiseToNearestAndChange, 0)) P_ChangeSwitchTexture(line, 1); break; case SR_Floor_RaiseToNextHighestFloor: if (EV_DoFloor(line, raiseFloorToNearest)) P_ChangeSwitchTexture(line, 1); break; case SR_Floor_LowerTo8AboveHighestFloor: if (EV_DoFloor(line, turboLower)) P_ChangeSwitchTexture(line, 1); break; case SR_Door_OpenWaitClose_Fast: if (EV_DoDoor(line, doorBlazeRaise)) P_ChangeSwitchTexture(line, 1); break; case SR_Door_OpenStay_Fast: if (EV_DoDoor(line, doorBlazeOpen)) P_ChangeSwitchTexture(line, 1); break; case SR_Door_CloseStay_Fast: if (EV_DoDoor(line, doorBlazeClose)) P_ChangeSwitchTexture(line, 1); break; case SR_Lift_LowerWaitRaise_Fast: if (EV_DoPlat(line, blazeDWUS, 0)) P_ChangeSwitchTexture(line, 1); break; case SR_Floor_RaiseToNextHighestFloor_Fast: if (EV_DoFloor(line, raiseFloorTurbo)) P_ChangeSwitchTexture(line, 1); break; case SR_Door_Blue_OpenStay_Fast: case SR_Door_Red_OpenStay_Fast: case SR_Door_Yellow_OpenStay_Fast: if (EV_DoLockedDoor(line, doorBlazeOpen, thing)) P_ChangeSwitchTexture(line, 1); break; case SR_Light_ChangeTo255: EV_LightTurnOn(line, 255); P_ChangeSwitchTexture(line, 1); break; case SR_Light_ChangeTo35: if (canmodify && gamemission == doom2 && gamemap == 4) EV_LightTurnOn(line, 0); else EV_LightTurnOn(line, 35); P_ChangeSwitchTexture(line, 1); break; } return true; }
// // P_UseSpecialLine // Called when a thing uses a special line. // Only the front sides of lines are usable. // boolean P_UseSpecialLine ( mobj_t* thing, line_t* line, int side ) { // Err... // Use the back sides of VERY SPECIAL lines... if (side) { switch(line->special) { case 124: // Sliding door open&close // UNUSED? break; default: return false; break; } } // Switches that other things can activate. if (!thing->player) { // never open secret doors if (line->flags & ML_SECRET) return false; switch(line->special) { case 1: // MANUAL DOOR RAISE case 32: // MANUAL BLUE case 33: // MANUAL RED case 34: // MANUAL YELLOW break; default: return false; break; } } // do something switch (line->special) { // MANUALS case 1: // Vertical Door case 26: // Blue Door/Locked case 27: // Yellow Door /Locked case 28: // Red Door /Locked case 31: // Manual door open case 32: // Blue locked door open case 33: // Red locked door open case 34: // Yellow locked door open case 117: // Blazing door raise case 118: // Blazing door open EV_VerticalDoor (line, thing); break; //UNUSED - Door Slide Open&Close // case 124: // EV_SlidingDoor (line, thing); // break; // SWITCHES case 7: // Build Stairs if (EV_BuildStairs(line,build8)) P_ChangeSwitchTexture(line,0); break; case 9: // Change Donut if (EV_DoDonut(line)) P_ChangeSwitchTexture(line,0); break; case 11: // Exit level P_ChangeSwitchTexture(line,0); G_ExitLevel (); break; case 14: // Raise Floor 32 and change texture if (EV_DoPlat(line,raiseAndChange,32)) P_ChangeSwitchTexture(line,0); break; case 15: // Raise Floor 24 and change texture if (EV_DoPlat(line,raiseAndChange,24)) P_ChangeSwitchTexture(line,0); break; case 18: // Raise Floor to next highest floor if (EV_DoFloor(line, raiseFloorToNearest)) P_ChangeSwitchTexture(line,0); break; case 20: // Raise Plat next highest floor and change texture if (EV_DoPlat(line,raiseToNearestAndChange,0)) P_ChangeSwitchTexture(line,0); break; case 21: // PlatDownWaitUpStay if (EV_DoPlat(line,downWaitUpStay,0)) P_ChangeSwitchTexture(line,0); break; case 23: // Lower Floor to Lowest if (EV_DoFloor(line,lowerFloorToLowest)) P_ChangeSwitchTexture(line,0); break; case 29: // Raise Door if (EV_DoDoor(line,normal)) P_ChangeSwitchTexture(line,0); break; case 41: // Lower Ceiling to Floor if (EV_DoCeiling(line,lowerToFloor)) P_ChangeSwitchTexture(line,0); break; case 71: // Turbo Lower Floor if (EV_DoFloor(line,turboLower)) P_ChangeSwitchTexture(line,0); break; case 49: // Ceiling Crush And Raise if (EV_DoCeiling(line,crushAndRaise)) P_ChangeSwitchTexture(line,0); break; case 50: // Close Door if (EV_DoDoor(line,closeDoor)) P_ChangeSwitchTexture(line,0); break; case 51: // Secret EXIT P_ChangeSwitchTexture(line,0); G_SecretExitLevel (); break; case 55: // Raise Floor Crush if (EV_DoFloor(line,raiseFloorCrush)) P_ChangeSwitchTexture(line,0); break; case 101: // Raise Floor if (EV_DoFloor(line,raiseFloor)) P_ChangeSwitchTexture(line,0); break; case 102: // Lower Floor to Surrounding floor height if (EV_DoFloor(line,lowerFloor)) P_ChangeSwitchTexture(line,0); break; case 103: // Open Door if (EV_DoDoor(line,openDoor)) P_ChangeSwitchTexture(line,0); break; case 111: // Blazing Door Raise (faster than TURBO!) if (EV_DoDoor (line,blazeRaise)) P_ChangeSwitchTexture(line,0); break; case 112: // Blazing Door Open (faster than TURBO!) if (EV_DoDoor (line,blazeOpen)) P_ChangeSwitchTexture(line,0); break; case 113: // Blazing Door Close (faster than TURBO!) if (EV_DoDoor (line,blazeClose)) P_ChangeSwitchTexture(line,0); break; case 122: // Blazing PlatDownWaitUpStay if (EV_DoPlat(line,blazeDWUS,0)) P_ChangeSwitchTexture(line,0); break; case 127: // Build Stairs Turbo 16 if (EV_BuildStairs(line,turbo16)) P_ChangeSwitchTexture(line,0); break; case 131: // Raise Floor Turbo if (EV_DoFloor(line,raiseFloorTurbo)) P_ChangeSwitchTexture(line,0); break; case 133: // BlzOpenDoor BLUE case 135: // BlzOpenDoor RED case 137: // BlzOpenDoor YELLOW if (EV_DoLockedDoor (line,blazeOpen,thing)) P_ChangeSwitchTexture(line,0); break; case 140: // Raise Floor 512 if (EV_DoFloor(line,raiseFloor512)) P_ChangeSwitchTexture(line,0); break; // BUTTONS case 42: // Close Door if (EV_DoDoor(line,closeDoor)) P_ChangeSwitchTexture(line,1); break; case 43: // Lower Ceiling to Floor if (EV_DoCeiling(line,lowerToFloor)) P_ChangeSwitchTexture(line,1); break; case 45: // Lower Floor to Surrounding floor height if (EV_DoFloor(line,lowerFloor)) P_ChangeSwitchTexture(line,1); break; case 60: // Lower Floor to Lowest if (EV_DoFloor(line,lowerFloorToLowest)) P_ChangeSwitchTexture(line,1); break; case 61: // Open Door if (EV_DoDoor(line,openDoor)) P_ChangeSwitchTexture(line,1); break; case 62: // PlatDownWaitUpStay if (EV_DoPlat(line,downWaitUpStay,1)) P_ChangeSwitchTexture(line,1); break; case 63: // Raise Door if (EV_DoDoor(line,normal)) P_ChangeSwitchTexture(line,1); break; case 64: // Raise Floor to ceiling if (EV_DoFloor(line,raiseFloor)) P_ChangeSwitchTexture(line,1); break; case 66: // Raise Floor 24 and change texture if (EV_DoPlat(line,raiseAndChange,24)) P_ChangeSwitchTexture(line,1); break; case 67: // Raise Floor 32 and change texture if (EV_DoPlat(line,raiseAndChange,32)) P_ChangeSwitchTexture(line,1); break; case 65: // Raise Floor Crush if (EV_DoFloor(line,raiseFloorCrush)) P_ChangeSwitchTexture(line,1); break; case 68: // Raise Plat to next highest floor and change texture if (EV_DoPlat(line,raiseToNearestAndChange,0)) P_ChangeSwitchTexture(line,1); break; case 69: // Raise Floor to next highest floor if (EV_DoFloor(line, raiseFloorToNearest)) P_ChangeSwitchTexture(line,1); break; case 70: // Turbo Lower Floor if (EV_DoFloor(line,turboLower)) P_ChangeSwitchTexture(line,1); break; case 114: // Blazing Door Raise (faster than TURBO!) if (EV_DoDoor (line,blazeRaise)) P_ChangeSwitchTexture(line,1); break; case 115: // Blazing Door Open (faster than TURBO!) if (EV_DoDoor (line,blazeOpen)) P_ChangeSwitchTexture(line,1); break; case 116: // Blazing Door Close (faster than TURBO!) if (EV_DoDoor (line,blazeClose)) P_ChangeSwitchTexture(line,1); break; case 123: // Blazing PlatDownWaitUpStay if (EV_DoPlat(line,blazeDWUS,0)) P_ChangeSwitchTexture(line,1); break; case 132: // Raise Floor Turbo if (EV_DoFloor(line,raiseFloorTurbo)) P_ChangeSwitchTexture(line,1); break; case 99: // BlzOpenDoor BLUE case 134: // BlzOpenDoor RED case 136: // BlzOpenDoor YELLOW if (EV_DoLockedDoor (line,blazeOpen,thing)) P_ChangeSwitchTexture(line,1); break; case 138: // Light Turn On EV_LightTurnOn(line,255); P_ChangeSwitchTexture(line,1); break; case 139: // Light Turn Off EV_LightTurnOn(line,35); P_ChangeSwitchTexture(line,1); break; } return true; }
// // P_UseSpecialLine // Called when a thing uses a special line. // Only the front sides of lines are usable. // boolean P_UseSpecialLine(mobj_t *thing, line_t *line, int side) { if (side) return false; // Switches that other things can activate. if (!thing->player) { // never open secret doors if (line->flags & ML_SECRET) return false; switch (line->special) { case DR_OpenDoorWait4SecondsClose: case D1_OpenDoorStayOpenBlueKeyRequired: case D1_OpenDoorStayOpenRedKeyRequired: case D1_OpenDoorStayOpenYellowKeyRequired: break; default: return false; } } if (!P_CheckTag(line)) // jff 2/27/98 disallow zero tag on some types return false; // do something switch (line->special) { // MANUALS case DR_OpenDoorWait4SecondsClose: case DR_OpenDoorWait4SecondsCloseBlueKeyRequired: case DR_OpenDoorWait4SecondsCloseYellowKeyRequired: case DR_OpenDoorWait4SecondsCloseRedKeyRequired: case D1_OpenDoorStayOpen: case D1_OpenDoorStayOpenBlueKeyRequired: case D1_OpenDoorStayOpenRedKeyRequired: case D1_OpenDoorStayOpenYellowKeyRequired: case DR_OpenFastDoorWait4SecondsClose: if (nomonsters && (line->flags & ML_TRIGGER666)) { line_t junk; junk.tag = 666; EV_DoFloor(&junk, lowerFloorToLowest); line->flags &= ~ML_TRIGGER666; } case D1_OpenFastDoorStayOpen: EV_VerticalDoor(line, thing); break; // SWITCHES case S1_RaiseStairsHeight8Units: if (EV_BuildStairs(line, build8)) P_ChangeSwitchTexture(line, 0); break; case S1_LowerPillarRaiseDonutChangeDonutFloorTextureAndType: if (EV_DoDonut(line)) P_ChangeSwitchTexture(line, 0); break; case S1_ExitLevel: if (thing->player && thing->player->health <= 0) { S_StartSound(thing, sfx_noway); return false; } P_ChangeSwitchTexture(line, 0); G_ExitLevel(); break; case S1_RaiseFloorBy32UnitsChangeFloorTextureAndType: if (EV_DoPlat(line, raiseAndChange, 32)) P_ChangeSwitchTexture(line, 0); break; case S1_RaiseFloorBy24UnitsChangeFloorTextureAndType: if (EV_DoPlat(line, raiseAndChange, 24)) P_ChangeSwitchTexture(line, 0); break; case S1_RaiseFloorToNextFloor: if (EV_DoFloor(line, raiseFloorToNearest)) P_ChangeSwitchTexture(line, 0); break; case S1_RaiseFloorToNextFloorChangeFloorTextureAndType: if (EV_DoPlat(line, raiseToNearestAndChange, 0)) P_ChangeSwitchTexture(line, 0); break; case S1_LowerLiftWait3SecondsRise: if (EV_DoPlat(line, downWaitUpStay, 0)) P_ChangeSwitchTexture(line, 0); break; case S1_SetFloorToLowestNeighbouringFloor: if (EV_DoFloor(line, lowerFloorToLowest)) P_ChangeSwitchTexture(line, 0); if (nomonsters && (line->flags & ML_TRIGGER666)) { line_t junk; junk.tag = 666; EV_DoFloor(&junk, lowerFloorToLowest); junk.tag = 667; EV_DoFloor(&junk, raiseToTexture); line->flags &= ~ML_TRIGGER666; } break; case S1_OpenDoorWait4SecondsClose: if (EV_DoDoor(line, normal)) P_ChangeSwitchTexture(line, 0); break; case S1_LowerCeilingToFloor: if (EV_DoCeiling(line, lowerToFloor)) P_ChangeSwitchTexture(line, 0); break; case S1_SetFloorTo8UnitsAboveHighestNeighbouringFloor: if (EV_DoFloor(line, turboLower)) P_ChangeSwitchTexture(line, 0); break; case S1_StartSlowCrusher: if (EV_DoCeiling(line, crushAndRaise)) P_ChangeSwitchTexture(line, 0); break; case S1_CloseDoor: if (EV_DoDoor(line, close)) P_ChangeSwitchTexture(line, 0); break; case S1_ExitLevelAndGoToSecretLevel: if (thing->player && thing->player->health <= 0) { S_StartSound(thing, sfx_noway); return false; } P_ChangeSwitchTexture(line, 0); G_SecretExitLevel(); break; case S1_SetFloorTo8UnitsUnderLowestNeighbouringCeiling: if (EV_DoFloor(line, raiseFloorCrush)) P_ChangeSwitchTexture(line, 0); break; case S1_SetFloorToLowestNeighbouringCeiling: if (EV_DoFloor(line, raiseFloor)) P_ChangeSwitchTexture(line, 0); break; case S1_SetFloorToHighestNeighbouringFloor: if (EV_DoFloor(line, lowerFloor)) P_ChangeSwitchTexture(line, 0); break; case S1_OpenDoorStayOpen: if (EV_DoDoor(line, open)) P_ChangeSwitchTexture(line, 0); break; case S1_OpenFastDoorWait4SecondsClose: if (EV_DoDoor(line, blazeRaise)) P_ChangeSwitchTexture(line, 0); break; case S1_OpenFastDoorStayOpen: if (EV_DoDoor(line, blazeOpen)) P_ChangeSwitchTexture(line, 0); break; case S1_CloseFastDoor: if (EV_DoDoor(line, blazeClose)) P_ChangeSwitchTexture(line, 0); break; case S1_LowerFastLiftWait3SecondsRise: if (EV_DoPlat(line, blazeDWUS, 0)) P_ChangeSwitchTexture(line, 0); break; case S1_RaiseFastStairsHeight16Units: if (EV_BuildStairs(line, turbo16)) P_ChangeSwitchTexture(line, 0); break; case S1_RaiseFastFloorToNextFloor: if (EV_DoFloor(line, raiseFloorTurbo)) P_ChangeSwitchTexture(line, 0); break; case S1_OpenFastDoorStayOpenBlueKeyRequired: case S1_OpenFastDoorStayOpenRedKeyRequired: case S1_OpenFastDoorStayOpenYellowKeyRequired: if (EV_DoLockedDoor(line, blazeOpen, thing)) P_ChangeSwitchTexture(line, 0); break; case S1_RaiseFloorBy512Units: if (EV_DoFloor(line, raiseFloor512)) P_ChangeSwitchTexture(line, 0); break; // BUTTONS case SR_LowerCeilingToFloorCloseDoor: if (EV_DoDoor(line, close)) P_ChangeSwitchTexture(line, 1); break; case SR_LowerCeilingToFloor: if (EV_DoCeiling(line, lowerToFloor)) P_ChangeSwitchTexture(line, 1); break; case SR_SetFloorToHighestNeighbouringFloor: if (EV_DoFloor(line, lowerFloor)) P_ChangeSwitchTexture(line, 1); break; case SR_SetFloorToLowestNeighbouringFloor: if (EV_DoFloor(line, lowerFloorToLowest)) P_ChangeSwitchTexture(line, 1); break; case SR_OpenDoorStayOpen: if (EV_DoDoor(line, open)) P_ChangeSwitchTexture(line, 1); break; case SR_LowerLiftWait3SecondsRise: if (EV_DoPlat(line, downWaitUpStay, 1)) P_ChangeSwitchTexture(line, 1); break; case SR_OpenDoorWait4SecondsClose: if (EV_DoDoor(line, normal)) P_ChangeSwitchTexture(line, 1); else if (thing->player) S_StartSound(thing, sfx_oof); break; case SR_SetFloorToLowestNeighbouringCeiling: if (EV_DoFloor(line, raiseFloor)) P_ChangeSwitchTexture(line, 1); break; case SR_RaiseFloorBy24UnitsChangeFloorTextureAndType: if (EV_DoPlat(line, raiseAndChange, 24)) P_ChangeSwitchTexture(line, 1); break; case SR_RaiseFloorBy32UnitsChangeFloorTextureAndType: if (EV_DoPlat(line, raiseAndChange, 32)) P_ChangeSwitchTexture(line, 1); break; case SR_SetFloorTo8UnitsUnderLowestNeighbouringCeiling: if (EV_DoFloor(line, raiseFloorCrush)) P_ChangeSwitchTexture(line, 1); break; case SR_RaiseFloorToNextFloorChangeFloorTextureAndType: if (EV_DoPlat(line, raiseToNearestAndChange, 0)) P_ChangeSwitchTexture(line, 1); break; case SR_RaiseFloorToNextFloor: if (EV_DoFloor(line, raiseFloorToNearest)) P_ChangeSwitchTexture(line, 1); break; case SR_SetFloorTo8UnitsAboveHighestNeighbouringFloor: if (EV_DoFloor(line, turboLower)) P_ChangeSwitchTexture(line, 1); break; case SR_OpenFastDoorWait4SecondsClose: if (EV_DoDoor(line, blazeRaise)) P_ChangeSwitchTexture(line, 1); break; case SR_OpenFastDoorStayOpen: if (EV_DoDoor(line, blazeOpen)) P_ChangeSwitchTexture(line, 1); break; case SR_CloseFastDoor: if (EV_DoDoor(line, blazeClose)) P_ChangeSwitchTexture(line, 1); break; case SR_LowerFastLiftWait3SecondsRise: if (EV_DoPlat(line, blazeDWUS, 0)) P_ChangeSwitchTexture(line, 1); break; case SR_RaiseFastFloorToNextFloor: if (EV_DoFloor(line, raiseFloorTurbo)) P_ChangeSwitchTexture(line, 1); break; case SR_OpenFastDoorStayOpenBlueKeyRequired: case SR_OpenFastDoorStayOpenRedKeyRequired: case SR_OpenFastDoorStayOpenYellowKeyRequired: if (EV_DoLockedDoor(line, blazeOpen, thing)) P_ChangeSwitchTexture(line, 1); break; case SR_LightsTo255: EV_LightTurnOn(line, 255); P_ChangeSwitchTexture(line, 1); break; case SR_LightsTo0: if (canmodify && gamemission == doom2 && gamemap == 4) EV_LightTurnOn(line, 0); else EV_LightTurnOn(line, 35); P_ChangeSwitchTexture(line, 1); break; } return true; }
// // P_CrossSpecialLine - TRIGGER // Called every time a thing origin is about // to cross a line with a non 0 special. // void P_CrossSpecialLine ( int linenum, int side, mobj_t* thing ) { line_t* line; int ok; line = &lines[linenum]; // Triggers that other things can activate if (!thing->player) { // Things that should NOT trigger specials... switch(thing->type) { case MT_ROCKET: case MT_PLASMA: case MT_BFG: case MT_TROOPSHOT: case MT_HEADSHOT: case MT_BRUISERSHOT: return; break; default: break; } ok = 0; switch(line->special) { case 39: // TELEPORT TRIGGER case 97: // TELEPORT RETRIGGER case 125: // TELEPORT MONSTERONLY TRIGGER case 126: // TELEPORT MONSTERONLY RETRIGGER case 4: // RAISE DOOR case 10: // PLAT DOWN-WAIT-UP-STAY TRIGGER case 88: // PLAT DOWN-WAIT-UP-STAY RETRIGGER ok = 1; break; } if (!ok) return; } // Note: could use some const's here. switch (line->special) { // TRIGGERS. // All from here to RETRIGGERS. case 2: // Open Door EV_DoDoor(line,vld_open); line->special = 0; break; case 3: // Close Door EV_DoDoor(line,vld_close); line->special = 0; break; case 4: // Raise Door EV_DoDoor(line,vld_normal); line->special = 0; break; case 5: // Raise Floor EV_DoFloor(line,raiseFloor); line->special = 0; break; case 6: // Fast Ceiling Crush & Raise EV_DoCeiling(line,fastCrushAndRaise); line->special = 0; break; case 8: // Build Stairs EV_BuildStairs(line,build8); line->special = 0; break; case 10: // PlatDownWaitUp EV_DoPlat(line,downWaitUpStay,0); line->special = 0; break; case 12: // Light Turn On - brightest near EV_LightTurnOn(line,0); line->special = 0; break; case 13: // Light Turn On 255 EV_LightTurnOn(line,255); line->special = 0; break; case 16: // Close Door 30 EV_DoDoor(line,vld_close30ThenOpen); line->special = 0; break; case 17: // Start Light Strobing EV_StartLightStrobing(line); line->special = 0; break; case 19: // Lower Floor EV_DoFloor(line,lowerFloor); line->special = 0; break; case 22: // Raise floor to nearest height and change texture EV_DoPlat(line,raiseToNearestAndChange,0); line->special = 0; break; case 25: // Ceiling Crush and Raise EV_DoCeiling(line,crushAndRaise); line->special = 0; break; case 30: // Raise floor to shortest texture height // on either side of lines. EV_DoFloor(line,raiseToTexture); line->special = 0; break; case 35: // Lights Very Dark EV_LightTurnOn(line,35); line->special = 0; break; case 36: // Lower Floor (TURBO) EV_DoFloor(line,turboLower); line->special = 0; break; case 37: // LowerAndChange EV_DoFloor(line,lowerAndChange); line->special = 0; break; case 38: // Lower Floor To Lowest EV_DoFloor( line, lowerFloorToLowest ); line->special = 0; break; case 39: // TELEPORT! EV_Teleport( line, side, thing ); line->special = 0; break; case 40: // RaiseCeilingLowerFloor EV_DoCeiling( line, raiseToHighest ); EV_DoFloor( line, lowerFloorToLowest ); line->special = 0; break; case 44: // Ceiling Crush EV_DoCeiling( line, lowerAndCrush ); line->special = 0; break; case 52: // EXIT! G_ExitLevel (); break; case 53: // Perpetual Platform Raise EV_DoPlat(line,perpetualRaise,0); line->special = 0; break; case 54: // Platform Stop EV_StopPlat(line); line->special = 0; break; case 56: // Raise Floor Crush EV_DoFloor(line,raiseFloorCrush); line->special = 0; break; case 57: // Ceiling Crush Stop EV_CeilingCrushStop(line); line->special = 0; break; case 58: // Raise Floor 24 EV_DoFloor(line,raiseFloor24); line->special = 0; break; case 59: // Raise Floor 24 And Change EV_DoFloor(line,raiseFloor24AndChange); line->special = 0; break; case 104: // Turn lights off in sector(tag) EV_TurnTagLightsOff(line); line->special = 0; break; case 108: // Blazing Door Raise (faster than TURBO!) EV_DoDoor (line,vld_blazeRaise); line->special = 0; break; case 109: // Blazing Door Open (faster than TURBO!) EV_DoDoor (line,vld_blazeOpen); line->special = 0; break; case 100: // Build Stairs Turbo 16 EV_BuildStairs(line,turbo16); line->special = 0; break; case 110: // Blazing Door Close (faster than TURBO!) EV_DoDoor (line,vld_blazeClose); line->special = 0; break; case 119: // Raise floor to nearest surr. floor EV_DoFloor(line,raiseFloorToNearest); line->special = 0; break; case 121: // Blazing PlatDownWaitUpStay EV_DoPlat(line,blazeDWUS,0); line->special = 0; break; case 124: // Secret EXIT G_SecretExitLevel (); break; case 125: // TELEPORT MonsterONLY if (!thing->player) { EV_Teleport( line, side, thing ); line->special = 0; } break; case 130: // Raise Floor Turbo EV_DoFloor(line,raiseFloorTurbo); line->special = 0; break; case 141: // Silent Ceiling Crush & Raise EV_DoCeiling(line,silentCrushAndRaise); line->special = 0; break; // RETRIGGERS. All from here till end. case 72: // Ceiling Crush EV_DoCeiling( line, lowerAndCrush ); break; case 73: // Ceiling Crush and Raise EV_DoCeiling(line,crushAndRaise); break; case 74: // Ceiling Crush Stop EV_CeilingCrushStop(line); break; case 75: // Close Door EV_DoDoor(line,vld_close); break; case 76: // Close Door 30 EV_DoDoor(line,vld_close30ThenOpen); break; case 77: // Fast Ceiling Crush & Raise EV_DoCeiling(line,fastCrushAndRaise); break; case 79: // Lights Very Dark EV_LightTurnOn(line,35); break; case 80: // Light Turn On - brightest near EV_LightTurnOn(line,0); break; case 81: // Light Turn On 255 EV_LightTurnOn(line,255); break; case 82: // Lower Floor To Lowest EV_DoFloor( line, lowerFloorToLowest ); break; case 83: // Lower Floor EV_DoFloor(line,lowerFloor); break; case 84: // LowerAndChange EV_DoFloor(line,lowerAndChange); break; case 86: // Open Door EV_DoDoor(line,vld_open); break; case 87: // Perpetual Platform Raise EV_DoPlat(line,perpetualRaise,0); break; case 88: // PlatDownWaitUp EV_DoPlat(line,downWaitUpStay,0); break; case 89: // Platform Stop EV_StopPlat(line); break; case 90: // Raise Door EV_DoDoor(line,vld_normal); break; case 91: // Raise Floor EV_DoFloor(line,raiseFloor); break; case 92: // Raise Floor 24 EV_DoFloor(line,raiseFloor24); break; case 93: // Raise Floor 24 And Change EV_DoFloor(line,raiseFloor24AndChange); break; case 94: // Raise Floor Crush EV_DoFloor(line,raiseFloorCrush); break; case 95: // Raise floor to nearest height // and change texture. EV_DoPlat(line,raiseToNearestAndChange,0); break; case 96: // Raise floor to shortest texture height // on either side of lines. EV_DoFloor(line,raiseToTexture); break; case 97: // TELEPORT! EV_Teleport( line, side, thing ); break; case 98: // Lower Floor (TURBO) EV_DoFloor(line,turboLower); break; case 105: // Blazing Door Raise (faster than TURBO!) EV_DoDoor (line,vld_blazeRaise); break; case 106: // Blazing Door Open (faster than TURBO!) EV_DoDoor (line,vld_blazeOpen); break; case 107: // Blazing Door Close (faster than TURBO!) EV_DoDoor (line,vld_blazeClose); break; case 120: // Blazing PlatDownWaitUpStay. EV_DoPlat(line,blazeDWUS,0); break; case 126: // TELEPORT MonsterONLY. if (!thing->player) EV_Teleport( line, side, thing ); break; case 128: // Raise To Nearest Floor EV_DoFloor(line,raiseFloorToNearest); break; case 129: // Raise Floor Turbo EV_DoFloor(line,raiseFloorTurbo); break; } }
/* * G_SnapFrame * It's time to send a new snap, so set the world up for sending */ void G_SnapFrame( void ) { edict_t *ent; game.realtime = trap_Milliseconds(); // level.time etc. might not be real time //others G_UpdateServerInfo(); // exit level if( level.exitNow ) { G_ExitLevel(); return; } AITools_Frame(); //MbotGame //give think time to AI debug tools // finish snap G_SnapClients(); // build the playerstate_t structures for all players G_SnapEntities(); // add effects based on accumulated info along the frame // set entity bits (prepare entities for being sent in the snap) for( ent = &game.edicts[0]; ENTNUM( ent ) < game.numentities; ent++ ) { if( ent->s.number != ENTNUM( ent ) ) { if( developer->integer ) G_Printf( "fixing ent->s.number (etype:%i, classname:%s)\n", ent->s.type, ent->classname ? ent->classname : "noclassname" ); ent->s.number = ENTNUM( ent ); } // temporary filter (Q2 system to ensure reliability) // ignore ents without visible models unless they have an effect if( !ent->r.inuse ) { ent->r.svflags |= SVF_NOCLIENT; continue; } else if( ent->s.type >= ET_TOTAL_TYPES || ent->s.type < 0 ) { if( developer->integer ) G_Printf( "'G_SnapFrame': Inhibiting invalid entity type %i\n", ent->s.type ); ent->r.svflags |= SVF_NOCLIENT; continue; } else if( !( ent->r.svflags & SVF_NOCLIENT ) && !ent->s.modelindex && !ent->s.effects && !ent->s.sound && !ISEVENTENTITY( &ent->s ) && !ent->s.light && !ent->r.client ) { if( developer->integer ) G_Printf( "'G_SnapFrame': fixing missing SVF_NOCLIENT flag (no effect)\n" ); ent->r.svflags |= SVF_NOCLIENT; continue; } ent->s.effects &= ~EF_TAKEDAMAGE; if( ent->takedamage ) ent->s.effects |= EF_TAKEDAMAGE; if( GS_MatchPaused() ) { // when in timeout, we don't send entity sounds entity_sound_backup[ENTNUM( ent )] = ent->s.sound; ent->s.sound = 0; } } }
void P_CrossSpecialLine(line_t *line,mobj_t *thing) { /* Triggers that other things can activate */ if (!thing->player) { /* Not a player? */ switch(line->special) { default: /* None of the above? */ return; /* Exit */ case 39: /* TELEPORT TRIGGER */ case 97: /* TELEPORT RETRIGGER */ case 4: /* RAISE DOOR */ case 10: /* PLAT DOWN-WAIT-UP-STAY TRIGGER */ case 88: /* PLAT DOWN-WAIT-UP-STAY RETRIGGER */ ; /* Null event */ } } /********************************** The first group of triggers all clear line->special so that they can't be triggered again. The second groun leaves line->special alone so triggering can occur at will. **********************************/ switch (line->special) { case 2: /* Open Door */ EV_DoDoor(line,open); line->special = 0; break; case 3: /* Close Door */ EV_DoDoor(line,close); line->special = 0; break; case 4: /* Raise Door */ EV_DoDoor(line,normaldoor); line->special = 0; break; case 5: /* Raise Floor */ EV_DoFloor(line,raiseFloor); line->special = 0; break; case 6: /* Fast Ceiling Crush & Raise */ EV_DoCeiling(line,fastCrushAndRaise); line->special = 0; break; case 8: /* Build Stairs */ EV_BuildStairs(line); line->special = 0; break; case 10: /* PlatDownWaitUp */ EV_DoPlat(line,downWaitUpStay,0); line->special = 0; break; case 12: /* Light Turn On - brightest near */ EV_LightTurnOn(line,0); line->special = 0; break; case 13: /* Light Turn On 255 */ EV_LightTurnOn(line,255); line->special = 0; break; case 16: /* Close Door 30 */ EV_DoDoor(line,close30ThenOpen); line->special = 0; break; case 17: /* Start Light Strobing */ EV_StartLightStrobing(line); line->special = 0; break; case 19: /* Lower Floor */ EV_DoFloor(line,lowerFloor); line->special = 0; break; case 22: /* Raise floor to nearest height and change texture */ EV_DoPlat(line,raiseToNearestAndChange,0); line->special = 0; break; case 25: /* Ceiling Crush and Raise */ EV_DoCeiling(line,crushAndRaise); line->special = 0; break; case 30: /* Raise floor to shortest texture height */ /* on either side of lines */ EV_DoFloor(line,raiseToTexture); line->special = 0; break; case 35: /* Lights Very Dark */ EV_LightTurnOn(line,35); line->special = 0; break; case 36: /* Lower Floor (TURBO) */ EV_DoFloor(line,turboLower); line->special = 0; break; case 37: /* LowerAndChange */ EV_DoFloor(line,lowerAndChange); line->special = 0; break; case 38: /* Lower Floor To Lowest */ EV_DoFloor(line,lowerFloorToLowest); line->special = 0; break; case 39: /* TELEPORT! */ EV_Teleport(line,thing); line->special = 0; break; case 40: /* RaiseCeilingLowerFloor */ EV_DoCeiling(line,raiseToHighest); EV_DoFloor(line,lowerFloorToLowest); line->special = 0; break; case 44: /* Ceiling Crush */ EV_DoCeiling(line,lowerAndCrush); line->special = 0; break; case 52: /* EXIT! */ G_ExitLevel(); line->special = 0; break; case 53: /* Perpetual Platform Raise */ EV_DoPlat(line,perpetualRaise,0); line->special = 0; break; case 54: /* Platform Stop */ EV_StopPlat(line); line->special = 0; break; case 56: /* Raise Floor Crush */ EV_DoFloor(line,raiseFloorCrush); line->special = 0; break; case 57: /* Ceiling Crush Stop */ EV_CeilingCrushStop(line); line->special = 0; break; case 58: /* Raise Floor 24 */ EV_DoFloor(line,raiseFloor24); line->special = 0; break; case 59: /* Raise Floor 24 And Change */ EV_DoFloor(line,raiseFloor24AndChange); line->special = 0; break; case 104: /* Turn lights off in sector(tag) */ EV_TurnTagLightsOff(line); line->special = 0; break; /* These are restartable, do not affect line->special */ case 72: /* Ceiling Crush */ EV_DoCeiling(line,lowerAndCrush); break; case 73: /* Ceiling Crush and Raise */ EV_DoCeiling(line,crushAndRaise); break; case 74: /* Ceiling Crush Stop */ EV_CeilingCrushStop(line); break; case 75: /* Close Door */ EV_DoDoor(line,close); break; case 76: /* Close Door 30 */ EV_DoDoor(line,close30ThenOpen); break; case 77: /* Fast Ceiling Crush & Raise */ EV_DoCeiling(line,fastCrushAndRaise); break; case 79: /* Lights Very Dark */ EV_LightTurnOn(line,35); break; case 80: /* Light Turn On - brightest near */ EV_LightTurnOn(line,0); break; case 81: /* Light Turn On 255 */ EV_LightTurnOn(line,255); break; case 82: /* Lower Floor To Lowest */ EV_DoFloor(line,lowerFloorToLowest); break; case 83: /* Lower Floor */ EV_DoFloor(line,lowerFloor); break; case 84: /* LowerAndChange */ EV_DoFloor(line,lowerAndChange); break; case 86: /* Open Door */ EV_DoDoor(line,open); break; case 87: /* Perpetual Platform Raise */ EV_DoPlat(line,perpetualRaise,0); break; case 88: /* PlatDownWaitUp */ EV_DoPlat(line,downWaitUpStay,0); break; case 89: /* Platform Stop */ EV_StopPlat(line); break; case 90: /* Raise Door */ EV_DoDoor(line,normaldoor); break; case 91: /* Raise Floor */ EV_DoFloor(line,raiseFloor); break; case 92: /* Raise Floor 24 */ EV_DoFloor(line,raiseFloor24); break; case 93: /* Raise Floor 24 And Change */ EV_DoFloor(line,raiseFloor24AndChange); break; case 94: /* Raise Floor Crush */ EV_DoFloor(line,raiseFloorCrush); break; case 95: /* Raise floor to nearest height and change texture */ EV_DoPlat(line,raiseToNearestAndChange,0); break; case 96: /* Raise floor to shortest texture height */ /* on either side of lines */ EV_DoFloor(line,raiseToTexture); break; case 97: /* TELEPORT! */ EV_Teleport(line,thing); break; case 98: /* Lower Floor (TURBO) */ EV_DoFloor(line,turboLower); break; } }
void P_CrossSpecialLine(int linenum, int side, mobj_t *thing) { line_t *line; line = &lines[linenum]; if(!thing->player) { // Check if trigger allowed by non-player mobj switch(line->special) { case 39: // Trigger_TELEPORT case 97: // Retrigger_TELEPORT case 4: // Trigger_Raise_Door //case 10: // PLAT DOWN-WAIT-UP-STAY TRIGGER //case 88: // PLAT DOWN-WAIT-UP-STAY RETRIGGER break; default: return; break; } } switch(line->special) { //==================================================== // TRIGGERS //==================================================== case 2: // Open Door EV_DoDoor(line,open,VDOORSPEED); line->special = 0; break; case 3: // Close Door EV_DoDoor(line,close,VDOORSPEED); line->special = 0; break; case 4: // Raise Door EV_DoDoor(line,normal,VDOORSPEED); line->special = 0; break; case 5: // Raise Floor EV_DoFloor(line,raiseFloor); line->special = 0; break; case 6: // Fast Ceiling Crush & Raise EV_DoCeiling(line,fastCrushAndRaise); line->special = 0; break; case 8: // Trigger_Build_Stairs (8 pixel steps) EV_BuildStairs(line, 8*FRACUNIT); line->special = 0; break; case 106: // Trigger_Build_Stairs_16 (16 pixel steps) EV_BuildStairs(line, 16*FRACUNIT); line->special = 0; break; case 10: // PlatDownWaitUp EV_DoPlat(line,downWaitUpStay,0); line->special = 0; break; case 12: // Light Turn On - brightest near EV_LightTurnOn(line,0); line->special = 0; break; case 13: // Light Turn On 255 EV_LightTurnOn(line,255); line->special = 0; break; case 16: // Close Door 30 EV_DoDoor(line,close30ThenOpen,VDOORSPEED); line->special = 0; break; case 17: // Start Light Strobing EV_StartLightStrobing(line); line->special = 0; break; case 19: // Lower Floor EV_DoFloor(line,lowerFloor); line->special = 0; break; case 22: // Raise floor to nearest height and change texture EV_DoPlat(line,raiseToNearestAndChange,0); line->special = 0; break; case 25: // Ceiling Crush and Raise EV_DoCeiling(line,crushAndRaise); line->special = 0; break; case 30: // Raise floor to shortest texture height // on either side of lines EV_DoFloor(line,raiseToTexture); line->special = 0; break; case 35: // Lights Very Dark EV_LightTurnOn(line,35); line->special = 0; break; case 36: // Lower Floor (TURBO) EV_DoFloor(line,turboLower); line->special = 0; break; case 37: // LowerAndChange EV_DoFloor(line,lowerAndChange); line->special = 0; break; case 38: // Lower Floor To Lowest EV_DoFloor( line, lowerFloorToLowest ); line->special = 0; break; case 39: // TELEPORT! EV_Teleport( line, side, thing ); line->special = 0; break; case 40: // RaiseCeilingLowerFloor EV_DoCeiling( line, raiseToHighest ); EV_DoFloor( line, lowerFloorToLowest ); line->special = 0; break; case 44: // Ceiling Crush EV_DoCeiling( line, lowerAndCrush ); line->special = 0; break; case 52: // EXIT! G_ExitLevel (); line->special = 0; break; case 53: // Perpetual Platform Raise EV_DoPlat(line,perpetualRaise,0); line->special = 0; break; case 54: // Platform Stop EV_StopPlat(line); line->special = 0; break; case 56: // Raise Floor Crush EV_DoFloor(line,raiseFloorCrush); line->special = 0; break; case 57: // Ceiling Crush Stop EV_CeilingCrushStop(line); line->special = 0; break; case 58: // Raise Floor 24 EV_DoFloor(line,raiseFloor24); line->special = 0; break; case 59: // Raise Floor 24 And Change EV_DoFloor(line,raiseFloor24AndChange); line->special = 0; break; case 104: // Turn lights off in sector(tag) EV_TurnTagLightsOff(line); line->special = 0; break; case 105: // Trigger_SecretExit G_SecretExitLevel(); line->special = 0; break; //==================================================== // RE-DOABLE TRIGGERS //==================================================== case 72: // Ceiling Crush EV_DoCeiling( line, lowerAndCrush ); break; case 73: // Ceiling Crush and Raise EV_DoCeiling(line,crushAndRaise); break; case 74: // Ceiling Crush Stop EV_CeilingCrushStop(line); break; case 75: // Close Door EV_DoDoor(line,close,VDOORSPEED); break; case 76: // Close Door 30 EV_DoDoor(line,close30ThenOpen,VDOORSPEED); break; case 77: // Fast Ceiling Crush & Raise EV_DoCeiling(line,fastCrushAndRaise); break; case 79: // Lights Very Dark EV_LightTurnOn(line,35); break; case 80: // Light Turn On - brightest near EV_LightTurnOn(line,0); break; case 81: // Light Turn On 255 EV_LightTurnOn(line,255); break; case 82: // Lower Floor To Lowest EV_DoFloor( line, lowerFloorToLowest ); break; case 83: // Lower Floor EV_DoFloor(line,lowerFloor); break; case 84: // LowerAndChange EV_DoFloor(line,lowerAndChange); break; case 86: // Open Door EV_DoDoor(line,open,VDOORSPEED); break; case 87: // Perpetual Platform Raise EV_DoPlat(line,perpetualRaise,0); break; case 88: // PlatDownWaitUp EV_DoPlat(line,downWaitUpStay,0); break; case 89: // Platform Stop EV_StopPlat(line); break; case 90: // Raise Door EV_DoDoor(line,normal,VDOORSPEED); break; case 100: // Retrigger_Raise_Door_Turbo EV_DoDoor(line, normal, VDOORSPEED*3); break; case 91: // Raise Floor EV_DoFloor(line,raiseFloor); break; case 92: // Raise Floor 24 EV_DoFloor(line,raiseFloor24); break; case 93: // Raise Floor 24 And Change EV_DoFloor(line,raiseFloor24AndChange); break; case 94: // Raise Floor Crush EV_DoFloor(line,raiseFloorCrush); break; case 95: // Raise floor to nearest height and change texture EV_DoPlat(line,raiseToNearestAndChange,0); break; case 96: // Raise floor to shortest texture height // on either side of lines EV_DoFloor(line,raiseToTexture); break; case 97: // TELEPORT! EV_Teleport( line, side, thing ); break; case 98: // Lower Floor (TURBO) EV_DoFloor(line,turboLower); break; } }
// // [denis] D_DoomWadReboot // change wads at runtime // on 404, returns a vector of bad files // std::vector<size_t> D_DoomWadReboot( const std::vector<std::string> &wadnames, const std::vector<std::string> &patch_files, std::vector<std::string> needhashes ) { std::vector<size_t> fails; size_t i; if (modifiedgame && (gameinfo.flags & GI_SHAREWARE)) I_FatalError ("\nYou cannot switch WAD with the shareware version. Register!"); SV_SendReconnectSignal(); G_ExitLevel(0, 0); DThinker::DestroyAllThinkers(); // Close all open WAD files W_Close(); // [ML] 9/11/10: Reset custom wad level information from MAPINFO et al. // I have never used memset, I hope I am not invoking satan by doing this :( if (wadlevelinfos) { for (i = 0; i < numwadlevelinfos; i++) if (wadlevelinfos[i].snapshot) { delete wadlevelinfos[i].snapshot; wadlevelinfos[i].snapshot = NULL; } memset(wadlevelinfos,0,sizeof(wadlevelinfos)); numwadlevelinfos = 0; } if (wadclusterinfos) { memset(wadclusterinfos,0,sizeof(wadclusterinfos)); numwadclusterinfos = 0; } // Restart the memory manager Z_Init(); wadfiles.clear(); modifiedgame = false; std::string custwad; if(wadnames.empty() == false) custwad = wadnames[0]; D_AddDefWads(custwad); for(i = 0; i < wadnames.size(); i++) { std::string file = BaseFileSearch(wadnames[i], ".WAD"); if(file.length()) wadfiles.push_back(file); else { if (wadnames[i] != "") { Printf (PRINT_HIGH, "could not find WAD: %s\n", wadnames[i].c_str()); fails.push_back(i); } } } if(wadnames.size() > 1) modifiedgame = true; wadhashes = W_InitMultipleFiles (wadfiles); SV_InitMultipleFiles (wadfiles); // get skill / episode / map from parms strcpy (startmap, (gameinfo.flags & GI_MAPxx) ? "MAP01" : "E1M1"); UndoDehPatch(); patchfiles.clear(); D_InitStrings (); D_DoDefDehackedPatch(patch_files); G_SetLevelStrings (); G_ParseMapInfo (); S_ParseSndInfo(); R_Init(); P_Init(); return fails; }
// // P_PlayerInSpecialSector // Called every tic frame // that the player origin is in a special sector // void P_PlayerInSpecialSector (player_t* player) { sector_t* sector; sector = player->mo->subsector->sector; // Falling, not all the way down yet? if (player->mo->z != sector->floorheight) return; // Has hitten ground. switch (sector->special) { case 5: // HELLSLIME DAMAGE if (!player->powers[pw_ironfeet]) if (!(::g->leveltime&0x1f)) P_DamageMobj (player->mo, NULL, NULL, 10); break; case 7: // NUKAGE DAMAGE if (!player->powers[pw_ironfeet]) if (!(::g->leveltime&0x1f)) P_DamageMobj (player->mo, NULL, NULL, 5); break; case 16: // SUPER HELLSLIME DAMAGE case 4: // STROBE HURT if (!player->powers[pw_ironfeet] || (P_Random()<5) ) { if (!(::g->leveltime&0x1f)) P_DamageMobj (player->mo, NULL, NULL, 20); } break; case 9: // SECRET SECTOR player->secretcount++; sector->special = 0; if ( !::g->demoplayback && ( ::g->usergame && !::g->netgame ) ) { // DHM - Nerve :: Let's give achievements in real time in Doom 2 if ( !common->IsMultiplayer() ) { switch( DoomLib::GetGameSKU() ) { case GAME_SKU_DOOM1_BFG: { // Removing trophies for DOOM and DOOM II BFG due to point limit. //gameLocal->UnlockAchievement( Doom1BFG_Trophies::SCOUT_FIND_ANY_SECRET ); break; } case GAME_SKU_DOOM2_BFG: { //gameLocal->UnlockAchievement( Doom2BFG_Trophies::IMPORTANT_LOOKING_DOOR_FIND_ANY_SECRET ); idAchievementManager::LocalUser_CompleteAchievement(ACHIEVEMENT_DOOM2_IMPORTANT_LOOKING_DOOR_FIND_ANY_SECRET ); break; } case GAME_SKU_DCC: { // Not on PC. //gameLocal->UnlockAchievement( DOOM_ACHIEVEMENT_FIND_SECRET ); break; } default: { // No unlocks for other SKUs. break; } } } } break; case 11: // EXIT SUPER DAMAGE! (for E1M8 finale) player->cheats &= ~CF_GODMODE; if (!(::g->leveltime&0x1f)) P_DamageMobj (player->mo, NULL, NULL, 20); if (player->health <= 10) G_ExitLevel(); break; default: I_Error ("P_PlayerInSpecialSector: " "unknown special %i", sector->special); break; }; }
// // P_UseSpecialLine // Called when a thing uses a special line. // Only the front sides of lines are usable. // boolean P_UseSpecialLine(mobj_t* thing, line_t* line, int side) { // Err... // Use the back sides of VERY SPECIAL lines... if (side) { switch(line->special) { case 148: // haleyjd [STRIFE] break; default: return false; } } // Switches that other things can activate. if (!thing->player) { // never open secret doors if (line->flags & ML_SECRET) return false; switch(line->special) { case 1: // MANUAL DOOR RAISE case 31: // haleyjd [STRIFE] case 144: // haleyjd [STRIFE] Manual sliding door break; default: return false; break; } } // do something switch(line->special) { // MANUALS case 1: // Vertical Door case 26: // DR ID Card case 27: // DR Pass Card case 28: // DR ID Badge case 31: // Manual door open case 32: // D1 ID Card case 33: // D1 ID Badge case 34: // D1 Pass Card case 117: // Blazing door raise case 118: // Blazing door open case 156: // haleyjd [STRIFE] D1 Brass Key case 157: // haleyjd [STRIFE] D1 Silver Key case 158: // haleyjd [STRIFE] D1 Gold Key case 159: // haleyjd [STRIFE] DR Gold Key case 160: // haleyjd [STRIFE] DR Silver Key case 161: // haleyjd [STRIFE] DR Brass Key case 165: // villsa [STRIFE] That doesn't seem to work case 166: // haleyjd [STRIFE] DR Hand Print case 169: // haleyjd [STRIFE] DR Base Key case 170: // haleyjd [STRIFE] DR Gov's Key case 190: // haleyjd [STRIFE] DR Order Key case 205: // villsa [STRIFE] Available in retail only case 213: // haleyjd [STRIFE] DR Chalice case 217: // haleyjd [STRIFE] DR Core Key case 221: // haleyjd [STRIFE] DR Mauler Key case 224: // haleyjd [STRIFE] DR Chapel Key case 225: // haleyjd [STRIFE] DR Catacomb Key case 232: // villsa [STRIFE] DR Oracle Pass EV_VerticalDoor (line, thing); break; // haleyjd: For the sake of our sanity, I have reordered all the line // specials from this point down so that they are strictly in numeric // order, and not divided up in a semi-arbitrary fashion. case 7: // Build Stairs - [STRIFE] Verified unmodified if (EV_BuildStairs(line,build8)) P_ChangeSwitchTexture(line,0); break; case 9: // Change Donut - [STRIFE] Verified unmodified if (EV_DoDonut(line)) P_ChangeSwitchTexture(line,0); break; case 11: // Exit level - [STRIFE] Modified to take tag, etc. P_ChangeSwitchTexture(line, 1); if(levelTimer && levelTimeCount) break; G_ExitLevel(line->tag); break; case 14: // Raise Floor 32 and change texture - [STRIFE] Verified unmodified if (EV_DoPlat(line, raiseAndChange,32)) P_ChangeSwitchTexture(line,0); break; case 15: // Raise Floor 24 and change texture if (EV_DoPlat(line, raiseAndChange,24)) P_ChangeSwitchTexture(line,0); break; case 18: // Raise Floor to next highest floor - [STRIFE] Verified unmodified if (EV_DoFloor(line, raiseFloorToNearest)) P_ChangeSwitchTexture(line,0); break; case 20: // Raise Plat next highest floor and change texture - [STRIFE] Verified unmodified if(EV_DoPlat(line, raiseToNearestAndChange, 0)) P_ChangeSwitchTexture(line,0); break; case 21: // PlatDownWaitUpStay - [STRIFE] Verified unmodified if (EV_DoPlat(line, downWaitUpStay,0)) P_ChangeSwitchTexture(line,0); break; case 23: // Lower Floor to Lowest - [STRIFE] Verified unmodified if (EV_DoFloor(line,lowerFloorToLowest)) P_ChangeSwitchTexture(line,0); break; case 29: // Raise Door - [STRIFE] Verified unmodified if (EV_DoDoor(line,normal)) P_ChangeSwitchTexture(line,0); break; case 40: // villsa [STRIFE] Split Open Door if(EV_DoDoor(line, splitOpen)) P_ChangeSwitchTexture(line, 0); break; // haleyjd case 41: // Lower Ceiling to Floor - [STRIFE] Verified unmodified if (EV_DoCeiling(line,lowerToFloor)) P_ChangeSwitchTexture(line,0); break; case 42: // Close Door - [STRIFE] Verified unmodified if (EV_DoDoor(line,close)) P_ChangeSwitchTexture(line,1); break; case 43: // Lower Ceiling to Floor - [STRIFE] Verified unmodified if (EV_DoCeiling(line,lowerToFloor)) P_ChangeSwitchTexture(line,1); break; case 45: // Lower Floor to Surrounding floor height - [STRIFE] Verified unmodified if (EV_DoFloor(line,lowerFloor)) P_ChangeSwitchTexture(line,1); break; case 49: // Ceiling Crush And Raise - [STRIFE] Verified unmodified if (EV_DoCeiling(line,crushAndRaise)) P_ChangeSwitchTexture(line,0); break; case 50: // Close Door - [STRIFE] Verified unmodified if (EV_DoDoor(line,close)) P_ChangeSwitchTexture(line,0); break; case 51: // [STRIFE] Modifed into S1 Start Finale (was Secret Exit) P_ChangeSwitchTexture(line,0); G_StartFinale(); break; case 55: // Raise Floor Crush - [STRIFE] Verified unmodified if (EV_DoFloor(line,raiseFloorCrush)) P_ChangeSwitchTexture(line,0); break; case 60: // Lower Floor to Lowest - [STRIFE] Verified unmodified if (EV_DoFloor(line,lowerFloorToLowest)) P_ChangeSwitchTexture(line,1); break; case 61: // Open Door - [STRIFE] Verified unmodified if (EV_DoDoor(line,open)) P_ChangeSwitchTexture(line,1); break; case 62: // PlatDownWaitUpStay - [STRIFE] Verified unmodified if (EV_DoPlat(line, downWaitUpStay,1)) P_ChangeSwitchTexture(line,1); break; case 63: // Raise Door - [STRIFE] Verified unmodified if (EV_DoDoor(line,normal)) P_ChangeSwitchTexture(line,1); break; case 64: // Raise Floor to ceiling - [STRIFE] Verified unmodified if (EV_DoFloor(line,raiseFloor)) P_ChangeSwitchTexture(line,1); break; case 65: // Raise Floor Crush - [STRIFE] Verified unmodified if (EV_DoFloor(line,raiseFloorCrush)) P_ChangeSwitchTexture(line,1); break; case 66: // Raise Floor 24 and change texture - [STRIFE] Verified unmodified if (EV_DoPlat(line, raiseAndChange, 24)) P_ChangeSwitchTexture(line,1); break; case 67: // Raise Floor 32 and change texture - [STRIFE] Verified unmodified if (EV_DoPlat(line, raiseAndChange, 32)) P_ChangeSwitchTexture(line,1); break; case 68: // Raise Plat to next highest floor and change texture - [STRIFE] Verified unmodified if (EV_DoPlat(line, raiseToNearestAndChange, 0)) P_ChangeSwitchTexture(line,1); break; case 69: // Raise Floor to next highest floor - [STRIFE] Verified unmodified if (EV_DoFloor(line, raiseFloorToNearest)) P_ChangeSwitchTexture(line,1); break; case 70: // Turbo Lower Floor - [STRIFE] Verified unmodified if (EV_DoFloor(line,turboLower)) P_ChangeSwitchTexture(line,1); break; case 71: // Turbo Lower Floor - [STRIFE] Verified unmodified if (EV_DoFloor(line,turboLower)) P_ChangeSwitchTexture(line,0); break; case 101: // Raise Floor - [STRIFE] Verified unmodified if (EV_DoFloor(line,raiseFloor)) P_ChangeSwitchTexture(line,0); break; case 102: // Lower Floor to Surrounding floor height - [STRIFE] Verified unmodified if (EV_DoFloor(line,lowerFloor)) P_ChangeSwitchTexture(line,0); break; case 103: // Open Door - [STRIFE] Verified unmodified if (EV_DoDoor(line,open)) P_ChangeSwitchTexture(line,0); break; case 111: // Blazing Door Raise (faster than TURBO!) - [STRIFE] Verified unmodified if (EV_DoDoor (line,blazeRaise)) P_ChangeSwitchTexture(line,0); break; case 112: // Blazing Door Open (faster than TURBO!) - [STRIFE] Verified unmodified if (EV_DoDoor (line,blazeOpen)) P_ChangeSwitchTexture(line,0); break; case 113: // Blazing Door Close (faster than TURBO!) - [STRIFE] Verified unmodified if (EV_DoDoor (line,blazeClose)) P_ChangeSwitchTexture(line,0); break; case 114: // Blazing Door Raise (faster than TURBO!) - [STRIFE] Verified unmodified if (EV_DoDoor (line,blazeRaise)) P_ChangeSwitchTexture(line,1); break; case 115: // Blazing Door Open (faster than TURBO!) - [STRIFE] Verified unmodified if (EV_DoDoor (line,blazeOpen)) P_ChangeSwitchTexture(line,1); break; case 116: // Blazing Door Close (faster than TURBO!) - [STRIFE] Verified unmodified if (EV_DoDoor (line,blazeClose)) P_ChangeSwitchTexture(line,1); break; case 122: // Blazing PlatDownWaitUpStay - [STRIFE] Verified unmodified if(EV_DoPlat(line, blazeDWUS, 0)) P_ChangeSwitchTexture(line,0); break; case 123: // Blazing PlatDownWaitUpStay - [STRIFE] Verified unmodified if(EV_DoPlat(line, blazeDWUS, 0)) P_ChangeSwitchTexture(line,1); break; case 127: // Build Stairs Turbo 16 - [STRIFE] Verified unmodified if (EV_BuildStairs(line,turbo16)) P_ChangeSwitchTexture(line,0); break; case 131: // Raise Floor Turbo - [STRIFE] Verified unmodified if (EV_DoFloor(line,raiseFloorTurbo)) P_ChangeSwitchTexture(line,0); break; case 132: // Raise Floor Turbo - [STRIFE] Verified unmodified if (EV_DoFloor(line,raiseFloorTurbo)) P_ChangeSwitchTexture(line,1); break; case 133: // [STRIFE] TODO - which key is it? case 135: // [STRIFE] TODO - which key is it? case 137: // [STRIFE] TODO - which key is it? if (EV_DoLockedDoor (line,blazeOpen,thing)) P_ChangeSwitchTexture(line,0); break; case 99: // [STRIFE] TODO: which key is it? case 134: // [STRIFE] TODO: which key is it? case 136: // [STRIFE] TODO: which key is it? if (EV_DoLockedDoor (line,blazeOpen,thing)) P_ChangeSwitchTexture(line,1); break; case 138: // Light Turn On - [STRIFE] Verified unmodified EV_LightTurnOn(line,255); P_ChangeSwitchTexture(line,1); break; case 139: // Light Turn Off - [STRIFE] Verified unmodified EV_LightTurnOn(line,35); P_ChangeSwitchTexture(line,1); break; case 140: // Raise Floor 512 - [STRIFE] Verified unmodified if (EV_DoFloor(line,raiseFloor512)) P_ChangeSwitchTexture(line,0); break; case 144: // villsa [STRIFE] manual sliding door EV_SlidingDoor(line, thing); break; case 146: // haleyjd 09/24/10: [STRIFE] S1 Build Stairs Down 16 (new type) if(EV_BuildStairs(line, buildDown16)) P_ChangeSwitchTexture(line, 0); break; case 147: // haleyjd 09/24/10: [STRIFE] S1 Clear Force Fields if(EV_ClearForceFields(line)) P_ChangeSwitchTexture(line, 0); break; case 148: // haleyjd 09/16/10: [STRIFE] using forcefields hurts P_DamageMobj(thing, NULL, NULL, 16); P_Thrust(thing->player, thing->angle + ANG180, 125*FRACUNIT/16); break; case 151: // villsa [STRIFE] BlzOpenDoor Gold key case 152: // [STRIFE] TODO: which key is it? case 153: // [STRIFE] TODO: which key is it? if(EV_DoLockedDoor(line, blazeOpen, thing)) P_ChangeSwitchTexture(line, 1); break; case 154: // villsa [STRIFE] plat lower wait rise if have gold key if(thing->player->cards[key_GoldKey]) { if(EV_DoPlat(line, downWaitUpStay, 0)) P_ChangeSwitchTexture(line, 1); } else { thing->player->message = DEH_String("You need a gold key"); S_StartSound(thing, sfx_oof); } break; case 155: // villsa [STRIFE] raise plat wait lower if(EV_DoPlat(line, upWaitDownStay, 0)) P_ChangeSwitchTexture(line, 1); break; case 162: // [STRIFE] TODO: which key is it? case 163: // [STRIFE] TODO: which key is it? case 164: // villsa [STRIFE] BlzOpenDoor Gold key case 167: // [STRIFE] TODO: which key is it? if(EV_DoLockedDoor(line, blazeOpen, thing)) P_ChangeSwitchTexture(line, 0); break; case 168: // [STRIFE] TODO: which key is it? // haleyjd 09/25/10: [STRIFE] SR Blaze Open Door ???? Key if(EV_DoLockedDoor(line, blazeOpen, thing)) P_ChangeSwitchTexture(line, 1); break; case 171: // [STRIFE] TODO: which key is it? // haleyjd 09/25/10: [STRIFE] S1 Open Door ???? Key if(EV_DoLockedDoor(line, open, thing)) P_ChangeSwitchTexture(line, 0); break; case 172: // [STRIFE] TODO: which key is it? case 173: // [STRIFE] TODO: which key is it? case 176: // [STRIFE] TODO: which key is it? case 191: // [STRIFE] TODO: which key is it? case 192: // [STRIFE] TODO: which key is it? case 223: // [STRIFE] TODO: which key is it? if(EV_DoLockedDoor(line, normal, thing)) P_ChangeSwitchTexture(line, 1); break; case 177: // villsa [STRIFE] plat lower wait rise if have power3 key if(thing->player->cards[key_Power3Key]) { if(EV_DoPlat(line, downWaitUpStay, 0)) P_ChangeSwitchTexture(line, 1); } else { thing->player->message = DEH_String("You don't have the key"); S_StartSound(thing, sfx_oof); } break; case 181: // haleyjd 09/25/10: [STRIFE] S1 Floor Raise 512 & Change if(EV_DoFloor(line, raiseFloor512AndChange)) P_ChangeSwitchTexture(line, 0); break; case 189: // [STRIFE] TODO: which key is it??? // haleyjd 09/25/10: [STRIFE] S1 Split Open Door ???? Key if(EV_DoLockedDoor(line, splitOpen, thing)) P_ChangeSwitchTexture(line, 0); break; case 194: // villsa [STRIFE] S1 Free Prisoners if(EV_DoDoor(line, open)) { P_ChangeSwitchTexture(line, 0); P_FreePrisoners(); } break; case 199: // haleyjd 09/25/10: [STRIFE] S1 Destroy Converter if(EV_DoCeiling(line, lowerAndCrush)) { P_ChangeSwitchTexture(line, 0); P_DestroyConverter(); } break; case 207: // villsa [STRIFE] SR Remote Sliding Door if(EV_RemoteSlidingDoor(line, thing)) P_ChangeSwitchTexture(line, 1); break; // haleyjd case 209: // haleyjd 09/24/10: [STRIFE] S1 Build Stairs Down 16 if Have Chalice if(!P_PlayerHasItem(thing->player, MT_INV_CHALICE)) { DEH_snprintf(usemessage, sizeof(usemessage), "You need the chalice!"); thing->player->message = usemessage; S_StartSound(thing, sfx_oof); break; } else if(EV_BuildStairs(line, buildDown16)) P_ChangeSwitchTexture(line, 0); break; case 211: // villsa [STRIFE] S1 Play VOC## sound if(&players[consoleplayer] == thing->player && thing->player->powers[pw_communicator]) { DEH_snprintf(usemessage, sizeof(usemessage), "voc%i", line->tag); I_StartVoice(usemessage); line->special = 0; } break; case 214: // villsa [STRIFE] S1 slow lift lower wait up stay if(EV_DoPlat(line, slowDWUS, 1)) P_ChangeSwitchTexture(line, 1); break; case 219: // haleyjd 09/25/10: S1 Lower Floor Blue Crystal if(!thing->player->cards[key_BlueCrystalKey]) { thing->player->message = DEH_String("You need the Blue Crystal"); S_StartSound(thing, sfx_oof); } else if(EV_DoFloor(line, lowerFloor)) P_ChangeSwitchTexture(line, 0); break; case 220: // haleyjd 09/25/10: S1 Lower Floor Red Crystal if(!thing->player->cards[key_RedCrystalKey]) { thing->player->message = DEH_String("You need the Red Crystal"); S_StartSound(thing, sfx_oof); } else if(EV_DoFloor(line, lowerFloor)) P_ChangeSwitchTexture(line, 0); break; case 226: // villsa [STRIFE] S1 Complete Training Area if(EV_DoFloor(line, lowerFloor)) { P_GiveItemToPlayer(thing->player, SPR_TOKN, MT_TOKEN_STAMINA); P_GiveItemToPlayer(thing->player, SPR_TOKN, MT_TOKEN_NEW_ACCURACY); P_ChangeSwitchTexture(line, 0); DEH_snprintf(usemessage, sizeof(usemessage), DEH_String("Congratulations! You have completed the training area.")); thing->player->message = usemessage; } break; case 229: // villsa [STRIFE] SR Sigil Sliding Door if(thing->player->sigiltype == 4) { if(EV_RemoteSlidingDoor(line, thing)) P_ChangeSwitchTexture(line, 1); } break; // haleyjd case 233: // villsa [STRIFE] objective given after revealing the computer if(!EV_DoDoor(line, splitOpen)) return true; P_ChangeSwitchTexture(line, 1); GiveVoiceObjective("voc70", "log70", 0); // haleyjd: Strife used sprintf here, not a direct set. DEH_snprintf(usemessage, sizeof(usemessage), "Incoming Message from BlackBird..."); thing->player->message = usemessage; break; case 234: // haleyjd 09/24/10: [STRIFE] SR Raise Door if Quest 3 if(!(thing->player->questflags & QF_QUEST3)) // QUEST3 == Irale { // BUG: doesn't make sfx_oof sound like all other message- // giving door types. I highly doubt this was intentional. DEH_snprintf(usemessage, sizeof(usemessage), "That doesn't seem to work!"); thing->player->message = usemessage; } else if(EV_DoDoor(line, normal)) P_ChangeSwitchTexture(line, 1); break; case 235: // haleyjd 09/25/10: [STRIFE] S1 Split Open Door if Have Sigil 4 if(thing->player->sigiltype == 4) { if(EV_DoDoor(line, splitOpen)) P_ChangeSwitchTexture(line, 0); } break; case 666: // villsa [STRIFE] SR Move Wall P_MoveWall(line, thing); break; } return true; }
void AActor::Die (AActor *source, AActor *inflictor, int dmgflags) { // Handle possible unmorph on death bool wasgibbed = (health < GibHealth()); AActor *realthis = NULL; int realstyle = 0; int realhealth = 0; if (P_MorphedDeath(this, &realthis, &realstyle, &realhealth)) { if (!(realstyle & MORPH_UNDOBYDEATHSAVES)) { if (wasgibbed) { int realgibhealth = realthis->GibHealth(); if (realthis->health >= realgibhealth) { realthis->health = realgibhealth -1; // if morphed was gibbed, so must original be (where allowed)l } } realthis->Die(source, inflictor, dmgflags); } return; } // [SO] 9/2/02 -- It's rather funny to see an exploded player body with the invuln sparkle active :) effects &= ~FX_RESPAWNINVUL; //flags &= ~MF_INVINCIBLE; if (debugfile && this->player) { static int dieticks[MAXPLAYERS]; // [ZzZombo] not used? Except if for peeking in debugger... int pnum = int(this->player-players); dieticks[pnum] = gametic; fprintf (debugfile, "died (%d) on tic %d (%s)\n", pnum, gametic, this->player->cheats&CF_PREDICTING?"predicting":"real"); } // [RH] Notify this actor's items. for (AInventory *item = Inventory; item != NULL; ) { AInventory *next = item->Inventory; item->OwnerDied(); item = next; } if (flags & MF_MISSILE) { // [RH] When missiles die, they just explode P_ExplodeMissile (this, NULL, NULL); return; } // [RH] Set the target to the thing that killed it. Strife apparently does this. if (source != NULL) { target = source; } flags &= ~(MF_SHOOTABLE|MF_FLOAT|MF_SKULLFLY); if (!(flags4 & MF4_DONTFALL)) flags&=~MF_NOGRAVITY; flags |= MF_DROPOFF; if ((flags3 & MF3_ISMONSTER) || FindState(NAME_Raise) != NULL || IsKindOf(RUNTIME_CLASS(APlayerPawn))) { // [RH] Only monsters get to be corpses. // Objects with a raise state should get the flag as well so they can // be revived by an Arch-Vile. Batman Doom needs this. // [RC] And disable this if DONTCORPSE is set, of course. if(!(flags6 & MF6_DONTCORPSE)) flags |= MF_CORPSE; } flags6 |= MF6_KILLED; // [RH] Allow the death height to be overridden using metadata. fixed_t metaheight = 0; if (DamageType == NAME_Fire) { metaheight = GetClass()->Meta.GetMetaFixed (AMETA_BurnHeight); } if (metaheight == 0) { metaheight = GetClass()->Meta.GetMetaFixed (AMETA_DeathHeight); } if (metaheight != 0) { height = MAX<fixed_t> (metaheight, 0); } else { height >>= 2; } // [RH] If the thing has a special, execute and remove it // Note that the thing that killed it is considered // the activator of the script. // New: In Hexen, the thing that died is the activator, // so now a level flag selects who the activator gets to be. // Everything is now moved to P_ActivateThingSpecial(). if (special && (!(flags & MF_SPECIAL) || (flags3 & MF3_ISMONSTER)) && !(activationtype & THINGSPEC_NoDeathSpecial)) { P_ActivateThingSpecial(this, source, true); } if (CountsAsKill()) level.killed_monsters++; if (source && source->player) { if (CountsAsKill()) { // count for intermission source->player->killcount++; } // Don't count any frags at level start, because they're just telefrags // resulting from insufficient deathmatch starts, and it wouldn't be // fair to count them toward a player's score. if (player && level.maptime) { source->player->frags[player - players]++; if (player == source->player) // [RH] Cumulative frag count { char buff[256]; player->fragcount--; if (deathmatch && player->spreecount >= 5 && cl_showsprees) { SexMessage (GStrings("SPREEKILLSELF"), buff, player->userinfo.GetGender(), player->userinfo.GetName(), player->userinfo.GetName()); StatusBar->AttachMessage (new DHUDMessageFadeOut (SmallFont, buff, 1.5f, 0.2f, 0, 0, CR_WHITE, 3.f, 0.5f), MAKE_ID('K','S','P','R')); } } else { if ((dmflags2 & DF2_YES_LOSEFRAG) && deathmatch) player->fragcount--; ++source->player->fragcount; ++source->player->spreecount; if (source->player->morphTics) { // Make a super chicken source->GiveInventoryType (RUNTIME_CLASS(APowerWeaponLevel2)); } if (deathmatch && cl_showsprees) { const char *spreemsg; char buff[256]; switch (source->player->spreecount) { case 5: spreemsg = GStrings("SPREE5"); break; case 10: spreemsg = GStrings("SPREE10"); break; case 15: spreemsg = GStrings("SPREE15"); break; case 20: spreemsg = GStrings("SPREE20"); break; case 25: spreemsg = GStrings("SPREE25"); break; default: spreemsg = NULL; break; } if (spreemsg == NULL && player->spreecount >= 5) { if (!AnnounceSpreeLoss (this)) { SexMessage (GStrings("SPREEOVER"), buff, player->userinfo.GetGender(), player->userinfo.GetName(), source->player->userinfo.GetName()); StatusBar->AttachMessage (new DHUDMessageFadeOut (SmallFont, buff, 1.5f, 0.2f, 0, 0, CR_WHITE, 3.f, 0.5f), MAKE_ID('K','S','P','R')); } } else if (spreemsg != NULL) { if (!AnnounceSpree (source)) { SexMessage (spreemsg, buff, player->userinfo.GetGender(), player->userinfo.GetName(), source->player->userinfo.GetName()); StatusBar->AttachMessage (new DHUDMessageFadeOut (SmallFont, buff, 1.5f, 0.2f, 0, 0, CR_WHITE, 3.f, 0.5f), MAKE_ID('K','S','P','R')); } } } } // [RH] Multikills if (player != source->player) { source->player->multicount++; if (source->player->lastkilltime > 0) { if (source->player->lastkilltime < level.time - 3*TICRATE) { source->player->multicount = 1; } if (deathmatch && source->CheckLocalView (consoleplayer) && cl_showmultikills) { const char *multimsg; switch (source->player->multicount) { case 1: multimsg = NULL; break; case 2: multimsg = GStrings("MULTI2"); break; case 3: multimsg = GStrings("MULTI3"); break; case 4: multimsg = GStrings("MULTI4"); break; default: multimsg = GStrings("MULTI5"); break; } if (multimsg != NULL) { char buff[256]; if (!AnnounceMultikill (source)) { SexMessage (multimsg, buff, player->userinfo.GetGender(), player->userinfo.GetName(), source->player->userinfo.GetName()); StatusBar->AttachMessage (new DHUDMessageFadeOut (SmallFont, buff, 1.5f, 0.8f, 0, 0, CR_RED, 3.f, 0.5f), MAKE_ID('M','K','I','L')); } } } } source->player->lastkilltime = level.time; } // [RH] Implement fraglimit if (deathmatch && fraglimit && fraglimit <= D_GetFragCount (source->player)) { Printf ("%s\n", GStrings("TXT_FRAGLIMIT")); G_ExitLevel (0, false); } } } else if (!multiplayer && CountsAsKill()) { // count all monster deaths, // even those caused by other monsters players[0].killcount++; } if (player) { // [RH] Death messages ClientObituary (this, inflictor, source, dmgflags); // Death script execution, care of Skull Tag FBehavior::StaticStartTypedScripts (SCRIPT_Death, this, true); // [RH] Force a delay between death and respawn player->respawn_time = level.time + TICRATE; //Added by MC: Respawn bots if (bglobal.botnum && !demoplayback) { if (player->Bot != NULL) player->Bot->t_respawn = (pr_botrespawn()%15)+((bglobal.botnum-1)*2)+TICRATE+1; //Added by MC: Discard enemies. for (int i = 0; i < MAXPLAYERS; i++) { if (players[i].Bot != NULL && this == players[i].Bot->enemy) { if (players[i].Bot->dest == players[i].Bot->enemy) players[i].Bot->dest = NULL; players[i].Bot->enemy = NULL; } } player->spreecount = 0; player->multicount = 0; } // count environment kills against you if (!source) { player->frags[player - players]++; player->fragcount--; // [RH] Cumulative frag count } flags &= ~MF_SOLID; player->playerstate = PST_DEAD; P_DropWeapon (player); if (this == players[consoleplayer].camera && automapactive) { // don't die in auto map, switch view prior to dying AM_Stop (); } // [GRB] Clear extralight. When you killed yourself with weapon that // called A_Light1/2 before it called A_Light0, extraligh remained. player->extralight = 0; } // [RH] If this is the unmorphed version of another monster, destroy this // actor, because the morphed version is the one that will stick around in // the level. if (flags & MF_UNMORPHED) { Destroy (); return; } FState *diestate = NULL; int gibhealth = GibHealth(); ActorFlags4 iflags4 = inflictor == NULL ? ActorFlags4::FromInt(0) : inflictor->flags4; bool extremelydead = ((health < gibhealth || iflags4 & MF4_EXTREMEDEATH) && !(iflags4 & MF4_NOEXTREMEDEATH)); // Special check for 'extreme' damage type to ensure that it gets recorded properly as an extreme death for subsequent checks. if (DamageType == NAME_Extreme) { extremelydead = true; DamageType = NAME_None; } // find the appropriate death state. The order is: // // 1. If damagetype is not 'none' and death is extreme, try a damage type specific extreme death state // 2. If no such state is found or death is not extreme try a damage type specific normal death state // 3. If damagetype is 'ice' and actor is a monster or player, try the generic freeze death (unless prohibited) // 4. If no state has been found and death is extreme, try the extreme death state // 5. If no such state is found or death is not extreme try the regular death state. // 6. If still no state has been found, destroy the actor immediately. if (DamageType != NAME_None) { if (extremelydead) { FName labels[] = { NAME_Death, NAME_Extreme, DamageType }; diestate = FindState(3, labels, true); } if (diestate == NULL) { diestate = FindState (NAME_Death, DamageType, true); if (diestate != NULL) extremelydead = false; } if (diestate == NULL) { if (DamageType == NAME_Ice) { // If an actor doesn't have an ice death, we can still give them a generic one. if (!deh.NoAutofreeze && !(flags4 & MF4_NOICEDEATH) && (player || (flags3 & MF3_ISMONSTER))) { diestate = FindState(NAME_GenericFreezeDeath); extremelydead = false; } } } } if (diestate == NULL) { // Don't pass on a damage type this actor cannot handle. // (most importantly, prevent barrels from passing on ice damage.) // Massacre must be preserved though. if (DamageType != NAME_Massacre) { DamageType = NAME_None; } if (extremelydead) { // Extreme death diestate = FindState (NAME_Death, NAME_Extreme, true); } if (diestate == NULL) { // Normal death extremelydead = false; diestate = FindState (NAME_Death); } } if (extremelydead) { // We'll only get here if an actual extreme death state was used. // For players, mark the appropriate flag. if (player != NULL) { player->cheats |= CF_EXTREMELYDEAD; } // If a non-player, mark as extremely dead for the crash state. else if (health >= gibhealth) { health = gibhealth - 1; } } if (diestate != NULL) { SetState (diestate); if (tics > 1) { tics -= pr_killmobj() & 3; if (tics < 1) tics = 1; } } else { Destroy(); } }
// // D_DoomWadReboot // [denis] change wads at runtime // Returns false if there are missing files and fills the missingfiles // vector // // [SL] passing an IWAD as newwadfiles[0] is now optional // TODO: hash checking for patchfiles // bool D_DoomWadReboot( const std::vector<std::string> &newwadfiles, const std::vector<std::string> &newpatchfiles, const std::vector<std::string> &newwadhashes, const std::vector<std::string> &newpatchhashes ) { size_t i; bool hashcheck = (newwadfiles.size() == newwadhashes.size()); missingfiles.clear(); missinghashes.clear(); // already loaded these? if (lastWadRebootSuccess && !wadhashes.empty() && newwadhashes == std::vector<std::string>(wadhashes.begin()+1, wadhashes.end())) { // fast track if files have not been changed // denis - todo - actually check the file timestamps Printf (PRINT_HIGH, "Currently loaded WADs match server checksum\n\n"); return true; } lastWadRebootSuccess = false; if (gamestate == GS_LEVEL) G_ExitLevel(0, 0); S_Stop(); DThinker::DestroyAllThinkers(); // Close all open WAD files W_Close(); // [ML] 9/11/10: Reset custom wad level information from MAPINFO et al. for (i = 0; i < wadlevelinfos.size(); i++) { if (wadlevelinfos[i].snapshot) { delete wadlevelinfos[i].snapshot; wadlevelinfos[i].snapshot = NULL; } } wadlevelinfos.clear(); wadclusterinfos.clear(); // Restart the memory manager Z_Init(); SetLanguageIDs (); gamestate_t oldgamestate = gamestate; gamestate = GS_STARTUP; // prevent console from trying to use nonexistant font // [SL] 2012-12-06 - If we weren't provided with a new IWAD filename in // newwadfiles, use the previous IWAD. std::string iwad_filename, iwad_hash; if ((newwadfiles.empty() || !W_IsIWAD(newwadfiles[0])) && (wadfiles.size() >= 2)) { iwad_filename = wadfiles[1]; iwad_hash = wadhashes[1]; } else if (!newwadfiles.empty()) { iwad_filename = newwadfiles[0]; iwad_hash = hashcheck ? newwadhashes[0] : ""; } wadfiles.clear(); D_AddDefWads(iwad_filename); // add odamex.wad & IWAD // check if the wad files exist and if they match the MD5SUM std::string base_filename, full_filename; if (!VerifyFile(iwad_filename, base_filename, full_filename, iwad_hash)) { Printf(PRINT_HIGH, "could not find WAD: %s\n", base_filename.c_str()); missingfiles.push_back(base_filename); if (hashcheck) missinghashes.push_back(iwad_hash); } for (i = 0; i < newwadfiles.size(); i++) { std::string hash = hashcheck ? newwadhashes[i] : ""; // already added the IWAD with D_AddDefWads if (W_IsIWAD(newwadfiles[i])) continue; if (VerifyFile(newwadfiles[i], base_filename, full_filename, hash)) wadfiles.push_back(full_filename); else { Printf(PRINT_HIGH, "could not find WAD: %s\n", base_filename.c_str()); missingfiles.push_back(base_filename); if (hashcheck) missinghashes.push_back(newwadhashes[i]); } } modifiedgame = (wadfiles.size() > 2) || !patchfiles.empty(); // more than odamex.wad and IWAD? if (modifiedgame && (gameinfo.flags & GI_SHAREWARE)) I_Error("\nYou cannot load additional WADs with the shareware version. Register!"); wadhashes = W_InitMultipleFiles (wadfiles); // get skill / episode / map from parms strcpy(startmap, (gameinfo.flags & GI_MAPxx) ? "MAP01" : "E1M1"); UndoDehPatch(); patchfiles.clear(); // [RH] Initialize localizable strings. GStrings.ResetStrings (); GStrings.Compact (); D_DoDefDehackedPatch(newpatchfiles); D_NewWadInit(); // preserve state lastWadRebootSuccess = missingfiles.empty(); gamestate = oldgamestate; // GS_STARTUP would prevent netcode connecting properly return missingfiles.empty(); }
// // P_PlayerInSpecialSector // Called every tic frame // that the player origin is in a special sector // void P_PlayerInSpecialSector (player_t* player) { sector_t* sector; extern int showMessages; player2_t *player2 = p2fromp(player); static sector_t* error; sector = player->mo->subsector->sector; // Falling, not all the way down yet? if (player->mo->z != sector->floorheight) return; // Has hitten ground. switch (sector->special) { case 5: // HELLSLIME DAMAGE if (!player->powers[pw_ironfeet]) if (!(leveltime&0x1f)) P_DamageMobj (player->mo, NULL, NULL, 10); break; case 7: // NUKAGE DAMAGE if (!player->powers[pw_ironfeet]) if (!(leveltime&0x1f)) P_DamageMobj (player->mo, NULL, NULL, 5); break; case 16: // SUPER HELLSLIME DAMAGE case 4: // STROBE HURT if (!player->powers[pw_ironfeet] || (P_Random()<5) ) { if (!(leveltime&0x1f)) P_DamageMobj (player->mo, NULL, NULL, 20); } break; case 9: // SECRET SECTOR // [crispy] show centered "Secret Revealed!" message if (showMessages && crispy_secretmessage) { player2->centermessage = HUSTR_SECRETFOUND; if (player == &players[consoleplayer]) S_StartSound(NULL, sfx_itmbk); } player->secretcount++; sector->special = 0; break; case 11: // EXIT SUPER DAMAGE! (for E1M8 finale) player->cheats &= ~CF_GODMODE; if (!(leveltime&0x1f)) P_DamageMobj (player->mo, NULL, NULL, 20); if (player->health <= 10) G_ExitLevel(); break; default: // [crispy] ignore unknown special sectors if (error != sector) { error = sector; printf ("P_PlayerInSpecialSector: " "unknown special %i\n", sector->special); } break; }; }
void P_UpdateSpecials (void) { anim_t* anim; int pic; int i; line_t* line; // LEVEL TIMER if (levelTimer == true) { levelTimeCount--; if (!levelTimeCount) G_ExitLevel(); } // ANIMATE FLATS AND TEXTURES GLOBALLY for (anim = anims ; anim < lastanim ; anim++) { for (i=anim->basepic ; i<anim->basepic+anim->numpics ; i++) { pic = anim->basepic + ( (leveltime/anim->speed + i)%anim->numpics ); if (anim->istexture) texturetranslation[i] = pic; else flattranslation[i] = pic; } } // ANIMATE LINE SPECIALS for (i = 0; i < numlinespecials; i++) { line = linespeciallist[i]; switch(line->special) { case 48: // EFFECT FIRSTCOL SCROLL + sides[line->sidenum[0]].textureoffset += FRACUNIT; break; } } // DO BUTTONS for (i = 0; i < MAXBUTTONS; i++) if (buttonlist[i].btimer) { buttonlist[i].btimer--; if (!buttonlist[i].btimer) { switch(buttonlist[i].where) { case top: sides[buttonlist[i].line->sidenum[0]].toptexture = buttonlist[i].btexture; break; case middle: sides[buttonlist[i].line->sidenum[0]].midtexture = buttonlist[i].btexture; break; case bottom: sides[buttonlist[i].line->sidenum[0]].bottomtexture = buttonlist[i].btexture; break; } S_StartSound(&buttonlist[i].soundorg,sfx_swtchn); memset(&buttonlist[i],0,sizeof(button_t)); } } }
void P_UpdateSpecials (void) { anim_t2* anim; int pic; int i; line_t* line; // LEVEL TIMER if (::g->levelTimer == true) { ::g->levelTimeCount--; if (!::g->levelTimeCount) G_ExitLevel(); } // DHM - Nerve :: FRAG COUNT if ( ::g->deathmatch && ::g->levelFragCount > 0 ) { bool fragCountHit = false; for ( int i=0; i<MAXPLAYERS; i++ ) { if ( ::g->playeringame[i] ) { if ( PlayerFrags(i) >= ::g->levelFragCount ) { fragCountHit = true; } } } if ( fragCountHit ) { G_ExitLevel(); } } // ANIMATE FLATS AND TEXTURES GLOBALLY for (anim = ::g->anims ; anim < ::g->lastanim ; anim++) { for (i=anim->basepic ; i<anim->basepic+anim->numpics ; i++) { pic = anim->basepic + ( (::g->leveltime/anim->speed + i)%anim->numpics ); if (anim->istexture) ::g->texturetranslation[i] = pic; else ::g->flattranslation[i] = pic; } } // ANIMATE LINE SPECIALS for (i = 0; i < ::g->numlinespecials; i++) { line = ::g->linespeciallist[i]; switch(line->special) { case 48: // EFFECT FIRSTCOL SCROLL + ::g->sides[line->sidenum[0]].textureoffset += FRACUNIT; break; } } // DO BUTTONS for (i = 0; i < MAXBUTTONS; i++) if (::g->buttonlist[i].btimer) { ::g->buttonlist[i].btimer--; if (!::g->buttonlist[i].btimer) { switch(::g->buttonlist[i].where) { case top: ::g->sides[::g->buttonlist[i].line->sidenum[0]].toptexture = ::g->buttonlist[i].btexture; break; case middle: ::g->sides[::g->buttonlist[i].line->sidenum[0]].midtexture = ::g->buttonlist[i].btexture; break; case bottom: ::g->sides[::g->buttonlist[i].line->sidenum[0]].bottomtexture = ::g->buttonlist[i].btexture; break; } S_StartSound((mobj_t *)&::g->buttonlist[i].soundorg,sfx_swtchn); memset(&::g->buttonlist[i],0,sizeof(button_t)); } } }
std::vector<size_t> D_DoomWadReboot( const std::vector<std::string> &wadnames, const std::vector<std::string> &patch_files, std::vector<std::string> needhashes ) { std::vector<size_t> fails; size_t i; // already loaded these? if (lastWadRebootSuccess && !wadhashes.empty() && needhashes == std::vector<std::string>(wadhashes.begin()+1, wadhashes.end())) { // fast track if files have not been changed // denis - todo - actually check the file timestamps Printf (PRINT_HIGH, "Currently loaded WADs match server checksum\n\n"); return std::vector<size_t>(); } // assume failure lastWadRebootSuccess = false; if (modifiedgame && (gameinfo.flags & GI_SHAREWARE)) I_Error ("\nYou cannot switch WAD with the shareware version. Register!"); if(gamestate == GS_LEVEL) G_ExitLevel(0, 0); AM_Stop(); S_Stop(); DThinker::DestroyAllThinkers(); // Close all open WAD files W_Close(); // [ML] 9/11/10: Reset custom wad level information from MAPINFO et al. // I have never used memset, I hope I am not invoking satan by doing this :( if (wadlevelinfos) { for (i = 0; i < numwadlevelinfos; i++) if (wadlevelinfos[i].snapshot) { delete wadlevelinfos[i].snapshot; wadlevelinfos[i].snapshot = NULL; } memset(wadlevelinfos,0,sizeof(wadlevelinfos)); numwadlevelinfos = 0; } if (wadclusterinfos) { memset(wadclusterinfos,0,sizeof(wadclusterinfos)); numwadclusterinfos = 0; } // Restart the memory manager Z_Init(); gamestate_t oldgamestate = gamestate; gamestate = GS_STARTUP; // prevent console from trying to use nonexistant font wadfiles.clear(); modifiedgame = false; std::string custwad; if(wadnames.empty() == false) custwad = wadnames[0]; D_AddDefWads(custwad); for(i = 0; i < wadnames.size(); i++) { std::string tmp = wadnames[i]; // strip absolute paths, as they present a security risk FixPathSeparator(tmp); size_t slash = tmp.find_last_of(PATHSEPCHAR); if(slash != std::string::npos) tmp = tmp.substr(slash + 1, tmp.length() - slash); // [Russell] - Generate a hash if it doesn't exist already if (needhashes[i].empty()) needhashes[i] = W_MD5(tmp); std::string file = BaseFileSearch(tmp, ".wad", needhashes[i]); if(file.length()) wadfiles.push_back(file); else { Printf (PRINT_HIGH, "could not find WAD: %s\n", tmp.c_str()); fails.push_back(i); } } if(wadnames.size() > 1) modifiedgame = true; wadhashes = W_InitMultipleFiles (wadfiles); UndoDehPatch(); // [RH] Initialize localizable strings. GStrings.ResetStrings (); GStrings.Compact (); D_DoDefDehackedPatch(patch_files); //gotconback = false; //C_InitConsole(DisplayWidth, DisplayHeight, true); HU_Init (); if(!(DefaultPalette = InitPalettes("PLAYPAL"))) I_Error("Could not reinitialize palette"); V_InitPalette(); G_SetLevelStrings (); G_ParseMapInfo (); G_ParseMusInfo (); S_ParseSndInfo(); M_Init(); R_Init(); P_InitEffects(); // [ML] Do this here so we don't have to put particle crap in server P_Init(); S_Init (snd_sfxvolume, snd_musicvolume); ST_Init(); // preserve state lastWadRebootSuccess = fails.empty(); gamestate = oldgamestate; // GS_STARTUP would prevent netcode connecting properly return fails; }