components/prboom/wi_stuff.c
// ====================================================================
// WI_updateDeathmatchStats
// Purpose: Advance Deathmatch stats screen animation.  Calculate
//          frags for all players.  Lots of noise and drama around
//          the presentation.
// Args:    none
// Returns: void
//
WI_updateDeathmatchStats
Purpose: Advance Deathmatch stats screen animation.  Calculate
frags for all players.  Lots of noise and drama around
the presentation.
Args:    none
Returns: void
WI_updateDeathmatchStats Purpose : Advance Deathmatch stats screen animation . Calculate frags for all players . Lots of noise and drama around the presentation . Args : none Returns : void
void WI_updateDeathmatchStats(void)
{
  int   i;
  int   j;
  boolean stillticking;
  WI_updateAnimatedBack();
  if (acceleratestage && dm_state != 4)  
  {
    acceleratestage = 0;
    for (i=0 ; i<MAXPLAYERS ; i++)
    {
      if (playeringame[i])
      {
        for (j=0 ; j<MAXPLAYERS ; j++)
          if (playeringame[j])
            dm_frags[i][j] = plrs[i].frags[j];
        dm_totals[i] = WI_fragSum(i);
      }
    }
    S_StartSound(0, sfx_barexp);  
    dm_state = 4;  
  }
  if (dm_state == 2)
  {
    if (!(bcnt&3))
      S_StartSound(0, sfx_pistol);  
    stillticking = false;
    for (i=0 ; i<MAXPLAYERS ; i++)
    {
      if (playeringame[i])
      {
        for (j=0 ; j<MAXPLAYERS ; j++)
        {
          if (playeringame[j]
             && dm_frags[i][j] != plrs[i].frags[j])
          {
            if (plrs[i].frags[j] < 0)
              dm_frags[i][j]--;
            else
              dm_frags[i][j]++;
            if (dm_frags[i][j] > 999) 
              dm_frags[i][j] = 999;
            if (dm_frags[i][j] < -999)
              dm_frags[i][j] = -999;
            stillticking = true;
          }
        }
        dm_totals[i] = WI_fragSum(i);
        if (dm_totals[i] > 999)
          dm_totals[i] = 999;
        if (dm_totals[i] < -999)
          dm_totals[i] = -999;  
      }
    }
    if (!stillticking)
    {
      S_StartSound(0, sfx_barexp);
      dm_state++;
    }
  }
  else if (dm_state == 4)
  {
    if (acceleratestage)
    {
      S_StartSound(0, sfx_slop);
      if ( gamemode == commercial)
        WI_initNoState();
      else
        WI_initShowNextLoc();
    }
  }
  else if (dm_state & 1)
  {
    if (!--cnt_pause)
    {
      dm_state++;
      cnt_pause = TICRATE;
    }
  }
}
void WI_updateDeathmatchStats ( void ) { int i ; int j ; boolean stillticking ; WI_updateAnimatedBack ( ) ; if ( acceleratestage && dm_state != 4 ) { acceleratestage = 0 ; for ( i = 0 ; i < MAXPLAYERS ; i ++ ) { if ( playeringame [ i ] ) { for ( j = 0 ; j < MAXPLAYERS ; j ++ ) if ( playeringame [ j ] ) dm_frags [ i ] [ j ] = plrs [ i ] . frags [ j ] ; dm_totals [ i ] = WI_fragSum ( i ) ; } } S_StartSound ( 0 , sfx_barexp ) ; dm_state = 4 ; } if ( dm_state == 2 ) { if ( ! ( bcnt & 3 ) ) S_StartSound ( 0 , sfx_pistol ) ; stillticking = false ; for ( i = 0 ; i < MAXPLAYERS ; i ++ ) { if ( playeringame [ i ] ) { for ( j = 0 ; j < MAXPLAYERS ; j ++ ) { if ( playeringame [ j ] && dm_frags [ i ] [ j ] != plrs [ i ] . frags [ j ] ) { if ( plrs [ i ] . frags [ j ] < 0 ) dm_frags [ i ] [ j ] -- ; else dm_frags [ i ] [ j ] ++ ; if ( dm_frags [ i ] [ j ] > 999 ) dm_frags [ i ] [ j ] = 999 ; if ( dm_frags [ i ] [ j ] < -999 ) dm_frags [ i ] [ j ] = -999 ; stillticking = true ; } } dm_totals [ i ] = WI_fragSum ( i ) ; if ( dm_totals [ i ] > 999 ) dm_totals [ i ] = 999 ; if ( dm_totals [ i ] < -999 ) dm_totals [ i ] = -999 ; } } if ( ! stillticking ) { S_StartSound ( 0 , sfx_barexp ) ; dm_state ++ ; } } else if ( dm_state == 4 ) { if ( acceleratestage ) { S_StartSound ( 0 , sfx_slop ) ; if ( gamemode == commercial ) WI_initNoState ( ) ; else WI_initShowNextLoc ( ) ; } } else if ( dm_state & 1 ) { if ( ! -- cnt_pause ) { dm_state ++ ; cnt_pause = TICRATE ; } } }
WI_updateDeathmatchStats
Purpose: Advance Deathmatch stats screen animation.
WI_updateDeathmatchStats Purpose : Advance Deathmatch stats screen animation .
// still ticking // bang // we're done with all 4 (or all we have to do) // noise while counting // Ty 03/17/98 3-digit frag count // Ty 03/17/98 end 3-digit frag count