本文整理汇总了C++中SetHullType函数的典型用法代码示例。如果您正苦于以下问题:C++ SetHullType函数的具体用法?C++ SetHullType怎么用?C++ SetHullType使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetHullType函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetHullType
//---------------------------------------------------------
//---------------------------------------------------------
void CZombie::SetZombieModel( void )
{
Hull_t lastHull = GetHullType();
if ( m_fIsTorso )
{
SetModel( "models/zombie/classic_torso.mdl" );
SetHullType( HULL_TINY );
}
else
{
SetModel( "models/zombie/classic.mdl" );
SetHullType( HULL_HUMAN );
}
SetBodygroup( ZOMBIE_BODYGROUP_HEADCRAB, !m_fIsHeadless );
SetHullSizeNormal( true );
SetDefaultEyeOffset();
SetActivity( ACT_IDLE );
// hull changed size, notify vphysics
// UNDONE: Solve this generally, systematically so other
// NPCs can change size
if ( lastHull != GetHullType() )
{
if ( VPhysicsGetObject() )
{
SetupVPhysicsHull();
}
}
}
示例2: Precache
//=========================================================
// Spawn
//=========================================================
void CGenericActor::Spawn()
{
Precache();
SetModel( STRING( GetModelName() ) );
/*
if ( FStrEq( STRING( GetModelName() ), "models/player.mdl" ) )
UTIL_SetSize(this, VEC_HUMAN_HULL_MIN, VEC_HUMAN_HULL_MAX);
else
UTIL_SetSize(this, VEC_HULL_MIN, VEC_HULL_MAX);
*/
if ( FStrEq( STRING( GetModelName() ), "models/player.mdl" ) ||
FStrEq( STRING( GetModelName() ), "models/holo.mdl" ) ||
FStrEq( STRING( GetModelName() ), "models/blackout.mdl" ) )
{
UTIL_SetSize(this, VEC_HULL_MIN, VEC_HULL_MAX);
}
else
{
UTIL_SetSize(this, NAI_Hull::Mins(HULL_HUMAN), NAI_Hull::Maxs(HULL_HUMAN));
}
if ( !FStrEq( STRING( GetModelName() ), "models/blackout.mdl" ) )
{
SetSolid( SOLID_BBOX );
AddSolidFlags( FSOLID_NOT_STANDABLE );
}
else
{
SetSolid( SOLID_NONE );
}
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 );
// remove head turn if no eyes or forward attachment
if (LookupAttachment( "eyes" ) > 0 && LookupAttachment( "forward" ) > 0)
{
CapabilitiesAdd( bits_CAP_TURN_HEAD | bits_CAP_ANIMATEDFACE );
}
if (m_strHullName != NULL_STRING)
{
SetHullType( NAI_Hull::LookupId( STRING( m_strHullName ) ) );
}
else
{
SetHullType( HULL_HUMAN );
}
SetHullSizeNormal( );
NPCInit();
}
示例3: SetHullType
void CASW_Parasite::Spawn( void )
{
SetHullType(HULL_TINY);
BaseClass::Spawn();
SetModel( SWARM_PARASITE_MODEL);
if (FClassnameIs(this, "asw_parasite_defanged"))
{
m_bDefanged = true;
m_iHealth = ASWGameRules()->ModifyAlienHealthBySkillLevel(10);
SetBodygroup( 0, 1 );
m_fSuicideTime = gpGlobals->curtime + 60;
}
else
{
m_bDefanged = false;
m_iHealth = ASWGameRules()->ModifyAlienHealthBySkillLevel(25);
SetBodygroup( 0, 0 );
m_fSuicideTime = 0;
}
SetMoveType( MOVETYPE_STEP );
SetHullType(HULL_TINY);
SetCollisionGroup( ASW_COLLISION_GROUP_PARASITE );
SetViewOffset( Vector(6, 0, 11) ) ; // Position of the eyes relative to NPC's origin.
m_NPCState = NPC_STATE_NONE;
CapabilitiesAdd( bits_CAP_MOVE_GROUND | bits_CAP_INNATE_RANGE_ATTACK1 );
m_bInfesting = false;
}
示例4: GetHullType
//-----------------------------------------------------------------------------
// Purpose:
//
// NOTE: This function is still heavy with common code (found at the bottom).
// we should consider moving some into the base class! (sjb)
//-----------------------------------------------------------------------------
void CNPC_Monster::SetZombieModel( void )
{
Hull_t lastHull = GetHullType();
SetModel( cModel.ToCStr() );
if (m_fIsTorso)
SetHullType(HULL_TINY);
else
SetHullType(HULL_HUMAN);
SetHullSizeNormal( true );
SetDefaultEyeOffset();
SetActivity( ACT_IDLE );
m_nSkin = m_iSkin;
if ( lastHull != GetHullType() )
{
if ( VPhysicsGetObject() )
{
SetupVPhysicsHull();
}
}
CollisionProp()->SetSurroundingBoundsType( USE_OBB_COLLISION_BOUNDS );
}
示例5: SetHullType
//-----------------------------------------------------------------------------
// Purpose:
// Input:
// Output:
//-----------------------------------------------------------------------------
void CASW_Boomer::Spawn( void )
{
SetHullType( HULL_LARGE );
BaseClass::Spawn();
SetHullType( HULL_LARGE );
SetCollisionGroup( ASW_COLLISION_GROUP_ALIEN );
SetHealthByDifficultyLevel();
CapabilitiesAdd( bits_CAP_MOVE_GROUND | bits_CAP_INNATE_MELEE_ATTACK1 | bits_CAP_INNATE_MELEE_ATTACK2 );
// "Health" "435"
// "WalkSpeed" "45"
// "RunSpeed" "254"
SetIdealState( NPC_STATE_ALERT );
m_bNeverRagdoll = true;
//softcopy:
//SetRenderColor(asw_boomer_color.GetColor().r(), asw_boomer_color.GetColor().g(), asw_boomer_color.GetColor().b()); //Ch1ckensCoop: Allow setting colors.
alienLabel = "boomer";
SetColorScale( alienLabel );
}
示例6: SetHullType
//-----------------------------------------------------------------------------
// Purpose:
// Input:
// Output:
//-----------------------------------------------------------------------------
void CASW_Ranger::Spawn( void )
{
SetHullType( HULL_MEDIUMBIG );
BaseClass::Spawn();
SetHullType( HULL_MEDIUMBIG );
SetHealthByDifficultyLevel();
SetBloodColor( BLOOD_COLOR_GREEN );
CapabilitiesAdd( bits_CAP_MOVE_GROUND | bits_CAP_INNATE_MELEE_ATTACK1 | bits_CAP_INNATE_RANGE_ATTACK1 );
SetIdealState( NPC_STATE_ALERT );
m_bNeverRagdoll = true;
//
// Firing patterns
//
// 3 shots
CASW_AlienVolley volley;
volley.m_rounds.SetCount( 3 );
volley.m_rounds[0].m_flTime = 0;
volley.m_rounds[0].m_nShot_type = GetShotIndex( "shot1" );
volley.m_rounds[0].m_flStartAngle = 0;
volley.m_rounds[0].m_flEndAngle = 0;
volley.m_rounds[0].m_nNumShots = 1;
volley.m_rounds[0].m_flShotDelay = 0;
volley.m_rounds[0].m_flSpeed = 425;
volley.m_rounds[0].m_flHorizontalOffset = 0;
volley.m_rounds[1].m_flTime = 0.1;
volley.m_rounds[1].m_nShot_type = GetShotIndex( "shot1" );
volley.m_rounds[1].m_flStartAngle = -4;
volley.m_rounds[1].m_flEndAngle = 0;
volley.m_rounds[1].m_nNumShots = 1;
volley.m_rounds[1].m_flShotDelay = 0;
volley.m_rounds[1].m_flSpeed = 425;
volley.m_rounds[1].m_flHorizontalOffset = 0;
volley.m_rounds[2].m_flTime = 0.2;
volley.m_rounds[2].m_nShot_type = GetShotIndex( "shot1" );
volley.m_rounds[2].m_flStartAngle = 4;
volley.m_rounds[2].m_flEndAngle = 0;
volley.m_rounds[2].m_nNumShots = 1;
volley.m_rounds[2].m_flShotDelay = 0;
volley.m_rounds[2].m_flSpeed = 425;
volley.m_rounds[2].m_flHorizontalOffset = 0;
CreateVolley( "volley1", &volley );
}
示例7: Precache
//-----------------------------------------------------------------------------
// 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();
}
示例8: Precache
//=========================================================
// 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();
}
示例9: Precache
//-----------------------------------------------------------------------------
// Purpose:
// Input :
// Output :
//-----------------------------------------------------------------------------
void CNPC_Headcrab::Spawn( void )
{
Precache();
SetRenderColor( 255, 255, 255, 255 );
SetModel( "models/headcrab.mdl" );
m_iHealth = sk_headcrab_health.GetFloat();
SetHullType(HULL_TINY);
SetHullSizeNormal();
SetSolid( SOLID_BBOX );
AddSolidFlags( FSOLID_NOT_STANDABLE );
SetMoveType( MOVETYPE_STEP );
SetViewOffset( Vector(6, 0, 11) ); // Position of the eyes relative to NPC's origin.
m_bloodColor = BLOOD_COLOR_GREEN;
m_flFieldOfView = 0.5;
m_NPCState = NPC_STATE_NONE;
m_nGibCount = HEADCRAB_ALL_GIB_COUNT;
CapabilitiesClear();
CapabilitiesAdd( bits_CAP_MOVE_GROUND | bits_CAP_INNATE_RANGE_ATTACK1 );
NPCInit();
}
示例10: SetModel
//---------------------------------------------------------
//---------------------------------------------------------
void CRebelZombie::SetZombieModel( void )
{
//if ( m_iZombieSex == 1 ) // Male
//{
SetModel( "models/zombie/classic.mdl" );
/*}
else // Female
{
SetModel( "models/zombie/classic_female.mdl" );
}*/
SetHullType( HULL_HUMAN );
m_nSkin = m_iRebelZombieSkin;
SetBodygroup( ZOMBIE_BODYGROUP_HEADCRAB, !m_fIsHeadless );
SetHullSizeNormal( true );
SetDefaultEyeOffset();
SetActivity( ACT_IDLE );
// hull changed size, notify vphysics
// UNDONE: Solve this generally, systematically so other
// NPCs can change size
if ( VPhysicsGetObject() )
{
SetupVPhysicsHull();
}
}
示例11: Precache
//=========================================================
// 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;
m_pEnergyWave = NULL;
m_flEndEnergyWaveTime = 0;
SetCollisionGroup( HL2COLLISION_GROUP_HOUNDEYE );
NPCInit();
}
示例12: GetHullType
void CZombie::SetZombieModel( void )
{
Hull_t lastHull = GetHullType();
if(m_iZombieType == ZOMBIE_BISOU)
SetModel( "models/zombie/Bisounours.mdl" );
else
SetModel( "models/zombie/classic.mdl" );
SetHullType( HULL_HUMAN );
//Commenté en attendant de trouver à quoi ça sert
//SetBodygroup( ZOMBIE_BODYGROUP_HEADCRAB, !m_fIsHeadless );
SetHullSizeNormal( true );
SetDefaultEyeOffset();
SetActivity( ACT_IDLE );
// hull changed size, notify vphysics
// UNDONE: Solve this generally, systematically so other
// NPCs can change size
if ( lastHull != GetHullType() )
if ( VPhysicsGetObject() )
SetupVPhysicsHull();
}
示例13: Precache
//-----------------------------------------------------------------------------
// 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();
}
示例14: Spawn
//-----------------------------------------------------------------------------
// Spawn
//-----------------------------------------------------------------------------
void CNPC_Eli :: Spawn()
{
Precache();
BaseClass::Spawn();
SetModel( "models/eli.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();
}
示例15: Precache
//=========================================================
// 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;
}