components/prboom/p_doors.c
//
// EV_DoLockedDoor
//
// Handle opening a tagged locked door
//
// Passed the line activating the door, the type of door,
// and the thing that activated the line
// Returns true if a thinker created
//
EV_DoLockedDoor
Handle opening a tagged locked door

Passed the line activating the door, the type of door,
and the thing that activated the line
Returns true if a thinker created
EV_DoLockedDoor Handle opening a tagged locked door Passed the line activating the door the type of door and the thing that activated the line Returns true if a thinker created
int EV_DoLockedDoor
( line_t* line,
  vldoor_e  type,
  mobj_t* thing )
{
  player_t* p;
  p = thing->player;
  if (!p)
    return 0;
  switch(line->special)
  {
    case 99:  
    case 133:
      if (!p->cards[it_bluecard] && !p->cards[it_blueskull])
      {
        p->message = s_PD_BLUEO;             
        S_StartSound(p->mo,sfx_oof);         
        return 0;
      }
      break;
    case 134: 
    case 135:
      if (!p->cards[it_redcard] && !p->cards[it_redskull])
      {
        p->message = s_PD_REDO;              
        S_StartSound(p->mo,sfx_oof);         
        return 0;
      }
      break;
    case 136: 
    case 137:
      if (!p->cards[it_yellowcard] && !p->cards[it_yellowskull])
      {
        p->message = s_PD_YELLOWO;           
        S_StartSound(p->mo,sfx_oof);         
        return 0;
      }
      break;
  }
  return EV_DoDoor(line,type);
}
int EV_DoLockedDoor ( line_t * line , vldoor_e type , mobj_t * thing ) { player_t * p ; p = thing -> player ; if ( ! p ) return 0 ; switch ( line -> special ) { case 99 : case 133 : if ( ! p -> cards [ it_bluecard ] && ! p -> cards [ it_blueskull ] ) { p -> message = s_PD_BLUEO ; S_StartSound ( p -> mo , sfx_oof ) ; return 0 ; } break ; case 134 : case 135 : if ( ! p -> cards [ it_redcard ] && ! p -> cards [ it_redskull ] ) { p -> message = s_PD_REDO ; S_StartSound ( p -> mo , sfx_oof ) ; return 0 ; } break ; case 136 : case 137 : if ( ! p -> cards [ it_yellowcard ] && ! p -> cards [ it_yellowskull ] ) { p -> message = s_PD_YELLOWO ; S_StartSound ( p -> mo , sfx_oof ) ; return 0 ; } break ; } return EV_DoDoor ( line , type ) ; }
EV_DoLockedDoor
Handle opening a tagged locked door
EV_DoLockedDoor Handle opening a tagged locked door
// only players can open locked doors // check type of linedef, and if key is possessed to open it // Blue Lock // Ty 03/27/98 - externalized // killough 3/20/98 // Red Lock // Ty 03/27/98 - externalized // killough 3/20/98 // Yellow Lock // Ty 03/27/98 - externalized // killough 3/20/98 // got the key, so open the door