コード例 #1
0
ファイル: P_SPEC.c プロジェクト: elhobbs/heretic3ds
void P_ShootSpecialLine(mobj_t *thing, line_t *line)
{
	if(!thing->player)
	{ // Check if trigger allowed by non-player mobj
		switch(line->special)
		{
			case 46: // Impact_OpenDoor
				break;
			default:
				return;
				break;
		}
	}
	switch(line->special)
	{
		case 24: // Impact_RaiseFloor
			EV_DoFloor(line, raiseFloor);
			P_ChangeSwitchTexture(line, 0);
			break;
		case 46: // Impact_OpenDoor
			EV_DoDoor(line, open, VDOORSPEED);
			P_ChangeSwitchTexture(line, 1);
			break;
		case 47: // Impact_RaiseFloorNear&Change
			EV_DoPlat(line, raiseToNearestAndChange, 0);
			P_ChangeSwitchTexture(line, 0);
			break;
	}
}
コード例 #2
0
ファイル: ev_specials.cpp プロジェクト: Blastfrog/eternity
//
// EV_BOOMGenPostActivate
//
// Post-activation logic for BOOM generalized line types
//
static int EV_BOOMGenPostActivate(ev_action_t *action, int result,
                                  ev_instance_t *instance)
{
   if(result)
   {
      switch(instance->genspac)
      {
      case GunOnce:
      case SwitchOnce:
         P_ChangeSwitchTexture(instance->line, 0, 0);
         break;
      case GunMany:
      case SwitchMany:
         P_ChangeSwitchTexture(instance->line, 1, 0);
         break;
      case WalkOnce:
      case PushOnce:
         instance->line->special = 0;
         break;
      default:
         break;
      }
   }

   // FIXME/TODO: P_Cross and P_Shoot have always been void, and P_UseSpecialLine
   // just returns true if an action is attempted, not if it succeeds. Until a
   // comp var is added, we return true from here instead of forwarding on the
   // result.
   
   //return result;
   return true; // temporary
}
コード例 #3
0
ファイル: p_spec.cpp プロジェクト: Blue-Shadow/zdoom
bool P_ActivateLine (line_t *line, AActor *mo, int side, int activationType, DVector3 *optpos)
{
	int lineActivation;
	INTBOOL repeat;
	INTBOOL buttonSuccess;
	BYTE special;

	if (!P_TestActivateLine (line, mo, side, activationType, optpos))
	{
		return false;
	}
	bool remote = (line->special != 7 && line->special != 8 && (line->special < 11 || line->special > 14));
	if (line->locknumber > 0 && !P_CheckKeys (mo, line->locknumber, remote)) return false;
	lineActivation = line->activation;
	repeat = line->flags & ML_REPEAT_SPECIAL;
	buttonSuccess = false;
	buttonSuccess = P_ExecuteSpecial(line->special,
					line, mo, side == 1, line->args[0],
					line->args[1], line->args[2],
					line->args[3], line->args[4]);

	special = line->special;
	if (!repeat && buttonSuccess)
	{ // clear the special on non-retriggerable lines
		line->special = 0;
	}

	if (buttonSuccess)
	{
		if (activationType == SPAC_Use || activationType == SPAC_Impact || activationType == SPAC_Push)
		{
			P_ChangeSwitchTexture (line->sidedef[0], repeat, special);
		}
	}
	// some old WADs use this method to create walls that change the texture when shot.
	else if (activationType == SPAC_Impact &&					// only for shootable triggers
		(level.flags2 & LEVEL2_DUMMYSWITCHES) &&				// this is only a compatibility setting for an old hack!
		!repeat &&												// only non-repeatable triggers
		(special<Generic_Floor || special>Generic_Crusher) &&	// not for Boom's generalized linedefs
		special &&												// not for lines without a special
		tagManager.LineHasID(line, line->args[0]) &&							// Safety check: exclude edited UDMF linedefs or ones that don't map the tag to args[0]
		line->args[0] &&										// only if there's a tag (which is stored in the first arg)
		P_FindFirstSectorFromTag (line->args[0]) == -1)			// only if no sector is tagged to this linedef
	{
		P_ChangeSwitchTexture (line->sidedef[0], repeat, special);
		line->special = 0;
	}
// end of changed code
	if (developer && buttonSuccess)
	{
		Printf ("Line special %d activated on line %i\n", special, int(line - lines));
	}
	return true;
}
コード例 #4
0
ファイル: p_spec.c プロジェクト: plumsinus/crispy-doom
//
// P_ShootSpecialLine - IMPACT SPECIALS
// Called when a thing shoots a special line.
//
void
P_ShootSpecialLine
( mobj_t*	thing,
  line_t*	line )
{
    int		ok;
    
    //	Impacts that other things can activate.
    if (!thing->player)
    {
	ok = 0;
	switch(line->special)
	{
	  case 46:
	    // OPEN DOOR IMPACT
	    ok = 1;
	    break;
	}
	if (!ok)
	    return;
    }

    switch(line->special)
    {
      case 24:
	// RAISE FLOOR
	EV_DoFloor(line,raiseFloor);
	P_ChangeSwitchTexture(line,0);
	break;
	
      case 46:
	// OPEN DOOR
	EV_DoDoor(line,vld_open);
	P_ChangeSwitchTexture(line,1);
	break;
	
      case 47:
	// RAISE FLOOR NEAR AND CHANGE
	EV_DoPlat(line,raiseToNearestAndChange,0);
	P_ChangeSwitchTexture(line,0);
	break;
    }
}
コード例 #5
0
ファイル: spec.c プロジェクト: Almamu/doom3do
void P_ShootSpecialLine(mobj_t *thing,line_t *line)
{
	/* Impacts that other things can activate */

	if (!thing->player) {
		if (line->special!=46) {	/* Open door impact */
			return;
		}
	}

	switch(line->special) {
	case 24:		/* RAISE FLOOR */
		EV_DoFloor(line,raiseFloor);
		P_ChangeSwitchTexture(line,FALSE);
		break;
	case 46:		/* OPEN DOOR */
		EV_DoDoor(line,open);
		P_ChangeSwitchTexture(line,TRUE);
		break;
	case 47:		/* RAISE FLOOR NEAR AND CHANGE */
		EV_DoPlat(line,raiseToNearestAndChange,0);
		P_ChangeSwitchTexture(line,FALSE);
	}
}
コード例 #6
0
ファイル: ev_specials.cpp プロジェクト: Blastfrog/eternity
//
// EV_DOOMPostShootLine
//
// Post-activation semantics for DOOM-style use line actions.
//
static int EV_DOOMPostShootLine(ev_action_t *action, int result,
                                ev_instance_t *instance)
{
   unsigned int flags = EV_CompositeActionFlags(action);

   // check for switch texture changes
   if(flags & EV_POSTCHANGESWITCH)
   {
      // Non-BOOM gun line types may clear their special even if they fail
      if(result || (flags & EV_POSTCHANGEALWAYS) || 
         (action->minversion < 200 && EV_ClearSwitchOnFail()))
      {
         int useAgain   = !(flags & EV_POSTCLEARSPECIAL);
         int changeSide = (flags & EV_POSTCHANGESIDED) ? instance->side : 0;
         P_ChangeSwitchTexture(instance->line, useAgain, changeSide);
      }
   }

   return result;
}
コード例 #7
0
ファイル: ev_specials.cpp プロジェクト: Blastfrog/eternity
//
// EV_ParamPostActivate
//
// If the action was successful, and has a source linedef, check for
// reusability and for switch texture changes, depending on the spac.
//
static int EV_ParamPostActivate(ev_action_t *action, int result,
                                ev_instance_t *instance)
{
   // check for switch texture change and special clear
   if(result && instance->line)
   {
      // ioanch 20160229: do NOT reset special for non-parameterized "Start line
      // script" SR/WR/GR lines.
      const ev_action_t *action = EV_ActionForSpecial(instance->line->special);
      int reuse = (instance->line->extflags & EX_ML_REPEAT) ||
         (action && action->action == EV_ActionStartLineScript && 
                  !(action->type->flags & EV_POSTCLEARSPECIAL));

      if(!reuse)
         instance->line->special = 0;

      if(instance->spac == SPAC_USE || instance->spac == SPAC_IMPACT)
         P_ChangeSwitchTexture(instance->line, reuse, instance->side);
   }

   return result;
}
コード例 #8
0
ファイル: p_doorsplus.c プロジェクト: aagallag/psDooM
//
// Switch force fields with id off
//
void EV_PlusForceField(int id, line_t *ln, mobj_t *thing, int flag)
{
	register int	line = -1;
	forcefield_t	*field;

	// find all lines with id
	while ((line = P_FindLineFromTag(id, line)) >= 0)
	{
		// force field must be 2s line
		if (!lines[line].flags & ML_TWOSIDED)
			continue;

		// make sure force field isn't open already
		if (sides[lines[line].sidenum[0]].midtexture == 0)
			continue;

		field = Z_Malloc(sizeof(*field), PU_LEVSPEC, (void *)0);
		field->frontsector = lines[line].frontsector;
		field->backsector = lines[line].backsector;
		field->line = &lines[line];
		field->oldflags = lines[line].flags;

		// used a switch?
		if (!flag)
		{
			field->status = ff_open;
			field->timer = FFWAITTICS;
		}
		// no, damaged with gun shot or deactivated with comm gadget or button
		else
		{
			field->status = ff_damaged;
			P_ChangeSwitchTexture(ln, 0);
		}
		P_AddThinker(&field->thinker);
		field->thinker.function.acv = T_ForceField;
	}
}
コード例 #9
0
ファイル: ev_specials.cpp プロジェクト: Blastfrog/eternity
//
// EV_DOOMPostUseLine
//
// Post-activation semantics for DOOM-style use line actions.
//
static int EV_DOOMPostUseLine(ev_action_t *action, int result,
                              ev_instance_t *instance)
{
   unsigned int flags = EV_CompositeActionFlags(action);

   // check for switch texture changes
   if(flags & EV_POSTCHANGESWITCH)
   {
      if(result || (flags & EV_POSTCHANGEALWAYS))
      {
         int useAgain   = !(flags & EV_POSTCLEARSPECIAL);
         int changeSide = (flags & EV_POSTCHANGESIDED) ? instance->side : 0;
         P_ChangeSwitchTexture(instance->line, useAgain, changeSide);
      }
   }

   // FIXME/TODO: ideally we return result; the vanilla code always returns true
   // if the line action was *attempted*, not if it succeeded. Fixing this will
   // require a new comp flag.
   
   //return result;
   return true; // temporary
}
コード例 #10
0
ファイル: P_spec.c プロジェクト: amitahire/development
boolean P_ActivateLine(line_t *line, mobj_t *mo, int side, int activationType)
{
	int     lineActivation;
	boolean repeat;
	boolean buttonSuccess;

	lineActivation = GET_SPAC(line->flags);
	if(lineActivation != activationType)
	{
		return false;
	}
	if(!mo->player && !(mo->flags & MF_MISSILE))
	{
		if(lineActivation != SPAC_MCROSS)
		{						// currently, monsters can only activate the MCROSS activation type
			return false;
		}
		if(line->flags & ML_SECRET)
			return false;		// never open secret doors
	}
	repeat = line->flags & ML_REPEAT_SPECIAL;
	buttonSuccess = false;

	buttonSuccess =
		P_ExecuteLineSpecial(line->special, &line->arg1, line, side, mo);
	if(!repeat && buttonSuccess)
	{							// clear the special on non-retriggerable lines
		line->special = 0;
	}
	if((lineActivation == SPAC_USE || lineActivation == SPAC_IMPACT) &&
	   buttonSuccess)
	{
		P_ChangeSwitchTexture(line, repeat);
	}
	return true;
}
コード例 #11
0
ファイル: p_switch.c プロジェクト: Clever-Boy/doomretro
//
// 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;
}
コード例 #12
0
ファイル: P_SWITCH.C プロジェクト: BruceJawn/flash-doom
boolean P_UseSpecialLine ( mobj_t *thing, line_t *line)
{		
	//
	//	Switches that other things can activate
	//
	if (!thing->player)
	{
		if (line->flags & ML_SECRET)
			return false;		// never open secret doors
		switch(line->special)
		{
			case 1:		// MANUAL DOOR RAISE
			case 32:	// MANUAL BLUE
			case 33:	// MANUAL RED
			case 34:	// MANUAL YELLOW
				break;
			default:
				return false;
		}
	}
	
	//
	// 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
			EV_VerticalDoor (line, thing);
			break;
		//===============================================
		//	SWITCHES
		//===============================================
		case 7: // Switch_Build_Stairs (8 pixel steps)
			if(EV_BuildStairs(line, 8*FRACUNIT))
			{
				P_ChangeSwitchTexture(line, 0);
			}
			break;
		case 107: // Switch_Build_Stairs_16 (16 pixel steps)
			if(EV_BuildStairs(line, 16*FRACUNIT))
			{
				P_ChangeSwitchTexture(line, 0);
			}
			break;
		case 9:			// Change Donut
			if (EV_DoDonut(line))
				P_ChangeSwitchTexture(line,0);
			break;
		case 11:		// Exit level
			G_ExitLevel ();
			P_ChangeSwitchTexture(line,0);
			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,VDOORSPEED))
				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:		// Lower Ceiling And Crush
			if (EV_DoCeiling(line,lowerAndCrush))
				P_ChangeSwitchTexture(line,0);
			break;
		case 50:		// Close Door
			if (EV_DoDoor(line,close,VDOORSPEED))
				P_ChangeSwitchTexture(line,0);
			break;
		case 51:		// Secret EXIT
			G_SecretExitLevel ();
			P_ChangeSwitchTexture(line,0);
			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,open,VDOORSPEED))
				P_ChangeSwitchTexture(line,0);
			break;
		//===============================================
		//	BUTTONS
		//===============================================
		case 42:		// Close Door
			if (EV_DoDoor(line,close,VDOORSPEED))
				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,open,VDOORSPEED))
				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,VDOORSPEED))
				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;
	}
	
	return true;
}
コード例 #13
0
//
// 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;
}
コード例 #14
0
ファイル: p_switch.c プロジェクト: Billy2600/doomretro
//
// 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;
}
コード例 #15
0
ファイル: p_switch.c プロジェクト: M-Code/chocolate-doom
//
// 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;
}
コード例 #16
0
ファイル: p_switch.c プロジェクト: CatalystG/libretro-prboom
//
// P_UseSpecialLine
//
//
// Called when a thing uses (pushes) a special line.
// Only the front sides of lines are usable.
// Dispatches to the appropriate linedef function handler.
//
// Passed the thing using the line, the line being used, and the side used
// Returns TRUE if a thinker was created
//
boolean
P_UseSpecialLine
( mobj_t*       thing,
  line_t*       line,
  int           side )
{

  // e6y
  // b.m. side test was broken in boom201
  if ((demoplayback ? (demover != 201) : (compatibility_level != boom_201_compatibility)))
  if (side) //jff 6/1/98 fix inadvertent deletion of side test
    return FALSE;

  //jff 02/04/98 add check here for generalized floor/ceil mover
  if (!demo_compatibility)
  {
    // pointer to line function is NULL by default, set non-null if
    // line special is push or switch generalized linedef type
    int (*linefunc)(line_t *line)=NULL;

    // check each range of generalized linedefs
    if ((unsigned)line->special >= GenEnd)
    {
      // Out of range for GenFloors
    }
    else 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;
      }
  }
コード例 #17
0
ファイル: p_switch.cpp プロジェクト: rlsosborne/doom
//
// P_UseSpecialLine
//
//
// Called when a thing uses (pushes) a special line.
// Only the front sides of lines are usable.
// Dispatches to the appropriate linedef function handler.
//
// Passed the thing using the line, the line being used, and the side used
// Returns true if a thinker was created
//
OVERLAY boolean
P_UseSpecialLine
( mobj_t*       thing,
  line_t*       line,
  int           side )
{

  if (side) //jff 6/1/98 fix inadvertent deletion of side test
    return false;

  //jff 02/04/98 add check here for generalized floor/ceil mover
  if (!demo_compatibility)
  {
    if ((unsigned)line->special >= GenCrusherBase) {
      if ((unsigned)line->special >= GenLockedBase &&
          (unsigned)line->special < GenDoorBase) {
        if (!thing->player)
          return false;   // monsters disallowed from unlocking doors
        if (!P_CanUnlockGenDoor(line,thing->player))
          return false;
      }
      int lineTriggerType = (line->special & TriggerType) >> TriggerTypeShift;
      switch (lineTriggerType) {
        case PushOnce:
        case PushMany:
          if (side)
            return true;
          break;
        case SwitchOnce:
        case SwitchMany:
          break;
        default: // if not a switch/push type, do nothing here
          return false;
      }
      int retval;
      // 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
        retval = EV_DoGenFloor(line);
      }
      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
        retval = EV_DoGenCeiling(line);
      }
      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
        retval = EV_DoGenDoor(line);
      }
      else if ((unsigned)line->special >= GenLockedBase)
      {
        if (!line->tag && ((line->special&6)!=6)) //jff 2/27/98 all non-manual
          return false;                         // generalized types require tag
        
        retval = EV_DoGenLockedDoor(line);
      }
      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
        retval = EV_DoGenLift(line);
      }
      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
        retval = EV_DoGenStairs(line);
      }
      else
      {
        assert((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
        retval = EV_DoGenCrusher(line);
      }
      switch (lineTriggerType)
      {
        case PushOnce:
          if (retval)
            line->special = 0;
          // fallthrough
        case PushMany:
          return true;
        case SwitchOnce:
          if (retval)
            P_ChangeSwitchTexture(line,0);
          return true;
        case SwitchMany:
          if (retval)
            P_ChangeSwitchTexture(line,1);
          return true;
      }
    }
  }
    
  // 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
      //jff 3/5/98 add ability to use teleporters for monsters
      case 195:       // switch teleporters
      case 174:
      case 210:       // silent switch teleporters
      case 209:
        break;
          
      default:
        return false;
        break;
    }
  }

  if (!P_CheckTag(line))  //jff 2/27/98 disallow zero tag on some types
    return false;

  // Dispatch to handler according to linedef type
  switch (line->special)
  {
    // Manual doors, push type with no tag
    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;
        
    // Switches (non-retriggerable)
    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,close))
        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,open))
        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;

      // killough 1/31/98: factored out compatibility check;
      // added inner switch, relaxed check to demo_compatibility

    default:
      if (!demo_compatibility)
        switch (line->special)
        {
          //jff 1/29/98 added linedef types to fill all functions out so that
          // all possess SR, S1, WR, W1 types

          case 158:
            // Raise Floor to shortest lower texture
            // 158 S1  EV_DoFloor(raiseToTexture), CSW(0)
            if (EV_DoFloor(line,raiseToTexture))
              P_ChangeSwitchTexture(line,0);
            break;

          case 159:
            // Raise Floor to shortest lower texture
            // 159 S1  EV_DoFloor(lowerAndChange)
            if (EV_DoFloor(line,lowerAndChange))
              P_ChangeSwitchTexture(line,0);
            break;
        
          case 160:
            // Raise Floor 24 and change
            // 160 S1  EV_DoFloor(raiseFloor24AndChange)
            if (EV_DoFloor(line,raiseFloor24AndChange))
              P_ChangeSwitchTexture(line,0);
            break;

          case 161:
            // Raise Floor 24
            // 161 S1  EV_DoFloor(raiseFloor24)
            if (EV_DoFloor(line,raiseFloor24))
              P_ChangeSwitchTexture(line,0);
            break;

          case 162:
            // Moving floor min n to max n
            // 162 S1  EV_DoPlat(perpetualRaise,0)
            if (EV_DoPlat(line,perpetualRaise,0))
              P_ChangeSwitchTexture(line,0);
            break;

          case 163:
            // Stop Moving floor
            // 163 S1  EV_DoPlat(perpetualRaise,0)
            EV_StopPlat(line);
            P_ChangeSwitchTexture(line,0);
            break;

          case 164:
            // Start fast crusher
            // 164 S1  EV_DoCeiling(fastCrushAndRaise)
            if (EV_DoCeiling(line,fastCrushAndRaise))
              P_ChangeSwitchTexture(line,0);
            break;

          case 165:
            // Start slow silent crusher
            // 165 S1  EV_DoCeiling(silentCrushAndRaise)
            if (EV_DoCeiling(line,silentCrushAndRaise))
              P_ChangeSwitchTexture(line,0);
            break;

          case 166:
            // Raise ceiling, Lower floor
            // 166 S1 EV_DoCeiling(raiseToHighest), EV_DoFloor(lowerFloortoLowest)
            if (EV_DoCeiling(line, raiseToHighest) ||
                EV_DoFloor(line, lowerFloorToLowest))
              P_ChangeSwitchTexture(line,0);
            break;

          case 167:
            // Lower floor and Crush
            // 167 S1 EV_DoCeiling(lowerAndCrush)
            if (EV_DoCeiling(line, lowerAndCrush))
              P_ChangeSwitchTexture(line,0);
            break;

          case 168:
            // Stop crusher
            // 168 S1 EV_CeilingCrushStop()
            if (EV_CeilingCrushStop(line))
              P_ChangeSwitchTexture(line,0);
            break;

          case 169:
            // Lights to brightest neighbor sector
            // 169 S1  EV_LightTurnOn(0)
            EV_LightTurnOn(line,0);
            P_ChangeSwitchTexture(line,0);
            break;

          case 170:
            // Lights to near dark
            // 170 S1  EV_LightTurnOn(35)
            EV_LightTurnOn(line,35);
            P_ChangeSwitchTexture(line,0);
            break;

          case 171:
            // Lights on full
            // 171 S1  EV_LightTurnOn(255)
            EV_LightTurnOn(line,255);
            P_ChangeSwitchTexture(line,0);
            break;

          case 172:
            // Start Lights Strobing
            // 172 S1  EV_StartLightStrobing()
            EV_StartLightStrobing(line);
            P_ChangeSwitchTexture(line,0);
            break;

          case 173:
            // Lights to Dimmest Near
            // 173 S1  EV_TurnTagLightsOff()
            EV_TurnTagLightsOff(line);
            P_ChangeSwitchTexture(line,0);
            break;

          case 174:
            // Teleport
            // 174 S1  EV_Teleport(side,thing)
            if (EV_Teleport(line,side,thing))
              P_ChangeSwitchTexture(line,0);
            break;

          case 175:
            // Close Door, Open in 30 secs
            // 175 S1  EV_DoDoor(close30ThenOpen)
            if (EV_DoDoor(line,close30ThenOpen))
              P_ChangeSwitchTexture(line,0);
            break;

          case 189: //jff 3/15/98 create texture change no motion type
            // Texture Change Only (Trigger)
            // 189 S1 Change Texture/Type Only
            if (EV_DoChange(line,trigChangeOnly))
              P_ChangeSwitchTexture(line,0);
            break;

          case 203:
            // Lower ceiling to lowest surrounding ceiling
            // 203 S1 EV_DoCeiling(lowerToLowest)
            if (EV_DoCeiling(line,lowerToLowest))
              P_ChangeSwitchTexture(line,0);
            break;

          case 204:
            // Lower ceiling to highest surrounding floor
            // 204 S1 EV_DoCeiling(lowerToMaxFloor)
            if (EV_DoCeiling(line,lowerToMaxFloor))
              P_ChangeSwitchTexture(line,0);
            break;

          case 209:
            // killough 1/31/98: silent teleporter
            //jff 209 S1 SilentTeleport 
            if (EV_SilentTeleport(line, side, thing))
              P_ChangeSwitchTexture(line,0);
            break;

          case 241: //jff 3/15/98 create texture change no motion type
            // Texture Change Only (Numeric)
            // 241 S1 Change Texture/Type Only
            if (EV_DoChange(line,numChangeOnly))
              P_ChangeSwitchTexture(line,0);
            break;

          case 221:
            // Lower floor to next lowest floor
            // 221 S1 Lower Floor To Nearest Floor
            if (EV_DoFloor(line,lowerFloorToNearest))
              P_ChangeSwitchTexture(line,0);
            break;

          case 229:
            // Raise elevator next floor
            // 229 S1 Raise Elevator next floor
            if (EV_DoElevator(line,elevateUp))
              P_ChangeSwitchTexture(line,0);
            break;

          case 233:
            // Lower elevator next floor
            // 233 S1 Lower Elevator next floor
            if (EV_DoElevator(line,elevateDown))
              P_ChangeSwitchTexture(line,0);
            break;

          case 237:
            // Elevator to current floor
            // 237 S1 Elevator to current floor
            if (EV_DoElevator(line,elevateCurrent))
              P_ChangeSwitchTexture(line,0);
            break;


          // jff 1/29/98 end of added S1 linedef types

          //jff 1/29/98 added linedef types to fill all functions out so that
          // all possess SR, S1, WR, W1 types
            
          case 78: //jff 3/15/98 create texture change no motion type
            // Texture Change Only (Numeric)
            // 78 SR Change Texture/Type Only
            if (EV_DoChange(line,numChangeOnly))
              P_ChangeSwitchTexture(line,1);
            break;

          case 176:
            // Raise Floor to shortest lower texture
            // 176 SR  EV_DoFloor(raiseToTexture), CSW(1)
            if (EV_DoFloor(line,raiseToTexture))
              P_ChangeSwitchTexture(line,1);
            break;

          case 177:
            // Raise Floor to shortest lower texture
            // 177 SR  EV_DoFloor(lowerAndChange)
            if (EV_DoFloor(line,lowerAndChange))
              P_ChangeSwitchTexture(line,1);
            break;

          case 178:
            // Raise Floor 512
            // 178 SR  EV_DoFloor(raiseFloor512)
            if (EV_DoFloor(line,raiseFloor512))
              P_ChangeSwitchTexture(line,1);
            break;

          case 179:
            // Raise Floor 24 and change
            // 179 SR  EV_DoFloor(raiseFloor24AndChange)
            if (EV_DoFloor(line,raiseFloor24AndChange))
              P_ChangeSwitchTexture(line,1);
            break;

          case 180:
            // Raise Floor 24
            // 180 SR  EV_DoFloor(raiseFloor24)
            if (EV_DoFloor(line,raiseFloor24))
              P_ChangeSwitchTexture(line,1);
            break;

          case 181:
            // Moving floor min n to max n
            // 181 SR  EV_DoPlat(perpetualRaise,0)

            EV_DoPlat(line,perpetualRaise,0);
            P_ChangeSwitchTexture(line,1);
            break;

          case 182:
            // Stop Moving floor
            // 182 SR  EV_DoPlat(perpetualRaise,0)
            EV_StopPlat(line);
            P_ChangeSwitchTexture(line,1);
            break;

          case 183:
            // Start fast crusher
            // 183 SR  EV_DoCeiling(fastCrushAndRaise)
            if (EV_DoCeiling(line,fastCrushAndRaise))
              P_ChangeSwitchTexture(line,1);
            break;

          case 184:
            // Start slow crusher
            // 184 SR  EV_DoCeiling(crushAndRaise)
            if (EV_DoCeiling(line,crushAndRaise))
              P_ChangeSwitchTexture(line,1);
            break;

          case 185:
            // Start slow silent crusher
            // 185 SR  EV_DoCeiling(silentCrushAndRaise)
            if (EV_DoCeiling(line,silentCrushAndRaise))
              P_ChangeSwitchTexture(line,1);
            break;

          case 186:
            // Raise ceiling, Lower floor
            // 186 SR EV_DoCeiling(raiseToHighest), EV_DoFloor(lowerFloortoLowest)
            if (EV_DoCeiling(line, raiseToHighest) ||
                EV_DoFloor(line, lowerFloorToLowest))
              P_ChangeSwitchTexture(line,1);
            break;

          case 187:
            // Lower floor and Crush
            // 187 SR EV_DoCeiling(lowerAndCrush)
            if (EV_DoCeiling(line, lowerAndCrush))
              P_ChangeSwitchTexture(line,1);
            break;

          case 188:
            // Stop crusher
            // 188 SR EV_CeilingCrushStop()
            if (EV_CeilingCrushStop(line))
              P_ChangeSwitchTexture(line,1);
            break;

          case 190: //jff 3/15/98 create texture change no motion type
            // Texture Change Only (Trigger)
            // 190 SR Change Texture/Type Only
            if (EV_DoChange(line,trigChangeOnly))
              P_ChangeSwitchTexture(line,1);
            break;

          case 191:
            // Lower Pillar, Raise Donut
            // 191 SR  EV_DoDonut()
            if (EV_DoDonut(line))
              P_ChangeSwitchTexture(line,1);
            break;

          case 192:
            // Lights to brightest neighbor sector
            // 192 SR  EV_LightTurnOn(0)
            EV_LightTurnOn(line,0);
            P_ChangeSwitchTexture(line,1);
            break;

          case 193:
            // Start Lights Strobing
            // 193 SR  EV_StartLightStrobing()
            EV_StartLightStrobing(line);
            P_ChangeSwitchTexture(line,1);
            break;

          case 194:
            // Lights to Dimmest Near
            // 194 SR  EV_TurnTagLightsOff()
            EV_TurnTagLightsOff(line);
            P_ChangeSwitchTexture(line,1);
            break;

          case 195:
            // Teleport
            // 195 SR  EV_Teleport(side,thing)
            if (EV_Teleport(line,side,thing))
              P_ChangeSwitchTexture(line,1);
            break;

          case 196:
            // Close Door, Open in 30 secs
            // 196 SR  EV_DoDoor(close30ThenOpen)
            if (EV_DoDoor(line,close30ThenOpen))
              P_ChangeSwitchTexture(line,1);
            break;

          case 205:
            // Lower ceiling to lowest surrounding ceiling
            // 205 SR EV_DoCeiling(lowerToLowest)
            if (EV_DoCeiling(line,lowerToLowest))
              P_ChangeSwitchTexture(line,1);
            break;

          case 206:
            // Lower ceiling to highest surrounding floor
            // 206 SR EV_DoCeiling(lowerToMaxFloor)
            if (EV_DoCeiling(line,lowerToMaxFloor))
              P_ChangeSwitchTexture(line,1);
            break;

          case 210:
            // killough 1/31/98: silent teleporter
            //jff 210 SR SilentTeleport 
            if (EV_SilentTeleport(line, side, thing))
              P_ChangeSwitchTexture(line,1);
            break;

          case 211: //jff 3/14/98 create instant toggle floor type
            // Toggle Floor Between C and F Instantly
            // 211 SR Toggle Floor Instant
            if (EV_DoPlat(line,toggleUpDn,0))
              P_ChangeSwitchTexture(line,1);
            break;

          case 222:
            // Lower floor to next lowest floor
            // 222 SR Lower Floor To Nearest Floor
            if (EV_DoFloor(line,lowerFloorToNearest))
              P_ChangeSwitchTexture(line,1);
            break;

          case 230:
            // Raise elevator next floor
            // 230 SR Raise Elevator next floor
            if (EV_DoElevator(line,elevateUp))
              P_ChangeSwitchTexture(line,1);
            break;

          case 234:
            // Lower elevator next floor
            // 234 SR Lower Elevator next floor
            if (EV_DoElevator(line,elevateDown))
              P_ChangeSwitchTexture(line,1);
            break;

          case 238:
            // Elevator to current floor
            // 238 SR Elevator to current floor
            if (EV_DoElevator(line,elevateCurrent))
              P_ChangeSwitchTexture(line,1);
            break;

          case 258:
            // Build stairs, step 8
            // 258 SR EV_BuildStairs(build8)
            if (EV_BuildStairs(line,build8))
              P_ChangeSwitchTexture(line,1);
            break;

          case 259:
            // Build stairs, step 16
            // 259 SR EV_BuildStairs(turbo16)
            if (EV_BuildStairs(line,turbo16))
              P_ChangeSwitchTexture(line,1);
            break;

          // 1/29/98 jff end of added SR linedef types

        }
      break;

    // Buttons (retriggerable switches)
    case 42:
      // Close Door
      if (EV_DoDoor(line,close))
        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,open))
        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;
}