//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CTFGrenadePipebombProjectile::Spawn() { if ( m_iType == TF_GL_MODE_REMOTE_DETONATE ) { // Set this to max, so effectively they do not self-implode. SetModel( TF_WEAPON_PIPEBOMB_MODEL ); SetDetonateTimerLength( FLT_MAX ); } else { SetModel( TF_WEAPON_PIPEGRENADE_MODEL ); SetDetonateTimerLength( TF_WEAPON_GRENADE_DETONATE_TIME ); SetTouch( &CTFGrenadePipebombProjectile::PipebombTouch ); } BaseClass::Spawn(); m_bTouched = false; m_flCreationTime = gpGlobals->curtime; // We want to get touch functions called so we can damage enemy players AddSolidFlags( FSOLID_TRIGGER ); m_flMinSleepTime = 0; }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CPointCommentaryNode::Spawn( void ) { // No model specified? char *szModel = (char *)STRING( GetModelName() ); if (!szModel || !*szModel) { szModel = "models/extras/info_speech.mdl"; SetModelName( AllocPooledString(szModel) ); } Precache(); SetModel( szModel ); UTIL_SetSize( this, -Vector(16,16,16), Vector(16,16,16) ); SetSolid( SOLID_BBOX ); AddSolidFlags( FSOLID_CUSTOMRAYTEST | FSOLID_CUSTOMBOXTEST ); AddEffects( EF_NOSHADOW ); // Setup for animation ResetSequence( LookupSequence("idle") ); SetThink( &CPointCommentaryNode::SpinThink ); SetNextThink( gpGlobals->curtime + 0.1f ); m_iNodeNumber = 0; m_iNodeNumberMax = 0; SetDisabled( m_bDisabled ); }
void CGrenadePathfollower::Spawn( void ) { Precache( ); // ------------------------- // Inert when first spawned // ------------------------- SetSolid( SOLID_BBOX ); AddSolidFlags( FSOLID_NOT_SOLID ); SetMoveType( MOVETYPE_NONE ); AddFlag( FL_OBJECT ); // So can be shot down AddEffects( EF_NODRAW ); UTIL_SetSize(this, Vector(0, 0, 0), Vector(0, 0, 0)); m_flDamage = sk_dmg_pathfollower_grenade.GetFloat(); m_DmgRadius = sk_pathfollower_grenade_radius.GetFloat(); m_takedamage = DAMAGE_YES; m_iHealth = 200; SetGravity( 0.00001 ); SetFriction( 0.8 ); SetSequence( 1 ); }
// // Throw a chunk // void CGib::Spawn( const char *szGibModel ) { SetMoveType( MOVETYPE_FLYGRAVITY, MOVECOLLIDE_FLY_BOUNCE ); SetFriction(0.55); // deading the bounce a bit // sometimes an entity inherits the edict from a former piece of glass, // and will spawn using the same render FX or m_nRenderMode! bad! SetRenderColorA( 255 ); m_nRenderMode = kRenderNormal; m_nRenderFX = kRenderFxNone; // hopefully this will fix the VELOCITY TOO LOW crap m_takedamage = DAMAGE_EVENTS_ONLY; SetSolid( SOLID_BBOX ); AddSolidFlags( FSOLID_NOT_STANDABLE ); SetCollisionGroup( COLLISION_GROUP_DEBRIS ); SetModel( szGibModel ); #ifdef HL1_DLL SetElasticity( 1.0 ); UTIL_SetSize( this, vec3_origin, vec3_origin ); #endif//HL1_DLL SetNextThink( gpGlobals->curtime + 4 ); m_lifeTime = 25; SetTouch ( &CGib::BounceGibTouch ); m_bForceRemove = false; m_material = matNone; m_cBloodDecals = 5;// how many blood decals this gib can place (1 per bounce until none remain). }
//----------------------------------------------------------------------------- // Spawn //----------------------------------------------------------------------------- void CNPC_Mossman :: Spawn() { Precache(); BaseClass::Spawn(); SetModel( "models/mossman.mdl" ); SetHullType(HULL_HUMAN); SetHullSizeNormal(); SetSolid( SOLID_BBOX ); AddSolidFlags( FSOLID_NOT_STANDABLE ); SetMoveType( MOVETYPE_STEP ); SetBloodColor( BLOOD_COLOR_RED ); m_iHealth = 8; m_flFieldOfView = 0.5;// indicates the width of this NPC's forward view cone ( as a dotproduct result ) m_NPCState = NPC_STATE_NONE; CapabilitiesAdd( bits_CAP_MOVE_GROUND | bits_CAP_OPEN_DOORS | bits_CAP_ANIMATEDFACE | bits_CAP_TURN_HEAD ); NPCInit(); Relink(); }
//------------------------------------------------ // Spawn //------------------------------------------------ void CPropCannon::Spawn( void ) { Precache(); SetModel( STRING( GetModelName() ) ); SetCollisionGroup( COLLISION_GROUP_VEHICLE ); BaseClass::Spawn(); SetSolid( SOLID_BBOX ); AddSolidFlags( FSOLID_NOT_SOLID ); SetMoveType( MOVETYPE_NOCLIP ); m_takedamage = DAMAGE_EVENTS_ONLY; m_takedamage = DAMAGE_EVENTS_ONLY; m_flTurn = 0; m_flExtension = 0; m_flFlyTime = 0.0f; m_flNextAttackTime = gpGlobals->curtime; InitCannonSpeeds(); SetPoseParameter( "armextensionpose", m_flExtension ); CreateVPhysics(); SetNextThink( gpGlobals->curtime ); }
// ----------------------------------------------------------------------------- // // CWeaponDODBase implementation. // ----------------------------------------------------------------------------- // CWeaponDODBase::CWeaponDODBase() { SetPredictionEligible( true ); m_bInAttack = false; m_iAltFireHint = 0; AddSolidFlags( FSOLID_TRIGGER ); // Nothing collides with these but it gets touches. }
//------------------------------------------------ // Spawn //------------------------------------------------ void CPropCrane::Spawn( void ) { Precache(); SetModel( STRING( GetModelName() ) ); SetCollisionGroup( COLLISION_GROUP_VEHICLE ); BaseClass::Spawn(); SetSolid( SOLID_BBOX ); AddSolidFlags( FSOLID_NOT_SOLID ); SetMoveType( MOVETYPE_NOCLIP ); m_takedamage = DAMAGE_EVENTS_ONLY; m_flTurn = 0; m_flExtension = 0; m_flNextDangerSoundTime = 0; m_flNextCreakSound = 0; m_flNextDropAllowedTime = 0; m_flSlowRaiseTime = 0; m_bDropping = false; m_bMagnetOn = false; InitCraneSpeeds(); SetPoseParameter( "armextensionpose", m_flExtension ); CreateVPhysics(); SetNextThink( gpGlobals->curtime ); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CNPC_Bug_Warrior::Spawn( void ) { Precache(); SetModel( BUG_WARRIOR_MODEL ); SetHullType(HULL_WIDE_HUMAN);//HULL_WIDE_SHORT; SetHullSizeNormal(); SetDefaultEyeOffset(); SetViewOffset( (WorldAlignMins() + WorldAlignMaxs()) * 0.5 ); // See from my center SetDistLook( 1024.0 ); SetNavType(NAV_GROUND); m_NPCState = NPC_STATE_NONE; SetBloodColor( BLOOD_COLOR_YELLOW ); m_iHealth = npc_bug_warrior_health.GetFloat(); SetSolid( SOLID_BBOX ); AddSolidFlags( FSOLID_NOT_STANDABLE ); SetMoveType( MOVETYPE_STEP ); m_iszPatrolPathName = NULL_STRING; // Only do this if a squadname appears in the entity if ( m_SquadName != NULL_STRING ) { CapabilitiesAdd( bits_CAP_SQUAD ); } CapabilitiesAdd( bits_CAP_MOVE_GROUND | bits_CAP_INNATE_MELEE_ATTACK1 ); NPCInit(); BaseClass::Spawn(); }
//----------------------------------------------------------------------------- bool CBaseDoor::CreateVPhysics( ) { if ( !FClassnameIs( this, "func_water" ) ) { //normal door // NOTE: Create this even when the door is not solid to support constraints. VPhysicsInitShadow( false, false ); } else { // special contents AddSolidFlags( FSOLID_VOLUME_CONTENTS ); SETBITS( m_spawnflags, SF_DOOR_SILENT ); // water is silent for now IPhysicsObject *pPhysics = VPhysicsInitShadow( false, false ); fluidparams_t fluid; Assert( CollisionProp()->GetCollisionAngles() == vec3_angle ); fluid.damping = 0.01f; fluid.surfacePlane[0] = 0; fluid.surfacePlane[1] = 0; fluid.surfacePlane[2] = 1; fluid.surfacePlane[3] = CollisionProp()->GetCollisionOrigin().z + CollisionProp()->OBBMaxs().z - 1; fluid.currentVelocity.Init(0,0,0); fluid.torqueFactor = 0.1f; fluid.viscosityFactor = 0.01f; fluid.pGameData = static_cast<void *>(this); //FIXME: Currently there's no way to specify that you want slime fluid.contents = CONTENTS_WATER; physenv->CreateFluidController( pPhysics, &fluid ); } return true; }
//----------------------------------------------------------------------------- // Purpose: This used to have something to do with bees flying, but // now it only initializes moving furniture in scripted sequences //----------------------------------------------------------------------------- void CNPC_Furniture::Spawn( ) { Precache(); SetModel( STRING(GetModelName()) ); SetMoveType( MOVETYPE_STEP ); SetSolid( SOLID_BBOX ); // Our collision, if needed, will be done through bone followers AddSolidFlags( FSOLID_NOT_SOLID ); SetBloodColor( DONT_BLEED ); m_iHealth = TOO_MUCH_HEALTH_TO_DIE; //wow m_takedamage = DAMAGE_AIM; SetSequence( 0 ); SetCycle( 0 ); SetNavType( NAV_FLY ); AddFlag( FL_FLY ); CapabilitiesAdd( bits_CAP_MOVE_FLY | bits_CAP_TURN_HEAD | bits_CAP_ANIMATEDFACE ); AddEFlags( EFL_NO_MEGAPHYSCANNON_RAGDOLL ); // pev->nextthink += 1.0; // SetThink (WalkMonsterDelay); ResetSequenceInfo( ); SetCycle( 0 ); NPCInit(); // Furniture needs to block LOS SetBlocksLOS( true ); }
//----------------------------------------------------------------------------- // Spawn //----------------------------------------------------------------------------- void CNPC_GMan::Spawn() { Precache(); BaseClass::Spawn(); SetModel( "models/gman.mdl" ); SetHullType(HULL_HUMAN); SetHullSizeNormal(); SetSolid( SOLID_BBOX ); AddSolidFlags( FSOLID_NOT_STANDABLE ); SetMoveType( MOVETYPE_STEP ); SetBloodColor( BLOOD_COLOR_RED ); m_iHealth = 8; m_flFieldOfView = 0.5;// indicates the width of this NPC's forward view cone ( as a dotproduct result ) m_NPCState = NPC_STATE_NONE; SetImpactEnergyScale( 0.0f ); // no physics damage on the gman CapabilitiesAdd( bits_CAP_MOVE_GROUND | bits_CAP_OPEN_DOORS | bits_CAP_ANIMATEDFACE | bits_CAP_TURN_HEAD ); CapabilitiesAdd( bits_CAP_FRIENDLY_DMG_IMMUNE ); AddEFlags( EFL_NO_DISSOLVE | EFL_NO_MEGAPHYSCANNON_RAGDOLL ); NPCInit(); }
void CGEGrenade::Spawn( void ) { Precache(); BaseClass::Spawn(); SetModel( "models/weapons/grenade/w_grenade.mdl" ); // So NPC's can "see" us AddFlag( FL_OBJECT ); m_takedamage = DAMAGE_YES; m_iHealth = 1; m_bHitSomething = false; m_bDroppedOnDeath = false; // Default Damages they should be modified by the thrower SetDamage( 320 ); SetDamageRadius( 260 ); SetSize( -Vector(4,4,4), Vector(4,4,4) ); SetCollisionGroup( COLLISION_GROUP_MINE ); // Init our physics definition VPhysicsInitNormal( SOLID_VPHYSICS, GetSolidFlags() | FSOLID_TRIGGER, false ); SetMoveType( MOVETYPE_VPHYSICS ); // Don't think until we have a time to think about! SetThink( NULL ); // Bounce if we hit something! SetTouch( &BaseClass::BounceTouch ); AddSolidFlags( FSOLID_NOT_STANDABLE ); }
void CPhysicsCannister::Spawn( void ) { Precache(); SetModel( STRING(GetModelName()) ); SetBloodColor( DONT_BLEED ); AddSolidFlags( FSOLID_CUSTOMRAYTEST ); m_takedamage = DAMAGE_YES; SetNextThink( TICK_NEVER_THINK ); if ( m_iHealth <= 0 ) m_iHealth = 25; m_flAnimTime = gpGlobals->curtime; m_flPlaybackRate = 0.0; SetCycle( 0 ); m_bFired = false; // not thrusting m_active = false; CreateVPhysics(); if ( !VPhysicsGetObject() ) { // must have a physics object or code will crash later UTIL_Remove(this); } }
void CStatueProp::Event_Killed( const CTakeDamageInfo &info ) { IPhysicsObject *pPhysics = VPhysicsGetObject(); if ( pPhysics && !pPhysics->IsMoveable() ) { pPhysics->EnableMotion( true ); VPhysicsTakeDamage( info ); } m_nShatterFlags = 0; // If you have some flags to network for the shatter effect, put them here! m_vShatterPosition = info.GetDamagePosition(); m_vShatterForce = info.GetDamageForce(); m_bShatter = true; // Skip over breaking code! //Break( info.GetInflictor(), info ); //BaseClass::Event_Killed( info ); // FIXME: Short delay before we actually remove so that the client statue gets a network update before we need it // This isn't a reliable way to do this and needs to be rethought. AddSolidFlags( FSOLID_NOT_SOLID ); SetNextThink( gpGlobals->curtime + 0.2f ); SetThink( &CBaseEntity::SUB_Remove ); }
//========================================================= // Spawn //========================================================= void CNPC_HAssassin::Spawn() { Precache( ); SetModel( "models/hassassin.mdl"); SetHullType(HULL_HUMAN); SetHullSizeNormal(); SetNavType ( NAV_GROUND ); SetSolid( SOLID_BBOX ); AddSolidFlags( FSOLID_NOT_STANDABLE ); SetMoveType( MOVETYPE_STEP ); m_bloodColor = BLOOD_COLOR_RED; ClearEffects(); m_iHealth = sk_hassassin_health.GetFloat(); m_flFieldOfView = VIEW_FIELD_WIDE; // indicates the width of this monster's forward view cone ( as a dotproduct result ) m_NPCState = NPC_STATE_NONE; m_HackedGunPos = Vector( 0, 24, 48 ); m_iTargetRanderamt = 20; SetRenderColor( 255, 255, 255, 20 ); m_nRenderMode = kRenderTransTexture; CapabilitiesClear(); CapabilitiesAdd( bits_CAP_MOVE_GROUND ); CapabilitiesAdd( bits_CAP_INNATE_RANGE_ATTACK1 | bits_CAP_INNATE_RANGE_ATTACK2 | bits_CAP_INNATE_MELEE_ATTACK1 ); NPCInit(); }
//========================================================= // Spawn //========================================================= void CNPC_Bullsquid::Spawn() { Precache( ); SetModel( "models/bullsquid.mdl"); SetHullType(HULL_WIDE_SHORT); SetHullSizeNormal(); SetSolid( SOLID_BBOX ); AddSolidFlags( FSOLID_NOT_STANDABLE ); SetMoveType( MOVETYPE_STEP ); m_bloodColor = BLOOD_COLOR_GREEN; SetRenderColor( 255, 255, 255, 255 ); m_iHealth = sk_bullsquid_health.GetFloat(); m_flFieldOfView = 0.2;// indicates the width of this monster's forward view cone ( as a dotproduct result ) m_NPCState = NPC_STATE_NONE; CapabilitiesClear(); CapabilitiesAdd( bits_CAP_MOVE_GROUND | bits_CAP_INNATE_RANGE_ATTACK1 | bits_CAP_INNATE_MELEE_ATTACK1 | bits_CAP_INNATE_MELEE_ATTACK2 ); m_fCanThreatDisplay = TRUE; m_flNextSpitTime = gpGlobals->curtime; NPCInit(); m_flDistTooFar = 784; }
//========================================================= // Spawn //========================================================= void CNPC_Houndeye::Spawn() { Precache( ); SetModel("models/houndeye.mdl"); SetHullType(HULL_WIDE_SHORT); SetHullSizeNormal(); SetSolid( SOLID_BBOX ); AddSolidFlags( FSOLID_NOT_STANDABLE ); SetMoveType( MOVETYPE_STEP ); SetBloodColor( BLOOD_COLOR_YELLOW ); m_iHealth = sk_Houndeye_health.GetFloat(); m_flFieldOfView = 0.5;// indicates the width of this monster's forward view cone ( as a dotproduct result ) m_NPCState = NPC_STATE_NONE; m_fAsleep = false; // everyone spawns awake m_fDontBlink = false; CapabilitiesAdd( bits_CAP_SQUAD ); CapabilitiesAdd( bits_CAP_MOVE_GROUND ); CapabilitiesAdd( bits_CAP_INNATE_RANGE_ATTACK1 ); CapabilitiesAdd( bits_CAP_TURN_HEAD ); m_flNextSecondaryAttack = 0; m_bLoopClockwise = random->RandomInt(0,1) ? true : false; SetCollisionGroup( HL2COLLISION_GROUP_HOUNDEYE ); NPCInit(); }
void CBasePlayer::SharedSpawn() { SetMoveType( MOVETYPE_WALK ); SetSolid( SOLID_BBOX ); AddSolidFlags( FSOLID_NOT_STANDABLE ); SetFriction( 1.0f ); pl.deadflag = false; m_lifeState = LIFE_ALIVE; m_iHealth = 100; m_takedamage = DAMAGE_YES; m_Local.m_bDrawViewmodel = true; m_Local.m_flStepSize = sv_stepsize.GetFloat(); m_Local.m_bAllowAutoMovement = true; m_nRenderFX = kRenderFxNone; m_flNextAttack = gpGlobals->curtime; m_flMaxspeed = 0.0f; MDLCACHE_CRITICAL_SECTION(); SetSequence( SelectWeightedSequence( ACT_IDLE ) ); if ( GetFlags() & FL_DUCKING ) SetCollisionBounds( VEC_DUCK_HULL_MIN, VEC_DUCK_HULL_MAX ); else SetCollisionBounds( VEC_HULL_MIN, VEC_HULL_MAX ); // dont let uninitialized value here hurt the player m_Local.m_flFallVelocity = 0; SetBloodColor( BLOOD_COLOR_RED ); }
//----------------------------------------------------------------------------- // Purpose: Initializes the control zone // Records who was the original controlling team (for control locking) //----------------------------------------------------------------------------- void CControlZone::Spawn( void ) { // set the starting controlling team m_ControllingTeam.Set( GetTeamNumber(), this, this ); // remember who the original controlling team was (for control locking) m_iDefendingTeam = GetTeamNumber(); // Solid SetSolid( SOLID_BSP ); AddSolidFlags( FSOLID_TRIGGER ); SetMoveType( MOVETYPE_NONE ); SetModel( STRING( GetModelName() ) ); // set size and link into world // TF2 rules m_flTimeTillContested = 10.0; // Go to contested 10 seconds after enemies enter the zone m_flTimeTillCaptured = 5.0; // Go to captured state as soon as only one team holds the zone if ( m_nZoneNumber == 0 ) { Warning( "Warning, trigger_controlzone without Zone Number set\n" ); } m_ZonePlayerList.Purge(); }
//----------------------------------------------------------------------------- //----------------------------------------------------------------------------- void CWeaponStunStick::Spawn() { Precache(); BaseClass::Spawn(); AddSolidFlags( FSOLID_NOT_STANDABLE ); }
//----------------------------------------------------------------------------- // Spawn //----------------------------------------------------------------------------- void CNPC_Kleiner::Spawn() { // Allow custom model usage (mostly for monitors) char *szModel = (char *)STRING( GetModelName() ); if (!szModel || !*szModel) { szModel = "models/kleiner.mdl"; SetModelName( AllocPooledString(szModel) ); } Precache(); SetModel( szModel ); BaseClass::Spawn(); SetHullType(HULL_HUMAN); SetHullSizeNormal(); SetSolid( SOLID_BBOX ); AddSolidFlags( FSOLID_NOT_STANDABLE ); SetMoveType( MOVETYPE_STEP ); SetBloodColor( BLOOD_COLOR_RED ); m_iHealth = 8; m_flFieldOfView = 0.5;// indicates the width of this NPC's forward view cone ( as a dotproduct result ) m_NPCState = NPC_STATE_NONE; CapabilitiesAdd( bits_CAP_MOVE_GROUND | bits_CAP_OPEN_DOORS | bits_CAP_ANIMATEDFACE | bits_CAP_TURN_HEAD ); CapabilitiesAdd( bits_CAP_FRIENDLY_DMG_IMMUNE ); AddEFlags( EFL_NO_DISSOLVE | EFL_NO_MEGAPHYSCANNON_RAGDOLL | EFL_NO_PHYSCANNON_INTERACTION ); NPCInit(); }
bool CItem::CreateItemVPhysicsObject( void ) { // Create the object in the physics system int nSolidFlags = GetSolidFlags() | FSOLID_NOT_STANDABLE; if ( !m_bActivateWhenAtRest ) { nSolidFlags |= FSOLID_TRIGGER; } if ( VPhysicsInitNormal( SOLID_VPHYSICS, nSolidFlags, false ) == NULL ) { SetSolid( SOLID_BBOX ); AddSolidFlags( nSolidFlags ); // If it's not physical, drop it to the floor if (UTIL_DropToFloor(this, MASK_SOLID) == 0) { Warning( "Item %s fell out of level at %f,%f,%f\n", GetClassname(), GetAbsOrigin().x, GetAbsOrigin().y, GetAbsOrigin().z); UTIL_Remove( this ); return false; } } return true; }
//========================================================= // Spawn() // Crear un nuevo //========================================================= void CNPC_Scient::Spawn() { Precache(); // Modelo y color de sangre. SetModel(MODEL_BASE); SetBloodColor(BLOOD); // Tamaño SetHullType(HULL_WIDE_SHORT); SetHullSizeNormal(); // Navegación, estado físico y opciones extra. SetSolid(SOLID_BBOX); SetNavType(NAV_GROUND); AddSolidFlags(FSOLID_NOT_STANDABLE); SetMoveType(MOVETYPE_STEP); SetRenderColor(255, 255, 255, 255); SetDistLook(SEE_DIST); // Reseteo de variables. // Salud, estado del NPC y vista. m_iHealth = sk_scient_health.GetFloat(); m_NPCState = NPC_STATE_NONE; m_flFieldOfView = FOV; // Capacidades CapabilitiesClear(); CapabilitiesAdd(CAPABILITIES); NPCInit(); BaseClass::Spawn(); }
//----------------------------------------------------------------------------- // Purpose: // // //----------------------------------------------------------------------------- void CNPC_Blob::Spawn( void ) { Precache(); SetModel( NPC_BLOB_MODEL ); SetHullType(HULL_TINY); SetHullSizeNormal(); SetSolid( SOLID_NONE ); AddSolidFlags( FSOLID_NOT_STANDABLE ); SetMoveType( MOVETYPE_STEP ); SetBloodColor( BLOOD_COLOR_RED ); m_iHealth = INT_MAX; m_flFieldOfView = -1.0f; m_NPCState = NPC_STATE_NONE; CapabilitiesClear(); CapabilitiesAdd( bits_CAP_MOVE_GROUND ); m_Elements.RemoveAll(); NPCInit(); AddEffects( EF_NODRAW ); m_flMinElementDist = blob_mindist.GetFloat(); }
//========================================================= // Materialize - make a CWeaponCSBase visible and tangible //========================================================= void CWeaponCSBase::Materialize() { if ( m_fEffects & EF_NODRAW ) { // changing from invisible state to visible. //Ken: Suppress the default sound //--- if( g_pGameRules->IsMultiplayer() ) { //EMIT_SOUND_DYN( ENT(pev), CHAN_WEAPON, "items/suitchargeok1.wav", 1, ATTN_NORM, 0, 150 ); } //--- m_fEffects &= ~EF_NODRAW; m_fEffects |= EF_MUZZLEFLASH; } AddSolidFlags( FSOLID_TRIGGER ); Relink(); //SetTouch( &CWeaponCSBase::DefaultTouch ); //Ken: Leave guns & items lying around in single-player //--- if( g_pGameRules->IsMultiplayer() ) { SetThink (&CWeaponCSBase::SUB_Remove); SetNextThink( gpGlobals->curtime + 1 ); } else { SetThink( NULL ); } }
//------------------------------------------------------------------------------ // Purpose : Override so doesn't fall to ground when killed //------------------------------------------------------------------------------ void CNPC_Bullseye::Event_Killed( const CTakeDamageInfo &info ) { BaseClass::Event_Killed( info ); if( GetParent() ) { if( GetParent()->ClassMatches("prop_combine_ball") ) { // If this bullseye is parented to a combine ball, explode the combine ball // and remove this bullseye. variant_t emptyVariant; GetParent()->AcceptInput( "explode", this, this, emptyVariant, 0 ); // Unhook. SetParent(NULL); UTIL_Remove(this); return; } } SetMoveType( MOVETYPE_NONE ); AddSolidFlags( FSOLID_NOT_SOLID ); UTIL_SetSize(this, vec3_origin, vec3_origin ); SetNextThink( gpGlobals->curtime + 0.1f ); SetThink( &CBaseEntity::SUB_Remove ); }
// ----------------------------------------------------------------------------- // // CWeaponHL2MPBase implementation. // ----------------------------------------------------------------------------- // CWeaponHL2MPBase::CWeaponHL2MPBase() { SetPredictionEligible( true ); AddSolidFlags( FSOLID_TRIGGER ); // Nothing collides with these but it gets touches. m_flNextResetCheckTime = 0.0f; }
void CASW_Rocket::SetGracePeriod( float flGracePeriod ) { m_flGracePeriodEndsAt = gpGlobals->curtime + flGracePeriod; // Go non-solid until the grace period ends AddSolidFlags( FSOLID_NOT_SOLID ); }
void CASW_Path_Utils_NPC::Spawn() { CapabilitiesAdd( bits_CAP_MOVE_GROUND | bits_CAP_OPEN_DOORS ); SetModel( SWARM_NEW_DRONE_MODEL ); NPCInit(); UTIL_SetSize(this, NAI_Hull::Mins(HULL_MEDIUMBIG), NAI_Hull::Maxs(HULL_MEDIUMBIG)); SetSolid( SOLID_BBOX ); AddSolidFlags( FSOLID_NOT_SOLID ); AddSolidFlags( FSOLID_NOT_STANDABLE ); SetMoveType( MOVETYPE_STEP ); m_takedamage = DAMAGE_NO; SetRenderMode(kRenderNone); AddEffects(EF_NODRAW | EF_NOSHADOW); }