예제 #1
0
//
// Handle gamepad/joystick buttons
//
static void FE_HandleJoyButtons(int joybuttons)
{
    femenuitem_t *mi = &(currentFEMenu->items[currentFEMenu->itemon]);
    int i;

    // exiting?
    if(frontend_state == FE_STATE_EXITING)
    {
        if(joybmenu_confirm >= 0 && (joybuttons & (1 << joybmenu_confirm)))
            I_Quit();
        else if(joybuttons)
        {
            frontend_state = FE_STATE_MAINMENU;
            I_StartVoice(NULL);
        }
        return;
    }
    else if(frontend_state != FE_STATE_MAINMENU)
        return; // no joy input handled here except in main menu state

	for(i = 0; i < JOY_NUM_BUTTONS + 16; i++)
    {
        if(!(joybuttons & (1 << i)))
            continue;

        i_seejoysticks = true;
        i_seemouses = false;

        if(i == joybmenu_back)
        {
            FE_PopMenu(false);
        }
        else if(i == joybmenu_up)
        {
            FE_HandleMenuUp();
        }
        else if(i == joybmenu_down)
        {
            FE_HandleMenuDown();
        }
        else if(i == joybmenu_left)
        {
            FE_HandleMenuLeft(mi);
        }
        else if(i == joybmenu_right)
        {
            FE_HandleMenuRight(mi);
        }
        else if(i == joybmenu_forward)
        {
            FE_HandleMenuForward(mi);
        }
    }
}
예제 #2
0
//
// F_StartCast
//
// haleyjd 09/13/10: [STRIFE] Heavily modified, yet unused.
// Evidence suggests this was meant to be started from a menu item.
// See m_menu.c for more info.
// [SVE]: completed.
//
void F_StartCast (void)
{
    usergame = false;
    gameaction = ga_nothing;
    viewactive = false;
    automapactive = false;
    castnum = 0;
    gamestate = GS_FINALE;
    caststate = &states[mobjinfo[castorder[castnum].type].seestate];
    casttics = caststate->tics;
    if(casttics > 50)
        casttics = 50;
    wipegamestate = -1;             // force a screen wipe
    castdeath = false;
    finalestage = F_STAGE_CAST;
    castframes = 0;
    castonmelee = 0;
    castattacking = false;
    S_ChangeMusic(mus_action, 1);
    I_StartVoice(NULL); // sorry Macil, be quiet for a sec :P
}
예제 #3
0
파일: p_dialog.c 프로젝트: derek57/WIP
//
// P_DialogStart
//
// villsa [STRIFE] New function
//
void P_DialogStart(player_t *player)
{
    int i = 0;
    int pic;
    int rnd = 0;
    char* byetext;
    int jumptoconv;

    if(menuactive || netgame)
        return;

    // are we facing towards our NPC?
    P_AimLineAttack(player->mo, player->mo->angle, (128*FRACUNIT));
    if(!linetarget)
    {
        P_AimLineAttack(player->mo, player->mo->angle + (ANG90/16), (128*FRACUNIT));
        if(!linetarget)
            P_AimLineAttack(player->mo, player->mo->angle - (ANG90/16), (128*FRACUNIT));
    }

    if(!linetarget)
       return;

    // already in combat, can't talk to it
    if(linetarget->flags & MF_NODIALOG)
       return;

    // set pointer to the character talking
    dialogtalker = linetarget;

    // play a sound
    if(player == &players[consoleplayer])
       S_StartSound(0, sfx_radio);

    linetarget->target = player->mo;         // target the player
    dialogtalker->reactiontime = 2;          // set reactiontime
    dialogtalkerangle = dialogtalker->angle; // remember original angle

    // face talker towards player
    A_FaceTarget(dialogtalker);

    // face towards NPC's direction
    player->mo->angle = R_PointToAngle2(player->mo->x,
                                        player->mo->y,
                                        dialogtalker->x,
                                        dialogtalker->y);
    // set pointer to player talking
    dialogplayer = player;

    // haleyjd 09/08/10: get any stored dialog state from this object
    jumptoconv = linetarget->miscdata;

    // check item requirements
    while(1)
    {
        int i = 0;
        currentdialog = P_DialogFind(linetarget->type, jumptoconv);

        // dialog's jumptoconv equal to 0? There's nothing to jump to.
        if(currentdialog->jumptoconv == 0)
            break;

        // villsa 09/08/10: converted into for loop
        for(i = 0; i < MDLG_MAXITEMS; i++)
        {
            // if the item is non-zero, the player must have at least one in his
            // or her inventory
            if(currentdialog->checkitem[i] != 0 &&
                P_PlayerHasItem(dialogplayer, currentdialog->checkitem[i]) < 1)
                break;
        }

        if(i < MDLG_MAXITEMS) // didn't find them all? this is our dialog!
            break;

        jumptoconv = currentdialog->jumptoconv;
    }

    M_DialogDimMsg(20, 28, currentdialog->text, false);
    dialogtext = P_DialogGetMsg(currentdialog->text);

    // get states
    dialogtalkerstates = P_DialogGetStates(linetarget->type);

    // have talker greet the player
    if(dialogtalkerstates->greet)
        P_SetMobjState(dialogtalker, dialogtalkerstates->greet);

    // get talker's name
    if(currentdialog->name[0])
        dialogname = currentdialog->name;
    else
    {
        // use a fallback:
        if(mobjinfo[linetarget->type].name)
            dialogname = DEH_String(mobjinfo[linetarget->type].name); // mobjtype name
        else
            dialogname = DEH_String("Person"); // default name - like Joe in Doom 3 :P
    }

    // setup number of choices to choose from
    for(i = 0; i < MDLG_MAXCHOICES; i++)
    {
        if(!currentdialog->choices[i].giveitem)
            break;
    }

    // set number of choices to menu
    dialogmenu.numitems = i + 1;

    rnd = M_Random() % 3;

    // setup dialog menu
    M_StartControlPanel();
    menupause = false;
    menuindialog = true;
    menupausetime = gametic + 17;
    currentMenu = &dialogmenu;

    if(i >= dialogmenu.lastOn)
        itemOn = dialogmenu.lastOn;
    else
        itemOn = 0;

    // get backdrop
    pic = W_CheckNumForName(currentdialog->backpic);
    dialogbgpiclumpnum = pic;
    if(pic != -1)
        V_DrawPatchDirect(0, 0, W_CacheLumpNum(pic, PU_CACHE));

    // get voice
    I_StartVoice(currentdialog->voice);

    // get bye text
    switch(rnd)
    {
    case 2:
        byetext = DEH_String("BYE!");
        break;
    case 1:
        byetext = DEH_String("Thanks, Bye!");
        break;
    default:
    case 0:
        byetext = DEH_String("See you later!");
        break;
    }

    DEH_snprintf(dialoglastmsgbuffer, sizeof(dialoglastmsgbuffer),
                 "%d) %s", i + 1, byetext);
}
예제 #4
0
파일: p_dialog.c 프로젝트: derek57/WIP
//
// P_DialogDoChoice
//
// [STRIFE] New function
// haleyjd 09/05/10: Handles making a choice in a dialog. Installed as the
// callback for all items in the dialogmenu structure.
//
void P_DialogDoChoice(int choice)
{
    int i = 0, nextdialog = 0;
    boolean candochoice = true;
    char *message = NULL;
    mapdlgchoice_t *currentchoice;

    if(choice == -1)
        choice = dialogmenu.numitems - 1;

    currentchoice = &(currentdialog->choices[choice]);

    I_StartVoice(NULL); // STRIFE-TODO: verify (should stop previous voice I believe)

    // villsa 09/08/10: converted into for loop
    for(i = 0; i < MDLG_MAXITEMS; i++)
    {
        if(P_PlayerHasItem(dialogplayer, currentchoice->needitems[i]) <
                                         currentchoice->needamounts[i])
        {
            candochoice = false; // nope, missing something
        }
    }

    if(choice != dialogmenu.numitems - 1 && candochoice)
    {
        int item;

        message = currentchoice->textok;
        if(dialogtalkerstates->yes)
            P_SetMobjState(dialogtalker, dialogtalkerstates->yes);

        item = currentchoice->giveitem;
        if(item < 0 || 
           P_GiveItemToPlayer(dialogplayer, 
                              states[mobjinfo[item].spawnstate].sprite, 
                              item))
        {
            // if successful, take needed items
            int count = 0;
            // villsa 09/08/10: converted into for loop
            for(count = 0; count < MDLG_MAXITEMS; count++)
            {
                P_TakeDialogItem(dialogplayer, 
                                 currentchoice->needitems[count],
                                 currentchoice->needamounts[count]);
            }
        }
        else
            message = DEH_String("You seem to have enough!");

        // store next dialog into the talking actor
        nextdialog = currentchoice->next;
        if(nextdialog != 0)
            dialogtalker->miscdata = (byte)(abs(nextdialog));
    }
    else
    {
        // not successful
        message = currentchoice->textno;
        if(dialogtalkerstates->no)
            P_SetMobjState(dialogtalker, dialogtalkerstates->no);
    }
    
    if(choice != dialogmenu.numitems - 1)
    {
        int objective;
        char *objlump;

        if((objective = currentchoice->objective))
        {
            DEH_snprintf(mission_objective, OBJECTIVE_LEN, "log%i", objective);
            objlump = W_CacheLumpName(mission_objective, PU_CACHE);
            M_StringCopy(mission_objective, objlump, OBJECTIVE_LEN);
        }
        // haleyjd 20130301: v1.31 hack: if first char of message is a period,
        // clear the player's message. Is this actually used anywhere?
        if(gameversion == exe_strife_1_31 && message[0] == '.')
            message = NULL;
        dialogplayer->message = message;
    }

    dialogtalker->angle = dialogtalkerangle;
    dialogplayer->st_update = true;
    M_ClearMenus(0);

    if(nextdialog >= 0 || gameaction == ga_victory) // Macil hack
        menuindialog = false;
    else
        P_DialogStart(dialogplayer);
}
예제 #5
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 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;
}
예제 #6
0
//
// Prompt to exit the game
//
void FE_CmdExit(void)
{
    frontend_state = FE_STATE_EXITING;
    curCharacter   = FE_GetCharacter();
    I_StartVoice(curCharacter->voice);
}
예제 #7
0
//
// Handle a keydown event
//
static void FE_HandleKey(SDL_Event *ev)
{
    femenuitem_t *mi = &(currentFEMenu->items[currentFEMenu->itemon]);

    int key = TranslateKey(&(ev->key.keysym));

    // exiting state
    if(frontend_state == FE_STATE_EXITING)
    {
        if(key == key_menu_confirm)
            I_Quit();
        else
        {
            frontend_state = FE_STATE_MAINMENU;
            I_StartVoice(NULL);
        }
        return;
    }

    // key input state
    if(frontend_state == FE_STATE_KEYINPUT)
    {
        if(FE_SetKeybinding(fe_kbitem, key))
            frontend_state = FE_STATE_MAINMENU;
        return;
    }

    // mouse button input state
    if(frontend_state == FE_STATE_MBINPUT)
    {
        if(key == KEY_BACKSPACE)
            FE_ClearMouseButton(fe_kbitem);
        return;
    }

    if(key == key_menu_forward)
    {
        FE_HandleMenuForward(mi);
    }
    else if(key == key_menu_left)
    {
        FE_HandleMenuLeft(mi);
    }
    else if(key == key_menu_right)
    {
        FE_HandleMenuRight(mi);
    }
    else if(key == key_menu_up)
    {
        FE_HandleMenuUp();
    }
    else if(key == key_menu_down)
    {
        FE_HandleMenuDown();
    }
    else if(key == key_menu_activate)
    {
        FE_PopMenu(false);
    }
    else
    {
        char ch;

        // jump to item by first letter
		if(!ev->key.keysym.sym || ev->key.keysym.sym >= 0x7f)
            return;

		ch = (char)(ev->key.keysym.sym & 0x7f);
        ch = tolower(ch);

        if(isalnum(ch))
        {
            int n = currentFEMenu->itemon;
            do
            {
                ++n;
                if(currentFEMenu->items[n].type == FE_MITEM_END)
                    n = 0;

                if(FE_IsSelectable(&(currentFEMenu->items[n])))
                {
                    if(tolower(currentFEMenu->items[n].description[0]) == ch)
                    {
                        if(n != currentFEMenu->itemon)
                        {
                            S_StartSound(NULL, sfx_pstop);
                            if(merchantOn)
                                FE_MerchantSetState(S_MRGT_00);
                        }
                        currentFEMenu->itemon = n;
                        break;
                    }
                }
            }
            while(n != currentFEMenu->itemon);
        }
    }
}
예제 #8
0
// 
// F_DoSlideShow
//
// [STRIFE] New function
// haleyjd 09/13/10: Handles slideshow states. Begging to be tabulated!
//
static void F_DoSlideShow(void)
{
    patch_t *patch;

    switch(slideshow_state)
    {
    case SLIDE_UNKNOWN: // state #0, seems to be unused
        slideshow_tics = 700;
        slideshow_state = SLIDE_EXIT;
        // falls through into state 1, so above is pointless? ...

    case SLIDE_PROGRAMMER1: // state #1
        slideshow_panel = DEH_String("SS2F1");
        I_StartVoice(DEH_String("MAC10"));
        slideshow_state = SLIDE_PROGRAMMER2;
        slideshow_tics = 315;
        break;
    case SLIDE_PROGRAMMER2: // state #2
        slideshow_panel = DEH_String("SS2F2");
        I_StartVoice(DEH_String("MAC11"));
        slideshow_state = SLIDE_PROGRAMMER3;
        slideshow_tics = 350;
        break;
    case SLIDE_PROGRAMMER3: // state #3
        slideshow_panel = DEH_String("SS2F3");
        I_StartVoice(DEH_String("MAC12"));
        slideshow_state = SLIDE_PROGRAMMER4;
        slideshow_tics = 420;
        break;
    case SLIDE_PROGRAMMER4: // state #4
        slideshow_panel = DEH_String("SS2F4");
        I_StartVoice(DEH_String("MAC13"));
        slideshow_state = SLIDE_EXITHACK; // End of slides
        slideshow_tics = 595;
        break;

    case SLIDE_SIGIL1: // state #5
        slideshow_panel = DEH_String("SS3F1");
        I_StartVoice(DEH_String("MAC16"));
        slideshow_state = SLIDE_SIGIL2;
        slideshow_tics = 350;
        break;
    case SLIDE_SIGIL2: // state #6
        slideshow_panel = DEH_String("SS3F2");
        I_StartVoice(DEH_String("MAC17"));
        slideshow_state = SLIDE_SIGIL3;
        slideshow_tics = 420;
        break;
    case SLIDE_SIGIL3: // state #7
        slideshow_panel = DEH_String("SS3F3");
        I_StartVoice(DEH_String("MAC18"));
        slideshow_tics = 420;
        slideshow_state = SLIDE_SIGIL4;
        break;
    case SLIDE_SIGIL4: // state #8
        slideshow_panel = DEH_String("SS3F4");
        I_StartVoice(DEH_String("MAC19"));
        slideshow_tics = 385;
        slideshow_state = SLIDE_EXITHACK; // End of slides
        break;

    case SLIDE_GOODEND1: // state #10
        slideshow_panel = DEH_String("SS4F1");
        S_StartMusic(mus_happy);
        I_StartVoice(DEH_String("RIE01"));
        slideshow_state = SLIDE_GOODEND2;
        slideshow_tics = 455;
        break;
    case SLIDE_GOODEND2: // state #11
        slideshow_panel = DEH_String("SS4F2");
        I_StartVoice(DEH_String("BBX01"));
        slideshow_state = SLIDE_GOODEND3;
        slideshow_tics = 385;
        break;
    case SLIDE_GOODEND3: // state #12
        slideshow_panel = DEH_String("SS4F3");
        I_StartVoice(DEH_String("BBX02"));
        slideshow_state = SLIDE_GOODEND4;
        slideshow_tics = 490;
        break;
    case SLIDE_GOODEND4: // state #13
        slideshow_panel = DEH_String("SS4F4");
        slideshow_state = SLIDE_EXIT; // Go to end credits
        slideshow_tics = 980;
        break;

    case SLIDE_BADEND1: // state #14
        S_StartMusic(mus_sad);
        slideshow_panel = DEH_String("SS5F1");
        I_StartVoice(DEH_String("SS501b"));
        slideshow_state = SLIDE_BADEND2;
        slideshow_tics = 385;
        break;
    case SLIDE_BADEND2: // state #15
        slideshow_panel = DEH_String("SS5F2");
        I_StartVoice(DEH_String("SS502b"));
        slideshow_state = SLIDE_BADEND3;
        slideshow_tics = 350;
        break;
    case SLIDE_BADEND3: // state #16
        slideshow_panel = DEH_String("SS5F3");
        I_StartVoice(DEH_String("SS503b"));
        slideshow_state = SLIDE_EXIT; // Go to end credits
        slideshow_tics = 385;
        break;

    case SLIDE_BLAHEND1: // state #17
        S_StartMusic(mus_end);
        slideshow_panel = DEH_String("SS6F1");
        I_StartVoice(DEH_String("SS601A"));
        slideshow_state = SLIDE_BLAHEND2;
        slideshow_tics = 280;
        break;
    case SLIDE_BLAHEND2: // state #18
        S_StartMusic(mus_end);
        slideshow_panel = DEH_String("SS6F2");
        I_StartVoice(DEH_String("SS602A"));
        slideshow_state = SLIDE_BLAHEND3;
        slideshow_tics = 280;
        break;
    case SLIDE_BLAHEND3: // state #19
        S_StartMusic(mus_end);
        slideshow_panel = DEH_String("SS6F3");
        I_StartVoice(DEH_String("SS603A"));
        slideshow_state = SLIDE_EXIT; // Go to credits
        slideshow_tics = 315;
        break;

    case SLIDE_DEMOEND1: // state #25 - only exists in 1.31
        slideshow_panel = DEH_String("PANEL7");
        slideshow_tics = 175;
        slideshow_state = SLIDE_DEMOEND2;
        break;
    case SLIDE_DEMOEND2: // state #26 - ditto
        slideshow_panel = DEH_String("VELLOGO");
        slideshow_tics = 175;
        slideshow_state = SLIDE_EXIT; // Go to end credits
        break;

    case SLIDE_EXITHACK: // state -99: super hack state
        gamestate = GS_LEVEL;
        P_DialogStartP1();
        break;
    case SLIDE_HACKHACK: // state -9: unknown bizarre unused state
        S_StartSound(NULL, sfx_rifle);
        slideshow_tics = 3150;
        break;
    case SLIDE_EXIT: // state -1: proceed to next finale stage
        finalecount = 0;
        finalestage = F_STAGE_ARTSCREEN;
        wipegamestate = -1;
        S_ChangeMusic(mus_fast, 1); // [SVE]: loop the ending music.
        // haleyjd 20130301: The ONLY glitch fixed in 1.31 of Strife
        // *would* be something this insignificant, of course!
        if(gameversion != exe_strife_1_31)
            slideshow_state = SLIDE_CHOCO; // haleyjd: see below...
        break;
    case SLIDE_CHOCO: 
        // haleyjd 09/14/10: This wouldn't be necessary except that Choco
        // doesn't support the V_MarkRect dirty rectangles system. This
        // just so happens to have hidden the fact that the ending
        // does a screenfade every ~19 seconds due to remaining stuck in
        // SLIDE_EXIT state above, UNLESS the menus were active - the
        // V_MarkRect calls in the menu system cause it to be visible. 
        // This means that in order to get the same behavior as the vanilla
        // EXE, I need different code. So, come to this state and only set 
        // wipegamestate if menuactive is true.
        finalecount = 0;
        finalestage = F_STAGE_ARTSCREEN;
        if(menuactive)
            wipegamestate = -1;
        S_StartMusic(mus_fast);
        slideshow_state = SLIDE_CHOCO; // remain here.
        break;
    default:
        break;
    }

    finalecount = 0;
    if(gameversion != exe_strife_1_31) // See above. This was removed in 1.31.
    {
       patch = (patch_t *)W_CacheLumpName(DEH_String("PANEL0"), PU_CACHE);
       V_DrawPatch(0, 0, patch);
    }
}
예제 #9
0
//
// This cycles through the demo sequences.
// FIXME - version dependend demo numbers?
//
// [STRIFE] Modified for the opening slideshow and the exit screen
//
void D_DoAdvanceDemo (void)
{
    players[consoleplayer].playerstate = PST_LIVE;  // not reborn
    advancedemo = false;
    usergame = false;               // no save / end game here
    paused = false;
    gameaction = ga_nothing;
    
    // villsa 09/12/10: [STRIFE] converted pagetics to ticrate
    switch (demosequence)
    {
    case -5: // exit the game
        I_Quit();
        return;
    case -4: // show exit screen
        menuactive = false;
        pagetic = 3*TICRATE;
        gamestate = GS_DEMOSCREEN;
        pagename = DEH_String("PANEL7");
        S_StartMusic(mus_fast);
        if(isdemoversion)
            demosequence = -3; // show Velocity logo
        else
            demosequence = -5; // exit
        return;
    case -3: // show Velocity logo for demo version
        pagetic = 6*TICRATE;
        gamestate = GS_DEMOSCREEN;
        pagename = DEH_String("vellogo");
        demosequence = -5; // exit
        return;
    case -2: // title screen
        pagetic = 6*TICRATE;
        gamestate = GS_DEMOSCREEN;
        pagename = DEH_String("TITLEPIC");
        S_StartMusic(mus_logo);
        demosequence = -1; // start intro cinematic
        return;
    case -1: // start of intro cinematic
        pagetic = 10;
        gamestate = GS_DEMOSCREEN;
        pagename = DEH_String("PANEL0");
        S_StartSound(NULL, sfx_rb2act);
        wipegamestate = -1;
        break;
    case 0: // Rogue logo
        pagetic = 4*TICRATE;
        gamestate = GS_DEMOSCREEN;
        pagename = DEH_String("RGELOGO");
        wipegamestate = -1;
        break;
    case 1:
        pagetic = 7*TICRATE;              // The comet struck our planet without
        gamestate = GS_DEMOSCREEN;        // warning.We lost our paradise in a 
        pagename = DEH_String("PANEL1");  // single, violent stroke.
        I_StartVoice(DEH_String("pro1")); 
        S_StartMusic(mus_intro);
        break;
    case 2:
        pagetic = 9*TICRATE;              // The impact released a virus which 
        gamestate = GS_DEMOSCREEN;        // swept through the land and killed 
        pagename = DEH_String("PANEL2");  // millions. They turned out to be 
        I_StartVoice(DEH_String("pro2")); // the lucky ones...
        break;
    case 3:
        pagetic = 12*TICRATE;             // For those that did not die became 
        gamestate = GS_DEMOSCREEN;        // mutations of humanity. Some became
        pagename = DEH_String("PANEL3");  // fanatics who heard the voice of a
        I_StartVoice(DEH_String("pro3")); // malignant God in their heads, and 
        break;                            // called themselves the Order.
    case 4:
        pagetic = 11*TICRATE;             // Those of us who were deaf to this
        pagename = DEH_String("PANEL4");  // voice suffer horribly and are 
        gamestate = GS_DEMOSCREEN;        // forced to serve these ruthless
        I_StartVoice(DEH_String("pro4")); // psychotics, who wield weapons more
        break;                            // powerful than anything we can muster.
    case 5:
        pagetic = 10*TICRATE;             // They destroy our women and children,
        gamestate = GS_DEMOSCREEN;        // so that we must hide them underground,
        pagename = DEH_String("PANEL5");  // and live like animals in constant
        I_StartVoice(DEH_String("pro5")); // fear for our lives.
        break;
    case 6:                               // But there are whispers of discontent.
        pagetic = 16*TICRATE;             // If we organize, can we defeat our
        gamestate = GS_DEMOSCREEN;        // masters? Weapons are being stolen,
        pagename = DEH_String("PANEL6");  // soldiers are being trained. A 
        I_StartVoice(DEH_String("pro6")); // Movement is born! Born of lifelong 
        break;                            // STRIFE!
    case 7: // titlepic again - unused...
        pagetic = 9*TICRATE;
        gamestate = GS_DEMOSCREEN;
        pagename = DEH_String("TITLEPIC");
        wipegamestate = -1;
        break;
    case 8: // demo
        ClearTmp();
        pagetic = 9*TICRATE;
        G_DeferedPlayDemo(DEH_String("demo1"));
        break;
    case 9: // velocity logo? - unused...
        pagetic = 6*TICRATE;
        gamestate = GS_DEMOSCREEN;
        pagename = DEH_String("vellogo");
        wipegamestate = -1;
        break;
    case 10: // credits
        gamestate = GS_DEMOSCREEN;
        pagetic = 12*TICRATE;
        pagename = DEH_String("CREDIT");
        wipegamestate = -1;
        break;
    default:
        break;
    }

    ++demosequence;

    if(demosequence > 11)
        demosequence = -2;
    if(demosequence == 7 || demosequence == 9)
        ++demosequence;
}