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

📄 wi_stuff.c

📁 The source code of Doom legacy for windows
💻 C
📖 第 1 页 / 共 4 页
字号:
    WI_drawRancking("Buchholz",85,RANKINGY,fragtab,scorelines,false,whiteplayer);    // count individuel    scorelines = 0;    for (i=0; i<MAXPLAYERS; i++)        if (playeringame[i])        {            fragtab[scorelines].count = 0;            for (j=0; j<MAXPLAYERS; j++)                if (playeringame[j] && i!=j)                {                     if(dm_frags[i][j]>dm_frags[j][i])                         fragtab[scorelines].count+=3;                     else                         if(dm_frags[i][j]==dm_frags[j][i])                              fragtab[scorelines].count+=1;                }            fragtab[scorelines].num = i;            fragtab[scorelines].color = players[i].skincolor;            fragtab[scorelines].name  = player_names[i];            scorelines++;        }    WI_drawRancking("indiv.",165,RANKINGY,fragtab,scorelines,false,whiteplayer);    // count deads    scorelines = 0;    for (i=0; i<MAXPLAYERS; i++)        if (playeringame[i])        {            fragtab[scorelines].count = 0;            for (j=0; j<MAXPLAYERS; j++)                if (playeringame[j])                     fragtab[scorelines].count+=dm_frags[j][i];            fragtab[scorelines].num   = i;            fragtab[scorelines].color = players[i].skincolor;            fragtab[scorelines].name  = player_names[i];            scorelines++;        }    WI_drawRancking("deads",245,RANKINGY,fragtab,scorelines,false,whiteplayer);    timeleft=va("start in %d",cnt_pause/TICRATE);    //i=V_StringWidth(num);    V_DrawStringWhite (200, 30, timeleft);}boolean teamingame(int teamnum){   int i;   if (cv_teamplay.value == 1)   {       for(i=0;i<MAXPLAYERS;i++)          if(playeringame[i] && players[i].skincolor==teamnum)              return true;   }   else   if (cv_teamplay.value == 2)   {       for(i=0;i<MAXPLAYERS;i++)          if(playeringame[i] && players[i].skin==teamnum)              return true;   }   return false;}static void WI_drawTeamsStats(void){    int          i,j;    int          scorelines;    int          whiteplayer;    fragsort_t   fragtab[MAXPLAYERS];    WI_slamBackground();    // draw animated background    WI_drawAnimatedBack();    WI_drawLF();    //Fab:25-04-98: when you play, you quickly see your frags because your    //  name is displayed white, when playback demo, you quicly see who's the    //  view.    if(cv_teamplay.value==1)        whiteplayer = demoplayback ? players[displayplayer].skincolor                                   : players[consoleplayer].skincolor;    else        whiteplayer = demoplayback ? players[displayplayer].skin                                   : players[consoleplayer].skin;    // count frags for each present player    scorelines = HU_CreateTeamFragTbl(fragtab,dm_totals,dm_frags);    WI_drawRancking("Frags",5,80,fragtab,scorelines,false,whiteplayer);    // count buchholz    scorelines = 0;    for (i=0; i<MAXPLAYERS; i++)        if (teamingame(i))        {            fragtab[scorelines].count = 0;            for (j=0; j<MAXPLAYERS; j++)                if (teamingame(j) && i!=j)                    fragtab[scorelines].count+= dm_frags[i][j]*dm_totals[j];            fragtab[scorelines].num   = i;            fragtab[scorelines].color = i;            fragtab[scorelines].name  = team_names[i];            scorelines++;        }    WI_drawRancking("Buchholz",85,80,fragtab,scorelines,false,whiteplayer);    // count individuel    scorelines = 0;    for (i=0; i<MAXPLAYERS; i++)        if (teamingame(i))        {            fragtab[scorelines].count = 0;            for (j=0; j<MAXPLAYERS; j++)                if (teamingame(j) && i!=j)                {                     if(dm_frags[i][j]>dm_frags[j][i])                         fragtab[scorelines].count+=3;                     else                         if(dm_frags[i][j]==dm_frags[j][i])                              fragtab[scorelines].count+=1;                }            fragtab[scorelines].num = i;            fragtab[scorelines].color = i;            fragtab[scorelines].name  = team_names[i];            scorelines++;        }    WI_drawRancking("indiv.",165,80,fragtab,scorelines,false,whiteplayer);    // count deads    scorelines = 0;    for (i=0; i<MAXPLAYERS; i++)        if (teamingame(i))        {            fragtab[scorelines].count = 0;            for (j=0; j<MAXPLAYERS; j++)                if (teamingame(j))                     fragtab[scorelines].count+=dm_frags[j][i];            fragtab[scorelines].num   = i;            fragtab[scorelines].color = i;            fragtab[scorelines].name  = team_names[i];            scorelines++;        }    WI_drawRancking("deads",245,80,fragtab,scorelines,false,whiteplayer);}/* old codestatic void WI_ddrawDeathmatchStats(void){    int         i;    int         j;    int         x;    int         y;    int         w;    int         lh;     // line height    byte*       colormap;       //added:08-02-98:see below    lh = WI_SPACINGY;    WI_slamBackground();    // draw animated background    WI_drawAnimatedBack();    WI_drawLF();    // draw stat titles (top line)    V_DrawScaledPatch(DM_TOTALSX-SHORT(total->width)/2,                DM_MATRIXY-WI_SPACINGY+10,                FB,                total);    V_DrawScaledPatch(DM_KILLERSX, DM_KILLERSY, FB, killers);    V_DrawScaledPatch(DM_VICTIMSX, DM_VICTIMSY, FB, victims);    // draw P?    x = DM_MATRIXX + DM_SPACINGX;    y = DM_MATRIXY;    for (i=0 ; i<MAXPLAYERS ; i++)    {        if (playeringame[i])        {            //added:08-02-98: use V_DrawMappedPatch instead of            //                    V_DrawScaledPatch, so that the            // graphics are 'colormapped' to the player's colors!            if (players[i].skincolor==0)                colormap = colormaps;            else                colormap = (byte *) translationtables - 256 + (players[i].skincolor<<8);            V_DrawMappedPatch(x-SHORT(stpb->width)/2,                        DM_MATRIXY - WI_SPACINGY,                        FB,                        stpb,      //p[i], now uses a common STPB0 translated                        colormap); //      to the right colors            V_DrawMappedPatch(DM_MATRIXX-SHORT(stpb->width)/2,                        y,                        FB,                        stpb,      //p[i]                        colormap);            if (i == me)            {                V_DrawScaledPatch(x-SHORT(stpb->width)/2,                            DM_MATRIXY - WI_SPACINGY,                            FB,                            bstar);                V_DrawScaledPatch(DM_MATRIXX-SHORT(stpb->width)/2,                            y,                            FB,                            star);            }        }        else        {            // V_DrawPatch(x-SHORT(bp[i]->width)/2,            //   DM_MATRIXY - WI_SPACINGY, FB, bp[i]);            // V_DrawPatch(DM_MATRIXX-SHORT(bp[i]->width)/2,            //   y, FB, bp[i]);        }        x += DM_SPACINGX;        y += WI_SPACINGY;    }    // draw stats    y = DM_MATRIXY+10;    w = SHORT(num[0]->width);    for (i=0 ; i<MAXPLAYERS ; i++)    {        x = DM_MATRIXX + DM_SPACINGX;        if (playeringame[i])        {            for (j=0 ; j<MAXPLAYERS ; j++)            {                if (playeringame[j])                    WI_drawNum(x+w, y, dm_frags[i][j], 2);                x += DM_SPACINGX;            }            WI_drawNum(DM_TOTALSX+w, y, dm_totals[i], 2);        }        y += WI_SPACINGY;    }}*/static int      cnt_frags[MAXPLAYERS];static int      dofrags;static int      ng_state;static void WI_initNetgameStats(void){    int i;    state = StatCount;    acceleratestage = 0;    ng_state = 1;    cnt_pause = TICRATE;    for (i=0 ; i<MAXPLAYERS ; i++)    {        if (!playeringame[i])            continue;        cnt_kills[i] = cnt_items[i] = cnt_secret[i] = cnt_frags[i] = 0;        dofrags += ST_PlayerFrags(i);    }    dofrags = !!dofrags;    WI_initAnimatedBack();}static void WI_updateNetgameStats(void){    int         i;    int         fsum;    boolean     stillticking;    WI_updateAnimatedBack();    if (acceleratestage && ng_state != 10)    {        acceleratestage = 0;        for (i=0 ; i<MAXPLAYERS ; i++)        {            if (!playeringame[i])                continue;            cnt_kills[i] = (plrs[i].skills * 100) / wbs->maxkills;            cnt_items[i] = (plrs[i].sitems * 100) / wbs->maxitems;            cnt_secret[i] = (plrs[i].ssecret * 100) / wbs->maxsecret;            if (dofrags)                cnt_frags[i] = ST_PlayerFrags(i);        }        S_StartSound(0, sfx_barexp);        ng_state = 10;    }    if (ng_state == 2)    {        if (!(bcnt&3))            S_StartSound(0, sfx_pistol);        stillticking = false;        for (i=0 ; i<MAXPLAYERS ; i++)        {            if (!playeringame[i])                continue;            cnt_kills[i] += 2;            if (cnt_kills[i] >= (plrs[i].skills * 100) / wbs->maxkills)                cnt_kills[i] = (plrs[i].skills * 100) / wbs->maxkills;            else                stillticking = true;        }        if (!stillticking)        {            S_StartSound(0, sfx_barexp);            ng_state++;        }    }    else if (ng_state == 4)    {        if (!(bcnt&3))            S_StartSound(0, sfx_pistol);        stillticking = false;        for (i=0 ; i<MAXPLAYERS ; i++)        {            if (!playeringame[i])                continue;            cnt_items[i] += 2;            if (cnt_items[i] >= (plrs[i].sitems * 100) / wbs->maxitems)                cnt_items[i] = (plrs[i].sitems * 100) / wbs->maxitems;            else                stillticking = true;        }        if (!stillticking)        {            S_StartSound(0, sfx_barexp);            ng_state++;        }    }    else if (ng_state == 6)    {        if (!(bcnt&3))            S_StartSound(0, sfx_pistol);        stillticking = false;        for (i=0 ; i<MAXPLAYERS ; i++)        {            if (!playeringame[i])                continue;            cnt_secret[i] += 2;            if (cnt_secret[i] >= (plrs[i].ssecret * 100) / wbs->maxsecret)                cnt_secret[i] = (plrs[i].ssecret * 100) / wbs->maxsecret;            else                stillticking = true;        }        if (!stillticking)        {            S_StartSound(0, sfx_barexp);            ng_state += 1 + 2*!dofrags;        }    }    else if (ng_state == 8)    {        if (!(bcnt&3))            S_StartSound(0, sfx_pistol);        stillticking = false;        for (i=0 ; i<MAXPLAYERS ; i++)        {            if (!playeringame[i])                continue;            cnt_frags[i] += 1;            if (cnt_frags[i] >= (fsum = ST_PlayerFrags(i)))                cnt_frags[i] = fsum;            else                stillticking = true;        }        if (!stillticking)        {            S_StartSound(0, sfx_pldeth);            ng_state++;        }    }    else if (ng_state == 10)    {        if (acceleratestage)        {            S_StartSound(0, sfx_sgcock);            if ( gamemode == commercial )                WI_initNoState();            else                WI_initShowNextLoc();        }    }    else if (ng_state & 1)    {        if (!--cnt_pause)        {            ng_state++;            cnt_pause = TICRATE;        }    }}static void WI_drawNetgameStats(void){    int         i;    int         x;    int         y;    int         pwidth = SHORT(percent->width);    byte*       colormap;   //added:08-02-98: remap STBP0 to player color    WI_slamBackground();    // draw animated background    WI_drawAnimatedBack();    WI_drawLF();    // draw stat titles (top line)    if( FontBBaseLump )    {        // use FontB if any        V_DrawTextB("Kills", NG_STATSX+  NG_SPACINGX-V_TextBWidth("Kills"), NG_STATSY);        V_DrawTextB("Items", NG_STATSX+2*NG_SPACINGX-V_TextBWidth("Items"), NG_STATSY);        V_DrawTextB("Scrt", NG_STATSX+3*NG_SPACINGX-V_TextBWidth("Scrt"), NG_STATSY);        if (dofrags)            V_DrawTextB("Frgs", NG_STATSX+4*NG_SPACINGX-V_TextBWidth("Frgs"), NG_STATSY);        y = NG_STATSY + V_TextBHeight("Kills");    }    else    {        V_DrawScaledPatch(NG_STATSX+NG_SPACINGX-SHORT(kills->width),            NG_STATSY, FB, kills);                V_DrawScaledPatch(NG_STATSX+2*NG_SPACINGX-SHORT(items->width),            NG_STATSY, FB, items);                V_DrawScaledPatch(NG_STATSX+3*NG_SPACINGX-SHORT(secret->width),            NG_STATSY, FB, secret);        if (dofrags)            V_DrawScaledPatch(NG_STATSX+4*NG_SPACINGX-SHORT(frags->width),                              NG_STATSY, FB, frags);        // draw stats        y = NG_STATSY + SHORT(kills->height);    }    //added:08-02-98: p[i] replaced by stpb (see WI_loadData for more)    for (i=0 ; i<MAXPLAYERS ; i++)    {        if (!playeringame[i])            continue;        x = NG_STATSX;        if (players[i].skincolor==0)            colormap = colormaps;       //no translation table for green guy        else            colormap = (byte *) translationtables - 256 + (players[i].skincolor<<8);        V_DrawMappedPatch(x-SHORT(stpb->width), y, FB, stpb, colormap);        if (i == me)            V_DrawScaledPatch(x-SHORT(stpb->width), y, FB, star);        x += NG_SPACINGX;        WI_drawPercent(x-pwidth, y+10, cnt_kills[i]);   x += NG_SPACINGX;        WI_drawPercent(x-pwidth, y+10, cnt_items[i]);   x += NG_SPACINGX;        WI_drawPercent(x-pwidth, y+10, cnt_secret[i]);  x += NG_SPACINGX;        if (dofrags)            WI_drawNum(x, y+10, cnt_frags[i], -1);        y += WI_SPACINGY;    }}static int sp_state;static void WI_initStats(void){    state = StatCount;    acceleratestage = 0;    sp_state = 1;    cnt_kills[0] = cnt_items[0] = cnt_secret[0] = -1;    cnt_time = cnt_par = -1;    cnt_pause = TICRATE;    WI_initAnimatedBack();}static void WI_updateStats(void){    WI_updateAnimatedBack();

⌨️ 快捷键说明

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