Esempio n. 1
0
void boss_spawn_tank (edict_t *ent)
{
	char	userinfo[MAX_INFO_STRING];
	//edict_t	*tank;

	//gi.dprintf("boss_spawn_tank()\n");

	if (G_EntExists(ent->owner) && (ent->owner->mtype == BOSS_TANK))
	{
		G_PrintGreenText(va("%s got bored and left the game.", ent->client->pers.netname));

		BecomeTE(ent->owner);
		ent->svflags &= ~SVF_NOCLIENT;
		ent->viewheight = 22;
		ent->movetype = MOVETYPE_WALK;
		ent->solid = SOLID_BBOX;
		ent->takedamage = DAMAGE_AIM;

		// recover player info
		memcpy(userinfo, ent->client->pers.userinfo, sizeof(userinfo));
		InitClientPersistant(ent->client);
		ClientUserinfoChanged(ent, userinfo);
		modify_max(ent);
		Pick_respawnweapon(ent);
		ent->owner = NULL;
		return;
	}

	CreateBoss(ent);
}
Esempio n. 2
0
void dom_flagthink (edict_t *self)
{
	vec3_t	end;
	trace_t	tr;

	//3.0 allow anyone to pick up the flag
	if (self->owner) self->owner = NULL;

	//3.0 destroy idling flags so they can respawn somewhere else
	if (self->count >= 60)	//30 seconds of idling time;
	{
		BecomeTE(self);
		return;
	}
	self->count++;

	if (!self->other && !VectorLength(self->velocity))
	{
		VectorCopy(self->s.origin, end);
		end[2] += 8192;
		tr = gi.trace (self->s.origin, NULL, NULL, end, self, MASK_SOLID);
		VectorCopy(tr.endpos, end);
		self->other = dom_spawnlaser(self, self->s.origin, end);
	}
	self->s.effects = 0;
	if (self->style)
		self->style = 0;
	else
		self->style = 1;
	self->s.effects |= (EF_ROTATE|EF_COLOR_SHELL);
	if (self->style)
		self->s.renderfx = RF_SHELL_RED;
	else
		self->s.renderfx = RF_SHELL_BLUE;
	self->nextthink = level.time + 0.5;
}
Esempio n. 3
0
void forcewall_think(edict_t *self)
{
	int		dmg;
	vec3_t	zvec={0,0,0};
	trace_t	tr;

	CTF_SummonableCheck(self);

	// wall will auto-remove if it is asked to
	if ((self->removetime > 0) && (level.time > self->removetime))
	{
		if (self->activator && self->activator->inuse)
			safe_cprintf(self->activator, PRINT_HIGH, "Your wall was removed from enemy territory.\n");
		self->think = BecomeTE;
		self->nextthink = level.time + FRAMETIME;
		return;
	}

	// wall must have an owner
	if (!G_EntIsAlive(self->activator) || (level.framenum > self->count))
	{
		if (G_EntExists(self->activator))
			safe_cprintf(self->activator, PRINT_HIGH, "Your wall faded away.\n");
		BecomeTE(self);
		return;
	}
	
	forcewall_seteffects(self);

	// is this a solid wall?
	if (self->takedamage)
	{
		forcewall_regenerate(self);
		tr = gi.trace (self->s.origin, self->mins, self->maxs, self->s.origin, self, (MASK_PLAYERSOLID|MASK_MONSTERSOLID));
		// reset solid state if nobody is in the wall
		if ((self->solid == SOLID_NOT) && !G_EntIsAlive(tr.ent) && (level.time > self->wait))
			self->solid = SOLID_BBOX;
	}
	else
	{

		// find something to burn
		tr = gi.trace (self->s.origin, self->mins, self->maxs, self->s.origin, self, (MASK_PLAYERSOLID|MASK_MONSTERSOLID));
		if (G_EntExists(tr.ent) && !OnSameTeam(self, tr.ent))
		{
			if (tr.ent->client && (tr.ent->client->respawn_time == level.time))
			{
				safe_cprintf(self->activator, PRINT_HIGH, "Your wall faded away because it was too close to a spawnpoint!\n");
				BecomeTE(self);
				return;
			}

			dmg = 10 + 4*self->activator->myskills.abilities[FORCE_WALL].current_level;
			burn_person(tr.ent, self->activator, dmg);
			T_Damage (tr.ent, self, self->activator, zvec, tr.ent->s.origin, NULL, dmg, 1, DAMAGE_ENERGY, MOD_BURN);
			
			// wall can only deal so much damage before self-destructing
			self->health -= dmg;
			if (self->health < 0)
			{
				safe_cprintf(self->activator, PRINT_HIGH, "Your wall has expired.\n");
				self->think = BecomeTE;
				self->nextthink = level.time + FRAMETIME;
				return;
			}
			
		}
		//gi.dprintf("found %s\n", tr.ent->classname);
	}

	if (self->delay-10 == level.time)
		safe_cprintf(self->activator, PRINT_HIGH, "Your wall will time-out in 10 seconds.\n");

	self->nextthink = level.time + FRAMETIME;
}
Esempio n. 4
0
void boss_spawn_tank (edict_t *ent)
{
	char	userinfo[MAX_INFO_STRING], *message;
	//edict_t	*tank;

	//gi.dprintf("boss_spawn_tank()\n");

	if (G_EntExists(ent->owner) && (ent->owner->mtype == BOSS_TANK))
	{
		message = HiPrint(va("%s got bored and left the game.", ent->client->pers.netname));
		gi.bprintf(PRINT_HIGH, "%s\n", message);
		V_Free(message);

		BecomeTE(ent->owner);
		ent->svflags &= ~SVF_NOCLIENT;
		ent->viewheight = 22;
		ent->movetype = MOVETYPE_WALK;
		ent->solid = SOLID_BBOX;
		ent->takedamage = DAMAGE_AIM;

		// recover player info
		memcpy(userinfo, ent->client->pers.userinfo, sizeof(userinfo));
		InitClientPersistant(ent->client);
		ClientUserinfoChanged(ent, userinfo);
		modify_max(ent);
		Pick_respawnweapon(ent);
		ent->owner = NULL;
		return;
	}

	CreateBoss(ent);
/*
	message = HiPrint(va("A level %d boss known as %s has spawned!", average_player_level, ent->client->pers.netname));
	gi.bprintf(PRINT_HIGH, "%s\n", message);

	// create the tank entity that the player will pilot
	tank = G_Spawn();
	tank->classname = "boss";
	tank->solid = SOLID_BBOX;
	tank->takedamage = DAMAGE_YES;
	tank->movetype = MOVETYPE_STEP;
	tank->clipmask = MASK_MONSTERSOLID;
	tank->svflags |= SVF_MONSTER;
	tank->activator = ent;
	tank->die = boss_tank_die;
	tank->think = boss_tank_think;
	tank->mass = 500;
	tank->monsterinfo.level = average_player_level;
	tank->health = TANK_INITIAL_HEALTH+TANK_ADDON_HEALTH*tank->monsterinfo.level;
	tank->max_health = tank->health;
	tank->mtype = BOSS_TANK;
	tank->pain = boss_pain;
	tank->flags |= FL_CHASEABLE; // 3.65 indicates entity can be chase cammed
	// set up pointers
	tank->owner = ent;
	ent->owner = tank;
	
	tank->s.modelindex = gi.modelindex ("models/monsters/tank/tris.md2");
	VectorSet (tank->mins, -24, -24, -16);
	VectorSet (tank->maxs, 24, 24, 64);
	tank->s.skinnum = 2; // commander skin
	VectorCopy(ent->s.angles, tank->s.angles);
	tank->s.angles[PITCH] = 0; // monsters don't use pitch
	tank->nextthink = level.time + FRAMETIME;
	VectorCopy(ent->s.origin, tank->s.origin);
	VectorCopy(ent->s.old_origin, tank->s.old_origin);

	// link up entities
	gi.linkentity(tank);
	gi.linkentity(ent);

	// make the player into a ghost
	ent->svflags |= SVF_NOCLIENT;
	ent->viewheight = 0;
	ent->movetype = MOVETYPE_NOCLIP;
	ent->solid = SOLID_NOT;
	ent->takedamage = DAMAGE_NO;
	ent->client->ps.gunindex = 0;
	memset (ent->client->pers.inventory, 0, sizeof(ent->client->pers.inventory));
	ent->client->pers.weapon = NULL;
	*/
}