Exemplo n.º 1
0
void SP_info_player_invasion (edict_t *self)
{
	//FIXME: change to invasion->value
	if (!pvm->value || !invasion->value)
	{
		G_FreeEdict (self);
		return;
	}

	// remove deathmatch spawnpoints
	if (!INVASION_OTHERSPAWNS_REMOVED)
	{
		edict_t *e=NULL;
		
		gi.dprintf("PvM Invasion mode activated!\n");

		while((e = G_Find(e, FOFS(classname), "info_player_deathmatch")) != NULL)
		{
			if (e && e->inuse)
				G_FreeEdict(e);
		}
		INVASION_OTHERSPAWNS_REMOVED = true;
	}

	//FIXME: this entity should be killable and game should end if all of them die
	gi.setmodel (self, "models/objects/dmspot/tris.md2");
	self->s.skinnum = 0;
	self->mtype = INVASION_PLAYERSPAWN;

	if (invasion->value == 1)
		self->health = PLAYERSPAWN_HEALTH + 250*AveragePlayerLevel();
	else if (invasion->value == 2)
		self->health = PLAYERSPAWN_HEALTH*2 + 250*AveragePlayerLevel();

	self->max_health = self->health;
	self->takedamage = DAMAGE_YES;
	self->die = info_player_invasion_death;
	self->think = info_player_invasion_think;
	self->nextthink = level.time + FRAMETIME;
	//self->touch = info_player_invasion_touch;
	self->solid = SOLID_BBOX;
	VectorSet (self->mins, -32, -32, -24);
	VectorSet (self->maxs, 32, 32, -16);
	gi.linkentity (self);

	INV_PlayerSpawns[invasion_max_playerspawns] = self;

	invasion_max_playerspawns++;
	invasion_spawncount++;
}
Exemplo n.º 2
0
//==========================================
// 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);
}
Exemplo n.º 3
0
void TBI_InitPlayerSpawns(int teamnum)
{
	char *_classname = "info_player_deathmatch";
	edict_t *e = g_edicts;
	int effects;

	if (teamnum == RED_TEAM)
	{
		_classname = "info_player_team1";
	}
	else if (teamnum == BLUE_TEAM)
	{
		_classname = "info_player_team2";
	}

	while((e = G_Find(e, FOFS(classname), _classname)) != NULL)
	{
		qboolean nullteam = false;
		e->health = TBI_SPAWN_HEALTH;
		e->max_health = e->health;
		e->takedamage = DAMAGE_YES;
		e->solid = SOLID_BBOX;
		e->deadflag = DEAD_NO;
		e->svflags &= ~SVF_NOCLIENT;
		e->monsterinfo.level = e->myskills.level = AveragePlayerLevel();

		e->s.effects |= EF_COLOR_SHELL;
		e->mtype = TBI_PLAYERSPAWN;
		e->think = TBI_SpawnThink;
		e->die = TBI_SpawnDie;

		if (teamnum == 3)
		{
			nullteam = true;
			if (tbi_game.TotalRedSpawns > tbi_game.TotalBlueSpawns)
				teamnum = BLUE_TEAM;
			else
				teamnum = RED_TEAM;
		}

		if (teamnum == RED_TEAM)
		{
			tbi_game.EntRedSpawns[tbi_game.RedSpawns] = e;
			tbi_game.RedSpawns++;
			tbi_game.TotalRedSpawns++;
			effects = RF_SHELL_RED;
		}
		else
		{
			tbi_game.EntBlueSpawns[tbi_game.BlueSpawns] = e;
			tbi_game.BlueSpawns++;
			tbi_game.TotalBlueSpawns++;
			effects = RF_SHELL_BLUE;
		}
		
		e->teamnum = teamnum;
		e->s.renderfx = effects;

		if (nullteam)
			teamnum = 3;
	}
}