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((mobj_t *)&buttonlist[i].soundorg,sfx_swtchn); memset(&buttonlist[i],0,sizeof(button_t)); } } }
//========================================================================== // // ST_NetDone - net progress complete // //========================================================================== void ST_NetDone(void) { S_StartSound(NULL, SFX_PICKUP_WEAPON); }
// // EV_DoPlat // // Do Platforms "amount" is only used for SOME platforms. // int EV_DoPlat(line_t* line, plattype_e type, int amount) { plat_t* plat; int secnum; int rtn; sector_t* sec; secnum = -1; rtn = 0; // Activate all <type> plats that are in_stasis switch(type) { case perpetualRaise: P_ActivateInStasis(line->tag); break; default: break; } while((secnum = P_FindSectorFromLineTag(line,secnum)) >= 0) { sec = §ors[secnum]; if (sec->specialdata) continue; // Find lowest & highest floors around sector rtn = 1; plat = Z_Malloc( sizeof(*plat), PU_LEVSPEC, 0); P_AddThinker(&plat->thinker); plat->type = type; plat->sector = sec; plat->sector->specialdata = plat; plat->thinker.function.acp1 = (actionf_p1) T_PlatRaise; plat->crush = false; plat->tag = line->tag; // haleyjd 20141001 [SVE]: protect against uninitialized plat->low // causing bounced plats that descend forever plat->low = sec->floorheight; switch(type) { case raiseToNearestAndChange: plat->speed = PLATSPEED/2; sec->floorpic = sides[line->sidenum[0]].sector->floorpic; plat->high = P_FindNextHighestFloor(sec,sec->floorheight); plat->wait = 0; plat->status = up; // NO MORE DAMAGE, IF APPLICABLE sec->special = 0; S_StartSound(&sec->soundorg, sfx_stnmov); break; case raiseAndChange: plat->speed = PLATSPEED/2; sec->floorpic = sides[line->sidenum[0]].sector->floorpic; plat->high = sec->floorheight + amount * FRACUNIT; plat->wait = 0; plat->status = up; S_StartSound(&sec->soundorg, sfx_stnmov); break; // villsa [STRIFE] case upWaitDownStay: plat->speed = PLATSPEED * 4; plat->high = P_FindNextHighestFloor(sec, sec->floorheight); plat->low = sec->floorheight; plat->wait = TICRATE * PLATWAIT; plat->status = up; S_StartSound(&sec->soundorg, sfx_pstart); break; case downWaitUpStay: plat->speed = PLATSPEED * 4; plat->low = P_FindLowestFloorSurrounding(sec); if(plat->low > sec->floorheight) plat->low = sec->floorheight; plat->high = sec->floorheight; plat->wait = TICRATE * PLATWAIT; plat->status = down; S_StartSound(&sec->soundorg, sfx_pstart); break; // villsa [STRIFE] case slowDWUS: plat->speed = PLATSPEED; plat->low = P_FindLowestFloorSurrounding(sec); if(plat->low > sec->floorheight) plat->low = sec->floorheight; plat->high = sec->floorheight; plat->wait = TICRATE * (PLATWAIT * 10); plat->status = down; S_StartSound(&sec->soundorg,sfx_pstart); break; case blazeDWUS: plat->speed = PLATSPEED * 8; plat->low = P_FindLowestFloorSurrounding(sec); if(plat->low > sec->floorheight) plat->low = sec->floorheight; plat->high = sec->floorheight; plat->wait = TICRATE * PLATWAIT; plat->status = down; S_StartSound(&sec->soundorg, sfx_pstart); break; case perpetualRaise: plat->speed = PLATSPEED; plat->low = P_FindLowestFloorSurrounding(sec); if(plat->low > sec->floorheight) plat->low = sec->floorheight; plat->high = P_FindHighestFloorSurrounding(sec); if(plat->high < sec->floorheight) plat->high = sec->floorheight; plat->wait = TICRATE * PLATWAIT; plat->status = P_Random() & 1; S_StartSound(&sec->soundorg, sfx_pstart); break; } P_AddActivePlat(plat); } return rtn; }
void IN_Ticker(void) { if (!intermission) { return; } if (interstate == 3) { IN_WaitStop(); return; } IN_CheckForSkip(); intertime++; if (oldintertime < intertime) { interstate++; if (gameepisode > 3 && interstate >= 1) { // Extended Wad levels: skip directly to the next level interstate = 3; } switch (interstate) { case 0: oldintertime = intertime + 300; if (gameepisode > 3) { oldintertime = intertime + 1200; } break; case 1: oldintertime = intertime + 200; break; case 2: oldintertime = INT_MAX; break; case 3: cnt = 10; break; default: break; } } if (skipintermission) { if (interstate == 0 && intertime < 150) { intertime = 150; skipintermission = false; return; } else if (interstate < 2 && gameepisode < 4) { interstate = 2; skipintermission = false; S_StartSound(NULL, sfx_dorcls); return; } interstate = 3; cnt = 10; skipintermission = false; S_StartSound(NULL, sfx_dorcls); } }
void IN_DrawDMStats(void) { int i; int j; int ypos; int xpos; int kpos; static int sounds; xpos = 90; ypos = 55; IN_DrTextB(DEH_String("TOTAL"), 265, 30); MN_DrTextA(DEH_String("VICTIMS"), 140, 8); for (i = 0; i < 7; i++) { MN_DrTextA(DEH_String(KillersText[i]), 10, 80 + 9 * i); } if (intertime < 20) { for (i = 0; i < MAXPLAYERS; i++) { if (playeringame[i]) { V_DrawShadowedPatch(40, ((ypos << FRACBITS) + dSlideY[i] * intertime) >> FRACBITS, W_CacheLumpNum(patchFaceOkayBase + i, PU_CACHE)); V_DrawShadowedPatch(((xpos << FRACBITS) + dSlideX[i] * intertime) >> FRACBITS, 18, W_CacheLumpNum(patchFaceDeadBase + i, PU_CACHE)); } } sounds = 0; return; } if (intertime >= 20 && sounds < 1) { S_StartSound(NULL, sfx_dorcls); sounds++; } if (intertime >= 100 && slaughterboy && sounds < 2) { S_StartSound(NULL, sfx_wpnup); sounds++; } for (i = 0; i < MAXPLAYERS; i++) { if (playeringame[i]) { if (intertime < 100 || i == consoleplayer) { V_DrawShadowedPatch(40, ypos, W_CacheLumpNum(patchFaceOkayBase + i, PU_CACHE)); V_DrawShadowedPatch(xpos, 18, W_CacheLumpNum(patchFaceDeadBase + i, PU_CACHE)); } else { V_DrawTLPatch(40, ypos, W_CacheLumpNum(patchFaceOkayBase + i, PU_CACHE)); V_DrawTLPatch(xpos, 18, W_CacheLumpNum(patchFaceDeadBase + i, PU_CACHE)); } kpos = 86; for (j = 0; j < MAXPLAYERS; j++) { if (playeringame[j]) { IN_DrawNumber(players[i].frags[j], kpos, ypos + 10, 3); kpos += 43; } } if (slaughterboy & (1 << i)) { if (!(intertime & 16)) { IN_DrawNumber(totalFrags[i], 263, ypos + 10, 3); } } else { IN_DrawNumber(totalFrags[i], 263, ypos + 10, 3); } ypos += 36; xpos += 43; } } }
void A_LoadShotgun2(player_t* player, pspdef_t* psp) { S_StartSound(player->mo, sfx_sht2load1); }
/** * @brief The cgame module is making a system call * @param[in] args * @return */ intptr_t CL_CgameSystemCalls(intptr_t *args) { switch (args[0]) { case CG_PRINT: Com_Printf("%s", (char *)VMA(1)); return 0; case CG_ERROR: Com_Error(ERR_DROP, "%s", (char *)VMA(1)); case CG_MILLISECONDS: return Sys_Milliseconds(); case CG_CVAR_REGISTER: Cvar_Register(VMA(1), VMA(2), VMA(3), args[4]); return 0; case CG_CVAR_UPDATE: Cvar_Update(VMA(1)); return 0; case CG_CVAR_SET: Cvar_SetSafe(VMA(1), VMA(2)); return 0; case CG_CVAR_VARIABLESTRINGBUFFER: Cvar_VariableStringBuffer(VMA(1), VMA(2), args[3]); return 0; case CG_CVAR_LATCHEDVARIABLESTRINGBUFFER: Cvar_LatchedVariableStringBuffer(VMA(1), VMA(2), args[3]); return 0; case CG_ARGC: return Cmd_Argc(); case CG_ARGV: Cmd_ArgvBuffer(args[1], VMA(2), args[3]); return 0; case CG_ARGS: Cmd_ArgsBuffer(VMA(1), args[2]); return 0; case CG_FS_FOPENFILE: return FS_FOpenFileByMode(VMA(1), VMA(2), args[3]); case CG_FS_READ: FS_Read(VMA(1), args[2], args[3]); return 0; case CG_FS_WRITE: return FS_Write(VMA(1), args[2], args[3]); case CG_FS_FCLOSEFILE: FS_FCloseFile(args[1]); return 0; case CG_FS_GETFILELIST: return FS_GetFileList(VMA(1), VMA(2), VMA(3), args[4]); case CG_FS_DELETEFILE: return FS_Delete(VMA(1)); case CG_SENDCONSOLECOMMAND: Cbuf_AddText(VMA(1)); return 0; case CG_ADDCOMMAND: Cmd_AddCommand(VMA(1)); return 0; case CG_REMOVECOMMAND: Cmd_RemoveCommandSafe(VMA(1)); return 0; case CG_SENDCLIENTCOMMAND: CL_AddReliableCommand(VMA(1)); return 0; case CG_UPDATESCREEN: SCR_UpdateScreen(); return 0; case CG_CM_LOADMAP: CL_CM_LoadMap(VMA(1)); return 0; case CG_CM_NUMINLINEMODELS: return CM_NumInlineModels(); case CG_CM_INLINEMODEL: return CM_InlineModel(args[1]); case CG_CM_TEMPBOXMODEL: return CM_TempBoxModel(VMA(1), VMA(2), qfalse); case CG_CM_TEMPCAPSULEMODEL: return CM_TempBoxModel(VMA(1), VMA(2), qtrue); case CG_CM_POINTCONTENTS: return CM_PointContents(VMA(1), args[2]); case CG_CM_TRANSFORMEDPOINTCONTENTS: return CM_TransformedPointContents(VMA(1), args[2], VMA(3), VMA(4)); case CG_CM_BOXTRACE: CM_BoxTrace(VMA(1), VMA(2), VMA(3), VMA(4), VMA(5), args[6], args[7], /*int capsule*/ qfalse); return 0; case CG_CM_CAPSULETRACE: CM_BoxTrace(VMA(1), VMA(2), VMA(3), VMA(4), VMA(5), args[6], args[7], /*int capsule*/ qtrue); return 0; case CG_CM_TRANSFORMEDBOXTRACE: CM_TransformedBoxTrace(VMA(1), VMA(2), VMA(3), VMA(4), VMA(5), args[6], args[7], VMA(8), VMA(9), /*int capsule*/ qfalse); return 0; case CG_CM_TRANSFORMEDCAPSULETRACE: CM_TransformedBoxTrace(VMA(1), VMA(2), VMA(3), VMA(4), VMA(5), args[6], args[7], VMA(8), VMA(9), /*int capsule*/ qtrue); return 0; case CG_CM_MARKFRAGMENTS: return re.MarkFragments(args[1], VMA(2), VMA(3), args[4], VMA(5), args[6], VMA(7)); case CG_R_PROJECTDECAL: re.ProjectDecal(args[1], args[2], VMA(3), VMA(4), VMA(5), args[6], args[7]); return 0; case CG_R_CLEARDECALS: re.ClearDecals(); return 0; case CG_S_STARTSOUND: S_StartSound(VMA(1), args[2], args[3], args[4], args[5]); return 0; case CG_S_STARTSOUNDEX: S_StartSoundEx(VMA(1), args[2], args[3], args[4], args[5], args[6]); return 0; case CG_S_STARTLOCALSOUND: S_StartLocalSound(args[1], args[2], args[3]); return 0; case CG_S_CLEARLOOPINGSOUNDS: S_ClearLoopingSounds(); return 0; case CG_S_CLEARSOUNDS: if (args[1] == 0) { S_ClearSounds(qtrue, qfalse); } else if (args[1] == 1) { S_ClearSounds(qtrue, qtrue); } return 0; case CG_S_ADDLOOPINGSOUND: // FIXME handling of looping sounds changed S_AddLoopingSound(VMA(1), VMA(2), args[3], args[4], args[5], args[6]); return 0; case CG_S_ADDREALLOOPINGSOUND: S_AddRealLoopingSound(VMA(1), VMA(2), args[3], args[4], args[5], args[6]); return 0; case CG_S_STOPSTREAMINGSOUND: S_StopEntStreamingSound(args[1]); return 0; case CG_S_UPDATEENTITYPOSITION: S_UpdateEntityPosition(args[1], VMA(2)); return 0; // talking animations case CG_S_GETVOICEAMPLITUDE: return S_GetVoiceAmplitude(args[1]); case CG_S_GETSOUNDLENGTH: return S_GetSoundLength(args[1]); // for looped sound starts case CG_S_GETCURRENTSOUNDTIME: return S_GetCurrentSoundTime(); case CG_S_RESPATIALIZE: S_Respatialize(args[1], VMA(2), VMA(3), args[4]); return 0; case CG_S_REGISTERSOUND: return S_RegisterSound(VMA(1), args[2]); case CG_S_STARTBACKGROUNDTRACK: S_StartBackgroundTrack(VMA(1), VMA(2), args[3]); // added fadeup time return 0; case CG_S_FADESTREAMINGSOUND: S_FadeStreamingSound(VMF(1), args[2], args[3]); // added music/all-streaming options return 0; case CG_S_STARTSTREAMINGSOUND: return S_StartStreamingSound(VMA(1), VMA(2), args[3], args[4], args[5]); case CG_R_LOADWORLDMAP: re.LoadWorld(VMA(1)); return 0; case CG_R_REGISTERMODEL: return re.RegisterModel(VMA(1)); case CG_R_REGISTERSKIN: return re.RegisterSkin(VMA(1)); case CG_R_GETSKINMODEL: return re.GetSkinModel(args[1], VMA(2), VMA(3)); case CG_R_GETMODELSHADER: return re.GetShaderFromModel(args[1], args[2], args[3]); case CG_R_REGISTERSHADER: return re.RegisterShader(VMA(1)); case CG_R_REGISTERSHADERNOMIP: return re.RegisterShaderNoMip(VMA(1)); case CG_R_REGISTERFONT: re.RegisterFont(VMA(1), args[2], VMA(3), (args[4] == qtrue)); return 0; case CG_R_CLEARSCENE: re.ClearScene(); return 0; case CG_R_ADDREFENTITYTOSCENE: re.AddRefEntityToScene(VMA(1)); return 0; case CG_R_ADDPOLYTOSCENE: re.AddPolyToScene(args[1], args[2], VMA(3)); return 0; case CG_R_ADDPOLYSTOSCENE: re.AddPolysToScene(args[1], args[2], VMA(3), args[4]); return 0; case CG_R_ADDPOLYBUFFERTOSCENE: re.AddPolyBufferToScene(VMA(1)); return 0; case CG_R_ADDLIGHTTOSCENE: re.AddLightToScene(VMA(1), VMF(2), VMF(3), VMF(4), VMF(5), VMF(6), args[7], args[8]); return 0; case CG_R_ADDCORONATOSCENE: re.AddCoronaToScene(VMA(1), VMF(2), VMF(3), VMF(4), VMF(5), args[6], args[7]); return 0; case CG_R_SETFOG: re.SetFog(args[1], args[2], args[3], VMF(4), VMF(5), VMF(6), VMF(7)); return 0; case CG_R_SETGLOBALFOG: re.SetGlobalFog(args[1], args[2], VMF(3), VMF(4), VMF(5), VMF(6)); return 0; case CG_R_RENDERSCENE: re.RenderScene(VMA(1)); return 0; case CG_R_SAVEVIEWPARMS: return 0; case CG_R_RESTOREVIEWPARMS: return 0; case CG_R_SETCOLOR: re.SetColor(VMA(1)); return 0; case CG_R_DRAWSTRETCHPIC: re.DrawStretchPic(VMF(1), VMF(2), VMF(3), VMF(4), VMF(5), VMF(6), VMF(7), VMF(8), args[9]); return 0; case CG_R_DRAWROTATEDPIC: re.DrawRotatedPic(VMF(1), VMF(2), VMF(3), VMF(4), VMF(5), VMF(6), VMF(7), VMF(8), args[9], VMF(10)); return 0; case CG_R_DRAWSTRETCHPIC_GRADIENT: re.DrawStretchPicGradient(VMF(1), VMF(2), VMF(3), VMF(4), VMF(5), VMF(6), VMF(7), VMF(8), args[9], VMA(10), args[11]); return 0; case CG_R_DRAW2DPOLYS: re.Add2dPolys(VMA(1), args[2], args[3]); return 0; case CG_R_MODELBOUNDS: re.ModelBounds(args[1], VMA(2), VMA(3)); return 0; case CG_R_LERPTAG: return re.LerpTag(VMA(1), VMA(2), VMA(3), args[4]); case CG_GETGLCONFIG: CL_GetGlconfig(VMA(1)); return 0; case CG_GETGAMESTATE: CL_GetGameState(VMA(1)); return 0; case CG_GETCURRENTSNAPSHOTNUMBER: CL_GetCurrentSnapshotNumber(VMA(1), VMA(2)); return 0; case CG_GETSNAPSHOT: return CL_GetSnapshot(args[1], VMA(2)); case CG_GETSERVERCOMMAND: return CL_GetServerCommand(args[1]); case CG_GETCURRENTCMDNUMBER: return CL_GetCurrentCmdNumber(); case CG_GETUSERCMD: return CL_GetUserCmd(args[1], VMA(2)); case CG_SETUSERCMDVALUE: CL_SetUserCmdValue(args[1], args[2], VMF(3), args[4]); return 0; case CG_SETCLIENTLERPORIGIN: CL_SetClientLerpOrigin(VMF(1), VMF(2), VMF(3)); return 0; case CG_MEMORY_REMAINING: return Hunk_MemoryRemaining(); case CG_KEY_ISDOWN: return Key_IsDown(args[1]); case CG_KEY_GETCATCHER: return Key_GetCatcher(); case CG_KEY_SETCATCHER: // Don't allow the cgame module to close the console Key_SetCatcher(args[1] | (Key_GetCatcher() & KEYCATCH_CONSOLE)); return 0; case CG_KEY_GETKEY: return Key_GetKey(VMA(1)); case CG_KEY_GETOVERSTRIKEMODE: return Key_GetOverstrikeMode(); case CG_KEY_SETOVERSTRIKEMODE: Key_SetOverstrikeMode(args[1]); return 0; case CG_MEMSET: return (intptr_t)Com_Memset(VMA(1), args[2], args[3]); case CG_MEMCPY: return (intptr_t)Com_Memcpy(VMA(1), VMA(2), args[3]); case CG_STRNCPY: return (intptr_t)strncpy(VMA(1), VMA(2), args[3]); case CG_SIN: return FloatAsInt(sin(VMF(1))); case CG_COS: return FloatAsInt(cos(VMF(1))); case CG_ATAN2: return FloatAsInt(atan2(VMF(1), VMF(2))); case CG_SQRT: return FloatAsInt(sqrt(VMF(1))); case CG_FLOOR: return FloatAsInt(floor(VMF(1))); case CG_CEIL: return FloatAsInt(ceil(VMF(1))); case CG_ACOS: return FloatAsInt(Q_acos(VMF(1))); case CG_PC_ADD_GLOBAL_DEFINE: return botlib_export->PC_AddGlobalDefine(VMA(1)); case CG_PC_LOAD_SOURCE: return botlib_export->PC_LoadSourceHandle(VMA(1)); case CG_PC_FREE_SOURCE: return botlib_export->PC_FreeSourceHandle(args[1]); case CG_PC_READ_TOKEN: return botlib_export->PC_ReadTokenHandle(args[1], VMA(2)); case CG_PC_SOURCE_FILE_AND_LINE: return botlib_export->PC_SourceFileAndLine(args[1], VMA(2), VMA(3)); case CG_PC_UNREAD_TOKEN: botlib_export->PC_UnreadLastTokenHandle(args[1]); return 0; case CG_S_STOPBACKGROUNDTRACK: S_StopBackgroundTrack(); return 0; case CG_REAL_TIME: return Com_RealTime(VMA(1)); case CG_SNAPVECTOR: Sys_SnapVector(VMA(1)); return 0; case CG_CIN_PLAYCINEMATIC: return CIN_PlayCinematic(VMA(1), args[2], args[3], args[4], args[5], args[6]); case CG_CIN_STOPCINEMATIC: return CIN_StopCinematic(args[1]); case CG_CIN_RUNCINEMATIC: return CIN_RunCinematic(args[1]); case CG_CIN_DRAWCINEMATIC: CIN_DrawCinematic(args[1]); return 0; case CG_CIN_SETEXTENTS: CIN_SetExtents(args[1], args[2], args[3], args[4], args[5]); return 0; case CG_R_REMAP_SHADER: re.RemapShader(VMA(1), VMA(2), VMA(3)); return 0; case CG_TESTPRINTINT: Com_Printf("%s%li\n", (char *)VMA(1), (long)args[2]); return 0; case CG_TESTPRINTFLOAT: Com_Printf("%s%f\n", (char *)VMA(1), VMF(2)); return 0; case CG_GET_ENTITY_TOKEN: return re.GetEntityToken(VMA(1), args[2]); case CG_INGAME_POPUP: if (cls.state == CA_ACTIVE && !clc.demoplaying) { if (uivm) // can be called as the system is shutting down { VM_Call(uivm, UI_SET_ACTIVE_MENU, args[1]); } } return 0; case CG_KEY_GETBINDINGBUF: Key_GetBindingBuf(args[1], VMA(2), args[3]); return 0; case CG_KEY_SETBINDING: Key_SetBinding(args[1], VMA(2)); return 0; case CG_KEY_KEYNUMTOSTRINGBUF: Key_KeynumToStringBuf(args[1], VMA(2), args[3]); return 0; case CG_KEY_BINDINGTOKEYS: Key_GetBindingByString(VMA(1), VMA(2), VMA(3)); return 0; case CG_TRANSLATE_STRING: CL_TranslateStringMod(VMA(1), VMA(2)); return 0; case CG_S_FADEALLSOUNDS: S_FadeAllSounds(VMF(1), args[2], args[3]); return 0; case CG_R_INPVS: return re.inPVS(VMA(1), VMA(2)); case CG_GETHUNKDATA: Com_GetHunkInfo(VMA(1), VMA(2)); return 0; // binary channel case CG_SENDMESSAGE: return CL_SendBinaryMessage(VMA(1), args[2]); case CG_MESSAGESTATUS: return CL_BinaryMessageStatus(); case CG_R_LOADDYNAMICSHADER: return re.LoadDynamicShader(VMA(1), VMA(2)); case CG_R_RENDERTOTEXTURE: re.RenderToTexture(args[1], args[2], args[3], args[4], args[5]); return 0; case CG_R_GETTEXTUREID: return re.GetTextureId(VMA(1)); // flush gl rendering buffers case CG_R_FINISH: re.Finish(); return 0; case CG_LOADCAMERA: case CG_STARTCAMERA: case CG_STOPCAMERA: case CG_GETCAMERAINFO: case CG_PUMPEVENTLOOP: case CG_INGAME_CLOSEPOPUP: case CG_R_LIGHTFORPOINT: // re-added to avoid a crash when called - still in enum of cgameImport_t // This shows (developer 1) when the vanilla mod code is loaded or mods using obsolete system calls - see cases. Com_DPrintf("Obsolete cgame system trap: %ld\n", (long int) args[0]); return 0; default: Com_Error(ERR_DROP, "Bad cgame system trap: %ld", (long int) args[0]); break; } return 0; }
// // A_BabyMetal // // Arachnotron chase w/sound. // void A_BabyMetal(actionargs_t *actionargs) { S_StartSound(actionargs->actor, sfx_bspwlk); A_Chase(actionargs); }
// // A_Hoof // // Cyberdemon chase pointer 1 with hoof sound. // void A_Hoof(actionargs_t *actionargs) { S_StartSound(actionargs->actor, sfx_hoof); A_Chase(actionargs); }
void WI_updateStats(void) { WI_updateAnimatedBack(); if (acceleratestage && sp_state != 10) { acceleratestage = 0; cnt_kills[0] = (plrs[me].skills * 100) / wbs->maxkills; cnt_items[0] = (plrs[me].sitems * 100) / wbs->maxitems; cnt_secret[0] = (plrs[me].ssecret * 100) / wbs->maxsecret; cnt_time = plrs[me].stime / TICRATE; cnt_par = wbs->partime / TICRATE; S_StartSound(0, sfx_barexp); sp_state = 10; } if (sp_state == 2) { cnt_kills[0] += 2; if (!(bcnt&3)) S_StartSound(0, sfx_pistol); if (cnt_kills[0] >= (plrs[me].skills * 100) / wbs->maxkills) { cnt_kills[0] = (plrs[me].skills * 100) / wbs->maxkills; S_StartSound(0, sfx_barexp); sp_state++; } } else if (sp_state == 4) { cnt_items[0] += 2; if (!(bcnt&3)) S_StartSound(0, sfx_pistol); if (cnt_items[0] >= (plrs[me].sitems * 100) / wbs->maxitems) { cnt_items[0] = (plrs[me].sitems * 100) / wbs->maxitems; S_StartSound(0, sfx_barexp); sp_state++; } } else if (sp_state == 6) { cnt_secret[0] += 2; if (!(bcnt&3)) S_StartSound(0, sfx_pistol); if (cnt_secret[0] >= (plrs[me].ssecret * 100) / wbs->maxsecret) { cnt_secret[0] = (plrs[me].ssecret * 100) / wbs->maxsecret; S_StartSound(0, sfx_barexp); sp_state++; } } else if (sp_state == 8) { if (!(bcnt&3)) S_StartSound(0, sfx_pistol); cnt_time += 3; if (cnt_time >= plrs[me].stime / TICRATE) cnt_time = plrs[me].stime / TICRATE; cnt_par += 3; if (cnt_par >= wbs->partime / TICRATE) { cnt_par = wbs->partime / TICRATE; if (cnt_time >= plrs[me].stime / TICRATE) { S_StartSound(0, sfx_barexp); sp_state++; } } } else if (sp_state == 10) { if (acceleratestage) { S_StartSound(0, sfx_sgcock); if (gamemode == commercial) WI_initNoState(); else WI_initShowNextLoc(); } } else if (sp_state & 1) { if (!--cnt_pause) { sp_state++; cnt_pause = TICRATE; } } }
void WI_updateDeathmatchStats(void) { int i; int j; boolean stillticking; WI_updateAnimatedBack(); if (acceleratestage && dm_state != 4) { acceleratestage = 0; for (i=0 ; i<MAXPLAYERS ; i++) { if (playeringame[i]) { for (j=0 ; j<MAXPLAYERS ; j++) if (playeringame[j]) dm_frags[i][j] = plrs[i].frags[j]; dm_totals[i] = WI_fragSum(i); } } S_StartSound(0, sfx_barexp); dm_state = 4; } if (dm_state == 2) { if (!(bcnt&3)) S_StartSound(0, sfx_pistol); stillticking = false; for (i=0 ; i<MAXPLAYERS ; i++) { if (playeringame[i]) { for (j=0 ; j<MAXPLAYERS ; j++) { if (playeringame[j] && dm_frags[i][j] != plrs[i].frags[j]) { if (plrs[i].frags[j] < 0) dm_frags[i][j]--; else dm_frags[i][j]++; if (dm_frags[i][j] > 99) dm_frags[i][j] = 99; if (dm_frags[i][j] < -99) dm_frags[i][j] = -99; stillticking = true; } } dm_totals[i] = WI_fragSum(i); if (dm_totals[i] > 99) dm_totals[i] = 99; if (dm_totals[i] < -99) dm_totals[i] = -99; } } if (!stillticking) { S_StartSound(0, sfx_barexp); dm_state++; } } else if (dm_state == 4) { if (acceleratestage) { S_StartSound(0, sfx_slop); if ( gamemode == commercial) WI_initNoState(); else WI_initShowNextLoc(); } } else if (dm_state & 1) { if (!--cnt_pause) { dm_state++; cnt_pause = TICRATE; } } }
void WI_updateNetgameStats(void) { int i; int fsum; boolean stillticking; WI_updateAnimatedBack(); if (acceleratestage && ng_state != 10) { acceleratestage = 0; for (i=0 ; i<MAXPLAYERS ; i++) { if (!playeringame[i]) continue; cnt_kills[i] = (plrs[i].skills * 100) / wbs->maxkills; cnt_items[i] = (plrs[i].sitems * 100) / wbs->maxitems; cnt_secret[i] = (plrs[i].ssecret * 100) / wbs->maxsecret; if (dofrags) cnt_frags[i] = WI_fragSum(i); } S_StartSound(0, sfx_barexp); ng_state = 10; } if (ng_state == 2) { if (!(bcnt&3)) S_StartSound(0, sfx_pistol); stillticking = false; for (i=0 ; i<MAXPLAYERS ; i++) { if (!playeringame[i]) continue; cnt_kills[i] += 2; if (cnt_kills[i] >= (plrs[i].skills * 100) / wbs->maxkills) cnt_kills[i] = (plrs[i].skills * 100) / wbs->maxkills; else stillticking = true; } if (!stillticking) { S_StartSound(0, sfx_barexp); ng_state++; } } else if (ng_state == 4) { if (!(bcnt&3)) S_StartSound(0, sfx_pistol); stillticking = false; for (i=0 ; i<MAXPLAYERS ; i++) { if (!playeringame[i]) continue; cnt_items[i] += 2; if (cnt_items[i] >= (plrs[i].sitems * 100) / wbs->maxitems) cnt_items[i] = (plrs[i].sitems * 100) / wbs->maxitems; else stillticking = true; } if (!stillticking) { S_StartSound(0, sfx_barexp); ng_state++; } } else if (ng_state == 6) { if (!(bcnt&3)) S_StartSound(0, sfx_pistol); stillticking = false; for (i=0 ; i<MAXPLAYERS ; i++) { if (!playeringame[i]) continue; cnt_secret[i] += 2; if (cnt_secret[i] >= (plrs[i].ssecret * 100) / wbs->maxsecret) cnt_secret[i] = (plrs[i].ssecret * 100) / wbs->maxsecret; else stillticking = true; } if (!stillticking) { S_StartSound(0, sfx_barexp); ng_state += 1 + 2*!dofrags; } } else if (ng_state == 8) { if (!(bcnt&3)) S_StartSound(0, sfx_pistol); stillticking = false; for (i=0 ; i<MAXPLAYERS ; i++) { if (!playeringame[i]) continue; cnt_frags[i] += 1; if (cnt_frags[i] >= (fsum = WI_fragSum(i))) cnt_frags[i] = fsum; else stillticking = true; } if (!stillticking) { S_StartSound(0, sfx_pldeth); ng_state++; } } else if (ng_state == 10) { if (acceleratestage) { S_StartSound(0, sfx_sgcock); if ( gamemode == commercial ) WI_initNoState(); else WI_initShowNextLoc(); } } else if (ng_state & 1) { if (!--cnt_pause) { ng_state++; cnt_pause = TICRATE; } } }
// // TELEPORTATION // dboolean EV_Teleport(line_t *line, int side, mobj_t *thing) { thinker_t *thinker; int i; // Don't teleport missiles. // Don't teleport if hit back of line, so you can get out of teleporter. if (side || (thing->flags & MF_MISSILE)) return false; // [BH] Don't teleport corpses once kill ccmd used if (thing->flags2 & MF2_MASSACRE) return false; // killough 1/31/98: improve performance by using // P_FindSectorFromLineTag instead of simple linear search. for (i = -1; (i = P_FindSectorFromLineTag(line, i)) >= 0;) for (thinker = thinkerclasscap[th_mobj].cnext; thinker != &thinkerclasscap[th_mobj]; thinker = thinker->cnext) { mobj_t *m; if ((m = (mobj_t *)thinker)->type == MT_TELEPORTMAN && m->subsector->sector - sectors == i) { fixed_t oldx = thing->x; fixed_t oldy = thing->y; fixed_t oldz = thing->z; player_t *player = thing->player; // killough 5/12/98: exclude voodoo dolls: if (player && player->mo != thing) player = NULL; if (P_TeleportMove(thing, m->x, m->y, m->z, false)) // killough 8/9/98 { mobj_t *fog; fixed_t newx = m->x; fixed_t newy = m->y; // spawn teleport fog at source fog = P_SpawnMobj(oldx, oldy, oldz, MT_TFOG); fog->angle = thing->angle; S_StartSound(fog, sfx_telept); // spawn teleport fog at destination thing->z = thing->floorz; if (player) { unsigned int an = m->angle >> ANGLETOFINESHIFT; newx += 20 * finecosine[an]; newy += 20 * finesine[an]; player->viewz = thing->z + player->viewheight; } fog = P_SpawnMobj(newx, newy, thing->z, MT_TFOG); fog->angle = m->angle; S_StartSound(fog, sfx_telept); if (player) { // [BH] teleport can be drawn on automap if (line->backsector) { int j; for (j = 0; j < line->backsector->linecount; j++) line->backsector->lines[j]->flags |= ML_TELEPORTTRIGGERED; } // don't move for a bit thing->reactiontime = 18; player->psprites[ps_weapon].sx = 0; player->psprites[ps_weapon].sy = WEAPONTOP; player->momx = player->momy = 0; } thing->angle = m->angle; thing->momx = thing->momy = thing->momz = 0; return true; } }
/* ==================== CL_CgameSystemCalls The cgame module is making a system call ==================== */ intptr_t CL_CgameSystemCalls( intptr_t *args ) { switch( args[0] ) { case CG_PRINT: Com_Printf( "%s", VMA(1) ); return 0; case CG_ERROR: Com_Error( ERR_DROP, "%s", VMA(1) ); return 0; case CG_MILLISECONDS: return Sys_Milliseconds(); case CG_CVAR_REGISTER: Cvar_Register( VMA(1), VMA(2), VMA(3), args[4] ); return 0; case CG_CVAR_UPDATE: Cvar_Update( VMA(1) ); return 0; case CG_CVAR_SET: Cvar_Set( VMA(1), VMA(2) ); return 0; case CG_CVAR_VARIABLESTRINGBUFFER: Cvar_VariableStringBuffer( VMA(1), VMA(2), args[3] ); return 0; case CG_ARGC: return Cmd_Argc(); case CG_ARGV: Cmd_ArgvBuffer( args[1], VMA(2), args[3] ); return 0; case CG_ARGS: Cmd_ArgsBuffer( VMA(1), args[2] ); return 0; case CG_LITERAL_ARGS: Cmd_LiteralArgsBuffer( VMA(1), args[2] ); return 0; case CG_FS_FOPENFILE: return FS_FOpenFileByMode( VMA(1), VMA(2), args[3] ); case CG_FS_READ: FS_Read2( VMA(1), args[2], args[3] ); return 0; case CG_FS_WRITE: FS_Write( VMA(1), args[2], args[3] ); return 0; case CG_FS_FCLOSEFILE: FS_FCloseFile( args[1] ); return 0; case CG_FS_SEEK: return FS_Seek( args[1], args[2], args[3] ); case CG_FS_GETFILELIST: return FS_GetFileList( VMA(1), VMA(2), VMA(3), args[4] ); case CG_SENDCONSOLECOMMAND: Cbuf_AddText( VMA(1) ); return 0; case CG_ADDCOMMAND: CL_AddCgameCommand( VMA(1) ); return 0; case CG_REMOVECOMMAND: Cmd_RemoveCommand( VMA(1) ); return 0; case CG_SENDCLIENTCOMMAND: CL_AddReliableCommand( VMA(1) ); return 0; case CG_UPDATESCREEN: // this is used during lengthy level loading, so pump message loop // Com_EventLoop(); // FIXME: if a server restarts here, BAD THINGS HAPPEN! // We can't call Com_EventLoop here, a restart will crash and this _does_ happen // if there is a map change while we are downloading at pk3. // ZOID SCR_UpdateScreen(); return 0; case CG_CM_LOADMAP: CL_CM_LoadMap( VMA(1) ); return 0; case CG_CM_NUMINLINEMODELS: return CM_NumInlineModels(); case CG_CM_INLINEMODEL: return CM_InlineModel( args[1] ); case CG_CM_TEMPBOXMODEL: return CM_TempBoxModel( VMA(1), VMA(2), /*int capsule*/ qfalse ); case CG_CM_TEMPCAPSULEMODEL: return CM_TempBoxModel( VMA(1), VMA(2), /*int capsule*/ qtrue ); case CG_CM_POINTCONTENTS: return CM_PointContents( VMA(1), args[2] ); case CG_CM_TRANSFORMEDPOINTCONTENTS: return CM_TransformedPointContents( VMA(1), args[2], VMA(3), VMA(4) ); case CG_CM_BOXTRACE: CM_BoxTrace( VMA(1), VMA(2), VMA(3), VMA(4), VMA(5), args[6], args[7], TT_AABB ); return 0; case CG_CM_CAPSULETRACE: CM_BoxTrace( VMA(1), VMA(2), VMA(3), VMA(4), VMA(5), args[6], args[7], TT_CAPSULE ); return 0; case CG_CM_TRANSFORMEDBOXTRACE: CM_TransformedBoxTrace( VMA(1), VMA(2), VMA(3), VMA(4), VMA(5), args[6], args[7], VMA(8), VMA(9), TT_AABB ); return 0; case CG_CM_TRANSFORMEDCAPSULETRACE: CM_TransformedBoxTrace( VMA(1), VMA(2), VMA(3), VMA(4), VMA(5), args[6], args[7], VMA(8), VMA(9), TT_CAPSULE ); return 0; case CG_CM_BISPHERETRACE: CM_BiSphereTrace( VMA(1), VMA(2), VMA(3), VMF(4), VMF(5), args[6], args[7] ); return 0; case CG_CM_TRANSFORMEDBISPHERETRACE: CM_TransformedBiSphereTrace( VMA(1), VMA(2), VMA(3), VMF(4), VMF(5), args[6], args[7], VMA(8) ); return 0; case CG_CM_MARKFRAGMENTS: return re.MarkFragments( args[1], VMA(2), VMA(3), args[4], VMA(5), args[6], VMA(7) ); case CG_S_STARTSOUND: S_StartSound( VMA(1), args[2], args[3], args[4] ); return 0; case CG_S_STARTLOCALSOUND: S_StartLocalSound( args[1], args[2] ); return 0; case CG_S_CLEARLOOPINGSOUNDS: S_ClearLoopingSounds(args[1]); return 0; case CG_S_ADDLOOPINGSOUND: S_AddLoopingSound( args[1], VMA(2), VMA(3), args[4] ); return 0; case CG_S_ADDREALLOOPINGSOUND: S_AddRealLoopingSound( args[1], VMA(2), VMA(3), args[4] ); return 0; case CG_S_STOPLOOPINGSOUND: S_StopLoopingSound( args[1] ); return 0; case CG_S_UPDATEENTITYPOSITION: S_UpdateEntityPosition( args[1], VMA(2) ); return 0; case CG_S_RESPATIALIZE: S_Respatialize( args[1], VMA(2), VMA(3), args[4] ); return 0; case CG_S_REGISTERSOUND: return S_RegisterSound( VMA(1), args[2] ); case CG_S_STARTBACKGROUNDTRACK: S_StartBackgroundTrack( VMA(1), VMA(2) ); return 0; case CG_R_LOADWORLDMAP: re.LoadWorld( VMA(1) ); return 0; case CG_R_REGISTERMODEL: return re.RegisterModel( VMA(1) ); case CG_R_REGISTERSKIN: return re.RegisterSkin( VMA(1) ); case CG_R_REGISTERSHADER: return re.RegisterShader( VMA(1) ); case CG_R_REGISTERSHADERNOMIP: return re.RegisterShaderNoMip( VMA(1) ); case CG_R_REGISTERFONT: re.RegisterFont( VMA(1), args[2], VMA(3)); case CG_R_CLEARSCENE: re.ClearScene(); return 0; case CG_R_ADDREFENTITYTOSCENE: re.AddRefEntityToScene( VMA(1) ); return 0; case CG_R_ADDPOLYTOSCENE: re.AddPolyToScene( args[1], args[2], VMA(3), 1 ); return 0; case CG_R_ADDPOLYSTOSCENE: re.AddPolyToScene( args[1], args[2], VMA(3), args[4] ); return 0; case CG_R_LIGHTFORPOINT: return re.LightForPoint( VMA(1), VMA(2), VMA(3), VMA(4) ); case CG_R_ADDLIGHTTOSCENE: re.AddLightToScene( VMA(1), VMF(2), VMF(3), VMF(4), VMF(5) ); return 0; case CG_R_ADDADDITIVELIGHTTOSCENE: re.AddAdditiveLightToScene( VMA(1), VMF(2), VMF(3), VMF(4), VMF(5) ); return 0; case CG_R_RENDERSCENE: re.RenderScene( VMA(1) ); return 0; case CG_R_SETCOLOR: re.SetColor( VMA(1) ); return 0; case CG_R_DRAWSTRETCHPIC: re.DrawStretchPic( VMF(1), VMF(2), VMF(3), VMF(4), VMF(5), VMF(6), VMF(7), VMF(8), args[9] ); return 0; case CG_R_MODELBOUNDS: re.ModelBounds( args[1], VMA(2), VMA(3) ); return 0; case CG_R_LERPTAG: return re.LerpTag( VMA(1), args[2], args[3], args[4], VMF(5), VMA(6) ); case CG_GETGLCONFIG: CL_GetGlconfig( VMA(1) ); return 0; case CG_GETGAMESTATE: CL_GetGameState( VMA(1) ); return 0; case CG_GETCURRENTSNAPSHOTNUMBER: CL_GetCurrentSnapshotNumber( VMA(1), VMA(2) ); return 0; case CG_GETSNAPSHOT: return CL_GetSnapshot( args[1], VMA(2) ); case CG_GETSERVERCOMMAND: return CL_GetServerCommand( args[1] ); case CG_GETCURRENTCMDNUMBER: return CL_GetCurrentCmdNumber(); case CG_GETUSERCMD: return CL_GetUserCmd( args[1], VMA(2) ); case CG_SETUSERCMDVALUE: CL_SetUserCmdValue( args[1], VMF(2) ); return 0; case CG_MEMORY_REMAINING: return Hunk_MemoryRemaining(); case CG_KEY_ISDOWN: return Key_IsDown( args[1] ); case CG_KEY_GETCATCHER: return Key_GetCatcher(); case CG_KEY_SETCATCHER: Key_SetCatcher( args[1] ); return 0; case CG_KEY_GETKEY: return Key_GetKey( VMA(1) ); case CG_GETDEMOSTATE: return CL_DemoState( ); case CG_GETDEMOPOS: return CL_DemoPos( ); case CG_GETDEMONAME: CL_DemoName( VMA(1), args[2] ); return 0; case CG_KEY_KEYNUMTOSTRINGBUF: Key_KeynumToStringBuf( args[1], VMA(2), args[3] ); return 0; case CG_KEY_GETBINDINGBUF: Key_GetBindingBuf( args[1], VMA(2), args[3] ); return 0; case CG_KEY_SETBINDING: Key_SetBinding( args[1], VMA(2) ); return 0; case CG_MEMSET: Com_Memset( VMA(1), args[2], args[3] ); return 0; case CG_MEMCPY: Com_Memcpy( VMA(1), VMA(2), args[3] ); return 0; case CG_STRNCPY: strncpy( VMA(1), VMA(2), args[3] ); return args[1]; case CG_SIN: return FloatAsInt( sin( VMF(1) ) ); case CG_COS: return FloatAsInt( cos( VMF(1) ) ); case CG_ATAN2: return FloatAsInt( atan2( VMF(1), VMF(2) ) ); case CG_SQRT: return FloatAsInt( sqrt( VMF(1) ) ); case CG_FLOOR: return FloatAsInt( floor( VMF(1) ) ); case CG_CEIL: return FloatAsInt( ceil( VMF(1) ) ); case CG_ACOS: return FloatAsInt( Q_acos( VMF(1) ) ); case CG_PC_ADD_GLOBAL_DEFINE: return botlib_export->PC_AddGlobalDefine( VMA(1) ); case CG_PC_LOAD_SOURCE: return botlib_export->PC_LoadSourceHandle( VMA(1) ); case CG_PC_FREE_SOURCE: return botlib_export->PC_FreeSourceHandle( args[1] ); case CG_PC_READ_TOKEN: return botlib_export->PC_ReadTokenHandle( args[1], VMA(2) ); case CG_PC_SOURCE_FILE_AND_LINE: return botlib_export->PC_SourceFileAndLine( args[1], VMA(2), VMA(3) ); case CG_S_STOPBACKGROUNDTRACK: S_StopBackgroundTrack(); return 0; case CG_REAL_TIME: return Com_RealTime( VMA(1) ); case CG_SNAPVECTOR: Sys_SnapVector( VMA(1) ); return 0; case CG_CIN_PLAYCINEMATIC: return CIN_PlayCinematic(VMA(1), args[2], args[3], args[4], args[5], args[6]); case CG_CIN_STOPCINEMATIC: return CIN_StopCinematic(args[1]); case CG_CIN_RUNCINEMATIC: return CIN_RunCinematic(args[1]); case CG_CIN_DRAWCINEMATIC: CIN_DrawCinematic(args[1]); return 0; case CG_CIN_SETEXTENTS: CIN_SetExtents(args[1], args[2], args[3], args[4], args[5]); return 0; case CG_R_REMAP_SHADER: re.RemapShader( VMA(1), VMA(2), VMA(3) ); return 0; /* case CG_LOADCAMERA: return loadCamera(VMA(1)); case CG_STARTCAMERA: startCamera(args[1]); return 0; case CG_GETCAMERAINFO: return getCameraInfo(args[1], VMA(2), VMA(3)); */ case CG_GET_ENTITY_TOKEN: return re.GetEntityToken( VMA(1), args[2] ); case CG_R_INPVS: return re.inPVS( VMA(1), VMA(2) ); case CG_UPDATE_YAW: CL_UpdateYaw( VMA(1) ); return 0; case CG_UPDATE_PITCH: CL_UpdatePitch( VMA(1) ); return 0; default: assert(0); // bk010102 Com_Error( ERR_DROP, "Bad cgame system trap: %i", args[0] ); } return 0; }
void A_ChainSawReady(player_t* player, pspdef_t* psp) { S_StartSound (player->mo, sfx_sawidle); A_WeaponReady(player, psp); }
// // A_Metal // // Cyberdemon chase pointer 2 with metal sound. // Also used by Spider Mastermind. // void A_Metal(actionargs_t *actionargs) { S_StartSound(actionargs->actor, sfx_metal); A_Chase(actionargs); }
void A_BFGsound(player_t* player, pspdef_t* psp) { S_StartSound(player->mo, sfx_bfg); }
// // Function that changes wall texture. // Tell it if switch is ok to use again (1=yes, it's a button). // void P_ChangeSwitchTexture(line_t* line, int useAgain) { int texTop; int texMid; int texBot; int i; int sound; boolean breakglass; // villsa [STRIFE] switchlist_t* sl; // villsa [STRIFE] breakglass = false; // villsa [STRIFE] texTop = sides[line->sidenum[0]].toptexture; texMid = sides[line->sidenum[0]].midtexture; texBot = sides[line->sidenum[0]].bottomtexture; sound = sfx_swtchn; // villsa [STRIFE] check for linetype 182 (break glass) if(line->special == 182) { line->flags &= ~ML_BLOCKING; breakglass = true; if(useAgain) { // haleyjd 09/21/10: Corrected (>> 16 == next field) texTop = 0; texBot = 0; } if(texMid) // haleyjd 09/21/10: Corrected (>> 16 == next field) useAgain = 0; sound = sfx_bglass; } if(!useAgain) line->special = 0; for(i = 0; i < numswitches*2; i++) { sl = &alphSwitchList[i / 2]; // villsa [STRIFE] if(switchlist[i] == texTop) { // villsa [STRIFE] set sound if(sl->sound) sound = sl->sound; S_StartSound(buttonlist->soundorg, sound); sides[line->sidenum[0]].toptexture = switchlist[i^1]; if(useAgain) P_StartButton(line,top,switchlist[i],BUTTONTIME); if(breakglass) P_SpawnBrokenGlass(line); return; } else { if(switchlist[i] == texMid) { // villsa [STRIFE] set sound if(sl->sound) sound = sl->sound; S_StartSound(buttonlist->soundorg,sound); sides[line->sidenum[0]].midtexture = switchlist[i^1]; // villsa [STRIFE] affect second side of line // BUG: will crash if 1S line is marked with TWOSIDED flag! if(line->flags & ML_TWOSIDED) sides[line->sidenum[1]].midtexture = switchlist[i^1]; if(useAgain) P_StartButton(line, middle,switchlist[i],BUTTONTIME); // villsa [STRIFE]: Mines Transmitter hack if(sound == sfx_firxpl) { breakglass = true; // give quest flag 29 to player players[0].questflags |= QF_QUEST29; // give stamina/accuracy items if(!netgame) { P_GiveItemToPlayer(players, SPR_TOKN, MT_TOKEN_STAMINA); P_GiveItemToPlayer(players, SPR_TOKN, MT_TOKEN_NEW_ACCURACY); } } // villsa [STRIFE] if(breakglass || sound == sfx_bglass) P_SpawnBrokenGlass(line); return; } else { if(switchlist[i] == texBot) { // villsa [STRIFE] set sound if(sl->sound) sound = sl->sound; S_StartSound(buttonlist->soundorg,sound); sides[line->sidenum[0]].bottomtexture = switchlist[i^1]; if(useAgain) P_StartButton(line, bottom,switchlist[i],BUTTONTIME); if(breakglass) P_SpawnBrokenGlass(line); return; } } } } }
void A_CloseShotgun2(player_t* player, pspdef_t* psp) { S_StartSound(player->mo, sfx_sht2load2); }
// // P_MoveWall // // villsa [STRIFE] New function. // Dynamically move a solid line. Unused in Strife // static void P_MoveWall(line_t *line, mobj_t *thing) { vertex_t *v2; vertex_t *v1; fixed_t x; fixed_t y; v1 = line->v1; v2 = line->v2; S_StartSound(thing, sfx_stnmov); if (line->dx) { if (thing->x >= v1->x) { v1->y -= (8 * FRACUNIT); v2->y -= (8 * FRACUNIT); } else { v1->y += (8 * FRACUNIT); v2->y += (8 * FRACUNIT); } } else { if (thing->y >= v1->y) { v1->x -= (8 * FRACUNIT); v2->x -= (8 * FRACUNIT); } else { v1->x += (8 * FRACUNIT); v2->x += (8 * FRACUNIT); } } if (v1->x >= v2->x) { line->bbox[BOXLEFT] = v2->x; x = v1->x; } else { line->bbox[BOXLEFT] = v1->x; x = v2->x; } line->bbox[BOXRIGHT] = x; if (v1->y >= v2->y) { line->bbox[BOXBOTTOM] = v2->y; y = v1->y; } else { line->bbox[BOXBOTTOM] = v1->y; y = v2->y; } line->bbox[BOXTOP] = y; }
boolean PIT_CheckThing(mobj_t * thing) { fixed_t blockdist; boolean solid; int damage; if (!(thing->flags & (MF_SOLID | MF_SPECIAL | MF_SHOOTABLE))) { // Can't hit thing return (true); } blockdist = thing->radius + tmthing->radius; if (abs(thing->x - tmx) >= blockdist || abs(thing->y - tmy) >= blockdist) { // Didn't hit thing return (true); } if (thing == tmthing) { // Don't clip against self return (true); } if (tmthing->flags2 & MF2_PASSMOBJ) { // check if a mobj passed over/under another object if ((tmthing->type == MT_IMP || tmthing->type == MT_WIZARD) && (thing->type == MT_IMP || thing->type == MT_WIZARD)) { // don't let imps/wizards fly over other imps/wizards return false; } if (tmthing->z > thing->z + thing->height && !(thing->flags & MF_SPECIAL)) { return (true); } else if (tmthing->z + tmthing->height < thing->z && !(thing->flags & MF_SPECIAL)) { // under thing return (true); } } // Check for skulls slamming into things if (tmthing->flags & MF_SKULLFLY) { damage = ((P_Random() % 8) + 1) * tmthing->damage; P_DamageMobj(thing, tmthing, tmthing, damage); tmthing->flags &= ~MF_SKULLFLY; tmthing->momx = tmthing->momy = tmthing->momz = 0; P_SetMobjState(tmthing, tmthing->info->seestate); return (false); } // Check for missile if (tmthing->flags & MF_MISSILE) { // Check for passing through a ghost if ((thing->flags & MF_SHADOW) && (tmthing->flags2 & MF2_THRUGHOST)) { return (true); } // Check if it went over / under if (tmthing->z > thing->z + thing->height) { // Over thing return (true); } if (tmthing->z + tmthing->height < thing->z) { // Under thing return (true); } if (tmthing->target && tmthing->target->type == thing->type) { // Don't hit same species as originator if (thing == tmthing->target) { // Don't missile self return (true); } if (thing->type != MT_PLAYER) { // Hit same species as originator, explode, no damage return (false); } } if (!(thing->flags & MF_SHOOTABLE)) { // Didn't do any damage return !(thing->flags & MF_SOLID); } if (tmthing->flags2 & MF2_RIP) { if (!(thing->flags & MF_NOBLOOD)) { // Ok to spawn some blood P_RipperBlood(tmthing); } S_StartSound(tmthing, sfx_ripslop); damage = ((P_Random() & 3) + 2) * tmthing->damage; P_DamageMobj(thing, tmthing, tmthing->target, damage); if (thing->flags2 & MF2_PUSHABLE && !(tmthing->flags2 & MF2_CANNOTPUSH)) { // Push thing thing->momx += tmthing->momx >> 2; thing->momy += tmthing->momy >> 2; } numspechit = 0; return (true); } // Do damage damage = ((P_Random() % 8) + 1) * tmthing->damage; if (damage) { if (!(thing->flags & MF_NOBLOOD) && P_Random() < 192) { P_BloodSplatter(tmthing->x, tmthing->y, tmthing->z, thing); } P_DamageMobj(thing, tmthing, tmthing->target, damage); } return (false); }
// // 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 IN_DrawSingleStats(void) { int x; static int sounds; IN_DrTextB(DEH_String("KILLS"), 50, 65); IN_DrTextB(DEH_String("ITEMS"), 50, 90); IN_DrTextB(DEH_String("SECRETS"), 50, 115); x = 160 - MN_TextBWidth(LevelNames[(gameepisode - 1) * 9 + prevmap - 1] + 7) / 2; IN_DrTextB(LevelNames[(gameepisode - 1) * 9 + prevmap - 1] + 7, x, 3); x = 160 - MN_TextAWidth(DEH_String("FINISHED")) / 2; MN_DrTextA(DEH_String("FINISHED"), x, 25); if (intertime < 30) { sounds = 0; return; } if (sounds < 1 && intertime >= 30) { S_StartSound(NULL, sfx_dorcls); sounds++; } IN_DrawNumber(players[consoleplayer].killcount, 200, 65, 3); V_DrawShadowedPatch(237, 65, FontBSlash); IN_DrawNumber(totalkills, 248, 65, 3); if (intertime < 60) { return; } if (sounds < 2 && intertime >= 60) { S_StartSound(NULL, sfx_dorcls); sounds++; } IN_DrawNumber(players[consoleplayer].itemcount, 200, 90, 3); V_DrawShadowedPatch(237, 90, FontBSlash); IN_DrawNumber(totalitems, 248, 90, 3); if (intertime < 90) { return; } if (sounds < 3 && intertime >= 90) { S_StartSound(NULL, sfx_dorcls); sounds++; } IN_DrawNumber(players[consoleplayer].secretcount, 200, 115, 3); V_DrawShadowedPatch(237, 115, FontBSlash); IN_DrawNumber(totalsecret, 248, 115, 3); if (intertime < 150) { return; } if (sounds < 4 && intertime >= 150) { S_StartSound(NULL, sfx_dorcls); sounds++; } if (gamemode != retail || gameepisode <= 3) { IN_DrTextB(DEH_String("TIME"), 85, 160); IN_DrawTime(155, 160, hours, minutes, seconds); } else { x = 160 - MN_TextAWidth(DEH_String("NOW ENTERING:")) / 2; MN_DrTextA(DEH_String("NOW ENTERING:"), x, 160); x = 160 - MN_TextBWidth(LevelNames[(gameepisode - 1) * 9 + gamemap - 1] + 7) / 2; IN_DrTextB(LevelNames[(gameepisode - 1) * 9 + gamemap - 1] + 7, x, 170); skipintermission = false; } }
void IN_Ticker(void) { if(!intermission) { return; } if(!IS_CLIENT) { if(interState == 3) { IN_WaitStop(); return; } } IN_CheckForSkip(); // Counter for general background animation. bcnt++; interTime++; if(oldInterTime < interTime) { interState++; if(wbs->episode > 2 && interState >= 1) { // Extended Wad levels: skip directly to the next level interState = 3; } switch(interState) { case 0: oldInterTime = interTime + 300; if(wbs->episode > 2) { oldInterTime = interTime + 1200; } break; case 1: oldInterTime = interTime + 200; break; case 2: oldInterTime = MAXINT; break; case 3: cnt = 10; break; default: break; } } if(skipIntermission) { if(interState == 0 && interTime < 150) { interTime = 150; skipIntermission = false; NetSv_Intermission(IMF_TIME, 0, interTime); return; } else if(interState < 2 && wbs->episode < 3) { interState = 2; skipIntermission = false; S_StartSound(SFX_DORCLS, NULL); NetSv_Intermission(IMF_STATE, interState, 0); return; } interState = 3; cnt = 10; skipIntermission = false; S_StartSound(SFX_DORCLS, NULL); NetSv_Intermission(IMF_STATE, interState, 0); } }
// // M_Responder // qboolean M_Responder (event_t* ev) { int ch; int i; ch = -1; if (ev->type == ev_joystick && ::g->joywait < I_GetTime()) { if (ev->data3 == -1) { ch = KEY_UPARROW; ::g->joywait = I_GetTime() + 5; } else if (ev->data3 == 1) { ch = KEY_DOWNARROW; ::g->joywait = I_GetTime() + 5; } if (ev->data2 == -1) { ch = KEY_LEFTARROW; ::g->joywait = I_GetTime() + 2; } else if (ev->data2 == 1) { ch = KEY_RIGHTARROW; ::g->joywait = I_GetTime() + 2; } if (ev->data1&1) { ch = KEY_ENTER; ::g->joywait = I_GetTime() + 5; } if (ev->data1&2) { ch = KEY_BACKSPACE; ::g->joywait = I_GetTime() + 5; } } else { if (ev->type == ev_mouse && ::g->mousewait < I_GetTime()) { ::g->mmenu_mousey += ev->data3; if (::g->mmenu_mousey < ::g->lasty-30) { ch = KEY_DOWNARROW; ::g->mousewait = I_GetTime() + 5; ::g->mmenu_mousey = ::g->lasty -= 30; } else if (::g->mmenu_mousey > ::g->lasty+30) { ch = KEY_UPARROW; ::g->mousewait = I_GetTime() + 5; ::g->mmenu_mousey = ::g->lasty += 30; } ::g->mmenu_mousex += ev->data2; if (::g->mmenu_mousex < ::g->lastx-30) { ch = KEY_LEFTARROW; ::g->mousewait = I_GetTime() + 5; ::g->mmenu_mousex = ::g->lastx -= 30; } else if (::g->mmenu_mousex > ::g->lastx+30) { ch = KEY_RIGHTARROW; ::g->mousewait = I_GetTime() + 5; ::g->mmenu_mousex = ::g->lastx += 30; } if (ev->data1&1) { ch = KEY_ENTER; ::g->mousewait = I_GetTime() + 15; } if (ev->data1&2) { ch = KEY_BACKSPACE; ::g->mousewait = I_GetTime() + 15; } } else if (ev->type == ev_keydown) { ch = ev->data1; } } if (ch == -1) return false; // Save Game string input if (::g->saveStringEnter) { switch(ch) { case KEY_BACKSPACE: if (::g->saveCharIndex > 0) { ::g->saveCharIndex--; ::g->savegamestrings[::g->saveSlot][::g->saveCharIndex] = 0; } break; case KEY_ESCAPE: ::g->saveStringEnter = 0; strcpy(&::g->savegamestrings[::g->saveSlot][0],::g->saveOldString); break; case KEY_ENTER: ::g->saveStringEnter = 0; if (::g->savegamestrings[::g->saveSlot][0]) M_DoSave(::g->saveSlot); break; default: ch = toupper(ch); if (ch != 32) if (ch-HU_FONTSTART < 0 || ch-HU_FONTSTART >= HU_FONTSIZE) break; if (ch >= 32 && ch <= 127 && ::g->saveCharIndex < SAVESTRINGSIZE-1 && M_StringWidth(::g->savegamestrings[::g->saveSlot]) < (SAVESTRINGSIZE-2)*8) { ::g->savegamestrings[::g->saveSlot][::g->saveCharIndex++] = ch; ::g->savegamestrings[::g->saveSlot][::g->saveCharIndex] = 0; } break; } return true; } // Take care of any messages that need input if (::g->messageToPrint) { if (::g->messageNeedsInput == true && !(ch == KEY_ENTER || ch == KEY_BACKSPACE || ch == KEY_ESCAPE)) return false; ::g->menuactive = ::g->messageLastMenuActive; ::g->messageToPrint = 0; if (::g->messageRoutine) ::g->messageRoutine(ch); S_StartSound(NULL,sfx_swtchx); return true; } /* if (::g->devparm && ch == KEY_F1) { G_ScreenShot (); return true; } // F-Keys if (!::g->menuactive) switch(ch) { case KEY_MINUS: // Screen size down if (::g->automapactive || ::g->chat_on) return false; //M_SizeDisplay(0); S_StartSound(NULL,sfx_stnmov); return true; case KEY_EQUALS: // Screen size up if (::g->automapactive || ::g->chat_on) return false; //M_SizeDisplay(1); S_StartSound(NULL,sfx_stnmov); return true; case KEY_F1: // Help key M_StartControlPanel (); if ( ::g->gamemode == retail ) ::g->currentMenu = &::g->ReadDef2; else ::g->currentMenu = &::g->ReadDef1; ::g->itemOn = 0; S_StartSound(NULL,sfx_swtchn); return true; case KEY_F2: // Save M_StartControlPanel(); S_StartSound(NULL,sfx_swtchn); M_SaveGame(0); return true; case KEY_F3: // Load M_StartControlPanel(); S_StartSound(NULL,sfx_swtchn); M_LoadGame(0); return true; case KEY_F4: // Sound Volume M_StartControlPanel (); ::g->currentMenu = &::g->SoundDef; ::g->itemOn = sfx_vol; S_StartSound(NULL,sfx_swtchn); return true; case KEY_F5: // Detail toggle M_ChangeDetail(0); S_StartSound(NULL,sfx_swtchn); return true; case KEY_F6: // Quicksave S_StartSound(NULL,sfx_swtchn); M_QuickSave(); return true; case KEY_F7: // End game S_StartSound(NULL,sfx_swtchn); M_EndGame(0); return true; case KEY_F8: // Toggle messages M_ChangeMessages(0); S_StartSound(NULL,sfx_swtchn); return true; case KEY_F9: // Quickload S_StartSound(NULL,sfx_swtchn); M_QuickLoad(); return true; case KEY_F10: // Quit DOOM S_StartSound(NULL,sfx_swtchn); M_QuitDOOM(0); return true; case KEY_F11: // gamma toggle ::g->usegamma++; if (::g->usegamma > 4) ::g->usegamma = 0; ::g->players[::g->consoleplayer].message = gammamsg[::g->usegamma]; I_SetPalette ((byte*)W_CacheLumpName ("PLAYPAL",PU_CACHE_SHARED)); return true; } */ // Pop-up menu? if (!::g->menuactive) { if (ch == KEY_ESCAPE && ( ::g->gamestate == GS_LEVEL || ::g->gamestate == GS_INTERMISSION || ::g->gamestate == GS_FINALE ) ) { M_StartControlPanel (); S_StartSound(NULL,sfx_swtchn); return true; } return false; } // Keys usable within menu switch (ch) { case KEY_DOWNARROW: do { if (::g->itemOn+1 > ::g->currentMenu->numitems-1) ::g->itemOn = 0; else ::g->itemOn++; S_StartSound(NULL,sfx_pstop); } while(::g->currentMenu->menuitems[::g->itemOn].status==-1); return true; case KEY_UPARROW: do { if (!::g->itemOn) ::g->itemOn = ::g->currentMenu->numitems-1; else ::g->itemOn--; S_StartSound(NULL,sfx_pstop); } while(::g->currentMenu->menuitems[::g->itemOn].status==-1); return true; case KEY_LEFTARROW: if (::g->currentMenu->menuitems[::g->itemOn].routine && ::g->currentMenu->menuitems[::g->itemOn].status == 2) { S_StartSound(NULL,sfx_stnmov); ::g->currentMenu->menuitems[::g->itemOn].routine(0); } return true; case KEY_RIGHTARROW: if (::g->currentMenu->menuitems[::g->itemOn].routine && ::g->currentMenu->menuitems[::g->itemOn].status == 2) { S_StartSound(NULL,sfx_stnmov); ::g->currentMenu->menuitems[::g->itemOn].routine(1); } return true; case KEY_ENTER: if (::g->currentMenu->menuitems[::g->itemOn].routine && ::g->currentMenu->menuitems[::g->itemOn].status) { ::g->currentMenu->lastOn = ::g->itemOn; if (::g->currentMenu->menuitems[::g->itemOn].status == 2) { ::g->currentMenu->menuitems[::g->itemOn].routine(1); // right arrow S_StartSound(NULL,sfx_stnmov); } else { ::g->currentMenu->menuitems[::g->itemOn].routine(::g->itemOn); S_StartSound(NULL,sfx_pistol); } } return true; case KEY_ESCAPE: case KEY_BACKSPACE: ::g->currentMenu->lastOn = ::g->itemOn; if (::g->currentMenu->prevMenu) { ::g->currentMenu = ::g->currentMenu->prevMenu; ::g->itemOn = ::g->currentMenu->lastOn; S_StartSound(NULL,sfx_swtchn); } else if ( ::g->currentMenu == &::g->MainDef && ( !::g->demoplayback && ::g->gamestate != GS_DEMOSCREEN ) ) { M_ClearMenus(); ::g->paused = false; } return true; default: for (i = ::g->itemOn+1;i < ::g->currentMenu->numitems;i++) if (::g->currentMenu->menuitems[i].alphaKey == ch) { ::g->itemOn = i; S_StartSound(NULL,sfx_pstop); return true; } for (i = 0;i <= ::g->itemOn;i++) if (::g->currentMenu->menuitems[i].alphaKey == ch) { ::g->itemOn = i; S_StartSound(NULL,sfx_pstop); return true; } break; } return false; }
static void DrDeathTally(void) { int i, j; fixed_t xPos, yPos; fixed_t xDelta, yDelta; fixed_t xStart, scale; int x, y; boolean bold; static boolean showTotals; int temp; V_DrawPatch(TALLY_TOP_X, TALLY_TOP_Y, W_CacheLumpName("tallytop", PU_CACHE)); V_DrawPatch(TALLY_LEFT_X, TALLY_LEFT_Y, W_CacheLumpName("tallylft", PU_CACHE)); if (intertime < TALLY_EFFECT_TICKS) { showTotals = false; scale = (intertime * FRACUNIT) / TALLY_EFFECT_TICKS; xDelta = FixedMul(scale, TALLY_FINAL_X_DELTA); yDelta = FixedMul(scale, TALLY_FINAL_Y_DELTA); xStart = TALLY_START_XPOS - FixedMul(scale, TALLY_START_XPOS - TALLY_STOP_XPOS); yPos = TALLY_START_YPOS - FixedMul(scale, TALLY_START_YPOS - TALLY_STOP_YPOS); } else { xDelta = TALLY_FINAL_X_DELTA; yDelta = TALLY_FINAL_Y_DELTA; xStart = TALLY_STOP_XPOS; yPos = TALLY_STOP_YPOS; } if (intertime >= TALLY_EFFECT_TICKS && showTotals == false) { showTotals = true; S_StartSound(NULL, SFX_PLATFORM_STOP); } y = yPos >> FRACBITS; for (i = 0; i < MAXPLAYERS; i++) { xPos = xStart; for (j = 0; j < MAXPLAYERS; j++, xPos += xDelta) { x = xPos >> FRACBITS; bold = (i == consoleplayer || j == consoleplayer); if (playeringame[i] && playeringame[j]) { if (bold) { DrNumberBold(players[i].frags[j], x, y, 100); } else { DrNumber(players[i].frags[j], x, y, 100); } } else { temp = MN_TextAWidth("--") / 2; if (bold) { MN_DrTextAYellow("--", x - temp, y); } else { MN_DrTextA("--", x - temp, y); } } } if (showTotals && playeringame[i] && !((slaughterboy & (1 << i)) && !(intertime & 16))) { DrNumber(totalFrags[i], TALLY_TOTALS_X, y, 1000); } yPos += yDelta; y = yPos >> FRACBITS; } }
void HU_Ticker(void) { int i, rc; char c; // tick down message counter if message is up if (message_counter && !--message_counter) { message_on = false; message_nottobefuckedwith = false; } if (showMessages || message_dontfuckwithme) { // display message if necessary if ((plr->message && !message_nottobefuckedwith) || (plr->message && message_dontfuckwithme)) { HUlib_addMessageToSText(&w_message, 0, plr->message); plr->message = 0; message_on = true; message_counter = HU_MSGTIMEOUT; message_nottobefuckedwith = message_dontfuckwithme; message_dontfuckwithme = 0; } } // else message_on = false; // check for incoming chat characters if (netgame) { for (i=0 ; i<MAXPLAYERS; i++) { if (!playeringame[i]) continue; if (i != consoleplayer && (c = players[i].cmd.chatchar)) { if (c <= HU_BROADCAST) chat_dest[i] = c; else { rc = HUlib_keyInIText(&w_inputbuffer[i], c); if (rc && c == KEY_ENTER) { if (w_inputbuffer[i].l.len && (chat_dest[i] == consoleplayer+1 || chat_dest[i] == HU_BROADCAST)) { HUlib_addMessageToSText(&w_message, DEH_String(player_names[i]), w_inputbuffer[i].l.l); message_nottobefuckedwith = true; message_on = true; message_counter = HU_MSGTIMEOUT; if ( gamemode == commercial ) S_StartSound(0, sfx_radio); else S_StartSound(0, sfx_tink); } HUlib_resetIText(&w_inputbuffer[i]); } } players[i].cmd.chatchar = 0; } } } }
void A_FireLaser(player_t *player, pspdef_t *psp) { angle_t angleoffs; angle_t spread; mobj_t *mobj; int lasercount; int i; fixed_t slope; fixed_t x; fixed_t y; fixed_t z; byte type; laser_t *laser[3]; laserthinker_t *laserthinker[3]; //fixed_t laserfrac; mobj = player->mo; lasercount = 0; spread = 0; angleoffs = 0; // the original used a lookup table with the values "0, 1, 1, 2, 1, 2, 2, 3" // this is an alternative to using that table type = (byte)(((player->artifacts & 3) != 0) + ((player->artifacts & 3) == 3) + ((player->artifacts & 4) != 0)); // setup laser type switch(type) { case 1: // Rapid fire / single shot psp->tics = 5; lasercount = 1; angleoffs = mobj->angle; break; case 2: // Rapid fire / double shot psp->tics = 4; lasercount = 2; angleoffs = mobj->angle + 0xFF4A0000; spread = 0x16C0000; break; case 3: // Spread shot psp->tics = 4; lasercount = 3; spread = 0x2220000 + (0x2220000 * (player->refire & 3)); angleoffs = mobj->angle - spread; break; default: // Normal shot lasercount = 1; angleoffs = mobj->angle; break; } if(lasercount <= 0) return; laserCells = lasercount; // setup laser beams for(i = 0; i < lasercount; i++) { int hitdice = 0; int damage = 0; slope = P_AimLineAttack(mobj, angleoffs, LASERAIMHEIGHT, LASERRANGE); player->ammo[weaponinfo[player->readyweapon].ammo]--; // // [kex] 1/2/12 the old code is just plain bad. the original behavior was // to simply call P_AimLineAttack and use the intercept fraction to // determine where the tail end of the laser will land. this is // optimal for consoles but leads to a lot of issues when working with // plane hit detection and auto aiming. P_LineAttack will be called normally // and instead of spawning puffs or blood, the xyz values are stored so the // tail end of the laser can be setup properly here // // (unused) adjust aim fraction which will be used to determine // the endpoint of the laser /*if(aimfrac) laserfrac = (aimfrac << (FRACBITS - 4)) - (4 << FRACBITS); else laserfrac = 0x800;*/ hitdice = (P_Random() & 7); damage = (((hitdice << 2) + hitdice) << 1) + 10; P_LineAttack(mobj, angleoffs, LASERRANGE, slope, damage); // setup laser laser[i] = Z_Malloc(sizeof(*laser[i]), PU_LEVSPEC, 0); // setup laser head point laser[i]->x1 = mobj->x + FixedMul(LASERDISTANCE, dcos(mobj->angle)); laser[i]->y1 = mobj->y + FixedMul(LASERDISTANCE, dsin(mobj->angle)); laser[i]->z1 = (mobj->z + LASERAIMHEIGHT); // setup laser tail point /* laser[i]->x2 = (FixedMul(dcos(angleoffs), laserfrac) + mobj->x); laser[i]->y2 = (FixedMul(dsin(angleoffs), laserfrac) + mobj->y); laser[i]->z2 = (FixedMul(slope, laserfrac) + (mobj->z + LASERAIMHEIGHT)); */ laser[i]->x2 = laserhit_x; laser[i]->y2 = laserhit_y; laser[i]->z2 = laserhit_z; // setup movement slope laser[i]->slopex = (dcos(angleoffs) << 5); laser[i]->slopey = (dsin(angleoffs) << 5); laser[i]->slopez = slope ? (slope << 5) : 0; // setup distance info x = (laser[i]->x1 - laser[i]->x2) >> FRACBITS; y = (laser[i]->y1 - laser[i]->y2) >> FRACBITS; z = (laser[i]->z1 - laser[i]->z2) >> FRACBITS; laser[i]->dist = 0; laser[i]->distmax = (int)sqrt((x * x) + (y * y) + (z * z)); laser[i]->next = NULL; laser[i]->marker = NULL; laser[i]->angle = angleoffs; x = laser[i]->x2; y = laser[i]->y2; z = laser[i]->z2; P_LaserCrossBSP(numnodes - 1, laser[i]); laserthinker[i] = Z_Malloc(sizeof(*laserthinker[i]), PU_LEVSPEC, 0); P_AddThinker(&laserthinker[i]->thinker); laserthinker[i]->thinker.function.acp1 = (actionf_p1)T_LaserThinker; laserthinker[i]->dest = P_SpawnMobj(x, y, z, MT_PROJ_LASER); laserthinker[i]->laser = laser[i]; /*if(linetarget) { int hitdice = 0; int damage = 0; hitdice = (P_Random() & 7); damage = (((hitdice << 2) + hitdice) << 1) + 10; P_DamageMobj(linetarget, mobj, mobj, damage); } else angleoffs += spread;*/ if(!linetarget) angleoffs += spread; } S_StartSound(player->mo, sfx_laser); P_SetMobjState(player->mo, S_007); P_SetPsprite(player, ps_flash, weaponinfo[player->readyweapon].flashstate); }
// // Move a plat up and down // void T_PlatRaise(plat_t* plat) { result_e res; switch(plat->status) { case up: res = T_MovePlane(plat->sector, plat->speed, plat->high, plat->crush, 0, 1); if(plat->type == raiseAndChange || plat->type == raiseToNearestAndChange) { if(!(leveltime&7)) S_StartSound(&plat->sector->soundorg, sfx_stnmov); } // villsa [STRIFE] if(plat->type == slowDWUS) { if(!(leveltime&7)) S_StartSound(&plat->sector->soundorg, sfx_stnmov); } if(res == crushed && (!plat->crush)) { plat->count = plat->wait; plat->status = down; S_StartSound(&plat->sector->soundorg, sfx_pstart); } else { if(res == pastdest) { plat->count = plat->wait; plat->status = waiting; S_StartSound(&plat->sector->soundorg, sfx_pstop); switch(plat->type) { case blazeDWUS: case downWaitUpStay: case raiseAndChange: case slowDWUS: // villsa [STRIFE] case raiseToNearestAndChange: P_RemoveActivePlat(plat); break; default: break; } } } break; case down: res = T_MovePlane(plat->sector, plat->speed, plat->low, false, 0, -1); // villsa [STRIFE] if(plat->type == slowDWUS) { if(!(leveltime&7)) S_StartSound(&plat->sector->soundorg, sfx_stnmov); } if(res == pastdest) { plat->count = plat->wait; plat->status = waiting; S_StartSound(&plat->sector->soundorg,sfx_pstop); // villsa [STRIFE] if(plat->type == upWaitDownStay) P_RemoveActivePlat(plat); } break; case waiting: if(!--plat->count) { if(plat->sector->floorheight == plat->low) plat->status = up; else plat->status = down; S_StartSound(&plat->sector->soundorg,sfx_pstart); } case in_stasis: break; } }
// // T_VerticalDoor // void T_VerticalDoor (vldoor_t* door) { result_e res; switch(door->direction) { case 0: // WAITING if (!--door->topcountdown) { switch(door->type) { case vld_blazeRaise: door->direction = -1; // time to go back down S_StartSound(&door->sector->soundorg, sfx_bdcls); break; case vld_normal: door->direction = -1; // time to go back down S_StartSound(&door->sector->soundorg, sfx_dorcls); break; case vld_close30ThenOpen: door->direction = 1; S_StartSound(&door->sector->soundorg, sfx_doropn); break; default: break; } } break; case 2: // INITIAL WAIT if (!--door->topcountdown) { switch(door->type) { case vld_raiseIn5Mins: door->direction = 1; door->type = vld_normal; S_StartSound(&door->sector->soundorg, sfx_doropn); break; default: break; } } break; case -1: // DOWN res = T_MovePlane(door->sector, door->speed, door->sector->floorheight, false,1,door->direction); if (res == pastdest) { switch(door->type) { case vld_blazeRaise: case vld_blazeClose: door->sector->specialdata = NULL; P_RemoveThinker (&door->thinker); // unlink and free S_StartSound(&door->sector->soundorg, sfx_bdcls); break; case vld_normal: case vld_close: door->sector->specialdata = NULL; P_RemoveThinker (&door->thinker); // unlink and free break; case vld_close30ThenOpen: door->direction = 0; door->topcountdown = TICRATE*30; break; default: break; } } else if (res == crushed) { switch(door->type) { case vld_blazeClose: case vld_close: // DO NOT GO BACK UP! break; default: door->direction = 1; S_StartSound(&door->sector->soundorg, sfx_doropn); break; } } break; case 1: // UP res = T_MovePlane(door->sector, door->speed, door->topheight, false,1,door->direction); if (res == pastdest) { switch(door->type) { case vld_blazeRaise: case vld_normal: door->direction = 0; // wait at top door->topcountdown = door->topwait; break; case vld_close30ThenOpen: case vld_blazeOpen: case vld_open: door->sector->specialdata = NULL; P_RemoveThinker (&door->thinker); // unlink and free break; default: break; } } break; } }