codemp/game/g_spawn.c File Reference

#include "g_local.h"
#include "../namespace_begin.h"
#include "../namespace_end.h"

Go to the source code of this file.

Data Structures

struct  spawn_t

Defines

#define NOVALUE   "novalue"

Functions

qboolean G_SpawnString (const char *key, const char *defaultString, char **out)
qboolean G_SpawnFloat (const char *key, const char *defaultString, float *out)
qboolean G_SpawnInt (const char *key, const char *defaultString, int *out)
qboolean G_SpawnVector (const char *key, const char *defaultString, float *out)
void SP_info_player_start (gentity_t *ent)
void SP_info_player_duel (gentity_t *ent)
void SP_info_player_duel1 (gentity_t *ent)
void SP_info_player_duel2 (gentity_t *ent)
void SP_info_player_deathmatch (gentity_t *ent)
void SP_info_player_siegeteam1 (gentity_t *ent)
void SP_info_player_siegeteam2 (gentity_t *ent)
void SP_info_player_intermission (gentity_t *ent)
void SP_info_player_intermission_red (gentity_t *ent)
void SP_info_player_intermission_blue (gentity_t *ent)
void SP_info_jedimaster_start (gentity_t *ent)
void SP_info_player_start_red (gentity_t *ent)
void SP_info_player_start_blue (gentity_t *ent)
void SP_info_firstplace (gentity_t *ent)
void SP_info_secondplace (gentity_t *ent)
void SP_info_thirdplace (gentity_t *ent)
void SP_info_podium (gentity_t *ent)
void SP_info_siege_objective (gentity_t *ent)
void SP_info_siege_radaricon (gentity_t *ent)
void SP_info_siege_decomplete (gentity_t *ent)
void SP_target_siege_end (gentity_t *ent)
void SP_misc_siege_item (gentity_t *ent)
void SP_func_plat (gentity_t *ent)
void SP_func_static (gentity_t *ent)
void SP_func_rotating (gentity_t *ent)
void SP_func_bobbing (gentity_t *ent)
void SP_func_pendulum (gentity_t *ent)
void SP_func_button (gentity_t *ent)
void SP_func_door (gentity_t *ent)
void SP_func_train (gentity_t *ent)
void SP_func_timer (gentity_t *self)
void SP_func_breakable (gentity_t *ent)
void SP_func_glass (gentity_t *ent)
void SP_func_usable (gentity_t *ent)
void SP_func_wall (gentity_t *ent)
void SP_trigger_lightningstrike (gentity_t *ent)
void SP_trigger_always (gentity_t *ent)
void SP_trigger_multiple (gentity_t *ent)
void SP_trigger_once (gentity_t *ent)
void SP_trigger_push (gentity_t *ent)
void SP_trigger_teleport (gentity_t *ent)
void SP_trigger_hurt (gentity_t *ent)
void SP_trigger_space (gentity_t *self)
void SP_trigger_shipboundary (gentity_t *self)
void SP_trigger_hyperspace (gentity_t *self)
void SP_trigger_asteroid_field (gentity_t *self)
void SP_target_remove_powerups (gentity_t *ent)
void SP_target_give (gentity_t *ent)
void SP_target_delay (gentity_t *ent)
void SP_target_speaker (gentity_t *ent)
void SP_target_print (gentity_t *ent)
void SP_target_laser (gentity_t *self)
void SP_target_character (gentity_t *ent)
void SP_target_score (gentity_t *ent)
void SP_target_teleporter (gentity_t *ent)
void SP_target_relay (gentity_t *ent)
void SP_target_kill (gentity_t *ent)
void SP_target_position (gentity_t *ent)
void SP_target_location (gentity_t *ent)
void SP_target_counter (gentity_t *self)
void SP_target_random (gentity_t *self)
void SP_target_scriptrunner (gentity_t *self)
void SP_target_interest (gentity_t *self)
void SP_target_activate (gentity_t *self)
void SP_target_deactivate (gentity_t *self)
void SP_target_level_change (gentity_t *self)
void SP_target_play_music (gentity_t *self)
void SP_target_push (gentity_t *ent)
void SP_light (gentity_t *self)
void SP_info_null (gentity_t *self)
void SP_info_notnull (gentity_t *self)
void SP_info_camp (gentity_t *self)
void SP_path_corner (gentity_t *self)
void SP_misc_teleporter_dest (gentity_t *self)
void SP_misc_model (gentity_t *ent)
void SP_misc_model_static (gentity_t *ent)
void SP_misc_G2model (gentity_t *ent)
void SP_misc_portal_camera (gentity_t *ent)
void SP_misc_portal_surface (gentity_t *ent)
void SP_misc_weather_zone (gentity_t *ent)
void SP_misc_bsp (gentity_t *ent)
void SP_terrain (gentity_t *ent)
void SP_misc_skyportal_orient (gentity_t *ent)
void SP_misc_skyportal (gentity_t *ent)
void SP_misc_ammo_floor_unit (gentity_t *ent)
void SP_misc_shield_floor_unit (gentity_t *ent)
void SP_misc_model_shield_power_converter (gentity_t *ent)
void SP_misc_model_ammo_power_converter (gentity_t *ent)
void SP_misc_model_health_power_converter (gentity_t *ent)
void SP_fx_runner (gentity_t *ent)
void SP_target_screenshake (gentity_t *ent)
void SP_target_escapetrig (gentity_t *ent)
void SP_misc_maglock (gentity_t *self)
void SP_misc_faller (gentity_t *ent)
void SP_misc_holocron (gentity_t *ent)
void SP_reference_tag (gentity_t *ent)
void SP_misc_weapon_shooter (gentity_t *self)
void SP_NPC_spawner (gentity_t *self)
void SP_NPC_Vehicle (gentity_t *self)
void SP_NPC_Kyle (gentity_t *self)
void SP_NPC_Lando (gentity_t *self)
void SP_NPC_Jan (gentity_t *self)
void SP_NPC_Luke (gentity_t *self)
void SP_NPC_MonMothma (gentity_t *self)
void SP_NPC_Tavion (gentity_t *self)
void SP_NPC_Tavion_New (gentity_t *self)
void SP_NPC_Alora (gentity_t *self)
void SP_NPC_Reelo (gentity_t *self)
void SP_NPC_Galak (gentity_t *self)
void SP_NPC_Desann (gentity_t *self)
void SP_NPC_Bartender (gentity_t *self)
void SP_NPC_MorganKatarn (gentity_t *self)
void SP_NPC_Jedi (gentity_t *self)
void SP_NPC_Prisoner (gentity_t *self)
void SP_NPC_Rebel (gentity_t *self)
void SP_NPC_Stormtrooper (gentity_t *self)
void SP_NPC_StormtrooperOfficer (gentity_t *self)
void SP_NPC_Snowtrooper (gentity_t *self)
void SP_NPC_Tie_Pilot (gentity_t *self)
void SP_NPC_Ugnaught (gentity_t *self)
void SP_NPC_Jawa (gentity_t *self)
void SP_NPC_Gran (gentity_t *self)
void SP_NPC_Rodian (gentity_t *self)
void SP_NPC_Weequay (gentity_t *self)
void SP_NPC_Trandoshan (gentity_t *self)
void SP_NPC_Tusken (gentity_t *self)
void SP_NPC_Noghri (gentity_t *self)
void SP_NPC_SwampTrooper (gentity_t *self)
void SP_NPC_Imperial (gentity_t *self)
void SP_NPC_ImpWorker (gentity_t *self)
void SP_NPC_BespinCop (gentity_t *self)
void SP_NPC_Reborn (gentity_t *self)
void SP_NPC_ShadowTrooper (gentity_t *self)
void SP_NPC_Monster_Murjj (gentity_t *self)
void SP_NPC_Monster_Swamp (gentity_t *self)
void SP_NPC_Monster_Howler (gentity_t *self)
void SP_NPC_Monster_Claw (gentity_t *self)
void SP_NPC_Monster_Glider (gentity_t *self)
void SP_NPC_Monster_Flier2 (gentity_t *self)
void SP_NPC_Monster_Lizard (gentity_t *self)
void SP_NPC_Monster_Fish (gentity_t *self)
void SP_NPC_Monster_Wampa (gentity_t *self)
void SP_NPC_Monster_Rancor (gentity_t *self)
void SP_NPC_MineMonster (gentity_t *self)
void SP_NPC_Droid_Interrogator (gentity_t *self)
void SP_NPC_Droid_Probe (gentity_t *self)
void SP_NPC_Droid_Mark1 (gentity_t *self)
void SP_NPC_Droid_Mark2 (gentity_t *self)
void SP_NPC_Droid_ATST (gentity_t *self)
void SP_NPC_Droid_Seeker (gentity_t *self)
void SP_NPC_Droid_Remote (gentity_t *self)
void SP_NPC_Droid_Sentry (gentity_t *self)
void SP_NPC_Droid_Gonk (gentity_t *self)
void SP_NPC_Droid_Mouse (gentity_t *self)
void SP_NPC_Droid_R2D2 (gentity_t *self)
void SP_NPC_Droid_R5D2 (gentity_t *self)
void SP_NPC_Droid_Protocol (gentity_t *self)
void SP_NPC_Reborn_New (gentity_t *self)
void SP_NPC_Cultist (gentity_t *self)
void SP_NPC_Cultist_Saber (gentity_t *self)
void SP_NPC_Cultist_Saber_Powers (gentity_t *self)
void SP_NPC_Cultist_Destroyer (gentity_t *self)
void SP_NPC_Cultist_Commando (gentity_t *self)
void SP_waypoint (gentity_t *ent)
void SP_waypoint_small (gentity_t *ent)
void SP_waypoint_navgoal (gentity_t *ent)
void SP_waypoint_navgoal_8 (gentity_t *ent)
void SP_waypoint_navgoal_4 (gentity_t *ent)
void SP_waypoint_navgoal_2 (gentity_t *ent)
void SP_waypoint_navgoal_1 (gentity_t *ent)
void SP_CreateSpaceDust (gentity_t *ent)
void SP_CreateSnow (gentity_t *ent)
void SP_CreateRain (gentity_t *ent)
void SP_point_combat (gentity_t *self)
void SP_shooter_blaster (gentity_t *ent)
void SP_team_CTF_redplayer (gentity_t *ent)
void SP_team_CTF_blueplayer (gentity_t *ent)
void SP_team_CTF_redspawn (gentity_t *ent)
void SP_team_CTF_bluespawn (gentity_t *ent)
void SP_misc_turret (gentity_t *ent)
void SP_misc_turretG2 (gentity_t *base)
void SP_item_botroam (gentity_t *ent)
void SP_gametype_item (gentity_t *ent)
void SP_emplaced_gun (gentity_t *ent)
qboolean G_CallSpawn (gentity_t *ent)
char * G_NewString (const char *string)
void BG_ParseField (BG_field_t *l_fields, const char *key, const char *value, byte *ent)
void G_SpawnGEntityFromSpawnVars (qboolean inSubBSP)
char * G_AddSpawnVarToken (const char *string)
void AddSpawnField (char *field, char *value)
qboolean G_ParseSpawnVars (qboolean inSubBSP)
void scriptrunner_run (gentity_t *self)
void EWebPrecache (void)
void SP_worldspawn (void)
qboolean SP_bsp_worldspawn (void)
void G_PrecacheSoundsets (void)
void G_SpawnEntitiesFromString (qboolean inSubBSP)

Variables

BG_field_t fields []
spawn_t spawns []
void * precachedKyle = 0
float g_cullDistance


Define Documentation

#define NOVALUE   "novalue"
 

Definition at line 886 of file g_spawn.c.


Function Documentation

void AddSpawnField char *  field,
char *  value
 

Definition at line 868 of file g_spawn.c.

References G_AddSpawnVarToken(), level, level_locals_t::numSpawnVars, Q_stricmp(), and level_locals_t::spawnVars.

00869 {
00870         int     i;
00871 
00872         for(i=0;i<level.numSpawnVars;i++)
00873         {
00874                 if (Q_stricmp(level.spawnVars[i][0], field) == 0)
00875                 {
00876                         level.spawnVars[ i ][1] = G_AddSpawnVarToken( value );
00877                         return;
00878                 }
00879         }
00880 
00881         level.spawnVars[ level.numSpawnVars ][0] = G_AddSpawnVarToken( field );
00882         level.spawnVars[ level.numSpawnVars ][1] = G_AddSpawnVarToken( value );
00883         level.numSpawnVars++;
00884 }

void BG_ParseField BG_field_t *  l_fields,
const char *  key,
const char *  value,
byte ent
 

Definition at line 358 of file bg_misc.c.

References atof(), atoi(), byte, CG_NewString(), G_NewString(), gentity_t, Q3_SetParm(), Q_stricmp(), sscanf(), and vec3_t.

Referenced by CG_SpawnCGameEntFromVars(), G_SpawnGEntityFromSpawnVars(), and SP_worldspawn().

00359 {
00360         BG_field_t      *f;
00361         byte    *b;
00362         float   v;
00363         vec3_t  vec;
00364 
00365         for ( f=l_fields ; f->name ; f++ ) {
00366                 if ( !Q_stricmp(f->name, key) ) {
00367                         // found it
00368                         b = (byte *)ent;
00369 
00370                         switch( f->type ) {
00371                         case F_LSTRING:
00372 #ifdef QAGAME
00373                                 *(char **)(b+f->ofs) = G_NewString (value);
00374 #else
00375                                 *(char **)(b+f->ofs) = CG_NewString (value);
00376 #endif
00377                                 break;
00378                         case F_VECTOR:
00379                                 sscanf (value, "%f %f %f", &vec[0], &vec[1], &vec[2]);
00380                                 ((float *)(b+f->ofs))[0] = vec[0];
00381                                 ((float *)(b+f->ofs))[1] = vec[1];
00382                                 ((float *)(b+f->ofs))[2] = vec[2];
00383                                 break;
00384                         case F_INT:
00385                                 *(int *)(b+f->ofs) = atoi(value);
00386                                 break;
00387                         case F_FLOAT:
00388                                 *(float *)(b+f->ofs) = atof(value);
00389                                 break;
00390                         case F_ANGLEHACK:
00391                                 v = atof(value);
00392                                 ((float *)(b+f->ofs))[0] = 0;
00393                                 ((float *)(b+f->ofs))[1] = v;
00394                                 ((float *)(b+f->ofs))[2] = 0;
00395                                 break;
00396 #ifdef QAGAME
00397                         case F_PARM1:
00398                         case F_PARM2:
00399                         case F_PARM3:
00400                         case F_PARM4:
00401                         case F_PARM5:
00402                         case F_PARM6:
00403                         case F_PARM7:
00404                         case F_PARM8:
00405                         case F_PARM9:
00406                         case F_PARM10:
00407                         case F_PARM11:
00408                         case F_PARM12:
00409                         case F_PARM13:
00410                         case F_PARM14:
00411                         case F_PARM15:
00412                         case F_PARM16:
00413                                 Q3_SetParm( ((gentity_t *)(ent))->s.number, (f->type - F_PARM1), (char *) value );
00414                                 break;
00415 #endif
00416                         default:
00417                         case F_IGNORE:
00418                                 break;
00419                         }
00420                         return;
00421                 }
00422         }
00423 }

void EWebPrecache void   ) 
 

Definition at line 1434 of file g_items.c.

References BG_FindItemForWeapon(), G_EffectIndex(), RegisterItem(), and WP_TURRET.

Referenced by SP_worldspawn().

01435 {
01436         RegisterItem( BG_FindItemForWeapon(WP_TURRET) );
01437         G_EffectIndex("detpack/explosion.efx");
01438         G_EffectIndex("turret/muzzle_flash.efx");
01439 }

char* G_AddSpawnVarToken const char *  string  ) 
 

Definition at line 851 of file g_spawn.c.

References G_Error(), level, MAX_SPAWN_VARS_CHARS, memcpy(), level_locals_t::numSpawnVarChars, level_locals_t::spawnVarChars, and strlen().

Referenced by AddSpawnField(), and G_ParseSpawnVars().

00851                                                {
00852         int             l;
00853         char    *dest;
00854 
00855         l = strlen( string );
00856         if ( level.numSpawnVarChars + l + 1 > MAX_SPAWN_VARS_CHARS ) {
00857                 G_Error( "G_AddSpawnVarToken: MAX_SPAWN_CHARS" );
00858         }
00859 
00860         dest = level.spawnVarChars + level.numSpawnVarChars;
00861         memcpy( dest, string, l+1 );
00862 
00863         level.numSpawnVarChars += l + 1;
00864 
00865         return dest;
00866 }

qboolean G_CallSpawn gentity_t ent  ) 
 

Definition at line 683 of file g_spawn.c.

References bg_itemlist, gitem_s::classname, gentity_s::classname, G_Printf(), G_SoundIndex(), G_SpawnItem(), gentity_t, gitem_t, gentity_s::healingsound, spawn_t::name, qboolean, qfalse, qtrue, spawn_t::spawn, spawns, and strcmp().

Referenced by G_SpawnGEntityFromSpawnVars().

00683                                        {
00684         spawn_t *s;
00685         gitem_t *item;
00686 
00687         if ( !ent->classname ) {
00688                 G_Printf ("G_CallSpawn: NULL classname\n");
00689                 return qfalse;
00690         }
00691 
00692         // check item spawn functions
00693         for ( item=bg_itemlist+1 ; item->classname ; item++ ) {
00694                 if ( !strcmp(item->classname, ent->classname) ) {
00695                         G_SpawnItem( ent, item );
00696                         return qtrue;
00697                 }
00698         }
00699 
00700         // check normal spawn functions
00701         for ( s=spawns ; s->name ; s++ ) {
00702                 if ( !strcmp(s->name, ent->classname) ) {
00703                         // found it
00704                         if (ent->healingsound && ent->healingsound[0])
00705                         { //yeah...this can be used for anything, so.. precache it if it's there
00706                                 G_SoundIndex(ent->healingsound);
00707                         }
00708                         s->spawn(ent);
00709                         return qtrue;
00710                 }
00711         }
00712         G_Printf ("%s doesn't have a spawn function\n", ent->classname);
00713         return qfalse;
00714 }

char* G_NewString const char *  string  ) 
 

Definition at line 724 of file g_spawn.c.

References G_Alloc(), and strlen().

Referenced by BG_ParseField(), NPC_ParseParms(), NPC_Spawn_Do(), NPC_SpawnType(), Q3_Play(), SP_target_interest(), SP_target_level_change(), and SP_target_play_music().

00724                                         {
00725         char    *newb, *new_p;
00726         int             i,l;
00727         
00728         l = strlen(string) + 1;
00729 
00730         newb = (char *) G_Alloc( l );
00731 
00732         new_p = newb;
00733 
00734         // turn \n into a real linefeed
00735         for ( i=0 ; i< l ; i++ ) {
00736                 if (string[i] == '\\' && i < l-1) {
00737                         i++;
00738                         if (string[i] == 'n') {
00739                                 *new_p++ = '\n';
00740                         } else {
00741                                 *new_p++ = '\\';
00742                         }
00743                 } else {
00744                         *new_p++ = string[i];
00745                 }
00746         }
00747         
00748         return newb;
00749 }

qboolean G_ParseSpawnVars qboolean  inSubBSP  ) 
 

Definition at line 1018 of file g_spawn.c.

References G_AddSpawnVarToken(), G_Error(), level, MAX_SPAWN_VARS, MAX_TOKEN_CHARS, level_locals_t::numSpawnVarChars, level_locals_t::numSpawnVars, qboolean, qfalse, qtrue, level_locals_t::spawnVars, and trap_GetEntityToken().

Referenced by G_SpawnEntitiesFromString(), and vmMain().

01018                                                {
01019         char            keyname[MAX_TOKEN_CHARS];
01020         char            com_token[MAX_TOKEN_CHARS];
01021 
01022         level.numSpawnVars = 0;
01023         level.numSpawnVarChars = 0;
01024 
01025         // parse the opening brace
01026         if ( !trap_GetEntityToken( com_token, sizeof( com_token ) ) ) {
01027                 // end of spawn string
01028                 return qfalse;
01029         }
01030         if ( com_token[0] != '{' ) {
01031                 G_Error( "G_ParseSpawnVars: found %s when expecting {",com_token );
01032         }
01033 
01034         // go through all the key / value pairs
01035         while ( 1 ) {   
01036                 // parse key
01037                 if ( !trap_GetEntityToken( keyname, sizeof( keyname ) ) ) {
01038                         G_Error( "G_ParseSpawnVars: EOF without closing brace" );
01039                 }
01040 
01041                 if ( keyname[0] == '}' ) {
01042                         break;
01043                 }
01044                 
01045                 // parse value  
01046                 if ( !trap_GetEntityToken( com_token, sizeof( com_token ) ) ) {
01047                         G_Error( "G_ParseSpawnVars: EOF without closing brace" );
01048                 }
01049 
01050                 if ( com_token[0] == '}' ) {
01051                         G_Error( "G_ParseSpawnVars: closing brace without data" );
01052                 }
01053                 if ( level.numSpawnVars == MAX_SPAWN_VARS ) {
01054                         G_Error( "G_ParseSpawnVars: MAX_SPAWN_VARS" );
01055                 }
01056                 level.spawnVars[ level.numSpawnVars ][0] = G_AddSpawnVarToken( keyname );
01057                 level.spawnVars[ level.numSpawnVars ][1] = G_AddSpawnVarToken( com_token );
01058                 level.numSpawnVars++;
01059         }
01060 
01061         if (inSubBSP)
01062         {
01063                 HandleEntityAdjustment();
01064         }
01065 
01066         return qtrue;
01067 }

void G_PrecacheSoundsets void   ) 
 

Definition at line 1394 of file g_spawn.c.

References Com_Error(), ERR_DROP, g_entities, G_SoundSetIndex(), gentity_t, gentity_s::inuse, MAX_AMBIENT_SETS, MAX_GENTITIES, NULL, gentity_s::s, gentity_s::soundSet, and entityState_s::soundSetIndex.

Referenced by G_SpawnEntitiesFromString().

01395 {
01396         gentity_t       *ent = NULL;
01397         int i;
01398         int countedSets = 0;
01399 
01400         for ( i = 0; i < MAX_GENTITIES; i++ )
01401         {
01402                 ent = &g_entities[i];
01403 
01404                 if (ent->inuse && ent->soundSet && ent->soundSet[0])
01405                 {
01406                         if (countedSets >= MAX_AMBIENT_SETS)
01407                         {
01408                                 Com_Error(ERR_DROP, "MAX_AMBIENT_SETS was exceeded! (too many soundsets)\n");
01409                         }
01410 
01411                         ent->s.soundSetIndex = G_SoundSetIndex(ent->soundSet);
01412                         countedSets++;
01413                 }
01414         }
01415 }

void G_SpawnEntitiesFromString qboolean  inSubBSP  ) 
 

Definition at line 1424 of file g_spawn.c.

References gentity_s::behaviorSet, BSET_SPAWN, BSET_USE, gentity_s::count, ENTITYNUM_WORLD, g_entities, G_Error(), G_ParseSpawnVars(), G_PrecacheSoundsets(), G_Spawn(), G_SpawnGEntityFromSpawnVars(), gentity_t, gentity_s::inuse, level, gentity_s::nextthink, level_locals_t::numSpawnVars, qfalse, qtrue, scriptrunner_run(), SP_bsp_worldspawn(), SP_worldspawn(), level_locals_t::spawning, gentity_s::think, level_locals_t::time, and trap_ICARUS_InitEnt().

Referenced by G_InitGame(), and SP_misc_bsp().

01424                                                     {
01425         // allow calls to G_Spawn*()
01426         level.spawning = qtrue;
01427         level.numSpawnVars = 0;
01428 
01429         // the worldspawn is not an actual entity, but it still
01430         // has a "spawn" function to perform any global setup
01431         // needed by a level (setting configstrings or cvars, etc)
01432         if ( !G_ParseSpawnVars(qfalse) ) {
01433                 G_Error( "SpawnEntities: no entities" );
01434         }
01435 
01436         if (!inSubBSP)
01437         {
01438                 SP_worldspawn();
01439         }
01440         else
01441         {
01442                 // Skip this guy if its worldspawn fails
01443                 if ( !SP_bsp_worldspawn() )
01444                 {
01445                         return;
01446                 }
01447         }
01448 
01449         // parse ents
01450         while( G_ParseSpawnVars(inSubBSP) ) {
01451                 G_SpawnGEntityFromSpawnVars(inSubBSP);
01452         }       
01453 
01454         if( g_entities[ENTITYNUM_WORLD].behaviorSet[BSET_SPAWN] && g_entities[ENTITYNUM_WORLD].behaviorSet[BSET_SPAWN][0] )
01455         {//World has a spawn script, but we don't want the world in ICARUS and running scripts,
01456                 //so make a scriptrunner and start it going.
01457                 gentity_t *script_runner = G_Spawn();
01458                 if ( script_runner )
01459                 {
01460                         script_runner->behaviorSet[BSET_USE] = g_entities[ENTITYNUM_WORLD].behaviorSet[BSET_SPAWN];
01461                         script_runner->count = 1;
01462                         script_runner->think = scriptrunner_run;
01463                         script_runner->nextthink = level.time + 100;
01464 
01465                         if ( script_runner->inuse )
01466                         {
01467                                 trap_ICARUS_InitEnt( script_runner );
01468                         }
01469                 }
01470         }
01471 
01472         if (!inSubBSP)
01473         {
01474                 level.spawning = qfalse;                        // any future calls to G_Spawn*() will be errors
01475         }
01476 
01477         G_PrecacheSoundsets();
01478 }

qboolean G_SpawnFloat const char *  key,
const char *  defaultString,
float *  out
 

Definition at line 25 of file g_spawn.c.

References atof(), G_SpawnString(), and qboolean.

Referenced by finish_spawning_turretG2(), G_SpawnItem(), InitMover(), SP_emplaced_gun(), SP_func_bobbing(), SP_func_breakable(), SP_func_button(), SP_func_door(), SP_func_pendulum(), SP_func_plat(), SP_func_timer(), SP_fx_runner(), SP_misc_bsp(), SP_misc_portal_camera(), SP_misc_siege_item(), SP_NPC_Vehicle(), SP_target_delay(), SP_target_screenshake(), SP_target_scriptrunner(), SP_target_speaker(), SP_worldspawn(), and turret_base_spawn_top().

00025                                                                                        {
00026         char            *s;
00027         qboolean        present;
00028 
00029         present = G_SpawnString( key, defaultString, &s );
00030         *out = atof( s );
00031         return present;
00032 }

void G_SpawnGEntityFromSpawnVars qboolean  inSubBSP  ) 
 

Definition at line 766 of file g_spawn.c.

References BG_ParseField(), BSET_SPAWN, byte, gentity_s::classname, entityShared_t::currentOrigin, fields, G_ActivateBehavior(), G_CallSpawn(), G_FreeEntity(), g_gametype, G_Spawn(), G_SpawnInt(), G_SpawnString(), gentity_t, GT_FFA, GT_MAX_GAME_TYPE, GT_SINGLE_PLAYER, GT_TEAM, vmCvar_t::integer, level, NULL, level_locals_t::numSpawnVars, entityState_s::origin, entityState_s::pos, Q_strncmp(), gentity_s::r, gentity_s::s, level_locals_t::spawnVars, strstr(), trap_ICARUS_InitEnt(), trap_ICARUS_ValidEnt(), trajectory_t::trBase, and VectorCopy.

Referenced by G_SpawnEntitiesFromString(), and vmMain().

00766                                                       {
00767         int                     i;
00768         gentity_t       *ent;
00769         char            *s, *value, *gametypeName;
00770         static char *gametypeNames[] = {"ffa", "holocron", "jedimaster", "duel", "powerduel", "single", "team", "siege", "ctf", "cty"};
00771 
00772         // get the next free entity
00773         ent = G_Spawn();
00774 
00775         for ( i = 0 ; i < level.numSpawnVars ; i++ ) {
00776                 BG_ParseField( fields, level.spawnVars[i][0], level.spawnVars[i][1], (byte *)ent );
00777         }
00778 
00779         // check for "notsingle" flag
00780         if ( g_gametype.integer == GT_SINGLE_PLAYER ) {
00781                 G_SpawnInt( "notsingle", "0", &i );
00782                 if ( i ) {
00783                         G_FreeEntity( ent );
00784                         return;
00785                 }
00786         }
00787         // check for "notteam" flag (GT_FFA, GT_DUEL, GT_SINGLE_PLAYER)
00788         if ( g_gametype.integer >= GT_TEAM ) {
00789                 G_SpawnInt( "notteam", "0", &i );
00790                 if ( i ) {
00791                         G_FreeEntity( ent );
00792                         return;
00793                 }
00794         } else {
00795                 G_SpawnInt( "notfree", "0", &i );
00796                 if ( i ) {
00797                         G_FreeEntity( ent );
00798                         return;
00799                 }
00800         }
00801 
00802         G_SpawnInt( "notta", "0", &i );
00803         if ( i ) {
00804                 G_FreeEntity( ent );
00805                 return;
00806         }
00807 
00808         if( G_SpawnString( "gametype", NULL, &value ) ) {
00809                 if( g_gametype.integer >= GT_FFA && g_gametype.integer < GT_MAX_GAME_TYPE ) {
00810                         gametypeName = gametypeNames[g_gametype.integer];
00811 
00812                         s = strstr( value, gametypeName );
00813                         if( !s ) {
00814                                 G_FreeEntity( ent );
00815                                 return;
00816                         }
00817                 }
00818         }
00819 
00820         // move editor origin to pos
00821         VectorCopy( ent->s.origin, ent->s.pos.trBase );
00822         VectorCopy( ent->s.origin, ent->r.currentOrigin );
00823 
00824         // if we didn't get a classname, don't bother spawning anything
00825         if ( !G_CallSpawn( ent ) ) {
00826                 G_FreeEntity( ent );
00827         }
00828 
00829         //Tag on the ICARUS scripting information only to valid recipients
00830         if ( trap_ICARUS_ValidEnt( ent ) )
00831         {
00832                 trap_ICARUS_InitEnt( ent );
00833 
00834                 if ( ent->classname && ent->classname[0] )
00835                 {
00836                         if ( Q_strncmp( "NPC_", ent->classname, 4 ) != 0 )
00837                         {//Not an NPC_spawner (rww - probably don't even care for MP, but whatever)
00838                                 G_ActivateBehavior( ent, BSET_SPAWN );
00839                         }
00840                 }
00841         }
00842 }

qboolean G_SpawnInt const char *  key,
const char *  defaultString,
int *  out
 

Definition at line 34 of file g_spawn.c.

References atoi(), G_SpawnString(), and qboolean.

Referenced by EnergyAmmoStationSettings(), EnergyHealthStationSettings(), EnergyShieldStationSettings(), finish_spawning_turretG2(), G_SpawnGEntityFromSpawnVars(), SP_emplaced_gun(), SP_func_bobbing(), SP_func_breakable(), SP_func_door(), SP_func_glass(), SP_func_pendulum(), SP_func_plat(), SP_func_rotating(), SP_func_static(), SP_func_usable(), SP_fx_runner(), SP_info_player_deathmatch(), SP_info_player_duel(), SP_info_player_duel1(), SP_info_player_duel2(), SP_info_player_siegeteam1(), SP_info_player_siegeteam2(), SP_info_siege_decomplete(), SP_info_siege_objective(), SP_info_siege_radaricon(), SP_light(), SP_misc_ammo_floor_unit(), SP_misc_bsp(), SP_misc_faller(), SP_misc_model_ammo_power_converter(), SP_misc_shield_floor_unit(), SP_misc_siege_item(), SP_misc_skyportal(), SP_misc_turretG2(), SP_NPC_spawner(), SP_NPC_Vehicle(), SP_target_escapetrig(), SP_target_screenshake(), SP_trigger_multiple(), SP_trigger_once(), SP_trigger_shipboundary(), and turret_base_spawn_top().

00034                                                                                    {
00035         char            *s;
00036         qboolean        present;
00037 
00038         present = G_SpawnString( key, defaultString, &s );
00039         *out = atoi( s );
00040         return present;
00041 }

qboolean G_SpawnString const char *  key,
const char *  defaultString,
char **  out
 

Definition at line 6 of file g_spawn.c.

References level, level_locals_t::numSpawnVars, Q_stricmp(), qboolean, qfalse, qtrue, level_locals_t::spawning, and level_locals_t::spawnVars.

Referenced by G_SpawnFloat(), G_SpawnGEntityFromSpawnVars(), G_SpawnInt(), G_SpawnVector(), SP_func_breakable(), SP_fx_runner(), SP_gametype_item(), SP_info_siege_objective(), SP_info_siege_radaricon(), SP_misc_bsp(), SP_misc_siege_item(), SP_misc_skyportal(), SP_misc_turret(), SP_misc_turretG2(), SP_misc_weapon_shooter(), SP_target_level_change(), SP_target_play_music(), SP_target_speaker(), SP_terrain(), SP_trigger_lightningstrike(), SP_trigger_multiple(), SP_trigger_once(), and SP_worldspawn().

00006                                                                                         {
00007         int             i;
00008 
00009         if ( !level.spawning ) {
00010                 *out = (char *)defaultString;
00011 //              G_Error( "G_SpawnString() called while not spawning" );
00012         }
00013 
00014         for ( i = 0 ; i < level.numSpawnVars ; i++ ) {
00015                 if ( !Q_stricmp( key, level.spawnVars[i][0] ) ) {
00016                         *out = level.spawnVars[i][1];
00017                         return qtrue;
00018                 }
00019         }
00020 
00021         *out = (char *)defaultString;
00022         return qfalse;
00023 }

qboolean G_SpawnVector const char *  key,
const char *  defaultString,
float *  out
 

Definition at line 43 of file g_spawn.c.

References G_SpawnString(), qboolean, and sscanf().

Referenced by InitMover(), SP_func_rotating(), SP_misc_siege_item(), and SP_misc_skyportal().

00043                                                                                         {
00044         char            *s;
00045         qboolean        present;
00046 
00047         present = G_SpawnString( key, defaultString, &s );
00048         sscanf( s, "%f %f %f", &out[0], &out[1], &out[2] );
00049         return present;
00050 }

void scriptrunner_run gentity_t self  ) 
 

Definition at line 754 of file g_target.c.

References gentity_s::activator, gentity_s::behaviorSet, BSET_USE, Com_Printf(), gentity_s::count, G_ActivateBehavior(), g_developer, gentity_t, vmCvar_t::integer, level, gentity_s::nextthink, NULL, entityState_s::number, numNewICARUSEnts, Q3_SCRIPT_DIR, gentity_s::s, gentity_s::script_targetname, gentity_s::spawnflags, gentity_s::targetname, level_locals_t::time, trap_ICARUS_InitEnt(), trap_ICARUS_IsInitialized(), trap_ICARUS_RunScript(), trap_ICARUS_ValidEnt(), gentity_s::use, va(), and gentity_s::wait.

Referenced by G_SpawnEntitiesFromString(), and target_scriptrunner_use().

00755 {
00756         /*
00757         if (self->behaviorSet[BSET_USE])
00758         {       
00759                 char    newname[MAX_FILENAME_LENGTH];
00760 
00761                 sprintf((char *) &newname, "%s/%s", Q3_SCRIPT_DIR, self->behaviorSet[BSET_USE] );
00762 
00763                 ICARUS_RunScript( self, newname );
00764         }
00765         */
00766 
00767         if ( self->count != -1 )
00768         {
00769                 if ( self->count <= 0 )
00770                 {
00771                         self->use = 0;
00772                         self->behaviorSet[BSET_USE] = NULL;
00773                         return;
00774                 }
00775                 else
00776                 {
00777                         --self->count;
00778                 }
00779         }
00780 
00781         if (self->behaviorSet[BSET_USE])
00782         {
00783                 if ( self->spawnflags & 1 )
00784                 {
00785                         if ( !self->activator )
00786                         {
00787                                 if (g_developer.integer)
00788                                 {
00789                                         Com_Printf("target_scriptrunner tried to run on invalid entity!\n");
00790                                 }
00791                                 return;
00792                         }
00793 
00794                         //if ( !self->activator->sequencer || !self->activator->taskManager )
00795                         if (!trap_ICARUS_IsInitialized(self->s.number))
00796                         {//Need to be initialized through ICARUS
00797                                 if ( !self->activator->script_targetname || !self->activator->script_targetname[0] )
00798                                 {
00799                                         //We don't have a script_targetname, so create a new one
00800                                         self->activator->script_targetname = va( "newICARUSEnt%d", numNewICARUSEnts++ );
00801                                 }
00802 
00803                                 if ( trap_ICARUS_ValidEnt( self->activator ) )
00804                                 {
00805                                         trap_ICARUS_InitEnt( self->activator );
00806                                 }
00807                                 else
00808                                 {
00809                                         if (g_developer.integer)
00810                                         {
00811                                                 Com_Printf("target_scriptrunner tried to run on invalid ICARUS activator!\n");
00812                                         }
00813                                         return;
00814                                 }
00815                         }
00816 
00817                         if (g_developer.integer)
00818                         {
00819                                 Com_Printf( "target_scriptrunner running %s on activator %s\n", self->behaviorSet[BSET_USE], self->activator->targetname );
00820                         }
00821                         trap_ICARUS_RunScript( self->activator, va( "%s/%s", Q3_SCRIPT_DIR, self->behaviorSet[BSET_USE] ) );
00822                 }
00823                 else
00824                 {
00825                         if ( g_developer.integer && self->activator )
00826                         {
00827                                 Com_Printf( "target_scriptrunner %s used by %s\n", self->targetname, self->activator->targetname );
00828                         }
00829                         G_ActivateBehavior( self, BSET_USE );
00830                 }
00831         }
00832 
00833         if ( self->wait )
00834         {
00835                 self->nextthink = level.time + self->wait;
00836         }
00837 }

qboolean SP_bsp_worldspawn void   ) 
 

Definition at line 1389 of file g_spawn.c.

References qboolean, and qtrue.

Referenced by G_SpawnEntitiesFromString().

01390 {
01391         return qtrue;
01392 }

void SP_CreateRain gentity_t ent  ) 
 

Definition at line 2535 of file g_misc.c.

References gentity_s::count, G_EffectIndex(), gentity_t, and va().

02536 { 
02537         G_EffectIndex(va("*rain init %i", ent->count));
02538 }

void SP_CreateSnow gentity_t ent  ) 
 

Definition at line 2522 of file g_misc.c.

References G_EffectIndex(), and gentity_t.

02523 { 
02524         G_EffectIndex("*snow");
02525         G_EffectIndex("*fog");
02526         G_EffectIndex("*constantwind (100 100 -100)");
02527 }

void SP_CreateSpaceDust gentity_t ent  ) 
 

Definition at line 2509 of file g_misc.c.

References gentity_s::count, G_EffectIndex(), gentity_t, and va().

02510 { 
02511         G_EffectIndex(va("*spacedust %i", ent->count));
02512         //G_EffectIndex("*constantwind ( 10 -10 0 )");
02513 }

void SP_emplaced_gun gentity_t ent  ) 
 

Definition at line 4915 of file g_weapon.c.

References trace_t::allsolid, entityState_s::angles, entityState_s::apos, BG_FindItemForWeapon(), entityShared_t::contents, CONTENTS_SOLID, gentity_s::count, entityShared_t::currentAngles, gentity_s::die, EMPLACED_CANRESPAWN, emplaced_gun_die(), EMPLACED_GUN_HEALTH, emplaced_gun_pain(), emplaced_gun_realuse(), emplaced_gun_update(), trace_t::endpos, trace_t::fraction, entityState_s::g2radius, G_ModelIndex(), G_ScaleNetHealth(), G_SetOrigin(), G_SpawnFloat(), G_SpawnInt(), gentity_s::genericValue4, gentity_s::genericValue5, gentity_t, gentity_s::health, level, MASK_SOLID, MAX_CLIENTS, gentity_s::maxHealth, entityShared_t::maxs, entityShared_t::mins, entityState_s::modelGhoul2, entityState_s::modelindex, name, gentity_s::nextthink, entityState_s::number, entityState_s::origin, entityState_s::origin2, entityState_s::owner, gentity_s::pain, entityState_s::pos, gentity_s::pos1, qtrue, gentity_s::r, RegisterItem(), gentity_s::s, entityState_s::shouldtarget, entityState_s::solid, SOLID_BBOX, gentity_s::spawnflags, gentity_s::splashDamage, gentity_s::splashRadius, trace_t::startsolid, SVF_PLAYER_USABLE, entityShared_t::svFlags, gentity_s::takedamage, gentity_s::think, level_locals_t::time, TR_STATIONARY, trap_LinkEntity(), trap_Trace(), trajectory_t::trBase, trajectory_t::trType, gentity_s::use, vec3_t, VectorCopy, VectorSet, entityState_s::weapon, and WP_EMPLACED_GUN.

04916 {
04917         const char *name = "models/map_objects/mp/turret_chair.glm";
04918         vec3_t down;
04919         trace_t tr;
04920 
04921         //make sure our assets are precached
04922         RegisterItem( BG_FindItemForWeapon(WP_EMPLACED_GUN) );
04923 
04924         ent->r.contents = CONTENTS_SOLID;
04925         ent->s.solid = SOLID_BBOX;
04926 
04927         ent->genericValue5 = 0;
04928 
04929         VectorSet( ent->r.mins, -30, -20, 8 );
04930         VectorSet( ent->r.maxs, 30, 20, 60 );
04931 
04932         VectorCopy(ent->s.origin, down);
04933 
04934         down[2] -= 1024;
04935 
04936         trap_Trace(&tr, ent->s.origin, ent->r.mins, ent->r.maxs, down, ent->s.number, MASK_SOLID);
04937 
04938         if (tr.fraction != 1 && !tr.allsolid && !tr.startsolid)
04939         {
04940                 VectorCopy(tr.endpos, ent->s.origin);
04941         }
04942 
04943         ent->spawnflags |= 4; // deadsolid
04944 
04945         ent->health = EMPLACED_GUN_HEALTH;
04946 
04947         if (ent->spawnflags & EMPLACED_CANRESPAWN)
04948         { //make it somewhat easier to kill if it can respawn
04949                 ent->health *= 0.4;
04950         }
04951 
04952         ent->maxHealth = ent->health;
04953         G_ScaleNetHealth(ent);
04954 
04955         ent->genericValue4 = 0;
04956 
04957         ent->takedamage = qtrue;
04958         ent->pain = emplaced_gun_pain;
04959         ent->die = emplaced_gun_die;
04960 
04961         // being caught in this thing when it blows would be really bad.
04962         ent->splashDamage = 80;
04963         ent->splashRadius = 128;
04964 
04965         // amount of ammo that this little poochie has
04966         G_SpawnInt( "count", "600", &ent->count );
04967 
04968         G_SpawnFloat( "constraint", "60", &ent->s.origin2[0] );
04969 
04970         ent->s.modelindex = G_ModelIndex( (char *)name );
04971         ent->s.modelGhoul2 = 1;
04972         ent->s.g2radius = 110;
04973 
04974         //so the cgame knows for sure that we're an emplaced weapon
04975         ent->s.weapon = WP_EMPLACED_GUN;
04976 
04977         G_SetOrigin( ent, ent->s.origin );
04978         
04979         // store base angles for later
04980         VectorCopy( ent->s.angles, ent->pos1 );
04981         VectorCopy( ent->s.angles, ent->r.currentAngles );
04982         VectorCopy( ent->s.angles, ent->s.apos.trBase );
04983 
04984         ent->think = emplaced_gun_update;
04985         ent->nextthink = level.time + 50;
04986 
04987         ent->use = emplaced_gun_realuse;
04988 
04989         ent->r.svFlags |= SVF_PLAYER_USABLE;
04990 
04991         ent->s.pos.trType = TR_STATIONARY;
04992 
04993         ent->s.owner = MAX_CLIENTS+1;
04994         ent->s.shouldtarget = qtrue;
04995         //ent->s.teamowner = 0;
04996 
04997         trap_LinkEntity(ent);
04998 }

void SP_func_bobbing gentity_t ent  ) 
 

Definition at line 2217 of file g_mover.c.

References entityShared_t::currentOrigin, gentity_s::damage, G_SpawnFloat(), G_SpawnInt(), gentity_t, InitMover(), gentity_s::model, entityState_s::origin, entityState_s::pos, gentity_s::r, gentity_s::s, gentity_s::spawnflags, gentity_s::speed, TR_SINE, trap_SetBrushModel(), trajectory_t::trBase, trajectory_t::trDelta, trajectory_t::trDuration, trajectory_t::trTime, trajectory_t::trType, and VectorCopy.

02217                                       {
02218         float           height;
02219         float           phase;
02220 
02221         G_SpawnFloat( "speed", "4", &ent->speed );
02222         G_SpawnFloat( "height", "32", &height );
02223         G_SpawnInt( "dmg", "2", &ent->damage );
02224         G_SpawnFloat( "phase", "0", &phase );
02225 
02226         trap_SetBrushModel( ent, ent->model );
02227         InitMover( ent );
02228 
02229         VectorCopy( ent->s.origin, ent->s.pos.trBase );
02230         VectorCopy( ent->s.origin, ent->r.currentOrigin );
02231 
02232         ent->s.pos.trDuration = ent->speed * 1000;
02233         ent->s.pos.trTime = ent->s.pos.trDuration * phase;
02234         ent->s.pos.trType = TR_SINE;
02235 
02236         // set the axis of bobbing
02237         if ( ent->spawnflags & 1 ) {
02238                 ent->s.pos.trDelta[0] = height;
02239         } else if ( ent->spawnflags & 2 ) {
02240                 ent->s.pos.trDelta[1] = height;
02241         } else {
02242                 ent->s.pos.trDelta[2] = height;
02243         }
02244 }

void SP_func_breakable gentity_t ent  ) 
 

Referenced by SP_func_rotating().

void SP_func_button gentity_t ent  ) 
 

Definition at line 1650 of file g_mover.c.

References entityState_s::angles, fabs(), G_SetMovedir(), G_SpawnFloat(), gentity_t, gentity_s::health, InitMover(), entityShared_t::maxs, entityShared_t::mins, gentity_s::model, gentity_s::movedir, entityState_s::origin, gentity_s::pos1, gentity_s::pos2, qtrue, gentity_s::r, gentity_s::s, gentity_s::speed, gentity_s::takedamage, gentity_s::touch, Touch_Button(), trap_SetBrushModel(), vec3_t, VectorCopy, VectorMA, VectorSubtract, and gentity_s::wait.

01650                                       {
01651         vec3_t          abs_movedir;
01652         float           distance;
01653         vec3_t          size;
01654         float           lip;
01655 
01656 //      ent->sound1to2 = G_SoundIndex("sound/movers/switches/butn2.wav");
01657         
01658         if ( !ent->speed ) {
01659                 ent->speed = 40;
01660         }
01661 
01662         if ( !ent->wait ) {
01663                 ent->wait = 1;
01664         }
01665         ent->wait *= 1000;
01666 
01667         // first position
01668         VectorCopy( ent->s.origin, ent->pos1 );
01669 
01670         // calculate second position
01671         trap_SetBrushModel( ent, ent->model );
01672 
01673         G_SpawnFloat( "lip", "4", &lip );
01674 
01675         G_SetMovedir( ent->s.angles, ent->movedir );
01676         abs_movedir[0] = fabs(ent->movedir[0]);
01677         abs_movedir[1] = fabs(ent->movedir[1]);
01678         abs_movedir[2] = fabs(ent->movedir[2]);
01679         VectorSubtract( ent->r.maxs, ent->r.mins, size );
01680         distance = abs_movedir[0] * size[0] + abs_movedir[1] * size[1] + abs_movedir[2] * size[2] - lip;
01681         VectorMA (ent->pos1, distance, ent->movedir, ent->pos2);
01682 
01683         if (ent->health) {
01684                 // shootable button
01685                 ent->takedamage = qtrue;
01686         } else {
01687                 // touchable button
01688                 ent->touch = Touch_Button;
01689         }
01690 
01691         InitMover( ent );
01692 }

void SP_func_door gentity_t ent  ) 
 

Definition at line 1370 of file g_mover.c.

References gentity_s::alliedTeam, entityState_s::angles, gentity_s::blocked, Blocked_Door(), entityState_s::bolt1, gentity_s::damage, gentity_s::delay, DotProduct, EF_SHADER_ANIM, entityState_s::eFlags, fabs(), FL_TEAMSLAVE, gentity_s::flags, entityState_s::frame, FRAMETIME, G_SetMovedir(), G_SpawnFloat(), G_SpawnInt(), gentity_s::genericValue14, gentity_t, InitMover(), level, entityShared_t::maxs, entityShared_t::mins, gentity_s::model, gentity_s::movedir, MOVER_FORCE_ACTIVATE, MOVER_LOCKED, MOVER_PLAYER_USE, gentity_s::nextthink, entityState_s::origin, gentity_s::pos1, gentity_s::pos2, qtrue, gentity_s::r, gentity_s::s, gentity_s::spawnflags, gentity_s::speed, gentity_s::takedamage, gentity_s::targetname, gentity_s::think, Think_MatchTeam(), Think_SpawnNewDoorTrigger(), level_locals_t::time, trap_SetBrushModel(), vec3_t, VectorCopy, VectorMA, VectorSubtract, and gentity_s::wait.

01371 {
01372         vec3_t  abs_movedir;
01373         float   distance;
01374         vec3_t  size;
01375         float   lip;
01376 
01377         G_SpawnInt("vehopen", "0", &ent->genericValue14);
01378 
01379         ent->blocked = Blocked_Door;
01380 
01381         // default speed of 400
01382         if (!ent->speed)
01383                 ent->speed = 400;
01384 
01385         // default wait of 2 seconds
01386         if (!ent->wait)
01387                 ent->wait = 2;
01388         ent->wait *= 1000;
01389 
01390         ent->delay *= 1000;
01391 
01392         // default lip of 8 units
01393         G_SpawnFloat( "lip", "8", &lip );
01394 
01395         // default damage of 2 points
01396         G_SpawnInt( "dmg", "2", &ent->damage );
01397         if ( ent->damage < 0 )
01398         {
01399                 ent->damage = 0;
01400         }
01401 
01402         G_SpawnInt( "teamallow", "0", &ent->alliedTeam );
01403 
01404         // first position at start
01405         VectorCopy( ent->s.origin, ent->pos1 );
01406 
01407         // calculate second position
01408         trap_SetBrushModel( ent, ent->model );
01409         G_SetMovedir( ent->s.angles, ent->movedir );
01410         abs_movedir[0] = fabs( ent->movedir[0] );
01411         abs_movedir[1] = fabs( ent->movedir[1] );
01412         abs_movedir[2] = fabs( ent->movedir[2] );
01413         VectorSubtract( ent->r.maxs, ent->r.mins, size );
01414         distance = DotProduct( abs_movedir, size ) - lip;
01415         VectorMA( ent->pos1, distance, ent->movedir, ent->pos2 );
01416 
01417         // if "start_open", reverse position 1 and 2
01418         if ( ent->spawnflags & 1 ) 
01419         {
01420                 vec3_t  temp;
01421 
01422                 VectorCopy( ent->pos2, temp );
01423                 VectorCopy( ent->s.origin, ent->pos2 );
01424                 VectorCopy( temp, ent->pos1 );
01425         }
01426 
01427         if ( ent->spawnflags & MOVER_LOCKED )
01428         {//a locked door, set up as locked until used directly
01429                 ent->s.eFlags |= EF_SHADER_ANIM;//use frame-controlled shader anim
01430                 ent->s.frame = 0;//first stage of anim
01431         }
01432         InitMover( ent );
01433 
01434         ent->nextthink = level.time + FRAMETIME;
01435 
01436         if ( !(ent->flags&FL_TEAMSLAVE) ) 
01437         {
01438                 int health;
01439 
01440                 G_SpawnInt( "health", "0", &health );
01441                 
01442                 if ( health ) 
01443                 {
01444                         ent->takedamage = qtrue;
01445                 }
01446                 
01447                 if ( !(ent->spawnflags&MOVER_LOCKED) && (ent->targetname || health || ent->spawnflags & MOVER_PLAYER_USE || ent->spawnflags & MOVER_FORCE_ACTIVATE) )
01448                 {
01449                         // non touch/shoot doors
01450                         ent->think = Think_MatchTeam;
01451 
01452                         if (ent->spawnflags & MOVER_FORCE_ACTIVATE)
01453                         { //so we know it's push/pullable on the client
01454                                 ent->s.bolt1 = 1;
01455                         }
01456                 } 
01457                 else 
01458                 {//locked doors still spawn a trigger
01459                         ent->think = Think_SpawnNewDoorTrigger;
01460                 }
01461         }
01462 }

void SP_func_glass gentity_t ent  ) 
 

Definition at line 2943 of file g_mover.c.

References entityShared_t::currentOrigin, gentity_s::die, G_SpawnInt(), gentity_s::genericValue1, gentity_s::genericValue3, gentity_s::genericValue4, gentity_t, GlassDie(), GlassPain(), GlassUse(), gentity_s::health, InitMover(), gentity_s::model, MOVER_POS1, gentity_s::moverState, entityState_s::origin, gentity_s::pain, entityState_s::pos, qfalse, qtrue, gentity_s::r, gentity_s::s, gentity_s::spawnflags, SVF_GLASS_BRUSH, entityShared_t::svFlags, gentity_s::takedamage, trap_SetBrushModel(), trajectory_t::trBase, gentity_s::use, and VectorCopy.

02943                                      {
02944         trap_SetBrushModel( ent, ent->model );
02945         InitMover( ent );
02946 
02947         ent->r.svFlags = SVF_GLASS_BRUSH;
02948 
02949         VectorCopy( ent->s.origin, ent->s.pos.trBase );
02950         VectorCopy( ent->s.origin, ent->r.currentOrigin );
02951         if (!ent->health)
02952         {
02953                 ent->health = 1;
02954         }
02955 
02956         G_SpawnInt("maxshards", "0", &ent->genericValue3);
02957 
02958         ent->genericValue1 = 0;
02959 
02960         ent->genericValue4 = 1;
02961 
02962         ent->moverState = MOVER_POS1;
02963 
02964         if (ent->spawnflags & 1)
02965         {
02966                 ent->takedamage = qfalse;
02967         }
02968         else
02969         {
02970                 ent->takedamage = qtrue;
02971         }
02972 
02973         ent->die = GlassDie;
02974         ent->use = GlassUse;
02975         ent->pain = GlassPain;
02976 }

void SP_func_pendulum gentity_t ent  ) 
 

Definition at line 2266 of file g_mover.c.

References entityState_s::angles, entityState_s::apos, entityShared_t::currentOrigin, gentity_s::damage, fabs(), g_gravity, G_SpawnFloat(), G_SpawnInt(), gentity_t, InitMover(), M_PI, entityShared_t::mins, gentity_s::model, entityState_s::origin, entityState_s::pos, gentity_s::r, gentity_s::s, sqrt(), TR_SINE, trap_SetBrushModel(), trajectory_t::trBase, trajectory_t::trDelta, trajectory_t::trDuration, trajectory_t::trTime, trajectory_t::trType, vmCvar_t::value, and VectorCopy.

02266                                       {
02267         float           freq;
02268         float           length;
02269         float           phase;
02270         float           speed;
02271 
02272         G_SpawnFloat( "speed", "30", &speed );
02273         G_SpawnInt( "dmg", "2", &ent->damage );
02274         G_SpawnFloat( "phase", "0", &phase );
02275 
02276         trap_SetBrushModel( ent, ent->model );
02277 
02278         // find pendulum length
02279         length = fabs( ent->r.mins[2] );
02280         if ( length < 8 ) {
02281                 length = 8;
02282         }
02283 
02284         freq = 1 / ( M_PI * 2 ) * sqrt( g_gravity.value / ( 3 * length ) );
02285 
02286         ent->s.pos.trDuration = ( 1000 / freq );
02287 
02288         InitMover( ent );
02289 
02290         VectorCopy( ent->s.origin, ent->s.pos.trBase );
02291         VectorCopy( ent->s.origin, ent->r.currentOrigin );
02292 
02293         VectorCopy( ent->s.angles, ent->s.apos.trBase );
02294 
02295         ent->s.apos.trDuration = 1000 / freq;
02296         ent->s.apos.trTime = ent->s.apos.trDuration * phase;
02297         ent->s.apos.trType = TR_SINE;
02298         ent->s.apos.trDelta[2] = speed;
02299 }

void SP_func_plat gentity_t ent  ) 
 

Definition at line 1566 of file g_mover.c.

References entityState_s::angles, gentity_s::blocked, Blocked_Door(), gentity_s::damage, G_SpawnFloat(), G_SpawnInt(), gentity_t, InitMover(), entityShared_t::maxs, entityShared_t::mins, gentity_s::model, entityState_s::origin, gentity_s::parent, gentity_s::pos1, gentity_s::pos2, gentity_s::r, gentity_s::s, SpawnPlatTrigger(), gentity_s::speed, gentity_s::targetname, gentity_s::touch, Touch_Plat(), trap_SetBrushModel(), VectorClear, VectorCopy, and gentity_s::wait.

01566                                    {
01567         float           lip, height;
01568 
01569 //      ent->sound1to2 = ent->sound2to1 = G_SoundIndex("sound/movers/plats/pt1_strt.wav");
01570 //      ent->soundPos1 = ent->soundPos2 = G_SoundIndex("sound/movers/plats/pt1_end.wav");
01571 
01572         VectorClear (ent->s.angles);
01573 
01574         G_SpawnFloat( "speed", "200", &ent->speed );
01575         G_SpawnInt( "dmg", "2", &ent->damage );
01576         G_SpawnFloat( "wait", "1", &ent->wait );
01577         G_SpawnFloat( "lip", "8", &lip );
01578 
01579         ent->wait = 1000;
01580 
01581         // create second position
01582         trap_SetBrushModel( ent, ent->model );
01583 
01584         if ( !G_SpawnFloat( "height", "0", &height ) ) {
01585                 height = (ent->r.maxs[2] - ent->r.mins[2]) - lip;
01586         }
01587 
01588         // pos1 is the rest (bottom) position, pos2 is the top
01589         VectorCopy( ent->s.origin, ent->pos2 );
01590         VectorCopy( ent->pos2, ent->pos1 );
01591         ent->pos1[2] -= height;
01592 
01593         InitMover( ent );
01594 
01595         // touch function keeps the plat from returning while
01596         // a live player is standing on it
01597         ent->touch = Touch_Plat;
01598 
01599         ent->blocked = Blocked_Door;
01600 
01601         ent->parent = ent;      // so it can be treated as a door
01602 
01603         // spawn the trigger if one hasn't been custom made
01604         if ( !ent->targetname ) {
01605                 SpawnPlatTrigger(ent);
01606         }
01607 }

void SP_func_rotating gentity_t ent  ) 
 

Definition at line 2121 of file g_mover.c.

02121                                        {
02122         vec3_t spinangles;
02123         if ( ent->health )
02124         {
02125                 int sav_spawnflags = ent->spawnflags;
02126                 ent->spawnflags = 0;
02127                 SP_func_breakable( ent );
02128                 ent->spawnflags = sav_spawnflags;
02129         }
02130         else
02131         {
02132                 trap_SetBrushModel( ent, ent->model );
02133                 InitMover( ent );
02134 
02135                 VectorCopy( ent->s.origin, ent->s.pos.trBase );
02136                 VectorCopy( ent->s.pos.trBase, ent->r.currentOrigin );
02137                 VectorCopy( ent->s.apos.trBase, ent->r.currentAngles );
02138 
02139                 trap_LinkEntity( ent );
02140         }
02141 
02142 #ifdef _XBOX
02143         int     tempModelScale;
02144         G_SpawnInt("model2scale", "0", &tempModelScale);
02145         ent->s.iModelScale = tempModelScale;
02146 #else
02147         G_SpawnInt("model2scale", "0", &ent->s.iModelScale);
02148 #endif
02149         if (ent->s.iModelScale < 0)
02150         {
02151                 ent->s.iModelScale = 0;
02152         }
02153         else if (ent->s.iModelScale > 1023)
02154         {
02155                 ent->s.iModelScale = 1023;
02156         }
02157 
02158         if ( G_SpawnVector( "spinangles", "0 0 0", spinangles ) )
02159         {
02160                 ent->speed = VectorLength( spinangles );
02161                 // set the axis of rotation
02162                 VectorCopy( spinangles, ent->s.apos.trDelta );
02163         }
02164         else
02165         {
02166                 if ( !ent->speed ) {
02167                         ent->speed = 100;
02168                 }
02169                 // set the axis of rotation
02170                 if ( ent->spawnflags & 4 ) {
02171                         ent->s.apos.trDelta[2] = ent->speed;
02172                 } else if ( ent->spawnflags & 8 ) {
02173                         ent->s.apos.trDelta[0] = ent->speed;
02174                 } else {
02175                         ent->s.apos.trDelta[1] = ent->speed;
02176                 }
02177         }
02178         ent->s.apos.trType = TR_LINEAR;
02179 
02180         if (!ent->damage) {
02181                 if ( (ent->spawnflags&16) )//IMPACT
02182                 {
02183                         ent->damage = 10000;
02184                 }
02185                 else
02186                 {
02187                         ent->damage = 2;
02188                 }
02189         }
02190         if ( (ent->spawnflags&2) )//RADAR
02191         {//show up on Radar at close range and play impact sound when close...?  Range based on my size
02192                 ent->s.speed = Distance( ent->r.absmin, ent->r.absmax )*0.5f;
02193                 ent->s.eFlags |= EF_RADAROBJECT;
02194         }
02195 }

void SP_func_static gentity_t ent  ) 
 

Definition at line 1946 of file g_mover.c.

References entityState_s::angles, entityState_s::bolt1, EF2_HYPERSPACE, EF_PERMANENT, EF_SHADER_ANIM, entityState_s::eFlags, entityState_s::eFlags2, entityState_s::frame, func_static_use(), G_SetAngles(), G_SetOrigin(), G_SpawnInt(), gentity_t, entityState_s::iModelScale, InitMover(), level, level_locals_t::mBSPInstanceDepth, gentity_s::model, entityState_s::origin, gentity_s::pos1, gentity_s::pos2, gentity_s::r, gentity_s::reached, gentity_s::s, gentity_s::spawnflags, SVF_BROADCAST, entityShared_t::svFlags, trap_LinkEntity(), trap_SetBrushModel(), gentity_s::use, and VectorCopy.

01947 {
01948         int             test;
01949         trap_SetBrushModel( ent, ent->model );
01950 
01951         VectorCopy( ent->s.origin, ent->pos1 );
01952         VectorCopy( ent->s.origin, ent->pos2 );
01953 
01954         InitMover( ent );
01955 
01956         ent->use = func_static_use;
01957         ent->reached = 0;
01958 
01959         G_SetOrigin( ent, ent->s.origin );
01960         G_SetAngles( ent, ent->s.angles );
01961 
01962         if( ent->spawnflags & 2048 )
01963         {                                                                  // yes this is very very evil, but for now (pre-alpha) it's a solution
01964                 ent->r.svFlags |= SVF_BROADCAST; // I need to rotate something that is huge and it's touching too many area portals...
01965         }
01966 
01967         if ( ent->spawnflags & 4/*SWITCH_SHADER*/ )
01968         {
01969                 ent->s.eFlags |= EF_SHADER_ANIM;//use frame-controlled shader anim
01970                 ent->s.frame = 0;//first stage of anim
01971         }
01972 
01973         if ((ent->spawnflags & 1) || (ent->spawnflags & 2))
01974         { //so we know it's push/pullable on the client
01975                 ent->s.bolt1 = 1;
01976         }
01977 
01978 #ifdef _XBOX
01979         int     tempModelScale;
01980         G_SpawnInt("model2scale", "0", &tempModelScale);
01981         ent->s.iModelScale = tempModelScale;
01982 #else
01983         G_SpawnInt("model2scale", "0", &ent->s.iModelScale);
01984 #endif
01985         if (ent->s.iModelScale < 0)
01986         {
01987                 ent->s.iModelScale = 0;
01988         }
01989         else if (ent->s.iModelScale > 1023)
01990         {
01991                 ent->s.iModelScale = 1023;
01992         }
01993 
01994         G_SpawnInt( "hyperspace", "0", &test );
01995         if ( test )
01996         {
01997                 ent->r.svFlags |= SVF_BROADCAST; // I need to rotate something that is huge and it's touching too many area portals...
01998                 ent->s.eFlags2 |= EF2_HYPERSPACE;
01999         }
02000 
02001         trap_LinkEntity( ent );
02002 
02003         if (level.mBSPInstanceDepth)
02004         {       // this means that this guy will never be updated, moved, changed, etc.
02005                 ent->s.eFlags = EF_PERMANENT;
02006         }
02007 }

void SP_func_timer gentity_t self  ) 
 

Definition at line 1771 of file g_trigger.c.

References gentity_s::activator, FRAMETIME, func_timer_think(), func_timer_use(), G_Printf(), G_SpawnFloat(), gentity_t, level, gentity_s::nextthink, entityState_s::origin, gentity_s::r, gentity_s::random, gentity_s::s, gentity_s::spawnflags, SVF_NOCLIENT, entityShared_t::svFlags, gentity_s::think, level_locals_t::time, gentity_s::use, vtos(), and gentity_s::wait.

01771                                       {
01772         G_SpawnFloat( "random", "1", &self->random);
01773         G_SpawnFloat( "wait", "1", &self->wait );
01774 
01775         self->use = func_timer_use;
01776         self->think = func_timer_think;
01777 
01778         if ( self->random >= self->wait ) {
01779                 self->random = self->wait - 1;//NOTE: was - FRAMETIME, but FRAMETIME is in msec (100) and these numbers are in *seconds*!
01780                 G_Printf( "func_timer at %s has random >= wait\n", vtos( self->s.origin ) );
01781         }
01782 
01783         if ( self->spawnflags & 1 ) {
01784                 self->nextthink = level.time + FRAMETIME;
01785                 self->activator = self;
01786         }
01787 
01788         self->r.svFlags = SVF_NOCLIENT;
01789 }

void SP_func_train gentity_t ent  ) 
 

Definition at line 1887 of file g_mover.c.

References entityShared_t::absmin, entityState_s::angles, gentity_s::damage, FRAMETIME, G_FreeEntity(), G_Printf(), gentity_t, InitMover(), level, gentity_s::model, gentity_s::nextthink, gentity_s::r, gentity_s::reached, Reached_Train(), gentity_s::s, gentity_s::spawnflags, gentity_s::speed, gentity_s::target, gentity_s::think, Think_SetupTrainTargets(), level_locals_t::time, TRAIN_BLOCK_STOPS, trap_SetBrushModel(), VectorClear, and vtos().

01887                                      {
01888         VectorClear (self->s.angles);
01889 
01890         if (self->spawnflags & TRAIN_BLOCK_STOPS) {
01891                 self->damage = 0;
01892         } else {
01893                 if (!self->damage) {
01894                         self->damage = 2;
01895                 }
01896         }
01897 
01898         if ( !self->speed ) {
01899                 self->speed = 100;
01900         }
01901 
01902         if ( !self->target ) {
01903                 G_Printf ("func_train without a target at %s\n", vtos(self->r.absmin));
01904                 G_FreeEntity( self );
01905                 return;
01906         }
01907 
01908         trap_SetBrushModel( self, self->model );
01909         InitMover( self );
01910 
01911         self->reached = Reached_Train;
01912 
01913         // start trains on the second frame, to make sure their targets have had
01914         // a chance to spawn
01915         self->nextthink = level.time + FRAMETIME;
01916         self->think = Think_SetupTrainTargets;
01917 }

void SP_func_usable gentity_t ent  ) 
 

Definition at line 3126 of file g_mover.c.

References gentity_s::clipmask, entityShared_t::contents, gentity_s::count, entityShared_t::currentOrigin, gentity_s::die, EF_NODRAW, EF_SHADER_ANIM, entityState_s::eFlags, entityState_s::frame, func_usable_die(), func_usable_pain(), func_usable_use(), G_ModelIndex(), G_SpawnInt(), gentity_s::genericValue5, gentity_t, gentity_s::health, InitMover(), gentity_s::model, gentity_s::model2, entityState_s::modelindex2, entityState_s::origin, gentity_s::pain, entityState_s::pos, gentity_s::pos1, qtrue, gentity_s::r, gentity_s::s, entityState_s::solid, gentity_s::spawnflags, strstr(), SVF_NOCLIENT, entityShared_t::svFlags, gentity_s::takedamage, entityState_s::time, trap_LinkEntity(), trap_SetBrushModel(), trajectory_t::trBase, gentity_s::use, and VectorCopy.

03127 {
03128         trap_SetBrushModel( self, self->model );
03129         InitMover( self );
03130         VectorCopy( self->s.origin, self->s.pos.trBase );
03131         VectorCopy( self->s.origin, self->r.currentOrigin );
03132         VectorCopy( self->s.origin, self->pos1 );
03133 
03134         G_SpawnInt("endframe", "0", &self->genericValue5);
03135 
03136         if ( self->model2 && self->model2[0] ) 
03137         {
03138                 if ( strstr( self->model2, ".glm" ))
03139                 { //for now, not supported in MP.
03140                         self->s.modelindex2 = 0;
03141                 }
03142                 else
03143                 {
03144                         self->s.modelindex2 = G_ModelIndex( self->model2 );
03145                 }
03146         }
03147 
03148         self->count = 1;
03149         if (self->spawnflags & 1)
03150         {
03151                 self->s.solid = 0;
03152                 self->r.contents = 0;
03153                 self->clipmask = 0;
03154                 self->r.svFlags |= SVF_NOCLIENT;
03155                 self->s.eFlags |= EF_NODRAW;
03156                 self->count = 0;
03157         }
03158 
03159         //FIXME: Animation?
03160         /*
03161         if (self->spawnflags & 2)
03162         {
03163                 self->s.eFlags |= EF_ANIM_ALLFAST;
03164         }
03165 
03166         if (self->spawnflags & 4)
03167         {//FIXME: need to be able to do change to something when it's done?  Or not be usable until it's done?
03168                 self->s.eFlags |= EF_ANIM_ONCE;
03169         }
03170         */
03171 
03172         self->use = func_usable_use;
03173 
03174         if ( self->health )
03175         {
03176                 self->takedamage = qtrue;
03177                 self->die = func_usable_die;
03178                 self->pain = func_usable_pain;
03179         }
03180 
03181         if ( self->genericValue5 > 0 )
03182         {
03183                 self->s.frame = 0;
03184                 self->s.eFlags |= EF_SHADER_ANIM;
03185                 self->s.time = self->genericValue5 + 1;
03186         }
03187 
03188         trap_LinkEntity (self);
03189 }

void SP_func_wall gentity_t ent  ) 
 

Definition at line 3242 of file g_mover.c.

References entityShared_t::contents, entityShared_t::currentOrigin, EF_NODRAW, entityState_s::eFlags, FUNC_WALL_OFF, gentity_t, InitMover(), gentity_s::model, entityState_s::origin, entityState_s::pos, gentity_s::pos1, gentity_s::pos2, gentity_s::r, gentity_s::s, gentity_s::spawnflags, SVF_NOCLIENT, entityShared_t::svFlags, trap_LinkEntity(), trap_SetBrushModel(), trajectory_t::trBase, gentity_s::use, use_wall(), and VectorCopy.

03243 {
03244         trap_SetBrushModel( ent, ent->model );
03245 
03246         VectorCopy( ent->s.origin, ent->pos1 );
03247         VectorCopy( ent->s.origin, ent->pos2 );
03248 
03249         InitMover( ent );
03250         VectorCopy( ent->s.origin, ent->s.pos.trBase );
03251         VectorCopy( ent->s.origin, ent->r.currentOrigin );
03252 
03253         // it must be START_OFF
03254         if (ent->spawnflags & FUNC_WALL_OFF)
03255         {
03256                 ent->r.contents = 0;
03257                 ent->r.svFlags |= SVF_NOCLIENT;
03258                 ent->s.eFlags |= EF_NODRAW;
03259         }
03260 
03261         ent->use = use_wall;
03262 
03263         trap_LinkEntity (ent);
03264 
03265 }

void SP_fx_runner gentity_t ent  ) 
 

Definition at line 2456 of file g_misc.c.

References entityState_s::angles, Com_Printf(), gentity_s::delay, ET_FX, entityState_s::eType, FX_ENT_RADIUS, fx_runner_link(), FX_STATE_OFF, G_EffectIndex(), G_FreeEntity(), G_SetOrigin(), G_SpawnFloat(), G_SpawnInt(), G_SpawnString(), gentity_t, level, entityShared_t::maxs, entityShared_t::mins, entityState_s::modelindex, entityState_s::modelindex2, gentity_s::nextthink, entityState_s::origin, gentity_s::r, gentity_s::random, gentity_s::s, S_COLOR_RED, entityState_s::speed, gentity_s::splashDamage, gentity_s::splashRadius, gentity_s::targetname, gentity_s::think, level_locals_t::time, entityState_s::time, trap_LinkEntity(), VectorScale, VectorSet, and vtos().

02457 {
02458         char *fxFile;
02459 
02460         G_SpawnString( "fxFile", "", &fxFile );
02461         // Get our defaults
02462         G_SpawnInt( "delay", "200", &ent->delay );
02463         G_SpawnFloat( "random", "0", &ent->random );
02464         G_SpawnInt( "splashRadius", "16", &ent->splashRadius );
02465         G_SpawnInt( "splashDamage", "5", &ent->splashDamage );
02466 
02467         if (!ent->s.angles[0] && !ent->s.angles[1] && !ent->s.angles[2])
02468         {
02469                 // didn't have angles, so give us the default of up
02470                 VectorSet( ent->s.angles, -90, 0, 0 );
02471         }
02472 
02473         if ( !fxFile || !fxFile[0] )
02474         {
02475                 Com_Printf( S_COLOR_RED"ERROR: fx_runner %s at %s has no fxFile specified\n", ent->targetname, vtos(ent->s.origin) );
02476                 G_FreeEntity( ent );
02477                 return;
02478         }
02479 
02480         // Try and associate an effect file, unfortunately we won't know if this worked or not 
02481         //      until the CGAME trys to register it...
02482         ent->s.modelindex = G_EffectIndex( fxFile );
02483 
02484         // important info transmitted
02485         ent->s.eType = ET_FX;
02486         ent->s.speed = ent->delay;
02487         ent->s.time = ent->random;
02488         ent->s.modelindex2 = FX_STATE_OFF;
02489 
02490         // Give us a bit of time to spawn in the other entities, since we may have to target one of 'em
02491         ent->think = fx_runner_link; 
02492         ent->nextthink = level.time + 400;
02493 
02494         // Save our position and link us up!
02495         G_SetOrigin( ent, ent->s.origin );
02496 
02497         VectorSet( ent->r.maxs, FX_ENT_RADIUS, FX_ENT_RADIUS, FX_ENT_RADIUS );
02498         VectorScale( ent->r.maxs, -1, ent->r.mins );
02499 
02500         trap_LinkEntity( ent );
02501 }

void SP_gametype_item gentity_t ent  ) 
 

Definition at line 372 of file g_spawn.c.

References BG_FindItem(), gitem_s::classname, gentity_s::classname, G_SetOrigin(), G_SpawnItem(), G_SpawnString(), gentity_t, gitem_t, level, level_locals_t::mTeamFilter, NULL, entityState_s::origin, Q_stricmp(), gentity_s::s, strstr(), gentity_s::targetname, TEAM_BLUE, and TEAM_RED.

00373 {
00374         gitem_t *item = NULL;
00375         char *value;
00376         int team = -1;
00377 
00378         G_SpawnString("teamfilter", "", &value);
00379 
00380         G_SetOrigin( ent, ent->s.origin );
00381 
00382         // If a team filter is set then override any team settings for the spawns
00383         if ( level.mTeamFilter[0] )
00384         {
00385                 if ( Q_stricmp ( level.mTeamFilter, "red") == 0 )
00386                 {
00387                         team = TEAM_RED;
00388                 }
00389                 else if ( Q_stricmp ( level.mTeamFilter, "blue") == 0 )
00390                 {
00391                         team = TEAM_BLUE;
00392                 }
00393         }
00394 
00395         if (ent->targetname && ent->targetname[0])
00396         {
00397                 if (team != -1)
00398                 {
00399                         if (strstr(ent->targetname, "flag"))
00400                         {
00401                                 if (team == TEAM_RED)
00402                                 {
00403                                         item = BG_FindItem("team_CTF_redflag");
00404                                 }
00405                                 else
00406                                 { //blue
00407                                         item = BG_FindItem("team_CTF_blueflag");
00408                                 }
00409                         }
00410                 }
00411                 else if (strstr(ent->targetname, "red_flag"))
00412                 {
00413                         item = BG_FindItem("team_CTF_redflag");
00414                 }
00415                 else if (strstr(ent->targetname, "blue_flag"))
00416                 {
00417                         item = BG_FindItem("team_CTF_blueflag");
00418                 }
00419                 else
00420                 {
00421                         item = NULL;
00422                 }
00423 
00424                 if (item)
00425                 {
00426                         ent->targetname = NULL;
00427                         ent->classname = item->classname;
00428                         G_SpawnItem( ent, item );
00429                 }
00430         }
00431 }

void SP_info_camp gentity_t self  ) 
 

Definition at line 25 of file g_misc.c.

References G_SetOrigin(), gentity_t, entityState_s::origin, and gentity_s::s.

00025                                      {
00026         G_SetOrigin( self, self->s.origin );
00027 }

void SP_info_firstplace gentity_t ent  ) 
 

void SP_info_jedimaster_start gentity_t ent  ) 
 

Definition at line 476 of file g_client.c.

References gentity_s::bounceCount, gentity_s::clipmask, entityShared_t::contents, CONTENTS_TRIGGER, gentity_s::enemy, ET_MISSILE, entityState_s::eType, FL_BOUNCE_HALF, gentity_s::flags, entityState_s::g2radius, G_FreeEntity(), g_gametype, G_ModelIndex(), gentity_t, gJMSaberEnt, GT_JEDIMASTER, vmCvar_t::integer, gentity_s::isSaberEntity, JMSaberThink(), JMSaberTouch(), level, MASK_SOLID, entityShared_t::maxs, entityShared_t::mins, entityState_s::modelGhoul2, entityState_s::modelindex, gentity_s::nextthink, NULL, entityState_s::origin2, gentity_s::physicsObject, entityState_s::pos, qtrue, gentity_s::r, gentity_s::s, gentity_s::think, level_locals_t::time, gentity_s::touch, TR_GRAVITY, trap_LinkEntity(), trajectory_t::trBase, trajectory_t::trTime, trajectory_t::trType, VectorCopy, VectorSet, entityState_s::weapon, and WP_SABER.

00477 {
00478         if (g_gametype.integer != GT_JEDIMASTER)
00479         {
00480                 gJMSaberEnt = NULL;
00481                 G_FreeEntity(ent);
00482                 return;
00483         }
00484 
00485         ent->enemy = NULL;
00486 
00487         ent->flags = FL_BOUNCE_HALF;
00488 
00489         ent->s.modelindex = G_ModelIndex("models/weapons2/saber/saber_w.glm");
00490         ent->s.modelGhoul2 = 1;
00491         ent->s.g2radius = 20;
00492         //ent->s.eType = ET_GENERAL;
00493         ent->s.eType = ET_MISSILE;
00494         ent->s.weapon = WP_SABER;
00495         ent->s.pos.trType = TR_GRAVITY;
00496         ent->s.pos.trTime = level.time;
00497         VectorSet( ent->r.maxs, 3, 3, 3 );
00498         VectorSet( ent->r.mins, -3, -3, -3 );
00499         ent->r.contents = CONTENTS_TRIGGER;
00500         ent->clipmask = MASK_SOLID;
00501 
00502         ent->isSaberEntity = qtrue;
00503 
00504         ent->bounceCount = -5;
00505 
00506         ent->physicsObject = qtrue;
00507 
00508         VectorCopy(ent->s.pos.trBase, ent->s.origin2); //remember the spawn spot
00509 
00510         ent->touch = JMSaberTouch;
00511 
00512         trap_LinkEntity(ent);
00513 
00514         ent->think = JMSaberThink;
00515         ent->nextthink = level.time + 50;
00516 }

void SP_info_notnull gentity_t self  ) 
 

Definition at line 42 of file g_misc.c.

References G_SetOrigin(), gentity_t, entityState_s::origin, and gentity_s::s.

00042                                        {
00043         G_SetOrigin( self, self->s.origin );
00044 }

void SP_info_null gentity_t self  ) 
 

Definition at line 33 of file g_misc.c.

References G_FreeEntity(), and gentity_t.

00033                                      {
00034         G_FreeEntity( self );
00035 }

void SP_info_player_deathmatch gentity_t ent  ) 
 

Definition at line 88 of file g_client.c.

References FL_NO_BOTS, FL_NO_HUMANS, gentity_s::flags, G_SpawnInt(), and gentity_t.

Referenced by SP_info_player_siegeteam1(), SP_info_player_siegeteam2(), SP_info_player_start(), SP_info_player_start_blue(), and SP_info_player_start_red().

00088                                                  {
00089         int             i;
00090 
00091         G_SpawnInt( "nobots", "0", &i);
00092         if ( i ) {
00093                 ent->flags |= FL_NO_BOTS;
00094         }
00095         G_SpawnInt( "nohumans", "0", &i );
00096         if ( i ) {
00097                 ent->flags |= FL_NO_HUMANS;
00098         }
00099 }

void SP_info_player_duel gentity_t ent  ) 
 

Definition at line 27 of file g_client.c.

References FL_NO_BOTS, FL_NO_HUMANS, gentity_s::flags, G_SpawnInt(), and gentity_t.

00028 {
00029         int             i;
00030 
00031         G_SpawnInt( "nobots", "0", &i);
00032         if ( i ) {
00033                 ent->flags |= FL_NO_BOTS;
00034         }
00035         G_SpawnInt( "nohumans", "0", &i );
00036         if ( i ) {
00037                 ent->flags |= FL_NO_HUMANS;
00038         }
00039 }

void SP_info_player_duel1 gentity_t ent  ) 
 

Definition at line 47 of file g_client.c.

References FL_NO_BOTS, FL_NO_HUMANS, gentity_s::flags, G_SpawnInt(), and gentity_t.

00048 {
00049         int             i;
00050 
00051         G_SpawnInt( "nobots", "0", &i);
00052         if ( i ) {
00053                 ent->flags |= FL_NO_BOTS;
00054         }
00055         G_SpawnInt( "nohumans", "0", &i );
00056         if ( i ) {
00057                 ent->flags |= FL_NO_HUMANS;
00058         }
00059 }

void SP_info_player_duel2 gentity_t ent  ) 
 

Definition at line 67 of file g_client.c.

References FL_NO_BOTS, FL_NO_HUMANS, gentity_s::flags, G_SpawnInt(), and gentity_t.

00068 {
00069         int             i;
00070 
00071         G_SpawnInt( "nobots", "0", &i);
00072         if ( i ) {
00073                 ent->flags |= FL_NO_BOTS;
00074         }
00075         G_SpawnInt( "nohumans", "0", &i );
00076         if ( i ) {
00077                 ent->flags |= FL_NO_HUMANS;
00078         }
00079 }

void SP_info_player_intermission gentity_t ent  ) 
 

Definition at line 230 of file g_client.c.

References gentity_t.

00230                                                    {
00231 
00232 }

void SP_info_player_intermission_blue gentity_t ent  ) 
 

Definition at line 252 of file g_client.c.

References gentity_t.

00252                                                         {
00253 
00254 }

void SP_info_player_intermission_red gentity_t ent  ) 
 

Definition at line 241 of file g_client.c.

References gentity_t.

00241                                                        {
00242 
00243 }

void SP_info_player_siegeteam1 gentity_t ent  ) 
 

Definition at line 164 of file g_client.c.

References gentity_s::classname, g_gametype, G_SpawnInt(), gentity_s::genericValue1, gentity_t, GT_SIEGE, vmCvar_t::integer, SiegePointUse(), SP_info_player_deathmatch(), and gentity_s::use.

00164                                                {
00165         int soff = 0;
00166 
00167         if (g_gametype.integer != GT_SIEGE)
00168         { //turn into a DM spawn if not in siege game mode
00169                 ent->classname = "info_player_deathmatch";
00170                 SP_info_player_deathmatch( ent );
00171 
00172                 return;
00173         }
00174 
00175         G_SpawnInt("startoff", "0", &soff);
00176 
00177         if (soff)
00178         { //start disabled
00179                 ent->genericValue1 = 0;
00180         }
00181         else
00182         {
00183                 ent->genericValue1 = 1;
00184         }
00185 
00186         ent->use = SiegePointUse;
00187 }

void SP_info_player_siegeteam2 gentity_t ent  ) 
 

Definition at line 200 of file g_client.c.

References gentity_s::classname, g_gametype, G_SpawnInt(), gentity_s::genericValue1, gentity_t, GT_SIEGE, vmCvar_t::integer, SiegePointUse(), SP_info_player_deathmatch(), and gentity_s::use.

00200                                                {
00201         int soff = 0;
00202 
00203         if (g_gametype.integer != GT_SIEGE)
00204         { //turn into a DM spawn if not in siege game mode
00205                 ent->classname = "info_player_deathmatch";
00206                 SP_info_player_deathmatch( ent );
00207 
00208                 return;
00209         }
00210 
00211         G_SpawnInt("startoff", "0", &soff);
00212 
00213         if (soff)
00214         { //start disabled
00215                 ent->genericValue1 = 0;
00216         }
00217         else
00218         {
00219                 ent->genericValue1 = 1;
00220         }
00221 
00222         ent->use = SiegePointUse;
00223 }

void SP_info_player_start gentity_t ent  ) 
 

Definition at line 105 of file g_client.c.

References gentity_s::classname, gentity_t, and SP_info_player_deathmatch().

00105                                           {
00106         ent->classname = "info_player_deathmatch";
00107         SP_info_player_deathmatch( ent );
00108 }

void SP_info_player_start_blue gentity_t ent  ) 
 

Definition at line 136 of file g_client.c.

References gentity_t, and SP_info_player_deathmatch().

00136                                                {
00137         SP_info_player_deathmatch( ent );
00138 }

void SP_info_player_start_red gentity_t ent  ) 
 

Definition at line 121 of file g_client.c.

References gentity_t, and SP_info_player_deathmatch().

00121                                               {
00122         SP_info_player_deathmatch( ent );
00123 }

void SP_info_podium gentity_t ent  ) 
 

void SP_info_secondplace gentity_t ent  ) 
 

void SP_info_siege_decomplete gentity_t ent  ) 
 

Definition at line 1297 of file g_saga.c.

References decompTriggerUse(), G_FreeEntity(), g_gametype, G_Printf(), G_SpawnInt(), gentity_t, GT_SIEGE, vmCvar_t::integer, gentity_s::objective, gentity_s::side, siege_valid, and gentity_s::use.

01298 {
01299         if (!siege_valid || g_gametype.integer != GT_SIEGE)
01300         {
01301                 G_FreeEntity(ent);
01302                 return;
01303         }
01304 
01305         ent->use = decompTriggerUse;
01306         G_SpawnInt( "objective", "0", &ent->objective);
01307         G_SpawnInt( "side", "0", &ent->side);
01308 
01309         if (!ent->objective || !ent->side)
01310         { //j00 fux0red something up
01311                 G_FreeEntity(ent);
01312                 G_Printf("ERROR: info_siege_objective_decomplete without an objective or side value\n");
01313                 return;
01314         }
01315 }

void SP_info_siege_objective gentity_t ent  ) 
 

Definition at line 1137 of file g_saga.c.

References entityState_s::brokenLimbs, EF_RADAROBJECT, entityState_s::eFlags, entityState_s::frame, G_FreeEntity(), g_gametype, G_IconIndex(), G_Printf(), G_SpawnInt(), G_SpawnString(), entityState_s::genericenemyindex, gentity_t, GT_SIEGE, vmCvar_t::integer, gentity_s::objective, gentity_s::r, gentity_s::s, gentity_s::side, siege_valid, SIEGEITEM_STARTOFFRADAR, siegeTriggerUse(), gentity_s::spawnflags, SVF_BROADCAST, entityShared_t::svFlags, trap_LinkEntity(), and gentity_s::use.

01138 {
01139         char* s;
01140 
01141         if (!siege_valid || g_gametype.integer != GT_SIEGE)
01142         {
01143                 G_FreeEntity(ent);
01144                 return;
01145         }
01146 
01147         ent->use = siegeTriggerUse;
01148         G_SpawnInt( "objective", "0", &ent->objective);
01149         G_SpawnInt( "side", "0", &ent->side);
01150 
01151         if (!ent->objective || !ent->side)
01152         { //j00 fux0red something up
01153                 G_FreeEntity(ent);
01154                 G_Printf("ERROR: info_siege_objective without an objective or side value\n");
01155                 return;
01156         }
01157 
01158         //Set it up to be drawn on radar
01159         if (!(ent->spawnflags & SIEGEITEM_STARTOFFRADAR))
01160         {
01161                 ent->s.eFlags |= EF_RADAROBJECT;
01162         }
01163 
01164         //All clients want to know where it is at all times for radar
01165         ent->r.svFlags |= SVF_BROADCAST;
01166 
01167         G_SpawnString( "icon", "", &s );
01168         
01169         if (s && s[0])
01170         { 
01171                 // We have an icon, so index it now.  We are reusing the genericenemyindex
01172                 // variable rather than adding a new one to the entity state.
01173                 ent->s.genericenemyindex = G_IconIndex(s);
01174         }
01175 
01176         ent->s.brokenLimbs = ent->side;
01177         ent->s.frame = ent->objective;
01178         trap_LinkEntity(ent);
01179 }

void SP_info_siege_radaricon gentity_t ent  ) 
 

Definition at line 1203 of file g_saga.c.

References Com_Error(), EF_RADAROBJECT, entityState_s::eFlags, ERR_DROP, G_FreeEntity(), g_gametype, G_IconIndex(), G_SpawnInt(), G_SpawnString(), entityState_s::genericenemyindex, gentity_t, GT_SIEGE, vmCvar_t::integer, gentity_s::r, gentity_s::s, siege_valid, SiegeIconUse(), SVF_BROADCAST, entityShared_t::svFlags, trap_LinkEntity(), and gentity_s::use.

01204 {
01205         char* s;
01206         int i;
01207 
01208         if (!siege_valid || g_gametype.integer != GT_SIEGE)
01209         {
01210                 G_FreeEntity(ent);
01211                 return;
01212         }
01213 
01214         G_SpawnInt("startoff", "0", &i);
01215 
01216         if (!i)
01217         { //start on then
01218                 ent->s.eFlags |= EF_RADAROBJECT;
01219                 ent->r.svFlags |= SVF_BROADCAST;
01220         }
01221 
01222         G_SpawnString( "icon", "", &s );
01223         if (!s || !s[0])
01224         { //that's the whole point of the entity
01225         Com_Error(ERR_DROP, "misc_siege_radaricon without an icon");
01226                 return;
01227         }
01228 
01229         ent->use = SiegeIconUse;
01230 
01231         ent->s.genericenemyindex = G_IconIndex(s);
01232 
01233         trap_LinkEntity(ent);
01234 }

void SP_info_thirdplace gentity_t ent  ) 
 

void SP_item_botroam gentity_t ent  ) 
 

Definition at line 368 of file g_spawn.c.

References gentity_t.

00369 {
00370 }

void SP_light gentity_t self  ) 
 

Definition at line 142 of file g_misc.c.

References gentity_s::alt_fire, gentity_s::bounceCount, gentity_s::count, ET_GENERAL, entityState_s::eType, gentity_s::fly_sound_debounce_time, G_FreeEntity(), G_SetOrigin(), G_SpawnInt(), gentity_t, misc_dlight_use(), entityState_s::origin, qfalse, qtrue, gentity_s::r, gentity_s::s, gentity_s::spawnflags, SVF_NOCLIENT, entityShared_t::svFlags, gentity_s::targetname, trap_LinkEntity(), and gentity_s::use.

00142                                  {
00143         if (!self->targetname )
00144         {//if i don't have a light style switch, the i go away
00145                 G_FreeEntity( self );
00146                 return;
00147         }
00148 
00149         G_SpawnInt( "style", "0", &self->count );
00150         G_SpawnInt( "switch_style", "0", &self->bounceCount );
00151         G_SpawnInt( "style_off", "0", &self->fly_sound_debounce_time );
00152         G_SetOrigin( self, self->s.origin );
00153         trap_LinkEntity( self );
00154 
00155         self->use = misc_dlight_use;
00156 
00157         self->s.eType = ET_GENERAL;
00158         self->alt_fire = qfalse;
00159         self->r.svFlags |= SVF_NOCLIENT;
00160 
00161         if ( !(self->spawnflags & 4) )
00162         {       //turn myself on now
00163                 self->alt_fire = qtrue;
00164         }
00165         misc_lightstyle_set (self);
00166 }

void SP_misc_ammo_floor_unit gentity_t ent  ) 
 

Definition at line 1515 of file g_misc.c.

References ammo_generic_power_converter_use(), entityState_s::angles, entityState_s::apos, check_recharge(), gentity_s::clipmask, entityShared_t::contents, CONTENTS_SOLID, gentity_s::count, EF_RADAROBJECT, entityState_s::eFlags, trace_t::endpos, EnergyShieldStationSettings(), trace_t::entityNum, ENTITYNUM_NONE, G_FreeEntity(), g_gametype, G_IconIndex(), G_ModelIndex(), G_Printf(), G_SetOrigin(), G_SoundIndex(), G_SpawnInt(), entityState_s::genericenemyindex, gentity_s::genericValue12, gentity_s::genericValue4, gentity_s::genericValue7, gentity_t, entityState_s::groundEntityNum, GT_SIEGE, entityState_s::health, gentity_s::health, vmCvar_t::integer, level, MASK_SOLID, entityState_s::maxhealth, entityShared_t::maxs, entityShared_t::mins, gentity_s::model, entityState_s::modelindex, gentity_s::nextthink, entityState_s::number, entityState_s::origin, entityState_s::owner, qtrue, gentity_s::r, gentity_s::s, entityState_s::shouldtarget, trace_t::startsolid, SVF_BROADCAST, SVF_PLAYER_USABLE, entityShared_t::svFlags, entityState_s::teamowner, gentity_s::think, level_locals_t::time, trap_LinkEntity(), trap_Trace(), trajectory_t::trBase, gentity_s::use, vec3_t, VectorCopy, VectorSet, and vtos().

01516 {
01517         vec3_t dest;
01518         trace_t tr;
01519 
01520         VectorSet( ent->r.mins, -16, -16, 0 );
01521         VectorSet( ent->r.maxs, 16, 16, 40 );
01522 
01523         ent->s.origin[2] += 0.1f;
01524         ent->r.maxs[2] -= 0.1f;
01525 
01526         VectorSet( dest, ent->s.origin[0], ent->s.origin[1], ent->s.origin[2] - 4096 );
01527         trap_Trace( &tr, ent->s.origin, ent->r.mins, ent->r.maxs, dest, ent->s.number, MASK_SOLID );
01528         if ( tr.startsolid )
01529         {
01530                 G_Printf ("SP_misc_ammo_floor_unit: misc_ammo_floor_unit startsolid at %s\n", vtos(ent->s.origin));
01531                 G_FreeEntity( ent );
01532                 return;
01533         }
01534 
01535         //add the 0.1 back after the trace
01536         ent->r.maxs[2] += 0.1f;
01537 
01538         // allow to ride movers
01539         ent->s.groundEntityNum = tr.entityNum;
01540 
01541         G_SetOrigin( ent, tr.endpos );
01542 
01543         if (!ent->health)
01544         {
01545                 ent->health = 60;
01546         }
01547 
01548         if (!ent->model || !ent->model[0])
01549         {
01550                 ent->model = "/models/items/a_pwr_converter.md3";
01551         }
01552 
01553         ent->s.modelindex = G_ModelIndex( ent->model );
01554 
01555         ent->s.eFlags = 0;
01556         ent->r.svFlags |= SVF_PLAYER_USABLE;
01557         ent->r.contents = CONTENTS_SOLID;
01558         ent->clipmask = MASK_SOLID;
01559 
01560         EnergyShieldStationSettings(ent);
01561 
01562         ent->genericValue4 = ent->count; //initial value
01563         ent->think = check_recharge;
01564 
01565         G_SpawnInt("nodrain", "0", &ent->genericValue12);
01566 
01567         if (!ent->genericValue12)
01568         {
01569                 ent->s.maxhealth = ent->s.health = ent->count;
01570         }
01571         ent->s.shouldtarget = qtrue;
01572         ent->s.teamowner = 0;
01573         ent->s.owner = ENTITYNUM_NONE;
01574 
01575         ent->nextthink = level.time + 200;// + STATION_RECHARGE_TIME;
01576 
01577         ent->use = ammo_generic_power_converter_use;
01578 
01579         VectorCopy( ent->s.angles, ent->s.apos.trBase );
01580         trap_LinkEntity (ent);
01581 
01582         G_SoundIndex("sound/interface/ammocon_run");
01583         ent->genericValue7 = G_SoundIndex("sound/interface/ammocon_done");
01584         G_SoundIndex("sound/interface/ammocon_empty");
01585 
01586         if (g_gametype.integer == GT_SIEGE)
01587         { //show on radar from everywhere
01588                 ent->r.svFlags |= SVF_BROADCAST;
01589                 ent->s.eFlags |= EF_RADAROBJECT;
01590                 ent->s.genericenemyindex = G_IconIndex("gfx/mp/siegeicons/desert/weapon_recharge");
01591         }
01592 }

void SP_misc_bsp gentity_t ent  ) 
 

Definition at line 390 of file g_misc.c.

References entityState_s::angles, entityState_s::apos, Com_sprintf(), entityShared_t::currentAngles, entityShared_t::currentOrigin, EF_PERMANENT, entityState_s::eFlags, ET_MOVER, entityState_s::eType, G_BSPIndex(), G_SpawnEntitiesFromString(), G_SpawnFloat(), G_SpawnInt(), G_SpawnString(), gentity_t, level, MAX_QPATH, level_locals_t::mBSPInstanceDepth, level_locals_t::mNumBSPInstances, entityState_s::modelindex, level_locals_t::mOriginAdjust, level_locals_t::mRotationAdjust, level_locals_t::mTargetAdjust, level_locals_t::mTeamFilter, entityState_s::origin, entityState_s::pos, qtrue, gentity_s::r, gentity_s::s, strcpy(), entityState_s::time, entityState_s::time2, trap_LinkEntity(), trap_SetActiveSubBSP(), trap_SetBrushModel(), trajectory_t::trBase, and VectorCopy.

00391 {
00392         char    temp[MAX_QPATH];
00393         char    *out;
00394         float   newAngle;
00395         int             tempint;
00396 
00397         G_SpawnFloat( "angle", "0", &newAngle );
00398         if (newAngle != 0.0)
00399         {
00400                 ent->s.angles[1] = newAngle;
00401         }
00402         // don't support rotation any other way
00403         ent->s.angles[0] = 0.0;
00404         ent->s.angles[2] = 0.0;
00405         
00406         G_SpawnString("bspmodel", "", &out);
00407 
00408         ent->s.eFlags = EF_PERMANENT;
00409 
00410         // Mainly for debugging
00411         G_SpawnInt( "spacing", "0", &tempint);
00412         ent->s.time2 = tempint;
00413         G_SpawnInt( "flatten", "0", &tempint);
00414         ent->s.time = tempint;
00415 
00416         Com_sprintf(temp, MAX_QPATH, "#%s", out);
00417         trap_SetBrushModel( ent, temp );  // SV_SetBrushModel -- sets mins and maxs
00418         G_BSPIndex(temp);
00419 
00420         level.mNumBSPInstances++;
00421         Com_sprintf(temp, MAX_QPATH, "%d-", level.mNumBSPInstances);
00422         VectorCopy(ent->s.origin, level.mOriginAdjust);
00423         level.mRotationAdjust = ent->s.angles[1];
00424         level.mTargetAdjust = temp;
00425         //level.hasBspInstances = qtrue; //rww - also not referenced anywhere.
00426         level.mBSPInstanceDepth++;
00427         /*
00428         G_SpawnString("filter", "", &out);
00429         strcpy(level.mFilter, out);
00430         */
00431         G_SpawnString("teamfilter", "", &out);
00432         strcpy(level.mTeamFilter, out);
00433 
00434         VectorCopy( ent->s.origin, ent->s.pos.trBase );
00435         VectorCopy( ent->s.origin, ent->r.currentOrigin );
00436         VectorCopy( ent->s.angles, ent->s.apos.trBase );
00437         VectorCopy( ent->s.angles, ent->r.currentAngles );
00438 
00439         ent->s.eType = ET_MOVER;
00440 
00441         trap_LinkEntity (ent);
00442 
00443         trap_SetActiveSubBSP(ent->s.modelindex);
00444         G_SpawnEntitiesFromString(qtrue);
00445         trap_SetActiveSubBSP(-1);
00446 
00447         level.mBSPInstanceDepth--;
00448         //level.mFilter[0] = level.mTeamFilter[0] = 0;
00449         level.mTeamFilter[0] = 0;
00450 
00451         /*
00452         if ( g_debugRMG.integer )
00453         {
00454                 G_SpawnDebugCylinder ( ent->s.origin, ent->s.time2, &g_entities[0], 2000, COLOR_WHITE );
00455 
00456                 if ( ent->s.time )
00457                 {
00458                         G_SpawnDebugCylinder ( ent->s.origin, ent->s.time, &g_entities[0], 2000, COLOR_RED );
00459                 }
00460         }
00461         */
00462 }

void SP_misc_faller gentity_t ent  ) 
 

Definition at line 2844 of file g_misc.c.

References G_ModelIndex(), G_SoundIndex(), G_SpawnInt(), gentity_s::genericValue1, gentity_s::genericValue2, gentity_t, level, misc_faller_create(), misc_faller_think(), gentity_s::nextthink, Q_irand(), gentity_s::targetname, gentity_s::think, level_locals_t::time, and gentity_s::use.

02845 {
02846         G_ModelIndex("models/players/stormtrooper/model.glm");
02847         G_SoundIndex("sound/chars/stofficer1/misc/pain25");
02848         G_SoundIndex("sound/chars/stofficer1/misc/pain50");
02849         G_SoundIndex("sound/chars/stofficer1/misc/pain75");
02850         G_SoundIndex("sound/chars/stofficer1/misc/falling1");
02851         G_SoundIndex("sound/player/fallsplat");
02852 
02853         G_SpawnInt("interval", "500", &ent->genericValue1);
02854         G_SpawnInt("fudgefactor", "0", &ent->genericValue2);
02855 
02856         if (!ent->targetname || !ent->targetname[0])
02857         {
02858                 ent->think = misc_faller_think;
02859                 ent->nextthink = level.time + ent->genericValue1 + Q_irand(0, ent->genericValue2);
02860         }
02861         else
02862         {
02863                 ent->use = misc_faller_create;
02864         }
02865 }

void SP_misc_G2model gentity_t ent  ) 
 

Definition at line 285 of file g_misc.c.

References entityState_s::angles, entityState_s::apos, BONE_ANIM_OVERRIDE_LOOP, G_FreeEntity(), G_ModelIndex(), G_SetOrigin(), gentity_t, level, entityState_s::origin, gentity_s::s, level_locals_t::time, trap_G2API_InitGhoul2Model(), trap_G2API_SetBoneAnim(), trap_LinkEntity(), trajectory_t::trBase, and VectorCopy.

00285                                        {
00286 
00287 #if 0
00288         char name1[200] = "models/players/kyle/modelmp.glm";
00289         trap_G2API_InitGhoul2Model(&ent->s, name1, G_ModelIndex( name1 ), 0, 0, 0, 0);
00290         trap_G2API_SetBoneAnim(ent->s.ghoul2, 0, "model_root", 0, 12, BONE_ANIM_OVERRIDE_LOOP, 1.0f, level.time, -1, -1);
00291         ent->s.radius = 150;
00292 //      VectorSet (ent->r.mins, -16, -16, -16);
00293 //      VectorSet (ent->r.maxs, 16, 16, 16);
00294         trap_LinkEntity (ent);
00295 
00296         G_SetOrigin( ent, ent->s.origin );
00297         VectorCopy( ent->s.angles, ent->s.apos.trBase );
00298 #else
00299         G_FreeEntity( ent );
00300 #endif
00301 }

void SP_misc_holocron gentity_t ent  ) 
 

Definition at line 993 of file g_misc.c.

References gentity_s::clipmask, entityShared_t::contents, CONTENTS_TRIGGER, gentity_s::count, trace_t::endpos, gentity_s::enemy, ET_HOLOCRON, entityState_s::eType, FL_BOUNCE_HALF, gentity_s::flags, FORCE_DARKSIDE, FORCE_LIGHTSIDE, forcePowerDarkLight, FP_SABER_DEFENSE, FP_SABER_OFFENSE, FP_SABERTHROW, G_FreeEntity(), g_gametype, G_Printf(), G_SetOrigin(), gentity_t, GT_HOLOCRON, HasSetSaberOnly(), HolocronThink(), HolocronTouch(), vmCvar_t::integer, entityState_s::isJediMaster, level, MASK_SOLID, entityShared_t::maxs, entityShared_t::mins, entityState_s::modelindex, gentity_s::nextthink, NULL, NUM_FORCE_POWERS, entityState_s::number, entityState_s::origin, entityState_s::origin2, gentity_s::physicsObject, entityState_s::pos, qtrue, gentity_s::r, gentity_s::s, trace_t::startsolid, gentity_s::think, level_locals_t::time, gentity_s::touch, TR_GRAVITY, trap_LinkEntity(), trap_Trace(), trajectory_t::trBase, entityState_s::trickedentindex3, entityState_s::trickedentindex4, trajectory_t::trTime, trajectory_t::trType, vec3_t, VectorCopy, VectorSet, and vtos().

00994 {
00995         vec3_t dest;
00996         trace_t tr;
00997 
00998         if (g_gametype.integer != GT_HOLOCRON)
00999         {
01000                 G_FreeEntity(ent);
01001                 return;
01002         }
01003 
01004         if (HasSetSaberOnly())
01005         {
01006                 if (ent->count == FP_SABER_OFFENSE ||
01007                         ent->count == FP_SABER_DEFENSE ||
01008                         ent->count == FP_SABERTHROW)
01009                 { //having saber holocrons in saber only mode is pointless
01010                         G_FreeEntity(ent);
01011                         return;
01012                 }
01013         }
01014 
01015         ent->s.isJediMaster = qtrue;
01016 
01017         VectorSet( ent->r.maxs, 8, 8, 8 );
01018         VectorSet( ent->r.mins, -8, -8, -8 );
01019 
01020         ent->s.origin[2] += 0.1;
01021         ent->r.maxs[2] -= 0.1;
01022 
01023         VectorSet( dest, ent->s.origin[0], ent->s.origin[1], ent->s.origin[2] - 4096 );
01024         trap_Trace( &tr, ent->s.origin, ent->r.mins, ent->r.maxs, dest, ent->s.number, MASK_SOLID );
01025         if ( tr.startsolid )
01026         {
01027                 G_Printf ("SP_misc_holocron: misc_holocron startsolid at %s\n", vtos(ent->s.origin));
01028                 G_FreeEntity( ent );
01029                 return;
01030         }
01031 
01032         //add the 0.1 back after the trace
01033         ent->r.maxs[2] += 0.1;
01034 
01035         // allow to ride movers
01036 //      ent->s.groundEntityNum = tr.entityNum;
01037 
01038         G_SetOrigin( ent, tr.endpos );
01039 
01040         if (ent->count < 0)
01041         {
01042                 ent->count = 0;
01043         }
01044 
01045         if (ent->count >= NUM_FORCE_POWERS)
01046         {
01047                 ent->count = NUM_FORCE_POWERS-1;
01048         }
01049 /*
01050         if (g_forcePowerDisable.integer &&
01051                 (g_forcePowerDisable.integer & (1 << ent->count)))
01052         {
01053                 G_FreeEntity(ent);
01054                 return;
01055         }
01056 */
01057         //No longer doing this, causing too many complaints about accidentally setting no force powers at all
01058         //and starting a holocron game (making it basically just FFA)
01059 
01060         ent->enemy = NULL;
01061 
01062         ent->flags = FL_BOUNCE_HALF;
01063 
01064         ent->s.modelindex = (ent->count - 128);//G_ModelIndex(holocronTypeModels[ent->count]);
01065         ent->s.eType = ET_HOLOCRON;
01066         ent->s.pos.trType = TR_GRAVITY;
01067         ent->s.pos.trTime = level.time;
01068 
01069         ent->r.contents = CONTENTS_TRIGGER;
01070         ent->clipmask = MASK_SOLID;
01071 
01072         ent->s.trickedentindex4 = ent->count;
01073 
01074         if (forcePowerDarkLight[ent->count] == FORCE_DARKSIDE)
01075         {
01076                 ent->s.trickedentindex3 = 1;
01077         }
01078         else if (forcePowerDarkLight[ent->count] == FORCE_LIGHTSIDE)
01079         {
01080                 ent->s.trickedentindex3 = 2;
01081         }
01082         else
01083         {
01084                 ent->s.trickedentindex3 = 3;
01085         }
01086 
01087         ent->physicsObject = qtrue;
01088 
01089         VectorCopy(ent->s.pos.trBase, ent->s.origin2); //remember the spawn spot
01090 
01091         ent->touch = HolocronTouch;
01092 
01093         trap_LinkEntity(ent);
01094 
01095         ent->think = HolocronThink;
01096         ent->nextthink = level.time + 50;
01097 }

void SP_misc_maglock gentity_t self  ) 
 

Definition at line 2645 of file g_misc.c.

References G_EffectIndex(), G_ModelIndex(), G_SetOrigin(), gentity_s::genericValue1, gentity_t, level, maglock_link(), entityState_s::modelindex, gentity_s::nextthink, entityState_s::origin, gentity_s::s, START_TIME_FIND_LINKS, gentity_s::think, and level_locals_t::time.

02646 {
02647         //NOTE: May have to make these only work on doors that are either untargeted 
02648         //              or are targeted by a trigger, not doors fired off by scripts, counters 
02649         //              or other such things?
02650         self->s.modelindex = G_ModelIndex( "models/map_objects/imp_detention/door_lock.md3" );
02651         self->genericValue1 = G_EffectIndex( "maglock/explosion" );
02652 
02653         G_SetOrigin( self, self->s.origin );
02654 
02655         self->think = maglock_link;
02656         //FIXME: for some reason, when you re-load a level, these fail to find their doors...?  Random?  Testing an additional 200ms after the START_TIME_FIND_LINKS
02657         self->nextthink = level.time + START_TIME_FIND_LINKS+200;//START_TIME_FIND_LINKS;//because we need to let the doors link up and spawn their triggers first!
02658 }

void SP_misc_model gentity_t ent  ) 
 

Definition at line 249 of file g_misc.c.

References entityState_s::angles, entityState_s::apos, G_FreeEntity(), G_ModelIndex(), G_SetOrigin(), gentity_t, entityShared_t::maxs, entityShared_t::mins, gentity_s::model, entityState_s::modelindex, entityState_s::origin, gentity_s::r, gentity_s::s, trap_LinkEntity(), trajectory_t::trBase, VectorCopy, and VectorSet.

00249                                      {
00250 
00251 #if 0
00252         ent->s.modelindex = G_ModelIndex( ent->model );
00253         VectorSet (ent->r.mins, -16, -16, -16);
00254         VectorSet (ent->r.maxs, 16, 16, 16);
00255         trap_LinkEntity (ent);
00256 
00257         G_SetOrigin( ent, ent->s.origin );
00258         VectorCopy( ent->s.angles, ent->s.apos.trBase );
00259 #else
00260         G_FreeEntity( ent );
00261 #endif
00262 }

void SP_misc_model_ammo_power_converter gentity_t ent  ) 
 

Definition at line 1864 of file g_misc.c.

References ammo_power_converter_use(), entityState_s::angles, entityState_s::apos, check_recharge(), gentity_s::clipmask, entityShared_t::contents, CONTENTS_SOLID, gentity_s::count, entityState_s::eFlags, EnergyAmmoStationSettings(), ENTITYNUM_NONE, G_ModelIndex(), G_SetOrigin(), G_SpawnInt(), gentity_s::genericValue12, gentity_s::genericValue4, gentity_t, entityState_s::health, gentity_s::health, level, MASK_SOLID, entityState_s::maxhealth, entityShared_t::maxs, entityShared_t::mins, gentity_s::model, entityState_s::modelindex, gentity_s::nextthink, entityState_s::origin, entityState_s::owner, qtrue, gentity_s::r, gentity_s::s, entityState_s::shouldtarget, SVF_PLAYER_USABLE, entityShared_t::svFlags, entityState_s::teamowner, gentity_s::think, level_locals_t::time, trap_LinkEntity(), trajectory_t::trBase, gentity_s::use, VectorCopy, and VectorSet.

01865 {
01866         if (!ent->health)
01867         {
01868                 ent->health = 60;
01869         }
01870 
01871         VectorSet (ent->r.mins, -16, -16, -16);
01872         VectorSet (ent->r.maxs, 16, 16, 16);
01873 
01874         ent->s.modelindex = G_ModelIndex( ent->model );
01875 
01876         ent->s.eFlags = 0;
01877         ent->r.svFlags |= SVF_PLAYER_USABLE;
01878         ent->r.contents = CONTENTS_SOLID;
01879         ent->clipmask = MASK_SOLID;
01880 
01881         G_SpawnInt("nodrain", "0", &ent->genericValue12);
01882         ent->use = ammo_power_converter_use;
01883 
01884         EnergyAmmoStationSettings(ent);
01885 
01886         ent->genericValue4 = ent->count; //initial value
01887         ent->think = check_recharge;
01888 
01889         if (!ent->genericValue12)
01890         {
01891                 ent->s.maxhealth = ent->s.health = ent->count;
01892         }
01893         ent->s.shouldtarget = qtrue;
01894         ent->s.teamowner = 0;
01895         ent->s.owner = ENTITYNUM_NONE;
01896 
01897         ent->nextthink = level.time + 200;// + STATION_RECHARGE_TIME;
01898 
01899         G_SetOrigin( ent, ent->s.origin );
01900         VectorCopy( ent->s.angles, ent->s.apos.trBase );
01901         trap_LinkEntity (ent);
01902 
01903         //G_SoundIndex("sound/movers/objects/useshieldstation.wav");
01904 }

void SP_misc_model_health_power_converter gentity_t ent  ) 
 

Definition at line 1982 of file g_misc.c.

References entityState_s::angles, entityState_s::apos, check_recharge(), gentity_s::clipmask, entityShared_t::contents, CONTENTS_SOLID, gentity_s::count, EF_RADAROBJECT, entityState_s::eFlags, EnergyHealthStationSettings(), ENTITYNUM_NONE, g_gametype, G_IconIndex(), G_ModelIndex(), G_SetOrigin(), G_SoundIndex(), entityState_s::genericenemyindex, gentity_s::genericValue4, gentity_s::genericValue7, gentity_t, GT_SIEGE, gentity_s::health, health_power_converter_use(), vmCvar_t::integer, level, MASK_SOLID, entityShared_t::maxs, entityShared_t::mins, gentity_s::model, entityState_s::modelindex, gentity_s::nextthink, entityState_s::origin, entityState_s::owner, qtrue, gentity_s::r, gentity_s::s, entityState_s::shouldtarget, SVF_BROADCAST, SVF_PLAYER_USABLE, entityShared_t::svFlags, entityState_s::teamowner, gentity_s::think, level_locals_t::time, trap_LinkEntity(), trajectory_t::trBase, gentity_s::use, VectorCopy, and VectorSet.

01983 {
01984         if (!ent->health)
01985         {
01986                 ent->health = 60;
01987         }
01988 
01989         VectorSet (ent->r.mins, -16, -16, -16);
01990         VectorSet (ent->r.maxs, 16, 16, 16);
01991 
01992         ent->s.modelindex = G_ModelIndex( ent->model );
01993 
01994         ent->s.eFlags = 0;
01995         ent->r.svFlags |= SVF_PLAYER_USABLE;
01996         ent->r.contents = CONTENTS_SOLID;
01997         ent->clipmask = MASK_SOLID;
01998 
01999         ent->use = health_power_converter_use;
02000 
02001         EnergyHealthStationSettings(ent);
02002 
02003         ent->genericValue4 = ent->count; //initial value
02004         ent->think = check_recharge;
02005 
02006         //ent->s.maxhealth = ent->s.health = ent->count;
02007         ent->s.shouldtarget = qtrue;
02008         ent->s.teamowner = 0;
02009         ent->s.owner = ENTITYNUM_NONE;
02010 
02011         ent->nextthink = level.time + 200;// + STATION_RECHARGE_TIME;
02012 
02013         G_SetOrigin( ent, ent->s.origin );
02014         VectorCopy( ent->s.angles, ent->s.apos.trBase );
02015         trap_LinkEntity (ent);
02016 
02017         //G_SoundIndex("sound/movers/objects/useshieldstation.wav");
02018         G_SoundIndex("sound/player/pickuphealth.wav");
02019         ent->genericValue7 = G_SoundIndex("sound/interface/shieldcon_done");
02020 
02021         if (g_gametype.integer == GT_SIEGE)
02022         { //show on radar from everywhere
02023                 ent->r.svFlags |= SVF_BROADCAST;
02024                 ent->s.eFlags |= EF_RADAROBJECT;
02025                 ent->s.genericenemyindex = G_IconIndex("gfx/mp/siegeicons/desert/bacta");
02026         }
02027 }

void SP_misc_model_shield_power_converter gentity_t ent  ) 
 

Definition at line 1697 of file g_misc.c.

References entityState_s::angles, entityState_s::apos, check_recharge(), gentity_s::clipmask, entityShared_t::contents, CONTENTS_SOLID, gentity_s::count, entityState_s::eFlags, EnergyShieldStationSettings(), ENTITYNUM_NONE, G_ModelIndex(), G_SetOrigin(), gentity_s::genericValue4, gentity_t, entityState_s::health, gentity_s::health, level, MASK_SOLID, entityState_s::maxhealth, entityShared_t::maxs, entityShared_t::mins, gentity_s::model, entityState_s::modelindex, entityState_s::modelindex2, gentity_s::nextthink, entityState_s::origin, entityState_s::owner, qtrue, gentity_s::r, gentity_s::s, shield_power_converter_use(), entityState_s::shouldtarget, SVF_PLAYER_USABLE, entityShared_t::svFlags, entityState_s::teamowner, gentity_s::think, level_locals_t::time, trap_LinkEntity(), trajectory_t::trBase, gentity_s::use, VectorCopy, and VectorSet.

01698 {
01699         if (!ent->health)
01700         {
01701                 ent->health = 60;
01702         }
01703 
01704         VectorSet (ent->r.mins, -16, -16, -16);
01705         VectorSet (ent->r.maxs, 16, 16, 16);
01706 
01707         ent->s.modelindex = G_ModelIndex( ent->model );
01708 
01709         ent->s.eFlags = 0;
01710         ent->r.svFlags |= SVF_PLAYER_USABLE;
01711         ent->r.contents = CONTENTS_SOLID;
01712         ent->clipmask = MASK_SOLID;
01713 
01714         EnergyShieldStationSettings(ent);
01715 
01716         ent->genericValue4 = ent->count; //initial value
01717         ent->think = check_recharge;
01718 
01719         ent->s.maxhealth = ent->s.health = ent->count;
01720         ent->s.shouldtarget = qtrue;
01721         ent->s.teamowner = 0;
01722         ent->s.owner = ENTITYNUM_NONE;
01723 
01724         ent->nextthink = level.time + 200;// + STATION_RECHARGE_TIME;
01725 
01726         ent->use = shield_power_converter_use;
01727 
01728         G_SetOrigin( ent, ent->s.origin );
01729         VectorCopy( ent->s.angles, ent->s.apos.trBase );
01730         trap_LinkEntity (ent);
01731 
01732         //G_SoundIndex("sound/movers/objects/useshieldstation.wav");
01733 
01734         ent->s.modelindex2 = G_ModelIndex("/models/items/psd_big.md3"); // Precache model
01735 }

void SP_misc_model_static gentity_t ent  ) 
 

Definition at line 277 of file g_misc.c.

References G_FreeEntity(), and gentity_t.

00278 {
00279         G_FreeEntity( ent );
00280 }

void SP_misc_portal_camera gentity_t ent  ) 
 

Definition at line 375 of file g_misc.c.

References entityState_s::clientNum, G_SpawnFloat(), gentity_t, entityShared_t::maxs, entityShared_t::mins, gentity_s::r, gentity_s::s, trap_LinkEntity(), and VectorClear.

00375                                            {
00376         float   roll;
00377 
00378         VectorClear( ent->r.mins );
00379         VectorClear( ent->r.maxs );
00380         trap_LinkEntity (ent);
00381 
00382         G_SpawnFloat( "roll", "0", &roll );
00383 
00384         ent->s.clientNum = roll/360.0 * 256;
00385 }

void SP_misc_portal_surface gentity_t ent  ) 
 

Definition at line 355 of file g_misc.c.

References ET_PORTAL, entityState_s::eType, gentity_t, level, locateCamera(), entityShared_t::maxs, entityShared_t::mins, gentity_s::nextthink, entityState_s::origin, entityState_s::origin2, gentity_s::r, gentity_s::s, SVF_PORTAL, entityShared_t::svFlags, gentity_s::target, gentity_s::think, level_locals_t::time, trap_LinkEntity(), VectorClear, and VectorCopy.

00355                                             {
00356         VectorClear( ent->r.mins );
00357         VectorClear( ent->r.maxs );
00358         trap_LinkEntity (ent);
00359 
00360         ent->r.svFlags = SVF_PORTAL;
00361         ent->s.eType = ET_PORTAL;
00362 
00363         if ( !ent->target ) {
00364                 VectorCopy( ent->s.origin, ent->s.origin2 );
00365         } else {
00366                 ent->think = locateCamera;
00367                 ent->nextthink = level.time + 100;
00368         }
00369 }

void SP_misc_shield_floor_unit gentity_t ent  ) 
 

Definition at line 1602 of file g_misc.c.

References entityState_s::angles, entityState_s::apos, check_recharge(), gentity_s::clipmask, entityShared_t::contents, CONTENTS_SOLID, gentity_s::count, EF_RADAROBJECT, entityState_s::eFlags, trace_t::endpos, EnergyShieldStationSettings(), trace_t::entityNum, ENTITYNUM_NONE, G_FreeEntity(), g_gametype, G_IconIndex(), G_ModelIndex(), G_Printf(), G_SetOrigin(), G_SoundIndex(), G_SpawnInt(), entityState_s::genericenemyindex, gentity_s::genericValue12, gentity_s::genericValue4, gentity_s::genericValue7, gentity_t, entityState_s::groundEntityNum, GT_CTF, GT_CTY, GT_SIEGE, entityState_s::health, gentity_s::health, vmCvar_t::integer, level, MASK_SOLID, entityState_s::maxhealth, entityShared_t::maxs, entityShared_t::mins, gentity_s::model, entityState_s::modelindex, gentity_s::nextthink, entityState_s::number, entityState_s::origin, entityState_s::owner, qtrue, gentity_s::r, gentity_s::s, shield_power_converter_use(), entityState_s::shouldtarget, trace_t::startsolid, SVF_BROADCAST, SVF_PLAYER_USABLE, entityShared_t::svFlags, entityState_s::teamowner, gentity_s::think, level_locals_t::time, trap_LinkEntity(), trap_Trace(), trajectory_t::trBase, gentity_s::use, vec3_t, VectorCopy, VectorSet, and vtos().

01603 {
01604         vec3_t dest;
01605         trace_t tr;
01606 
01607         if (g_gametype.integer != GT_CTF &&
01608                 g_gametype.integer != GT_CTY &&
01609                 g_gametype.integer != GT_SIEGE)
01610         {
01611                 G_FreeEntity( ent );
01612                 return;
01613         }
01614 
01615         VectorSet( ent->r.mins, -16, -16, 0 );
01616         VectorSet( ent->r.maxs, 16, 16, 40 );
01617 
01618         ent->s.origin[2] += 0.1;
01619         ent->r.maxs[2] -= 0.1;
01620 
01621         VectorSet( dest, ent->s.origin[0], ent->s.origin[1], ent->s.origin[2] - 4096 );
01622         trap_Trace( &tr, ent->s.origin, ent->r.mins, ent->r.maxs, dest, ent->s.number, MASK_SOLID );
01623         if ( tr.startsolid )
01624         {
01625                 G_Printf ("SP_misc_shield_floor_unit: misc_shield_floor_unit startsolid at %s\n", vtos(ent->s.origin));
01626                 G_FreeEntity( ent );
01627                 return;
01628         }
01629 
01630         //add the 0.1 back after the trace
01631         ent->r.maxs[2] += 0.1;
01632 
01633         // allow to ride movers
01634         ent->s.groundEntityNum = tr.entityNum;
01635 
01636         G_SetOrigin( ent, tr.endpos );
01637 
01638         if (!ent->health)
01639         {
01640                 ent->health = 60;
01641         }
01642 
01643         if (!ent->model || !ent->model[0])
01644         {
01645                 ent->model = "/models/items/a_shield_converter.md3";
01646         }
01647 
01648         ent->s.modelindex = G_ModelIndex( ent->model );
01649 
01650         ent->s.eFlags = 0;
01651         ent->r.svFlags |= SVF_PLAYER_USABLE;
01652         ent->r.contents = CONTENTS_SOLID;
01653         ent->clipmask = MASK_SOLID;
01654 
01655         EnergyShieldStationSettings(ent);
01656 
01657         ent->genericValue4 = ent->count; //initial value
01658         ent->think = check_recharge;
01659 
01660         G_SpawnInt("nodrain", "0", &ent->genericValue12);
01661 
01662     if (!ent->genericValue12)
01663         {
01664                 ent->s.maxhealth = ent->s.health = ent->count;
01665         }
01666         ent->s.shouldtarget = qtrue;
01667         ent->s.teamowner = 0;
01668         ent->s.owner = ENTITYNUM_NONE;
01669 
01670         ent->nextthink = level.time + 200;// + STATION_RECHARGE_TIME;
01671 
01672         ent->use = shield_power_converter_use;
01673 
01674         VectorCopy( ent->s.angles, ent->s.apos.trBase );
01675         trap_LinkEntity (ent);
01676 
01677         G_SoundIndex("sound/interface/shieldcon_run");
01678         ent->genericValue7 = G_SoundIndex("sound/interface/shieldcon_done");
01679         G_SoundIndex("sound/interface/shieldcon_empty");
01680 
01681         if (g_gametype.integer == GT_SIEGE)
01682         { //show on radar from everywhere
01683                 ent->r.svFlags |= SVF_BROADCAST;
01684                 ent->s.eFlags |= EF_RADAROBJECT;
01685                 ent->s.genericenemyindex = G_IconIndex("gfx/mp/siegeicons/desert/shield_recharge");
01686         }
01687 }

void SP_misc_siege_item gentity_t ent  ) 
 

Definition at line 1676 of file g_saga.c.

References entityState_s::angles, entityState_s::apos, gentity_s::clipmask, entityShared_t::contents, CONTENTS_SOLID, CONTENTS_TERRAIN, CONTENTS_TRIGGER, entityShared_t::currentAngles, gentity_s::die, EF_CLIENTSMOOTH, EF_NODRAW, EF_RADAROBJECT, entityState_s::eFlags, ENTITYNUM_NONE, ET_GENERAL, entityState_s::eType, FRAMETIME, G_EffectIndex(), G_Error(), G_FreeEntity(), g_gametype, G_IconIndex(), G_ModelIndex(), G_ScaleNetHealth(), G_SetOrigin(), G_SoundIndex(), G_SpawnFloat(), G_SpawnInt(), G_SpawnString(), G_SpawnVector(), entityState_s::genericenemyindex, gentity_s::genericValue1, gentity_s::genericValue10, gentity_s::genericValue11, gentity_s::genericValue12, gentity_s::genericValue13, gentity_s::genericValue15, gentity_s::genericValue3, gentity_s::genericValue4, gentity_s::genericValue6, gentity_s::genericValue7, gentity_s::genericValue8, gentity_t, GT_SIEGE, gentity_s::health, vmCvar_t::integer, level, MASK_PLAYERSOLID, gentity_s::mass, gentity_s::maxHealth, entityShared_t::maxs, entityShared_t::mins, gentity_s::model, entityState_s::modelGhoul2, entityState_s::modelindex, gentity_s::neverFree, gentity_s::nextthink, gentity_s::noise_index, entityState_s::origin, gentity_s::pain, gentity_s::pos1, Q_stricmp(), qfalse, qtrue, gentity_s::r, gentity_s::radius, gentity_s::random, gentity_s::s, siege_valid, SIEGEITEM_STARTOFFRADAR, SiegeItemDie(), SiegeItemPain(), SiegeItemThink(), SiegeItemTouch(), SiegeItemUse(), gentity_s::spawnflags, strlen(), SVF_BROADCAST, entityShared_t::svFlags, gentity_s::takedamage, gentity_s::targetname, gentity_s::think, level_locals_t::time, gentity_s::touch, trap_LinkEntity(), trajectory_t::trBase, gentity_s::use, and VectorCopy.

01677 {
01678         int             canpickup;
01679         int             noradar;
01680         char    *s;
01681 
01682         if (!siege_valid || g_gametype.integer != GT_SIEGE)
01683         {
01684                 G_FreeEntity(ent);
01685                 return;
01686         }
01687 
01688         if (!ent->model || !ent->model[0])
01689         {
01690                 G_Error("You must specify a model for misc_siege_item types.");
01691         }
01692 
01693         G_SpawnInt("canpickup", "1", &canpickup);
01694         G_SpawnInt("usephysics", "1", &ent->genericValue1);
01695 
01696         if (ent->genericValue1)
01697         { //if we're using physics we want lerporigin smoothing
01698                 ent->s.eFlags |= EF_CLIENTSMOOTH;
01699         }
01700 
01701         G_SpawnInt("noradar", "0", &noradar);
01702         //Want it to always show up as a goal object on radar
01703         if (!noradar && !(ent->spawnflags & SIEGEITEM_STARTOFFRADAR))
01704         {
01705                 ent->s.eFlags |= EF_RADAROBJECT;
01706         }
01707 
01708         //All clients want to know where it is at all times for radar
01709         ent->r.svFlags |= SVF_BROADCAST;
01710 
01711         G_SpawnInt("pickuponlyonce", "1", &ent->genericValue4);
01712 
01713         G_SpawnInt("teamnotouch", "0", &ent->genericValue6);
01714         G_SpawnInt("teamnocomplete", "0", &ent->genericValue7);
01715         
01716         //Get default physics values.
01717         G_SpawnFloat("mass", "0.09", &ent->mass);
01718         G_SpawnFloat("gravity", "3.0", &ent->radius);
01719         G_SpawnFloat("bounce", "1.3", &ent->random);
01720 
01721         G_SpawnString( "pickupsound", "", &s );
01722 
01723         if (s && s[0])
01724         { //We have a pickup sound, so index it now.
01725                 ent->noise_index = G_SoundIndex(s);
01726         }
01727 
01728         G_SpawnString( "deathfx", "", &s );
01729 
01730         if (s && s[0])
01731         { //We have a death effect, so index it now.
01732                 ent->genericValue3 = G_EffectIndex(s);
01733         }
01734 
01735         G_SpawnString( "respawnfx", "", &s );
01736 
01737         if (s && s[0])
01738         { //We have a respawn effect, so index it now.
01739                 ent->genericValue10 = G_EffectIndex(s);
01740         }
01741 
01742         G_SpawnString( "icon", "", &s );
01743         
01744         if (s && s[0])
01745         { 
01746                 // We have an icon, so index it now.  We are reusing the genericenemyindex
01747                 // variable rather than adding a new one to the entity state.
01748                 ent->s.genericenemyindex = G_IconIndex(s);
01749         }
01750         
01751         ent->s.modelindex = G_ModelIndex(ent->model);
01752 
01753         //Is the model a ghoul2 model?
01754         if (!Q_stricmp(&ent->model[strlen(ent->model) - 4], ".glm"))
01755         { //apparently so.
01756         ent->s.modelGhoul2 = 1;
01757         }
01758 
01759         ent->s.eType = ET_GENERAL;
01760 
01761         //Set the mins/maxs with default values.
01762         G_SpawnVector("mins", "-16 -16 -24", ent->r.mins);
01763         G_SpawnVector("maxs", "16 16 32", ent->r.maxs);
01764 
01765         VectorCopy(ent->s.origin, ent->pos1); //store off the initial origin for respawning
01766         G_SetOrigin(ent, ent->s.origin);
01767 
01768         VectorCopy(ent->s.angles, ent->r.currentAngles);
01769         VectorCopy(ent->s.angles, ent->s.apos.trBase);
01770 
01771         G_SpawnInt("forcelimit", "0", &ent->genericValue15);
01772 
01773         if (ent->health > 0)
01774         { //If it has health, it can be killed.
01775                 int t;
01776 
01777                 ent->pain = SiegeItemPain;
01778                 ent->die = SiegeItemDie;
01779                 ent->takedamage = qtrue;
01780 
01781                 G_SpawnInt( "showhealth", "0", &t );
01782                 if (t)
01783                 { //a non-0 maxhealth value will mean we want to show the health on the hud
01784                         ent->maxHealth = ent->health;
01785                         G_ScaleNetHealth(ent);
01786 
01787                         G_SpawnInt( "health_chargeamt", "0", &ent->genericValue12);
01788                         G_SpawnInt( "health_chargerate", "0", &ent->genericValue13);
01789                 }
01790         }
01791         else
01792         { //Otherwise no.
01793                 ent->takedamage = qfalse;
01794         }
01795 
01796         if (ent->spawnflags & SIEGEITEM_STARTOFFRADAR)
01797         {
01798                 ent->use = SiegeItemUse;
01799         }
01800         else if (ent->targetname && ent->targetname[0])
01801         {
01802                 ent->s.eFlags |= EF_NODRAW; //kind of hacky, but whatever
01803                 ent->genericValue11 = canpickup;
01804         ent->use = SiegeItemUse;
01805                 ent->s.eFlags &= ~EF_RADAROBJECT;
01806         }
01807 
01808         if ( (!ent->targetname || !ent->targetname[0]) ||
01809                  (ent->spawnflags & SIEGEITEM_STARTOFFRADAR) )
01810         {
01811                 if (canpickup || !ent->takedamage)
01812                 { //We want to be able to walk into it to pick it up then.
01813                         ent->r.contents = CONTENTS_TRIGGER;
01814                         ent->clipmask = CONTENTS_SOLID|CONTENTS_TERRAIN;
01815                         if (canpickup)
01816                         {
01817                                 ent->touch = SiegeItemTouch;
01818                         }
01819                 }
01820                 else
01821                 { //Make it solid.
01822                         ent->r.contents = MASK_PLAYERSOLID;
01823                         ent->clipmask = MASK_PLAYERSOLID;
01824                 }
01825 
01826                 ent->think = SiegeItemThink;
01827                 ent->nextthink = level.time + FRAMETIME/2;
01828         }
01829 
01830         ent->genericValue8 = ENTITYNUM_NONE; //initialize the carrier to none
01831 
01832         ent->neverFree = qtrue; //never free us unless we specifically request it.
01833 
01834         trap_LinkEntity(ent);
01835 }

void SP_misc_skyportal gentity_t ent  ) 
 

Definition at line 694 of file g_misc.c.

References atof(), CS_SKYBOXORG, G_PortalifyEntities(), G_SpawnInt(), G_SpawnString(), G_SpawnVector(), gentity_t, level, gentity_s::nextthink, entityState_s::origin, gentity_s::s, gentity_s::think, level_locals_t::time, trap_SetConfigstring(), va(), and vec3_t.

00695 {
00696         char    *fov;
00697         vec3_t  fogv;   //----(SA)      
00698         int             fogn;   //----(SA)      
00699         int             fogf;   //----(SA)      
00700         int             isfog = 0;      // (SA)
00701 
00702         float   fov_x;
00703 
00704         G_SpawnString ("fov", "80", &fov);
00705         fov_x = atof (fov);
00706 
00707         isfog += G_SpawnVector ("fogcolor", "0 0 0", fogv);
00708         isfog += G_SpawnInt ("fognear", "0", &fogn);
00709         isfog += G_SpawnInt ("fogfar", "300", &fogf);
00710 
00711         trap_SetConfigstring( CS_SKYBOXORG, va("%.2f %.2f %.2f %.1f %i %.2f %.2f %.2f %i %i", ent->s.origin[0], ent->s.origin[1], ent->s.origin[2], fov_x, (int)isfog, fogv[0], fogv[1], fogv[2], fogn, fogf ) );
00712 
00713         ent->think = G_PortalifyEntities;
00714         ent->nextthink = level.time + 1050; //give it some time first so that all other entities are spawned.
00715 }

void SP_misc_skyportal_orient gentity_t ent  ) 
 

Definition at line 675 of file g_misc.c.

References G_FreeEntity(), and gentity_t.

00676 {
00677         G_FreeEntity(ent);
00678 }

void SP_misc_teleporter_dest gentity_t self  ) 
 

Definition at line 239 of file g_misc.c.

References gentity_t.

00239                                                {
00240 }

void SP_misc_turret gentity_t ent  ) 
 

Definition at line 663 of file g_turret.c.

References entityState_s::angles, entityShared_t::contents, CONTENTS_BODY, FRAMETIME, G_FreeEntity(), G_IconIndex(), G_ModelIndex(), G_SetAngles(), G_SetOrigin(), G_SpawnString(), entityState_s::genericenemyindex, gentity_t, level, entityShared_t::maxs, entityShared_t::mins, entityState_s::modelindex, entityState_s::modelindex2, gentity_s::nextthink, entityState_s::origin, gentity_s::r, gentity_s::s, gentity_s::think, level_locals_t::time, trap_LinkEntity(), turret_base_spawn_top(), turret_base_think(), turret_base_use(), gentity_s::use, and VectorSet.

00665 {
00666         char* s;
00667 
00668         base->s.modelindex2 = G_ModelIndex( "models/map_objects/hoth/turret_bottom.md3" );
00669         base->s.modelindex = G_ModelIndex( "models/map_objects/hoth/turret_base.md3" );
00670         //base->playerModel = gi.G2API_InitGhoul2Model( base->ghoul2, "models/map_objects/imp_mine/turret_canon.glm", base->s.modelindex );
00671         //base->s.radius = 80.0f;
00672 
00673         //gi.G2API_SetBoneAngles( &base->ghoul2[base->playerModel], "Bone_body", vec3_origin, BONE_ANGLES_POSTMULT, POSITIVE_Y, POSITIVE_Z, POSITIVE_X, NULL ); 
00674         //base->torsoBolt = gi.G2API_AddBolt( &base->ghoul2[base->playerModel], "*flash03" );
00675 
00676         G_SpawnString( "icon", "", &s );
00677         if (s && s[0])
00678         { 
00679                 // We have an icon, so index it now.  We are reusing the genericenemyindex
00680                 // variable rather than adding a new one to the entity state.
00681                 base->s.genericenemyindex = G_IconIndex(s);
00682         }
00683 
00684         G_SetAngles( base, base->s.angles );
00685         G_SetOrigin( base, base->s.origin );
00686 
00687         base->r.contents = CONTENTS_BODY;
00688 
00689         VectorSet( base->r.maxs, 32.0f, 32.0f, 128.0f );
00690         VectorSet( base->r.mins, -32.0f, -32.0f, 0.0f );
00691 
00692         base->use = turret_base_use;
00693         base->think = turret_base_think;
00694         // don't start working right away
00695         base->nextthink = level.time + FRAMETIME * 5;
00696 
00697         trap_LinkEntity( base );
00698 
00699         if ( !turret_base_spawn_top( base ) )
00700         {
00701                 G_FreeEntity( base );
00702         }
00703 }

void SP_misc_turretG2 gentity_t base  ) 
 

Definition at line 1021 of file g_turret_G2.c.

References EF_RADAROBJECT, EF_SHADER_ANIM, entityState_s::eFlags, finish_spawning_turretG2(), entityState_s::frame, G_IconIndex(), G_SpawnInt(), G_SpawnString(), entityState_s::genericenemyindex, gentity_s::genericValue4, gentity_s::genericValue8, gentity_t, entityState_s::iModelScale, gentity_s::modelScale, qfalse, gentity_s::s, gentity_s::spawnflags, SPF_SHOWONRADAR, SPF_TURRETG2_TURBO, and turretG2_set_models().

01023 {
01024         int customscaleVal;
01025         char* s;
01026 
01027         turretG2_set_models( base, qfalse );
01028 
01029         G_SpawnInt("painwait", "0", &base->genericValue4);
01030         base->genericValue8 = 0;
01031 
01032         G_SpawnInt("customscale", "0", &customscaleVal);
01033         base->s.iModelScale = customscaleVal;
01034         if (base->s.iModelScale)
01035         {
01036                 if (base->s.iModelScale > 1023)
01037                 {
01038                         base->s.iModelScale = 1023;
01039                 }
01040                 base->modelScale[0] = base->modelScale[1] = base->modelScale[2] = base->s.iModelScale/100.0f;
01041         }
01042 
01043         G_SpawnString( "icon", "", &s );
01044         if (s && s[0])
01045         { 
01046                 // We have an icon, so index it now.  We are reusing the genericenemyindex
01047                 // variable rather than adding a new one to the entity state.
01048                 base->s.genericenemyindex = G_IconIndex(s);
01049         }
01050 
01051         finish_spawning_turretG2( base );
01052 
01053         if (( base->spawnflags & 1 )) // Start_Off
01054         {
01055                 base->s.frame = 1; // black
01056         }
01057         else
01058         {
01059                 base->s.frame = 0; // glow
01060         }
01061         if ( !(base->spawnflags&SPF_TURRETG2_TURBO) )
01062         {
01063                 base->s.eFlags |= EF_SHADER_ANIM;
01064         }
01065 
01066         if (base->spawnflags & SPF_SHOWONRADAR)
01067         {
01068                 base->s.eFlags |= EF_RADAROBJECT;
01069         }
01070 #undef name
01071 #undef name2
01072 #undef name3
01073 }

void SP_misc_weapon_shooter gentity_t self  ) 
 

Definition at line 3444 of file g_misc.c.

References entityState_s::angles, AngleVectors(), BG_FindItemForWeapon(), gentity_s::client, G_ClientForShooter(), G_SpawnString(), gentity_t, GetIDForString(), level, misc_weapon_shooter_aim(), misc_weapon_shooter_use(), renderInfo_s::muzzlePoint, gentity_s::nextthink, NULL, entityState_s::origin, gentity_s::pos1, gclient_s::ps, RegisterItem(), gclient_s::renderInfo, gentity_s::s, START_TIME_LINK_ENTS, gentity_s::target, gentity_s::think, level_locals_t::time, gentity_s::use, VectorCopy, playerState_s::viewangles, gentity_s::wait, playerState_s::weapon, entityState_s::weapon, WP_BLASTER, and WPTable.

03445 {
03446         char *s;
03447 
03448         //alloc a client just for the weapon code to use
03449         self->client = G_ClientForShooter();//(gclient_s *)gi.Malloc(sizeof(gclient_s), TAG_G_ALLOC, qtrue);
03450 
03451         G_SpawnString("weapon", "", &s);
03452 
03453         //set weapon
03454         self->s.weapon = self->client->ps.weapon = WP_BLASTER;
03455         if ( s && s[0] )
03456         {//use a different weapon
03457                 self->s.weapon = self->client->ps.weapon = GetIDForString( WPTable, s );
03458         }
03459 
03460         RegisterItem(BG_FindItemForWeapon(self->s.weapon));
03461 
03462         //set where our muzzle is
03463         VectorCopy( self->s.origin, self->client->renderInfo.muzzlePoint );
03464         //permanently updated (don't need for MP)
03465         //self->client->renderInfo.mPCalcTime = Q3_INFINITE;
03466 
03467         //set up to link
03468         if ( self->target )
03469         {
03470         self->think = misc_weapon_shooter_aim;
03471                 self->nextthink = level.time + START_TIME_LINK_ENTS;
03472         }
03473         else
03474         {//just set aim angles
03475                 VectorCopy( self->s.angles, self->client->ps.viewangles );
03476                 AngleVectors( self->s.angles, self->pos1, NULL, NULL );
03477         }
03478 
03479         //set up to fire when used
03480     self->use = misc_weapon_shooter_use;
03481 
03482         if ( !self->wait )
03483         {
03484                 self->wait = 500;
03485         }
03486 }

void SP_misc_weather_zone gentity_t ent  ) 
 

Definition at line 3491 of file g_misc.c.

References G_FreeEntity(), and gentity_t.

03492 {
03493         G_FreeEntity(ent);
03494 }

void SP_NPC_Alora gentity_t self  ) 
 

Definition at line 2454 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, SP_NPC_spawner(), and gentity_s::spawnflags.

02455 {
02456         if ( (self->spawnflags&1) )
02457         {
02458                 self->NPC_type = "alora_dual";
02459         }
02460         else
02461         {
02462                 self->NPC_type = "alora";
02463         }
02464 
02465         SP_NPC_spawner( self );
02466 }

void SP_NPC_Bartender gentity_t self  ) 
 

Definition at line 2816 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, and SP_NPC_spawner().

02817 {
02818         self->NPC_type = "Bartender";
02819 
02820         SP_NPC_spawner( self );
02821 }

void SP_NPC_BespinCop gentity_t self  ) 
 

Definition at line 3332 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, Q_irand(), and SP_NPC_spawner().

03333 {
03334         if ( !self->NPC_type )
03335         {
03336                 if ( !Q_irand( 0, 1 ) )
03337                 {
03338                         self->NPC_type = "BespinCop";
03339                 }
03340                 else
03341                 {
03342                         self->NPC_type = "BespinCop2";
03343                 }
03344         }
03345 
03346         SP_NPC_spawner( self );
03347 }

void SP_NPC_Cultist gentity_t self  ) 
 

Definition at line 2673 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, NULL, Q_irand(), SP_NPC_Cultist_Saber(), SP_NPC_spawner(), and gentity_s::spawnflags.

02674 {
02675         if ( !self->NPC_type )
02676         {
02677                 if ( (self->spawnflags&1) )
02678                 {
02679                         self->NPC_type = NULL;
02680                         self->spawnflags = 0;//fast, no throw
02681                         switch ( Q_irand( 0, 2 ) )
02682                         {
02683                         case 0://medium
02684                                 self->spawnflags |= 1;
02685                                 break;
02686                         case 1://strong
02687                                 self->spawnflags |= 2;
02688                                 break;
02689                         case 2://all
02690                                 self->spawnflags |= 4;
02691                                 break;
02692                         }
02693                         if ( Q_irand( 0, 1 ) )
02694                         {//throw
02695                                 self->spawnflags |= 8;
02696                         }
02697                         SP_NPC_Cultist_Saber( self );
02698                         return;
02699                 }
02700                 else if ( (self->spawnflags&2) )
02701                 {
02702                         self->NPC_type = "cultist_grip";
02703                 }
02704                 else if ( (self->spawnflags&4) )
02705                 {
02706                         self->NPC_type = "cultist_lightning";
02707                 }
02708                 else if ( (self->spawnflags&8) )
02709                 {
02710                         self->NPC_type = "cultist_drain";
02711                 }
02712                 else
02713                 {
02714                         self->NPC_type = "cultist";
02715                 }
02716         }
02717         
02718         SP_NPC_spawner( self );
02719 }

void SP_NPC_Cultist_Commando gentity_t self  ) 
 

Definition at line 2731 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, and SP_NPC_spawner().

02732 {
02733         if ( !self->NPC_type )
02734         {
02735                 self->NPC_type = "cultistcommando";
02736         }
02737         SP_NPC_spawner( self );
02738 }

void SP_NPC_Cultist_Destroyer gentity_t self  ) 
 

Definition at line 2749 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, and SP_NPC_spawner().

02750 {
02751         self->NPC_type = "cultist";//"cultist_explode";
02752         SP_NPC_spawner( self );
02753 }

void SP_NPC_Cultist_Saber gentity_t self  ) 
 

Definition at line 2536 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, SP_NPC_spawner(), and gentity_s::spawnflags.

Referenced by SP_NPC_Cultist().

02537 {
02538         if ( !self->NPC_type )
02539         {
02540                 if ( (self->spawnflags&1) )
02541                 {
02542                         if ( (self->spawnflags&8) )
02543                         {
02544                                 self->NPC_type = "cultist_saber_med_throw";
02545                         }
02546                         else
02547                         {
02548                                 self->NPC_type = "cultist_saber_med";
02549                         }
02550                 }
02551                 else if ( (self->spawnflags&2) )
02552                 {
02553                         if ( (self->spawnflags&8) )
02554                         {
02555                                 self->NPC_type = "cultist_saber_strong_throw";
02556                         }
02557                         else
02558                         {
02559                                 self->NPC_type = "cultist_saber_strong";
02560                         }
02561                 }
02562                 else if ( (self->spawnflags&2) )
02563                 {
02564                         if ( (self->spawnflags&8) )
02565                         {
02566                                 self->NPC_type = "cultist_saber_all_throw";
02567                         }
02568                         else
02569                         {
02570                                 self->NPC_type = "cultist_saber_all";
02571                         }
02572                 }
02573                 else
02574                 {
02575                         if ( (self->spawnflags&8) )
02576                         {
02577                                 self->NPC_type = "cultist_saber_throw";
02578                         }
02579                         else
02580                         {
02581                                 self->NPC_type = "cultist_saber";
02582                         }
02583                 }
02584         }
02585         
02586         SP_NPC_spawner( self );
02587 }

void SP_NPC_Cultist_Saber_Powers gentity_t self  ) 
 

Definition at line 2605 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, SP_NPC_spawner(), and gentity_s::spawnflags.

02606 {
02607         if ( !self->NPC_type )
02608         {
02609                 if ( (self->spawnflags&1) )
02610                 {
02611                         if ( (self->spawnflags&8) )
02612                         {
02613                                 self->NPC_type = "cultist_saber_med_throw2";
02614                         }
02615                         else
02616                         {
02617                                 self->NPC_type = "cultist_saber_med2";
02618                         }
02619                 }
02620                 else if ( (self->spawnflags&2) )
02621                 {
02622                         if ( (self->spawnflags&8) )
02623                         {
02624                                 self->NPC_type = "cultist_saber_strong_throw2";
02625                         }
02626                         else
02627                         {
02628                                 self->NPC_type = "cultist_saber_strong2";
02629                         }
02630                 }
02631                 else if ( (self->spawnflags&2) )
02632                 {
02633                         if ( (self->spawnflags&8) )
02634                         {
02635                                 self->NPC_type = "cultist_saber_all_throw2";
02636                         }
02637                         else
02638                         {
02639                                 self->NPC_type = "cultist_saber_all2";
02640                         }
02641                 }
02642                 else
02643                 {
02644                         if ( (self->spawnflags&8) )
02645                         {
02646                                 self->NPC_type = "cultist_saber_throw";
02647                         }
02648                         else
02649                         {
02650                                 self->NPC_type = "cultist_saber2";
02651                         }
02652                 }
02653         }
02654         
02655         SP_NPC_spawner( self );
02656 }

void SP_NPC_Desann gentity_t self  ) 
 

Definition at line 2800 of file NPC_spawn.c.

References CLASS_DESANN, gentity_t, gentity_s::NPC_type, NULL, SP_NPC_spawner(), and WP_SetSaberModel().

02801 {
02802         self->NPC_type = "Desann";
02803 
02804         WP_SetSaberModel( NULL, CLASS_DESANN );
02805 
02806         SP_NPC_spawner( self );
02807 }

void SP_NPC_Droid_ATST gentity_t self  ) 
 

Definition at line 3668 of file NPC_spawn.c.

References gentity_t, NPC_ATST_Precache(), gentity_s::NPC_type, SP_NPC_spawner(), and gentity_s::spawnflags.

03669 {
03670         if ( (self->spawnflags&1) )
03671         {
03672                 self->NPC_type = "atst_vehicle";
03673         }
03674         else
03675         {
03676                 self->NPC_type = "atst";
03677         }
03678 
03679         SP_NPC_spawner( self );
03680 
03681         NPC_ATST_Precache();
03682 }

void SP_NPC_Droid_Gonk gentity_t self  ) 
 

Definition at line 3749 of file NPC_spawn.c.

References gentity_t, NPC_Gonk_Precache(), gentity_s::NPC_type, and SP_NPC_spawner().

03750 {
03751         self->NPC_type = "gonk";
03752 
03753         SP_NPC_spawner( self );
03754 
03755         //precache the Gonk sounds
03756         NPC_Gonk_Precache();
03757 }

void SP_NPC_Droid_Interrogator gentity_t self  ) 
 

Definition at line 3596 of file NPC_spawn.c.

References gentity_t, NPC_Interrogator_Precache(), gentity_s::NPC_type, and SP_NPC_spawner().

03597 {
03598         self->NPC_type = "interrogator";
03599 
03600         SP_NPC_spawner( self );
03601 
03602         NPC_Interrogator_Precache(self);
03603 }

void SP_NPC_Droid_Mark1 gentity_t self  ) 
 

Definition at line 3633 of file NPC_spawn.c.

References gentity_t, NPC_Mark1_Precache(), gentity_s::NPC_type, and SP_NPC_spawner().

03634 {
03635         self->NPC_type = "mark1";
03636 
03637         SP_NPC_spawner( self );
03638 
03639         NPC_Mark1_Precache();
03640 }

void SP_NPC_Droid_Mark2 gentity_t self  ) 
 

Definition at line 3652 of file NPC_spawn.c.

References gentity_t, NPC_Mark2_Precache(), gentity_s::NPC_type, and SP_NPC_spawner().

03653 {
03654         self->NPC_type = "mark2";
03655 
03656         SP_NPC_spawner( self );
03657 
03658         NPC_Mark2_Precache();
03659 }

void SP_NPC_Droid_Mouse gentity_t self  ) 
 

Definition at line 3770 of file NPC_spawn.c.

References gentity_t, NPC_Mouse_Precache(), gentity_s::NPC_type, and SP_NPC_spawner().

03771 {
03772         self->NPC_type = "mouse";
03773 
03774         SP_NPC_spawner( self );
03775 
03776         //precache the Mouse sounds
03777         NPC_Mouse_Precache();
03778 
03779 }

void SP_NPC_Droid_Probe gentity_t self  ) 
 

Definition at line 3614 of file NPC_spawn.c.

References gentity_t, NPC_Probe_Precache(), gentity_s::NPC_type, and SP_NPC_spawner().

03615 {
03616         self->NPC_type = "probe";
03617 
03618         SP_NPC_spawner( self );
03619 
03620         NPC_Probe_Precache();
03621 }

void SP_NPC_Droid_Protocol gentity_t self  ) 
 

Definition at line 3845 of file NPC_spawn.c.

References gentity_t, NPC_Protocol_Precache(), gentity_s::NPC_type, SP_NPC_spawner(), and gentity_s::spawnflags.

03846 {
03847         if ( self->spawnflags&1 )
03848         {//imperial skin
03849                 self->NPC_type = "protocol_imp";
03850         }
03851         else
03852         {
03853                 self->NPC_type = "protocol";
03854         }
03855 
03856         SP_NPC_spawner( self );
03857         NPC_Protocol_Precache();
03858 }

void SP_NPC_Droid_R2D2 gentity_t self  ) 
 

Definition at line 3792 of file NPC_spawn.c.

References gentity_t, NPC_R2D2_Precache(), gentity_s::NPC_type, SP_NPC_spawner(), and gentity_s::spawnflags.

03793 {
03794         if ( self->spawnflags&1 )
03795         {//imperial skin
03796                 self->NPC_type = "r2d2_imp";
03797         }
03798         else
03799         {
03800                 self->NPC_type = "r2d2";
03801         }
03802 
03803         SP_NPC_spawner( self );
03804 
03805         NPC_R2D2_Precache();
03806 }

void SP_NPC_Droid_R5D2 gentity_t self  ) 
 

Definition at line 3820 of file NPC_spawn.c.

References gentity_t, NPC_R5D2_Precache(), gentity_s::NPC_type, SP_NPC_spawner(), and gentity_s::spawnflags.

03821 {
03822         if ( self->spawnflags&1 )
03823         {//imperial skin
03824                 self->NPC_type = "r5d2_imp";
03825         }
03826         else
03827         {
03828                 self->NPC_type = "r5d2";
03829         }
03830 
03831         SP_NPC_spawner( self );
03832 
03833         NPC_R5D2_Precache();
03834 }

void SP_NPC_Droid_Remote gentity_t self  ) 
 

Definition at line 3693 of file NPC_spawn.c.

References gentity_t, NPC_Remote_Precache(), gentity_s::NPC_type, and SP_NPC_spawner().

03694 {
03695         self->NPC_type = "remote";
03696 
03697         SP_NPC_spawner( self );
03698 
03699         NPC_Remote_Precache();
03700 }

void SP_NPC_Droid_Seeker gentity_t self  ) 
 

Definition at line 3711 of file NPC_spawn.c.

References gentity_t, NPC_Seeker_Precache(), gentity_s::NPC_type, and SP_NPC_spawner().

03712 {
03713         self->NPC_type = "seeker";
03714 
03715         SP_NPC_spawner( self );
03716 
03717         NPC_Seeker_Precache();
03718 }

void SP_NPC_Droid_Sentry gentity_t self  ) 
 

Definition at line 3729 of file NPC_spawn.c.

References gentity_t, NPC_Sentry_Precache(), gentity_s::NPC_type, and SP_NPC_spawner().

03730 {
03731         self->NPC_type = "sentry";
03732 
03733         SP_NPC_spawner( self );
03734 
03735         NPC_Sentry_Precache();
03736 }

void SP_NPC_Galak gentity_t self  ) 
 

Definition at line 2778 of file NPC_spawn.c.

References gentity_t, NPC_GalakMech_Precache(), gentity_s::NPC_type, SP_NPC_spawner(), and gentity_s::spawnflags.

02779 {
02780         if ( self->spawnflags & 1 )
02781         {
02782                 self->NPC_type = "Galak_Mech";
02783                 NPC_GalakMech_Precache();
02784         }
02785         else
02786         {
02787                 self->NPC_type = "Galak";
02788         }
02789 
02790         SP_NPC_spawner( self );
02791 }

void SP_NPC_Gran gentity_t self  ) 
 

Definition at line 3078 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, Q_irand(), SP_NPC_spawner(), and gentity_s::spawnflags.

03079 {
03080         if ( !self->NPC_type )
03081         {
03082                 if ( self->spawnflags & 1 )
03083                 {
03084                         self->NPC_type = "granshooter";
03085                 }
03086                 else if ( self->spawnflags & 2 )
03087                 {
03088                         self->NPC_type = "granboxer";
03089                 }
03090                 else
03091                 {
03092                         if ( Q_irand( 0, 1 ) )
03093                         {
03094                                 self->NPC_type = "gran";
03095                         }
03096                         else
03097                         {
03098                                 self->NPC_type = "gran2";
03099                         }
03100                 }
03101         }
03102 
03103         SP_NPC_spawner( self );
03104 }

void SP_NPC_Imperial gentity_t self  ) 
 

Definition at line 3261 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, SP_NPC_spawner(), and gentity_s::spawnflags.

03262 {
03263         if ( !self->NPC_type )
03264         {
03265                 if ( self->spawnflags & 1 )
03266                 {
03267                         self->NPC_type = "ImpOfficer";
03268                 }
03269                 else if ( self->spawnflags & 2 )
03270                 {
03271                         self->NPC_type = "ImpCommander";
03272                 }
03273                 else
03274                 {
03275                         self->NPC_type = "Imperial";
03276                 }
03277         }
03278 
03279         /*
03280         if ( self->message )
03281         {//may drop a key, precache the key model and pickup sound
03282                 G_SoundIndex( "sound/weapons/key_pkup.wav" );
03283                 if ( !Q_stricmp( "goodie", self->message ) )
03284                 {
03285                         RegisterItem( FindItemForInventory( INV_GOODIE_KEY ) );
03286                 }
03287                 else
03288                 {
03289                         RegisterItem( FindItemForInventory( INV_SECURITY_KEY ) );
03290                 }
03291         }
03292         */
03293         //rwwFIXMEFIXME: Allow goodie keys
03294         SP_NPC_spawner( self );
03295 }

void SP_NPC_ImpWorker gentity_t self  ) 
 

Definition at line 3304 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, Q_irand(), and SP_NPC_spawner().

03305 {
03306         if ( !self->NPC_type )
03307         {
03308                 if ( !Q_irand( 0, 2 ) )
03309                 {
03310                         self->NPC_type = "ImpWorker";
03311                 }
03312                 else if ( Q_irand( 0, 1 ) )
03313                 {
03314                         self->NPC_type = "ImpWorker2";
03315                 }
03316                 else
03317                 {
03318                         self->NPC_type = "ImpWorker3";
03319                 }
03320         }
03321 
03322         SP_NPC_spawner( self );
03323 }

void SP_NPC_Jan gentity_t self  ) 
 

Definition at line 2362 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, and SP_NPC_spawner().

02363 {
02364         self->NPC_type = "Jan";
02365 
02366         SP_NPC_spawner( self );
02367 }

void SP_NPC_Jawa gentity_t self  ) 
 

Definition at line 3050 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, SP_NPC_spawner(), and gentity_s::spawnflags.

03051 {
03052         if ( !self->NPC_type )
03053         {
03054                 if ( (self->spawnflags&1) )
03055                 {
03056                         self->NPC_type = "jawa_armed";
03057                 }
03058                 else
03059                 {
03060                         self->NPC_type = "jawa";
03061                 }
03062         }
03063 
03064         SP_NPC_spawner( self );
03065 }

void SP_NPC_Jedi gentity_t self  ) 
 

Definition at line 2851 of file NPC_spawn.c.

References CLASS_JEDI, gentity_t, gentity_s::NPC_type, NULL, Q_irand(), SP_NPC_spawner(), gentity_s::spawnflags, and WP_SetSaberModel().

02852 {
02853         if(!self->NPC_type)
02854         {
02855                 if ( self->spawnflags & 1 )
02856                 {
02857                         self->NPC_type = "jeditrainer";
02858                 }
02859                 else 
02860                 {
02861                         /*
02862                         if ( !Q_irand( 0, 2 ) )
02863                         {
02864                                 self->NPC_type = "JediF";
02865                         }
02866                         else 
02867                         */if ( Q_irand( 0, 1 ) )
02868                         {
02869                                 self->NPC_type = "Jedi";
02870                         }
02871                         else
02872                         {
02873                                 self->NPC_type = "Jedi2";
02874                         }
02875                 }
02876         }
02877 
02878         WP_SetSaberModel( NULL, CLASS_JEDI );
02879 
02880         SP_NPC_spawner( self );
02881 }

void SP_NPC_Kyle gentity_t self  ) 
 

Definition at line 2332 of file NPC_spawn.c.

References CLASS_KYLE, gentity_t, gentity_s::NPC_type, NULL, SP_NPC_spawner(), and WP_SetSaberModel().

02333 {
02334         self->NPC_type = "Kyle";
02335 
02336         WP_SetSaberModel( NULL, CLASS_KYLE );
02337 
02338         SP_NPC_spawner( self );
02339 }

void SP_NPC_Lando gentity_t self  ) 
 

Definition at line 2348 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, and SP_NPC_spawner().

02349 {
02350         self->NPC_type = "Lando";
02351 
02352         SP_NPC_spawner( self );
02353 }

void SP_NPC_Luke gentity_t self  ) 
 

Definition at line 2376 of file NPC_spawn.c.

References CLASS_LUKE, gentity_t, gentity_s::NPC_type, NULL, SP_NPC_spawner(), and WP_SetSaberModel().

02377 {
02378         self->NPC_type = "Luke";
02379 
02380         WP_SetSaberModel( NULL, CLASS_LUKE );
02381 
02382         SP_NPC_spawner( self );
02383 }

void SP_NPC_MineMonster gentity_t self  ) 
 

Definition at line 3475 of file NPC_spawn.c.

References gentity_t, NPC_MineMonster_Precache(), gentity_s::NPC_type, and SP_NPC_spawner().

03476 {
03477         self->NPC_type = "minemonster";
03478 
03479         SP_NPC_spawner( self );
03480         NPC_MineMonster_Precache();
03481 }

void SP_NPC_MonMothma gentity_t self  ) 
 

Definition at line 2392 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, and SP_NPC_spawner().

02393 {
02394         self->NPC_type = "MonMothma";
02395 
02396         SP_NPC_spawner( self );
02397 }

void SP_NPC_Monster_Claw gentity_t self  ) 
 

Definition at line 3490 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, and SP_NPC_spawner().

03491 {
03492         self->NPC_type = "Claw";
03493 
03494         SP_NPC_spawner( self );
03495 }

void SP_NPC_Monster_Fish gentity_t self  ) 
 

Definition at line 3546 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, and SP_NPC_spawner().

03547 {
03548         self->NPC_type = "Fish";
03549 
03550         SP_NPC_spawner( self );
03551 }

void SP_NPC_Monster_Flier2 gentity_t self  ) 
 

Definition at line 3518 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, and SP_NPC_spawner().

03519 {
03520         self->NPC_type = "Flier2";
03521 
03522         SP_NPC_spawner( self );
03523 }

void SP_NPC_Monster_Glider gentity_t self  ) 
 

Definition at line 3504 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, and SP_NPC_spawner().

03505 {
03506         self->NPC_type = "Glider";
03507 
03508         SP_NPC_spawner( self );
03509 }

void SP_NPC_Monster_Howler gentity_t self  ) 
 

Definition at line 3461 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, and SP_NPC_spawner().

03462 {
03463         self->NPC_type = "howler";
03464 
03465         SP_NPC_spawner( self );
03466 }

void SP_NPC_Monster_Lizard gentity_t self  ) 
 

Definition at line 3532 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, and SP_NPC_spawner().

03533 {
03534         self->NPC_type = "Lizard";
03535 
03536         SP_NPC_spawner( self );
03537 }

void SP_NPC_Monster_Murjj gentity_t self  ) 
 

Definition at line 3433 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, and SP_NPC_spawner().

03434 {
03435         self->NPC_type = "Murjj";
03436 
03437         SP_NPC_spawner( self );
03438 }

void SP_NPC_Monster_Rancor gentity_t self  ) 
 

Definition at line 3578 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, and SP_NPC_spawner().

03579 {
03580         self->NPC_type = "rancor";
03581 
03582         SP_NPC_spawner( self );
03583 }

void SP_NPC_Monster_Swamp gentity_t self  ) 
 

Definition at line 3447 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, and SP_NPC_spawner().

03448 {
03449         self->NPC_type = "Swamp";
03450 
03451         SP_NPC_spawner( self );
03452 }

void SP_NPC_Monster_Wampa gentity_t self  ) 
 

Definition at line 3562 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, NPC_Wampa_Precache(), and SP_NPC_spawner().

03563 {
03564         self->NPC_type = "wampa";
03565 
03566         NPC_Wampa_Precache();
03567 
03568         SP_NPC_spawner( self );
03569 }

void SP_NPC_MorganKatarn gentity_t self  ) 
 

Definition at line 2830 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, and SP_NPC_spawner().

02831 {
02832         self->NPC_type = "MorganKatarn";
02833 
02834         SP_NPC_spawner( self );
02835 }

void SP_NPC_Noghri gentity_t self  ) 
 

Definition at line 3211 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, and SP_NPC_spawner().

03212 {
03213         if ( !self->NPC_type )
03214         {
03215                 self->NPC_type = "noghri";
03216         }
03217 
03218         SP_NPC_spawner( self );
03219 }

void SP_NPC_Prisoner gentity_t self  ) 
 

Definition at line 2890 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, Q_irand(), and SP_NPC_spawner().

02891 {
02892         if(!self->NPC_type)
02893         {
02894                 if ( Q_irand( 0, 1 ) )
02895                 {
02896                         self->NPC_type = "Prisoner";
02897                 }
02898                 else
02899                 {
02900                         self->NPC_type = "Prisoner2";
02901                 }
02902         }
02903 
02904         SP_NPC_spawner( self );
02905 }

void SP_NPC_Rebel gentity_t self  ) 
 

Definition at line 2914 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, Q_irand(), and SP_NPC_spawner().

02915 {
02916         if(!self->NPC_type)
02917         {
02918                 if ( Q_irand( 0, 1 ) )
02919                 {
02920                         self->NPC_type = "Rebel";
02921                 }
02922                 else
02923                 {
02924                         self->NPC_type = "Rebel2";
02925                 }
02926         }
02927 
02928         SP_NPC_spawner( self );
02929 }

void SP_NPC_Reborn gentity_t self  ) 
 

Definition at line 3366 of file NPC_spawn.c.

References CLASS_REBORN, gentity_t, gentity_s::NPC_type, NULL, SP_NPC_spawner(), gentity_s::spawnflags, and WP_SetSaberModel().

03367 {
03368         if ( !self->NPC_type )
03369         {
03370                 if ( self->spawnflags & 1 )
03371                 {
03372                         self->NPC_type = "rebornforceuser";
03373                 }
03374                 else if ( self->spawnflags & 2 )
03375                 {
03376                         self->NPC_type = "rebornfencer";
03377                 }
03378                 else if ( self->spawnflags & 4 )
03379                 {
03380                         self->NPC_type = "rebornacrobat";
03381                 }
03382                 else if ( self->spawnflags & 8 )
03383                 {
03384                         self->NPC_type = "rebornboss";
03385                 }
03386                 else
03387                 {
03388                         self->NPC_type = "reborn";
03389                 }
03390         }
03391         
03392         WP_SetSaberModel( NULL, CLASS_REBORN );
03393         SP_NPC_spawner( self );
03394 }

void SP_NPC_Reborn_New gentity_t self  ) 
 

Definition at line 2481 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, SP_NPC_spawner(), and gentity_s::spawnflags.

02482 {
02483         if ( !self->NPC_type )
02484         {
02485                 if ( (self->spawnflags&4) )
02486                 {//weaker guys
02487                         if ( (self->spawnflags&1) )
02488                         {
02489                                 self->NPC_type = "reborn_dual2";
02490                         }
02491                         else if ( (self->spawnflags&2) )
02492                         {
02493                                 self->NPC_type = "reborn_staff2";
02494                         }
02495                         else
02496                         {
02497                                 self->NPC_type = "reborn_new2";
02498                         }
02499                 }
02500                 else
02501                 {
02502                         if ( (self->spawnflags&1) )
02503                         {
02504                                 self->NPC_type = "reborn_dual";
02505                         }
02506                         else if ( (self->spawnflags&2) )
02507                         {
02508                                 self->NPC_type = "reborn_staff";
02509                         }
02510                         else
02511                         {
02512                                 self->NPC_type = "reborn_new";
02513                         }
02514                 }
02515         }
02516         
02517         SP_NPC_spawner( self );
02518 }

void SP_NPC_Reelo gentity_t self  ) 
 

Definition at line 2762 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, and SP_NPC_spawner().

02763 {
02764         self->NPC_type = "Reelo";
02765 
02766         SP_NPC_spawner( self );
02767 }

void SP_NPC_Rodian gentity_t self  ) 
 

Definition at line 3115 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, SP_NPC_spawner(), and gentity_s::spawnflags.

03116 {
03117         if ( !self->NPC_type )
03118         {
03119                 if ( self->spawnflags&1 )
03120                 {
03121                         self->NPC_type = "rodian2";
03122                 }
03123                 else
03124                 {
03125                         self->NPC_type = "rodian";
03126                 }
03127         }
03128 
03129         SP_NPC_spawner( self );
03130 }

void SP_NPC_ShadowTrooper gentity_t self  ) 
 

Definition at line 3403 of file NPC_spawn.c.

References CLASS_SHADOWTROOPER, gentity_t, NPC_ShadowTrooper_Precache(), gentity_s::NPC_type, NULL, Q_irand(), SP_NPC_spawner(), and WP_SetSaberModel().

03404 {
03405         if(!self->NPC_type)
03406         {
03407                 if ( !Q_irand( 0, 1 ) )
03408                 {
03409                         self->NPC_type = "ShadowTrooper";
03410                 }
03411                 else
03412                 {
03413                         self->NPC_type = "ShadowTrooper2";
03414                 }
03415         }
03416         
03417         NPC_ShadowTrooper_Precache();
03418         WP_SetSaberModel( NULL, CLASS_SHADOWTROOPER );
03419 
03420         SP_NPC_spawner( self );
03421 }

void SP_NPC_Snowtrooper gentity_t self  ) 
 

Definition at line 2995 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, and SP_NPC_spawner().

02996 {
02997         self->NPC_type = "snowtrooper";
02998 
02999         SP_NPC_spawner( self );
03000 }

void SP_NPC_spawner gentity_t self  ) 
 

Definition at line 1967 of file NPC_spawn.c.

References gentity_s::count, gentity_s::delay, gentity_s::fullName, g_allowNPC, G_FreeEntity(), G_SpawnInt(), gentity_t, vmCvar_t::integer, level, gentity_s::nextthink, NPC_Precache(), NPC_PrecacheAnimationCFG(), NPC_Spawn(), NPC_Spawn_Go(), gentity_s::NPC_type, qtrue, gentity_s::r, gentity_s::s, entityState_s::shouldtarget, START_TIME_REMOVE_ENTS, SVF_NO_BASIC_SOUNDS, SVF_NO_COMBAT_SOUNDS, SVF_NO_EXTRA_SOUNDS, entityShared_t::svFlags, gentity_s::targetname, gentity_s::think, level_locals_t::time, gentity_s::use, and gentity_s::wait.

Referenced by SP_NPC_Alora(), SP_NPC_Bartender(), SP_NPC_BespinCop(), SP_NPC_Cultist(), SP_NPC_Cultist_Commando(), SP_NPC_Cultist_Destroyer(), SP_NPC_Cultist_Saber(), SP_NPC_Cultist_Saber_Powers(), SP_NPC_Desann(), SP_NPC_Droid_ATST(), SP_NPC_Droid_Gonk(), SP_NPC_Droid_Interrogator(), SP_NPC_Droid_Mark1(), SP_NPC_Droid_Mark2(), SP_NPC_Droid_Mouse(), SP_NPC_Droid_Probe(), SP_NPC_Droid_Protocol(), SP_NPC_Droid_R2D2(), SP_NPC_Droid_R5D2(), SP_NPC_Droid_Remote(), SP_NPC_Droid_Seeker(), SP_NPC_Droid_Sentry(), SP_NPC_Galak(), SP_NPC_Gran(), SP_NPC_Imperial(), SP_NPC_ImpWorker(), SP_NPC_Jan(), SP_NPC_Jawa(), SP_NPC_Jedi(), SP_NPC_Kyle(), SP_NPC_Lando(), SP_NPC_Luke(), SP_NPC_MineMonster(), SP_NPC_MonMothma(), SP_NPC_Monster_Claw(), SP_NPC_Monster_Fish(), SP_NPC_Monster_Flier2(), SP_NPC_Monster_Glider(), SP_NPC_Monster_Howler(), SP_NPC_Monster_Lizard(), SP_NPC_Monster_Murjj(), SP_NPC_Monster_Rancor(), SP_NPC_Monster_Swamp(), SP_NPC_Monster_Wampa(), SP_NPC_MorganKatarn(), SP_NPC_Noghri(), SP_NPC_Prisoner(), SP_NPC_Rebel(), SP_NPC_Reborn(), SP_NPC_Reborn_New(), SP_NPC_Reelo(), SP_NPC_Rodian(), SP_NPC_ShadowTrooper(), SP_NPC_Snowtrooper(), SP_NPC_Stormtrooper(), SP_NPC_SwampTrooper(), SP_NPC_Tavion(), SP_NPC_Tavion_New(), SP_NPC_Tie_Pilot(), SP_NPC_Trandoshan(), SP_NPC_Tusken(), SP_NPC_Ugnaught(), and SP_NPC_Weequay().

01968 {
01969         int t;
01970 
01971         if (!g_allowNPC.integer)
01972         {
01973                 self->think = G_FreeEntity;
01974                 self->nextthink = level.time;
01975                 return;
01976         }
01977         if ( !self->fullName || !self->fullName[0] )
01978         {
01979                 //FIXME: make an index into an external string table for localization
01980                 self->fullName = "Humanoid Lifeform";
01981         }
01982 
01983         //register/precache the models needed for this NPC, not anymore
01984         //self->classname = "NPC_spawner";
01985 
01986         if(!self->count)
01987         {
01988                 self->count = 1;
01989         }
01990 
01991         {//Stop loading of certain extra sounds
01992                 static  int     garbage;
01993 
01994                 if ( G_SpawnInt( "noBasicSounds", "0", &garbage ) )
01995                 {
01996                         self->r.svFlags |= SVF_NO_BASIC_SOUNDS;
01997                 }
01998                 if ( G_SpawnInt( "noCombatSounds", "0", &garbage ) )
01999                 {
02000                         self->r.svFlags |= SVF_NO_COMBAT_SOUNDS;
02001                 }
02002                 if ( G_SpawnInt( "noExtraSounds", "0", &garbage ) )
02003                 {
02004                         self->r.svFlags |= SVF_NO_EXTRA_SOUNDS;
02005                 }
02006         }
02007 
02008         if ( !self->wait )
02009         {
02010                 self->wait = 500;
02011         }
02012         else
02013         {
02014                 self->wait *= 1000;//1 = 1 msec, 1000 = 1 sec
02015         }
02016 
02017         self->delay *= 1000;//1 = 1 msec, 1000 = 1 sec
02018 
02019         G_SpawnInt( "showhealth", "0", &t );
02020         if (t)
02021         {
02022                 self->s.shouldtarget = qtrue;
02023         }
02024         /*
02025         if ( self->delay > 0 )
02026         {
02027                 self->r.svFlags |= SVF_NPC_PRECACHE;
02028         }
02029         */
02030         //rwwFIXMEFIXME: support for this flag?
02031 
02032         //We have to load the animation.cfg now because spawnscripts are going to want to set anims and we need to know their length and if they're valid
02033         NPC_PrecacheAnimationCFG( self->NPC_type );
02034 
02035         //rww - can't cheat and do this on the client like in SP, so I'm doing this.
02036         NPC_Precache(self);
02037 
02038         if ( self->targetname )
02039         {//Wait for triggering
02040                 self->use = NPC_Spawn;
02041         //      self->r.svFlags |= SVF_NPC_PRECACHE;//FIXME: precache my weapons somehow?
02042 
02043                 //NPC_PrecacheModels( self->NPC_type );
02044         }
02045         else
02046         {
02047                 //NOTE: auto-spawners never check for shy spawning
02048                 //if ( spawning )
02049                 if (1) //just gonna always do this I suppose.
02050                 {//in entity spawn stage - map starting up
02051                         self->think = NPC_Spawn_Go;
02052                         self->nextthink = level.time + START_TIME_REMOVE_ENTS + 50;
02053                 }
02054                 else
02055                 {//else spawn right now
02056                         NPC_Spawn( self, self, self );
02057                 }
02058         }
02059 
02060         //FIXME: store cameraGroup somewhere else and apply to spawned NPCs' cameraGroup
02061         //Or just don't include NPC_spawners in cameraGroupings
02062 }

void SP_NPC_Stormtrooper gentity_t self  ) 
 

Definition at line 2949 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, Q_irand(), SP_NPC_spawner(), and gentity_s::spawnflags.

Referenced by SP_NPC_StormtrooperOfficer().

02950 {
02951         if ( self->spawnflags & 8 )
02952         {//rocketer
02953                 self->NPC_type = "rockettrooper";
02954         }
02955         else if ( self->spawnflags & 4 )
02956         {//alt-officer
02957                 self->NPC_type = "stofficeralt";
02958         }
02959         else if ( self->spawnflags & 2 )
02960         {//commander
02961                 self->NPC_type = "stcommander";
02962         }
02963         else if ( self->spawnflags & 1 )
02964         {//officer
02965                 self->NPC_type = "stofficer";
02966         }
02967         else
02968         {//regular trooper
02969                 if ( Q_irand( 0, 1 ) )
02970                 {
02971                         self->NPC_type = "StormTrooper";
02972                 }
02973                 else
02974                 {
02975                         self->NPC_type = "StormTrooper2";
02976                 }
02977         }
02978 
02979         SP_NPC_spawner( self );
02980 }

void SP_NPC_StormtrooperOfficer gentity_t self  ) 
 

Definition at line 2981 of file NPC_spawn.c.

References gentity_t, SP_NPC_Stormtrooper(), and gentity_s::spawnflags.

02982 {
02983         self->spawnflags |= 1;
02984         SP_NPC_Stormtrooper( self );
02985 }

void SP_NPC_SwampTrooper gentity_t self  ) 
 

Definition at line 3229 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, SP_NPC_spawner(), and gentity_s::spawnflags.

03230 {
03231         if ( !self->NPC_type )
03232         {
03233                 if ( self->spawnflags & 1 )
03234                 {
03235                         self->NPC_type = "SwampTrooper2";
03236                 }
03237                 else
03238                 {
03239                         self->NPC_type = "SwampTrooper";
03240                 }
03241         }
03242 
03243         SP_NPC_spawner( self );
03244 }

void SP_NPC_Tavion gentity_t self  ) 
 

Definition at line 2406 of file NPC_spawn.c.

References CLASS_TAVION, gentity_t, gentity_s::NPC_type, NULL, SP_NPC_spawner(), and WP_SetSaberModel().

02407 {
02408         self->NPC_type = "Tavion";
02409 
02410         WP_SetSaberModel( NULL, CLASS_TAVION );
02411 
02412         SP_NPC_spawner( self );
02413 }

void SP_NPC_Tavion_New gentity_t self  ) 
 

Definition at line 2426 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, SP_NPC_spawner(), and gentity_s::spawnflags.

02427 {
02428         if ( (self->spawnflags&1) )
02429         {
02430                 self->NPC_type = "tavion_scepter";
02431         }
02432         else if ( (self->spawnflags&2) )
02433         {
02434                 self->NPC_type = "tavion_sith_sword";
02435         }
02436         else
02437         {
02438                 self->NPC_type = "tavion_new";
02439         }
02440 
02441         SP_NPC_spawner( self );
02442 }

void SP_NPC_Tie_Pilot gentity_t self  ) 
 

Definition at line 3010 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, and SP_NPC_spawner().

03011 {
03012         self->NPC_type = "stormpilot";
03013 
03014         SP_NPC_spawner( self );
03015 }

void SP_NPC_Trandoshan gentity_t self  ) 
 

Definition at line 3170 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, and SP_NPC_spawner().

03171 {
03172         if ( !self->NPC_type )
03173         {
03174                 self->NPC_type = "Trandoshan";
03175         }
03176 
03177         SP_NPC_spawner( self );
03178 }

void SP_NPC_Tusken gentity_t self  ) 
 

Definition at line 3187 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, SP_NPC_spawner(), and gentity_s::spawnflags.

03188 {
03189         if ( !self->NPC_type )
03190         {
03191                 if ( (self->spawnflags&1) )
03192                 {
03193                         self->NPC_type = "tuskensniper";
03194                 }
03195                 else
03196                 {
03197                         self->NPC_type = "tusken";
03198                 }
03199         }
03200 
03201         SP_NPC_spawner( self );
03202 }

void SP_NPC_Ugnaught gentity_t self  ) 
 

Definition at line 3024 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, Q_irand(), and SP_NPC_spawner().

03025 {
03026         if ( !self->NPC_type )
03027         {
03028                 if ( Q_irand( 0, 1 ) )
03029                 {
03030                         self->NPC_type = "Ugnaught";
03031                 }
03032                 else
03033                 {
03034                         self->NPC_type = "Ugnaught2";
03035                 }
03036         }
03037 
03038         SP_NPC_spawner( self );
03039 }

void SP_NPC_Vehicle gentity_t self  ) 
 

Definition at line 2182 of file NPC_spawn.c.

References entityState_s::angles, ceil(), gentity_s::classname, gentity_s::delay, gentity_s::fly_sound_debounce_time, G_FreeEntity(), G_SetAngles(), G_SetOrigin(), G_SpawnFloat(), G_SpawnInt(), G_VehicleSpawn(), gentity_t, level, gentity_s::nextthink, gentity_s::NPC_type, NPC_VehiclePrecache(), NPC_VehicleSpawnUse(), entityState_s::origin, qtrue, gentity_s::s, entityState_s::shouldtarget, gentity_s::targetname, gentity_s::think, level_locals_t::time, gentity_s::use, and gentity_s::wait.

02183 {
02184         float dropTime;
02185         int             t;
02186         if ( !self->NPC_type )
02187         {
02188                 self->NPC_type = "swoop";
02189         }
02190 
02191         if ( !self->classname )
02192         {
02193                 self->classname = "NPC_Vehicle";
02194         }
02195 
02196         if ( !self->wait )
02197         {
02198                 self->wait = 500;
02199         }
02200         else
02201         {
02202                 self->wait *= 1000;//1 = 1 msec, 1000 = 1 sec
02203         }
02204         self->delay *= 1000;//1 = 1 msec, 1000 = 1 sec
02205 
02206         G_SetOrigin( self, self->s.origin );
02207         G_SetAngles( self, self->s.angles );
02208         G_SpawnFloat( "dropTime", "0", &dropTime );
02209         if ( dropTime )
02210         {
02211                 self->fly_sound_debounce_time = ceil(dropTime*1000.0);
02212         }
02213         
02214         G_SpawnInt( "showhealth", "0", &t );
02215         if (t)
02216         {
02217                 self->s.shouldtarget = qtrue;
02218         }
02219         //FIXME: PRECACHE!!!
02220 
02221         if ( self->targetname )
02222         {
02223                 if ( !NPC_VehiclePrecache( self ) )
02224                 {//FIXME: err msg?
02225                         G_FreeEntity( self );
02226                         return;
02227                 }
02228                 self->use = NPC_VehicleSpawnUse;
02229         }
02230         else
02231         {
02232                 if ( self->delay )
02233                 {
02234                         if ( !NPC_VehiclePrecache( self ) )
02235                         {//FIXME: err msg?
02236                                 G_FreeEntity( self );
02237                                 return;
02238                         }
02239                         self->think = G_VehicleSpawn;
02240                         self->nextthink = level.time + self->delay;
02241                 }
02242                 else
02243                 {
02244                         G_VehicleSpawn( self );
02245                 }
02246         }
02247 }

void SP_NPC_Weequay gentity_t self  ) 
 

Definition at line 3139 of file NPC_spawn.c.

References gentity_t, gentity_s::NPC_type, Q_irand(), and SP_NPC_spawner().

03140 {
03141         if ( !self->NPC_type )
03142         {
03143                 switch ( Q_irand( 0, 3 ) )
03144                 {
03145                 case 0:
03146                         self->NPC_type = "Weequay";
03147                         break;
03148                 case 1:
03149                         self->NPC_type = "Weequay2";
03150                         break;
03151                 case 2:
03152                         self->NPC_type = "Weequay3";
03153                         break;
03154                 case 3:
03155                         self->NPC_type = "Weequay4";
03156                         break;
03157                 }
03158         }
03159 
03160         SP_NPC_spawner( self );
03161 }

void SP_path_corner gentity_t self  ) 
 

Definition at line 1863 of file g_mover.c.

References G_FreeEntity(), G_Printf(), gentity_t, entityState_s::origin, gentity_s::s, gentity_s::targetname, and vtos().

01863                                        {
01864         if ( !self->targetname ) {
01865                 G_Printf ("path_corner with no targetname at %s\n", vtos(self->s.origin));
01866                 G_FreeEntity( self );
01867                 return;
01868         }
01869         // path corners don't need to be linked in
01870 }

void SP_point_combat gentity_t self  ) 
 

Definition at line 2516 of file NPC_combat.c.

References Com_Printf(), level_locals_t::combatPoints, entityShared_t::currentOrigin, G_CheckInSolid(), G_FreeEntity(), G_SetOrigin(), gentity_t, level, MAX_COMBAT_POINTS, level_locals_t::numCombatPoints, entityState_s::origin, qfalse, qtrue, gentity_s::r, gentity_s::s, S_COLOR_RED, gentity_s::spawnflags, trap_LinkEntity(), VectorCopy, and vtos().

02517 {
02518         if(level.numCombatPoints >= MAX_COMBAT_POINTS)
02519         {
02520 #ifndef FINAL_BUILD
02521                 Com_Printf(S_COLOR_RED"ERROR:  Too many combat points, limit is %d\n", MAX_COMBAT_POINTS);
02522 #endif
02523                 G_FreeEntity(self);
02524                 return;
02525         }
02526 
02527         self->s.origin[2] += 0.125;
02528         G_SetOrigin(self, self->s.origin);
02529         trap_LinkEntity(self);
02530 
02531         if ( G_CheckInSolid( self, qtrue ) )
02532         {
02533 #ifndef FINAL_BUILD
02534                 Com_Printf( S_COLOR_RED"ERROR: combat point at %s in solid!\n", vtos(self->r.currentOrigin) );
02535 #endif
02536         }
02537 
02538         VectorCopy( self->r.currentOrigin, level.combatPoints[level.numCombatPoints].origin );
02539         
02540         level.combatPoints[level.numCombatPoints].flags = self->spawnflags;
02541         level.combatPoints[level.numCombatPoints].occupied = qfalse;
02542 
02543         level.numCombatPoints++;
02544 
02545         G_FreeEntity(self);
02546 }

void SP_reference_tag gentity_t ent  ) 
 

Definition at line 3300 of file g_misc.c.

References gentity_t, level, gentity_s::nextthink, ref_link(), START_TIME_LINK_ENTS, gentity_s::target, gentity_s::think, and level_locals_t::time.

03301 {
03302         if ( ent->target )
03303         {
03304                 //Init cannot occur until all entities have been spawned
03305                 ent->think = ref_link;
03306                 ent->nextthink = level.time + START_TIME_LINK_ENTS;
03307         }
03308         else
03309         {
03310                 ref_link( ent );
03311         }
03312 }

void SP_shooter_blaster gentity_t ent  ) 
 

Definition at line 1172 of file g_misc.c.

References gentity_t, InitShooter(), and WP_BLASTER.

01172                                           {
01173         InitShooter( ent, WP_BLASTER);
01174 }

void SP_target_activate gentity_t self  ) 
 

Definition at line 930 of file g_target.c.

References G_SetOrigin(), gentity_t, entityState_s::origin, gentity_s::s, target_activate_use(), and gentity_s::use.

00931 {
00932         G_SetOrigin( self, self->s.origin );
00933         self->use = target_activate_use;
00934 }

void SP_target_character gentity_t ent  ) 
 

void SP_target_counter gentity_t self  ) 
 

Definition at line 660 of file g_target.c.

References gentity_s::count, gentity_s::genericValue1, gentity_t, target_counter_use(), gentity_s::use, and gentity_s::wait.

00661 {
00662         self->wait = -1;
00663         if (!self->count)
00664         {
00665                 self->count = 2;
00666         }
00667         //if ( self->bounceCount > 0 )//let's always set this anyway
00668         {//we will reset when we use up our count, remember our initial count
00669                 self->genericValue1 = self->count;
00670         }
00671 
00672         self->use = target_counter_use;
00673 }

void SP_target_deactivate gentity_t self  ) 
 

Definition at line 939 of file g_target.c.

References G_SetOrigin(), gentity_t, entityState_s::origin, gentity_s::s, target_deactivate_use(), and gentity_s::use.

00940 {
00941         G_SetOrigin( self, self->s.origin );
00942         self->use = target_deactivate_use;
00943 }

void SP_target_delay gentity_t ent  ) 
 

Definition at line 93 of file g_target.c.

References G_SpawnFloat(), gentity_t, gentity_s::use, Use_Target_Delay(), and gentity_s::wait.

00093                                        {
00094         // check delay for backwards compatability
00095         if ( !G_SpawnFloat( "delay", "0", &ent->wait ) ) {
00096                 G_SpawnFloat( "wait", "1", &ent->wait );
00097         }
00098 
00099         if ( !ent->wait ) {
00100                 ent->wait = 1;
00101         }
00102         ent->use = Use_Target_Delay;
00103 }

void SP_target_escapetrig gentity_t ent  ) 
 

Definition at line 2599 of file g_misc.c.

References G_FreeEntity(), g_gametype, G_SpawnInt(), gentity_s::genericValue5, gentity_s::genericValue6, gentity_t, GT_SINGLE_PLAYER, vmCvar_t::integer, gentity_s::use, and Use_Target_Escapetrig().

02600 {
02601         if (g_gametype.integer != GT_SINGLE_PLAYER)
02602         {
02603                 G_FreeEntity(ent);
02604                 return;
02605         }
02606 
02607         G_SpawnInt( "escapetime", "60000", &ent->genericValue5);
02608         //time given (in ms) for the escape
02609         G_SpawnInt( "escapegoal", "0", &ent->genericValue6);
02610         //if non-0, when used, will end an ongoing escape instead of start it
02611 
02612         ent->use = Use_Target_Escapetrig;
02613 }

void SP_target_give gentity_t ent  ) 
 

Definition at line 36 of file g_target.c.

References gentity_t, gentity_s::use, and Use_Target_Give().

00036                                       {
00037         ent->use = Use_Target_Give;
00038 }

void SP_target_interest gentity_t self  ) 
 

Definition at line 915 of file NPC_senses.c.

References Com_Printf(), entityShared_t::currentOrigin, G_FreeEntity(), G_NewString(), gentity_t, level_locals_t::interestPoints, level, MAX_INTEREST_POINTS, level_locals_t::numInterestPoints, gentity_s::r, gentity_s::target, and VectorCopy.

00916 {//FIXME: rename point_interest
00917         if(level.numInterestPoints >= MAX_INTEREST_POINTS)
00918         {
00919                 Com_Printf("ERROR:  Too many interest points, limit is %d\n", MAX_INTEREST_POINTS);
00920                 G_FreeEntity(self);
00921                 return;
00922         }
00923 
00924         VectorCopy(self->r.currentOrigin, level.interestPoints[level.numInterestPoints].origin);
00925 
00926         if(self->target && self->target[0])
00927         {
00928                 level.interestPoints[level.numInterestPoints].target = G_NewString( self->target );
00929         }
00930 
00931         level.numInterestPoints++;
00932 
00933         G_FreeEntity(self);
00934 }

void SP_target_kill gentity_t ent  ) 
 

Definition at line 539 of file g_target.c.

References gentity_t, target_kill_use(), and gentity_s::use.

00539                                        {
00540         self->use = target_kill_use;
00541 }

void SP_target_laser gentity_t self  ) 
 

Definition at line 430 of file g_target.c.

References FRAMETIME, gentity_t, level, gentity_s::nextthink, target_laser_start(), gentity_s::think, and level_locals_t::time.

00431 {
00432         // let everything else get spawned before we start firing
00433         self->think = target_laser_start;
00434         self->nextthink = level.time + FRAMETIME;
00435 }

void SP_target_level_change gentity_t self  ) 
 

Definition at line 955 of file g_target.c.

References G_Error(), G_NewString(), G_SetOrigin(), G_SpawnString(), gentity_t, gentity_s::message, entityState_s::origin, gentity_s::s, target_level_change_use(), and gentity_s::use.

00956 {
00957         char *s;
00958 
00959         G_SpawnString( "mapname", "", &s );
00960         self->message = G_NewString(s);
00961 
00962         if ( !self->message || !self->message[0] )
00963         {
00964                 G_Error( "target_level_change with no mapname!\n");
00965                 return;
00966         }
00967 
00968         G_SetOrigin( self, self->s.origin );
00969         self->use = target_level_change_use;
00970 }

void SP_target_location gentity_t ent  ) 
 

Definition at line 592 of file g_target.c.

References G_SetOrigin(), gentity_t, level, gentity_s::nextthink, entityState_s::origin, gentity_s::s, gentity_s::think, and level_locals_t::time.

00592                                           {
00593         self->think = target_location_linkup;
00594         self->nextthink = level.time + 200;  // Let them all spawn first
00595 
00596         G_SetOrigin( self, self->s.origin );
00597 }

void SP_target_play_music gentity_t self  ) 
 

Definition at line 989 of file g_target.c.

References G_Error(), G_NewString(), G_SetOrigin(), G_SpawnString(), gentity_t, gentity_s::message, entityState_s::origin, gentity_s::s, target_play_music_use(), gentity_s::use, and vtos().

00990 {
00991         char *s;
00992 
00993         G_SetOrigin( self, self->s.origin );
00994         if (!G_SpawnString( "music", "", &s ))
00995         {
00996                 G_Error( "target_play_music without a music key at %s", vtos( self->s.origin ) );
00997         }
00998 
00999         self->message = G_NewString(s);
01000 
01001         self->use = target_play_music_use;
01002 }

void SP_target_position gentity_t ent  ) 
 

Definition at line 546 of file g_target.c.

References G_SetOrigin(), gentity_t, entityState_s::origin, and gentity_s::s.

00546                                           {
00547         G_SetOrigin( self, self->s.origin );
00548         /*
00549         G_SetAngles( self, self->s.angles );
00550         self->s.eType = ET_INVISIBLE;
00551         */
00552 }

void SP_target_print gentity_t ent  ) 
 

Definition at line 239 of file g_target.c.

References gentity_t, gentity_s::use, and Use_Target_Print().

00239                                        {
00240         ent->use = Use_Target_Print;
00241 }

void SP_target_push gentity_t ent  ) 
 

Definition at line 1168 of file g_trigger.c.

References entityShared_t::absmax, entityShared_t::absmin, AimAtTarget(), entityState_s::angles, FRAMETIME, G_SetMovedir(), G_SoundIndex(), gentity_t, level, gentity_s::nextthink, gentity_s::noise_index, entityState_s::origin, entityState_s::origin2, gentity_s::r, gentity_s::s, gentity_s::spawnflags, gentity_s::speed, gentity_s::target, gentity_s::think, level_locals_t::time, gentity_s::use, Use_target_push(), VectorCopy, and VectorScale.

01168                                        {
01169         if (!self->speed) {
01170                 self->speed = 1000;
01171         }
01172         G_SetMovedir (self->s.angles, self->s.origin2);
01173         VectorScale (self->s.origin2, self->speed, self->s.origin2);
01174 
01175         if ( self->spawnflags & 1 ) {
01176                 self->noise_index = G_SoundIndex("sound/weapons/force/jump.wav");
01177         } else {
01178                 self->noise_index = 0;  //G_SoundIndex("sound/misc/windfly.wav");
01179         }
01180         if ( self->target ) {
01181                 VectorCopy( self->s.origin, self->r.absmin );
01182                 VectorCopy( self->s.origin, self->r.absmax );
01183                 self->think = AimAtTarget;
01184                 self->nextthink = level.time + FRAMETIME;
01185         }
01186         self->use = Use_target_push;
01187 }

void SP_target_random gentity_t self  ) 
 

Definition at line 748 of file g_target.c.

References gentity_t, target_random_use(), and gentity_s::use.

00749 {
00750         self->use = target_random_use;
00751 }

void SP_target_relay gentity_t ent  ) 
 

Definition at line 520 of file g_target.c.

References FL_INACTIVE, gentity_s::flags, gentity_t, gentity_s::spawnflags, target_relay_use(), and gentity_s::use.

00520                                        {
00521         self->use = target_relay_use;
00522         if ( self->spawnflags&128 )
00523         {
00524                 self->flags |= FL_INACTIVE;
00525         }
00526 }

void SP_target_remove_powerups gentity_t ent  ) 
 

Definition at line 63 of file g_target.c.

References gentity_t, gentity_s::use, and Use_target_remove_powerups().

00063                                                  {
00064         ent->use = Use_target_remove_powerups;
00065 }

void SP_target_score gentity_t ent  ) 
 

Definition at line 117 of file g_target.c.

References gentity_s::count, gentity_t, gentity_s::use, and Use_Target_Score().

00117                                        {
00118         if ( !ent->count ) {
00119                 ent->count = 1;
00120         }
00121         ent->use = Use_Target_Score;
00122 }

void SP_target_screenshake gentity_t ent  ) 
 

Definition at line 2555 of file g_misc.c.

References G_SpawnFloat(), G_SpawnInt(), gentity_s::genericValue5, gentity_s::genericValue6, gentity_t, gentity_s::speed, gentity_s::use, and Use_Target_Screenshake().

02556 {
02557         G_SpawnFloat( "intensity", "10", &ent->speed );
02558         //intensity of the shake
02559         G_SpawnInt( "duration", "800", &ent->genericValue5 );
02560         //duration of the shake
02561         G_SpawnInt( "globalshake", "1", &ent->genericValue6 );
02562         //non-0 if shake should be global (all clients). Otherwise, only in the PVS.
02563 
02564         ent->use = Use_Target_Screenshake;
02565 }

void SP_target_scriptrunner gentity_t self  ) 
 

Definition at line 871 of file g_target.c.

References gentity_s::count, gentity_s::delay, FL_INACTIVE, gentity_s::flags, G_SetOrigin(), G_SpawnFloat(), gentity_t, entityState_s::origin, gentity_s::s, gentity_s::spawnflags, target_scriptrunner_use(), gentity_s::use, and gentity_s::wait.

00872 {
00873         float v;
00874         if ( self->spawnflags & 128 )
00875         {
00876                 self->flags |= FL_INACTIVE;
00877         }
00878 
00879         if ( !self->count )
00880         {
00881                 self->count = 1;//default 1 use only
00882         }
00883         /*
00884         else if ( !self->wait )
00885         {
00886                 self->wait = 1;//default wait of 1 sec
00887         }
00888         */
00889         // FIXME: this is a hack... because delay is read in as an int, so I'm bypassing that because it's too late in the project to change it and I want to be able to set less than a second delays
00890         // no one should be setting a radius on a scriptrunner, if they are this would be bad, take this out for the next project
00891         v = 0.0f;
00892         G_SpawnFloat( "delay", "0", &v );
00893         self->delay = v * 1000;//sec to ms
00894         self->wait *= 1000;//sec to ms
00895 
00896         G_SetOrigin( self, self->s.origin );
00897         self->use = target_scriptrunner_use;
00898 }

void SP_target_siege_end gentity_t ent  ) 
 

Definition at line 1325 of file g_saga.c.

References G_FreeEntity(), g_gametype, gentity_t, GT_SIEGE, vmCvar_t::integer, siege_valid, siegeEndUse(), and gentity_s::use.

01326 {
01327         if (!siege_valid || g_gametype.integer != GT_SIEGE)
01328         {
01329                 G_FreeEntity(ent);
01330                 return;
01331         }
01332 
01333         ent->use = siegeEndUse;
01334 }

void SP_target_speaker gentity_t ent  ) 
 

Definition at line 286 of file g_target.c.

References entityState_s::clientNum, EF_PERMANENT, entityState_s::eFlags, ET_SPEAKER, entityState_s::eType, entityState_s::eventParm, entityState_s::frame, G_Error(), G_SoundIndex(), G_SoundSetIndex(), G_SpawnFloat(), G_SpawnString(), gentity_t, entityState_s::loopIsSoundset, entityState_s::loopSound, MAX_QPATH, gentity_s::noise_index, entityState_s::origin, entityState_s::pos, Q_strncpyz(), qfalse, gentity_s::r, gentity_s::random, gentity_s::s, entityState_s::soundSetIndex, gentity_s::spawnflags, SVF_BROADCAST, entityShared_t::svFlags, trap_LinkEntity(), trajectory_t::trBase, gentity_s::use, Use_Target_Speaker(), VectorCopy, vtos(), and gentity_s::wait.

00286                                          {
00287         char    buffer[MAX_QPATH];
00288         char    *s;
00289 
00290         G_SpawnFloat( "wait", "0", &ent->wait );
00291         G_SpawnFloat( "random", "0", &ent->random );
00292 
00293         if ( G_SpawnString ( "soundSet", "", &s ) )
00294         {       // this is a sound set
00295                 ent->s.soundSetIndex = G_SoundSetIndex(s);
00296                 ent->s.eFlags = EF_PERMANENT;
00297                 VectorCopy( ent->s.origin, ent->s.pos.trBase );
00298                 trap_LinkEntity (ent);
00299                 return;
00300         }
00301 
00302         if ( !G_SpawnString( "noise", "NOSOUND", &s ) ) {
00303                 G_Error( "target_speaker without a noise key at %s", vtos( ent->s.origin ) );
00304         }
00305 
00306         // force all client reletive sounds to be "activator" speakers that
00307         // play on the entity that activates it
00308         if ( s[0] == '*' ) {
00309                 ent->spawnflags |= 8;
00310         }
00311 
00312         Q_strncpyz( buffer, s, sizeof(buffer) );
00313 
00314         ent->noise_index = G_SoundIndex(buffer);
00315 
00316         // a repeating speaker can be done completely client side
00317         ent->s.eType = ET_SPEAKER;
00318         ent->s.eventParm = ent->noise_index;
00319         ent->s.frame = ent->wait * 10;
00320         ent->s.clientNum = ent->random * 10;
00321 
00322 
00323         // check for prestarted looping sound
00324         if ( ent->spawnflags & 1 ) {
00325                 ent->s.loopSound = ent->noise_index;
00326                 ent->s.loopIsSoundset = qfalse;
00327         }
00328 
00329         ent->use = Use_Target_Speaker;
00330 
00331         if (ent->spawnflags & 4) {
00332                 ent->r.svFlags |= SVF_BROADCAST;
00333         }
00334 
00335         VectorCopy( ent->s.origin, ent->s.pos.trBase );
00336 
00337         // must link the entity so we get areas and clusters so
00338         // the server can determine who to send updates to
00339         trap_LinkEntity( ent );
00340 }

void SP_target_teleporter gentity_t ent  ) 
 

Definition at line 460 of file g_target.c.

References gentity_s::classname, G_Printf(), gentity_t, entityState_s::origin, gentity_s::s, target_teleporter_use(), gentity_s::targetname, gentity_s::use, and vtos().

00460                                              {
00461         if (!self->targetname)
00462                 G_Printf("untargeted %s at %s\n", self->classname, vtos(self->s.origin));
00463 
00464         self->use = target_teleporter_use;
00465 }

void SP_team_CTF_blueplayer gentity_t ent  ) 
 

Definition at line 1207 of file g_team.c.

References gentity_t.

01207                                               {
01208 }

void SP_team_CTF_bluespawn gentity_t ent  ) 
 

Definition at line 1222 of file g_team.c.

References gentity_t.

01222                                            {
01223 }

void SP_team_CTF_redplayer gentity_t ent  ) 
 

Definition at line 1200 of file g_team.c.

References gentity_t.

01200                                              {
01201 }

void SP_team_CTF_redspawn gentity_t ent  ) 
 

Definition at line 1215 of file g_team.c.

References gentity_t.

01215                                           {
01216 }

void SP_terrain gentity_t ent  ) 
 

Definition at line 484 of file g_misc.c.

References entityState_s::angles, atof(), atoi(), entityShared_t::contents, CONTENTS_TERRAIN, CS_TERRAINS, EF_PERMANENT, entityState_s::eFlags, ET_TERRAIN, entityState_s::eType, g_RMG, G_SpawnString(), gentity_t, Info_SetValueForKey(), vmCvar_t::integer, MAX_INFO_STRING, MAX_INSTANCE_TYPES, MAX_QPATH, entityShared_t::maxs, entityShared_t::mins, gentity_s::model, entityState_s::modelindex, gentity_s::r, gentity_s::s, strlen(), SVF_NOCLIENT, entityShared_t::svFlags, trap_CM_RegisterTerrain(), trap_Cvar_Set(), trap_Cvar_VariableStringBuffer(), trap_LinkEntity(), trap_RMG_Init(), trap_SetBrushModel(), trap_SetConfigstring(), va(), and VectorClear.

00485 {
00486         char                            temp[MAX_INFO_STRING];
00487         char                            final[MAX_QPATH];
00488         char                            seed[MAX_QPATH];
00489         char                            missionType[MAX_QPATH];
00490         //char                          soundSet[MAX_QPATH];
00491         int                                     shaderNum, i;
00492         char                            *value;
00493         int                                     terrainID;
00494 
00495         //Force it to 1 when there is terrain on the level.
00496         trap_Cvar_Set("RMG", "1");
00497         g_RMG.integer = 1;
00498 
00499         VectorClear (ent->s.angles);
00500         trap_SetBrushModel( ent, ent->model );
00501 
00502         // Get the shader from the top of the brush
00503 //      shaderNum = gi.CM_GetShaderNum(s.modelindex);
00504         shaderNum = 0;
00505 
00506         if (g_RMG.integer)
00507         {
00508                 /*
00509                 // Grab the default terrain file from the RMG cvar
00510                 trap_Cvar_VariableStringBuffer("RMG_terrain", temp, MAX_QPATH);
00511                 Com_sprintf(final, MAX_QPATH, "%s", temp);
00512                 AddSpawnField("terrainDef", temp);
00513  
00514                 trap_Cvar_VariableStringBuffer("RMG_instances", temp, MAX_QPATH);
00515                 Com_sprintf(final, MAX_QPATH, "%s", temp);
00516                 AddSpawnField("instanceDef", temp);
00517 
00518                 trap_Cvar_VariableStringBuffer("RMG_miscents", temp, MAX_QPATH);
00519                 Com_sprintf(final, MAX_QPATH, "%s", temp);
00520                 AddSpawnField("miscentDef", temp);
00521                 */
00522                 //rww - disabled for now, don't want cvar overrides.
00523 
00524                 trap_Cvar_VariableStringBuffer("RMG_seed", seed, MAX_QPATH);
00525                 trap_Cvar_VariableStringBuffer("RMG_mission", missionType, MAX_QPATH);
00526 
00527                 //rww - May want to implement these at some point.
00528                 //trap_Cvar_VariableStringBuffer("RMG_soundset", soundSet, MAX_QPATH);
00529                 //trap_SetConfigstring(CS_AMBIENT_SOUNDSETS, soundSet );
00530         }
00531 
00532         // Get info required for the common init
00533         temp[0] = 0;
00534         G_SpawnString("heightmap", "", &value);
00535         Info_SetValueForKey(temp, "heightMap", value);
00536 
00537         G_SpawnString("numpatches", "400", &value);
00538         Info_SetValueForKey(temp, "numPatches", va("%d", atoi(value)));
00539 
00540         G_SpawnString("terxels", "4", &value);
00541         Info_SetValueForKey(temp, "terxels", va("%d", atoi(value)));
00542 
00543         Info_SetValueForKey(temp, "seed", seed);
00544         Info_SetValueForKey(temp, "minx", va("%f", ent->r.mins[0]));
00545         Info_SetValueForKey(temp, "miny", va("%f", ent->r.mins[1]));
00546         Info_SetValueForKey(temp, "minz", va("%f", ent->r.mins[2]));
00547         Info_SetValueForKey(temp, "maxx", va("%f", ent->r.maxs[0]));
00548         Info_SetValueForKey(temp, "maxy", va("%f", ent->r.maxs[1]));
00549         Info_SetValueForKey(temp, "maxz", va("%f", ent->r.maxs[2]));
00550 
00551         Info_SetValueForKey(temp, "modelIndex", va("%d", ent->s.modelindex));
00552 
00553         G_SpawnString("terraindef", "grassyhills", &value);
00554         Info_SetValueForKey(temp, "terrainDef", value);
00555 
00556         G_SpawnString("instancedef", "", &value);
00557         Info_SetValueForKey(temp, "instanceDef", value);
00558 
00559         G_SpawnString("miscentdef", "", &value);
00560         Info_SetValueForKey(temp, "miscentDef", value);
00561 
00562         Info_SetValueForKey(temp, "missionType", missionType);
00563         
00564         for(i = 0; i < MAX_INSTANCE_TYPES; i++)
00565         {
00566                 trap_Cvar_VariableStringBuffer(va("RMG_instance%d", i), final, MAX_QPATH);
00567                 if(strlen(final))
00568                 {
00569                         Info_SetValueForKey(temp, va("inst%d", i), final);
00570                 }
00571         }
00572 
00573         // Set additional data required on the client only
00574         G_SpawnString("densitymap", "", &value);
00575         Info_SetValueForKey(temp, "densityMap", value);
00576 
00577         Info_SetValueForKey(temp, "shader", va("%d", shaderNum));
00578         G_SpawnString("texturescale", "0.005", &value);
00579         Info_SetValueForKey(temp, "texturescale", va("%f", atof(value)));
00580 
00581         // Initialise the common aspects of the terrain
00582         terrainID = trap_CM_RegisterTerrain(temp);
00583 //      SetCommon(common);
00584 
00585         Info_SetValueForKey(temp, "terrainId", va("%d", terrainID));
00586 
00587         // Let the entity know if it is random generated or not
00588 //      SetIsRandom(common->GetIsRandom());
00589 
00590         // Let the game remember everything
00591         //level.landScapes[terrainID] = ent; //rww - also not referenced
00592 
00593         // Send all the data down to the client
00594         trap_SetConfigstring(CS_TERRAINS + terrainID, temp);
00595 
00596         // Make sure the contents are properly set
00597         ent->r.contents = CONTENTS_TERRAIN;
00598         ent->r.svFlags = SVF_NOCLIENT;
00599         ent->s.eFlags = EF_PERMANENT;
00600         ent->s.eType = ET_TERRAIN;
00601 
00602         // Hook into the world so physics will work
00603         trap_LinkEntity(ent);
00604 
00605         // If running RMG then initialize the terrain and handle team skins
00606         if ( g_RMG.integer ) 
00607         {
00608                 trap_RMG_Init(terrainID);
00609 
00610                 /*
00611                 if ( level.gametypeData->teams )
00612                 {
00613                         char temp[MAX_QPATH];
00614 
00615                         // Red team change from RMG ?
00616                         trap_GetConfigstring ( CS_GAMETYPE_REDTEAM, temp, MAX_QPATH );
00617                         if ( Q_stricmp ( temp, level.gametypeTeam[TEAM_RED] ) )
00618                         {
00619                                 level.gametypeTeam[TEAM_RED] = trap_VM_LocalStringAlloc ( temp );
00620                         }
00621 
00622                         // Blue team change from RMG ?
00623                         trap_GetConfigstring ( CS_GAMETYPE_BLUETEAM, temp, MAX_QPATH );
00624                         if ( Q_stricmp ( temp, level.gametypeTeam[TEAM_BLUE] ) )
00625                         {
00626                                 level.gametypeTeam[TEAM_BLUE] = trap_VM_LocalStringAlloc ( temp );
00627                         }
00628                 }
00629                 */
00630         }
00631 }

void SP_trigger_always gentity_t ent  ) 
 

Definition at line 880 of file g_trigger.c.

References gentity_t, level, gentity_s::nextthink, gentity_s::think, level_locals_t::time, and trigger_always_think().

00880                                         {
00881         // we must have some delay to make sure our use targets are present
00882         ent->nextthink = level.time + 300;
00883         ent->think = trigger_always_think;
00884 }

void SP_trigger_asteroid_field gentity_t self  ) 
 

Definition at line 1960 of file g_trigger.c.

References asteroid_field_think(), entityShared_t::contents, gentity_s::count, gentity_t, gentity_s::health, level, gentity_s::model, gentity_s::nextthink, gentity_s::r, gentity_s::speed, gentity_s::think, level_locals_t::time, trap_LinkEntity(), and trap_SetBrushModel().

01961 {
01962         trap_SetBrushModel( self, self->model );
01963         self->r.contents = 0;
01964 
01965         if ( !self->count )
01966         {
01967                 self->health = 20;
01968         }
01969 
01970         if ( !self->speed )
01971         {
01972                 self->speed = 10000;
01973         }
01974 
01975         self->think = asteroid_field_think;
01976         self->nextthink = level.time + 100;
01977 
01978     trap_LinkEntity(self);
01979 }

void SP_trigger_hurt gentity_t ent  ) 
 

Definition at line 1410 of file g_trigger.c.

References entityShared_t::contents, CONTENTS_TRIGGER, gentity_s::damage, G_SoundIndex(), gentity_t, gTrigFallSound, hurt_touch(), hurt_use(), InitTrigger(), entityShared_t::linked, gentity_s::noise_index, gentity_s::r, gentity_s::spawnflags, gentity_s::touch, trap_LinkEntity(), trap_UnlinkEntity(), and gentity_s::use.

01410                                         {
01411         InitTrigger (self);
01412 
01413         gTrigFallSound = G_SoundIndex("*falling1.wav");
01414 
01415         self->noise_index = G_SoundIndex( "sound/weapons/force/speed.wav" );
01416         self->touch = hurt_touch;
01417 
01418         if ( !self->damage ) {
01419                 self->damage = 5;
01420         }
01421 
01422         self->r.contents = CONTENTS_TRIGGER;
01423 
01424         if ( self->spawnflags & 2 ) {
01425                 self->use = hurt_use;
01426         }
01427 
01428         // link in to the world if starting active
01429         if ( ! (self->spawnflags & 1) ) {
01430                 trap_LinkEntity (self);
01431         }
01432         else if (self->r.linked)
01433         {
01434                 trap_UnlinkEntity(self);
01435         }
01436 }

void SP_trigger_hyperspace gentity_t self  ) 
 

Definition at line 1704 of file g_trigger.c.

References entityShared_t::absmax, entityShared_t::absmin, entityShared_t::contents, CONTENTS_TRIGGER, gentity_s::delay, G_Error(), G_SoundIndex(), gentity_t, hyperspace_touch(), InitTrigger(), gentity_s::r, gentity_s::target, gentity_s::target2, gentity_s::touch, and trap_LinkEntity().

01705 {
01706         //register the hyperspace end sound (start sounds are customized)
01707         G_SoundIndex( "sound/vehicles/common/hyperend.wav" );
01708 
01709         InitTrigger(self);
01710         self->r.contents = CONTENTS_TRIGGER;
01711         
01712         if (!self->target || !self->target[0])
01713         {
01714                 G_Error("trigger_hyperspace without a target.");
01715         }
01716         if (!self->target2 || !self->target2[0])
01717         {
01718                 G_Error("trigger_hyperspace without a target2.");
01719         }
01720         
01721         self->delay = Distance( self->r.absmax, self->r.absmin );//my size
01722 
01723         self->touch = hyperspace_touch;
01724 
01725     trap_LinkEntity(self);
01726 
01727         //self->think = trigger_hyperspace_find_targets;
01728         //self->nextthink = level.time + FRAMETIME;
01729 }

void SP_trigger_lightningstrike gentity_t ent  ) 
 

Definition at line 824 of file g_trigger.c.

References Com_Error(), gentity_s::damage, ERR_DROP, G_EffectIndex(), G_SpawnString(), gentity_s::genericValue1, gentity_s::genericValue2, gentity_t, InitTrigger(), level, gentity_s::nextthink, gentity_s::random, gentity_s::spawnflags, gentity_s::think, Think_Strike(), level_locals_t::time, trap_LinkEntity(), gentity_s::use, Use_Strike(), and gentity_s::wait.

00825 {
00826         char *s;
00827 
00828         ent->use = Use_Strike;
00829         ent->think = Think_Strike;
00830         ent->nextthink = level.time + 500;
00831 
00832         G_SpawnString("lightningfx", "", &s);
00833         if (!s || !s[0])
00834         {
00835                 Com_Error(ERR_DROP, "trigger_lightningstrike with no lightningfx");
00836         }
00837 
00838         //get a configstring index for it
00839         ent->genericValue2 = G_EffectIndex(s);
00840 
00841         if (ent->spawnflags & 1)
00842         { //START_OFF
00843                 ent->genericValue1 = 1;
00844         }
00845 
00846         if (!ent->wait)
00847         { //default 1000
00848                 ent->wait = 1000;
00849         }
00850         if (!ent->random)
00851         { //default 2000
00852                 ent->random = 2000;
00853         }
00854         if (!ent->damage)
00855         { //default 50
00856                 ent->damage = 50;
00857         }
00858 
00859         InitTrigger( ent );
00860         trap_LinkEntity (ent);
00861 }

void SP_trigger_multiple gentity_t ent  ) 
 

Definition at line 607 of file g_trigger.c.

References gentity_s::alliedTeam, atoi(), Com_Printf(), gentity_s::delay, FRAMETIME, G_SoundIndex(), G_SpawnInt(), G_SpawnString(), gentity_s::genericValue1, gentity_s::genericValue2, gentity_s::genericValue7, gentity_t, InitTrigger(), gentity_s::noise_index, NULL, gentity_s::random, S_COLOR_YELLOW, gentity_s::speed, gentity_s::target2, gentity_s::team, gentity_s::touch, Touch_Multi(), trap_LinkEntity(), gentity_s::use, Use_Multi(), and gentity_s::wait.

00608 {
00609         char    *s;
00610         if ( G_SpawnString( "noise", "", &s ) ) 
00611         {
00612                 if (s && s[0])
00613                 {
00614                         ent->noise_index = G_SoundIndex(s);
00615                 }
00616                 else
00617                 {
00618                         ent->noise_index = 0;
00619                 }
00620         }
00621 
00622         G_SpawnInt("usetime", "0", &ent->genericValue7);
00623 
00624         //For siege gametype
00625         G_SpawnInt("siegetrig", "0", &ent->genericValue1);
00626     G_SpawnInt("teambalance", "0", &ent->genericValue2);
00627 
00628         G_SpawnInt("delay", "0", &ent->delay);
00629 
00630         if ( (ent->wait > 0) && (ent->random >= ent->wait) ) {
00631                 ent->random = ent->wait - FRAMETIME;
00632                 Com_Printf(S_COLOR_YELLOW"trigger_multiple has random >= wait\n");
00633         }
00634 
00635         ent->delay *= 1000;//1 = 1 msec, 1000 = 1 sec
00636         if ( !ent->speed && ent->target2 && ent->target2[0] )
00637         {
00638                 ent->speed = 1000;
00639         }
00640         else
00641         {
00642                 ent->speed *= 1000;
00643         }
00644 
00645         ent->touch = Touch_Multi;
00646         ent->use   = Use_Multi;
00647 
00648         if ( ent->team && ent->team[0] )
00649         {
00650                 ent->alliedTeam = atoi(ent->team);
00651                 ent->team = NULL;
00652         }
00653 
00654         InitTrigger( ent );
00655         trap_LinkEntity (ent);
00656 }

void SP_trigger_once gentity_t ent  ) 
 

Definition at line 694 of file g_trigger.c.

References gentity_s::alliedTeam, atoi(), gentity_s::delay, G_SoundIndex(), G_SpawnInt(), G_SpawnString(), gentity_s::genericValue1, gentity_s::genericValue7, gentity_t, InitTrigger(), gentity_s::noise_index, NULL, gentity_s::team, gentity_s::touch, Touch_Multi(), trap_LinkEntity(), gentity_s::use, Use_Multi(), and gentity_s::wait.

00695 {
00696         char    *s;
00697         if ( G_SpawnString( "noise", "", &s ) ) 
00698         {
00699                 if (s && s[0])
00700                 {
00701                         ent->noise_index = G_SoundIndex(s);
00702                 }
00703                 else
00704                 {
00705                         ent->noise_index = 0;
00706                 }
00707         }
00708 
00709         G_SpawnInt("usetime", "0", &ent->genericValue7);
00710 
00711         //For siege gametype
00712         G_SpawnInt("siegetrig", "0", &ent->genericValue1);
00713 
00714         G_SpawnInt("delay", "0", &ent->delay);
00715 
00716         ent->wait = -1;
00717 
00718         ent->touch = Touch_Multi;
00719         ent->use   = Use_Multi;
00720 
00721         if ( ent->team && ent->team[0] )
00722         {
00723                 ent->alliedTeam = atoi(ent->team);
00724                 ent->team = NULL;
00725         }
00726 
00727         ent->delay *= 1000;//1 = 1 msec, 1000 = 1 sec
00728 
00729         InitTrigger( ent );
00730         trap_LinkEntity (ent);
00731 }

void SP_trigger_push gentity_t ent  ) 
 

Definition at line 1112 of file g_trigger.c.

References AimAtTarget(), ET_PUSH_TRIGGER, entityState_s::eType, FRAMETIME, G_SoundIndex(), gentity_t, InitTrigger(), level, gentity_s::nextthink, gentity_s::r, gentity_s::s, gentity_s::spawnflags, gentity_s::speed, SVF_NOCLIENT, entityShared_t::svFlags, gentity_s::think, level_locals_t::time, gentity_s::touch, trap_LinkEntity(), and trigger_push_touch().

01112                                         {
01113         InitTrigger (self);
01114 
01115         // unlike other triggers, we need to send this one to the client
01116         self->r.svFlags &= ~SVF_NOCLIENT;
01117 
01118         // make sure the client precaches this sound
01119         G_SoundIndex("sound/weapons/force/jump.wav");
01120 
01121         self->s.eType = ET_PUSH_TRIGGER;
01122         
01123         if ( !(self->spawnflags&2) )
01124         {//start on
01125                 self->touch = trigger_push_touch;
01126         }
01127 
01128         if ( self->spawnflags & 4 )
01129         {//linear
01130                 self->speed = 1000;
01131         }
01132 
01133         self->think = AimAtTarget;
01134         self->nextthink = level.time + FRAMETIME;
01135         trap_LinkEntity (self);
01136 }

void SP_trigger_shipboundary gentity_t self  ) 
 

Definition at line 1571 of file g_trigger.c.

References entityShared_t::contents, CONTENTS_TRIGGER, G_Error(), G_SpawnInt(), gentity_s::genericValue1, gentity_t, InitTrigger(), level, gentity_s::nextthink, gentity_s::r, shipboundary_think(), shipboundary_touch(), gentity_s::target, gentity_s::think, level_locals_t::time, gentity_s::touch, and trap_LinkEntity().

01572 {
01573         InitTrigger(self);
01574         self->r.contents = CONTENTS_TRIGGER;
01575         
01576         if (!self->target || !self->target[0])
01577         {
01578                 G_Error("trigger_shipboundary without a target.");
01579         }
01580         G_SpawnInt("traveltime", "0", &self->genericValue1);
01581 
01582         if (!self->genericValue1)
01583         {
01584                 G_Error("trigger_shipboundary without traveltime.");
01585         }
01586 
01587         self->think = shipboundary_think;
01588         self->nextthink = level.time + 500;
01589         self->touch = shipboundary_touch;
01590 
01591     trap_LinkEntity(self);
01592 }

void SP_trigger_space gentity_t self  ) 
 

Definition at line 1481 of file g_trigger.c.

References entityShared_t::contents, CONTENTS_TRIGGER, gentity_t, InitTrigger(), gentity_s::r, space_touch(), gentity_s::touch, and trap_LinkEntity().

01482 {
01483         InitTrigger(self);
01484         self->r.contents = CONTENTS_TRIGGER;
01485         
01486         self->touch = space_touch;
01487 
01488     trap_LinkEntity(self);
01489 }

void SP_trigger_teleport gentity_t ent  ) 
 

Definition at line 1236 of file g_trigger.c.

References ET_TELEPORT_TRIGGER, entityState_s::eType, G_SoundIndex(), gentity_t, InitTrigger(), gentity_s::r, gentity_s::s, gentity_s::spawnflags, SVF_NOCLIENT, entityShared_t::svFlags, gentity_s::touch, trap_LinkEntity(), and trigger_teleporter_touch().

01236                                             {
01237         InitTrigger (self);
01238 
01239         // unlike other triggers, we need to send this one to the client
01240         // unless is a spectator trigger
01241         if ( self->spawnflags & 1 ) {
01242                 self->r.svFlags |= SVF_NOCLIENT;
01243         } else {
01244                 self->r.svFlags &= ~SVF_NOCLIENT;
01245         }
01246 
01247         // make sure the client precaches this sound
01248         G_SoundIndex("sound/weapons/force/speed.wav");
01249 
01250         self->s.eType = ET_TELEPORT_TRIGGER;
01251         self->touch = trigger_teleporter_touch;
01252 
01253         trap_LinkEntity (self);
01254 }

void SP_waypoint gentity_t ent  ) 
 

Definition at line 1275 of file g_nav.c.

References gentity_s::classname, gentity_s::clipmask, Com_Printf(), entityShared_t::contents, CONTENTS_TRIGGER, gentity_s::count, CROUCH_MAXS_2, entityShared_t::currentOrigin, DEFAULT_MAXS_2, DEFAULT_MINS_2, G_CheckInSolid(), G_FreeEntity(), gentity_t, gentity_s::health, MASK_DEADSOLID, entityShared_t::maxs, entityShared_t::mins, NAV_StoreWaypoint(), navCalculatePaths, qtrue, gentity_s::r, S_COLOR_RED, gentity_s::spawnflags, gentity_s::targetname, trap_LinkEntity(), trap_Nav_AddRawPoint(), VectorSet, vtos(), and waypoint_getRadius().

01276 {
01277         if ( navCalculatePaths )
01278         {
01279                 unsigned int radius;
01280 
01281                 VectorSet(ent->r.mins, -15, -15, DEFAULT_MINS_2);
01282                 VectorSet(ent->r.maxs, 15, 15, DEFAULT_MAXS_2);
01283                 
01284                 ent->r.contents = CONTENTS_TRIGGER;
01285                 ent->clipmask = MASK_DEADSOLID;
01286 
01287                 trap_LinkEntity( ent );
01288 
01289                 ent->count = -1;
01290                 ent->classname = "waypoint";
01291 
01292                 if( !(ent->spawnflags&1) && G_CheckInSolid (ent, qtrue))
01293                 {//if not SOLID_OK, and in solid
01294                         ent->r.maxs[2] = CROUCH_MAXS_2;
01295                         if(G_CheckInSolid (ent, qtrue))
01296                         {
01297                                 Com_Printf(S_COLOR_RED"ERROR: Waypoint %s at %s in solid!\n", ent->targetname, vtos(ent->r.currentOrigin));
01298                                 assert(0 && "Waypoint in solid!");
01299                                 G_FreeEntity(ent);
01300                                 return;
01301                         }
01302                 }
01303 
01304                 radius = waypoint_getRadius( ent );
01305 
01306                 ent->health = trap_Nav_AddRawPoint( ent->r.currentOrigin, ent->spawnflags, radius );
01307                 NAV_StoreWaypoint( ent );
01308                 G_FreeEntity(ent);
01309                 return;
01310         }
01311 
01312         G_FreeEntity(ent);
01313 }

void SP_waypoint_navgoal gentity_t ent  ) 
 

Definition at line 1370 of file g_nav.c.

References entityState_s::angles, gentity_s::classname, Com_Printf(), entityShared_t::currentOrigin, G_CheckInSolid(), G_FreeEntity(), gentity_t, entityShared_t::maxs, entityShared_t::mins, NAVGOAL_USE_RADIUS, NULL, entityState_s::origin, qfalse, gentity_s::r, gentity_s::radius, RTF_NAVGOAL, gentity_s::s, S_COLOR_RED, gentity_s::spawnflags, TAG_Add(), gentity_s::targetname, VectorSet, and vtos().

01371 {
01372         int radius = ( ent->radius ) ? (((int)ent->radius)|NAVGOAL_USE_RADIUS) : 12;
01373 
01374         VectorSet( ent->r.mins, -16, -16, -24 );
01375         VectorSet( ent->r.maxs, 16, 16, 32 );
01376         ent->s.origin[2] += 0.125;
01377         if ( !(ent->spawnflags&1) && G_CheckInSolid( ent, qfalse ) )
01378         {
01379                 Com_Printf(S_COLOR_RED"ERROR: Waypoint_navgoal %s at %s in solid!\n", ent->targetname, vtos(ent->r.currentOrigin));
01380                 assert(0);
01381         }
01382         TAG_Add( ent->targetname, NULL, ent->s.origin, ent->s.angles, radius, RTF_NAVGOAL );
01383 
01384         ent->classname = "navgoal";
01385         G_FreeEntity( ent );//can't do this, they need to be found later by some functions, though those could be fixed, maybe?
01386 }

void SP_waypoint_navgoal_1 gentity_t ent  ) 
 

Definition at line 1495 of file g_nav.c.

References entityState_s::angles, gentity_s::classname, Com_Printf(), entityShared_t::currentOrigin, G_CheckInSolid(), G_FreeEntity(), gentity_t, entityShared_t::maxs, entityShared_t::mins, NULL, entityState_s::origin, qfalse, gentity_s::r, RTF_NAVGOAL, gentity_s::s, S_COLOR_RED, gentity_s::spawnflags, TAG_Add(), gentity_s::targetname, VectorSet, and vtos().

01496 {
01497         VectorSet( ent->r.mins, -1, -1, -24 );
01498         VectorSet( ent->r.maxs, 1, 1, 32 );
01499         ent->s.origin[2] += 0.125;
01500         if ( !(ent->spawnflags&1) && G_CheckInSolid( ent, qfalse ) )
01501         {
01502                 Com_Printf(S_COLOR_RED"ERROR: Waypoint_navgoal_1 %s at %s in solid!\n", ent->targetname, vtos(ent->r.currentOrigin));
01503                 assert(0);
01504         }
01505 
01506         TAG_Add( ent->targetname, NULL, ent->s.origin, ent->s.angles, 1, RTF_NAVGOAL );
01507 
01508         ent->classname = "navgoal";
01509         G_FreeEntity( ent );//can't do this, they need to be found later by some functions, though those could be fixed, maybe?
01510 }

void SP_waypoint_navgoal_2 gentity_t ent  ) 
 

Definition at line 1464 of file g_nav.c.

References entityState_s::angles, gentity_s::classname, Com_Printf(), entityShared_t::currentOrigin, G_CheckInSolid(), G_FreeEntity(), gentity_t, entityShared_t::maxs, entityShared_t::mins, NULL, entityState_s::origin, qfalse, gentity_s::r, RTF_NAVGOAL, gentity_s::s, S_COLOR_RED, gentity_s::spawnflags, TAG_Add(), gentity_s::targetname, VectorSet, and vtos().

01465 {       
01466         VectorSet( ent->r.mins, -2, -2, -24 );
01467         VectorSet( ent->r.maxs, 2, 2, 32 );
01468         ent->s.origin[2] += 0.125;
01469         if ( !(ent->spawnflags&1) && G_CheckInSolid( ent, qfalse ) )
01470         {
01471                 Com_Printf(S_COLOR_RED"ERROR: Waypoint_navgoal_2 %s at %s in solid!\n", ent->targetname, vtos(ent->r.currentOrigin));
01472                 assert(0);
01473         }
01474 
01475         TAG_Add( ent->targetname, NULL, ent->s.origin, ent->s.angles, 2, RTF_NAVGOAL );
01476 
01477         ent->classname = "navgoal";
01478         G_FreeEntity( ent );//can't do this, they need to be found later by some functions, though those could be fixed, maybe?
01479 }

void SP_waypoint_navgoal_4 gentity_t ent  ) 
 

Definition at line 1433 of file g_nav.c.

References entityState_s::angles, gentity_s::classname, Com_Printf(), entityShared_t::currentOrigin, G_CheckInSolid(), G_FreeEntity(), gentity_t, entityShared_t::maxs, entityShared_t::mins, NULL, entityState_s::origin, qfalse, gentity_s::r, RTF_NAVGOAL, gentity_s::s, S_COLOR_RED, gentity_s::spawnflags, TAG_Add(), gentity_s::targetname, VectorSet, and vtos().

01434 {
01435         VectorSet( ent->r.mins, -4, -4, -24 );
01436         VectorSet( ent->r.maxs, 4, 4, 32 );
01437         ent->s.origin[2] += 0.125;
01438         if ( !(ent->spawnflags&1) && G_CheckInSolid( ent, qfalse ) )
01439         {
01440                 Com_Printf(S_COLOR_RED"ERROR: Waypoint_navgoal_4 %s at %s in solid!\n", ent->targetname, vtos(ent->r.currentOrigin));
01441                 assert(0);
01442         }
01443 
01444         TAG_Add( ent->targetname, NULL, ent->s.origin, ent->s.angles, 4, RTF_NAVGOAL );
01445 
01446         ent->classname = "navgoal";
01447         G_FreeEntity( ent );//can't do this, they need to be found later by some functions, though those could be fixed, maybe?
01448 }

void SP_waypoint_navgoal_8 gentity_t ent  ) 
 

Definition at line 1402 of file g_nav.c.

References entityState_s::angles, gentity_s::classname, Com_Printf(), entityShared_t::currentOrigin, G_CheckInSolid(), G_FreeEntity(), gentity_t, entityShared_t::maxs, entityShared_t::mins, NULL, entityState_s::origin, qfalse, gentity_s::r, RTF_NAVGOAL, gentity_s::s, S_COLOR_RED, gentity_s::spawnflags, TAG_Add(), gentity_s::targetname, VectorSet, and vtos().

01403 {
01404         VectorSet( ent->r.mins, -8, -8, -24 );
01405         VectorSet( ent->r.maxs, 8, 8, 32 );
01406         ent->s.origin[2] += 0.125;
01407         if ( !(ent->spawnflags&1) && G_CheckInSolid( ent, qfalse ) )
01408         {
01409                 Com_Printf(S_COLOR_RED"ERROR: Waypoint_navgoal_8 %s at %s in solid!\n", ent->targetname, vtos(ent->r.currentOrigin));
01410                 assert(0);
01411         }
01412 
01413         TAG_Add( ent->targetname, NULL, ent->s.origin, ent->s.angles, 8, RTF_NAVGOAL );
01414 
01415         ent->classname = "navgoal";
01416         G_FreeEntity( ent );//can't do this, they need to be found later by some functions, though those could be fixed, maybe?
01417 }

void SP_waypoint_small gentity_t ent  ) 
 

Definition at line 1318 of file g_nav.c.

References gentity_s::classname, gentity_s::clipmask, Com_Printf(), entityShared_t::contents, CONTENTS_TRIGGER, gentity_s::count, CROUCH_MAXS_2, entityShared_t::currentOrigin, DEFAULT_MAXS_2, DEFAULT_MINS_2, G_CheckInSolid(), G_FreeEntity(), gentity_t, gentity_s::health, MASK_DEADSOLID, entityShared_t::maxs, entityShared_t::mins, NAV_StoreWaypoint(), navCalculatePaths, qtrue, gentity_s::r, S_COLOR_RED, gentity_s::spawnflags, gentity_s::targetname, trap_LinkEntity(), trap_Nav_AddRawPoint(), VectorSet, and vtos().

01319 {
01320         if ( navCalculatePaths )
01321         {
01322                 VectorSet(ent->r.mins, -2, -2, DEFAULT_MINS_2);
01323                 VectorSet(ent->r.maxs, 2, 2, DEFAULT_MAXS_2);
01324 
01325                 ent->r.contents = CONTENTS_TRIGGER;
01326                 ent->clipmask = MASK_DEADSOLID;
01327 
01328                 trap_LinkEntity( ent );
01329 
01330                 ent->count = -1;
01331                 ent->classname = "waypoint";
01332 
01333                 if ( !(ent->spawnflags&1) && G_CheckInSolid( ent, qtrue ) )
01334                 {
01335                         ent->r.maxs[2] = CROUCH_MAXS_2;
01336                         if ( G_CheckInSolid( ent, qtrue ) )
01337                         {
01338                                 Com_Printf(S_COLOR_RED"ERROR: Waypoint_small %s at %s in solid!\n", ent->targetname, vtos(ent->r.currentOrigin));
01339                                 assert(0);
01340                                 G_FreeEntity(ent);
01341                                 return;
01342                         }
01343                 }
01344 
01345                 ent->health = trap_Nav_AddRawPoint( ent->r.currentOrigin, ent->spawnflags, 2 );
01346                 NAV_StoreWaypoint( ent );
01347                 G_FreeEntity(ent);
01348                 return;
01349         }
01350 
01351         G_FreeEntity(ent);
01352 }

void SP_worldspawn void   ) 
 

Definition at line 1259 of file g_spawn.c.

References BG_ParseAnimationFile(), BG_ParseField(), bgHumanoidAnimations, BGPAFtextLoaded, byte, Com_Error(), Com_sprintf(), CS_GAME_VERSION, CS_GLOBAL_AMBIENT_SET, CS_LEVEL_START_TIME, CS_LIGHT_STYLES, CS_MESSAGE, CS_MOTD, CS_MUSIC, CS_WARMUP, ENTITYNUM_WORLD, ERR_DROP, EWebPrecache(), fields, g2SaberInstance, g_cullDistance, g_entities, G_Error(), g_gametype, g_motd, g_restarted, G_SpawnFloat(), G_SpawnString(), GAME_VERSION, GT_SIEGE, vmCvar_t::integer, level, LS_NUM_STYLES, LS_STYLES_START, level_locals_t::numSpawnVars, precachedKyle, Q_stricmp(), qtrue, level_locals_t::spawnVars, level_locals_t::startTime, vmCvar_t::string, strlen(), trap_Cvar_Set(), trap_G2API_AddBolt(), trap_G2API_InitGhoul2Model(), trap_G2API_SetBoltInfo(), trap_G2API_SetSkin(), trap_R_RegisterSkin(), trap_SetConfigstring(), trap_SetServerCull(), va(), and level_locals_t::warmupTime.

Referenced by G_SpawnEntitiesFromString().

01260 {
01261         char            *text, temp[32];
01262         int                     i;
01263         int                     lengthRed, lengthBlue, lengthGreen;
01264 
01265         //I want to "cull" entities out of net sends to clients to reduce
01266         //net traffic on our larger open maps -rww
01267         G_SpawnFloat("distanceCull", "6000.0", &g_cullDistance);
01268         trap_SetServerCull(g_cullDistance);
01269 
01270         G_SpawnString( "classname", "", &text );
01271         if ( Q_stricmp( text, "worldspawn" ) ) {
01272                 G_Error( "SP_worldspawn: The first entity isn't 'worldspawn'" );
01273         }
01274 
01275         for ( i = 0 ; i < level.numSpawnVars ; i++ ) 
01276         {
01277                 if ( Q_stricmp( "spawnscript", level.spawnVars[i][0] ) == 0 )
01278                 {//ONly let them set spawnscript, we don't want them setting an angle or something on the world.
01279                         BG_ParseField( fields, level.spawnVars[i][0], level.spawnVars[i][1], (byte *)&g_entities[ENTITYNUM_WORLD] );
01280                 }
01281         }
01282         //The server will precache the standard model and animations, so that there is no hit
01283         //when the first client connnects.
01284         if (!BGPAFtextLoaded)
01285         {
01286                 BG_ParseAnimationFile("models/players/_humanoid/animation.cfg", bgHumanoidAnimations, qtrue);
01287         }
01288 
01289         if (!precachedKyle)
01290         {
01291                 int defSkin;
01292 
01293                 trap_G2API_InitGhoul2Model(&precachedKyle, "models/players/kyle/model.glm", 0, 0, -20, 0, 0);
01294 
01295                 if (precachedKyle)
01296                 {
01297                         defSkin = trap_R_RegisterSkin("models/players/kyle/model_default.skin");
01298                         trap_G2API_SetSkin(precachedKyle, 0, defSkin, defSkin);
01299                 }
01300         }
01301 
01302         if (!g2SaberInstance)
01303         {
01304                 trap_G2API_InitGhoul2Model(&g2SaberInstance, "models/weapons2/saber/saber_w.glm", 0, 0, -20, 0, 0);
01305 
01306                 if (g2SaberInstance)
01307                 {
01308                         // indicate we will be bolted to model 0 (ie the player) on bolt 0 (always the right hand) when we get copied
01309                         trap_G2API_SetBoltInfo(g2SaberInstance, 0, 0);
01310                         // now set up the gun bolt on it
01311                         trap_G2API_AddBolt(g2SaberInstance, 0, "*blade1");
01312                 }
01313         }
01314 
01315         if (g_gametype.integer == GT_SIEGE)
01316         { //a tad bit of a hack, but..
01317                 EWebPrecache();
01318         }
01319 
01320         // make some data visible to connecting client
01321         trap_SetConfigstring( CS_GAME_VERSION, GAME_VERSION );
01322 
01323         trap_SetConfigstring( CS_LEVEL_START_TIME, va("%i", level.startTime ) );
01324 
01325         G_SpawnString( "music", "", &text );
01326         trap_SetConfigstring( CS_MUSIC, text );
01327 
01328         G_SpawnString( "message", "", &text );
01329         trap_SetConfigstring( CS_MESSAGE, text );                               // map specific message
01330 
01331         trap_SetConfigstring( CS_MOTD, g_motd.string );         // message of the day
01332 
01333         G_SpawnString( "gravity", "800", &text );
01334         trap_Cvar_Set( "g_gravity", text );
01335 
01336         G_SpawnString( "enableBreath", "0", &text );
01337         trap_Cvar_Set( "g_enableBreath", text );
01338 
01339         G_SpawnString( "soundSet", "default", &text );
01340         trap_SetConfigstring( CS_GLOBAL_AMBIENT_SET, text );
01341 
01342         g_entities[ENTITYNUM_WORLD].s.number = ENTITYNUM_WORLD;
01343         g_entities[ENTITYNUM_WORLD].classname = "worldspawn";
01344 
01345         // see if we want a warmup time
01346         trap_SetConfigstring( CS_WARMUP, "" );
01347         if ( g_restarted.integer ) {
01348                 trap_Cvar_Set( "g_restarted", "0" );
01349                 level.warmupTime = 0;
01350         } 
01351         /*
01352         else if ( g_doWarmup.integer && g_gametype.integer != GT_DUEL && g_gametype.integer != GT_POWERDUEL ) { // Turn it on
01353                 level.warmupTime = -1;
01354                 trap_SetConfigstring( CS_WARMUP, va("%i", level.warmupTime) );
01355                 G_LogPrintf( "Warmup:\n" );
01356         }
01357         */
01358 
01359         trap_SetConfigstring(CS_LIGHT_STYLES+(LS_STYLES_START*3)+0, defaultStyles[0][0]);
01360         trap_SetConfigstring(CS_LIGHT_STYLES+(LS_STYLES_START*3)+1, defaultStyles[0][1]);
01361         trap_SetConfigstring(CS_LIGHT_STYLES+(LS_STYLES_START*3)+2, defaultStyles[0][2]);
01362         
01363         for(i=1;i<LS_NUM_STYLES;i++)
01364         {
01365                 Com_sprintf(temp, sizeof(temp), "ls_%dr", i);
01366                 G_SpawnString(temp, defaultStyles[i][0], &text);
01367                 lengthRed = strlen(text);
01368                 trap_SetConfigstring(CS_LIGHT_STYLES+((i+LS_STYLES_START)*3)+0, text);
01369 
01370                 Com_sprintf(temp, sizeof(temp), "ls_%dg", i);
01371                 G_SpawnString(temp, defaultStyles[i][1], &text);
01372                 lengthGreen = strlen(text);
01373                 trap_SetConfigstring(CS_LIGHT_STYLES+((i+LS_STYLES_START)*3)+1, text);
01374 
01375                 Com_sprintf(temp, sizeof(temp), "ls_%db", i);
01376                 G_SpawnString(temp, defaultStyles[i][2], &text);
01377                 lengthBlue = strlen(text);
01378                 trap_SetConfigstring(CS_LIGHT_STYLES+((i+LS_STYLES_START)*3)+2, text);
01379 
01380                 if (lengthRed != lengthGreen || lengthGreen != lengthBlue)
01381                 {
01382                         Com_Error(ERR_DROP, "Style %d has inconsistent lengths: R %d, G %d, B %d", 
01383                                 i, lengthRed, lengthGreen, lengthBlue);
01384                 }
01385         }               
01386 }


Variable Documentation

BG_field_t fields[]
 

Definition at line 54 of file g_spawn.c.

Referenced by G_SpawnGEntityFromSpawnVars(), and SP_worldspawn().

float g_cullDistance
 

Definition at line 1258 of file g_spawn.c.

Referenced by SP_worldspawn(), and WP_VehCheckTraceFromCamPos().

void* precachedKyle = 0
 

Definition at line 1234 of file g_spawn.c.

Referenced by G_ShutdownGame(), SetupGameGhoul2Model(), and SP_worldspawn().

spawn_t spawns[]
 

Definition at line 435 of file g_spawn.c.

Referenced by G_CallSpawn().