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

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

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

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

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

示例1: BotMatch_WhichTeam

/*==================BotMatch_LeaveSubteam==================*/void BotMatch_WhichTeam(bot_state_t *bs, bot_match_t *match) {	if (!TeamPlayIsOn()) return;	//if not addressed to this bot	if (!BotAddressedToBot(bs, match)) return;	//	if (strlen(bs->subteam)) {		BotAI_BotInitialChat(bs, "inteam", bs->subteam, NULL);	}	else {		BotAI_BotInitialChat(bs, "noteam", NULL);	}	trap_BotEnterChat(bs->cs, bs->client, CHAT_TEAM);}
开发者ID:Avatarchik,项目名称:Quake-III-Arena-D3D11,代码行数:18,


示例2: BotMatch_LeaveSubteam

/*==================BotMatch_LeaveSubteam==================*/void BotMatch_LeaveSubteam( bot_state_t *bs, bot_match_t *match ) {	if ( !TeamPlayIsOn() ) {		return;	}	//if not addressed to this bot	if ( !BotAddressedToBot( bs, match ) ) {		return;	}	//	if ( strlen( bs->subteam ) ) {		BotAI_BotInitialChat( bs, "leftteam", bs->subteam, NULL );	} //end if	trap_BotEnterChat( bs->cs, bs->client, CHAT_TEAM );	strcpy( bs->subteam, "" );}
开发者ID:JackalFrost,项目名称:RTCW-WSGF,代码行数:20,


示例3: BotMatch_Dismiss

/*=======================================================================================================================================BotMatch_Dismiss=======================================================================================================================================*/void BotMatch_Dismiss(bot_state_t *bs, bot_match_t *match) {	if (!TeamPlayIsOn()) {		return;	}	// if not addressed to this bot	if (!BotAddressedToBot(bs, match)) {		return;	}	bs->ltgtype = 0;	bs->lead_time = 0;	BotAI_BotInitialChat(bs, "dismissed", NULL);	trap_BotEnterChat(bs->cs, bs->client, CHAT_TEAM);}
开发者ID:ioid3-games,项目名称:ioid3-rtcw,代码行数:20,


示例4: BotMatch_Suicide

/*==================BotMatch_Suicide==================*/void BotMatch_Suicide(bot_state_t *bs, bot_match_t *match) {	char netname[MAX_MESSAGE_SIZE];	int client;	if (!TeamPlayIsOn()) return;	//if not addressed to this bot	if (!BotAddressedToBot(bs, match)) return;	//	trap_EA_Command(bs->client, "kill");	//	trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));	client = ClientFromName(netname);	//	BotVoiceChat(bs, client, VOICECHAT_TAUNT);	trap_EA_Action(bs->client, ACTION_AFFIRMATIVE);}
开发者ID:AHPlankton,项目名称:Quake-III-Arena,代码行数:21,


示例5: BotMatch_WhereAreYou

/*=======================================================================================================================================BotMatch_WhereAreYou=======================================================================================================================================*/void BotMatch_WhereAreYou(bot_state_t *bs, bot_match_t *match) {	float dist, bestdist;	int i, bestitem, redflagtt, blueflagtt;	bot_goal_t goal;	char *nearbyitems[] = {		"Shotgun", "Grenade Launcher", "Rocket Launcher", "Plasmagun", "Railgun", "Lightning Gun", "BFG10K", "Quad Damage", "Regeneration", "Battle Suit", "Speed", "Invisibility", "Flight", "Armor", "Heavy Armor", "Red Flag", "Blue Flag", NULL	};	if (!TeamPlayIsOn()) {		return;	}	// if not addressed to this bot	if (!BotAddressedToBot(bs, match)) {		return;	}	bestitem = -1;	bestdist = 999999;	for (i = 0; nearbyitems[i]; i++) {		dist = BotNearestVisibleItem(bs, nearbyitems[i], &goal);		if (dist < bestdist) {			bestdist = dist;			bestitem = i;		}	}	if (bestitem != -1) {		if (gametype == GT_CTF) {			redflagtt = trap_AAS_AreaTravelTimeToGoalArea(bs->areanum, bs->origin, ctf_redflag.areanum, TFL_DEFAULT);			blueflagtt = trap_AAS_AreaTravelTimeToGoalArea(bs->areanum, bs->origin, ctf_blueflag.areanum, TFL_DEFAULT);			if (redflagtt < (redflagtt + blueflagtt) * 0.4) {				BotAI_BotInitialChat(bs, "ctflocation", nearbyitems[bestitem], "red", NULL);			} else if (blueflagtt < (redflagtt + blueflagtt) * 0.4) {				BotAI_BotInitialChat(bs, "ctflocation", nearbyitems[bestitem], "blue", NULL);			} else {				BotAI_BotInitialChat(bs, "location", nearbyitems[bestitem], NULL);			}		} else {			BotAI_BotInitialChat(bs, "location", nearbyitems[bestitem], NULL);		}		trap_BotEnterChat(bs->cs, bs->client, CHAT_TEAM);	}}
开发者ID:ioid3-games,项目名称:ioid3-rtcw,代码行数:52,


示例6: BotMatch_GetFlag

/*==================BotMatch_GetFlag==================*/void BotMatch_GetFlag(bot_state_t *bs, bot_match_t *match) {	char netname[MAX_MESSAGE_SIZE];	int client;	if (gametype == GT_CTF) {		if (!ctf_redflag.areanum || !ctf_blueflag.areanum)			return;	}#ifdef MISSIONPACK	else if (gametype == GT_1FCTF) {		if (!ctf_neutralflag.areanum || !ctf_redflag.areanum || !ctf_blueflag.areanum)			return;	}#endif	else {		return;	}	//if not addressed to this bot	if (!BotAddressedToBot(bs, match)) return;	//	trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));	//	client = FindClientByName(netname);	//	bs->decisionmaker = client;	bs->ordered = qtrue;	bs->order_time = FloatTime();	//set the time to send a message to the team mates	bs->teammessage_time = FloatTime() + 2 * random();	//set the ltg type	bs->ltgtype = LTG_GETFLAG;	//set the team goal time	bs->teamgoal_time = FloatTime() + CTF_GETFLAG_TIME;	// get an alternate route in ctf	if (gametype == GT_CTF) {		//get an alternative route goal towards the enemy base		BotGetAlternateRouteGoal(bs, BotOppositeTeam(bs));	}	//	BotSetTeamStatus(bs);	// remember last ordered task	BotRememberLastOrderedTask(bs);#ifdef DEBUG	BotPrintTeamGoal(bs);#endif //DEBUG}
开发者ID:AHPlankton,项目名称:Quake-III-Arena,代码行数:51,


示例7: BotMatch_FormationSpace

/*==================BotMatch_FormationSpace==================*/void BotMatch_FormationSpace(bot_state_t *bs, bot_match_t *match) {	char buf[MAX_MESSAGE_SIZE];	float space;	if (!TeamPlayIsOn()) return;	//if not addressed to this bot	if (!BotAddressedToBot(bs, match)) return;	//	trap_BotMatchVariable(match, NUMBER, buf, MAX_MESSAGE_SIZE);	//if it's the distance in feet	if (match->subtype & ST_FEET) space = 0.3048 * 32 * atof(buf);	//else it's in meters	else space = 32 * atof(buf);	//check if the formation intervening space is valid	if (space < 48 || space > 500) space = 100;	bs->formation_dist = space;}
开发者ID:AHPlankton,项目名称:Quake-III-Arena,代码行数:22,


示例8: BotMatch_LeaveSubteam

/*==================BotMatch_LeaveSubteam==================*/void BotMatch_LeaveSubteam(bot_state_t *bs, bot_match_t *match) {	char netname[MAX_MESSAGE_SIZE];	int client;	if (!TeamPlayIsOn()) return;	//if not addressed to this bot	if (!BotAddressedToBot(bs, match)) return;	//	if (strlen(bs->subteam))	{		BotAI_BotInitialChat(bs, "leftteam", bs->subteam, NULL);		trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));		client = ClientFromName(netname);		trap_BotEnterChat(bs->cs, client, CHAT_TELL);	} //end if	strcpy(bs->subteam, "");}
开发者ID:AHPlankton,项目名称:Quake-III-Arena,代码行数:22,


示例9: BotMatch_JoinSubteam

/*=======================================================================================================================================BotMatch_JoinSubteam=======================================================================================================================================*/void BotMatch_JoinSubteam(bot_state_t *bs, bot_match_t *match) {	char teammate[MAX_MESSAGE_SIZE];	if (!TeamPlayIsOn()) {		return;	}	// if not addressed to this bot	if (!BotAddressedToBot(bs, match)) {		return;	}	// get the sub team name	trap_BotMatchVariable(match, TEAMNAME, teammate, MAX_MESSAGE_SIZE);	// set the sub team name	strncpy(bs->subteam, teammate, 32);	bs->subteam[31] = '/0';	BotAI_BotInitialChat(bs, "joinedteam", teammate, NULL);	trap_BotEnterChat(bs->cs, bs->client, CHAT_TEAM);}
开发者ID:ioid3-games,项目名称:ioid3-rtcw,代码行数:23,


示例10: BotMatch_JoinSubteam

/*==================BotMatch_JoinSubteam==================*/void BotMatch_JoinSubteam(bot_state_t *bs, bot_match_t *match) {	char teammate[MAX_MESSAGE_SIZE];	char netname[MAX_MESSAGE_SIZE];	int client;	if (!TeamPlayIsOn()) return;	//if not addressed to this bot	if (!BotAddressedToBot(bs, match)) return;	//get the sub team name	trap_BotMatchVariable(match, TEAMNAME, teammate, sizeof(teammate));	//set the sub team name	strncpy(bs->subteam, teammate, 32);	bs->subteam[31] = '/0';	//	trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));	BotAI_BotInitialChat(bs, "joinedteam", teammate, NULL);	client = ClientFromName(netname);	trap_BotEnterChat(bs->cs, client, CHAT_TELL);}
开发者ID:AHPlankton,项目名称:Quake-III-Arena,代码行数:24,


示例11: BotMatch_GetFlag

/*=======================================================================================================================================BotMatch_GetFlag=======================================================================================================================================*/void BotMatch_GetFlag(bot_state_t *bs, bot_match_t *match) {	// if not in CTF mode	if (gametype != GT_CTF || !ctf_redflag.areanum || !ctf_blueflag.areanum) {		return;	}	// if not addressed to this bot	if (!BotAddressedToBot(bs, match)) {		return;	}	// set the time to send a message to the team mates	bs->teammessage_time = trap_AAS_Time() + 2 * random();	// set the ltg type	bs->ltgtype = LTG_GETFLAG;	// set the team goal time	bs->teamgoal_time = trap_AAS_Time() + CTF_GETFLAG_TIME;#ifdef DEBUG	BotPrintTeamGoal(bs);#endif // DEBUG}
开发者ID:ioid3-games,项目名称:ioid3-rtcw,代码行数:24,


示例12: BotMatch_Dismiss

/*==================BotMatch_Dismiss==================*/void BotMatch_Dismiss(bot_state_t *bs, bot_match_t *match) {	char netname[MAX_MESSAGE_SIZE];	int client;	if (!TeamPlayIsOn()) return;	//if not addressed to this bot	if (!BotAddressedToBot(bs, match)) return;	trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));	client = ClientFromName(netname);	//	bs->decisionmaker = client;	//	bs->ltgtype = 0;	bs->lead_time = 0;	bs->lastgoal_ltgtype = 0;	//	BotAI_BotInitialChat(bs, "dismissed", NULL);	trap_BotEnterChat(bs->cs, client, CHAT_TELL);}
开发者ID:AHPlankton,项目名称:Quake-III-Arena,代码行数:24,


示例13: BotMatch_DefendKeyArea

/*==================BotMatch_DefendKeyArea==================*/void BotMatch_DefendKeyArea(bot_state_t *bs, bot_match_t *match) {	char itemname[MAX_MESSAGE_SIZE];	char netname[MAX_MESSAGE_SIZE];	int client;	if (!TeamPlayIsOn()) return;	//if not addressed to this bot	if (!BotAddressedToBot(bs, match)) return;	//get the match variable	trap_BotMatchVariable(match, KEYAREA, itemname, sizeof(itemname));	//	if (!BotGetMessageTeamGoal(bs, itemname, &bs->teamgoal)) {		//BotAI_BotInitialChat(bs, "cannotfind", itemname, NULL);		//trap_BotEnterChat(bs->cs, bs->client, CHAT_TEAM);		return;	}	//	trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));	//	client = ClientFromName(netname);	//the team mate who ordered	bs->decisionmaker = client;	bs->ordered = qtrue;	bs->order_time = FloatTime();	//set the time to send a message to the team mates	bs->teammessage_time = FloatTime() + 2 * random();	//set the ltg type	bs->ltgtype = LTG_DEFENDKEYAREA;	//get the team goal time	bs->teamgoal_time = BotGetTime(match);	//set the team goal time	if (!bs->teamgoal_time) bs->teamgoal_time = FloatTime() + TEAM_DEFENDKEYAREA_TIME;	//away from defending	bs->defendaway_time = 0;	//	BotSetTeamStatus(bs);	// remember last ordered task	BotRememberLastOrderedTask(bs);#ifdef DEBUG	BotPrintTeamGoal(bs);#endif //DEBUG}
开发者ID:AHPlankton,项目名称:Quake-III-Arena,代码行数:47,


示例14: BotMatch_ReturnFlag

/*=======================================================================================================================================BotMatch_ReturnFlag=======================================================================================================================================*/void BotMatch_ReturnFlag(bot_state_t *bs, bot_match_t *match) {	// if not in CTF mode	if (gametype != GT_CTF) {		return;	}	// if not addressed to this bot	if (!BotAddressedToBot(bs, match)) {		return;	}	// set the time to send a message to the team mates	bs->teammessage_time = trap_AAS_Time() + 2 * random();	// set the ltg type	bs->ltgtype = LTG_RETURNFLAG;	// set the team goal time	bs->teamgoal_time = trap_AAS_Time() + CTF_RETURNFLAG_TIME;	bs->rushbaseaway_time = 0;#ifdef DEBUG	BotPrintTeamGoal(bs);#endif // DEBUG}
开发者ID:ioid3-games,项目名称:ioid3-rtcw,代码行数:25,


示例15: BotMatch_AttackEnemyBase

/*==================BotMatch_AttackEnemyBase==================*/void BotMatch_AttackEnemyBase(bot_state_t *bs, bot_match_t *match) {	char netname[MAX_MESSAGE_SIZE];	int client;	if (gametype == GT_CTF) {		BotMatch_GetFlag(bs, match);	}#ifdef MISSIONPACK	else if (gametype == GT_1FCTF || gametype == GT_OBELISK || gametype == GT_HARVESTER) {		if (!redobelisk.areanum || !blueobelisk.areanum)			return;	}#endif	else {		return;	}	//if not addressed to this bot	if (!BotAddressedToBot(bs, match)) return;	//	trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));	//	client = FindClientByName(netname);	//	bs->decisionmaker = client;	bs->ordered = qtrue;	bs->order_time = FloatTime();	//set the time to send a message to the team mates	bs->teammessage_time = FloatTime() + 2 * random();	//set the ltg type	bs->ltgtype = LTG_ATTACKENEMYBASE;	//set the team goal time	bs->teamgoal_time = FloatTime() + TEAM_ATTACKENEMYBASE_TIME;	bs->attackaway_time = 0;	//	BotSetTeamStatus(bs);	// remember last ordered task	BotRememberLastOrderedTask(bs);#ifdef DEBUG	BotPrintTeamGoal(bs);#endif //DEBUG}
开发者ID:AHPlankton,项目名称:Quake-III-Arena,代码行数:46,


示例16: BotMatch_RushBase

/*==================BotMatch_RushBase==================*/void BotMatch_RushBase(bot_state_t *bs, bot_match_t *match) {	char netname[MAX_MESSAGE_SIZE];	int client;	if (gametype == GT_CTF) {		if (!ctf_redflag.areanum || !ctf_blueflag.areanum)			return;	}#ifdef MISSIONPACK	else if (gametype == GT_1FCTF || gametype == GT_HARVESTER) {		if (!redobelisk.areanum || !blueobelisk.areanum)			return;	}#endif	else {		return;	}	//if not addressed to this bot	if (!BotAddressedToBot(bs, match)) return;	//	trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));	//	client = FindClientByName(netname);	//	bs->decisionmaker = client;	bs->ordered = qtrue;	bs->order_time = FloatTime();	//set the time to send a message to the team mates	bs->teammessage_time = FloatTime() + 2 * random();	//set the ltg type	bs->ltgtype = LTG_RUSHBASE;	//set the team goal time	bs->teamgoal_time = FloatTime() + CTF_RUSHBASE_TIME;	bs->rushbaseaway_time = 0;	//	BotSetTeamStatus(bs);#ifdef DEBUG	BotPrintTeamGoal(bs);#endif //DEBUG}
开发者ID:AHPlankton,项目名称:Quake-III-Arena,代码行数:45,


示例17: BotMatch_ReturnFlag

/*==================BotMatch_ReturnFlag==================*/void BotMatch_ReturnFlag(bot_state_t *bs, bot_match_t *match) {	char netname[MAX_MESSAGE_SIZE];	int client;	//if not in CTF mode	if (		gametype != GT_CTF#ifdef MISSIONPACK		&& gametype != GT_1FCTF#endif		)		return;	//if not addressed to this bot	if (!BotAddressedToBot(bs, match))		return;	//	trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));	//	client = FindClientByName(netname);	//	bs->decisionmaker = client;	bs->ordered = qtrue;	bs->order_time = FloatTime();	//set the time to send a message to the team mates	bs->teammessage_time = FloatTime() + 2 * random();	//set the ltg type	bs->ltgtype = LTG_RETURNFLAG;	//set the team goal time	bs->teamgoal_time = FloatTime() + CTF_RETURNFLAG_TIME;	bs->rushbaseaway_time = 0;	//	BotSetTeamStatus(bs);#ifdef DEBUG	BotPrintTeamGoal(bs);#endif //DEBUG}
开发者ID:AHPlankton,项目名称:Quake-III-Arena,代码行数:41,


示例18: BotMatch_Harvest

/*==================BotMatch_Harvest==================*/void BotMatch_Harvest(bot_state_t *bs, bot_match_t *match) {	char netname[MAX_MESSAGE_SIZE];	int client;	if (gametype == GT_HARVESTER) {		if (!neutralobelisk.areanum || !redobelisk.areanum || !blueobelisk.areanum)			return;	}	else {		return;	}	//if not addressed to this bot	if (!BotAddressedToBot(bs, match)) return;	//	trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));	//	client = FindClientByName(netname);	//	bs->decisionmaker = client;	bs->ordered = qtrue;	bs->order_time = FloatTime();	//set the time to send a message to the team mates	bs->teammessage_time = FloatTime() + 2 * random();	//set the ltg type	bs->ltgtype = LTG_HARVEST;	//set the team goal time	bs->teamgoal_time = FloatTime() + TEAM_HARVEST_TIME;	bs->harvestaway_time = 0;	//	BotSetTeamStatus(bs);	// remember last ordered task	BotRememberLastOrderedTask(bs);#ifdef DEBUG	BotPrintTeamGoal(bs);#endif //DEBUG}
开发者ID:AHPlankton,项目名称:Quake-III-Arena,代码行数:41,


示例19: BotMatch_Camp

/*==================BotMatch_Camp==================*/void BotMatch_Camp(bot_state_t *bs, bot_match_t *match) {	int playernum, areanum;	char netname[MAX_MESSAGE_SIZE];	char itemname[MAX_MESSAGE_SIZE];	aas_entityinfo_t entinfo;	if (!TeamPlayIsOn()) return;	//if not addressed to this bot	if (!BotAddressedToBot(bs, match)) return;	//	BotMatchVariable(match, NETNAME, netname, sizeof(netname));	//asked for someone else	playernum = FindPlayerByName(netname);	//if there's no valid player with this name	if (playernum < 0) {		BotAI_BotInitialChat(bs, "whois", netname, NULL);		BotEnterChat(bs->cs, bs->playernum, CHAT_TEAM);		return;	}	//get the match variable	BotMatchVariable(match, KEYAREA, itemname, sizeof(itemname));	//in CTF it could be the base	if (match->subtype & ST_THERE) {		//camp at the spot the bot is currently standing		bs->teamgoal.entitynum = bs->entitynum;		bs->teamgoal.areanum = bs->areanum;		VectorCopy(bs->origin, bs->teamgoal.origin);		VectorSet(bs->teamgoal.mins, -8, -8, -8);		VectorSet(bs->teamgoal.maxs, 8, 8, 8);	}	else if (match->subtype & ST_HERE) {		//if this is the bot self		if (playernum == bs->playernum) return;		//		bs->teamgoal.entitynum = -1;		BotEntityInfo(playernum, &entinfo);		//if info is valid (in PVS)		if (entinfo.valid) {			areanum = BotPointAreaNum(entinfo.origin);			if (areanum) {// && trap_AAS_AreaReachability(areanum)) {				//NOTE: just assume the bot knows where the person is				//if (BotEntityVisible(bs->entitynum, bs->eye, bs->viewangles, 360, playernum)) {					bs->teamgoal.entitynum = playernum;					bs->teamgoal.areanum = areanum;					VectorCopy(entinfo.origin, bs->teamgoal.origin);					VectorSet(bs->teamgoal.mins, -8, -8, -8);					VectorSet(bs->teamgoal.maxs, 8, 8, 8);				//}			}		}		//if the other is not visible		if (bs->teamgoal.entitynum < 0) {			BotAI_BotInitialChat(bs, "whereareyou", netname, NULL);			playernum = PlayerFromName(netname);			BotEnterChat(bs->cs, playernum, CHAT_TELL);			return;		}	}	else if (!BotGetMessageTeamGoal(bs, itemname, &bs->teamgoal)) {		//BotAI_BotInitialChat(bs, "cannotfind", itemname, NULL);		//playernum = PlayerFromName(netname);		//BotEnterChat(bs->cs, playernum, CHAT_TELL);		return;	}	//	bs->decisionmaker = playernum;	bs->ordered = qtrue;	bs->order_time = FloatTime();	//set the time to send a message to the team mates	bs->teammessage_time = FloatTime() + 2 * random();	//set the ltg type	bs->ltgtype = LTG_CAMPORDER;	//get the team goal time	bs->teamgoal_time = BotGetTime(match);	//set the team goal time	if (!bs->teamgoal_time) bs->teamgoal_time = FloatTime() + TEAM_CAMP_TIME;	//not arrived yet	bs->arrive_time = 0;	//	BotSetTeamStatus(bs);	// remember last ordered task	BotRememberLastOrderedTask(bs);	BotPrintTeamGoal(bs);}
开发者ID:coltongit,项目名称:mint-arena,代码行数:89,


示例20: BotMatch_WhereAreYou

/*==================BotMatch_WhereAreYou==================*/void BotMatch_WhereAreYou(bot_state_t *bs, bot_match_t *match) {	float dist, bestdist;	int i, bestitem, redtt, bluett, client;	bot_goal_t goal;	char netname[MAX_MESSAGE_SIZE];	char *nearbyitems[] = {		"Shotgun",		"Grenade Launcher",		"Rocket Launcher",		"Plasmagun",		"Railgun",		"Lightning Gun",		"BFG10K",		"Quad Damage",		"Regeneration",		"Battle Suit",		"Speed",		"Invisibility",		"Flight",		"Armor",		"Heavy Armor",		"Red Flag",		"Blue Flag",#ifdef MISSIONPACK		"Nailgun",		"Prox Launcher",		"Chaingun",		"Scout",		"Guard",		"Doubler",		"Ammo Regen",		"Neutral Flag",		"Red Obelisk",		"Blue Obelisk",		"Neutral Obelisk",#endif		NULL	};	//	if (!TeamPlayIsOn())		return;	//if not addressed to this bot	if (!BotAddressedToBot(bs, match))		return;	bestitem = -1;	bestdist = 999999;	for (i = 0; nearbyitems[i]; i++) {		dist = BotNearestVisibleItem(bs, nearbyitems[i], &goal);		if (dist < bestdist) {			bestdist = dist;			bestitem = i;		}	}	if (bestitem != -1) {		if (gametype == GT_CTF#ifdef MISSIONPACK			|| gametype == GT_1FCTF#endif			) {			redtt = trap_AAS_AreaTravelTimeToGoalArea(bs->areanum, bs->origin, ctf_redflag.areanum, TFL_DEFAULT);			bluett = trap_AAS_AreaTravelTimeToGoalArea(bs->areanum, bs->origin, ctf_blueflag.areanum, TFL_DEFAULT);			if (redtt < (redtt + bluett) * 0.4) {				BotAI_BotInitialChat(bs, "teamlocation", nearbyitems[bestitem], "red", NULL);			}			else if (bluett < (redtt + bluett) * 0.4) {				BotAI_BotInitialChat(bs, "teamlocation", nearbyitems[bestitem], "blue", NULL);			}			else {				BotAI_BotInitialChat(bs, "location", nearbyitems[bestitem], NULL);			}		}#ifdef MISSIONPACK		else if (gametype == GT_OBELISK || gametype == GT_HARVESTER) {			redtt = trap_AAS_AreaTravelTimeToGoalArea(bs->areanum, bs->origin, redobelisk.areanum, TFL_DEFAULT);			bluett = trap_AAS_AreaTravelTimeToGoalArea(bs->areanum, bs->origin, blueobelisk.areanum, TFL_DEFAULT);			if (redtt < (redtt + bluett) * 0.4) {				BotAI_BotInitialChat(bs, "teamlocation", nearbyitems[bestitem], "red", NULL);			}			else if (bluett < (redtt + bluett) * 0.4) {				BotAI_BotInitialChat(bs, "teamlocation", nearbyitems[bestitem], "blue", NULL);			}			else {				BotAI_BotInitialChat(bs, "location", nearbyitems[bestitem], NULL);			}		}#endif		else {			BotAI_BotInitialChat(bs, "location", nearbyitems[bestitem], NULL);		}		trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));		client = ClientFromName(netname);		trap_BotEnterChat(bs->cs, client, CHAT_TELL);	}}
开发者ID:AHPlankton,项目名称:Quake-III-Arena,代码行数:100,


示例21: BotMatch_Camp

/*=======================================================================================================================================BotMatch_Camp=======================================================================================================================================*/void BotMatch_Camp(bot_state_t *bs, bot_match_t *match) {	int client, areanum;	char netname[MAX_MESSAGE_SIZE];	char itemname[MAX_MESSAGE_SIZE];	aas_entityinfo_t entinfo;	if (!TeamPlayIsOn()) {		return;	}	// if not addressed to this bot	if (!BotAddressedToBot(bs, match)) {		return;	}	trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));	// asked for someone else	client = FindClientByName(netname);	// if there's no valid client with this name	if (client < 0) {		BotAI_BotInitialChat(bs, "whois", netname, NULL);		trap_BotEnterChat(bs->cs, bs->client, CHAT_TEAM);		return;	}	// get the match variable	trap_BotMatchVariable(match, KEYAREA, itemname, sizeof(itemname));	// in CTF it could be the base	if (match->subtype & ST_THERE) {		// camp at the spot the bot is currently standing		bs->teamgoal.entitynum = bs->entitynum;		bs->teamgoal.areanum = bs->areanum;		VectorCopy(bs->origin, bs->teamgoal.origin);		VectorSet(bs->teamgoal.mins, -8, -8, -8);		VectorSet(bs->teamgoal.maxs, 8, 8, 8);	} else if (match->subtype & ST_HERE) {		// if this is the bot self		if (client == bs->client) {			return;		}		bs->teamgoal.entitynum = -1;		BotEntityInfo(client, &entinfo);		// if info is valid (in PVS)		if (entinfo.valid) {			areanum = BotPointAreaNum(entinfo.origin);			if (areanum && trap_AAS_AreaReachability(areanum)) {				// NOTE: just cheat and assume the bot knows where the person is				// if (BotEntityVisible(bs->entitynum, bs->eye, bs->viewangles, 360, client)) {				bs->teamgoal.entitynum = client;				bs->teamgoal.areanum = areanum;				VectorCopy(entinfo.origin, bs->teamgoal.origin);				VectorSet(bs->teamgoal.mins, -8, -8, -8);				VectorSet(bs->teamgoal.maxs, 8, 8, 8);				//}			}		}		// if the other is not visible		if (bs->teamgoal.entitynum < 0) {			BotAI_BotInitialChat(bs, "whereareyou", netname, NULL);			trap_BotEnterChat(bs->cs, bs->client, CHAT_TEAM);			return;		}	} else if (!BotGetMessageTeamGoal(bs, itemname, &bs->teamgoal)) {		// BotAI_BotInitialChat(bs, "cannotfind", itemname, NULL);		// trap_BotEnterChat(bs->cs, bs->client, CHAT_TEAM);		return;	}	// set the time to send a message to the team mates	bs->teammessage_time = trap_AAS_Time() + 2 * random();	// set the ltg type	bs->ltgtype = LTG_CAMPORDER;	// get the team goal time	bs->teamgoal_time = BotGetTime(match);	// set the team goal time	if (!bs->teamgoal_time) {		bs->teamgoal_time = trap_AAS_Time() + TEAM_CAMP_TIME;	}	// the teammate that requested the camping	bs->teammate = client;	// not arrived yet	bs->arrive_time = 0;#ifdef DEBUG	BotPrintTeamGoal(bs);#endif // DEBUG}
开发者ID:ioid3-games,项目名称:ioid3-rtcw,代码行数:90,


示例22: BotMatch_HelpAccompany

/*=======================================================================================================================================BotMatch_HelpAccompany=======================================================================================================================================*/void BotMatch_HelpAccompany(bot_state_t *bs, bot_match_t *match) {	int client, other, areanum;	char teammate[MAX_MESSAGE_SIZE], netname[MAX_MESSAGE_SIZE];	char itemname[MAX_MESSAGE_SIZE];	bot_match_t teammatematch;	aas_entityinfo_t entinfo;	if (!TeamPlayIsOn()) {		return;	}	// if not addressed to this bot	if (!BotAddressedToBot(bs, match)) {		return;	}	// get the team mate name	trap_BotMatchVariable(match, TEAMMATE, teammate, sizeof(teammate));	// get the client to help	if (trap_BotFindMatch(teammate, &teammatematch, MTCONTEXT_TEAMMATE) &&		// if someone asks for him or herself		 teammatematch.type == MSG_ME) {		// get the netname		trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));		client = ClientFromName(netname);		other = qfalse;	} else {		// asked for someone else		client = FindClientByName(teammate);		// if this is the bot self		if (client == bs->client) {			other = qfalse;		} else if (!BotSameTeam(bs, client)) {			// FIXME: say "I don't help the enemy"			return;		} else {			other = qtrue;		}	}	// if the bot doesn't know who to help (FindClientByName returned -1)	if (client < 0) {		if (other) {			BotAI_BotInitialChat(bs, "whois", teammate, NULL);		} else {BotAI_BotInitialChat(bs, "whois", netname, NULL);}		trap_BotEnterChat(bs->cs, bs->client, CHAT_TEAM);		return;	}	// don't help or accompany yourself	if (client == bs->client) {		return;	}	bs->teamgoal.entitynum = -1;	BotEntityInfo(client, &entinfo);	// if info is valid (in PVS)	if (entinfo.valid) {		areanum = BotPointAreaNum(entinfo.origin);		if (areanum && trap_AAS_AreaReachability(areanum)) {			bs->teamgoal.entitynum = client;			bs->teamgoal.areanum = areanum;			VectorCopy(entinfo.origin, bs->teamgoal.origin);			VectorSet(bs->teamgoal.mins, -8, -8, -8);			VectorSet(bs->teamgoal.maxs, 8, 8, 8);		}	}	// if no teamgoal yet	if (bs->teamgoal.entitynum < 0) {		// if near an item		if (match->subtype & ST_NEARITEM) {			// get the match variable			trap_BotMatchVariable(match, ITEM, itemname, sizeof(itemname));			if (!BotGetMessageTeamGoal(bs, itemname, &bs->teamgoal)) {				// BotAI_BotInitialChat(bs, "cannotfind", itemname, NULL);				// trap_BotEnterChat(bs->cs, bs->client, CHAT_TEAM);				return;			}		}	}	if (bs->teamgoal.entitynum < 0) {		if (other) {			BotAI_BotInitialChat(bs, "whereis", teammate, NULL);		} else {BotAI_BotInitialChat(bs, "whereareyou", netname, NULL);}		trap_BotEnterChat(bs->cs, bs->client, CHAT_TEAM);		return;	}	// the team mate	bs->teammate = client;	// last time the team mate was assumed visible	bs->teammatevisible_time = trap_AAS_Time();	// set the time to send a message to the team mates	bs->teammessage_time = trap_AAS_Time() + 2 * random();	// get the team goal time//.........这里部分代码省略.........
开发者ID:ioid3-games,项目名称:ioid3-rtcw,代码行数:101,


示例23: BotMatch_LeadTheWay

/*=======================================================================================================================================BotMatch_LeadTheWay=======================================================================================================================================*/void BotMatch_LeadTheWay(bot_state_t *bs, bot_match_t *match) {	aas_entityinfo_t entinfo;	char netname[MAX_MESSAGE_SIZE], teammate[MAX_MESSAGE_SIZE];	int client, areanum, other;	if (!TeamPlayIsOn()) {		return;	}	// if not addressed to this bot	if (!BotAddressedToBot(bs, match)) {		return;	}	// if someone asks for someone else	if (match->subtype & ST_SOMEONE) {		// get the team mate name		trap_BotMatchVariable(match, TEAMMATE, teammate, sizeof(teammate));		client = FindClientByName(teammate);		// if this is the bot self		if (client == bs->client) {			other = qfalse;		} else if (!BotSameTeam(bs, client)) {			// FIXME: say "I don't help the enemy"			return;		} else {			other = qtrue;		}	} else {		// get the netname		trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));		client = ClientFromName(netname);		other = qfalse;	}	// if the bot doesn't know who to help (FindClientByName returned -1)	if (client < 0) {		BotAI_BotInitialChat(bs, "whois", netname, NULL);		trap_BotEnterChat(bs->cs, bs->client, CHAT_TEAM);		return;	}	bs->lead_teamgoal.entitynum = -1;	BotEntityInfo(client, &entinfo);	// if info is valid (in PVS)	if (entinfo.valid) {		areanum = BotPointAreaNum(entinfo.origin);		if (areanum && trap_AAS_AreaReachability(areanum)) {			bs->lead_teamgoal.entitynum = client;			bs->lead_teamgoal.areanum = areanum;			VectorCopy(entinfo.origin, bs->lead_teamgoal.origin);			VectorSet(bs->lead_teamgoal.mins, -8, -8, -8);			VectorSet(bs->lead_teamgoal.maxs, 8, 8, 8);		}	}	if (bs->teamgoal.entitynum < 0) {		if (other) {			BotAI_BotInitialChat(bs, "whereis", teammate, NULL);		} else {BotAI_BotInitialChat(bs, "whereareyou", netname, NULL);}		trap_BotEnterChat(bs->cs, bs->client, CHAT_TEAM);		return;	}	bs->lead_teammate = client;	bs->lead_time = trap_AAS_Time() + TEAM_LEAD_TIME;	bs->leadvisible_time = 0;	bs->leadmessage_time = -(trap_AAS_Time() + 2 * random());}
开发者ID:ioid3-games,项目名称:ioid3-rtcw,代码行数:73,


示例24: BotMatch_WhatAreYouDoing

/*==================BotMatch_WhatAreYouDoing==================*/void BotMatch_WhatAreYouDoing(bot_state_t *bs, bot_match_t *match) {	char netname[MAX_MESSAGE_SIZE];	char goalname[MAX_MESSAGE_SIZE];	int playernum;	//if not addressed to this bot	if (!BotAddressedToBot(bs, match)) return;	//	switch(bs->ltgtype) {		case LTG_TEAMHELP:		{			EasyPlayerName(bs->teammate, netname, sizeof(netname));			BotAI_BotInitialChat(bs, "helping", netname, NULL);			break;		}		case LTG_TEAMACCOMPANY:		{			EasyPlayerName(bs->teammate, netname, sizeof(netname));			BotAI_BotInitialChat(bs, "accompanying", netname, NULL);			break;		}		case LTG_DEFENDKEYAREA:		{			BotGoalName(bs->teamgoal.number, goalname, sizeof(goalname));			BotAI_BotInitialChat(bs, "defending", goalname, NULL);			break;		}		case LTG_GETITEM:		{			BotGoalName(bs->teamgoal.number, goalname, sizeof(goalname));			BotAI_BotInitialChat(bs, "gettingitem", goalname, NULL);			break;		}		case LTG_KILL:		{			PlayerName(bs->teamgoal.entitynum, netname, sizeof(netname));			BotAI_BotInitialChat(bs, "killing", netname, NULL);			break;		}		case LTG_CAMP:		case LTG_CAMPORDER:		{			BotAI_BotInitialChat(bs, "camping", NULL);			break;		}		case LTG_PATROL:		{			BotAI_BotInitialChat(bs, "patrolling", NULL);			break;		}		case LTG_GETFLAG:		{			BotAI_BotInitialChat(bs, "capturingflag", NULL);			break;		}		case LTG_RUSHBASE:		{			BotAI_BotInitialChat(bs, "rushingbase", NULL);			break;		}		case LTG_RETURNFLAG:		{			BotAI_BotInitialChat(bs, "returningflag", NULL);			break;		}#ifdef MISSIONPACK		case LTG_ATTACKENEMYBASE:		{			BotAI_BotInitialChat(bs, "attackingenemybase", NULL);			break;		}		case LTG_HARVEST:		{			BotAI_BotInitialChat(bs, "harvesting", NULL);			break;		}#endif		default:		{			BotAI_BotInitialChat(bs, "roaming", NULL);			break;		}	}	//chat what the bot is doing	BotMatchVariable(match, NETNAME, netname, sizeof(netname));	playernum = PlayerFromName(netname);	BotEnterChat(bs->cs, playernum, CHAT_TELL);}
开发者ID:coltongit,项目名称:mint-arena,代码行数:93,


示例25: BotMatch_WhatAreYouDoing

/*=======================================================================================================================================BotMatch_WhatAreYouDoing=======================================================================================================================================*/void BotMatch_WhatAreYouDoing(bot_state_t *bs, bot_match_t *match) {	char netname[MAX_MESSAGE_SIZE];	char goalname[MAX_MESSAGE_SIZE];	// if not addressed to this bot	if (!BotAddressedToBot(bs, match)) {		return;	}	switch (bs->ltgtype) {	case LTG_TEAMHELP:	{		trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));		EasyClientName(bs->teammate, netname, MAX_MESSAGE_SIZE);		BotAI_BotInitialChat(bs, "helping", netname, NULL);		break;	}	case LTG_TEAMACCOMPANY:	{		trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));		EasyClientName(bs->teammate, netname, MAX_MESSAGE_SIZE);		BotAI_BotInitialChat(bs, "accompanying", netname, NULL);		break;	}	case LTG_DEFENDKEYAREA:	{		trap_BotGoalName(bs->teamgoal.number, goalname, sizeof(goalname));		BotAI_BotInitialChat(bs, "defending", goalname, NULL);		break;	}	case LTG_GETITEM:	{		trap_BotGoalName(bs->teamgoal.number, goalname, sizeof(goalname));		BotAI_BotInitialChat(bs, "gettingitem", goalname, NULL);		break;	}	case LTG_KILL:	{		ClientName(bs->teamgoal.entitynum, netname, sizeof(netname));		BotAI_BotInitialChat(bs, "killing", netname, NULL);		break;	}	case LTG_CAMP:	case LTG_CAMPORDER:	{		BotAI_BotInitialChat(bs, "camping", NULL);		break;	}	case LTG_PATROL:	{		BotAI_BotInitialChat(bs, "patrolling", NULL);		break;	}	case LTG_GETFLAG:	{		BotAI_BotInitialChat(bs, "capturingflag", NULL);		break;	}	case LTG_RUSHBASE:	{		BotAI_BotInitialChat(bs, "rushingbase", NULL);		break;	}	case LTG_RETURNFLAG:	{		BotAI_BotInitialChat(bs, "returningflag", NULL);		break;	}	default:	{		BotAI_BotInitialChat(bs, "roaming", NULL);		break;	}	}	// chat what the bot is doing	trap_BotEnterChat(bs->cs, bs->client, CHAT_TEAM);}
开发者ID:ioid3-games,项目名称:ioid3-rtcw,代码行数:91,


示例26: BotMatch_WhereAreYou

/*==================BotMatch_WhereAreYou==================*/void BotMatch_WhereAreYou(bot_state_t *bs, bot_match_t *match) {	float dist, bestdist;	int i, redtt, bluett, playernum;	char *teamlocation;	char *bestitemname;	bot_goal_t goal;	gitem_t *it;	char netname[MAX_MESSAGE_SIZE];	char *nearbyitems[] = {#ifdef MISSIONPACK		"Red Obelisk",		"Blue Obelisk",		"Neutral Obelisk",#endif		NULL	};	//	if (!TeamPlayIsOn())		return;	//if not addressed to this bot	if (!BotAddressedToBot(bs, match))		return;	bestitemname = NULL;	bestdist = 999999;	for (i = 1; i < BG_NumItems(); i++) {		it = BG_ItemForItemNum( i );		if ( !it->classname || !*it->classname ) {			continue;		}		//ignore health, ammo, holdables, small armor, and Red Cube and Blue Cube		if ( it->giType == IT_HEALTH			|| it->giType == IT_AMMO			|| it->giType == IT_HOLDABLE			|| ( it->giType == IT_ARMOR && it->quantity < 50 )#ifdef MISSIONPACK			|| ( it->giType == IT_TEAM && it->giTag == 0 )#endif			) {			continue;		}		dist = BotNearestVisibleItem(bs, it->pickup_name, &goal);		if (dist < bestdist) {			bestdist = dist;			bestitemname = it->pickup_name;		}	}	for (i = 0; nearbyitems[i]; i++) {		dist = BotNearestVisibleItem(bs, nearbyitems[i], &goal);		if (dist < bestdist) {			bestdist = dist;			bestitemname = nearbyitems[i];		}	}	if (bestitemname) {		if (gametype == GT_CTF#ifdef MISSIONPACK			|| gametype == GT_1FCTF			|| gametype == GT_OBELISK			|| gametype == GT_HARVESTER#endif			) {#ifdef MISSIONPACK			if (gametype == GT_OBELISK || gametype == GT_HARVESTER) {				redtt = trap_AAS_AreaTravelTimeToGoalArea(bs->areanum, bs->origin, redobelisk.areanum, TFL_DEFAULT);				bluett = trap_AAS_AreaTravelTimeToGoalArea(bs->areanum, bs->origin, blueobelisk.areanum, TFL_DEFAULT);			}			else#endif			{				redtt = trap_AAS_AreaTravelTimeToGoalArea(bs->areanum, bs->origin, ctf_redflag.areanum, TFL_DEFAULT);				bluett = trap_AAS_AreaTravelTimeToGoalArea(bs->areanum, bs->origin, ctf_blueflag.areanum, TFL_DEFAULT);			}			// unpatched q3 used 'ctflocation', some games still use it			if ( BotNumInitialChats( bs->cs, "teamlocation" ) ) {				teamlocation = "teamlocation";			} else {				teamlocation = "ctflocation";			}			if (redtt < (redtt + bluett) * 0.4) {				BotAI_BotInitialChat(bs, teamlocation, bestitemname, "red", NULL);			}			else if (bluett < (redtt + bluett) * 0.4) {				BotAI_BotInitialChat(bs, teamlocation, bestitemname, "blue", NULL);			}			else {				BotAI_BotInitialChat(bs, "location", bestitemname, NULL);			}		}		else {//.........这里部分代码省略.........
开发者ID:coltongit,项目名称:mint-arena,代码行数:101,


示例27: BotMatch_HelpAccompany

/*==================BotMatch_HelpAccompany==================*/void BotMatch_HelpAccompany(bot_state_t *bs, bot_match_t *match) {	int playernum, other, areanum;	char teammate[MAX_MESSAGE_SIZE];	char netname[MAX_MESSAGE_SIZE];	char itemname[MAX_MESSAGE_SIZE];	bot_match_t teammatematch;	aas_entityinfo_t entinfo;	if (!TeamPlayIsOn()) return;	//if not addressed to this bot	if (!BotAddressedToBot(bs, match)) return;	//get the team mate name	BotMatchVariable(match, TEAMMATE, teammate, sizeof(teammate));	//get the player to help	if (BotFindMatch(teammate, &teammatematch, MTCONTEXT_TEAMMATE) &&			//if someone asks for him or herself			teammatematch.type == MSG_ME) {		//get the netname		BotMatchVariable(match, NETNAME, netname, sizeof(netname));		playernum = PlayerFromName(netname);		other = qfalse;	}	else {		//asked for someone else		playernum = FindPlayerByName(teammate);		//if this is the bot self		if (playernum == bs->playernum) {			other = qfalse;		}		else if (!BotSameTeam(bs, playernum)) {			//FIXME: say "I don't help the enemy"			return;		}		else {			other = qtrue;		}	}	//if the bot doesn't know who to help (FindPlayerByName returned -1)	if (playernum < 0) {		if (other) BotAI_BotInitialChat(bs, "whois", teammate, NULL);		else BotAI_BotInitialChat(bs, "whois", netname, NULL);		playernum = PlayerFromName(netname);		BotEnterChat(bs->cs, playernum, CHAT_TELL);		return;	}	//don't help or accompany yourself	if (playernum == bs->playernum) {		return;	}	//	bs->teamgoal.entitynum = -1;	BotEntityInfo(playernum, &entinfo);	//if info is valid (in PVS)	if (entinfo.valid) {		areanum = BotPointAreaNum(entinfo.origin);		if (areanum) {// && trap_AAS_AreaReachability(areanum)) {			bs->teamgoal.entitynum = playernum;			bs->teamgoal.areanum = areanum;			VectorCopy(entinfo.origin, bs->teamgoal.origin);			VectorSet(bs->teamgoal.mins, -8, -8, -8);			VectorSet(bs->teamgoal.maxs, 8, 8, 8);		}	}	//if no teamgoal yet	if (bs->teamgoal.entitynum < 0) {		//if near an item		if (match->subtype & ST_NEARITEM) {			//get the match variable			BotMatchVariable(match, ITEM, itemname, sizeof(itemname));			//			if (!BotGetMessageTeamGoal(bs, itemname, &bs->teamgoal)) {				//BotAI_BotInitialChat(bs, "cannotfind", itemname, NULL);				//BotEnterChat(bs->cs, bs->playernum, CHAT_TEAM);				return;			}		}	}	//	if (bs->teamgoal.entitynum < 0) {		if (other) BotAI_BotInitialChat(bs, "whereis", teammate, NULL);		else BotAI_BotInitialChat(bs, "whereareyou", netname, NULL);		playernum = PlayerFromName(netname);		BotEnterChat(bs->cs, playernum, CHAT_TEAM);		return;	}	//the team mate	bs->teammate = playernum;	//	BotMatchVariable(match, NETNAME, netname, sizeof(netname));	//	playernum = PlayerFromName(netname);	//the team mate who ordered	bs->decisionmaker = playernum;	bs->ordered = qtrue;	bs->order_time = FloatTime();//.........这里部分代码省略.........
开发者ID:coltongit,项目名称:mint-arena,代码行数:101,


示例28: BotMatch_DropCart

// cyr_drop{void BotMatch_DropCart(bot_state_t *bs, bot_match_t *match) {	int client, areanum;	char netname[MAX_MESSAGE_SIZE];	aas_entityinfo_t entinfo;	if (!TeamPlayIsOn()) return;	//if not addressed to this bot	if (!BotAddressedToBot(bs, match)) return;	//get the netname	trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));	client = ClientFromName(netname);		//if the bot doesn't know who to help (FindClientByName returned -1)	if (client < 0) {		BotAI_BotInitialChat(bs, "whois", netname, NULL);		client = ClientFromName(netname);		trap_BotEnterChat(bs->cs, client, CHAT_TELL);		return;	}	//don't help or accompany yourself	if (client == bs->client) {		return;	}	//	bs->teamgoal.entitynum = -1;	BotEntityInfo(client, &entinfo);	//if info is valid (in PVS)	if (entinfo.valid) {		areanum = BotPointAreaNum(entinfo.origin);		if (areanum) {// && trap_AAS_AreaReachability(areanum)) {			bs->teamgoal.entitynum = client;			bs->teamgoal.areanum = areanum;			VectorCopy(entinfo.origin, bs->teamgoal.origin);			VectorSet(bs->teamgoal.mins, -8, -8, -8);			VectorSet(bs->teamgoal.maxs, 8, 8, 8);		}	}	if (bs->teamgoal.entitynum < 0) {		BotAI_BotInitialChat(bs, "whereareyou", netname, NULL);		client = ClientFromName(netname);		trap_BotEnterChat(bs->cs, client, CHAT_TEAM);		return;	}	//the team mate	bs->teammate = client;	//	trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));	//	client = ClientFromName(netname);	//the team mate who ordered	bs->decisionmaker = client;	// bs->ordered = qtrue;	//bs->order_time = FloatTime();	//last time the team mate was assumed visible	bs->teammatevisible_time = FloatTime();	//set the time to send a message to the team mates	bs->teammessage_time = FloatTime() + 1 * random();	//set the ltg type	bs->ltgtype = LTG_GIVECART;	//G_Printf("^4giving cart! /n");	// cyr 20055	bs->teamgoal_time = FloatTime() + SYC_CART_EXCHANGE_TIME;}
开发者ID:PadWorld-Entertainment,项目名称:wop-gamesource,代码行数:66,



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


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