Пример #1
0
void CCycler :: Spawn( )
{
	InitBoneControllers();
	pev->solid			= SOLID_SLIDEBOX;
	pev->movetype		= MOVETYPE_NONE;
	pev->takedamage		= DAMAGE_YES;
	pev->effects		= 0;
	pev->health			= 80000;// no cycler should die
	pev->yaw_speed		= 5;
	pev->ideal_yaw		= pev->angles.y;
	ChangeYaw( 360 );
	
	m_flFrameRate		= 75;
	m_flGroundSpeed		= 0;

	pev->nextthink		+= 1.0;

	ResetSequenceInfo( );

	if (pev->sequence != 0 || pev->frame != 0)
	{
		m_animate = 0;
		pev->framerate = 0;
	}
	else
	{
		m_animate = 1;
	}
}
Пример #2
0
void CFuncMachinegun::Spawn()
{
	Precache();
	pev->movetype	= MOVETYPE_FLY;
	pev->solid	= SOLID_BBOX;
	pev->takedamage = DAMAGE_AIM;
	pev->angles.x	= 0;
	pev->renderfx 	= 51; // хак для рендерера, чтобы он не интерполировал контроллеры
	pev->health 	= pev->max_health;
	pev->armorvalue = pev->armortype;
	pev->weapons 	= m_iAmmo;//for respawn
	pev->origin.z  += 1;
	DROP_TO_FLOOR ( ENT(pev) );
	pev->oldorigin 	= pev->origin;

	if (pev->model)
		SET_MODEL( ENT(pev), STRING(pev->model) );
	else
		SET_MODEL(ENT(pev), "models/error.mdl");

	UTIL_SetSize( pev, Vector(-25,-25,0), Vector(25,25,35));

	ResetSequenceInfo();
	m_fSequenceLoops = TRUE;
	InitBoneControllers();
}
Пример #3
0
//=========================================================
// Spawn
//=========================================================
void CBarnacle :: Spawn()
{
	Precache( );

	if (pev->model)
		SET_MODEL(ENT(pev), STRING(pev->model)); //LRC
	else
		SET_MODEL(ENT(pev), "models/barnacle.mdl");
	UTIL_SetSize( pev, Vector(-16, -16, -32), Vector(16, 16, 0) );

	pev->solid			= SOLID_SLIDEBOX;
	pev->movetype		= MOVETYPE_NONE;
	pev->takedamage		= DAMAGE_AIM;
	m_bloodColor		= BLOOD_COLOR_RED;
	pev->effects		= EF_INVLIGHT; // take light from the ceiling 
	pev->health			= 25;
	m_flFieldOfView		= 0.5;// indicates the width of this monster's forward view cone ( as a dotproduct result )
	m_MonsterState		= MONSTERSTATE_NONE;
	m_flKillVictimTime	= 0;
	m_cGibs				= 0;
	m_fLiftingPrey		= FALSE;
	m_flTongueAdj		= -100;

	InitBoneControllers();

	SetActivity ( ACT_IDLE );

	SetThink(&CBarnacle :: BarnacleThink );
	SetNextThink( 0.5 );

	UTIL_SetOrigin ( this, pev->origin );
}
Пример #4
0
void CNihilanth :: Spawn( void )
{
	Precache( );
	// motor
	pev->movetype = MOVETYPE_FLY;
	pev->solid = SOLID_BBOX;

	SET_MODEL(edict(), "models/nihilanth.mdl");
	// UTIL_SetSize(pev, Vector( -300, -300, 0), Vector(300, 300, 512));
	UTIL_SetSize(pev, Vector( -32, -32, 0), Vector(32, 32, 64));
	UTIL_SetOrigin( pev, pev->origin );

	pev->flags			|= FL_MONSTER;
	pev->takedamage		= DAMAGE_AIM;
	pev->health			= gSkillData.nihilanthHealth;
	pev->view_ofs		= Vector( 0, 0, 300 );

	m_flFieldOfView = -1; // 360 degrees

	pev->sequence = 0;
	ResetSequenceInfo( );

	InitBoneControllers();

	SetThink( &CNihilanth::StartupThink );
	pev->nextthink = gpGlobals->time + 0.1;

	m_vecDesired = Vector( 1, 0, 0 );
	m_posDesired = Vector( pev->origin.x, pev->origin.y, 512 );

	m_iLevel = 1; 
	m_iTeleport = 1;

	if (m_szRechargerTarget[0] == '\0')	strcpy( m_szRechargerTarget, "n_recharger" );
	if (m_szDrawUse[0] == '\0')			strcpy( m_szDrawUse, "n_draw" );
	if (m_szTeleportUse[0] == '\0')		strcpy( m_szTeleportUse, "n_leaving" );
	if (m_szTeleportTouch[0] == '\0')	strcpy( m_szTeleportTouch, "n_teleport" );
	if (m_szDeadUse[0] == '\0')			strcpy( m_szDeadUse, "n_dead" );
	if (m_szDeadTouch[0] == '\0')		strcpy( m_szDeadTouch, "n_ending" );

	// near death
	/*
	m_iTeleport = 10;
	m_iLevel = 10;
	m_irritation = 2;
	pev->health = 100;
	*/
}
Пример #5
0
// does not call to base class spawn.
void CFlexExpresser::Spawn( void )
{
	const char *szModel = (char *)STRING( GetModelName() );
	if (!szModel || !*szModel)
	{
		Warning( "WARNING: %s at %.0f %.0f %0.f missing modelname\n", GetDebugName(), GetAbsOrigin().x, GetAbsOrigin().y, GetAbsOrigin().z );
	}
	else
	{
	    PrecacheModel( szModel );
	    SetModel( szModel );
	}
	Precache();

	if ( m_spawnflags & FCYCLER_NOTSOLID )
	{
		SetSolid( SOLID_NONE );
	}
	else
	{
		SetSolid( SOLID_BBOX );
		AddSolidFlags( FSOLID_NOT_STANDABLE );
	}
	SetMoveType( MOVETYPE_NONE );

	// funcorators are immortal
	m_takedamage		= DAMAGE_NO;
	m_iHealth			= 80000;// no cycler should die

	m_flPlaybackRate	= 1.0f;
	m_flGroundSpeed		= 0;


	SetNextThink( gpGlobals->curtime + 1.0f );

	ResetSequenceInfo( );

	InitBoneControllers();

	/*
	if (GetNumFlexControllers() < 5)
		Warning( "cycler_flex used on model %s without enough flexes.\n", szModel );
	*/

	CreateExpresser();
}
Пример #6
0
//
// ********** Scientist SPAWN **********
//
void CSittingScientist :: Spawn( )
{
	if (pev->model)
		PRECACHE_MODEL((char*)STRING(pev->model)); //LRC
	else
		PRECACHE_MODEL("models/scientist.mdl");
	if (pev->model)
		SET_MODEL(ENT(pev), STRING(pev->model)); //LRC
	else
		SET_MODEL(ENT(pev), "models/scientist.mdl");
	Precache();
	InitBoneControllers();

	UTIL_SetSize(pev, Vector(-14, -14, 0), Vector(14, 14, 36));

	pev->solid			= SOLID_SLIDEBOX;
	pev->movetype		= MOVETYPE_STEP;
	pev->effects		= 0;
	pev->health			= 50;
	
	m_bloodColor = BLOOD_COLOR_RED;
	m_flFieldOfView		= VIEW_FIELD_WIDE; // indicates the width of this monster's forward view cone ( as a dotproduct result )

	m_afCapability		= bits_CAP_HEAR | bits_CAP_TURN_HEAD;

	if (!FBitSet(pev->spawnflags, SF_SITTINGSCI_POSTDISASTER)) //LRC- allow a sitter to be postdisaster.
		SetBits(pev->spawnflags, SF_MONSTER_PREDISASTER); // predisaster only!

	if ( pev->body == -1 )
	{// -1 chooses a random head
		pev->body = RANDOM_LONG(0, NUM_SCIENTIST_HEADS-1);// pick a head, any head
	}
	// Luther is black, make his hands black
	if ( pev->body == HEAD_LUTHER )
		pev->skin = 1;
	
	m_baseSequence = LookupSequence( "sitlookleft" );
	pev->sequence = m_baseSequence + RANDOM_LONG(0,4);
	ResetSequenceInfo( );
	
	SetThink(&CSittingScientist ::SittingThink);
	SetNextThink( 0.1 );

	DROP_TO_FLOOR ( ENT(pev) );
}
Пример #7
0
void CFuncMachinegun::RealReSpawn( void )
{
	pev->armorvalue = pev->armortype;
	pev->health 	= pev->max_health;
	pev->takedamage = DAMAGE_AIM;
	pev->movetype	= MOVETYPE_FLY;
	pev->solid	= SOLID_BBOX;
	pev->angles.x	= 0;
	pev->renderfx 	= 51;
	pev->origin 	= pev->oldorigin;
	pev->effects 	= 0;
	m_iAmmo         = pev->weapons;
	UTIL_SetSize( pev, Vector(-25,-25,0), Vector(25,25,35));

	ResetSequenceInfo();
	m_fSequenceLoops = TRUE;
	InitBoneControllers();
}
void COsprey :: Spawn( void )
{
	Precache( );
	// motor
	pev->movetype = MOVETYPE_FLY;
	pev->solid = SOLID_BBOX;

	if (pev->model)
		SET_MODEL(ENT(pev), STRING(pev->model)); //LRC
	else
		SET_MODEL(ENT(pev), "models/osprey.mdl");
	UTIL_SetSize(pev, Vector( -400, -400, -100), Vector(400, 400, 32));
	UTIL_SetOrigin( this, pev->origin );

	//ALERT(at_console, "Osprey origin %f %f %f\n", pev->origin.x, pev->origin.y, pev->origin.z);

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

	pev->speed = 80; //LRC - default speed, in case path corners don't give a speed.

	m_flFieldOfView = 0; // 180 degrees

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

	InitBoneControllers();

	SetThink(&COsprey :: FindAllThink );
	SetUse(&COsprey :: CommandUse );

	if (!(pev->spawnflags & SF_WAITFORTRIGGER))
	{
		SetNextThink( 1.0 );
	}

	m_pos2 = pev->origin;
	m_ang2 = pev->angles;
	m_vel2 = pev->velocity;
}
void COsprey::Spawn(void)
{
	Precache();
	// motor
	pev->movetype = MOVETYPE_FLY;
	pev->solid = SOLID_BBOX;

	if (pev->model)
		SET_MODEL(ENT(pev), STRING(pev->model)); //SOHL: Refresh 1.0
	else
		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(&COsprey::FindAllThink);
	SetUse(&COsprey::CommandUse);

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

	m_pos2 = pev->origin;
	m_ang2 = pev->angles;
	m_vel2 = pev->velocity;
}
Пример #10
0
void CCycler::Spawn( )
{
	InitBoneControllers();
	
	SetSolid( SOLID_BBOX );
	if ( m_spawnflags & FCYCLER_NOTSOLID )
	{
		AddSolidFlags( FSOLID_NOT_SOLID );
	}
	else
	{
		AddSolidFlags( FSOLID_NOT_STANDABLE );
	}

	SetMoveType( MOVETYPE_NONE );
	m_takedamage		= DAMAGE_YES;
	m_iHealth			= 80000;// no cycler should die
	GetMotor()->SetIdealYaw( GetLocalAngles().y );
	GetMotor()->SnapYaw();
	
	m_flPlaybackRate	= 1.0;
	m_flGroundSpeed		= 0;

	SetNextThink( gpGlobals->curtime + 1.0f );

	ResetSequenceInfo( );

	if (GetSequence() != 0 || m_flCycle != 0)
	{
#ifdef TF2_DLL
		m_animate = 1;
#else
		m_animate = 0;
		m_flPlaybackRate = 0;
#endif
	}
	else
	{
		m_animate = 1;
	}
}
Пример #11
0
/* <fc2a1> ../cstrike/dlls/mpstubb.cpp:62 */
void CBaseMonster::__MAKE_VHOOK(MonsterInitDead)(void)
{
	InitBoneControllers();

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

	pev->frame = 0;
	ResetSequenceInfo();
	pev->framerate = 0;

	pev->max_health = pev->health;
	pev->deadflag = DEAD_DEAD;

	UTIL_SetSize(pev, g_vecZero, g_vecZero);
	UTIL_SetOrigin(pev, pev->origin);

	BecomeDead();
	SetThink(&CBaseEntity::SUB_Remove);
	pev->nextthink = gpGlobals->time + 0.5;
}
void CApache :: Spawn( void )
{
	Precache( );
	// motor
	pev->movetype = MOVETYPE_FLY;
	pev->solid = SOLID_BBOX;

	if (pev->model)
		SET_MODEL(ENT(pev), STRING(pev->model)); //LRC
	else
		SET_MODEL(ENT(pev), "models/apache.mdl");
	UTIL_SetSize( pev, Vector( -32, -32, -64 ), Vector( 32, 32, 0 ) );
	UTIL_SetOrigin( this, pev->origin );

	pev->flags |= FL_MONSTER;
	pev->takedamage		= DAMAGE_AIM;
	if (pev->health == 0)
		pev->health			= gSkillData.apacheHealth;

	m_flFieldOfView = -0.707; // 270 degrees

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

	InitBoneControllers();

	if (pev->spawnflags & SF_WAITFORTRIGGER)
	{
		SetUse(&CApache :: StartupUse );
	}
	else
	{
		SetThink(&CApache :: HuntThink );
		SetTouch(&CApache :: FlyTouch );
		SetNextThink( 1.0 );
	}

	m_iRockets = 10;
}
Пример #13
0
void CCycler :: Spawn( )
{
	InitBoneControllers();
	pev->solid			= SOLID_SLIDEBOX;
	
	pev->movetype		= MOVETYPE_NONE;

	pev->takedamage		= DAMAGE_YES;
	pev->effects		= 0;
	pev->health			= 80000;// no cycler should die
	pev->yaw_speed		= 5;
	pev->ideal_yaw		= pev->angles.y;
	ChangeYaw( 360 );
	
	m_flFrameRate		= 75;
	m_flGroundSpeed		= 0;

	pev->nextthink		+= 1.0;

	ResetSequenceInfo( );

	if (pev->sequence != 0 || pev->frame != 0)
	{
		m_animate = 0;
		pev->framerate = 0;
	}
	else
	{
		m_animate = 1;
	}

	if ( FClassnameIs ( pev, "cine_entity" ) )
	{
		m_bloodColor = DONT_BLEED;

		pev->origin.z += 1;
		DROP_TO_FLOOR ( ENT(pev) );
	}
}
Пример #14
0
void CApache :: Spawn( void )
{
	Precache( );
	// motor
	pev->movetype = MOVETYPE_FLYMISSILE;
	pev->solid = SOLID_BBOX;

	SET_MODEL(ENT(pev), "models/apache.mdl");
	UTIL_SetSize( pev, Vector( -32, -32, -64 ), Vector( 32, 32, 0 ) );
	UTIL_SetOrigin( pev, pev->origin );

	pev->flags |= FL_MONSTER;
	pev->takedamage		= DAMAGE_AIM;
	pev->health			= gSkillData.apacheHealth;

	m_flFieldOfView = -0.707; // 270 degrees

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

	InitBoneControllers();

	if (pev->spawnflags & SF_WAITFORTRIGGER)
	{
		SetUse( StartupUse );
	}
	else
	{
		SetThink( HuntThink );
		SetTouch( FlyTouch );
		pev->nextthink = gpGlobals->time + 1.0;
	}

	m_iRockets = 10;

	// modif de Julien
	m_bFlashLightOn = FALSE;
}
//---------------------------------------------------------
//---------------------------------------------------------
void CNPC_MissileDefense::Spawn( void )
{
	Precache();

	SetModel( "models/missile_defense.mdl" );
	UTIL_SetSize( this, Vector( -36, -36 , 0 ), Vector( 36, 36, 64 ) );

	SetSolid( SOLID_BBOX );
	SetMoveType( MOVETYPE_NONE );
	m_takedamage		= DAMAGE_YES;
	SetBloodColor( DONT_BLEED );
	m_iHealth			= 10;
	m_flFieldOfView		= 0.1;
	m_NPCState			= NPC_STATE_NONE;
	CapabilitiesClear();
	CapabilitiesAdd ( bits_CAP_INNATE_RANGE_ATTACK1 );

	// Hate missiles	
	AddClassRelationship( CLASS_MISSILE, D_HT, 5 );

	m_spawnflags |= SF_NPC_LONG_RANGE;

	m_flReloadedTime = gpGlobals->curtime;

	InitBoneControllers();

	NPCInit();

	SetBoneController( MD_BC_YAW, 10 );
	SetBoneController( MD_BC_PITCH, 0 );

	SetBodygroup( 1, 1 );
	SetBodygroup( 2, 1 );
	SetBodygroup( 3, 1 );
	SetBodygroup( 4, 1 );

	m_NPCState = NPC_STATE_IDLE;
}
Пример #16
0
// Call after animation/pose is set up
void CBaseMonster :: MonsterInitDead( void )
{
	InitBoneControllers();

	pev->solid			= SOLID_BBOX;
	pev->movetype		= MOVETYPE_TOSS;// so he'll fall to ground

	pev->frame = 0;
	ResetSequenceInfo( );
	pev->framerate = 0;
	
	// Copy health
	pev->max_health		= pev->health;
	pev->deadflag		= DEAD_DEAD;
	
	UTIL_SetSize(pev, g_vecZero, g_vecZero );
	UTIL_SetOrigin( pev, pev->origin );

	// Setup health counters, etc.
	BecomeDead();
	SetThink( &CBaseMonster::CorpseFallThink );
	pev->nextthink = gpGlobals->time + 0.5;
}
Пример #17
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;


}