这篇教程C++ G_SpawnInt函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中G_SpawnInt函数的典型用法代码示例。如果您正苦于以下问题:C++ G_SpawnInt函数的具体用法?C++ G_SpawnInt怎么用?C++ G_SpawnInt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了G_SpawnInt函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: G_SpawnItem/*============G_SpawnItemSets the clipping size and plants the object on the floor.Items can't be immediately dropped to floor, because they mightbe on an entity that hasn't spawned yet.============*/void G_SpawnItem (gentity_t *ent, gitem_t *item) { char *noise; G_SpawnFloat( "random", "0", &ent->random ); G_SpawnFloat( "wait", "0", &ent->wait ); ent->item = item; // some movers spawn on the second frame, so delay item // spawns until the third frame so they can ride trains ent->nextthink = level.time + FRAMETIME * 2; ent->think = FinishSpawningItem; if(G_SpawnString("noise", 0, &noise)) ent->noise_index = G_SoundIndex(noise); ent->physicsBounce = 0.50; // items are bouncy if(ent->model) { ent->s.modelindex2 = G_ModelIndex(ent->model); } if ( item->giType == IT_TEAM ) { G_SpawnInt( "count", "1", &ent->s.density ); G_SpawnInt( "speedscale", "100", &ent->splashDamage ); if( !ent->splashDamage ) { ent->splashDamage = 100; } }}
开发者ID:BackupTheBerlios,项目名称:et-flf-svn,代码行数:39,
示例2: SP_CreatePuffSystem//----------------------------------------------------------void SP_CreatePuffSystem( gentity_t *ent ){ char temp[128]; // Initialize the puff system to either 1000 particles or whatever they choose. G_SpawnInt( "count", "1000", &ent->count ); cvar_t *r_weatherScale = gi.cvar( "r_weatherScale", "1", CVAR_ARCHIVE ); // See which puff system to use. int iPuffSystem = 0; int iVal = 0; if ( G_SpawnInt( "whichsystem", "0", &iVal ) ) { iPuffSystem = iVal; if ( iPuffSystem < 0 || iPuffSystem > 1 ) { iPuffSystem = 0; //ri.Error( ERR_DROP, "Weather Effect: Invalid value for whichsystem key" ); Com_Printf( "Weather Effect: Invalid value for whichsystem key/n" ); } } if ( r_weatherScale->value > 0.0f ) { sprintf( temp, "puff%i init %i", iPuffSystem, (int)( ent->count * r_weatherScale->value )); G_FindConfigstringIndex( temp, CS_WORLD_FX, MAX_WORLD_FX, qtrue ); // Should return here??? It didn't originally... } // See whether we should have the saber spark from the puff system. iVal = 0; G_SpawnInt( "sabersparks", "0", &iVal ); if ( iVal == 1 ) level.worldFlags |= WF_PUFFING; else level.worldFlags &= ~WF_PUFFING; // Go through all the fields and assign the values to the created puff system now. for ( int i = 0; i < 20; i++ ) { char *key = NULL; char *value = NULL; // Fetch a field. if ( !G_SpawnField( i, &key, &value ) ) continue; // Make sure we don't get key's that are worthless. if ( Q_stricmp( key, "origin" ) == 0 || Q_stricmp( key, "classname" ) == 0 || Q_stricmp( key, "count" ) == 0 || Q_stricmp( key, "targetname" ) == 0 || Q_stricmp( key, "sabersparks" ) == 0 || Q_stricmp( key, "whichsystem" ) == 0 ) continue; // Send the command. _snprintf( temp, 128, "puff%i %s %s", iPuffSystem, key, value ); G_FindConfigstringIndex( temp, CS_WORLD_FX, MAX_WORLD_FX, qtrue ); }}
开发者ID:3ddy,项目名称:Jedi-Academy,代码行数:60,
示例3: SP_trigger_stagevoid SP_trigger_stage( gentity_t *self ){ G_SpawnInt( "team", "0", (int *)&self->stageTeam ); G_SpawnInt( "stage", "0", (int *)&self->stageStage ); self->use = trigger_stage_use; self->r.svFlags = SVF_NOCLIENT;}
开发者ID:redrumrobot,项目名称:trem-gpp-bots,代码行数:9,
示例4: G_SpawnGEntityFromSpawnVars/*===================G_SpawnGEntityFromSpawnVarsSpawn an entity and fill in all of the level fields fromlevel.spawnVars[], then call the class specfic spawn function===================*/void G_SpawnGEntityFromSpawnVars( void ) { int i; gentity_t *ent; char *s, *value, *gametypeName; static char *gametypeNames[] = {"ffa", "tournament", "single", "team", "ctf", "oneflag", "obelisk", "harvester", "teamtournament"}; // get the next free entity ent = G_Spawn(); for ( i = 0 ; i < level.numSpawnVars ; i++ ) { G_ParseField( level.spawnVars[i][0], level.spawnVars[i][1], ent ); } // check for "notsingle" flag if ( g_gametype.integer == GT_SINGLE_PLAYER ) { G_SpawnInt( "notsingle", "0", &i ); if ( i ) { G_FreeEntity( ent ); return; } } // check for "notteam" flag (GT_FFA, GT_DUEL, GT_SINGLE_PLAYER) if ( g_gametype.integer >= GT_TEAM ) { G_SpawnInt( "notteam", "0", &i ); if ( i ) { G_FreeEntity( ent ); return; } } else { G_SpawnInt( "notfree", "0", &i ); if ( i ) { G_FreeEntity( ent ); return; } } if( G_SpawnString( "gametype", NULL, &value ) ) { if( g_gametype.integer >= GT_FFA && g_gametype.integer < GT_MAX_GAME_TYPE ) { gametypeName = gametypeNames[g_gametype.integer]; s = strstr( value, gametypeName ); if( !s ) { G_FreeEntity( ent ); return; } } } // move editor origin to pos VectorCopy( ent->s.origin, ent->s.pos.trBase ); VectorCopy( ent->s.origin, ent->r.currentOrigin ); // if we didn't get a classname, don't bother spawning anything if ( !G_CallSpawn( ent ) ) { G_FreeEntity( ent ); }}
开发者ID:LuckyBro,项目名称:sgfork,代码行数:65,
示例5: SP_info_player_deathmatch/*QUAKED info_player_deathmatch (1 0 1) (-16 -16 -24) (16 16 32) initialpotential spawning position for deathmatch games.The first time a player enters the game, they will be at an 'initial' spot.Targets will be fired when someone spawns in on them."nobots" will prevent bots from using this spot."nohumans" will prevent non-bots from using this spot.*/void SP_info_player_deathmatch( gentity_t *ent ) { int i; G_SpawnInt( "nobots", "0", &i); if ( i ) { ent->flags |= FL_NO_BOTS; } G_SpawnInt( "nohumans", "0", &i ); if ( i ) { ent->flags |= FL_NO_HUMANS; }}
开发者ID:zturtleman,项目名称:swarmedq3,代码行数:19,
示例6: SP_misc_turretG2//-----------------------------------------------------void SP_misc_turretG2( gentity_t *base )//-----------------------------------------------------{ int customscaleVal; char* s; turretG2_set_models( base, qfalse ); G_SpawnInt("painwait", "0", &base->genericValue4); base->genericValue8 = 0; G_SpawnInt("customscale", "0", &customscaleVal); base->s.iModelScale = customscaleVal; if (base->s.iModelScale) { if (base->s.iModelScale > 1023) { base->s.iModelScale = 1023; } base->modelScale[0] = base->modelScale[1] = base->modelScale[2] = base->s.iModelScale/100.0f; } G_SpawnString( "icon", "", &s ); if (s && s[0]) { // We have an icon, so index it now. We are reusing the genericenemyindex // variable rather than adding a new one to the entity state. base->s.genericenemyindex = G_IconIndex(s); } finish_spawning_turretG2( base ); if (( base->spawnflags & 1 )) // Start_Off { base->s.frame = 1; // black } else { base->s.frame = 0; // glow } if ( !(base->spawnflags&SPF_TURRETG2_TURBO) ) { base->s.eFlags |= EF_SHADER_ANIM; } if (base->spawnflags & SPF_SHOWONRADAR) { base->s.eFlags |= EF_RADAROBJECT; }#undef name#undef name2#undef name3}
开发者ID:Atlas-zz,项目名称:SDK-JKA-ACADEMIE-HCF,代码行数:54,
示例7: SP_rail_lanevoid SP_rail_lane(gentity_t *ent){ gi.SetBrushModel(ent, ent->model); G_SpawnInt("delay", "0", &ent->delay); mRailLanes.push_back().Setup(ent); G_FreeEntity(ent);}
开发者ID:BishopExile,项目名称:OpenJK,代码行数:7,
示例8: SP_trigger_heal/*===============SP_trigger_heal===============*/void SP_trigger_heal( gentity_t *self ){ G_SpawnInt( "heal", "5", &self->damage ); if ( self->damage <= 0 ) { self->damage = 1; G_Printf( S_COLOR_YELLOW "WARNING: trigger_heal with negative damage key/n" ); } self->touch = trigger_heal_touch; self->use = trigger_heal_use; InitTrigger( self ); // link in to the world if starting active if ( self->spawnflags & 1 ) { trap_UnlinkEntity( self ); } else { trap_LinkEntity( self ); }}
开发者ID:Sixthly,项目名称:Unvanquished,代码行数:30,
示例9: SP_gfx_light_flarevoid SP_gfx_light_flare( gentity_t *self ){ self->s.eType = ET_LIGHTFLARE; self->s.modelindex = G_ShaderIndex( self->shaderKey ); VectorCopy( self->activatedPosition, self->s.origin2 ); //try to find a spot near to the flare which is empty. This //is used to facilitate visibility testing findEmptySpot( self->s.origin, 8.0f, self->s.angles2 ); self->act = gfx_light_flare_toggle; if( !self->config.speed ) self->config.speed = 200; self->s.time = self->config.speed; G_SpawnInt( "mindist", "0", &self->s.generic1 ); if ( self->spawnflags & SPF_SPAWN_DISABLED ) { self->s.eFlags |= EF_NODRAW; } trap_LinkEntity( self );}
开发者ID:JacksonTech,项目名称:Unvanquished,代码行数:26,
示例10: multiplier/*QUAKED script_mover (0.5 0.25 1.0) ? TRIGGERSPAWN SOLID EXPLOSIVEDAMAGEONLYScripted brush entity. A simplified means of moving brushes around based on events."modelscale" - Scale multiplier (defaults to 1, and scales uniformly)"modelscale_vec" - Set scale per-axis. Overrides "modelscale", so if you have both the "modelscale" is ignored"model2" optional md3 to draw over the solid clip brush"scriptname" name used for scripting purposes (like aiName in AI scripting)"health" optionally make this entity damagable*/void SP_script_mover( gentity_t *ent ) { float scale[3] = {1,1,1}; vec3_t scalevec; if ( !ent->model ) { G_Error( "script_model_med must have a /"model/"/n" ); } if ( !ent->scriptName ) { G_Error( "script_model_med must have a /"scriptname/"/n" ); } ent->blocked = script_mover_blocked; // first position at start VectorCopy( ent->s.origin, ent->pos1 );// VectorCopy( ent->r.currentOrigin, ent->pos1 ); VectorCopy( ent->pos1, ent->pos2 ); // don't go anywhere just yet trap_SetBrushModel( ent, ent->model ); InitMover( ent ); ent->reached = NULL; if ( ent->spawnflags & 1 ) { ent->use = script_mover_use; trap_UnlinkEntity( ent ); // make sure it's not visible return; } G_SetAngle( ent, ent->s.angles ); G_SpawnInt( "health", "0", &ent->health ); if ( ent->health ) { ent->takedamage = qtrue; } ent->die = script_mover_die; ent->pain = script_mover_pain; // look for general scaling if ( G_SpawnFloat( "modelscale", "1", &scale[0] ) ) { scale[2] = scale[1] = scale[0]; } // look for axis specific scaling if ( G_SpawnVector( "modelscale_vec", "1 1 1", &scalevec[0] ) ) { VectorCopy( scalevec, scale ); } if ( scale[0] != 1 || scale[1] != 1 || scale[2] != 1 ) {// ent->s.eType = ET_MOVERSCALED; ent->s.density = ET_MOVERSCALED; // scale is stored in 'angles2' VectorCopy( scale, ent->s.angles2 ); } script_mover_spawn( ent );}
开发者ID:JackalFrost,项目名称:RTCW-WSGF,代码行数:69,
示例11: EnergyShieldStationSettings/*================EnergyShieldStationSettings================*/void EnergyShieldStationSettings(gentity_t *ent){ G_SpawnInt( "count", "0", &ent->count ); if (!ent->count) { ent->count = 50; } G_SpawnInt("chargerate", "0", &ent->bolt_Head); if (!ent->bolt_Head) { ent->bolt_Head = STATION_RECHARGE_TIME; }}
开发者ID:Boothand,项目名称:Birdbones,代码行数:21,
示例12: G_SpawnGEntityFromSpawnVars/*===================G_SpawnGEntityFromSpawnVarsSpawn an entity and fill in all of the level fields fromlevel.spawnVars[], then call the class specfic spawn function===================*/void G_SpawnGEntityFromSpawnVars( void ){ int i; gentity_t *ent; // get the next free entity ent = G_Spawn( ); for( i = 0 ; i < level.numSpawnVars ; i++ ) G_ParseField( level.spawnVars[ i ][ 0 ], level.spawnVars[ i ][ 1 ], ent ); G_SpawnInt( "notq3a", "0", &i ); if( i ) { G_FreeEntity( ent ); return; } // move editor origin to pos VectorCopy( ent->s.origin, ent->s.pos.trBase ); VectorCopy( ent->s.origin, ent->r.currentOrigin ); // if we didn't get a classname, don't bother spawning anything if( !G_CallSpawn( ent ) ) G_FreeEntity( ent );}
开发者ID:redrumrobot,项目名称:korx,代码行数:35,
示例13: SP_misc_beamvoid SP_misc_beam(gentity_t *self){ char *str; G_SpawnString("target2", "", &str); if (*str) { self->message = G_NewString(str); } G_SpawnString("shader", "lightningBolt", &str); if (*str) { self->s.modelindex2 = G_ShaderIndex(str); } G_SpawnInt("scale", "1", &self->s.torsoAnim); G_SpawnVector("color", "1 1 1", self->s.angles2); // let everything else get spawned before we start firing self->accuracy = 0; self->think = misc_beam_start; self->nextthink = level.time + FRAMETIME;}
开发者ID:morsik,项目名称:warpig,代码行数:26,
示例14: game/*QUAKED target_fog (1 1 0) (-8 -8 -8) (8 8 8)color picker chooses color of fog"distance" sets fog distance. Use value '0' to give control back to the game (and use the fog values specified in the sky shader if present)"time" time it takes to change fog to new value. default time is 1 sec*/void SP_target_fog(gentity_t *ent){ int dist; float ftime; ent->use = Use_target_fog; // ent->s.density will carry the 'distance' value if (G_SpawnInt("distance", "0", &dist)) { if (dist >= 0) { ent->s.density = dist; } } // ent->s.time will carry the 'time' value if (G_SpawnFloat("time", "0.5", &ftime)) { if (ftime >= 0) { ent->s.time = ftime * 1000; // sec to ms } }}
开发者ID:morsik,项目名称:warpig,代码行数:30,
示例15: blocked/*QUAKED func_pendulum (0 .5 .8) ?You need to have an origin brush as part of this entity.Pendulums always swing north / south on unrotated models. Add an angles field to the model to allow rotation in other directions.Pendulum frequency is a physical constant based on the length of the beam and gravity."model2" .md3 model to also draw"speed" the number of degrees each way the pendulum swings, (30 default)"phase" the 0.0 to 1.0 offset in the cycle to start at"dmg" damage to inflict when blocked (2 default)"color" constantLight color"light" constantLight radius*/void SP_func_pendulum(gentity_t *ent) { float freq; float length; float phase; float speed; G_SpawnFloat( "speed", "30", &speed ); G_SpawnInt( "dmg", "2", &ent->damage ); G_SpawnFloat( "phase", "0", &phase ); trap_SetBrushModel( ent, ent->model ); // find pendulum length length = fabs( ent->r.mins[2] ); if ( length < 8 ) { length = 8; } freq = 1 / ( M_PI * 2 ) * sqrt( g_gravity.value / ( 3 * length ) ); ent->s.pos.trDuration = ( 1000 / freq ); InitMover( ent ); VectorCopy( ent->s.origin, ent->s.pos.trBase ); VectorCopy( ent->s.origin, ent->r.currentOrigin ); VectorCopy( ent->s.angles, ent->s.apos.trBase ); ent->s.apos.trDuration = 1000 / freq; ent->s.apos.trTime = ent->s.apos.trDuration * phase; ent->s.apos.trType = TR_SINE; ent->s.apos.trDelta[2] = speed;}
开发者ID:AHPlankton,项目名称:Quake-III-Arena,代码行数:45,
示例16: SP_trigger_entdistvoid SP_trigger_entdist( gentity_t *self ) { G_SpawnInt( "distance", "0", &self->count); self->e_UseFunc = useF_trigger_entdist_use;}
开发者ID:AlexXT,项目名称:OpenJK,代码行数:7,
示例17: SP_target_stoptimervoid SP_target_stoptimer(gentity_t *ent) { char *t = NULL; // Nico, used to look for parent gentity_t *parent = NULL; // Nico, override wait -1 or wait 9999 on stop timer entities if (g_forceTimerReset.integer) { parent = G_FindByTarget(NULL, ent->targetname); if (parent && parent->wait != 0.5 && !Q_stricmp(parent->classname, "trigger_multiple")) { G_DPrintf("%s: SP_target_stoptimer, wait found = %f, overrided to 0.5/n", GAME_VERSION, parent->wait); G_SpawnFloat("wait", "0.5", &parent->wait); } } G_SpawnString("name", "default", &t); ent->timerunName = G_NewString(t); // create a timerun with this name if it doesn't exit yet GetTimerunNum(ent->timerunName); G_SpawnInt("mincheckpoints", "0", &ent->count); ent->use = target_stoptimer_use; level.isTimerun = qtrue;}
开发者ID:boutetnico,项目名称:ETrun,代码行数:26,
示例18: bob/*QUAKED func_bobbing (0 .5 .8) ? X_AXIS Y_AXISNormally bobs on the Z axis"model2" .md3 model to also draw"height" amplitude of bob (32 default)"speed" seconds to complete a bob cycle (4 default)"phase" the 0.0 to 1.0 offset in the cycle to start at"dmg" damage to inflict when blocked (2 default)"color" constantLight color"light" constantLight radius*/void SP_func_bobbing (gentity_t *ent) { float height; float phase; G_SpawnFloat( "speed", "4", &ent->speed ); G_SpawnFloat( "height", "32", &height ); G_SpawnInt( "dmg", "2", &ent->damage ); G_SpawnFloat( "phase", "0", &phase ); trap_SetBrushModel( ent, ent->model ); InitMover( ent ); VectorCopy( ent->s.origin, ent->s.pos.trBase ); VectorCopy( ent->s.origin, ent->r.currentOrigin ); ent->s.pos.trDuration = ent->speed * 1000; ent->s.pos.trTime = ent->s.pos.trDuration * phase; ent->s.pos.trType = TR_SINE; // set the axis of bobbing if ( ent->spawnflags & 1 ) { ent->s.pos.trDelta[0] = height; } else if ( ent->spawnflags & 2 ) { ent->s.pos.trDelta[1] = height; } else { ent->s.pos.trDelta[2] = height; }}
开发者ID:AHPlankton,项目名称:Quake-III-Arena,代码行数:38,
示例19: G_SpawnItem/*============G_SpawnItemSets the clipping size and plants the object on the floor.Items can't be immediately dropped to floor, because they mightbe on an entity that hasn't spawned yet.============*/void G_SpawnItem( gentity_t *ent, gitem_t *item ) { char *noise; int page; G_SpawnFloat( "random", "0", &ent->random ); G_SpawnFloat( "wait", "0", &ent->wait ); RegisterItem( item ); ent->item = item; // some movers spawn on the second frame, so delay item // spawns until the third frame so they can ride trains ent->nextthink = level.time + FRAMETIME * 2; ent->think = FinishSpawningItem; if ( G_SpawnString( "noise", 0, &noise ) ) { ent->noise_index = G_SoundIndex( noise ); } ent->physicsBounce = 0.50; // items are bouncy if ( ent->model ) { ent->s.modelindex2 = G_ModelIndex( ent->model ); } if ( item->giType == IT_CLIPBOARD ) { if ( G_SpawnInt( "notebookpage", "1", &page ) ) { ent->key = page; } } if ( item->giType == IT_POWERUP ) { G_SoundIndex( "sound/items/poweruprespawn.wav" ); }}
开发者ID:MAN-AT-ARMS,项目名称:iortcw-archive,代码行数:44,
示例20: game/*QUAKED target_fog (1 1 0) (-8 -8 -8) (8 8 8)color picker chooses color of fog"distance" sets fog distance. Use value '0' to give control back to the game (and use the fog values specified in the sky shader if present)distance value sets the type of fog. values > 1 are distance fog (ex. 2048), values < 1 are density fog (ex. .0002)"near" is fog start distance when using distance fog"time" time it takes to change fog to new value. default time is 1 sec*/void SP_target_fog(gentity_t *ent){ int dist; float startdist; float ftime; ent->use = Use_target_fog; // ent->random will carry the 'far' or density value G_SpawnInt("distance", "0", &dist); if(dist >= 0) { ent->random = dist; } G_SpawnFloat("near", "1.0", &startdist); ent->accuracy = startdist; // ent->s.time will carry the 'time' value G_SpawnFloat("time", "0.5", &ftime); if(ftime >= 0) { ent->s.time = ftime * 1000; // sec to ms }}
开发者ID:Justasic,项目名称:RTCW-SP,代码行数:35,
示例21: G_SpawnGEntityFromSpawnVars/*===================G_SpawnGEntityFromSpawnVarsSpawn an entity and fill in all of the level fields fromlevel.spawnVars[], then call the class specfic spawn function===================*/void G_SpawnGEntityFromSpawnVars( void ) { int i; gentity_t *ent; char *s, *value, *gametypeName; static char *gametypeNames[] = {"ffa", "tournament", "single", "team", "ctf", "oneflag", "obelisk", "harvester", "teamtournament"}; // get the next free entity ent = G_Spawn(); for ( i = 0 ; i < level.numSpawnVars ; i++ ) { G_ParseField( level.spawnVars[i][0], level.spawnVars[i][1], ent ); } G_SpawnInt( "notep", "0", &i ); if ( i ) { G_FreeEntity( ent ); return; } // move editor origin to pos VectorCopy( ent->s.origin, ent->s.pos.trBase ); VectorCopy( ent->s.origin, ent->r.currentOrigin ); // if we didn't get a classname, don't bother spawning anything if ( !G_CallSpawn( ent ) ) { G_FreeEntity( ent ); }}
开发者ID:Clever-Boy,项目名称:entityplus,代码行数:36,
示例22: AICast_DelayedSpawnCast/*================AICast_DelayedSpawnCast================*/void AICast_DelayedSpawnCast( gentity_t *ent, int castType ){ // ............................ // head separation if(!ent->aiSkin) G_SpawnString( "skin", "", &ent->aiSkin); if(!ent->aihSkin) G_SpawnString( "head", "default", &ent->aihSkin); G_SpawnInt( "aiteam", "-1", &ent->aiTeam); // ............................ // we have to wait a bit before spawning it, otherwise the server will just delete it, since it's treated like a client ent->think = AIChar_spawn; ent->nextthink = level.time + FRAMETIME*4; // have to wait more than 3 frames, since the server runs 3 frames before it clears all clients // we don't really want to start this character right away, but if we don't spawn the client // now, if the game gets saved after the character spawns in, when it gets re-loaded, the client // won't get spawned properly. if (ent->spawnflags & 1) // TriggerSpawn { ent->AIScript_AlertEntity = AIChar_AIScript_AlertEntity; ent->aiInactive = qtrue; } // RF, had to move this down since some dev maps don't properly spawn the guys in, so we // get a crash when transitioning between levels after they all spawn at once (overloading // the client/server command buffers) ent->nextthink += FRAMETIME * ((numSpawningCast+1) / 3); // space them out a bit so we don't overflow the client ent->aiCharacter = castType; numSpawningCast++;}
开发者ID:natelo,项目名称:rtcwPub,代码行数:38,
示例23: SP_target_fx/*QUAKED target_fx (0 0 1) (-8 -8 -8) (8 8 8)*/void SP_target_fx(gentity_t * self){ char *effectName; int startOn = 0; self->s.eType = ET_INVISIBLE; G_SpawnFloat("wait", "0.5", &self->wait); G_SpawnFloat("random", "0", &self->random); G_SpawnInt("start_on", "0", &startOn); if(!startOn) self->s.eFlags |= EF_NODRAW; G_SpawnString("luaThink", "", &effectName); self->s.modelindex = G_EffectIndex(effectName); G_SetOrigin(self, self->s.origin); // save angles VectorCopy(self->s.angles, self->s.apos.trBase); self->s.apos.trType = TR_STATIONARY; self->s.apos.trTime = 0; self->s.apos.trDuration = 0; VectorClear(self->s.apos.trDelta); //VectorCopy(origin, ent->r.currentAOrigin); VectorClear(self->r.mins); VectorClear(self->r.maxs); trap_LinkEntity(self); self->think = target_fx_think; self->nextthink = level.time + 1000;}
开发者ID:SinSiXX,项目名称:Rogue-Reborn,代码行数:36,
示例24: SP_pos_locationvoid SP_pos_location( gentity_t *self ){ char *message; self->s.eType = entityType_t::ET_LOCATION; self->r.svFlags = SVF_BROADCAST; trap_LinkEntity( self ); // make the server send them to the clients if ( G_SpawnInt( "count", "", &self->customNumber) ) { if ( self->customNumber < 0 ) { self->customNumber = 0; } if ( self->customNumber > 7 ) { self->customNumber = 7; } message = va( "%c%c%s^7", Color::Constants::ESCAPE, self->customNumber + '0', self->message ); } else { message = self->message; } self->nextPathSegment = level.locationHead; self->s.generic1 = G_LocationIndex(message); level.locationHead = self; G_SetOrigin( self, self->s.origin );}
开发者ID:t4im,项目名称:Unvanquished,代码行数:33,
示例25: G_Spawn/*===================G_SpawnGEntityFromSpawnVarsSpawn an entity and fill in all of the level fields fromlevel.spawnVars[], then call the class specfic spawn function===================*/gentity_t *G_SpawnGEntityFromSpawnVars(void){ int i; gentity_t *ent = G_Spawn(); // get the next free entity char *str; for (i = 0 ; i < level.numSpawnVars ; i++) { G_ParseField(level.spawnVars[i][0], level.spawnVars[i][1], ent); } // check for "notteam" / "notfree" flags G_SpawnInt("notteam", "0", &i); if (i) { G_FreeEntity(ent); return NULL; } // allowteams handling G_SpawnString("allowteams", "", &str); if (str[0]) { str = Q_strlwr(str); if (strstr(str, "axis")) { ent->allowteams |= ALLOW_AXIS_TEAM; } if (strstr(str, "allies")) { ent->allowteams |= ALLOW_ALLIED_TEAM; } if (strstr(str, "cvops")) { ent->allowteams |= ALLOW_DISGUISED_CVOPS; } } if (ent->targetname && *ent->targetname) { ent->targetnamehash = BG_StringHashValue(ent->targetname); } else { ent->targetnamehash = -1; } // move editor origin to pos VectorCopy(ent->s.origin, ent->s.pos.trBase); VectorCopy(ent->s.origin, ent->r.currentOrigin); // if we didn't get a classname, don't bother spawning anything if (!G_CallSpawn(ent)) { G_FreeEntity(ent); } return ent;}
开发者ID:fretn,项目名称:etlegacy,代码行数:67,
示例26: SP_rail_trackvoid SP_rail_track(gentity_t *ent){ gi.SetBrushModel(ent, ent->model); G_SpawnInt("delay", "0", &ent->delay); mRailTracks.push_back().Setup(ent); G_FreeEntity(ent); mRailSystemActive = true;}
开发者ID:BishopExile,项目名称:OpenJK,代码行数:8,
示例27: SP_trigger_winvoid SP_trigger_win( gentity_t *self ){ G_SpawnInt( "team", "0", (int *)&self->stageTeam ); self->use = trigger_win; self->r.svFlags = SVF_NOCLIENT;}
开发者ID:redrumrobot,项目名称:trem-gpp-bots,代码行数:8,
示例28: G_SpawnGEntityFromSpawnVars/*=======================================================================================================================================G_SpawnGEntityFromSpawnVarsSpawn an entity and fill in all of the level fields fromlevel.spawnVars[], then call the class specfic spawn function=======================================================================================================================================*/void G_SpawnGEntityFromSpawnVars(void) { int i; gentity_t *ent; // get the next free entity ent = G_Spawn(); for (i = 0; i < level.numSpawnVars; i++) { G_ParseField(level.spawnVars[i][0], level.spawnVars[i][1], ent); } // check for "notteam"/"notfree" flags if (g_gametype.integer == GT_SINGLE_PLAYER) { G_SpawnInt("notsingle", "0", &i); if (i) { ADJUST_AREAPORTAL(); G_FreeEntity(ent); return; } } if (g_gametype.integer >= GT_TEAM) { G_SpawnInt("notteam", "0", &i); if (i) { ADJUST_AREAPORTAL(); G_FreeEntity(ent); return; } } else { G_SpawnInt("notfree", "0", &i); if (i) { ADJUST_AREAPORTAL(); G_FreeEntity(ent); return; } } // move editor origin to pos VectorCopy(ent->s.origin, ent->s.pos.trBase); VectorCopy(ent->s.origin, ent->r.currentOrigin); // if we didn't get a classname, don't bother spawning anything if (!G_CallSpawn(ent)) { ADJUST_AREAPORTAL(); G_FreeEntity(ent); }}
开发者ID:ioid3-games,项目名称:ioid3-rtcw,代码行数:54,
示例29: SP_func_usablevoid SP_func_usable( gentity_t *self ){ gi.SetBrushModel( self, self->model ); InitMover( self ); VectorCopy( self->s.origin, self->s.pos.trBase ); VectorCopy( self->s.origin, self->currentOrigin ); VectorCopy( self->s.origin, self->pos1 ); self->count = 1; if (self->spawnflags & 1) { self->spawnContents = self->contents; // It Navs can temporarly turn it "on" self->s.solid = 0; self->contents = 0; self->clipmask = 0; self->svFlags |= SVF_NOCLIENT; self->s.eFlags |= EF_NODRAW; self->count = 0; } if (self->spawnflags & 2) { self->s.eFlags |= EF_ANIM_ALLFAST; } if (self->spawnflags & 4) {//FIXME: need to be able to do change to something when it's done? Or not be usable until it's done? self->s.eFlags |= EF_ANIM_ONCE; } self->e_UseFunc = useF_func_usable_use; if ( self->health ) { self->takedamage = qtrue; self->e_DieFunc = dieF_func_usable_die; self->e_PainFunc = painF_func_usable_pain; } if ( self->endFrame > 0 ) { self->s.frame = self->startFrame = 0; self->s.eFlags |= EF_SHADER_ANIM; } gi.linkentity (self); int forceVisible = 0; G_SpawnInt( "forcevisible", "0", &forceVisible ); if ( forceVisible ) {//can see these through walls with force sight, so must be broadcast if ( VectorCompare( self->s.origin, vec3_origin ) ) {//no origin brush self->svFlags |= SVF_BROADCAST; } self->s.eFlags |= EF_FORCE_VISIBLE; }}
开发者ID:AlexXT,项目名称:OpenJK,代码行数:58,
注:本文中的G_SpawnInt函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ G_THEMED_ICON函数代码示例 C++ G_SpawnFloat函数代码示例 |