Пример #1
0
void WI_initNetgameStats (void)
{

    unsigned int i;

    state = StatCount;
    acceleratestage = 0;
    ng_state = 1;

    cnt_pause = TICRATE;

    cnt_kills_c.clear();
    cnt_items_c.clear();
    cnt_secret_c.clear();
    cnt_frags_c.clear();

    for (i=0 ; i<players.size() ; i++)
    {
        if (!players[i].ingame())
            continue;

        cnt_kills_c.push_back(0);
        cnt_items_c.push_back(0);
        cnt_secret_c.push_back(0);
        cnt_frags_c.push_back(0);

        dofrags += WI_fragSum(players[i]);
    }

    dofrags = !!dofrags;

    WI_initAnimatedBack();
}
Пример #2
0
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 += WI_fragSum(i);
    }

    dofrags = !!dofrags;

    WI_initAnimatedBack();
}
Пример #3
0
void WI_initNetgameStats()
{
	state = StatCount;
	acceleratestage = 0;
	ng_state = 1;

	cnt_pause = TICRATE;

	cnt_kills_c.clear();
	cnt_items_c.clear();
	cnt_secret_c.clear();
	cnt_frags_c.clear();

	for (Players::iterator it = players.begin();it != players.end();++it)
	{
		if (!(it->ingame()))
			continue;

		cnt_kills_c.push_back(0);
		cnt_items_c.push_back(0);
		cnt_secret_c.push_back(0);
		cnt_frags_c.push_back(0);

		dofrags += WI_fragSum(*it);
	}

	dofrags = !!dofrags;

	WI_initAnimatedBack();
}
Пример #4
0
void WI_initNetgameStats(void)
{

    int i;

    ::g->state = StatCount;
    ::g->acceleratestage = 0;
    ::g->ng_state = 1;

    ::g->cnt_pause = TICRATE;

    for (i=0 ; i<MAXPLAYERS ; i++)
    {
	if (!::g->playeringame[i])
	    continue;

	::g->cnt_kills[i] = ::g->cnt_items[i] = ::g->cnt_secret[i] = ::g->cnt_frags[i] = 0;

	::g->dofrags += WI_fragSum(i);
    }

    ::g->dofrags = !!::g->dofrags;

    WI_initAnimatedBack();

	// JAF PS3 
	/*
	if ( gameLocal->IsMultiplayer() ) {
		if(gameLocal->IsFullVersion() && gameLocal->liveSession.IsHost( ::g->consoleplayer )) {
			bool endOfMission = false;

			if ( ::g->gamemission == 0 && ::g->gamemap == 30 ) {
				endOfMission = true;
			}
			else if ( ::g->gamemission > 0 && ::g->gamemap == 8 ) {
				endOfMission = true;
			}

			gameLocal->liveSession.GetCoopSession().BeginEndLevel( endOfMission );
		}
	}
	*/

	DoomLib::ShowXToContinue( true );
	
}
Пример #5
0
// ====================================================================
// WI_initNetgameStats
// Purpose: Prepare for coop game stats
// Args:    none
// Returns: void
//
void WI_initNetgameStats(void)
{
    int i;

    state = StatCount;
    acceleratestage = 0;
    ng_state = 1;

    cnt_pause = TICRATE;

    // CPhipps - allocate these dynamically, blank with calloc
    cnt_kills = calloc(MAXPLAYERS, sizeof(*cnt_kills));
    cnt_items = calloc(MAXPLAYERS, sizeof(*cnt_items));
    cnt_secret= calloc(MAXPLAYERS, sizeof(*cnt_secret));
    cnt_frags = calloc(MAXPLAYERS, sizeof(*cnt_frags));

    for (i=0 ; i<MAXPLAYERS ; i++)
        if (playeringame[i])
            dofrags += WI_fragSum(i);

    dofrags = !!dofrags; // set to true or false - did we have frags?

    WI_initAnimatedBack();
}
Пример #6
0
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] > 99)
			    dm_frags[i][j] = 99;

			if (dm_frags[i][j] < -99)
			    dm_frags[i][j] = -99;
			
			stillticking = true;
		    }
		}
		dm_totals[i] = WI_fragSum(i);

		if (dm_totals[i] > 99)
		    dm_totals[i] = 99;
		
		if (dm_totals[i] < -99)
		    dm_totals[i] = -99;
	    }
	    
	}
	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;
	}
    }
}
Пример #7
0
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] = WI_fragSum(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 = WI_fragSum(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;
	}
    }
}
Пример #8
0
// ====================================================================
// WI_updateNetgameStats
// Purpose: Calculate coop stats as we display them with noise and fury
// Args:    none
// Returns: void
// Comment: This stuff sure is complicated for what it does
//
void WI_updateNetgameStats(void)
{
    int   i;
    int   fsum;

    bool 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;

            // killough 2/22/98: Make secrets = 100% if maxsecret = 0:
            cnt_secret[i] = wbs->maxsecret ?
                            (plrs[i].ssecret * 100) / wbs->maxsecret : 100;
            if (dofrags)
                cnt_frags[i] = WI_fragSum(i);  // we had frags
        }
        S_StartSound(0, sfx_barexp);  // bang
        ng_state = 10;
    }

    if (ng_state == 2)
    {
        if (!(bcnt&3))
            S_StartSound(0, sfx_pistol);  // pop

        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; // still got stuff to tally
        }

        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;

            // killough 2/22/98: Make secrets = 100% if maxsecret = 0:

            if (cnt_secret[i] >= (wbs->maxsecret ? (plrs[i].ssecret * 100) / wbs->maxsecret : compatibility_level < lxdoom_1_compatibility ? 0 : 100))
                cnt_secret[i] = wbs->maxsecret ? (plrs[i].ssecret * 100) / wbs->maxsecret : 100;
            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 = WI_fragSum(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;
        }
    }
}
Пример #9
0
// ====================================================================
// 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;

    bool stillticking;

    WI_updateAnimatedBack();

    if (acceleratestage && dm_state != 4)  // still ticking
    {
        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);  // bang
        dm_state = 4;  // we're done with all 4 (or all we have to do)
    }


    if (dm_state == 2)
    {
        if (!(bcnt&3))
            S_StartSound(0, sfx_pistol);  // noise while counting

        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) // Ty 03/17/98 3-digit frag count
                            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;  // Ty 03/17/98 end 3-digit frag count
            }
        }

        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;
        }
    }
}
Пример #10
0
void WI_updateNetgameStats (void)
{

    unsigned int i;
    int fsum;
    BOOL stillticking;

    WI_updateAnimatedBack();

    if (acceleratestage && ng_state != 10)
    {
        acceleratestage = 0;

        for (i=0 ; i<players.size(); i++)
        {
            if (!players[i].ingame())
                continue;

            cnt_kills_c[i] = plrs[i].skills;
            cnt_items_c[i] = plrs[i].sitems;
            cnt_secret_c[i] = plrs[i].ssecret;

            if (dofrags)
                cnt_frags_c[i] = WI_fragSum (players[i]);
        }
        S_Sound (CHAN_INTERFACE, "weapons/rocklx", 1, ATTN_NONE);
        ng_state = 10;
    }

    if (ng_state == 2)
    {
        if (!(bcnt&3))
            S_Sound (CHAN_INTERFACE, "weapons/pistol", 1, ATTN_NONE);

        stillticking = false;

        for (i=0 ; i<players.size() ; i++)
        {
            if (!players[i].ingame())
                continue;

            cnt_kills_c[i] += 2;

            if (cnt_kills_c[i] > plrs[i].skills)
                cnt_kills_c[i] = plrs[i].skills;
            else
                stillticking = true;
        }

        if (!stillticking)
        {
            S_Sound (CHAN_INTERFACE, "weapons/rocklx", 1, ATTN_NONE);
            ng_state++;
        }
    }
    else if (ng_state == 4)
    {
        if (!(bcnt&3))
            S_Sound (CHAN_INTERFACE, "weapons/pistol", 1, ATTN_NONE);

        stillticking = false;

        for (i=0 ; i<players.size() ; i++)
        {
            if (!players[i].ingame())
                continue;

            cnt_items_c[i] += 2;
            if (cnt_items_c[i] > plrs[i].sitems)
                cnt_items_c[i] = plrs[i].sitems;
            else
                stillticking = true;
        }
        if (!stillticking)
        {
            S_Sound (CHAN_INTERFACE, "weapons/rocklx", 1, ATTN_NONE);
            ng_state++;
        }
    }
    else if (ng_state == 6)
    {
        if (!(bcnt&3))
            S_Sound (CHAN_INTERFACE, "weapons/pistol", 1, ATTN_NONE);

        stillticking = false;

        for (i=0 ; i<players.size() ; i++)
        {
            if (!players[i].ingame())
                continue;

            cnt_secret_c[i] += 2;

            if (cnt_secret_c[i] > plrs[i].ssecret)
                cnt_secret_c[i] = plrs[i].ssecret;
            else
                stillticking = true;
        }

        if (!stillticking)
        {
            S_Sound (CHAN_INTERFACE, "weapons/rocklx", 1, ATTN_NONE);
            ng_state += 1 + 2*!dofrags;
        }
    }
    else if (ng_state == 8)
    {
        if (!(bcnt&3))
            S_Sound (CHAN_INTERFACE, "weapons/pistol", 1, ATTN_NONE);

        stillticking = false;

        for (i=0 ; i<players.size() ; i++)
        {
            if (!players[i].ingame())
                continue;

            cnt_frags_c[i] += 1;

            if (cnt_frags_c[i] >= (fsum = WI_fragSum(players[i])))
                cnt_frags_c[i] = fsum;
            else
                stillticking = true;
        }

        if (!stillticking)
        {
            S_Sound (CHAN_INTERFACE, "player/male/death1", 1, ATTN_NONE);
            ng_state++;
        }
    }
    else if (ng_state == 10)
    {
        if (acceleratestage)
        {
            S_Sound (CHAN_INTERFACE, "weapons/shotgr", 1, ATTN_NONE);
            if ( (gameinfo.flags & GI_MAPxx) )
                WI_initNoState();
            else
                WI_initShowNextLoc();
        }
    }
    else if (ng_state & 1)
    {
        if (!--cnt_pause)
        {
            ng_state++;
            cnt_pause = TICRATE;
        }
    }
}
Пример #11
0
void WI_updateNetgameStats ()
{

	int i;
	int fsum;
	BOOL 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;
			cnt_items[i] = plrs[i].sitems;
			cnt_secret[i] = plrs[i].ssecret;

			if (dofrags)
				cnt_frags[i] = WI_fragSum (i);
		}
		S_Sound (CHAN_VOICE, NEXTSTAGE, 1, ATTN_NONE);
		ng_state = 10;
	}

	if (ng_state == 2)
	{
		if (!(bcnt&3))
			S_Sound (CHAN_VOICE, "weapons/pistol", 1, ATTN_NONE);

		stillticking = false;

		for (i=0 ; i<MAXPLAYERS ; i++)
		{
			if (!playeringame[i])
				continue;

			cnt_kills[i] += 2;

			if (cnt_kills[i] > plrs[i].skills)
				cnt_kills[i] = plrs[i].skills;
			else
				stillticking = true;
		}
		
		if (!stillticking)
		{
			S_Sound (CHAN_VOICE, NEXTSTAGE, 1, ATTN_NONE);
			ng_state++;
		}
	}
	else if (ng_state == 4)
	{
		if (!(bcnt&3))
			S_Sound (CHAN_VOICE, "weapons/pistol", 1, ATTN_NONE);

		stillticking = false;

		for (i=0 ; i<MAXPLAYERS ; i++)
		{
			if (!playeringame[i])
				continue;

			cnt_items[i] += 2;
			if (cnt_items[i] > plrs[i].sitems)
				cnt_items[i] = plrs[i].sitems;
			else
				stillticking = true;
		}
		if (!stillticking)
		{
			S_Sound (CHAN_VOICE, NEXTSTAGE, 1, ATTN_NONE);
			ng_state++;
		}
	}
	else if (ng_state == 6)
	{
		if (!(bcnt&3))
			S_Sound (CHAN_VOICE, "weapons/pistol", 1, ATTN_NONE);

		stillticking = false;

		for (i=0 ; i<MAXPLAYERS ; i++)
		{
			if (!playeringame[i])
				continue;

			cnt_secret[i] += 2;

			if (cnt_secret[i] > plrs[i].ssecret)
				cnt_secret[i] = plrs[i].ssecret;
			else
				stillticking = true;
		}
		
		if (!stillticking)
		{
			S_Sound (CHAN_VOICE, NEXTSTAGE, 1, ATTN_NONE);
			ng_state += 1 + 2*!dofrags;
		}
	}
	else if (ng_state == 8)
	{
		if (!(bcnt&3))
			S_Sound (CHAN_VOICE, "weapons/pistol", 1, ATTN_NONE);

		stillticking = false;

		for (i=0 ; i<MAXPLAYERS ; i++)
		{
			if (!playeringame[i])
				continue;

			cnt_frags[i] += 1;

			if (cnt_frags[i] >= (fsum = WI_fragSum(i)))
				cnt_frags[i] = fsum;
			else
				stillticking = true;
		}
		
		if (!stillticking)
		{
			S_Sound (CHAN_VOICE, "player/male/death1", 1, ATTN_NONE);
			ng_state++;
		}
	}
	else if (ng_state == 10)
	{
		if (acceleratestage)
		{
			S_Sound (CHAN_VOICE, PASTSTATS, 1, ATTN_NONE);
			if ( gamemode == commercial )
				WI_initNoState();
			else
				WI_initShowNextLoc();
		}
	}
	else if (ng_state & 1)
	{
		if (!--cnt_pause)
		{
			ng_state++;
			cnt_pause = TICRATE;
		}
	}
}
Пример #12
0
void WI_updateDeathmatchStats(void)
{

    int		i;
    int		j;
    
    qboolean	stillticking;

    WI_updateAnimatedBack();

    if (::g->acceleratestage && ::g->dm_state != 4)
    {
	::g->acceleratestage = 0;

	for (i=0 ; i<MAXPLAYERS ; i++)
	{
	    if (::g->playeringame[i])
	    {
		for (j=0 ; j<MAXPLAYERS ; j++)
		    if (::g->playeringame[j])
			::g->dm_frags[i][j] = plrs[i].frags[j];

		::g->dm_totals[i] = WI_fragSum(i);
	    }
	}
	

	S_StartSound(0, sfx_barexp);
	::g->dm_state = 4;
    }

    
    if (::g->dm_state == 2)
    {
	if (!(::g->bcnt&3))
	    S_StartSound(0, sfx_pistol);
	
	stillticking = false;

	for (i=0 ; i<MAXPLAYERS ; i++)
	{
	    if (::g->playeringame[i])
	    {
		for (j=0 ; j<MAXPLAYERS ; j++)
		{
		    if (::g->playeringame[j]
			&& ::g->dm_frags[i][j] != plrs[i].frags[j])
		    {
			if (plrs[i].frags[j] < 0)
			    ::g->dm_frags[i][j]--;
			else
			    ::g->dm_frags[i][j]++;

			if (::g->dm_frags[i][j] > 99)
			    ::g->dm_frags[i][j] = 99;

			if (::g->dm_frags[i][j] < -99)
			    ::g->dm_frags[i][j] = -99;
			
			stillticking = true;
		    }
		}
		::g->dm_totals[i] = WI_fragSum(i);

		if (::g->dm_totals[i] > 99)
		    ::g->dm_totals[i] = 99;
		
		if (::g->dm_totals[i] < -99)
		    ::g->dm_totals[i] = -99;
	    }
	    
	}
	if (!stillticking)
	{
	    S_StartSound(0, sfx_barexp);
	    ::g->dm_state++;
	}

    }
    else if (::g->dm_state == 4)
    {
		if (::g->acceleratestage)
		{
			if ( !::g->demoplayback && ( ::g->usergame || ::g->netgame ) ) {
					// This sound plays repeatedly after a player continues at the end of a deathmatch,
					// and sounds bad. Quick fix is to just not play it.
					//S_StartSound(0, sfx_slop);

					DoomLib::HandleEndMatch();
			}
		}
    }
    else if (::g->dm_state & 1)
    {
		if (!--::g->cnt_pause)
		{
			::g->dm_state++;
			::g->cnt_pause = TICRATE;
		}
    }
}
Пример #13
0
void WI_updateNetgameStats(void)
{

    int		i;
    int		fsum;
    
    qboolean	stillticking;

    WI_updateAnimatedBack();

    if (::g->acceleratestage && ::g->ng_state != 10)
    {
	::g->acceleratestage = 0;

	for (i=0 ; i<MAXPLAYERS ; i++)
	{
	    if (!::g->playeringame[i])
		continue;

	    ::g->cnt_kills[i] = (plrs[i].skills * 100) / ::g->wbs->maxkills;
	    ::g->cnt_items[i] = (plrs[i].sitems * 100) / ::g->wbs->maxitems;
	    ::g->cnt_secret[i] = (plrs[i].ssecret * 100) / ::g->wbs->maxsecret;

	    if (::g->dofrags)
		::g->cnt_frags[i] = WI_fragSum(i);
	}
	S_StartSound(0, sfx_barexp);
	::g->ng_state = 10;
    }

    if (::g->ng_state == 2)
    {
	if (!(::g->bcnt&3))
	    S_StartSound(0, sfx_pistol);

	stillticking = false;

	for (i=0 ; i<MAXPLAYERS ; i++)
	{
	    if (!::g->playeringame[i])
		continue;

	    ::g->cnt_kills[i] += 2;

	    if (::g->cnt_kills[i] >= (plrs[i].skills * 100) / ::g->wbs->maxkills)
		::g->cnt_kills[i] = (plrs[i].skills * 100) / ::g->wbs->maxkills;
	    else
		stillticking = true;
	}
	
	if (!stillticking)
	{
	    S_StartSound(0, sfx_barexp);
	    ::g->ng_state++;
	}
    }
    else if (::g->ng_state == 4)
    {
	if (!(::g->bcnt&3))
	    S_StartSound(0, sfx_pistol);

	stillticking = false;

	for (i=0 ; i<MAXPLAYERS ; i++)
	{
	    if (!::g->playeringame[i])
		continue;

	    ::g->cnt_items[i] += 2;
	    if (::g->cnt_items[i] >= (plrs[i].sitems * 100) / ::g->wbs->maxitems)
		::g->cnt_items[i] = (plrs[i].sitems * 100) / ::g->wbs->maxitems;
	    else
		stillticking = true;
	}
	if (!stillticking)
	{
	    S_StartSound(0, sfx_barexp);
	    ::g->ng_state++;
	}
    }
    else if (::g->ng_state == 6)
    {
	if (!(::g->bcnt&3))
	    S_StartSound(0, sfx_pistol);

	stillticking = false;

	for (i=0 ; i<MAXPLAYERS ; i++)
	{
	    if (!::g->playeringame[i])
		continue;

	    ::g->cnt_secret[i] += 2;

	    if (::g->cnt_secret[i] >= (plrs[i].ssecret * 100) / ::g->wbs->maxsecret)
		::g->cnt_secret[i] = (plrs[i].ssecret * 100) / ::g->wbs->maxsecret;
	    else
		stillticking = true;
	}
	
	if (!stillticking)
	{
	    S_StartSound(0, sfx_barexp);
	    ::g->ng_state += 1 + 2*!::g->dofrags;
	}
    }
    else if (::g->ng_state == 8)
    {
	if (!(::g->bcnt&3))
	    S_StartSound(0, sfx_pistol);

	stillticking = false;

	for (i=0 ; i<MAXPLAYERS ; i++)
	{
	    if (!::g->playeringame[i])
		continue;

	    ::g->cnt_frags[i] += 1;

	    if (::g->cnt_frags[i] >= (fsum = WI_fragSum(i)))
		::g->cnt_frags[i] = fsum;
	    else
		stillticking = true;
	}
	
	if (!stillticking)
	{
	    S_StartSound(0, sfx_pldeth);
	    ::g->ng_state++;
	}
    }
    else if (::g->ng_state == 10)
    {
	if (::g->acceleratestage)
	{
		if ( !::g->demoplayback && ( ::g->usergame || ::g->netgame ) ) {
			S_StartSound(0, sfx_sgcock);

			// need to do this again if they buy it
			localCalculateAchievements(false);
			if (::g->gamemode == commercial){
				WI_initNoState();
				DoomLib::ShowXToContinue( false );
			}
			else{
				WI_initShowNextLoc();
			}
		}
	}
    }
    else if (::g->ng_state & 1)
    {
	if (!--::g->cnt_pause)
	{
	    ::g->ng_state++;
	    ::g->cnt_pause = TICRATE;
	}
    }
}
Пример #14
0
void WI_updateNetgameStats(void)
{
	int     i;
	int     fsum;
	boolean stillticking;

	WI_updateAnimatedBack();

	if(acceleratestage && ng_state != 10)
	{
		acceleratestage = 0;
		for(i = 0; i < NUM_TEAMS; i++)
		{
			//if (!players[i].plr->ingame) continue;
			cnt_kills[i] = (teaminfo[i].kills * 100) / wbs->maxkills;
			cnt_items[i] = (teaminfo[i].items * 100) / wbs->maxitems;
			cnt_secret[i] = (teaminfo[i].secret * 100) / wbs->maxsecret;

			if(dofrags)
				cnt_frags[i] = teaminfo[i].totalfrags;	//WI_fragSum(i);
		}
		S_LocalSound(sfx_barexp, 0);
		ng_state = 10;
	}

	if(ng_state == 2)
	{
		if(!(bcnt & 3))
			S_LocalSound(sfx_pistol, 0);
		stillticking = false;

		for(i = 0; i < NUM_TEAMS; i++)
		{
			//if (!players[i].plr->ingame) continue;

			cnt_kills[i] += 2;

			if(cnt_kills[i] >= (teaminfo[i].kills * 100) / wbs->maxkills)
				cnt_kills[i] = (teaminfo[i].kills * 100) / wbs->maxkills;
			else
				stillticking = true;
		}
		if(!stillticking)
		{
			S_LocalSound(sfx_barexp, 0);
			ng_state++;
		}
	}
	else if(ng_state == 4)
	{
		if(!(bcnt & 3))
			S_LocalSound(sfx_pistol, 0);
		stillticking = false;

		for(i = 0; i < NUM_TEAMS; i++)
		{
			//if (!players[i].plr->ingame) continue;

			cnt_items[i] += 2;
			if(cnt_items[i] >= (teaminfo[i].items * 100) / wbs->maxitems)
				cnt_items[i] = (teaminfo[i].items * 100) / wbs->maxitems;
			else
				stillticking = true;
		}
		if(!stillticking)
		{
			S_LocalSound(sfx_barexp, 0);
			ng_state++;
		}
	}
	else if(ng_state == 6)
	{
		if(!(bcnt & 3))
			S_LocalSound(sfx_pistol, 0);

		stillticking = false;

		for(i = 0; i < NUM_TEAMS; i++)
		{
			//if (!players[i].plr->ingame) continue;

			cnt_secret[i] += 2;

			if(cnt_secret[i] >= (teaminfo[i].secret * 100) / wbs->maxsecret)
				cnt_secret[i] = (teaminfo[i].secret * 100) / wbs->maxsecret;
			else
				stillticking = true;
		}
		if(!stillticking)
		{
			S_LocalSound(sfx_barexp, 0);
			ng_state += 1 + 2 * !dofrags;
		}
	}
	else if(ng_state == 8)
	{
		if(!(bcnt & 3))
			S_LocalSound(sfx_pistol, 0);

		stillticking = false;

		for(i = 0; i < NUM_TEAMS; i++)
		{
			//if (!players[i].plr->ingame) continue;

			cnt_frags[i] += 1;

			if(cnt_frags[i] >= (fsum = WI_fragSum(i)))
				cnt_frags[i] = fsum;
			else
				stillticking = true;
		}
		if(!stillticking)
		{
			S_LocalSound(sfx_pldeth, 0);
			ng_state++;
		}
	}
	else if(ng_state == 10)
	{
		if(acceleratestage)
		{
			S_LocalSound(sfx_sgcock, 0);
			if(gamemode == commercial)
				WI_initNoState();
			else
				WI_initShowNextLoc();
		}
	}
	else if(ng_state & 1)
	{
		if(!--cnt_pause)
		{
			ng_state++;
			cnt_pause = TICRATE;
		}
	}
}
Пример #15
0
void WI_updateDeathmatchStats(void)
{

	int     i;
	int     j;
	boolean stillticking;

	WI_updateAnimatedBack();

	if(acceleratestage && dm_state != 4)
	{
		acceleratestage = 0;
		for(i = 0; i < NUM_TEAMS; i++)
		{
			//          if(teaminfo[i].members)
			//          {
			for(j = 0; j < NUM_TEAMS; j++)
			{
				//              if (players[i].plr->ingame)
				dm_frags[i][j] = teaminfo[i].frags[j];
			}
			dm_totals[i] = WI_fragSum(i);
			//          }
		}
		S_LocalSound(sfx_barexp, 0);
		dm_state = 4;
	}

	if(dm_state == 2)
	{
		if(!(bcnt & 3))
			S_LocalSound(sfx_pistol, 0);
		stillticking = false;
		for(i = 0; i < NUM_TEAMS; i++)
		{
			//          if (players[i].plr->ingame)
			{
				for(j = 0; j < NUM_TEAMS; j++)
				{
					if( /*players[i].plr->ingame && */ dm_frags[i][j] !=
					   teaminfo[i].frags[j])
					{
						if(teaminfo[i].frags[j] < 0)
							dm_frags[i][j]--;
						else
							dm_frags[i][j]++;

						if(dm_frags[i][j] > 99)
							dm_frags[i][j] = 99;

						if(dm_frags[i][j] < -99)
							dm_frags[i][j] = -99;

						stillticking = true;
					}
				}
				dm_totals[i] = WI_fragSum(i);

				if(dm_totals[i] > 99)
					dm_totals[i] = 99;

				if(dm_totals[i] < -99)
					dm_totals[i] = -99;
			}
		}
		if(!stillticking)
		{
			S_LocalSound(sfx_barexp, 0);
			dm_state++;
		}
	}
	else if(dm_state == 4)
	{
		if(acceleratestage)
		{
			S_LocalSound(sfx_slop, 0);
			if(gamemode == commercial)
				WI_initNoState();
			else
				WI_initShowNextLoc();
		}
	}
	else if(dm_state & 1)
	{
		if(!--cnt_pause)
		{
			dm_state++;
			cnt_pause = TICRATE;
		}
	}
}