⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 f_finale.c

📁 The source code of Doom legacy for windows
💻 C
📖 第 1 页 / 共 2 页
字号:
    finalestage = 2;    castframes = 0;    castonmelee = 0;    castattacking = false;    S_ChangeMusic(mus_evil, true);}//// F_CastTicker//void F_CastTicker (void){    int         st;    int         sfx;    if (--casttics > 0)        return;                 // not time to change state yet    if (caststate->tics == -1 || caststate->nextstate == S_NULL)    {        // switch from deathstate to next monster        castnum++;        castdeath = false;        if (castorder[castnum].name == NULL)            castnum = 0;        if (mobjinfo[castorder[castnum].type].seesound)            S_StartSound (NULL, mobjinfo[castorder[castnum].type].seesound);        caststate = &states[mobjinfo[castorder[castnum].type].seestate];        castframes = 0;    }    else    {        // just advance to next state in animation        if (caststate == &states[S_PLAY_ATK1])            goto stopattack;    // Oh, gross hack!        st = caststate->nextstate;        caststate = &states[st];        castframes++;        // sound hacks....        switch (st)        {          case S_PLAY_ATK1:     sfx = sfx_dshtgn; break;          case S_POSS_ATK2:     sfx = sfx_pistol; break;          case S_SPOS_ATK2:     sfx = sfx_shotgn; break;          case S_VILE_ATK2:     sfx = sfx_vilatk; break;          case S_SKEL_FIST2:    sfx = sfx_skeswg; break;          case S_SKEL_FIST4:    sfx = sfx_skepch; break;          case S_SKEL_MISS2:    sfx = sfx_skeatk; break;          case S_FATT_ATK8:          case S_FATT_ATK5:          case S_FATT_ATK2:     sfx = sfx_firsht; break;          case S_CPOS_ATK2:          case S_CPOS_ATK3:          case S_CPOS_ATK4:     sfx = sfx_shotgn; break;          case S_TROO_ATK3:     sfx = sfx_claw; break;          case S_SARG_ATK2:     sfx = sfx_sgtatk; break;          case S_BOSS_ATK2:          case S_BOS2_ATK2:          case S_HEAD_ATK2:     sfx = sfx_firsht; break;          case S_SKULL_ATK2:    sfx = sfx_sklatk; break;          case S_SPID_ATK2:          case S_SPID_ATK3:     sfx = sfx_shotgn; break;          case S_BSPI_ATK2:     sfx = sfx_plasma; break;          case S_CYBER_ATK2:          case S_CYBER_ATK4:          case S_CYBER_ATK6:    sfx = sfx_rlaunc; break;          case S_PAIN_ATK3:     sfx = sfx_sklatk; break;          default: sfx = 0; break;        }        if (sfx)            S_StartSound (NULL, sfx);    }    if (castframes == 12)    {        // go into attack frame        castattacking = true;        if (castonmelee)            caststate=&states[mobjinfo[castorder[castnum].type].meleestate];        else            caststate=&states[mobjinfo[castorder[castnum].type].missilestate];        castonmelee ^= 1;        if (caststate == &states[S_NULL])        {            if (castonmelee)                caststate=                    &states[mobjinfo[castorder[castnum].type].meleestate];            else                caststate=                    &states[mobjinfo[castorder[castnum].type].missilestate];        }    }    if (castattacking)    {        if (castframes == 24            ||  caststate == &states[mobjinfo[castorder[castnum].type].seestate] )        {          stopattack:            castattacking = false;            castframes = 0;            caststate = &states[mobjinfo[castorder[castnum].type].seestate];        }    }    casttics = caststate->tics;    if (casttics == -1)        casttics = 15;}//// F_CastResponder//boolean F_CastResponder (event_t* ev){    if (ev->type != ev_keydown)        return false;    if (castdeath)        return true;                    // already in dying frames    // go into death frame    castdeath = true;    caststate = &states[mobjinfo[castorder[castnum].type].deathstate];    casttics = caststate->tics;    castframes = 0;    castattacking = false;    if (mobjinfo[castorder[castnum].type].deathsound)        S_StartSound (NULL, mobjinfo[castorder[castnum].type].deathsound);    return true;}#define CASTNAME_Y   180                // where the name of actor is drawnvoid F_CastPrint (char* text){    V_DrawString ((BASEVIDWIDTH-V_StringWidth (text))/2, CASTNAME_Y, text);}//// F_CastDrawer//void V_DrawPatchFlipped (int x, int y, int scrn, patch_t *patch);void F_CastDrawer (void){    spritedef_t*        sprdef;    spriteframe_t*      sprframe;    int                 lump;    boolean             flip;    patch_t*            patch;    // erase the entire screen to a background    //V_DrawPatch (0,0,0, W_CachePatchName ("BOSSBACK", PU_CACHE));    D_PageDrawer ("BOSSBACK");    F_CastPrint (castorder[castnum].name);    // draw the current frame in the middle of the screen    sprdef = &sprites[caststate->sprite];    sprframe = &sprdef->spriteframes[ caststate->frame & FF_FRAMEMASK];    lump = sprframe->lumppat[0];      //Fab: see R_InitSprites for more    flip = (boolean)sprframe->flip[0];    patch = W_CachePatchNum (lump, PU_CACHE);    if (flip)        V_DrawScaledPatchFlipped (BASEVIDWIDTH>>1,170,0,patch);    else        V_DrawScaledPatch (BASEVIDWIDTH>>1,170,0,patch);}//// F_DrawPatchCol//static void F_DrawPatchCol (int           x,  patch_t*      patch,  int           col ){    column_t*   column;    byte*       source;    byte*       dest;    byte*       desttop;    int         count;    column = (column_t *)((byte *)patch + LONG(patch->columnofs[col]));    desttop = screens[0]+x*vid.dupx;    // step through the posts in a column    while (column->topdelta != 0xff )    {        source = (byte *)column + 3;        dest = desttop + column->topdelta*vid.width;        count = column->length;        while (count--)        {            int dupycount=vid.dupy;            while(dupycount--)            {                int dupxcount=vid.dupx;                while(dupxcount--)                     *dest++ = *source;                dest += (vid.width-vid.dupx);            }            source++;        }        column = (column_t *)(  (byte *)column + column->length + 4 );    }}//// F_BunnyScroll//void F_BunnyScroll (void){    int         scrolled;    int         x;    patch_t*    p1;    patch_t*    p2;    char        name[10];    int         stage;    static int  laststage;    p1 = W_CachePatchName ("PFUB2", PU_LEVEL);    p2 = W_CachePatchName ("PFUB1", PU_LEVEL);    V_MarkRect (0, 0, vid.width, vid.height);    scrolled = 320 - (finalecount-230)/2;    if (scrolled > 320)        scrolled = 320;    if (scrolled < 0)        scrolled = 0;    //faB:do equivalent for hw mode ?    if (rendermode==render_soft)    {        for ( x=0 ; x<320 ; x++)        {            if (x+scrolled < 320)                F_DrawPatchCol (x, p1, x+scrolled);            else                F_DrawPatchCol (x, p2, x+scrolled - 320);        }    }    else    {        if( scrolled>0 )            V_DrawScaledPatch(320-scrolled,0, 0, p2 );        if( scrolled<320 )            V_DrawScaledPatch(-scrolled,0, 0, p1 );    }    if (finalecount < 1130)        return;    if (finalecount < 1180)    {        V_DrawScaledPatch ((320-13*8)/2,                           (200-8*8)/2,0, W_CachePatchName ("END0",PU_CACHE));        laststage = 0;        return;    }    stage = (finalecount-1180) / 5;    if (stage > 6)        stage = 6;    if (stage > laststage)    {        S_StartSound (NULL, sfx_pistol);        laststage = stage;    }    sprintf (name,"END%i",stage);    V_DrawScaledPatch ((320-13*8)/2, (200-8*8)/2,0, W_CachePatchName (name,PU_CACHE));}/*==================== F_DemonScroll===================*/void F_DemonScroll(void){        int scrolled;    scrolled = (finalecount-70)/3;    if (scrolled > 200)        scrolled = 200;    if (scrolled < 0)        scrolled = 0;    if( scrolled<200 )        V_DrawRawScreen(0, scrolled*vid.dupy, W_CheckNumForName("FINAL1"),320,200);    if( scrolled>0 )        V_DrawRawScreen(0, (scrolled-200)*vid.dupy, W_CheckNumForName("FINAL2"),320,200);}/*==================== F_DrawUnderwater===================*/void F_DrawUnderwater(void){    static boolean underwawa;    switch(finalestage)    {        case 1:            if(!underwawa)            {                underwawa = true;                I_SetPalette(W_CacheLumpName("E2PAL", PU_CACHE));                V_DrawRawScreen(0, 0, W_CheckNumForName("E2END"),320,200);            }            break;        case 2:            V_DrawRawScreen(0, 0, W_CheckNumForName("TITLE"),320,200);            //D_StartTitle(); // go to intro/demo mode.    }}//// F_Drawer//void F_Drawer (void){    if (finalestage == 2)    {        F_CastDrawer ();        return;    }    if (!finalestage)        F_TextWrite ();    else    {        if( gamemode == heretic )        {            switch (gameepisode)            {                case 1:                    if(W_CheckNumForName("e2m1")==-1)                        V_DrawRawScreen(0, 0, W_CheckNumForName("ORDER"),320,200);                    else                        V_DrawRawScreen(0, 0, W_CheckNumForName("CREDIT"),320,200);                    break;                case 2:                    F_DrawUnderwater();                    break;                case 3:                    F_DemonScroll();                    break;                case 4: // Just show credits screen for extended episodes                case 5:                    V_DrawRawScreen(0, 0, W_CheckNumForName("CREDIT"),320,200);                    break;            }        }        else        switch (gameepisode)        {          case 1:            if ( gamemode == retail )              V_DrawScaledPatch (0,0,0,                         W_CachePatchName(text[CREDIT_NUM],PU_CACHE));            else              V_DrawScaledPatch (0,0,0,                         W_CachePatchName(text[HELP2_NUM],PU_CACHE));            break;          case 2:            V_DrawScaledPatch(0,0,0,                        W_CachePatchName(text[VICTORY2_NUM],PU_CACHE));            break;          case 3:            F_BunnyScroll ();            break;          case 4:            V_DrawScaledPatch (0,0,0,                         W_CachePatchName(text[ENDPIC_NUM],PU_CACHE));            break;        }    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -