您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ BotNumActivePlayers函数代码示例

51自学网 2021-06-01 19:55:31
  C++
这篇教程C++ BotNumActivePlayers函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中BotNumActivePlayers函数的典型用法代码示例。如果您正苦于以下问题:C++ BotNumActivePlayers函数的具体用法?C++ BotNumActivePlayers怎么用?C++ BotNumActivePlayers使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了BotNumActivePlayers函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: BotChat_EnterGame

/*==================BotChat_EnterGame==================*/int BotChat_EnterGame(bot_state_t *bs) {	char name[32];	float rnd;	if (bot_nochat.integer) return qfalse;	if (bs->lastchat_time > FloatTime() - TIME_BETWEENCHATTING) return qfalse;	//don't chat in teamplay	if (TeamPlayIsOn()) return qfalse;	// don't chat in tournament mode	if (gametype == GT_TOURNAMENT) return qfalse;	rnd = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_CHAT_ENTEREXITGAME, 0, 1);	if (!bot_fastchat.integer) {		if (random() > rnd) return qfalse;	}	if (BotNumActivePlayers() <= 1) return qfalse;	if (!BotValidChatPosition(bs)) return qfalse;	BotAI_BotInitialChat(bs, "game_enter",				EasyClientName(bs->client, name, 32),	// 0				BotRandomOpponentName(bs),				// 1				"[invalid var]",						// 2				"[invalid var]",						// 3				BotMapTitle(),							// 4				NULL);	bs->lastchat_time = FloatTime();	bs->chatto = CHAT_ALL;	return qtrue;}
开发者ID:MAN-AT-ARMS,项目名称:ioq3,代码行数:32,


示例2: BotChat_StartLevel

/*==================BotChat_StartLevel==================*/int BotChat_StartLevel(bot_state_t *bs) {	char name[32];	float rnd;	if (bot_nochat.integer) return qfalse;	if (BotIsObserver(bs)) return qfalse;	if (bs->lastchat_time > FloatTime() - TIME_BETWEENCHATTING) return qfalse;	//don't chat in teamplay	if (TeamPlayIsOn()) {#ifdef MISSIONPACK	    trap_EA_Command(bs->client, "vtaunt");#endif	    return qfalse;	}	// don't chat in tournament mode	if (gametype == GT_TOURNAMENT) return qfalse;	rnd = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_CHAT_STARTENDLEVEL, 0, 1);	if (!bot_fastchat.integer) {		if (random() > rnd) return qfalse;	}	if (BotNumActivePlayers() <= 1) return qfalse;	BotAI_BotInitialChat(bs, "level_start",				EasyClientName(bs->client, name, 32),	// 0				NULL);	bs->lastchat_time = FloatTime();	bs->chatto = CHAT_ALL;	return qtrue;}
开发者ID:MAN-AT-ARMS,项目名称:ioq3,代码行数:33,


示例3: BotChat_HitNoDeath

/*==================BotChat_HitNoDeath==================*/int BotChat_HitNoDeath( bot_state_t *bs ) {	char name[32];    const char* weap;	float rnd;	int lasthurt_client;	aas_entityinfo_t entinfo;	lasthurt_client = g_entities[bs->client].client->lasthurt_client;	if ( !lasthurt_client ) {		return qfalse;	}	if ( lasthurt_client == bs->client ) {		return qfalse;	}	//	if ( lasthurt_client < 0 || lasthurt_client >= MAX_CLIENTS ) {		return qfalse;	}	//	if ( bot_nochat.integer ) {		return qfalse;	}	if ( bs->lastchat_time > trap_AAS_Time() - 3 ) {		return qfalse;	}	if ( BotNumActivePlayers() <= 1 ) {		return qfalse;	}	rnd = trap_Characteristic_BFloat( bs->character, CHARACTERISTIC_CHAT_HITNODEATH, 0, 1 );	//don't chat in teamplay	if ( TeamPlayIsOn() ) {		return qfalse;	}	//if fast chat is off	if ( !bot_fastchat.integer ) {		if ( random() > rnd * 0.5 ) {			return qfalse;		}	}	if ( !BotValidChatPosition( bs ) ) {		return qfalse;	}	//if the enemy is visible	if ( BotEntityVisible( bs->client, bs->eye, bs->viewangles, 360, bs->enemy ) ) {		return qfalse;	}	//	BotEntityInfo( bs->enemy, &entinfo );	if ( EntityIsShooting( &entinfo ) ) {		return qfalse;	}	//	ClientName( lasthurt_client, name, sizeof( name ) );	weap = BotWeaponNameForMeansOfDeath( g_entities[bs->client].client->lasthurt_mod );	//	BotAI_BotInitialChat( bs, "hit_nodeath", name, weap, NULL );	bs->lastchat_time = trap_AAS_Time();	bs->chatto = CHAT_ALL;	return qtrue;}
开发者ID:bibendovsky,项目名称:rtcw,代码行数:65,


示例4: BotChat_HitTalking

/*==================BotChat_HitTalking==================*/int BotChat_HitTalking(bot_state_t *bs) {	char name[32], *weap;	int lasthurt_client;	float rnd;	if (bot_nochat.integer) return qfalse;	if (bs->lastchat_time > FloatTime() - TIME_BETWEENCHATTING) return qfalse;	if (BotNumActivePlayers() <= 1) return qfalse;	lasthurt_client = g_entities[bs->client].client->lasthurt_client;	if (!lasthurt_client) return qfalse;	if (lasthurt_client == bs->client) return qfalse;	//	if (lasthurt_client < 0 || lasthurt_client >= MAX_CLIENTS) return qfalse;	//	rnd = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_CHAT_HITTALKING, 0, 1);	//don't chat in teamplay	if (TeamPlayIsOn()) return qfalse;	// don't chat in tournament mode	if (gametype == GT_TOURNAMENT) return qfalse;	//if fast chat is off	if (!bot_fastchat.integer) {		if (random() > rnd * 0.5) return qfalse;	}	if (!BotValidChatPosition(bs)) return qfalse;	//	ClientName(g_entities[bs->client].client->lasthurt_client, name, sizeof(name));	weap = BotWeaponNameForMeansOfDeath(g_entities[bs->client].client->lasthurt_mod);	//	BotAI_BotInitialChat(bs, "hit_talking", name, weap, NULL);	bs->lastchat_time = FloatTime();	bs->chatto = CHAT_ALL;	return qtrue;}
开发者ID:MAN-AT-ARMS,项目名称:ioq3,代码行数:38,


示例5: BotChat_ExitGame

/*=======================================================================================================================================BotChat_ExitGame=======================================================================================================================================*/int BotChat_ExitGame(bot_state_t *bs) {	char name[32];	float rnd;	if (bs->lastchat_time > FloatTime() - TIME_BETWEENCHATTING) {		return qfalse;	}	// don't chat in teamplay	if (TeamPlayIsOn()) {		return qfalse;	}	// don't chat in tournament mode	if (gametype == GT_TOURNAMENT) {		return qfalse;	}	rnd = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_CHAT_ENTEREXITGAME, 0, 1);	if (random() > rnd) {		return qfalse;	}	if (BotNumActivePlayers() <= 1) {		return qfalse;	}	BotAI_BotInitialChat(bs, "game_exit", EasyClientName(bs->client, name, 32), BotRandomOpponentName(bs), "[invalid var]", "[invalid var]", BotMapTitle(), NULL);	bs->lastchat_time = FloatTime();	bs->chatto = CHAT_ALL;	return qtrue;}
开发者ID:KuehnhammerTobias,项目名称:ioqw,代码行数:37,


示例6: BotChat_ExitGame

/*==================BotChat_ExitGame==================*/int BotChat_ExitGame( bot_state_t *bs ) {	char name[32];	float rnd;	if ( bot_nochat.integer ) {		return qfalse;	}	if ( bs->lastchat_time > trap_AAS_Time() - 3 ) {		return qfalse;	}	//don't chat in teamplay	if ( TeamPlayIsOn() ) {		return qfalse;	}	rnd = trap_Characteristic_BFloat( bs->character, CHARACTERISTIC_CHAT_ENTEREXITGAME, 0, 1 );	if ( !bot_fastchat.integer ) {		if ( random() > rnd ) {			return qfalse;		}	}	if ( BotNumActivePlayers() <= 1 ) {		return qfalse;	}	//	BotAI_BotInitialChat( bs, "game_exit",						  EasyClientName( bs->client, name, 32 ), // 0						  BotRandomOpponentName( bs ),  // 1						  "[invalid var]",          // 2						  "[invalid var]",          // 3						  BotMapTitle(),                // 4						  NULL );	bs->lastchat_time = trap_AAS_Time();	bs->chatto = CHAT_ALL;	return qtrue;}
开发者ID:chegestar,项目名称:omni-bot,代码行数:40,


示例7: BotChat_StartLevel

/*==================BotChat_StartLevel==================*/int BotChat_StartLevel( bot_state_t *bs ) {	char name[32];	float rnd;	if ( bot_nochat.integer ) {		return qfalse;	}	if ( BotIsObserver( bs ) ) {		return qfalse;	}	if ( bs->lastchat_time > trap_AAS_Time() - 3 ) {		return qfalse;	}	//don't chat in teamplay	if ( TeamPlayIsOn() ) {		return qfalse;	}	rnd = trap_Characteristic_BFloat( bs->character, CHARACTERISTIC_CHAT_STARTENDLEVEL, 0, 1 );	if ( !bot_fastchat.integer ) {		if ( random() > rnd ) {			return qfalse;		}	}	if ( BotNumActivePlayers() <= 1 ) {		return qfalse;	}	BotAI_BotInitialChat( bs, "level_start",						  EasyClientName( bs->client, name, 32 ), // 0						  NULL );	bs->lastchat_time = trap_AAS_Time();	bs->chatto = CHAT_ALL;	return qtrue;}
开发者ID:chegestar,项目名称:omni-bot,代码行数:38,


示例8: BotChat_HitNoKill

/*==================BotChat_HitNoKill==================*/int BotChat_HitNoKill(bot_state_t *bs) {	char name[32], *weap;	float rnd;	aas_entityinfo_t entinfo;	if (bot_nochat.integer) return qfalse;	if (bs->lastchat_time > FloatTime() - TIME_BETWEENCHATTING) return qfalse;	if (BotNumActivePlayers() <= 1) return qfalse;	rnd = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_CHAT_HITNOKILL, 0, 1);	//don't chat in teamplay	if (TeamPlayIsOn()) return qfalse;	// don't chat in tournament mode	if (gametype == GT_TOURNAMENT) return qfalse;	//if fast chat is off	if (!bot_fastchat.integer) {		if (random() > rnd * 0.5) return qfalse;	}	if (!BotValidChatPosition(bs)) return qfalse;	//	if (BotVisibleEnemies(bs)) return qfalse;	//	BotEntityInfo(bs->enemy, &entinfo);	if (EntityIsShooting(&entinfo)) return qfalse;	//	ClientName(bs->enemy, name, sizeof(name));	weap = BotWeaponNameForMeansOfDeath(g_entities[bs->enemy].client->lasthurt_mod);	//	BotAI_BotInitialChat(bs, "hit_nokill", name, weap, NULL);	bs->lastchat_time = FloatTime();	bs->chatto = CHAT_ALL;	return qtrue;}
开发者ID:MAN-AT-ARMS,项目名称:ioq3,代码行数:37,


示例9: BotChat_EnemySuicide

/*==================BotChat_EnemySuicide==================*/int BotChat_EnemySuicide(bot_state_t *bs) {	char name[32];	float rnd;	if (bot_nochat.integer) return qfalse;	if (bs->lastchat_time > FloatTime() - TIME_BETWEENCHATTING) return qfalse;	if (BotNumActivePlayers() <= 1) return qfalse;	//	rnd = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_CHAT_ENEMYSUICIDE, 0, 1);	//don't chat in teamplay	if (TeamPlayIsOn()) return qfalse;	// don't chat in tournament mode	if (gametype == GT_TOURNAMENT) return qfalse;	//if fast chat is off	if (!bot_fastchat.integer) {		if (random() > rnd) return qfalse;	}	if (!BotValidChatPosition(bs)) return qfalse;	//	if (BotVisibleEnemies(bs)) return qfalse;	//	if (bs->enemy >= 0) EasyClientName(bs->enemy, name, 32);	else strcpy(name, "");	BotAI_BotInitialChat(bs, "enemy_suicide", name, NULL);	bs->lastchat_time = FloatTime();	bs->chatto = CHAT_ALL;	return qtrue;}
开发者ID:MAN-AT-ARMS,项目名称:ioq3,代码行数:33,


示例10: BotChat_Kill

/*==================BotChat_Kill==================*/int BotChat_Kill(bot_state_t *bs) {	char name[32];	float rnd;	if (bot_nochat.integer) return qfalse;	if (bs->lastchat_time > FloatTime() - TIME_BETWEENCHATTING) return qfalse;	rnd = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_CHAT_KILL, 0, 1);	// don't chat in tournament mode	if (gametype == GT_TOURNAMENT) return qfalse;	//if fast chat is off	if (!bot_fastchat.integer) {		if (random() > rnd) return qfalse;	}	if (bs->lastkilledplayer == bs->client) return qfalse;	if (BotNumActivePlayers() <= 1) return qfalse;	if (!BotValidChatPosition(bs)) return qfalse;	//	if (BotVisibleEnemies(bs)) return qfalse;	//	EasyClientName(bs->lastkilledplayer, name, 32);	//	bs->chatto = CHAT_ALL;	if (TeamPlayIsOn() && BotSameTeam(bs, bs->lastkilledplayer)) {		BotAI_BotInitialChat(bs, "kill_teammate", name, NULL);		bs->chatto = CHAT_TEAM;	}	else	{		//don't chat in teamplay		if (TeamPlayIsOn()) {#ifdef MISSIONPACK			trap_EA_Command(bs->client, "vtaunt");#endif			return qfalse;			// don't wait		}		//		if (bs->enemydeathtype == MOD_GAUNTLET) {			BotAI_BotInitialChat(bs, "kill_gauntlet", name, NULL);		}		else if (bs->enemydeathtype == MOD_RAILGUN) {			BotAI_BotInitialChat(bs, "kill_rail", name, NULL);		}		else if (bs->enemydeathtype == MOD_TELEFRAG) {			BotAI_BotInitialChat(bs, "kill_telefrag", name, NULL);		}#ifdef MISSIONPACK		else if (bs->botdeathtype == MOD_KAMIKAZE && trap_BotNumInitialChats(bs->cs, "kill_kamikaze"))			BotAI_BotInitialChat(bs, "kill_kamikaze", name, NULL);#endif		//choose between insult and praise		else if (random() < trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_CHAT_INSULT, 0, 1)) {			BotAI_BotInitialChat(bs, "kill_insult", name, NULL);		}		else {			BotAI_BotInitialChat(bs, "kill_praise", name, NULL);		}	}	bs->lastchat_time = FloatTime();	return qtrue;}
开发者ID:MAN-AT-ARMS,项目名称:ioq3,代码行数:65,


示例11: BotChat_Kill

/*==================BotChat_Kill==================*/int BotChat_Kill( bot_state_t *bs ) {	char name[32];	float rnd;	if ( bot_nochat.integer ) {		return qfalse;	}	if ( bs->lastchat_time > trap_AAS_Time() - 3 ) {		return qfalse;	}	rnd = trap_Characteristic_BFloat( bs->character, CHARACTERISTIC_CHAT_KILL, 0, 1 );	//if fast chat is off	if ( !bot_fastchat.integer ) {		if ( random() > rnd ) {			return qfalse;		}	}	if ( bs->lastkilledplayer == bs->client ) {		return qfalse;	}	if ( BotNumActivePlayers() <= 1 ) {		return qfalse;	}	if ( !BotValidChatPosition( bs ) ) {		return qfalse;	}	//	EasyClientName( bs->lastkilledplayer, name, 32 );	//	bs->chatto = CHAT_ALL;	if ( TeamPlayIsOn() && BotSameTeam( bs, bs->lastkilledplayer ) ) {		BotAI_BotInitialChat( bs, "kill_teammate", name, NULL );		bs->chatto = CHAT_TEAM;	} else	{		//don't chat in teamplay		if ( TeamPlayIsOn() ) {			return qfalse;		}		//		if ( bs->enemydeathtype == MOD_GAUNTLET ) {			BotAI_BotInitialChat( bs, "kill_gauntlet", name, NULL );		} else if ( bs->enemydeathtype == MOD_RAILGUN )     {			BotAI_BotInitialChat( bs, "kill_rail", name, NULL );		} else if ( bs->enemydeathtype == MOD_TELEFRAG )     {			BotAI_BotInitialChat( bs, "kill_telefrag", name, NULL );		}		//choose between insult and praise		else if ( random() < trap_Characteristic_BFloat( bs->character, CHARACTERISTIC_CHAT_INSULT, 0, 1 ) ) {			BotAI_BotInitialChat( bs, "kill_insult", name, NULL );		} else {			BotAI_BotInitialChat( bs, "kill_praise", name, NULL );		}	}	bs->lastchat_time = trap_AAS_Time();	return qtrue;}
开发者ID:chegestar,项目名称:omni-bot,代码行数:62,


示例12: BotChat_EndLevel

/*==================BotChat_EndLevel==================*/int BotChat_EndLevel( bot_state_t *bs ) {	char name[32];	float rnd;	if ( bot_nochat.integer ) {		return qfalse;	}	if ( BotIsObserver( bs ) ) {		return qfalse;	}	if ( bs->lastchat_time > trap_AAS_Time() - 3 ) {		return qfalse;	}	//don't chat in teamplay	if ( TeamPlayIsOn() ) {		return qfalse;	}	rnd = trap_Characteristic_BFloat( bs->character, CHARACTERISTIC_CHAT_STARTENDLEVEL, 0, 1 );	if ( !bot_fastchat.integer ) {		if ( random() > rnd ) {			return qfalse;		}	}	if ( BotNumActivePlayers() <= 1 ) {		return qfalse;	}	//	if ( BotIsFirstInRankings( bs ) ) {		BotAI_BotInitialChat( bs, "level_end_victory",							  EasyClientName( bs->client, name, 32 ), // 0							  BotRandomOpponentName( bs ), // 1							  "[invalid var]",      // 2							  BotLastClientInRankings(), // 3							  BotMapTitle(),            // 4							  NULL );	} else if ( BotIsLastInRankings( bs ) )       {		BotAI_BotInitialChat( bs, "level_end_lose",							  EasyClientName( bs->client, name, 32 ), // 0							  BotRandomOpponentName( bs ), // 1							  BotFirstClientInRankings(), // 2							  "[invalid var]",      // 3							  BotMapTitle(),            // 4							  NULL );	} else {		BotAI_BotInitialChat( bs, "level_end",							  EasyClientName( bs->client, name, 32 ), // 0							  BotRandomOpponentName( bs ), // 1							  BotFirstClientInRankings(), // 2							  BotLastClientInRankings(), // 3							  BotMapTitle(),            // 4							  NULL );	}	bs->lastchat_time = trap_AAS_Time();	bs->chatto = CHAT_ALL;	return qtrue;}
开发者ID:chegestar,项目名称:omni-bot,代码行数:61,


示例13: BotChat_EndLevel

/*==================BotChat_EndLevel==================*/int BotChat_EndLevel(bot_state_t *bs) {	char name[32];	float rnd;	if (bot_nochat.integer) return qfalse;	if (BotIsObserver(bs)) return qfalse;	if (bs->lastchat_time > FloatTime() - TIME_BETWEENCHATTING) return qfalse;	// teamplay	if (TeamPlayIsOn()) 	{#ifdef MISSIONPACK		if (BotIsFirstInRankings(bs)) {			trap_EA_Command(bs->client, "vtaunt");		}#endif		return qtrue;	}	// don't chat in tournament mode	if (gametype == GT_TOURNAMENT) return qfalse;	rnd = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_CHAT_STARTENDLEVEL, 0, 1);	if (!bot_fastchat.integer) {		if (random() > rnd) return qfalse;	}	if (BotNumActivePlayers() <= 1) return qfalse;	//	if (BotIsFirstInRankings(bs)) {		BotAI_BotInitialChat(bs, "level_end_victory",				EasyClientName(bs->client, name, 32),	// 0				BotRandomOpponentName(bs),				// 1				"[invalid var]",						// 2				BotLastClientInRankings(),				// 3				BotMapTitle(),							// 4				NULL);	}	else if (BotIsLastInRankings(bs)) {		BotAI_BotInitialChat(bs, "level_end_lose",				EasyClientName(bs->client, name, 32),	// 0				BotRandomOpponentName(bs),				// 1				BotFirstClientInRankings(),				// 2				"[invalid var]",						// 3				BotMapTitle(),							// 4				NULL);	}	else {		BotAI_BotInitialChat(bs, "level_end",				EasyClientName(bs->client, name, 32),	// 0				BotRandomOpponentName(bs),				// 1				BotFirstClientInRankings(),				// 2				BotLastClientInRankings(),				// 3				BotMapTitle(),							// 4				NULL);	}	bs->lastchat_time = FloatTime();	bs->chatto = CHAT_ALL;	return qtrue;}
开发者ID:MAN-AT-ARMS,项目名称:ioq3,代码行数:61,


示例14: BotChat_EnemySuicide

/*==================BotChat_EnemySuicide==================*/int BotChat_EnemySuicide( bot_state_t *bs ) {	char name[32];	float rnd;	if ( bot_nochat.integer ) {		return qfalse;	}	if ( bs->lastchat_time > trap_AAS_Time() - 3 ) {		return qfalse;	}	if ( BotNumActivePlayers() <= 1 ) {		return qfalse;	}	//	rnd = trap_Characteristic_BFloat( bs->character, CHARACTERISTIC_CHAT_KILL, 0, 1 );	//don't chat in teamplay	if ( TeamPlayIsOn() ) {		return qfalse;	}	//if fast chat is off	if ( !bot_fastchat.integer ) {		if ( random() > rnd ) {			return qfalse;		}	}	if ( !BotValidChatPosition( bs ) ) {		return qfalse;	}	//	if ( bs->enemy >= 0 ) {		EasyClientName( bs->enemy, name, 32 );	} else { strcpy( name, "" );}	BotAI_BotInitialChat( bs, "enemy_suicide", name, NULL );	bs->lastchat_time = trap_AAS_Time();	bs->chatto = CHAT_ALL;	return qtrue;}
开发者ID:chegestar,项目名称:omni-bot,代码行数:42,


示例15: BotChat_Random

/*==================BotChat_Random==================*/int BotChat_Random( bot_state_t *bs ) {	float rnd;	char name[32];	if ( bot_nochat.integer ) {		return qfalse;	}	if ( BotIsObserver( bs ) ) {		return qfalse;	}	if ( bs->lastchat_time > trap_AAS_Time() - 3 ) {		return qfalse;	}	//don't chat in teamplay	if ( TeamPlayIsOn() ) {		return qfalse;	}	//don't chat when doing something important :)	if ( bs->ltgtype == LTG_TEAMHELP ||		 bs->ltgtype == LTG_TEAMACCOMPANY ||		 bs->ltgtype == LTG_RUSHBASE ) {		return qfalse;	}	//	rnd = trap_Characteristic_BFloat( bs->character, CHARACTERISTIC_CHAT_RANDOM, 0, 1 );	if ( random() > bs->thinktime * 0.1 ) {		return qfalse;	}	if ( !bot_fastchat.integer ) {		if ( random() > rnd ) {			return qfalse;		}		if ( random() > 0.25 ) {			return qfalse;		}	}	if ( BotNumActivePlayers() <= 1 ) {		return qfalse;	}	if ( !BotValidChatPosition( bs ) ) {		return qfalse;	}	//	if ( bs->lastkilledplayer == bs->client ) {		strcpy( name, BotRandomOpponentName( bs ) );	} else {		EasyClientName( bs->lastkilledplayer, name, sizeof( name ) );	}	//	if ( random() < trap_Characteristic_BFloat( bs->character, CHARACTERISTIC_CHAT_MISC, 0, 1 ) ) {		BotAI_BotInitialChat( bs, "random_misc",							  BotRandomOpponentName( bs ), // 0							  name,             // 1							  "[invalid var]", // 2							  "[invalid var]", // 3							  BotMapTitle(),    // 4							  BotRandomWeaponName(), // 5							  NULL );	} else {		BotAI_BotInitialChat( bs, "random_insult",							  BotRandomOpponentName( bs ), // 0							  name,             // 1							  "[invalid var]", // 2							  "[invalid var]", // 3							  BotMapTitle(),    // 4							  BotRandomWeaponName(), // 5							  NULL );	}	bs->lastchat_time = trap_AAS_Time();	bs->chatto = CHAT_ALL;	return qtrue;}
开发者ID:chegestar,项目名称:omni-bot,代码行数:77,


示例16: BotChat_Death

/*==================BotChat_Death==================*/int BotChat_Death( bot_state_t *bs ) {	char name[32];	float rnd;	if ( bot_nochat.integer ) {		return qfalse;	}	if ( bs->lastchat_time > trap_AAS_Time() - 3 ) {		return qfalse;	}	rnd = trap_Characteristic_BFloat( bs->character, CHARACTERISTIC_CHAT_DEATH, 0, 1 );	//if fast chatting is off	if ( !bot_fastchat.integer ) {		if ( random() > rnd ) {			return qfalse;		}	}	if ( BotNumActivePlayers() <= 1 ) {		return qfalse;	}	//	if ( bs->lastkilledby >= 0 && bs->lastkilledby < MAX_CLIENTS ) {		EasyClientName( bs->lastkilledby, name, 32 );	} else {		strcpy( name, "[world]" );	}	//	if ( TeamPlayIsOn() && BotSameTeam( bs, bs->lastkilledby ) ) {		if ( bs->lastkilledby == bs->client ) {			return qfalse;		}		BotAI_BotInitialChat( bs, "death_teammate", name, NULL );		bs->chatto = CHAT_TEAM;	} else	{		//don't chat in teamplay		if ( TeamPlayIsOn() ) {			return qfalse;		}		//		if ( bs->botdeathtype == MOD_WATER ) {			BotAI_BotInitialChat( bs, "death_drown", BotRandomOpponentName( bs ), NULL );		} else if ( bs->botdeathtype == MOD_SLIME ) {			BotAI_BotInitialChat( bs, "death_slime", BotRandomOpponentName( bs ), NULL );		} else if ( bs->botdeathtype == MOD_LAVA ) {			BotAI_BotInitialChat( bs, "death_lava", BotRandomOpponentName( bs ), NULL );		} else if ( bs->botdeathtype == MOD_FALLING ) {			BotAI_BotInitialChat( bs, "death_cratered", BotRandomOpponentName( bs ), NULL );		} else if ( bs->botsuicide || //all other suicides by own weapon					bs->botdeathtype == MOD_CRUSH ||					bs->botdeathtype == MOD_SUICIDE ||					bs->botdeathtype == MOD_TARGET_LASER ||					bs->botdeathtype == MOD_TRIGGER_HURT ||					bs->botdeathtype == MOD_UNKNOWN ) {			BotAI_BotInitialChat( bs, "death_suicide", BotRandomOpponentName( bs ), NULL );		} else if ( bs->botdeathtype == MOD_TELEFRAG ) {			BotAI_BotInitialChat( bs, "death_telefrag", name, NULL );		} else {			if ( ( bs->botdeathtype == MOD_GAUNTLET ||				   bs->botdeathtype == MOD_RAILGUN ||				   bs->botdeathtype == MOD_BFG ||				   bs->botdeathtype == MOD_BFG_SPLASH ) && random() < 0.5 ) {				if ( bs->botdeathtype == MOD_GAUNTLET ) {					BotAI_BotInitialChat( bs, "death_gauntlet",										  name,                                 // 0										  BotWeaponNameForMeansOfDeath( bs->botdeathtype ), // 1										  NULL );				} else if ( bs->botdeathtype == MOD_RAILGUN ) {					BotAI_BotInitialChat( bs, "death_rail",										  name,                                 // 0										  BotWeaponNameForMeansOfDeath( bs->botdeathtype ), // 1										  NULL );				} else {					BotAI_BotInitialChat( bs, "death_bfg",										  name,                                 // 0										  BotWeaponNameForMeansOfDeath( bs->botdeathtype ), // 1										  NULL );				}			}			//choose between insult and praise			else if ( random() < trap_Characteristic_BFloat( bs->character, CHARACTERISTIC_CHAT_INSULT, 0, 1 ) ) {				BotAI_BotInitialChat( bs, "death_insult",									  name,                                     // 0									  BotWeaponNameForMeansOfDeath( bs->botdeathtype ), // 1									  NULL );			} else {				BotAI_BotInitialChat( bs, "death_praise",									  name,                                     // 0									  BotWeaponNameForMeansOfDeath( bs->botdeathtype ), // 1									  NULL );			}		}		bs->chatto = CHAT_ALL;	}//.........这里部分代码省略.........
开发者ID:chegestar,项目名称:omni-bot,代码行数:101,


示例17: BotChat_Random

/*==================BotChat_Random==================*/int BotChat_Random(bot_state_t *bs) {	float rnd;	char name[32];	if (bot_nochat.integer) return qfalse;	if (BotIsObserver(bs)) return qfalse;	if (bs->lastchat_time > FloatTime() - TIME_BETWEENCHATTING) return qfalse;	// don't chat in tournament mode	if (gametype == GT_TOURNAMENT) return qfalse;	//don't chat when doing something important :)	if (bs->ltgtype == LTG_TEAMHELP ||		bs->ltgtype == LTG_TEAMACCOMPANY ||		bs->ltgtype == LTG_RUSHBASE) return qfalse;	//	rnd = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_CHAT_RANDOM, 0, 1);	if (random() > bs->thinktime * 0.1) return qfalse;	if (!bot_fastchat.integer) {		if (random() > rnd) return qfalse;		if (random() > 0.25) return qfalse;	}	if (BotNumActivePlayers() <= 1) return qfalse;	//	if (!BotValidChatPosition(bs)) return qfalse;	//	if (BotVisibleEnemies(bs)) return qfalse;	//	if (bs->lastkilledplayer == bs->client) {		strcpy(name, BotRandomOpponentName(bs));	}	else {		EasyClientName(bs->lastkilledplayer, name, sizeof(name));	}	if (TeamPlayIsOn()) {#ifdef MISSIONPACK		trap_EA_Command(bs->client, "vtaunt");#endif		return qfalse;			// don't wait	}	//	if (random() < trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_CHAT_MISC, 0, 1)) {		BotAI_BotInitialChat(bs, "random_misc",					BotRandomOpponentName(bs),	// 0					name,						// 1					"[invalid var]",			// 2					"[invalid var]",			// 3					BotMapTitle(),				// 4					BotRandomWeaponName(),		// 5					NULL);	}	else {		BotAI_BotInitialChat(bs, "random_insult",					BotRandomOpponentName(bs),	// 0					name,						// 1					"[invalid var]",			// 2					"[invalid var]",			// 3					BotMapTitle(),				// 4					BotRandomWeaponName(),		// 5					NULL);	}	bs->lastchat_time = FloatTime();	bs->chatto = CHAT_ALL;	return qtrue;}
开发者ID:MAN-AT-ARMS,项目名称:ioq3,代码行数:68,


示例18: BotChat_HitNoDeath

/*=======================================================================================================================================BotChat_HitNoDeath=======================================================================================================================================*/int BotChat_HitNoDeath(bot_state_t *bs) {	char name[32], *weap;	float rnd;	int lasthurt_client;	aas_entityinfo_t entinfo;	lasthurt_client = g_entities[bs->client].client->lasthurt_client;	if (!lasthurt_client) {		return qfalse;	}	if (lasthurt_client == bs->client) {		return qfalse;	}	if (lasthurt_client < 0 || lasthurt_client >= MAX_CLIENTS) {		return qfalse;	}	if (bs->lastchat_time > FloatTime() - TIME_BETWEENCHATTING) {		return qfalse;	}	if (BotNumActivePlayers() <= 1) {		return qfalse;	}	rnd = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_CHAT_HITNODEATH, 0, 1);	// don't chat in teamplay	if (TeamPlayIsOn()) {		return qfalse;	}	// don't chat in tournament mode	if (gametype == GT_TOURNAMENT) {		return qfalse;	}	if (random() > rnd * 0.5) {		return qfalse;	}	if (!BotValidChatPosition(bs)) {		return qfalse;	}	if (BotVisibleEnemies(bs)) {		return qfalse;	}	if (bs->enemy >= MAX_CLIENTS) {		return qfalse;	}	if (bs->enemy >= 0) {		// get the entity information		BotEntityInfo(bs->enemy, &entinfo);		if (EntityIsShooting(&entinfo)) {			return qfalse;		}	}	ClientName(lasthurt_client, name, sizeof(name));	weap = BotWeaponNameForMeansOfDeath(g_entities[bs->client].client->lasthurt_mod);	BotAI_BotInitialChat(bs, "hit_nodeath", name, weap, NULL);	bs->lastchat_time = FloatTime();	bs->chatto = CHAT_ALL;	return qtrue;}
开发者ID:KuehnhammerTobias,项目名称:ioqw,代码行数:78,


示例19: BotChat_Death

/*==================BotChat_Death==================*/int BotChat_Death(bot_state_t *bs) {	char name[32];	float rnd;	if (bot_nochat.integer) return qfalse;	if (bs->lastchat_time > FloatTime() - TIME_BETWEENCHATTING) return qfalse;	rnd = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_CHAT_DEATH, 0, 1);	// don't chat in tournament mode	if (gametype == GT_TOURNAMENT) return qfalse;	//if fast chatting is off	if (!bot_fastchat.integer) {		if (random() > rnd) return qfalse;	}	if (BotNumActivePlayers() <= 1) return qfalse;	//	if (bs->lastkilledby >= 0 && bs->lastkilledby < MAX_CLIENTS)		EasyClientName(bs->lastkilledby, name, 32);	else		strcpy(name, "[world]");	//	if (TeamPlayIsOn() && BotSameTeam(bs, bs->lastkilledby)) {		if (bs->lastkilledby == bs->client) return qfalse;		BotAI_BotInitialChat(bs, "death_teammate", name, NULL);		bs->chatto = CHAT_TEAM;	}	else	{		//teamplay		if (TeamPlayIsOn()) {#ifdef MISSIONPACK			trap_EA_Command(bs->client, "vtaunt");#endif			return qtrue;		}		//		if (bs->botdeathtype == MOD_WATER)			BotAI_BotInitialChat(bs, "death_drown", BotRandomOpponentName(bs), NULL);		else if (bs->botdeathtype == MOD_SLIME)			BotAI_BotInitialChat(bs, "death_slime", BotRandomOpponentName(bs), NULL);		else if (bs->botdeathtype == MOD_LAVA)			BotAI_BotInitialChat(bs, "death_lava", BotRandomOpponentName(bs), NULL);		else if (bs->botdeathtype == MOD_FALLING)			BotAI_BotInitialChat(bs, "death_cratered", BotRandomOpponentName(bs), NULL);		else if (bs->botsuicide || //all other suicides by own weapon				bs->botdeathtype == MOD_CRUSH ||				bs->botdeathtype == MOD_SUICIDE ||				bs->botdeathtype == MOD_TARGET_LASER ||				bs->botdeathtype == MOD_TRIGGER_HURT ||				bs->botdeathtype == MOD_UNKNOWN)			BotAI_BotInitialChat(bs, "death_suicide", BotRandomOpponentName(bs), NULL);		else if (bs->botdeathtype == MOD_TELEFRAG)			BotAI_BotInitialChat(bs, "death_telefrag", name, NULL);#ifdef MISSIONPACK		else if (bs->botdeathtype == MOD_KAMIKAZE && trap_BotNumInitialChats(bs->cs, "death_kamikaze"))			BotAI_BotInitialChat(bs, "death_kamikaze", name, NULL);#endif		else {			if ((bs->botdeathtype == MOD_GAUNTLET ||				bs->botdeathtype == MOD_RAILGUN ||				bs->botdeathtype == MOD_BFG ||				bs->botdeathtype == MOD_BFG_SPLASH) && random() < 0.5) {				if (bs->botdeathtype == MOD_GAUNTLET)					BotAI_BotInitialChat(bs, "death_gauntlet",							name,												// 0							BotWeaponNameForMeansOfDeath(bs->botdeathtype),		// 1							NULL);				else if (bs->botdeathtype == MOD_RAILGUN)					BotAI_BotInitialChat(bs, "death_rail",							name,												// 0							BotWeaponNameForMeansOfDeath(bs->botdeathtype),		// 1							NULL);				else					BotAI_BotInitialChat(bs, "death_bfg",							name,												// 0							BotWeaponNameForMeansOfDeath(bs->botdeathtype),		// 1							NULL);			}			//choose between insult and praise			else if (random() < trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_CHAT_INSULT, 0, 1)) {				BotAI_BotInitialChat(bs, "death_insult",							name,												// 0							BotWeaponNameForMeansOfDeath(bs->botdeathtype),		// 1							NULL);			}			else {				BotAI_BotInitialChat(bs, "death_praise",							name,												// 0							BotWeaponNameForMeansOfDeath(bs->botdeathtype),		// 1							NULL);			}		}		bs->chatto = CHAT_ALL;	}	bs->lastchat_time = FloatTime();//.........这里部分代码省略.........
开发者ID:MAN-AT-ARMS,项目名称:ioq3,代码行数:101,



注:本文中的BotNumActivePlayers函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ BotPrintTeamGoal函数代码示例
C++ BotCharacterFromHandle函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。