Beispiel #1
0
void target_laser_start (gentity_t *self)
{
	gentity_t *ent;

	self->s.eType = ET_BEAM;

	if (self->target) {
		ent = G_Find (NULL, FOFS(targetname), self->target);
		if (!ent) {
			G_Printf ("%s at %s: %s is a bad target\n", self->classname, vtos(self->s.origin), self->target);
		}
		self->enemy = ent;
	} else {
		G_SetMovedir (self->s.angles, self->movedir);
	}

	self->use = target_laser_use;
	self->think = target_laser_think;

	if ( !self->damage ) {
		self->damage = 1;
	}

	if (self->spawnflags & 1)
		target_laser_on (self);
	else
		target_laser_off (self);
}
Beispiel #2
0
void target_laser_use (edict_t *self, edict_t *other, edict_t *activator)
{
	self->activator = activator;
	if (self->spawnflags & 1)
		target_laser_off (self);
	else
		target_laser_on (self);
}
Beispiel #3
0
void target_laser_use (gentity_t *self, gentity_t *other, gentity_t *activator)
{
	self->activator = activator;
	if ( self->nextthink > 0 )
		target_laser_off (self);
	else
		target_laser_on (self);
}
Beispiel #4
0
void target_laser_start (edict_t *self)
{
	edict_t *ent;

	self->movetype = MOVETYPE_NONE;
	self->solid = SOLID_NOT;
	self->s.renderfx |= RF_BEAM|RF_TRANSLUCENT;
	self->s.modelindex = 1;			// must be non-zero

	// set the beam diameter
	if (self->spawnflags & 64)
		self->s.frame = 16;
	else
		self->s.frame = 4;

	// set the color
	if (self->spawnflags & 2)
		self->s.skinnum = 0xf2f2f0f0;
	else if (self->spawnflags & 4)
		self->s.skinnum = 0xd0d1d2d3;
	else if (self->spawnflags & 8)
		self->s.skinnum = 0xf3f3f1f1;
	else if (self->spawnflags & 16)
		self->s.skinnum = 0xdcdddedf;
	else if (self->spawnflags & 32)
		self->s.skinnum = 0xe0e1e2e3;

	if (!self->enemy)
	{
		if (self->target)
		{
			ent = G_Find (NULL, FOFS(targetname), self->target);
			if (!ent)
				gi.dprintf ("%s at %s: %s is a bad target\n", self->classname, vtos(self->s.origin), self->target);
			self->enemy = ent;
		}
		else
		{
			G_SetMovedir (self->s.angles, self->movedir);
		}
	}
	self->use = target_laser_use;
	self->think = target_laser_think;

	if (!self->dmg)
		self->dmg = 1;

	VectorSet (self->mins, -8, -8, -8);
	VectorSet (self->maxs, 8, 8, 8);
	gi.linkentity (self);

	if (self->spawnflags & 1)
		target_laser_on (self);
	else
		target_laser_off (self);
}
Beispiel #5
0
void target_laser_use (gentity_t *self, gentity_t *other, gentity_t *activator)
{
	G_ActivateBehavior(self,BSET_USE);

	self->activator = activator;
	if ( self->nextthink > 0 )
		target_laser_off (self);
	else
		target_laser_on (self);
}
Beispiel #6
0
void target_laser_start( edict_t *self )
{
	edict_t *ent;

	self->movetype = MOVETYPE_NONE;
	self->r.solid = SOLID_NOT;
	self->s.type = ET_BEAM;
	self->s.modelindex = 1;     // must be non-zero
	self->r.svflags = SVF_TRANSMITORIGIN2;

	// set the beam diameter
	if( self->spawnflags & 64 )
		self->s.frame = 16;
	else
		self->s.frame = 4;

	// set the color
	if( self->spawnflags & 2 )
		self->s.colorRGBA = COLOR_RGBA( 220, 0, 0, 76 );
	else if( self->spawnflags & 4 )
		self->s.colorRGBA = COLOR_RGBA( 0, 220, 0, 76 );
	else if( self->spawnflags & 8 )
		self->s.colorRGBA = COLOR_RGBA( 0, 0, 220, 76 );
	else if( self->spawnflags & 16 )
		self->s.colorRGBA = COLOR_RGBA( 220, 220, 0, 76 );
	else if( self->spawnflags & 32 )
		self->s.colorRGBA = COLOR_RGBA( 255, 255, 0, 76 );

	if( !self->enemy )
	{
		if( self->target )
		{
			ent = G_Find( NULL, FOFS( targetname ), self->target );
			if( !ent )
				if( developer->integer )
					G_Printf( "%s at %s: %s is a bad target\n", self->classname, vtos( self->s.origin ), self->target );
			self->enemy = ent;
		}
		else
		{
			G_SetMovedir( self->s.angles, self->moveinfo.movedir );
		}
	}
	self->use = target_laser_use;
	self->think = target_laser_think;

	if( !self->dmg )
		self->dmg = 1;

	if( self->spawnflags & 1 )
		target_laser_on( self );
	else
		target_laser_off( self );
}
Beispiel #7
0
void target_laser_use(gentity_t *self, gentity_t *other, gentity_t *activator) {
	// Nico, silent GCC
	(void)other;

	self->activator = activator;
	if (self->nextthink > 0) {
		target_laser_off(self);
	} else {
		target_laser_on(self);
	}
}
Beispiel #8
0
void target_laser_use (gentity_t *self, gentity_t *other, gentity_t *activator)
{
	/* LQ3A */
	UNREFERENCED_PARAMETER(other);

	self->activator = activator;
	if ( self->nextthink > 0 )
		target_laser_off (self);
	else
		target_laser_on (self);
}
Beispiel #9
0
void target_laser_use (edict_t *self, edict_t *other, edict_t *activator)
{
	if (!self || !activator)
	{
		return;
	}

	self->activator = activator;

	if (self->spawnflags & 1)
	{
		target_laser_off(self);
	}
	else
	{
		target_laser_on(self);
	}
}
Beispiel #10
0
void    pre_target_laser_think (edict_t *self)
{
	target_laser_on (self);
	self->think = target_laser_think;
}
Beispiel #11
0
void Cmd_Trigger_f (edict_t *ent)
{
    char		*targetname;
    edict_t	*t;
    int		arg2;

    arg2 = atoi (gi.argv(2));
    targetname = gi.argv(1);
    t = G_Find (NULL, FOFS(targetname), targetname);

    switch (arg2)
    {
    /*
    =============
    Turn target off
    =============
    */
    case 1:
        if (!t)
            return;
        if (!strncmp(t->classname,"target_mappack_laser",sizeof("target_mappack_laser")))
        {
            if (t->spawnflags & 1)
                target_laser_off (t);
        }
        if (!strncmp(t->classname,"mappack_light",sizeof("mappack_light")))
        {
            if (!t->spawnflags & 1)
            {
                gi.configstring (CS_LIGHTS+t->style, "a");
                t->spawnflags |= 1;
            }
        }
        break;
    /*
    =============
    Turn target on
    =============
    */
    case 2:
        if (!t)
            return;
        if (!strncmp(t->classname,"target_satan_laser",sizeof("target_satan_laser")))
        {
            if (t->spawnflags & 1)
            {
            }
            else
                target_laser_on (t);
        }
        if (!strncmp(t->classname,"satan_light", sizeof("satan_light")))
        {
            if (t->spawnflags & 1)
            {
                gi.configstring (CS_LIGHTS+t->style, "m");
                t->spawnflags &= ~1;
            }
        }
        break;

    /*
    =============
    Just swap em around, or trigger em if not toggleable
    =============
    */
    default:
        if (!t)
            return;

        t = G_Spawn();
        t->classname = "DelayedUse";
        t->nextthink = level.time + 0.01;
        t->think = Think_Delay;
        t->activator = ent;
        t->target = gi.argv(1);
        break;
    }
}