Exemplo n.º 1
0
void CNihilanthHVR :: TeleportInit( CNihilanth *pOwner, CBaseEntity *pEnemy, CBaseEntity *pTarget, CBaseEntity *pTouch )
{
	pev->movetype = MOVETYPE_FLY;
	pev->solid = SOLID_BBOX;

	pev->rendercolor.x = 255;
	pev->rendercolor.y = 255;
	pev->rendercolor.z = 255;
	pev->velocity.z *= 0.2;

	SET_MODEL(edict(), "sprites/exit1.spr");

	m_pNihilanth = pOwner;
	m_hEnemy = pEnemy;
	m_hTargetEnt = pTarget;
	m_hTouch = pTouch;

	SetThink( &CNihilanthHVR::TeleportThink );
	SetTouch( &CNihilanthHVR::TeleportTouch );
	pev->nextthink = gpGlobals->time + 0.1;

	EMIT_SOUND_DYN( edict(), CHAN_WEAPON, "x/x_teleattack1.wav", 1, 0.2, 0, 100 );
}
Exemplo n.º 2
0
void CCyclerSprite::Spawn(void)
{
	pev->solid = SOLID_SLIDEBOX;
	pev->movetype = MOVETYPE_NONE;
	pev->takedamage = DAMAGE_YES;
	pev->effects = 0;
	pev->frame = 0;
	pev->nextthink = gpGlobals->time + 0.1;

	m_animate = 1;
	m_lastTime = gpGlobals->time;

	PRECACHE_MODEL((char *)STRING(pev->model));
	SET_MODEL(ENT(pev), STRING(pev->model));

	m_maxFrame = (float)MODEL_FRAMES(pev->modelindex) - 1;
	m_renderfx = pev->renderfx;
	m_rendermode = pev->rendermode;
	m_renderamt = pev->renderamt;
	m_rendercolor[0] = pev->rendercolor[0];
	m_rendercolor[1] = pev->rendercolor[1];
	m_rendercolor[2] = pev->rendercolor[2];
}
Exemplo n.º 3
0
void CSprite::Spawn( void )
{
	pev->solid			= SOLID_NOT;
	pev->movetype		= MOVETYPE_NONE;
	pev->effects		= 0;
	pev->frame			= 0;

	Precache();
	SET_MODEL( ENT(pev), STRING(pev->model) );

	m_maxFrame = (float) MODEL_FRAMES( pev->modelindex ) - 1;
	if ( pev->targetname && !(pev->spawnflags & SF_SPRITE_STARTON) )
		TurnOff();
	else
		TurnOn();
	
	// Worldcraft only sets y rotation, copy to Z
	if ( pev->angles.y != 0 && pev->angles.z == 0 )
	{
		pev->angles.z = pev->angles.y;
		pev->angles.y = 0;
	}
}
Exemplo n.º 4
0
//=========================================================
// Spawn
//=========================================================
void CBarney :: Spawn()
{
	Precache( );

	SET_MODEL(ENT(pev), "models/barney.mdl");
	UTIL_SetSize(pev, VEC_HUMAN_HULL_MIN, VEC_HUMAN_HULL_MAX);

	pev->solid			= SOLID_SLIDEBOX;
	pev->movetype		= MOVETYPE_STEP;
	m_bloodColor		= BLOOD_COLOR_RED;
	pev->health			= gSkillData.barneyHealth;
	pev->view_ofs		= Vector ( 0, 0, 50 );// position of the eyes relative to monster's origin.
	m_flFieldOfView		= VIEW_FIELD_WIDE; // NOTE: we need a wide field of view so npc will notice player and say hello
	m_MonsterState		= MONSTERSTATE_NONE;

	pev->body			= 0; // gun in holster
	m_fGunDrawn			= FALSE;

	m_afCapability		= bits_CAP_HEAR | bits_CAP_TURN_HEAD | bits_CAP_DOORS_GROUP;

	MonsterInit();
	SetUse( &CBarney::FollowerUse );
}
Exemplo n.º 5
0
Arquivo: xen.cpp Projeto: Arkshine/NS
void CXenTree :: Spawn( void )
{
	Precache();

	SET_MODEL( ENT(pev), "models/tree.mdl" );
	pev->movetype	= MOVETYPE_NONE;
	pev->solid		= SOLID_BBOX;

	pev->takedamage = DAMAGE_YES;

	UTIL_SetSize( pev, Vector(-30,-30,0), Vector(30,30,188));
	SetActivity( ACT_IDLE );
	pev->nextthink = gpGlobals->time + 0.1;
	pev->frame = RANDOM_FLOAT(0,255);
	pev->framerate = RANDOM_FLOAT( 0.7, 1.4 );

	Vector triggerPosition;
	UTIL_MakeVectorsPrivate( pev->angles, triggerPosition, NULL, NULL );
	triggerPosition = pev->origin + (triggerPosition * 64);
	// Create the trigger
	m_pTrigger = CXenTreeTrigger::TriggerCreate( edict(), triggerPosition );
	UTIL_SetSize( m_pTrigger->pev, Vector( -24, -24, 0 ), Vector( 24, 24, 128 ) );
}
Exemplo n.º 6
0
void CFuncTank :: Spawn( void )
{
	Precache();

	pev->movetype	= MOVETYPE_PUSH;  // so it doesn't get pushed by anything
	pev->solid		= SOLID_BSP;
	SET_MODEL( ENT(pev), STRING(pev->model) );

	m_yawCenter = pev->angles.y;
	m_pitchCenter = pev->angles.x;

	if ( IsActive() )
		pev->nextthink = pev->ltime + 1.0;

	m_sightOrigin = BarrelPosition(); // Point at the end of the barrel

	if ( m_fireRate <= 0 )
		m_fireRate = 1;
	if ( m_spread > MAX_FIRING_SPREADS )
		m_spread = 0;

	pev->oldorigin = pev->origin;
}
//standard Spirit 1.0 spawn function
void CBaseDoor::Spawn( )
{
	Precache();
	SetMovedir (pev);

	if ( pev->skin == 0 )
	{//normal door
		if ( FBitSet (pev->spawnflags, SF_DOOR_PASSABLE) )
			pev->solid = SOLID_NOT;
		else
			pev->solid = SOLID_BSP;
	}
	else
	{// special contents
		pev->solid = SOLID_NOT;
		SetBits( pev->spawnflags, SF_DOOR_SILENT );	// water is silent for now
	}

	pev->movetype	= MOVETYPE_PUSH;
	SET_MODEL( ENT(pev), STRING(pev->model) );
	UTIL_SetOrigin(this, pev->origin);
	
	if (pev->speed == 0)
		pev->speed = 100;

	m_toggle_state = TS_AT_BOTTOM;

	// if the door is flagged for USE button activation only, use NULL touch function
	// (unless it's overridden, of course- LRC)
	if ( FBitSet ( pev->spawnflags, SF_DOOR_USE_ONLY ) &&
			!FBitSet ( pev->spawnflags, SF_DOOR_FORCETOUCHABLE ))
	{
		SetTouch ( NULL );
	}
	else // touchable button
		SetTouch( &CBaseDoor:: DoorTouch );
}
Exemplo n.º 8
0
CGrenade * CGrenade:: ShootTimed( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, float time )
{
	CGrenade *pGrenade = GetClassPtr( (CGrenade *)NULL );
	pGrenade->Spawn();

	UTIL_SetOrigin( pGrenade, vecStart );
	pGrenade->SetAbsVelocity( vecVelocity );
	pGrenade->SetLocalAngles( UTIL_VecToAngles( pGrenade->GetAbsVelocity( )));
	pGrenade->pev->owner = ENT( pevOwner );
	
	pGrenade->SetTouch( &CGrenade::BounceTouch );	// Bounce if touched
	
	// Take one second off of the desired detonation time and set the think to PreDetonate. PreDetonate
	// will insert a DANGER sound into the world sound list and delay detonation for one second so that 
	// the grenade explodes after the exact amount of time specified in the call to ShootTimed(). 

	pGrenade->pev->dmgtime = gpGlobals->time + time;
	pGrenade->SetThink( &CGrenade::TumbleThink );
	pGrenade->SetNextThink( 0.1 );

	if( time < 0.1 )
	{
		pGrenade->SetNextThink( 0 );
		pGrenade->SetLocalVelocity( g_vecZero );
	}
		
	pGrenade->pev->sequence = RANDOM_LONG( 3, 6 );
	pGrenade->pev->framerate = 1.0;

	pGrenade->pev->gravity = 0.5;
	pGrenade->pev->friction = 0.8;

	SET_MODEL( pGrenade->edict(), "models/w_grenade.mdl" );
	pGrenade->pev->dmg = 100;

	return pGrenade;
}
Exemplo n.º 9
0
void CFuncConveyor :: Spawn( void )
{
	pev->flags |= FL_WORLDBRUSH;
	pev->solid = SOLID_BSP;
	pev->movetype = MOVETYPE_PUSH;

	SET_MODEL( edict(), GetModel() );

	if( !FBitSet( pev->spawnflags, SF_CONVEYOR_VISUAL ))
		SetBits( pev->flags, FL_CONVEYOR );

	// is mapper forgot set angles?
	if( pev->movedir == g_vecZero )
		pev->movedir = Vector( 1, 0, 0 );

	// HACKHACK - This is to allow for some special effects
	if( FBitSet( pev->spawnflags, SF_CONVEYOR_NOTSOLID ))
	{
		pev->solid = SOLID_NOT;
		pev->skin = 0; // don't want the engine thinking we've got special contents on this brush
	}
	else
	{
		if( m_hParent )
			m_pUserData = WorldPhysic->CreateKinematicBodyFromEntity( this );
		else m_pUserData = WorldPhysic->CreateStaticBodyFromEntity( this );
	}

	if( pev->speed == 0 )
		pev->speed = 100;

	m_flMaxSpeed = pev->speed;	// save initial speed

	if( FBitSet( pev->spawnflags, SF_CONVEYOR_STARTOFF ))
		UpdateSpeed( 0 );
	else UpdateSpeed( m_flMaxSpeed );
}
Exemplo n.º 10
0
void BabblerProjectile::Spawn( void )
{
	Precache( );
	// motor
	pev->movetype = MOVETYPE_BOUNCE;
	pev->solid = SOLID_BBOX;
	pev->classname = MAKE_STRING(kwsBabblerProjectile);

	SET_MODEL(ENT(pev), kBabblerModel);
	//UTIL_SetSize(pev, Vector( -4, -4, 0), Vector(4, 4, 8));
	UTIL_SetSize(pev, Vector(HULL1_MINX, HULL1_MINY, HULL1_MINZ), Vector(HULL1_MAXX, HULL1_MAXY, HULL1_MAXZ));
	UTIL_SetOrigin( pev, pev->origin );

	SetTouch( &BabblerProjectile::SuperBounceTouch );
	SetThink( &BabblerProjectile::HuntThink );
	pev->nextthink = gpGlobals->time + 0.1;
	m_flNextHunt = gpGlobals->time + 1E6;

	pev->flags |= FL_MONSTER;
	pev->takedamage		= DAMAGE_AIM;
	pev->health			= gSkillData.snarkHealth;
	pev->gravity		= 0.5;
	pev->friction		= 0.5;

	m_flDie = gpGlobals->time + SQUEEK_DETONATE_DELAY;

	m_flFieldOfView = 0; // 180 degrees

	if ( pev->owner )
		m_hOwner = Instance( pev->owner );

	m_flNextBounceSoundTime = gpGlobals->time;// reset each time a snark is spawned.

	//pev->sequence = WSQUEAK_RUN;
	pev->sequence = 4;
	ResetSequenceInfo( );
}
Exemplo n.º 11
0
void CSqueakGrenade :: Spawn( void )
{
	Precache( );
	// motor
	pev->movetype = MOVETYPE_BOUNCE;
	pev->solid = SOLID_BBOX;

	SET_MODEL(ENT(pev), "models/w_squeak.mdl");
	UTIL_SetSize(pev, Vector( -4, -4, 0), Vector(4, 4, 8));
	UTIL_SetOrigin( this, pev->origin );

	SetTouch(&CSqueakGrenade :: SuperBounceTouch );
	SetThink(&CSqueakGrenade :: HuntThink );
	SetNextThink( 0.1 );
	m_flNextHunt = gpGlobals->time + 1E6;

	pev->flags |= FL_MONSTER;
	pev->takedamage		= DAMAGE_AIM;
	if (pev->health == 0)
		pev->health			= gSkillData.snarkHealth;
	pev->gravity		= 0.5;
	pev->friction		= 0.5;

	pev->dmg = gSkillData.snarkDmgPop;

	m_flDie = gpGlobals->time + SQUEEK_DETONATE_DELAY;

	m_flFieldOfView = 0; // 180 degrees

	if ( pev->owner )
		m_hOwner = Instance( pev->owner );

	m_flNextBounceSoundTime = gpGlobals->time;// reset each time a snark is spawned.

	pev->sequence = WSQUEAK_RUN;
	ResetSequenceInfo( );
}
Exemplo n.º 12
0
void COsprey :: Spawn( void )
{
	Precache( );
	// motor
	pev->movetype = MOVETYPE_FLY;
	pev->solid = SOLID_BBOX;

	SET_MODEL(ENT(pev), "models/osprey.mdl");
	UTIL_SetSize(pev, Vector( -400, -400, -100), Vector(400, 400, 32));
	UTIL_SetOrigin( pev, pev->origin );

	pev->flags |= FL_MONSTER;
	pev->takedamage		= DAMAGE_YES;
	m_flRightHealth		= 200;
	m_flLeftHealth		= 200;
	pev->health			= 400;

	m_flFieldOfView = 0; // 180 degrees

	pev->sequence = 0;
	ResetSequenceInfo( );
	pev->frame = RANDOM_LONG(0,0xFF);

	InitBoneControllers();

	SetThink( FindAllThink );
	SetUse( CommandUse );

	if (!(pev->spawnflags & SF_WAITFORTRIGGER))
	{
		pev->nextthink = gpGlobals->time + 1.0;
	}

	m_pos2 = pev->origin;
	m_ang2 = pev->angles;
	m_vel2 = pev->velocity;
}
Exemplo n.º 13
0
void CPendulum :: Spawn( void )
{
	// set the axis of rotation
	CBaseToggle :: AxisDir( pev );

	if ( FBitSet (pev->spawnflags, SF_DOOR_PASSABLE) )
		pev->solid		= SOLID_NOT;
	else
		pev->solid		= SOLID_BSP;
	pev->movetype	= MOVETYPE_PUSH;
	UTIL_SetOrigin(pev, pev->origin);
	SET_MODEL(ENT(pev), STRING(pev->model) );

	if ( m_distance == 0 )
		return;

	if (pev->speed == 0)
		pev->speed = 100;

	m_accel = (pev->speed * pev->speed) / (2 * fabs(m_distance));	// Calculate constant acceleration from speed and distance
	m_maxSpeed = pev->speed;
	m_start = pev->angles;
	m_center = pev->angles + (m_distance * 0.5) * pev->movedir;

	if ( FBitSet( pev->spawnflags, SF_BRUSH_ROTATE_INSTANT) )
	{		
		SetThink( SUB_CallUseToggle );
		pev->nextthink = gpGlobals->time + 0.1;
	}
	pev->speed = 0;
	SetUse( PendulumUse );

	if ( FBitSet( pev->spawnflags, SF_PENDULUM_SWING ) )
	{
		SetTouch ( RopeTouch );
	}
}
Exemplo n.º 14
0
//=========================================================
// Spawn
//=========================================================
void CAGrunt :: Spawn()
{
	Precache( );

	SET_MODEL(ENT(pev), "models/agrunt.mdl");
	UTIL_SetSize(pev, Vector(-32, -32, 0), Vector(32, 32, 64));

	pev->solid			= SOLID_SLIDEBOX;
	pev->movetype		= MOVETYPE_STEP;
	m_bloodColor		= BLOOD_COLOR_GREEN;
	pev->effects		= 0;
	pev->health			= gSkillData.agruntHealth;
	m_flFieldOfView		= 0.2;// indicates the width of this monster's forward view cone ( as a dotproduct result )
	m_MonsterState		= MONSTERSTATE_NONE;
	m_afCapability		= 0;
	m_afCapability		|= bits_CAP_SQUAD;

	m_HackedGunPos		= Vector( 24, 64, 48 );

	m_flNextSpeakTime	= m_flNextWordTime = gpGlobals->time + 10 + RANDOM_LONG(0, 10);


	MonsterInit();
}
Exemplo n.º 15
0
//=========================================================
// Randomly decide what powerup to be
void CDiscwarPowerup::ChoosePowerupThink(void)
{
	int iPowerup   = RANDOM_LONG(0, NUM_POWERUPS - 1);
	m_iPowerupType = (1 << iPowerup);

	SET_MODEL(ENT(pev), szPowerupModels[iPowerup]);
	pev->effects &= ~EF_NODRAW;

	SetTouch(&CDiscwarPowerup::PowerupTouch);

	// Start Animating
	pev->sequence = 0;
	pev->frame    = 0;
	ResetSequenceInfo();

	SetThink(&CDiscwarPowerup::AnimateThink);
	pev->nextthink = gpGlobals->time + 0.1;

	pev->rendermode = kRenderTransAdd;
	pev->renderamt  = 150;

	// Play the powerup appear sound
	EMIT_SOUND_DYN(edict(), CHAN_STATIC, "pspawn.wav", 1.0, ATTN_NORM, 0, 98 + RANDOM_LONG(0, 3));
}
Exemplo n.º 16
0
void CTank :: Spawn( void )
{
	Precache( );

//	pev->movetype = MOVETYPE_NOCLIP;
	pev->movetype = MOVETYPE_FLY;
	pev->solid = SOLID_BBOX;
	pev->classname = MAKE_STRING("info_tank_model");	//necessaire pour le passage a la sauvegarde : getclassptr ne cree pas de pev->classname et donc l entite n est pas prise en compte

	SET_MODEL(ENT(pev), "models/tank.mdl");

	UTIL_SetSize(pev, Vector(0,0,0), Vector(0,0,0) );
	UTIL_SetOrigin( pev, pev->origin );




	pev->flags |= FL_MONSTER;
	pev->takedamage		= DAMAGE_NO;
	pev->sequence		= 0;
	pev->health			= 100;

	m_flTempHealth		= m_pTankBSP->pev->health;

	ResetSequenceInfo( );
	pev->frame = RANDOM_LONG(0,0xFF);
	InitBoneControllers();

	bTankOn = bSetView = bTankDead =0;
	m_flLastAttack1 = m_soundPlaying = 0;

	SetThink( IdleThink );
	pev->nextthink = gpGlobals->time + 1;


}
Exemplo n.º 17
0
//
// Throw a chunk
//
void CGib :: Spawn( const char *szGibModel )
{
	pev->movetype = MOVETYPE_BOUNCE;
	pev->friction = 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 rendermode! bad!
	pev->renderamt = 255;
	pev->rendermode = kRenderNormal;
	pev->renderfx = kRenderFxNone;
	pev->solid = SOLID_SLIDEBOX;/// hopefully this will fix the VELOCITY TOO LOW crap
	pev->classname = MAKE_STRING("gib");

	SET_MODEL(ENT(pev), szGibModel);
	UTIL_SetSize(pev, Vector( 0, 0, 0), Vector(0, 0, 0));

	pev->nextthink = gpGlobals->time + 4;
	m_lifeTime = 10;
	SetThink ( &CGib::WaitTillLand );
	SetTouch ( &CGib::BounceGibTouch );

	m_material = matNone;
	m_cBloodDecals = 5;// how many blood decals this gib can place (1 per bounce until none remain). 
}
Exemplo n.º 18
0
//=========================================================
// Spawn
//=========================================================
void CGargantua :: Spawn()
{
	Precache( );

	SET_MODEL(ENT(pev), "models/garg.mdl");
	UTIL_SetSize( pev, Vector( -32, -32, 0 ), Vector( 32, 32, 64 ) );

	pev->solid			= SOLID_SLIDEBOX;
	pev->movetype		= MOVETYPE_STEP;
	m_bloodColor		= BLOOD_COLOR_GREEN;
	pev->health			= gSkillData.gargantuaHealth;
	//pev->view_ofs		= Vector ( 0, 0, 96 );// taken from mdl file
	m_flFieldOfView		= -0.2;// width of forward view cone ( as a dotproduct result )
	m_MonsterState		= MONSTERSTATE_NONE;

	MonsterInit();

	m_pEyeGlow = CSprite::SpriteCreate( GARG_EYE_SPRITE_NAME, pev->origin, false );
	m_pEyeGlow->SetTransparency( kRenderGlow, 255, 255, 255, 0, kRenderFxNoDissipation );
	m_pEyeGlow->SetAttachment( edict(), 1 );
	EyeOff();
	m_seeTime = gpGlobals->time + 5;
	m_flameTime = gpGlobals->time + 2;
}
Exemplo n.º 19
0
// CSSDK
void CGrenade::Spawn( void )
{
    m_iNumBounce	= 0;
    m_fPlantedC4	= FALSE;

    pev->movetype	= MOVETYPE_BOUNCE;
    pev->solid		= SOLID_BBOX;

    // TODO: Implements me.
    // 	if( pev->classname )
    // 		this->RemoveEntityHashValue( STRING( pev->classname ) );

    pev->classname	= MAKE_STRING( "grenade" );

    // TODO: Implements me.
    //	this->AddEntityHashValue( STRING( pev->classname ) );

    SET_MODEL( ENT( pev ), "models/grenade.mdl" );
    UTIL_SetSize( pev, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) );

    pev->dmg = 30.0;

    m_fRegisteredSound = FALSE;
}
Exemplo n.º 20
0
//=========================================================
// Spawn
//=========================================================
void CLuciole :: Spawn()
{
	Precache( );

	SET_MODEL(ENT(pev), "models/gorg.mdl");
	UTIL_SetSize( pev, Vector( -4, -4, -0 ), Vector( 4, 4, 8 ));

	pev->solid			= SOLID_SLIDEBOX;	//SOLID_SLIDEBOX;
	pev->movetype		= MOVETYPE_FLY;
	pev->flags			|= FL_FLY;
	m_bloodColor		= BLOOD_COLOR_GREEN;
	pev->health			= gSkillData.LucioleHealth;
	pev->view_ofs		= Vector( 0, 0, 3 );// position of the eyes relative to monster's origin.
	m_flFieldOfView		= VIEW_FIELD_FULL;// indicates the width of this monster's forward view cone ( as a dotproduct result )
	m_MonsterState		= MONSTERSTATE_NONE;

	m_flLastAttack		= 0;

	m_vecRoute			= pev->origin;

	m_iMouchard			= MOUCHARD_OFF;

	MonsterInit();
}
Exemplo n.º 21
0
void AddNodeEntity(const Vector &origin, int effects)
{
   edict_t *pNode = CREATE_ENTITY();
   if (g_fIsMetamod) {
      CALL_GAME_ENTITY(PLID, "info_node", VARS(pNode));
   } else {
      info_node(VARS(pNode));
   }

   pNode->v.classname = MAKE_STRING("info_node");
   SET_ORIGIN(pNode, origin);
   pNode->v.rendercolor.x = 255;
   pNode->v.rendercolor.y = 255;
   pNode->v.rendercolor.z = 0;
   pNode->v.rendermode = kRenderTransAdd;
   pNode->v.movetype = MOVETYPE_NONE;
   pNode->v.solid = SOLID_TRIGGER;
   SET_SIZE(ENT(&pNode->v), Vector(-8, -8, -8), Vector(8, 8, 8));
   pNode->v.renderfx = kRenderFxNoDissipation;
   pNode->v.renderamt = 255;
   pNode->v.scale = 0.2;
   SET_MODEL(ENT(pNode), "sprites/glow02.spr");
   pNode->v.effects = effects;
}
Exemplo n.º 22
0
void CBreakable::Spawn( void )
{
    Precache( );    

	if ( FBitSet( pev->spawnflags, SF_BREAK_TRIGGER_ONLY ) )
		pev->takedamage	= DAMAGE_NO;
	else
		pev->takedamage	= DAMAGE_YES;
  
	pev->solid		= SOLID_BSP;
    pev->movetype	= MOVETYPE_PUSH;
    m_angle			= pev->angles.y;
	pev->angles.y	= 0;

	// HACK:  matGlass can receive decals, we need the client to know about this
	//  so use class to store the material flag
	if ( m_Material == matGlass )
	{
		pev->playerclass = 1;
	}

	SET_MODEL(ENT(pev), STRING(pev->model) );//set size and link into world.

	SetTouch( &CBreakable::BreakTouch );
	if ( FBitSet( pev->spawnflags, SF_BREAK_TRIGGER_ONLY ) )		// Only break on trigger
		SetTouch( NULL );

	// << cgc >> Save max_health so we can reset the entity
	this->pev->max_health = this->pev->health;

	// Flag unbreakable glass as "worldbrush" so it will block ALL tracelines
	if ( !IsBreakable() && pev->rendermode != kRenderNormal )
		pev->flags |= FL_WORLDBRUSH;

	this->pev->iuser3 = AVH_USER3_BREAKABLE;
}
Exemplo n.º 23
0
CGrenade* CGrenade::ShootTimed( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, float time )
{
    CGrenade *pGrenade = GetClassPtr( (CGrenade *)NULL );

    pGrenade->Spawn();
    UTIL_SetOrigin( pGrenade->pev, vecStart );

    pGrenade->pev->velocity	= vecVelocity;
    pGrenade->pev->angles	= pevOwner->angles;
    pGrenade->pev->owner	= ENT( pevOwner );

    pGrenade->SetTouch( &CGrenade::BounceTouch );
    pGrenade->SetThink( &CGrenade::TumbleThink );

    pGrenade->pev->dmgtime	= gpGlobals->time + time;
    pGrenade->pev->nextthink= gpGlobals->time + 0.1;

    if( time < 0.1 )
    {
        pGrenade->pev->nextthink= gpGlobals->time;
        pGrenade->pev->velocity	= g_vecZero;
    }

    pGrenade->pev->sequence	= RANDOM_LONG( 3, 6 );
    pGrenade->pev->framerate= 1.0;

    pGrenade->m_fJustBlew	= TRUE;

    pGrenade->pev->gravity	= 0.5;
    pGrenade->pev->friction = 0.8;
    pGrenade->pev->dmg		= 35;

    SET_MODEL( ENT( pGrenade->pev ), "models/w_flashbang.mdl" );

    return pGrenade;
}
Exemplo n.º 24
0
/* <cd466> ../cstrike/dlls/h_cycler.cpp:96 */
void CCycler::GenericCyclerSpawn(char *szModel, Vector vecMin, Vector vecMax)
{
	if (!szModel || !szModel[0])
	{
		ALERT(at_error, "cycler at %.0f %.0f %0.f missing modelname", pev->origin.x, pev->origin.y, pev->origin.z);
		REMOVE_ENTITY(ENT(pev));
		return;
	}

	if (pev->classname)
	{
		RemoveEntityHashValue(pev, STRING(pev->classname), CLASSNAME);
	}

	MAKE_STRING_CLASS("cycler", pev);
	AddEntityHashValue(pev, STRING(pev->classname), CLASSNAME);

	PRECACHE_MODEL(szModel);
	SET_MODEL(ENT(pev), szModel);

	CCycler::Spawn();

	UTIL_SetSize(pev, vecMin, vecMax);
}
Exemplo n.º 25
0
void CTripmine::Spawn( )
{
	Precache( );
	m_iId = WEAPON_TRIPMINE;
	SET_MODEL(ENT(pev), "models/v_tripmine.mdl");
	pev->frame = 0;
	pev->body = 3;
	pev->sequence = TRIPMINE_GROUND;
	// ResetSequenceInfo( );
	pev->framerate = 0;

	FallInit();// get ready to fall down

	m_iDefaultAmmo = TRIPMINE_DEFAULT_GIVE;

#ifdef CLIENT_DLL
	if ( !bIsMultiplayer() )
#else
	if ( !g_pGameRules->IsDeathmatch() )
#endif
	{
		UTIL_SetSize(pev, Vector(-16, -16, 0), Vector(16, 16, 28) ); 
	}
}
Exemplo n.º 26
0
void CRpg::Spawn( )
{
	Precache( );
	m_iId = WEAPON_RPG;

	SET_MODEL(ENT(pev), "models/w_rpg.mdl");
	m_fSpotActive = 1;

#ifdef CLIENT_DLL
	if ( bIsMultiplayer() )
#else
	if ( g_pGameRules->IsMultiplayer() )
#endif
	{
		// more default ammo in multiplay. 
		m_iDefaultAmmo = RPG_DEFAULT_GIVE * 2;
	}
	else
	{
		m_iDefaultAmmo = RPG_DEFAULT_GIVE;
	}

	FallInit();// get ready to fall down.
}
Exemplo n.º 27
0
/* <7f49c> ../cstrike/dlls/explode.cpp:39 */
void CShower::__MAKE_VHOOK(Spawn)(void)
{
	pev->velocity = RANDOM_FLOAT(200, 300) * pev->angles;
	pev->velocity.x += RANDOM_FLOAT(-100, 100);
	pev->velocity.y += RANDOM_FLOAT(-100, 100);

	if (pev->velocity.z >= 0)
		pev->velocity.z += 200;
	else
		pev->velocity.z -= 200;

	pev->movetype = MOVETYPE_BOUNCE;
	pev->gravity = 0.5f;
	pev->nextthink = gpGlobals->time + 0.1f;
	pev->solid = SOLID_NOT;

	// Need a model, just use the grenade, we don't draw it anyway
	SET_MODEL(edict(), "models/grenade.mdl");
	UTIL_SetSize(pev, g_vecZero, g_vecZero);

	pev->effects |= EF_NODRAW;
	pev->speed = RANDOM_FLOAT(0.5, 1.5);
	pev->angles = g_vecZero;
}
Exemplo n.º 28
0
void CFuncTank::Spawn(void)
{
	Precache();

	pev->movetype = MOVETYPE_PUSH;
	pev->solid = SOLID_BSP;
	SET_MODEL(ENT(pev), STRING(pev->model));

	m_yawCenter = pev->angles.y;
	m_pitchCenter = pev->angles.x;

	if (IsActive())
		pev->nextthink = pev->ltime + 1;

	m_sightOrigin = BarrelPosition();

	if (m_fireRate <= 0)
		m_fireRate = 1;

	if (m_spread > (int)(MAX_FIRING_SPREADS))
		m_spread = 0;

	pev->oldorigin = pev->origin;
}
Exemplo n.º 29
0
void CSatchelCharge :: Spawn( void )
{
	Precache( );
	// motor
	pev->movetype = MOVETYPE_BOUNCE;
	pev->solid = SOLID_BBOX;

	SET_MODEL(ENT(pev), "models/w_satchel.mdl");
	//UTIL_SetSize(pev, Vector( -16, -16, -4), Vector(16, 16, 32));	// Old box -- size of headcrab monsters/players get blocked by this
	UTIL_SetSize(pev, Vector( -4, -4, -4), Vector(4, 4, 4));	// Uses point-sized, and can be stepped over
	UTIL_SetOrigin( pev, pev->origin );

	SetTouch( CSatchelCharge::SatchelSlide );
	SetUse( CGrenade::DetonateUse );
	SetThink( CSatchelCharge::SatchelThink );
	pev->nextthink = gpGlobals->time + 0.1;

	pev->gravity = 0.5;
	pev->friction = 0.8;

	pev->dmg = gSkillData.plrDmgSatchel;
	// ResetSequenceInfo( );
	pev->sequence = 1;
}
Exemplo n.º 30
0
//=========================================================
// ********** DeadGenericMonster SPAWN **********
//=========================================================
void CDeadGenericMonster :: Spawn( void )
{
	Precache();
	SET_MODEL(ENT(pev), STRING(pev->model));

	pev->effects		= 0;
	pev->yaw_speed		= 8; //LRC -- what?
	pev->sequence		= 0;

	if (pev->netname)
	{
		pev->sequence = LookupSequence( STRING(pev->netname) );

		if (pev->sequence == -1)
		{
			ALERT ( at_debug, "Invalid sequence name \"%s\" in monster_generic_dead\n", STRING(pev->netname) );
		}
	}
	else
	{
		pev->sequence = LookupActivity( pev->frags );
//		if (pev->sequence == -1)
//		{
//			ALERT ( at_error, "monster_generic_dead - specify a sequence name or choose a different death type: model \"%s\" has no available death sequences.\n", STRING(pev->model) );
//		}
		//...and if that doesn't work, forget it.
	}

	// Corpses have less health
	pev->health			= 8;

	MonsterInitDead();

	ResetSequenceInfo( );
	pev->frame = 255; // pose at the _end_ of its death sequence.
}