Exemplo n.º 1
0
//[/CoOp]
//-----------------------------------------------------
void SP_misc_turret( gentity_t *base )
//-----------------------------------------------------
{
	char* s;

	//[CoOp]
	//wahoo turret - actually a spawn flag of 5 spawns a huge space turbo turret
	//and others spawn the normal g2 turret so fixed this if statement.  In sp, spawnflags
	//are checked for the value of 5 to spawn the turbo turrets, but in mp it checks for
	//a spawn flag of 8 in sp_misc_turretg2, so setting to 8 before spawning.  No hoth style
	//turrets can be found in sp so far.
	if( g_gametype.integer == GT_SINGLE_PLAYER )
	{//SP uses this same map entity name for the ceiling turrets.  Override to use them
		//in CoOp.
		if( base->spawnflags & 5 )
			base->spawnflags |= 8;
		
		SP_misc_turretG2( base );
			return;
	}
	//[/CoOp]

	base->s.modelindex2 = G_ModelIndex( "models/map_objects/hoth/turret_bottom.md3" );
	base->s.modelindex = G_ModelIndex( "models/map_objects/hoth/turret_base.md3" );
	//base->playerModel = gi.G2API_InitGhoul2Model( base->ghoul2, "models/map_objects/imp_mine/turret_canon.glm", base->s.modelindex );
	//base->s.radius = 80.0f;

	//gi.G2API_SetBoneAngles( &base->ghoul2[base->playerModel], "Bone_body", vec3_origin, BONE_ANGLES_POSTMULT, POSITIVE_Y, POSITIVE_Z, POSITIVE_X, NULL ); 
	//base->torsoBolt = gi.G2API_AddBolt( &base->ghoul2[base->playerModel], "*flash03" );

	G_SpawnString( "icon", "", &s );
	if (s && s[0])
	{ 
		// We have an icon, so index it now.  We are reusing the genericenemyindex
		// variable rather than adding a new one to the entity state.
		base->s.genericenemyindex = G_IconIndex(s);
	}

	G_SetAngles( base, base->s.angles );
	G_SetOrigin( base, base->s.origin );

	base->r.contents = CONTENTS_BODY;

	VectorSet( base->r.maxs, 32.0f, 32.0f, 128.0f );
	VectorSet( base->r.mins, -32.0f, -32.0f, 0.0f );

	base->use = turret_base_use;
	base->think = turret_base_think;
	// don't start working right away
	base->nextthink = level.time + FRAMETIME * 5;

	trap_LinkEntity( base );

	if ( !turret_base_spawn_top( base ) )
	{
		G_FreeEntity( base );
	}
}
Exemplo n.º 2
0
//-----------------------------------------------------
void SP_misc_turretG2( gentity_t *base )
//-----------------------------------------------------
{
    int customscaleVal;
    char* s;

    turretG2_set_models( base, qfalse );

    G_SpawnInt("painwait", "0", &base->genericValue4);
    base->genericValue8 = 0;

    G_SpawnInt("customscale", "0", &customscaleVal);
    base->s.iModelScale = customscaleVal;
    if (base->s.iModelScale)
    {
        if (base->s.iModelScale > 1023)
        {
            base->s.iModelScale = 1023;
        }
        base->modelScale[0] = base->modelScale[1] = base->modelScale[2] = base->s.iModelScale/100.0f;
    }

    G_SpawnString( "icon", "", &s );
    if (s && s[0])
    {
        // We have an icon, so index it now.  We are reusing the genericenemyindex
        // variable rather than adding a new one to the entity state.
        base->s.genericenemyindex = G_IconIndex(s);
    }

    finish_spawning_turretG2( base );

    if (( base->spawnflags & 1 )) // Start_Off
    {
        base->s.frame = 1; // black
    }
    else
    {
        base->s.frame = 0; // glow
    }
    if ( !(base->spawnflags&SPF_TURRETG2_TURBO) )
    {
        base->s.eFlags |= EF_SHADER_ANIM;
    }

    if (base->spawnflags & SPF_SHOWONRADAR)
    {
        base->s.eFlags |= EF_RADAROBJECT;
    }
#undef name
#undef name2
#undef name3
}
Exemplo n.º 3
0
//-----------------------------------------------------
void SP_misc_turret( gentity_t *base )
//-----------------------------------------------------
{
	char* s;

	base->s.modelindex2 = G_ModelIndex( "models/map_objects/hoth/turret_bottom.md3" );
	base->s.modelindex = G_ModelIndex( "models/map_objects/hoth/turret_base.md3" );
	//base->playerModel = trap->G2API_InitGhoul2Model( base->ghoul2, "models/map_objects/imp_mine/turret_canon.glm", base->s.modelindex );
	//base->s.radius = 80.0f;

	//trap->G2API_SetBoneAngles( &base->ghoul2[base->playerModel], "Bone_body", vec3_origin, BONE_ANGLES_POSTMULT, POSITIVE_Y, POSITIVE_Z, POSITIVE_X, NULL ); 
	//base->torsoBolt = trap->G2API_AddBolt( &base->ghoul2[base->playerModel], "*flash03" );

	G_SpawnString( "icon", "", &s );
	if (s && s[0])
	{ 
		// We have an icon, so index it now.  We are reusing the genericenemyindex
		// variable rather than adding a new one to the entity state.
		base->s.genericenemyindex = G_IconIndex(s);
	}

	G_SetAngles( base, base->s.angles );
	G_SetOrigin( base, base->s.origin );

	base->r.contents = CONTENTS_BODY;

	VectorSet( base->r.maxs, 32.0f, 32.0f, 128.0f );
	VectorSet( base->r.mins, -32.0f, -32.0f, 0.0f );

	base->use = turret_base_use;
	base->think = turret_base_think;
	// don't start working right away
	base->nextthink = level.time + FRAMETIME * 5;

	trap->LinkEntity( (sharedEntity_t *)base );

	if ( !turret_base_spawn_top( base ) )
	{
		G_FreeEntity( base );
	}
}
Exemplo n.º 4
0
//-----------------------------------------------------
void SP_misc_turret( gentity_t *base )
//-----------------------------------------------------
{
	char* s;

	base->s.modelindex2 = G_ModelIndex( "models/map_objects/hoth/turret_bottom.md3" );
	base->s.modelindex = G_ModelIndex( "models/map_objects/hoth/turret_base.md3" );

	G_SpawnString( "icon", "", &s );
	if (s && s[0])
	{ 
		// We have an icon, so index it now.  We are reusing the genericenemyindex
		// variable rather than adding a new one to the entity state.
		base->s.genericenemyindex = G_IconIndex(s);
	}

	G_SetAngles( base, base->s.angles );
	G_SetOrigin( base, base->s.origin );

	base->r.contents = CONTENTS_BODY;

	VectorSet( base->r.maxs, 32.0f, 32.0f, 128.0f );
	VectorSet( base->r.mins, -32.0f, -32.0f, 0.0f );

	base->use = turret_base_use;
	base->think = turret_base_think;
	// don't start working right away
	base->nextthink = level.time + FRAMETIME * 5;

	trap_LinkEntity( base );

	if ( !turret_base_spawn_top( base ) )
	{
		G_FreeEntity( base );
	}
}