本文整理匯總了C++中BotPrintTeamGoal函數的典型用法代碼示例。如果您正苦於以下問題:C++ BotPrintTeamGoal函數的具體用法?C++ BotPrintTeamGoal怎麽用?C++ BotPrintTeamGoal使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了BotPrintTeamGoal函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: 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
}
示例2: 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
}
示例3: BotMatch_Patrol
/*
=======================================================================================================================================
BotMatch_Patrol
=======================================================================================================================================
*/
void BotMatch_Patrol(bot_state_t *bs, bot_match_t *match) {
if (!TeamPlayIsOn()) {
return;
}
// if not addressed to this bot
if (!BotAddressedToBot(bs, match)) {
return;
}
// get the patrol waypoints
if (!BotGetPatrolWaypoints(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_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 = trap_AAS_Time() + TEAM_PATROL_TIME;
}
#ifdef DEBUG
BotPrintTeamGoal(bs);
#endif // DEBUG
}
示例4: BotMatch_Kill
/*
=======================================================================================================================================
BotMatch_Kill
=======================================================================================================================================
*/
void BotMatch_Kill(bot_state_t *bs, bot_match_t *match) {
char enemy[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_BotEnterChat(bs->cs, bs->client, CHAT_TEAM);
return;
}
bs->teamgoal.entitynum = client;
// 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_KILL;
// set the team goal time
bs->teamgoal_time = trap_AAS_Time() + TEAM_KILL_SOMEONE;
#ifdef DEBUG
BotPrintTeamGoal(bs);
#endif // DEBUG
}
示例5: BotMatch_GetItem
/*
=======================================================================================================================================
BotMatch_GetItem
=======================================================================================================================================
*/
void BotMatch_GetItem(bot_state_t *bs, bot_match_t *match) {
char itemname[MAX_MESSAGE_SIZE];
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;
}
// 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_GETITEM;
// set the team goal time
bs->teamgoal_time = trap_AAS_Time() + TEAM_GETITEM_TIME;
#ifdef DEBUG
BotPrintTeamGoal(bs);
#endif // DEBUG
}
示例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 playernum;
if (!TeamPlayIsOn()) return;
//if not addressed to this bot
if (!BotAddressedToBot(bs, match)) return;
BotMatchVariable(match, ENEMY, enemy, sizeof(enemy));
//
playernum = FindEnemyByName(bs, enemy);
if (playernum < 0) {
BotAI_BotInitialChat(bs, "whois", enemy, NULL);
BotMatchVariable(match, NETNAME, netname, sizeof(netname));
playernum = PlayerFromName(netname);
BotEnterChat(bs->cs, playernum, CHAT_TELL);
return;
}
bs->teamgoal.entitynum = playernum;
//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);
BotPrintTeamGoal(bs);
}
示例7: 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);
}
示例8: 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);
}
示例9: 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
}
示例10: BotVoiceChat_FollowFlagCarrier
/*
==================
BotVoiceChat_FollowFlagCarrier
==================
*/
void BotVoiceChat_FollowFlagCarrier(bot_state_t *bs, int playernum, int mode) {
int carrier;
carrier = BotTeamFlagCarrier(bs);
if (carrier >= 0)
BotVoiceChat_FollowMe(bs, carrier, mode);
BotPrintTeamGoal(bs);
}
示例11: 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
}
示例12: BotVoiceChat_Camp
/*
==================
BotVoiceChat_Camp
==================
*/
void
BotVoiceChat_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
}
示例13: BotVoiceChat_FollowFlagCarrier
void BotVoiceChat_FollowFlagCarrier(bot_state_t *bs, int client, int mode) {
int carrier;
carrier = BotTeamFlagCarrier(bs);
if (carrier >= 0)
BotVoiceChat_FollowMe(bs, carrier, mode);
#ifdef DEBUG
BotPrintTeamGoal(bs);
#endif //DEBUG
}
示例14: BotVoiceChat_FollowMe
/*
==================
BotVoiceChat_FollowMe
==================
*/
void
BotVoiceChat_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
}
示例15: BotVoiceChat_Offense
/*
==================
BotVoiceChat_Offense
==================
*/
void
BotVoiceChat_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
}