コード例 #1
0
ファイル: g_trigger.c プロジェクト: redrumrobot/trem-gpp-bots
/*
===============
SP_trigger_equipment
===============
*/
void SP_trigger_equipment( gentity_t *self )
{
    char *buffer;

    G_SpawnFloat( "wait", "0.5", &self->wait );
    G_SpawnFloat( "random", "0", &self->random );

    if( self->random >= self->wait && self->wait >= 0 )
    {
        self->random = self->wait - FRAMETIME;
        G_Printf( S_COLOR_YELLOW "WARNING: trigger_equipment has random >= wait\n" );
    }

    G_SpawnString( "equipment", "", &buffer );

    BG_ParseCSVEquipmentList( buffer, self->wTriggers, WP_NUM_WEAPONS,
                              self->uTriggers, UP_NUM_UPGRADES );

    self->touch = trigger_equipment_touch;
    self->use = trigger_equipment_use;

    // SPAWN_DISABLED
    if( self->spawnflags & 1 )
        self->s.eFlags |= EF_NODRAW;

    // NEGATE
    if( self->spawnflags & 2 )
        self->s.eFlags |= EF_DEAD;

    InitTrigger( self );
    trap_LinkEntity( self );
}
コード例 #2
0
void SP_ConditionFields( gentity_t *self ) {
	char *buffer;

	if ( G_SpawnString( "buildables", "", &buffer ) )
		BG_ParseCSVBuildableList( buffer, self->conditions.buildables, BA_NUM_BUILDABLES );

	if ( G_SpawnString( "classes", "", &buffer ) )
		BG_ParseCSVClassList( buffer, self->conditions.classes, PCL_NUM_CLASSES );

	if ( G_SpawnString( "equipment", "", &buffer ) )
		BG_ParseCSVEquipmentList( buffer, self->conditions.weapons, WP_NUM_WEAPONS,
	                          self->conditions.upgrades, UP_NUM_UPGRADES );

}