Ejemplo n.º 1
0
int do_difficulty_menu()
{
	int s;
	newmenu_item m[5];

	m[0].type=NM_TYPE_MENU; m[0].text=MENU_DIFFICULTY_TEXT(0);
	m[1].type=NM_TYPE_MENU; m[1].text=MENU_DIFFICULTY_TEXT(1);
	m[2].type=NM_TYPE_MENU; m[2].text=MENU_DIFFICULTY_TEXT(2);
	m[3].type=NM_TYPE_MENU; m[3].text=MENU_DIFFICULTY_TEXT(3);
	m[4].type=NM_TYPE_MENU; m[4].text=MENU_DIFFICULTY_TEXT(4);

	s = newmenu_do1( NULL, TXT_DIFFICULTY_LEVEL, NDL, m, NULL, Difficulty_level);

	if (s > -1 )	{
		if (s != Difficulty_level)
		{	
			Player_default_difficulty = s;
			write_player_file();
		}
		Difficulty_level = s;
		mprintf((0, "%s %s %i\n", TXT_DIFFICULTY_LEVEL, TXT_SET_TO, Difficulty_level));
		return 1;
	}
	return 0;
}
Ejemplo n.º 2
0
int do_game_pause()
{
	char *msg;
	char total_time[9],level_time[9];

#ifdef NETWORK
	if (Game_mode & GM_MULTI)
	{
		netplayerinfo_on= !netplayerinfo_on;
		return(KEY_PAUSE);
	}
#endif

	MALLOC(msg, char, 1024);
	if (!msg)
		return 0;

	songs_pause();

	format_time(total_time, f2i(Players[Player_num].time_total) + Players[Player_num].hours_total*3600);
	format_time(level_time, f2i(Players[Player_num].time_level) + Players[Player_num].hours_level*3600);
	if (Newdemo_state!=ND_STATE_PLAYBACK)
		snprintf(msg,1024,"PAUSE\n\nSkill level:  %s\nHostages on board:  %d\nTime on level: %s\nTotal time in game: %s",MENU_DIFFICULTY_TEXT(Difficulty_level),Players[Player_num].hostages_on_board,level_time,total_time);
	else
	  	snprintf(msg,1024,"PAUSE\n\nSkill level:  %s\nHostages on board:  %d\n",MENU_DIFFICULTY_TEXT(Difficulty_level),Players[Player_num].hostages_on_board);
	set_screen_mode(SCREEN_MENU);

	if (!window_create(&grd_curscreen->sc_canvas, 0, 0, SWIDTH, SHEIGHT, (int (*)(window *, d_event *, void *))pause_handler, msg))
		d_free(msg);

	return 0 /*key*/;	// Keycode returning ripped out (kreatordxx)
}
Ejemplo n.º 3
0
Archivo: scores.c Proyecto: paud/d2x-xl
void scores_draw_item( int  i, stats_info * stats )
{
	char buffer[20];

		int y;

	WIN(DDGRLOCK(dd_grd_curcanv));
		y = 7+70+i*9;

		if (i==0) y -= 8;

		if ( i==MAX_HIGH_SCORES ) 	{
			y += 8;
			//scores_rprintf( 17+33+XX, y+YY, "" );
		} else {
			scores_rprintf( 17+33+XX, y+YY, "%d.", i+1 );
		}

		if (strlen(stats->name)==0) {
			GrPrintF( LHX(26+33+XX)+xOffs, LHY(y+YY)+yOffs, TXT_EMPTY );
			WIN(DDGRUNLOCK(dd_grd_curcanv));
			return;
		}
		GrPrintF( LHX(26+33+XX)+xOffs, LHY(y+YY)+yOffs, "%s", stats->name );
		int_to_string(stats->score, buffer);
		scores_rprintf( 109+33+XX, y+YY, "%s", buffer );

		GrPrintF( LHX(125+33+XX)+xOffs, LHY(y+YY)+yOffs, "%s", MENU_DIFFICULTY_TEXT(stats->diff_level) );

		if ( (stats->starting_level > 0 ) && (stats->ending_level > 0 ))
			scores_rprintf( 192+33+XX, y+YY, "%d-%d", stats->starting_level, stats->ending_level );
		else if ( (stats->starting_level < 0 ) && (stats->ending_level > 0 ))
			scores_rprintf( 192+33+XX, y+YY, "S%d-%d", -stats->starting_level, stats->ending_level );
		else if ( (stats->starting_level < 0 ) && (stats->ending_level < 0 ))
			scores_rprintf( 192+33+XX, y+YY, "S%d-S%d", -stats->starting_level, -stats->ending_level );
		else if ( (stats->starting_level > 0 ) && (stats->ending_level < 0 ))
			scores_rprintf( 192+33+XX, y+YY, "%d-S%d", stats->starting_level, -stats->ending_level );

		{
			int h, m, s;
			h = stats->seconds/3600;
			s = stats->seconds%3600;
			m = s / 60;
			s = s % 60;
			scores_rprintf( 311-42+XX, y+YY, "%d:%02d:%02d", h, m, s );
		}
	WIN(DDGRUNLOCK(dd_grd_curcanv));
}
Ejemplo n.º 4
0
int DifficultyMenu (void)
{
	int		i, choice = gameStates.app.nDifficultyLevel;
	CMenu		m (5);

for (i = 0; i < 5; i++)
	m.AddMenu ( MENU_DIFFICULTY_TEXT (i), 0, "");
i = m.Menu (NULL, TXT_DIFFICULTY_LEVEL, NULL, &choice);
if (i <= -1)
	return 0;
if (choice != gameStates.app.nDifficultyLevel) {       
	gameStates.app.nDifficultyLevel = choice;
	SavePlayerProfile ();
	}
return 1;
}
Ejemplo n.º 5
0
void scores_draw_item( int i, stats_info * stats )
{
	char buffer[20];

	int y;

	y = 77+i*9;

	if (i==0)
		y -= 8;

	if ( i==MAX_HIGH_SCORES )
		y += 8;
	else
		scores_rprintf( 57, y-3, "%d.", i+1 );

	y -= 3;

	if (strlen(stats->name)==0) {
		gr_printf( FSPACX(66), FSPACY(y), TXT_EMPTY );
		return;
	}
	gr_printf( FSPACX(66), FSPACY(y), "%s", stats->name );
	int_to_string(stats->score, buffer);
	scores_rprintf( 149, y, "%s", buffer );

	gr_printf( FSPACX(166), FSPACY(y), "%s", MENU_DIFFICULTY_TEXT(stats->diff_level) );

	if ( (stats->starting_level > 0 ) && (stats->ending_level > 0 ))
		scores_rprintf( 232, y, "%d-%d", stats->starting_level, stats->ending_level );
	else if ( (stats->starting_level < 0 ) && (stats->ending_level > 0 ))
		scores_rprintf( 232, y, "S%d-%d", -stats->starting_level, stats->ending_level );
	else if ( (stats->starting_level < 0 ) && (stats->ending_level < 0 ))
		scores_rprintf( 232, y, "S%d-S%d", -stats->starting_level, -stats->ending_level );
	else if ( (stats->starting_level > 0 ) && (stats->ending_level < 0 ))
		scores_rprintf( 232, y, "%d-S%d", stats->starting_level, -stats->ending_level );

	{
		int h, m, s;
		h = stats->seconds/3600;
		s = stats->seconds%3600;
		m = s / 60;
		s = s % 60;
		scores_rprintf( 276, y, "%d:%02d:%02d", h, m, s );
	}
}
Ejemplo n.º 6
0
int NewGameMenuCallback (CMenu& menu, int& key, int nCurItem, int nState)
{
if (nState)
	return nCurItem;

	CMenuItem*	m;
	int			v;

m = menu + nOptDifficulty;
v = m->m_value;
if (gameStates.app.nDifficultyLevel != v) {
	gameStates.app.nDifficultyLevel = 
	gameStates.app.nDifficultyLevel = v;
	gameData.bosses.InitGateIntervals ();
	sprintf (m->m_text, TXT_DIFFICULTY2, MENU_DIFFICULTY_TEXT (gameStates.app.nDifficultyLevel));
	m->m_bRebuild = 1;
	}
return nCurItem;
}
Ejemplo n.º 7
0
int GameplayOptionsCallback (CMenu& menu, int& key, int nCurItem, int nState)
{
if (nState)
	return nCurItem;

	CMenuItem*	m;
	int			v;

m = menu + gplayOpts.nDifficulty;
v = m->m_value;
if (gameStates.app.nDifficultyLevel != v) {
	gameStates.app.nDifficultyLevel = v;
	if (!IsMultiGame) {
		gameStates.app.nDifficultyLevel = v;
		gameData.bosses.InitGateIntervals ();
		}
	sprintf (m->m_text, TXT_DIFFICULTY2, MENU_DIFFICULTY_TEXT (gameStates.app.nDifficultyLevel));
	m->m_bRebuild = 1;
	}

m = menu + gplayOpts.nAIAggressivity;
v = m->m_value;
if (nAIAggressivity != v) {
	nAIAggressivity = v;
	sprintf (m->m_text, TXT_AI_AGGRESSIVITY, pszAggressivities [v]);
	m->m_bRebuild = 1;
	}

m = menu + gplayOpts.nWeaponSwitch;
v = m->m_value;
if (gameOpts->gameplay.nAutoSelectWeapon != v) {
	gameOpts->gameplay.nAutoSelectWeapon = v;
	sprintf (m->m_text, TXT_WEAPON_SWITCH, pszWeaponSwitch [v]);
	m->m_bRebuild = 1;
	}

return nCurItem;
}
Ejemplo n.º 8
0
void show_netplayerinfo()
{
	int x=0, y=0, i=0, color=0;
	
	gr_set_current_canvas(NULL);
	gr_set_curfont(GAME_FONT);
	gr_set_fontcolor(255,-1);
	
	x=(SWIDTH/2)-FSPACX(120);
	y=(SHEIGHT/2)-FSPACY(84);
	
	gr_settransblend(14, GR_BLEND_NORMAL);
	gr_setcolor( BM_XRGB(0,0,0) );
	gr_rect((SWIDTH/2)-FSPACX(120),(SHEIGHT/2)-FSPACY(84),(SWIDTH/2)+FSPACX(120),(SHEIGHT/2)+FSPACY(84));
	gr_settransblend(GR_FADE_OFF, GR_BLEND_NORMAL);
	
	// general game information
	y+=LINE_SPACING;
	gr_printf(0x8000,y,"%s",Netgame.game_name);
#ifndef SHAREWARE
	y+=LINE_SPACING;
	gr_printf(0x8000,y,"%s - lvl: %i",Netgame.mission_title,Netgame.levelnum);
#endif
	
	x+=FSPACX(8);
	y+=LINE_SPACING*2;
	gr_printf(x,y,"game mode: %s",GMNames[Netgame.gamemode]);
	y+=LINE_SPACING;
	gr_printf(x,y,"difficulty: %s",MENU_DIFFICULTY_TEXT(Netgame.difficulty));
	y+=LINE_SPACING;
	gr_printf(x,y,"level time: %i:%02i:%02i",Players[Player_num].hours_level,f2i(Players[Player_num].time_level) / 60 % 60,f2i(Players[Player_num].time_level) % 60);
	y+=LINE_SPACING;
	gr_printf(x,y,"total time: %i:%02i:%02i",Players[Player_num].hours_total,f2i(Players[Player_num].time_total) / 60 % 60,f2i(Players[Player_num].time_total) % 60);
	y+=LINE_SPACING;
	if (Netgame.KillGoal)
		gr_printf(x,y,"Kill goal: %d",Netgame.KillGoal*5);
	
	// player information (name, kills, ping, game efficiency)
	y+=LINE_SPACING*2;
	gr_printf(x,y,"player");
	if (Game_mode & GM_MULTI_COOP)
		gr_printf(x+FSPACX(8)*7,y,"score");
	else
	{
		gr_printf(x+FSPACX(8)*7,y,"kills");
		gr_printf(x+FSPACX(8)*12,y,"deaths");
	}
	gr_printf(x+FSPACX(8)*18,y,"ping");
	gr_printf(x+FSPACX(8)*23,y,"efficiency");
	
	// process players table
	for (i=0; i<MAX_PLAYERS; i++)
	{
		if (!Players[i].connected)
			continue;
		
		y+=LINE_SPACING;
		
		if (Game_mode & GM_TEAM)
			color=get_team(i);
		else
			color=i;
		gr_set_fontcolor(BM_XRGB(player_rgb[color].r,player_rgb[color].g,player_rgb[color].b),-1 );
		gr_printf(x,y,"%s\n",Players[i].callsign);
		if (Game_mode & GM_MULTI_COOP)
			gr_printf(x+FSPACX(8)*7,y,"%-6d",Players[i].score);
		else
		{
			gr_printf(x+FSPACX(8)*7,y,"%-6d",Players[i].net_kills_total);
			gr_printf(x+FSPACX(8)*12,y,"%-6d",Players[i].net_killed_total);
		}
		
		gr_printf(x+FSPACX(8)*18,y,"%-6d",Netgame.players[i].ping);
		if (i != Player_num)
			gr_printf(x+FSPACX(8)*23,y,"%d/%d",kill_matrix[Player_num][i],kill_matrix[i][Player_num]);
	}
	
	y+=LINE_SPACING*2+(LINE_SPACING*(MAX_PLAYERS-N_players));
	
	// printf team scores
	if (Game_mode & GM_TEAM)
	{
		gr_set_fontcolor(255,-1);
		gr_printf(x,y,"team");
		gr_printf(x+FSPACX(8)*8,y,"score");
		y+=LINE_SPACING;
		gr_set_fontcolor(BM_XRGB(player_rgb[get_team(0)].r,player_rgb[get_team(0)].g,player_rgb[get_team(0)].b),-1 );
		gr_printf(x,y,"%s:",Netgame.team_name[0]);
		gr_printf(x+FSPACX(8)*8,y,"%i",team_kills[0]);
		y+=LINE_SPACING;
		gr_set_fontcolor(BM_XRGB(player_rgb[get_team(1)].r,player_rgb[get_team(1)].g,player_rgb[get_team(1)].b),-1 );
		gr_printf(x,y,"%s:",Netgame.team_name[1]);
		gr_printf(x+FSPACX(8)*8,y,"%i",team_kills[1]);
		y+=LINE_SPACING*2;
	}
}
Ejemplo n.º 9
0
void ShowNetGameInfo (int choice)
 {
	CMenu	m (30);
   char	mTexts [30][200];
	int	i, j, nInMenu, opt = 0;

#if !DBG
if (choice >= networkData.nActiveGames)
	return;
#endif
memset (mTexts, 0, sizeof (mTexts));
for (i = 0; i < 20; i++)
	m.AddText (reinterpret_cast<char*> (mTexts + i));
sprintf (mTexts [opt], TXT_NGI_GAME, szHighlight, AGI.szGameName); 
opt++;
sprintf (mTexts [opt], TXT_NGI_MISSION, szHighlight, AGI.szMissionTitle); 
opt++;
sprintf (mTexts [opt], TXT_NGI_LEVEL, szHighlight, AGI.nLevel); 
opt++;
sprintf (mTexts [opt], TXT_NGI_SKILL, szHighlight, MENU_DIFFICULTY_TEXT (AGI.difficulty)); 
opt++;
opt++;
#if !DBG
if (!*AXI.szGameName) {
	sprintf (mTexts [opt], "Gamehost is not using D2X-XL or running in pure mode");
	opt++;
	}
else 
#endif
 {
	if (AXI.bShadows || AXI.bUseParticles || AXI.bBrightObjects || (!AXI.bCompetition && AXI.bUseLightning)) {
		INITFLAGS ("Graphics Fx: "); 
		ADDFLAG (AXI.bShadows, "Shadows");
		ADDFLAG (AXI.bUseParticles, "Smoke");
		if (!AXI.bCompetition)
			ADDFLAG (AXI.bUseLightning, "Lightnings");
		ADDFLAG (AXI.bBrightObjects, "Bright Objects");
		}
	else
		strcpy (mTexts [opt], "Graphics Fx: None");
	opt++;
	if (!AXI.bCompetition && (AXI.bLightTrails || AXI.bShockwaves || AXI.bTracers)) {
		INITFLAGS ("Weapon Fx: ");
		ADDFLAG (AXI.bLightTrails, "Light trails");
		ADDFLAG (AXI.bShockwaves, "Shockwaves");
		ADDFLAG (AXI.bTracers, "Tracers");
		ADDFLAG (AXI.bShowWeapons, "Weapons");
		}
	else
		sprintf (mTexts [opt], "Weapon Fx: None");
	opt++;
	if (!AXI.bCompetition && (AXI.bDamageExplosions || AXI.bPlayerShield)) {
		INITFLAGS ("Ship Fx: ");
		ADDFLAG (AXI.bPlayerShield, "Shield");
		ADDFLAG (AXI.bDamageExplosions, "Damage");
		ADDFLAG (AXI.bGatlingSpeedUp, "Gatling speedup");
		}
	else
		sprintf (mTexts [opt], "Ship Fx: None");
	opt++;
	if (AXI.nWeaponIcons || (!AXI.bCompetition && (AXI.bTargetIndicators || AXI.bDamageIndicators))) {
		INITFLAGS ("HUD extensions: ");
		ADDFLAG (AXI.nWeaponIcons != 0, "Icons");
		ADDFLAG (!AXI.bCompetition && AXI.bTargetIndicators, "Tgt indicators");
		ADDFLAG (!AXI.bCompetition && AXI.bDamageIndicators, "Dmg indicators");
		ADDFLAG (!AXI.bCompetition && AXI.bMslLockIndicators, "Trk indicators");
		}
	else
		strcat (mTexts [opt], "HUD extensions: None");
	opt++;
	if (!AXI.bCompetition && AXI.bRadarEnabled) {
		INITFLAGS ("Radar: ");
		ADDFLAG ((AGI.gameFlags & NETGAME_FLAG_SHOW_MAP) != 0, "Players");
		ADDFLAG (AXI.nRadar, "Radar");
		ADDFLAG (AXI.bPowerupsOnRadar, "Powerups");
		ADDFLAG (AXI.bRobotsOnRadar, "Robots");
		}
	else
		strcat (mTexts [opt], "Radar: off");
	opt++;
	if (!AXI.bCompetition && (AXI.bMouseLook || AXI.bFastPitch)) {
		INITFLAGS ("Controls ext.: ");
		ADDFLAG (AXI.bMouseLook, "mouselook");
		ADDFLAG (AXI.bFastPitch, "fast pitch");
		}
	else
		strcat (mTexts [opt], "Controls ext.: None");
	opt++;
	if (!AXI.bCompetition && 
		 (AXI.bDualMissileLaunch || !AXI.bFriendlyFire || AXI.bInhibitSuicide || 
		  AXI.bEnableCheats || AXI.bDarkness || (AXI.nFusionRamp != 2))) {
		INITFLAGS ("Gameplay ext.: ");
		ADDFLAG (AXI.bEnableCheats, "Cheats");
		ADDFLAG (AXI.bDarkness, "Darkness");
		ADDFLAG (AXI.bSmokeGrenades, "Smoke Grens");
		ADDFLAG (AXI.bDualMissileLaunch, "Dual Msls");
		ADDFLAG (AXI.nFusionRamp != 2, "Fusion ramp");
		ADDFLAG (!AXI.bFriendlyFire, "no FF");
		ADDFLAG (AXI.bInhibitSuicide, "no suicide");
		ADDFLAG (AXI.bKillMissiles, "shoot msls");
		ADDFLAG (AXI.bTripleFusion, "tri fusion");
		ADDFLAG (AXI.bEnhancedShakers, "enh shakers");
		ADDFLAG (AXI.nHitboxes, "hit boxes");
		}
	else
		strcat (mTexts [opt], "Gameplay ext.: None");
	opt++;
	}
bAlreadyShowingInfo = 1;
nInMenu = gameStates.menus.nInMenu;
gameStates.menus.nInMenu = 0;
gameStates.menus.bNoBackground = 0;
m.TinyMenu (NULL, TXT_NETGAME_INFO);
gameStates.menus.bNoBackground = 0;
gameStates.app.bGameRunning = 0;
gameStates.menus.nInMenu = nInMenu;
bAlreadyShowingInfo = 0;
 }
Ejemplo n.º 10
0
void scores_draw_item(int  i, stats_info * stats)
{
	char buffer[20];

	int y;

	y = 7 + 70 + i * 9;

	if (i == 0) y -= 8;

	if (i == MAX_HIGH_SCORES) 	{
		y += 8;
		//scores_rprintf( 17+33+XX, y+YY, "" );
	}
	else {
		scores_rprintf(17 + 33 + XX, y + YY, "%d.", i + 1);
	}

	if (strlen(stats->name) == 0) {
		gr_scale_printf((26 + 33 + XX) * f2fl(Scale_x), (y + YY) * f2fl(Scale_y), Scale_factor, Scale_factor, TXT_EMPTY);
		return;
	}
	gr_scale_printf((26 + 33 + XX) * f2fl(Scale_x), (y + YY) * f2fl(Scale_y), Scale_factor, Scale_factor, "%s", stats->name);
	int_to_string(stats->score, buffer);
	scores_rprintf(109 + 33 + XX, y + YY, "%s", buffer);

	gr_scale_printf((125 + 33 + XX) * f2fl(Scale_x), (y + YY) * f2fl(Scale_y), Scale_factor, Scale_factor, "%s", MENU_DIFFICULTY_TEXT(stats->diff_level));

	if ((stats->starting_level > 0) && (stats->ending_level > 0))
		scores_rprintf(192 + 33 + XX, y + YY, "%d-%d", stats->starting_level, stats->ending_level);
	else if ((stats->starting_level < 0) && (stats->ending_level > 0))
		scores_rprintf(192 + 33 + XX, y + YY, "S%d-%d", -stats->starting_level, stats->ending_level);
	else if ((stats->starting_level < 0) && (stats->ending_level < 0))
		scores_rprintf(192 + 33 + XX, y + YY, "S%d-S%d", -stats->starting_level, -stats->ending_level);
	else if ((stats->starting_level > 0) && (stats->ending_level < 0))
		scores_rprintf(192 + 33 + XX, y + YY, "%d-S%d", stats->starting_level, -stats->ending_level);

	{
		int h, m, s;
		h = stats->seconds / 3600;
		s = stats->seconds % 3600;
		m = s / 60;
		s = s % 60;
		scores_rprintf(311 - 42 + XX, y + YY, "%d:%02d:%02d", h, m, s);
	}
}
Ejemplo n.º 11
0
void NewGameMenu (void)
{
	CMenu				menu;
	int				optSelMsn, optMsnName, optLevelText, optLevel, optLaunch, optLoadout;
	int				nMission = gameData.missions.nLastMission, bMsnLoaded = 0;
	int				i, choice = 0;
	char				szDifficulty [50];
	char				szLevelText [32];
	char				szLevel [5];
#if DBG
	int				optLives;
	char				szLives [5];
#endif

	static int		nPlayerMaxLevel = 1;
	static int		nLevel = 0;

if (gameStates.app.bNostalgia) {
	LegacyNewGameMenu ();
	return;
	}
gameStates.app.bD1Mission = 0;
gameStates.app.bD1Data = 0;
gameOpts->app.nVersionFilter = 3;
SetDataVersion (-1);
if (nMission < 0)
	gameFolders.szMsnSubDir [0] = '\0';
else if (gameOpts->app.bSinglePlayer) {
	if (!strstr (gameFolders.szMsnSubDir, "single/"))
		nMission = -1;
	gameFolders.szMsnSubDir [0] = '\0';
	}
hogFileManager.UseMission ("");

for (;;) {
	menu.Destroy ();
	menu.Create (15);

	optSelMsn = menu.AddMenu (TXT_SEL_MISSION, KEY_I, HTX_MULTI_MISSION);
	optMsnName = menu.AddText ((nMission < 0) ? TXT_NONE_SELECTED : gameData.missions.list [nMission].szMissionName, 0);
	if ((nMission >= 0) && (nPlayerMaxLevel > 1)) {
		sprintf (szLevelText, "%s (1-%d)", TXT_LEVEL_, nPlayerMaxLevel);
		Assert (strlen (szLevelText) < 100);
		optLevelText = menu.AddText (szLevelText, 0); 
		menu [optLevelText].m_bRebuild = 1;
		sprintf (szLevel, "%d", nLevel);
		optLevel = menu.AddInput (szLevel, 4, HTX_MULTI_LEVEL);
		}
	else
		optLevel = -1;
#if DBG
	menu.AddText ("");
	menu.AddText ("Initial Lives:");
	sprintf (szLives, "%d", gameStates.gameplay.nInitialLives);
	optLives = menu.AddInput (szLives, 4);
#endif
	menu.AddText ("                              ", 0);
	sprintf (szDifficulty + 1, TXT_DIFFICULTY2, MENU_DIFFICULTY_TEXT (gameStates.app.nDifficultyLevel));
	*szDifficulty = *(TXT_DIFFICULTY2 - 1);
	nOptDifficulty = menu.AddSlider (szDifficulty + 1, gameStates.app.nDifficultyLevel, 0, 4, KEY_D, HTX_GPLAY_DIFFICULTY);
	menu.AddText ("", 0);
	optLoadout = menu.AddMenu (TXT_LOADOUT_OPTION, KEY_B, HTX_MULTI_LOADOUT);

	if (nMission >= 0) {
		menu.AddText ("", 0);
		optLaunch = menu.AddMenu (TXT_LAUNCH_GAME, KEY_L, "");
		menu [optLaunch].m_bCentered = 1;
		}
	else
		optLaunch = -1;

	i = menu.Menu (NULL, TXT_NEWGAME_MENUTITLE, NewGameMenuCallback, &choice);
	if (i < 0) {
		SetFunctionMode (FMODE_MENU);
		return;
		}
	if (choice == optLoadout)
		LoadoutOptionsMenu ();
	else if (choice == optSelMsn) {
		i = SelectAndLoadMission (0, NULL);
		if (i >= 0) {
			bMsnLoaded = 1;
			nMission = i;
			nLevel = 1;
			PrintLog ("   getting highest level allowed to play\n");
			nPlayerMaxLevel = GetHighestLevel ();
			if (nPlayerMaxLevel > gameData.missions.nLastLevel)
				nPlayerMaxLevel = gameData.missions.nLastLevel;
			}
		}
	else if (choice == optLevel) {
		i = atoi (menu [optLevel].m_text);
#if DBG
		if (!i || (i < -gameData.missions.nSecretLevels) || (i > nPlayerMaxLevel))
#else
		if ((i <= 0) || (i > nPlayerMaxLevel))
#endif
			MsgBox (NULL, NULL, 1, TXT_OK, TXT_INVALID_LEVEL); 
		else if (nLevel == i)
			break;
		else
			nLevel = i;
		}
	else if (nMission >= 0) {
		if ((optLevel > 0) && !(nLevel = atoi (menu [optLevel].m_text))) {
			MsgBox (NULL, NULL, 1, TXT_OK, TXT_INVALID_LEVEL); 
			nLevel = 1;
			}
		else
			break;
		}
#if DBG
	else {
		i = atoi (menu [optLives].m_text);
		if (i > 0)
			gameStates.gameplay.nInitialLives = min (i, 255);
		}
#endif
	}

i = menu [nOptDifficulty].m_value;
if (gameStates.app.nDifficultyLevel != i) {
	gameStates.app.nDifficultyLevel = i;
	gameData.bosses.InitGateIntervals ();
	}
SavePlayerProfile ();

paletteManager.DisableEffect ();
if (!bMsnLoaded)
	LoadMission (nMission);
if (!StartNewGame (nLevel))
	SetFunctionMode (FMODE_MENU);
}
Ejemplo n.º 12
0
void GameplayOptionsMenu (void)
{
	static int choice = 0;

	CMenu m;
	int	i;
	int	optSmartWeaponSwitch = -1, optHeadlightBuiltIn = -1, optHeadlightPowerDrain = -1, optNoThief = -1;
	int	optReorderPrim, optReorderSec;
	char	szSlider [50];

pszAggressivities [0] = TXT_STANDARD;
pszAggressivities [1] = TXT_MODERATE;
pszAggressivities [2] = TXT_MEDIUM;
pszAggressivities [3] = TXT_HIGH;
pszAggressivities [4] = TXT_VERY_HIGH;
pszAggressivities [5] = TXT_EXTREME;

pszWeaponSwitch [0] = TXT_NEVER;
pszWeaponSwitch [1] = TXT_WHEN_EMPTY;
pszWeaponSwitch [2] = TXT_CHOSE_BEST;

nAIAggressivity = (gameOpts->gameplay.nAIAggressivity && gameOpts->gameplay.nAIAwareness) ? 5 :  gameOpts->gameplay.nAIAggressivity;
do {
	m.Destroy ();
	m.Create (20);

	sprintf (szSlider + 1, TXT_DIFFICULTY2, MENU_DIFFICULTY_TEXT (gameStates.app.nDifficultyLevel));
	*szSlider = *(TXT_DIFFICULTY2 - 1);
	gplayOpts.nDifficulty = m.AddSlider (szSlider + 1, gameStates.app.nDifficultyLevel, 0, 4, KEY_D, HTX_GPLAY_DIFFICULTY);

	sprintf (szSlider + 1, TXT_AI_AGGRESSIVITY, pszAggressivities [nAIAggressivity]);
	*szSlider = *(TXT_AI_AGGRESSIVITY - 1);
	gplayOpts.nAIAggressivity = m.AddSlider (szSlider + 1, nAIAggressivity, 0, 5, KEY_A, HTX_AI_AGGRESSIVITY);

	sprintf (szSlider + 1, TXT_WEAPON_SWITCH, pszWeaponSwitch [gameOpts->gameplay.nAutoSelectWeapon]);
	*szSlider = *(TXT_WEAPON_SWITCH - 1);
	gplayOpts.nWeaponSwitch = m.AddSlider (szSlider + 1, gameOpts->gameplay.nAutoSelectWeapon, 0, 2, KEY_W, HTX_WEAPON_SWITCH);

	m.AddText ("", 0);
	optSmartWeaponSwitch = m.AddCheck (TXT_SMART_WPNSWITCH, extraGameInfo [0].bSmartWeaponSwitch, KEY_S, HTX_GPLAY_SMARTSWITCH);
	optHeadlightBuiltIn = m.AddCheck (TXT_HEADLIGHT_BUILTIN, extraGameInfo [0].headlight.bBuiltIn, KEY_B, HTX_HEADLIGHT_BUILTIN);
	optHeadlightPowerDrain = m.AddCheck (TXT_HEADLIGHT_POWERDRAIN, extraGameInfo [0].headlight.bDrainPower, KEY_H, HTX_HEADLIGHT_POWERDRAIN);
	optNoThief = m.AddCheck (TXT_SUPPRESS_THIEF, gameOpts->gameplay.bNoThief, KEY_T, HTX_SUPPRESS_THIEF);
	m.AddText ("");
	optReorderPrim = m.AddMenu (TXT_PRIMARY_PRIO, KEY_P, HTX_OPTIONS_PRIMPRIO);
	optReorderSec = m.AddMenu (TXT_SECONDARY_PRIO, KEY_E, HTX_OPTIONS_SECPRIO);
	for (;;) {
		if (0 > (i = m.Menu (NULL, TXT_GAMEPLAY_OPTS, GameplayOptionsCallback, &choice)))
			break;
		if (choice == optReorderPrim)
			ReorderPrimary ();
		else if (choice == optReorderSec)
			ReorderSecondary ();
		};
	} while (i == -2);
if (nAIAggressivity == 5) {
	gameOpts->gameplay.nAIAwareness = 1;
	gameOpts->gameplay.nAIAggressivity = nAIAggressivity - 1;
	}
else {
	gameOpts->gameplay.nAIAwareness = 0;
	gameOpts->gameplay.nAIAggressivity = nAIAggressivity;
	}

extraGameInfo [0].headlight.bAvailable = m [gplayOpts.nHeadlightAvailable].m_value;
extraGameInfo [0].bSmartWeaponSwitch = m [optSmartWeaponSwitch].m_value;
GET_VAL (gameOpts->gameplay.bNoThief, optNoThief);
GET_VAL (extraGameInfo [0].headlight.bDrainPower, optHeadlightPowerDrain);
GET_VAL (extraGameInfo [0].headlight.bBuiltIn, optHeadlightBuiltIn);
DefaultGameplaySettings ();
if (IsMultiGame && !COMPETITION && EGI_FLAG (bSmokeGrenades, 0, 0, 0))
	LOCALPLAYER.secondaryAmmo [PROXMINE_INDEX] = 4;
if (IsMultiGame)
	NetworkSendExtraGameInfo (NULL);
}
Ejemplo n.º 13
0
void DoShowNetGameHelp (void)
{
    CMenu		m (30);
    char		szText [MENU_MAX_TEXTLEN];
    int		i, eff;
#if DBG
    int pl;
#endif
    //char *eff_strings[]={"trashing", "really hurting", "seriously affecting", "hurting", "affecting", "tarnishing"};

    sprintf (szText, TXT_INFO_GAME, netGame.m_info.szGameName);
    m.AddText (szText);
    sprintf (szText, TXT_INFO_MISSION, netGame.m_info.szMissionTitle);
    m.AddText (szText);
    sprintf (szText, TXT_INFO_LEVEL, netGame.m_info.GetLevel ());
    m.AddText (szText);
    sprintf (szText, TXT_INFO_SKILL, MENU_DIFFICULTY_TEXT (netGame.m_info.difficulty));
    m.AddText (szText);
    sprintf (szText, TXT_INFO_MODE, GT (537 + netGame.m_info.gameMode));
    m.AddText (szText);
    sprintf (szText, TXT_INFO_SERVER, gameData.multiplayer.players [NetworkWhoIsMaster()].callsign);
    m.AddText (szText);
    sprintf (szText, TXT_INFO_PLRNUM, NetworkHowManyConnected (), netGame.m_info.nMaxPlayers);
    m.AddText (szText);
    sprintf (szText, TXT_INFO_PPS, netGame.GetPacketsPerSec ());
    m.AddText (szText);
    sprintf (szText, TXT_INFO_SHORTPKT, netGame.GetShortPackets () ? "Yes" : "No");
    m.AddText (szText);
#if DBG
    pl = (int) ((double (networkData.nTotalMissedPackets) / double (networkData.nTotalPacketsGot + networkData.nTotalMissedPackets)) * 100.0);
    if (pl < 0)
        pl = 0;
    sprintf (szText, TXT_INFO_LOSTPKT, networkData.nTotalMissedPackets, pl);
    m.AddText (szText);
#endif
    if (netGame.GetScoreGoal ())
        sprintf (szText, TXT_INFO_SCOREGOAL, netGame.GetScoreGoal () * 5);
    sprintf (szText, " ");
    sprintf (szText, TXT_INFO_PLRSCONN);
    netPlayers.m_info.players [gameData.multiplayer.nLocalPlayer].rank = GetMyNetRanking ();
    for (i = 0; i < gameData.multiplayer.nPlayers; i++)
        if (gameData.multiplayer.players [i].connected) {
            if (!gameOpts->multi.bNoRankings) {
                if (i == gameData.multiplayer.nLocalPlayer)
                    sprintf (szText, "%s%s (%d/%d)",
                             pszRankStrings [netPlayers.m_info.players [i].rank],
                             gameData.multiplayer.players [i].callsign,
                             networkData.nNetLifeKills,
                             networkData.nNetLifeKilled);
                else
                    sprintf (szText, "%s%s %d/%d",
                             pszRankStrings[netPlayers.m_info.players [i].rank],
                             gameData.multiplayer.players [i].callsign,
                             gameData.multigame.kills.matrix[gameData.multiplayer.nLocalPlayer][i],
                             gameData.multigame.kills.matrix[i][gameData.multiplayer.nLocalPlayer]);
            }
            else
                sprintf (szText, "%s", gameData.multiplayer.players [i].callsign);
            m.AddText (szText);
        }
    m.AddText ("");
    eff = (int)((double)((double) networkData.nNetLifeKills / ((double) networkData.nNetLifeKilled + (double) networkData.nNetLifeKills))*100.0);
    if (eff < 0)
        eff = 0;
    if (gameData.app.nGameMode & GM_HOARD) {
        if (gameData.score.nPhallicMan == -1)
            sprintf (szText, TXT_NO_RECORD2);
        else
            sprintf (szText, TXT_RECORD3, gameData.multiplayer.players [gameData.score.nPhallicMan].callsign, gameData.score.nPhallicLimit);
    }
    else if (!gameOpts->multi.bNoRankings) {
        sprintf (szText, TXT_EFF_LIFETIME, eff);
        m.AddText (szText);
        if (eff < 60)
            sprintf (szText, TXT_EFF_INFLUENCE, GT(546 + eff / 10));
        else
            sprintf (szText, TXT_EFF_SERVEWELL);
        m.AddText (szText);
    }
//paletteManager.SuspendEffect();
    bPauseableMenu = 1;
    m.TinyMenu (NULL, "NetGame Information");
//paletteManager.ResumeEffect ();
}
Ejemplo n.º 14
0
void show_netplayerinfo()
{
	int x=0, y=0, i=0, color=0, eff=0;
	static const char *const eff_strings[]={"trashing","really hurting","seriously affecting","hurting","affecting","tarnishing"};

	gr_set_current_canvas(NULL);
	gr_set_curfont(GAME_FONT);
	gr_set_fontcolor(255,-1);

	x=(SWIDTH/2)-FSPACX(120);
	y=(SHEIGHT/2)-FSPACY(84);

	gr_settransblend(14, GR_BLEND_NORMAL);
	gr_setcolor( BM_XRGB(0,0,0) );
	gr_rect((SWIDTH/2)-FSPACX(120),(SHEIGHT/2)-FSPACY(84),(SWIDTH/2)+FSPACX(120),(SHEIGHT/2)+FSPACY(84));
	gr_settransblend(GR_FADE_OFF, GR_BLEND_NORMAL);

	// general game information
	y+=LINE_SPACING;
	gr_printf(0x8000,y,"%s",Netgame.game_name);
#ifndef SHAREWARE
	y+=LINE_SPACING;
	gr_printf(0x8000,y,"%s - lvl: %i",Netgame.mission_title,Netgame.levelnum);
#endif

	x+=FSPACX(8);
	y+=LINE_SPACING*2;
	unsigned gamemode = Netgame.gamemode;
	gr_printf(x,y,"game mode: %s",gamemode < (sizeof(GMNames) / sizeof(GMNames[0])) ? GMNames[gamemode] : "INVALID");

	
	int base_flags_left = SWIDTH/2 - FSPACX(15);
	int flags_x = base_flags_left + FSPACX(30);
	int letter_spacing = FSPACX(7); 
	int word_spacing = FSPACX(46); 


	if(Netgame.RetroProtocol) {
		draw_flag("RetroP2P", 1,                         						 base_flags_left + word_spacing*0, y); 
	} else if(Netgame.ShortPackets) {
		draw_flag("ShortPkt", 1,                         						 base_flags_left + word_spacing*0, y); 
	} else {
		draw_flag("LongPkt", 1,                         						 base_flags_left + word_spacing*0, y); 
	}

	char pps_string[16];
	sprintf(pps_string, "PPS %d", Netgame.PacketsPerSec); 
	draw_flag(pps_string, 1,                         						 base_flags_left + word_spacing*1, y);

	if(Netgame.SpawnStyle == SPAWN_STYLE_NO_INVUL ) {
		draw_flag("NoInvul", 1,                            base_flags_left + word_spacing*2, y); 
	} else if (Netgame.SpawnStyle == SPAWN_STYLE_SHORT_INVUL ) {
		draw_flag("ShortInv", 1, base_flags_left + word_spacing*2, y); 
	}  else if (Netgame.SpawnStyle == SPAWN_STYLE_LONG_INVUL ) {
		draw_flag("LongInv", 1,                            base_flags_left + word_spacing*2, y); 
	} else {
		draw_flag("Preview", 1,                            base_flags_left + word_spacing*2, y); 
	}
	

	set_font_newline(); 

	y+=LINE_SPACING;
	gr_printf(x,y,"difficulty: %s",MENU_DIFFICULTY_TEXT(Netgame.difficulty));

	draw_flag("ColorLgt", Netgame.AllowColoredLighting,                            base_flags_left + word_spacing*0, y); 
	draw_flag("BrtShips", Netgame.BrightPlayers,                                   base_flags_left + word_spacing*1, y); 	
	draw_flag("ConcResp", Netgame.RespawnConcs,                                    base_flags_left + word_spacing*2, y); 

	set_font_newline(); 
	y+=LINE_SPACING;
	gr_printf(x,y,"level time: %i:%02i:%02i",Players[Player_num].hours_level,f2i(Players[Player_num].time_level) / 60 % 60,f2i(Players[Player_num].time_level) % 60);

	char disp_string[16];
	sprintf(disp_string, "Guns x%d", Netgame.PrimaryDupFactor == 0 ? 1 : Netgame.PrimaryDupFactor);
	draw_flag(disp_string, Netgame.PrimaryDupFactor > 1,                           base_flags_left + word_spacing*0, y); 

	sprintf(disp_string, "Msls x%d", Netgame.SecondaryDupFactor == 0 ? 1 : Netgame.SecondaryDupFactor);
	draw_flag(disp_string, Netgame.SecondaryDupFactor > 1,                         base_flags_left + word_spacing*1, y); 	

	sprintf(disp_string, "Mcap %s", Netgame.SecondaryCapFactor == 0 ? "ALL" : (Netgame.SecondaryCapFactor == 1 ? "6" : "2"));
	draw_flag(disp_string, Netgame.SecondaryCapFactor > 0,                         base_flags_left + word_spacing*2, y); 	


	set_font_newline(); 
	y+=LINE_SPACING;
	gr_printf(x,y,"total time: %i:%02i:%02i",Players[Player_num].hours_total,f2i(Players[Player_num].time_total) / 60 % 60,f2i(Players[Player_num].time_total) % 60);




	set_font_newline(); 
	y+=LINE_SPACING;
	if (Netgame.KillGoal)
		gr_printf(x,y,"Kill goal: %d",Netgame.KillGoal*10);

	gr_printf(base_flags_left, y, "Items: "); 
	draw_flag("L", Netgame.AllowedItems & NETFLAG_DOLASER,     flags_x, y);  flags_x += letter_spacing; 
	draw_flag("Q", Netgame.AllowedItems & NETFLAG_DOQUAD,      flags_x, y);  flags_x += letter_spacing; 
	draw_flag("V", Netgame.AllowedItems & NETFLAG_DOVULCAN,    flags_x, y);  flags_x += letter_spacing; 
	draw_flag("A", Netgame.AllowedItems & NETFLAG_DOVULCANAMMO,flags_x, y);  flags_x += letter_spacing; 
	draw_flag("S", Netgame.AllowedItems & NETFLAG_DOSPREAD,    flags_x, y);  flags_x += letter_spacing; 
	draw_flag("P", Netgame.AllowedItems & NETFLAG_DOPLASMA,    flags_x, y);  flags_x += letter_spacing; 
	draw_flag("F", Netgame.AllowedItems & NETFLAG_DOFUSION,    flags_x, y);  flags_x += letter_spacing; 
	draw_flag("C", 1,                                          flags_x, y);  flags_x += letter_spacing; 
	draw_flag("H", Netgame.AllowedItems & NETFLAG_DOHOMING,    flags_x, y);  flags_x += letter_spacing; 
	draw_flag("P", Netgame.AllowedItems & NETFLAG_DOPROXIM,    flags_x, y);  flags_x += letter_spacing; 
	draw_flag("S", Netgame.AllowedItems & NETFLAG_DOSMART,     flags_x, y);  flags_x += letter_spacing; 
	draw_flag("M", Netgame.AllowedItems & NETFLAG_DOMEGA,      flags_x, y);  flags_x += letter_spacing; 
	draw_flag("C", Netgame.AllowedItems & NETFLAG_DOCLOAK,     flags_x, y);  flags_x += letter_spacing; 
	draw_flag("I", Netgame.AllowedItems & NETFLAG_DOINVUL,     flags_x, y);  flags_x += letter_spacing; 

	// player information (name, kills, ping, game efficiency)
	set_font_newline(); 	
	y+=LINE_SPACING*3;
	gr_printf(x,y,"player");
	if (Game_mode & GM_MULTI_COOP)
		gr_printf(x+FSPACX(8)*7,y,"score");
	else
	{
		gr_printf(x+FSPACX(8)*7,y,"kills");
		gr_printf(x+FSPACX(8)*12,y,"deaths");
	}
	gr_printf(x+FSPACX(8)*18,y,"ping");
	gr_printf(x+FSPACX(8)*23,y,"efficiency");

	if(Netgame.FairColors)
		selected_player_rgb = player_rgb_all_blue; 
	else if(Netgame.BlackAndWhitePyros) 
		selected_player_rgb = player_rgb_alt; 
	else
		selected_player_rgb = player_rgb;

	// process players table
	for (i=0; i<MAX_PLAYERS; i++)
	{
		if (!Players[i].connected)
			continue;

		y+=LINE_SPACING;

		if (Game_mode & GM_TEAM)
			color=get_team(i);
		else
			color=Netgame.players[i].color;//i;
		gr_set_fontcolor( BM_XRGB(selected_player_rgb[color].r,selected_player_rgb[color].g,selected_player_rgb[color].b),-1 );
		gr_printf(x,y,"%s\n",Players[i].callsign);
		if (Game_mode & GM_MULTI_COOP)
			gr_printf(x+FSPACX(8)*7,y,"%-6d",Players[i].score);
		else
		{
			gr_printf(x+FSPACX(8)*7,y,"%-6d",Players[i].net_kills_total);
			gr_printf(x+FSPACX(8)*12,y,"%-6d",Players[i].net_killed_total);
		}

		gr_printf(x+FSPACX(8)*18,y,"%-6d",Netgame.players[i].ping + Netgame.players[Player_num].ping);
		if (i != Player_num)
			gr_printf(x+FSPACX(8)*23,y,"%d/%d",kill_matrix[Player_num][i],kill_matrix[i][Player_num]);
	}

	y+=LINE_SPACING*2+(LINE_SPACING*(MAX_PLAYERS-N_players));

	// printf team scores
	if (Game_mode & GM_TEAM)
	{
		gr_set_fontcolor(255,-1);
		gr_printf(x,y,"team");
		gr_printf(x+FSPACX(8)*8,y,"score");
		y+=LINE_SPACING;
		gr_set_fontcolor(BM_XRGB(selected_player_rgb[0].r,selected_player_rgb[0].g,selected_player_rgb[0].b),-1 );
		gr_printf(x,y,"%s:",Netgame.team_name[0]);
		gr_printf(x+FSPACX(8)*8,y,"%i",team_kills[0]);
		y+=LINE_SPACING;
		gr_set_fontcolor(BM_XRGB(selected_player_rgb[1].r,selected_player_rgb[1].g,selected_player_rgb[1].b),-1 );
		gr_printf(x,y,"%s:",Netgame.team_name[1]);
		gr_printf(x+FSPACX(8)*8,y,"%i",team_kills[1]);
		y+=LINE_SPACING*2;
	}
	else
		y+=LINE_SPACING*4;

	gr_set_fontcolor(255,-1);

	// additional information about game - ranking
	eff=(int)((float)((float)PlayerCfg.NetlifeKills/((float)PlayerCfg.NetlifeKilled+(float)PlayerCfg.NetlifeKills))*100.0);
	if (eff<0)
		eff=0;

	if (!PlayerCfg.NoRankings)
	{
		gr_printf(0x8000,y,"Your lifetime efficiency of %d%% (%d/%d)",eff,PlayerCfg.NetlifeKills,PlayerCfg.NetlifeKilled);
		y+=LINE_SPACING;
		if (eff<60)
			gr_printf(0x8000,y,"is %s your ranking.",eff_strings[eff/10]);
		else
			gr_printf(0x8000,y,"is serving you well.");
		y+=LINE_SPACING;
		gr_printf(0x8000,y,"your rank is: %s",RankStrings[GetMyNetRanking()]);
	}
}