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

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

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

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

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

示例1: BotVoiceChat_Offense

/*==================BotVoiceChat_Offense==================*/voidBotVoiceChat_Offense(bot_state_t * bs, int client, int mode){  if (gametype == GT_CTF#ifdef MISSIONPACK      || gametype == GT_1FCTF#endif    )  {    BotVoiceChat_GetFlag(bs, client, mode);    return;  }#ifdef MISSIONPACK  if (gametype == GT_HARVESTER)  {    //    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);  }  else#endif  {    //    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:lrq3000,项目名称:ioquake3-anti-cheat,代码行数:59,


示例2: BotVoiceChat_ReturnFlag

/*==================BotVoiceChat_ReturnFlag==================*/void BotVoiceChat_ReturnFlag(bot_state_t *bs, int client, int mode) {		/* LQ3A */	UNREFERENCED_PARAMETER(mode);	//if not in CTF mode	if (		gametype != GT_CTF#ifdef MISSIONPACK		&& gametype != GT_1FCTF#endif		) {		return;	}	//	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:monoknot,项目名称:loaded-q3a,代码行数:35,


示例3: BotMatch_Patrol

/*==================BotMatch_Patrol==================*/void BotMatch_Patrol(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;	//get the patrol waypoints	if (!BotGetPatrolWaypoints(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_PATROL;	//get the team goal time	bs->teamgoal_time = BotGetTime(match);	//set the team goal time if not set already	if (!bs->teamgoal_time) bs->teamgoal_time = FloatTime() + TEAM_PATROL_TIME;	//	BotSetTeamStatus(bs);	// remember last ordered task	BotRememberLastOrderedTask(bs);#ifdef DEBUG	BotPrintTeamGoal(bs);#endif //DEBUG}
开发者ID:AHPlankton,项目名称:Quake-III-Arena,代码行数:38,


示例4: BotMatch_Harvest

/*==================BotMatch_Harvest==================*/void BotMatch_Harvest(bot_state_t *bs, bot_match_t *match) {	char netname[MAX_MESSAGE_SIZE];	int playernum;	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;	//	BotMatchVariable(match, NETNAME, netname, sizeof(netname));	//	playernum = FindPlayerByName(netname);	//	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_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);	BotPrintTeamGoal(bs);}
开发者ID:coltongit,项目名称:mint-arena,代码行数:39,


示例5: BotMatch_ReturnFlag

/*==================BotMatch_ReturnFlag==================*/void BotMatch_ReturnFlag(bot_state_t *bs, bot_match_t *match) {	char netname[MAX_MESSAGE_SIZE];	int playernum;	//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;	//	BotMatchVariable(match, NETNAME, netname, sizeof(netname));	//	playernum = FindPlayerByName(netname);	//	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_RETURNFLAG;	//set the team goal time	bs->teamgoal_time = FloatTime() + CTF_RETURNFLAG_TIME;	bs->rushbaseaway_time = 0;	//	BotSetTeamStatus(bs);	BotPrintTeamGoal(bs);}
开发者ID:coltongit,项目名称:mint-arena,代码行数:39,


示例6: BotMatch_Kill

/*==================BotMatch_Kill==================*/void BotMatch_Kill(bot_state_t *bs, bot_match_t *match) {	char enemy[MAX_MESSAGE_SIZE];	char netname[MAX_MESSAGE_SIZE];	int client;	if (!TeamPlayIsOn()) return;	//if not addressed to this bot	if (!BotAddressedToBot(bs, match)) return;	trap_BotMatchVariable(match, ENEMY, enemy, sizeof(enemy));	//	client = FindEnemyByName(bs, enemy);	if (client < 0) {		BotAI_BotInitialChat(bs, "whois", enemy, NULL);		trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));		client = ClientFromName(netname);		trap_BotEnterChat(bs->cs, client, CHAT_TELL);		return;	}	bs->teamgoal.entitynum = client;	//set the time to send a message to the team mates	bs->teammessage_time = FloatTime() + 2 * random();	//set the ltg type	bs->ltgtype = LTG_KILL;	//set the team goal time	bs->teamgoal_time = FloatTime() + TEAM_KILL_SOMEONE;	//	BotSetTeamStatus(bs);#ifdef DEBUG	BotPrintTeamGoal(bs);#endif //DEBUG}
开发者ID:AHPlankton,项目名称:Quake-III-Arena,代码行数:37,


示例7: BotMatch_GetItem

/*==================BotMatch_GetItem==================*/void BotMatch_GetItem(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, 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;	}	trap_BotMatchVariable(match, NETNAME, netname, sizeof(netname));	client = ClientOnSameTeamFromName(bs, 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_GETITEM;	//set the team goal time	bs->teamgoal_time = FloatTime() + TEAM_GETITEM_TIME;	//	BotSetTeamStatus(bs);#ifdef DEBUG	BotPrintTeamGoal(bs);#endif //DEBUG}
开发者ID:AHPlankton,项目名称:Quake-III-Arena,代码行数:39,


示例8: BotVoiceChat_Defend

/*==================BotVoiceChat_Defend==================*/void BotVoiceChat_Defend(bot_state_t *bs, int client, int mode) {    Q_UNUSED(mode);#ifdef MISSIONPACK    if ( gametype == GT_OBELISK || gametype == GT_HARVESTER) {        //        switch(BotTeam(bs)) {        case TEAM_RED:            memcpy(&bs->teamgoal, &redobelisk, sizeof(bot_goal_t));            break;        case TEAM_BLUE:            memcpy(&bs->teamgoal, &blueobelisk, sizeof(bot_goal_t));            break;        default:            return;        }    }    else#endif        if (gametype == GT_CTF#ifdef MISSIONPACK                || gametype == GT_1FCTF#endif           ) {            //            switch(BotTeam(bs)) {            case TEAM_RED:                memcpy(&bs->teamgoal, &ctf_redflag, sizeof(bot_goal_t));                break;            case TEAM_BLUE:                memcpy(&bs->teamgoal, &ctf_blueflag, sizeof(bot_goal_t));                break;            default:                return;            }        }        else {            return;        }    //    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 = 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:UberGames,项目名称:EF2GameSource,代码行数:63,


示例9: BotVoiceChat_Camp

/*==================BotVoiceChat_Camp==================*/voidBotVoiceChat_Camp(bot_state_t * bs, int client, int mode){  int areanum;  aas_entityinfo_t entinfo;  char netname[MAX_NETNAME];  //  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 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",			 EasyClientName(client, netname,					sizeof(netname)), NULL);    trap_BotEnterChat(bs->cs, client, CHAT_TELL);    return;  }  //  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_CAMPORDER;  //get the team goal time  bs->teamgoal_time = FloatTime() + TEAM_CAMP_TIME;  //the teammate that requested the camping  bs->teammate = client;  //not arrived yet  bs->arrive_time = 0;  //  BotSetTeamStatus(bs);  // remember last ordered task  BotRememberLastOrderedTask(bs);#ifdef DEBUG  BotPrintTeamGoal(bs);#endif //DEBUG}
开发者ID:lrq3000,项目名称:ioquake3-anti-cheat,代码行数:62,


示例10: BotVoiceChat_FollowMe

/*==================BotVoiceChat_FollowMe==================*/voidBotVoiceChat_FollowMe(bot_state_t * bs, int client, int mode){  int areanum;  aas_entityinfo_t entinfo;  char netname[MAX_NETNAME];  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 the other is not visible  if (bs->teamgoal.entitynum < 0)  {    BotAI_BotInitialChat(bs, "whereareyou",			 EasyClientName(client, netname,					sizeof(netname)), NULL);    trap_BotEnterChat(bs->cs, client, CHAT_TELL);    return;  }  //  bs->decisionmaker = client;  bs->ordered = qtrue;  bs->order_time = FloatTime();  //the team mate  bs->teammate = client;  //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() + 2 * random();  //get the team goal time  bs->teamgoal_time = FloatTime() + TEAM_ACCOMPANY_TIME;  //set the ltg type  bs->ltgtype = LTG_TEAMACCOMPANY;  bs->formation_dist = 3.5 * 32;	//3.5 meter  bs->arrive_time = 0;  //  BotSetTeamStatus(bs);  // remember last ordered task  BotRememberLastOrderedTask(bs);#ifdef DEBUG  BotPrintTeamGoal(bs);#endif //DEBUG}
开发者ID:lrq3000,项目名称:ioquake3-anti-cheat,代码行数:60,


示例11: BotVoiceChat_Patrol

/*==================BotVoiceChat_Patrol==================*/void BotVoiceChat_Patrol(bot_state_t *bs, int playernum, int mode) {	//	bs->decisionmaker = playernum;	//	bs->ltgtype = 0;	bs->lead_time = 0;	bs->lastgoal_ltgtype = 0;	//	BotAI_BotInitialChat(bs, "dismissed", NULL);	BotEnterChat(bs->cs, playernum, CHAT_TELL);	BotVoiceChatOnly(bs, -1, VOICECHAT_ONPATROL);	//	BotSetTeamStatus(bs);	BotPrintTeamGoal(bs);}
开发者ID:KuehnhammerTobias,项目名称:ioid3-game,代码行数:20,


示例12: BotVoiceChat_Patrol

/*==================BotVoiceChat_Patrol==================*/void BotVoiceChat_Patrol(bot_state_t *bs, int client, int mode) {	//	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);	BotVoiceChatOnly(bs, -1, VOICECHAT_ONPATROL);	//	BotSetTeamStatus(bs);#ifdef DEBUG	BotPrintTeamGoal(bs);#endif //DEBUG}
开发者ID:Mixone-FinallyHere,项目名称:SmokinGuns,代码行数:22,


示例13: 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,


示例14: BotVoiceChat_GetFlag

/*==================BotVoiceChat_GetFlag==================*/voidBotVoiceChat_GetFlag(bot_state_t * bs, int client, int mode){  //  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;  }  //  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:lrq3000,项目名称:ioquake3-anti-cheat,代码行数:50,


示例15: 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,


示例16: 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,


示例17: BotVoiceChat_Defend

/*==================BotVoiceChat_Defend==================*/void BotVoiceChat_Defend(bot_state_t *bs, int client, int mode) {	//	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 = 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:LuckyBro,项目名称:sgfork,代码行数:26,


示例18: 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,


示例19: BotVoiceChat_Offense

/*==================BotVoiceChat_Offense==================*/void BotVoiceChat_Offense(bot_state_t *bs, int client, int mode) {	{		//		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:LuckyBro,项目名称:sgfork,代码行数:27,


示例20: BotVoiceChat_ReturnFlag

/*==================BotVoiceChat_ReturnFlag==================*/void BotVoiceChat_ReturnFlag(bot_state_t *bs, int playernum, int mode) {	//if not in CTF mode	if (		gametype != GT_CTF#ifdef MISSIONPACK		&& gametype != GT_1FCTF#endif		) {		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_RETURNFLAG;	//set the team goal time	bs->teamgoal_time = FloatTime() + CTF_RETURNFLAG_TIME;	bs->rushbaseaway_time = 0;	BotSetTeamStatus(bs);	BotPrintTeamGoal(bs);}
开发者ID:KuehnhammerTobias,项目名称:ioid3-game,代码行数:29,


示例21: BotTeamSeekGoals

void BotTeamSeekGoals( bot_state_t *bs ) {	aas_entityinfo_t	entinfo;	int	c;	int	areanum;	if ( bs->ltgtype == LTG_TEAMACCOMPANY && !bs->ordered ) {		BotEntityInfo( bs->teammate, &entinfo );		if ( !entinfo.valid || !( entinfo.powerups & ( 1 << PW_BATTLESUIT ) ) ) {			bs->ltgtype = 0;			return;		}		areanum = BotPointAreaNum( entinfo.origin );		if ( !trap_AAS_AreaTravelTimeToGoalArea( bs->areanum, bs->origin, areanum, bs->tfl ) ) {			bs->ltgtype = 0;		}		return;	}	if ( bs->owndecision_time < FloatTime() ) {		c = BotTeamCarrierVisible( bs );		if ( c >= 0 && ( bs->ltgtype != LTG_TEAMACCOMPANY || bs->teammate != c ) ) {			BotRefuseOrder( bs );			bs->decisionmaker = bs->client;			bs->ordered = qfalse;			bs->teammate = c;			bs->teammatevisible_time = FloatTime();			bs->teammessage_time = 0;			bs->arrive_time = 1;			bs->teamgoal_time = FloatTime() + 120;			bs->ltgtype = LTG_TEAMACCOMPANY;			bs->formation_dist = 70;			BotSetTeamStatus( bs );			bs->owndecision_time = FloatTime() + 5;			return;		}	}#if 0	if ( BotTeamLeader( bs ) ) {		return;	}	if ( bs->lastgoal_ltgtype ) {		bs->teamgoal_time += 60;	}	if ( !bs->ordered && bs->lastgoal_ltgtype ) {		bs->ltgtype = 0;	}	if ( bs->ltgtype == LTG_TEAMHELP ||		bs->ltgtype == LTG_TEAMACCOMPANY ||		bs->ltgtype == LTG_DEFENDKEYAREA ||		bs->ltgtype == LTG_CAMPORDER ||		bs->ltgtype == LTG_PATROL ||		bs->ltgtype == LTG_GETITEM ) {		return;	}	if ( BotSetLastOrderedTask( bs ) ) {		return;	}	if ( bs->owndecision_time > FloatTime() ) {		return;	}	if ( bs->ctfroam_time > FloatTime() ) {		return;	}	if ( BotAggression( bs ) < 50 ) {		return;	}	bs->teammessage_time = FloatTime() + 2 * random();	bs->ltgtype = 0;	bs->ctfroam_time = FloatTime() + CTF_ROAM_TIME;	BotSetTeamStatus( bs );	bs->owndecision_time = FloatTime() + 5;#endif}
开发者ID:xzero450,项目名称:revolution,代码行数:74,


示例22: 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 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);			client = ClientFromName(netname);			trap_BotEnterChat(bs->cs, client, CHAT_TELL);			return;		}	}	else if (!BotGetMessageTeamGoal(bs, itemname, &bs->teamgoal)) {		//BotAI_BotInitialChat(bs, "cannotfind", itemname, NULL);		//client = ClientFromName(netname);		//trap_BotEnterChat(bs->cs, client, CHAT_TELL);		return;	}	//	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_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);#ifdef DEBUG	BotPrintTeamGoal(bs);#endif //DEBUG}
开发者ID:AHPlankton,项目名称:Quake-III-Arena,代码行数:91,


示例23: BotMatch_HelpAccompany

//.........这里部分代码省略.........		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);		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 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);		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() + 2 * random();	//get the team goal time	bs->teamgoal_time = BotGetTime(match);	//set the ltg type	if (match->type == MSG_HELP) {		bs->ltgtype = LTG_TEAMHELP;		if (!bs->teamgoal_time) bs->teamgoal_time = FloatTime() + TEAM_HELP_TIME;	}	else {		bs->ltgtype = LTG_TEAMACCOMPANY;		if (!bs->teamgoal_time) bs->teamgoal_time = FloatTime() + TEAM_ACCOMPANY_TIME;		bs->formation_dist = 3.5 * 32;		//3.5 meter		bs->arrive_time = 0;		//		BotSetTeamStatus(bs);		// remember last ordered task		BotRememberLastOrderedTask(bs);	}#ifdef DEBUG	BotPrintTeamGoal(bs);#endif //DEBUG}
开发者ID:AHPlankton,项目名称:Quake-III-Arena,代码行数:101,



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


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