示例#1
0
文件: bot_spawn.c 项目: zardoru/vrxcl
//==========================================
// BOT_DMClass_JoinGame
// put the bot into the game.
//==========================================
void BOT_DMClass_JoinGame (edict_t *ent, char *team_name)
{
	char *s;
	//int rnd = CLASS_PALADIN;

	if ( !BOT_JoinCTFTeam(ent, team_name) )
		gi.bprintf (PRINT_HIGH,  "[BOT] %s joined the game.\n",
		ent->client->pers.netname);

	ent->think = AI_Think;
	ent->nextthink = level.time + FRAMETIME;

	// az: Vortex stuff
	disableAbilities(ent);

	ent->myskills.level = AveragePlayerLevel();
	ent->myskills.speciality_points = ent->myskills.level * 2;

	s = Info_ValueForKey (ent->client->pers.userinfo, "skin");

	/*while (1) // except the knight, any class.
	{
		rnd = GetRandom(1, CLASS_MAX);
		if (rnd != CLASS_PALADIN && rnd != CLASS_POLTERGEIST)
			break;
	}

	ent->myskills.class_num = rnd;*/
	ent->myskills.class_num = CLASS_SOLDIER; 
	ent->myskills.respawn_weapon = GetRandom(1, 11);

	ent->client->pers.spectator = false;
	ent->client->resp.spectator = false;

    vrx_add_respawn_items(ent);
    vrx_add_respawn_weapon(ent, ent->myskills.respawn_weapon);

    vrx_assign_abilities(ent);
    vrx_set_talents(ent);
	ent->myskills.streak = 0;

	BOT_VortexAssignSkills(ent);

	//join game
	ent->movetype = MOVETYPE_WALK;
	ent->solid = SOLID_BBOX;
	ent->svflags &= ~SVF_NOCLIENT;
	ent->client->ps.gunindex = 0;

	PutClientInServer(ent);

	if (!KillBox (ent))
	{	// could't spawn in?
	}
	gi.linkentity (ent);
}
示例#2
0
文件: bot_spawn.c 项目: ZwS/qudos
//==========================================
// BOT_DMClass_JoinGame
// put the bot into the game.
//==========================================
void BOT_DMClass_JoinGame (edict_t *ent, char *team_name)
{
	if ( !BOT_JoinCTFTeam(ent, team_name) )
		Com_Printf ( "%s joined the game.\n",
		ent->client->pers.netname);

	ent->think = AI_Think;
	ent->nextthink = level.time + FRAMETIME;

	//join game
	ent->movetype = MOVETYPE_WALK;
	ent->solid = SOLID_BBOX;
	ent->svflags &= ~SVF_NOCLIENT;
	ent->client->ps.gunindex = 0;

	if (!KillBox (ent))
	{	// could't spawn in?
	}
	gi.linkentity (ent);
}