本文整理汇总了C++中IsOnFire函数的典型用法代码示例。如果您正苦于以下问题:C++ IsOnFire函数的具体用法?C++ IsOnFire怎么用?C++ IsOnFire使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsOnFire函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetChunkX
void cMonster::HandleDaylightBurning(cChunk & a_Chunk)
{
if (!m_BurnsInDaylight)
{
return;
}
int RelY = (int)floor(GetPosY());
if ((RelY < 0) || (RelY >= cChunkDef::Height))
{
// Outside the world
return;
}
int RelX = (int)floor(GetPosX()) - GetChunkX() * cChunkDef::Width;
int RelZ = (int)floor(GetPosZ()) - GetChunkZ() * cChunkDef::Width;
if (
(a_Chunk.GetSkyLight(RelX, RelY, RelZ) == 15) && // In the daylight
(a_Chunk.GetBlock(RelX, RelY, RelZ) != E_BLOCK_SOULSAND) && // Not on soulsand
(GetWorld()->GetTimeOfDay() < (12000 + 1000)) && // It is nighttime
!IsOnFire() // Not already burning
)
{
// Burn for 100 ticks, then decide again
StartBurning(100);
}
}
示例2: GatherGrenadeConditions
void CNPC_Zombine::GatherGrenadeConditions( void )
{
if ( m_iGrenadeCount <= 0 )
return;
if ( g_flZombineGrenadeTimes > gpGlobals->curtime )
return;
if ( m_flGrenadePullTime > gpGlobals->curtime )
return;
if ( m_flSuperFastAttackTime >= gpGlobals->curtime )
return;
if ( HasGrenade() )
return;
if ( GetEnemy() == NULL )
return;
if ( FVisible( GetEnemy() ) == false )
return;
if ( IsSprinting() )
return;
if ( IsOnFire() )
return;
if ( IsRunningDynamicInteraction() == true )
return;
if ( m_ActBusyBehavior.IsActive() )
return;
CBasePlayer *pPlayer = AI_GetSinglePlayer();
if ( pPlayer && pPlayer->FVisible( this ) )
{
float flLengthToPlayer = (pPlayer->GetAbsOrigin() - GetAbsOrigin()).Length();
float flLengthToEnemy = flLengthToPlayer;
if ( pPlayer != GetEnemy() )
{
flLengthToEnemy = ( GetEnemy()->GetAbsOrigin() - GetAbsOrigin()).Length();
}
if ( flLengthToPlayer <= GRENADE_PULL_MAX_DISTANCE && flLengthToEnemy <= GRENADE_PULL_MAX_DISTANCE )
{
float flPullChance = 1.0f - ( flLengthToEnemy / GRENADE_PULL_MAX_DISTANCE );
m_flGrenadePullTime = gpGlobals->curtime + 0.5f;
if ( flPullChance >= random->RandomFloat( 0.0f, 1.0f ) )
{
g_flZombineGrenadeTimes = gpGlobals->curtime + 10.0f;
SetCondition( COND_ZOMBINE_GRENADE );
}
}
}
}
示例3: DeathSound
//=========================================================
// DeathSound
//=========================================================
void CNPC_Houndeye::DeathSound(void)
{
if (IsOnFire())
return;
EmitSound( "NPC_Houndeye.Die" );
}
示例4: PainSound
//=========================================================
// PainSound
//=========================================================
void CNPC_Houndeye::PainSound(void)
{
if (IsOnFire())
return;
EmitSound( "NPC_Houndeye.Pain" );
}
示例5: MoanSound
//---------------------------------------------------------
// Classic zombie only uses moan sound if on fire.
//---------------------------------------------------------
void CRebelZombie::MoanSound( envelopePoint_t *pEnvelope, int iEnvelopeSize )
{
if( IsOnFire() )
{
BaseClass::MoanSound( pEnvelope, iEnvelopeSize );
}
}
示例6: GetChunkZ
void cMonster::HandleDaylightBurning(cChunk & a_Chunk, bool WouldBurn)
{
if (!m_BurnsInDaylight)
{
return;
}
int RelY = POSY_TOINT;
if ((RelY < 0) || (RelY >= cChunkDef::Height))
{
// Outside the world
return;
}
if (!a_Chunk.IsLightValid())
{
m_World->QueueLightChunk(GetChunkX(), GetChunkZ());
return;
}
if (!IsOnFire() && WouldBurn)
{
// Burn for 100 ticks, then decide again
StartBurning(100);
}
}
示例7: PainSound
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void CNPC_Monk::PainSound( const CTakeDamageInfo &info )
{
if (IsOnFire())
return;
SpeakIfAllowed( TLK_WOUND );
}
示例8: GetChunkX
void cMonster::HandleDaylightBurning(cChunk & a_Chunk)
{
if (!m_BurnsInDaylight)
{
return;
}
int RelY = POSY_TOINT;
if ((RelY < 0) || (RelY >= cChunkDef::Height))
{
// Outside the world
return;
}
int RelX = POSX_TOINT - GetChunkX() * cChunkDef::Width;
int RelZ = POSZ_TOINT - GetChunkZ() * cChunkDef::Width;
if (!a_Chunk.IsLightValid())
{
m_World->QueueLightChunk(GetChunkX(), GetChunkZ());
return;
}
if (
(a_Chunk.GetSkyLight(RelX, RelY, RelZ) == 15) && // In the daylight
(a_Chunk.GetBlock(RelX, RelY, RelZ) != E_BLOCK_SOULSAND) && // Not on soulsand
(GetWorld()->GetTimeOfDay() < (12000 + 1000)) && // It is nighttime
!IsOnFire() && // Not already burning
(GetWorld()->GetWeather() != eWeather_Rain) // Not raining
)
{
// Burn for 100 ticks, then decide again
StartBurning(100);
}
}
示例9: switch
void CNPC_Zombine::RunTask( const Task_t *pTask )
{
switch ( pTask->iTask )
{
case TASK_WAIT_FOR_MOVEMENT_STEP:
case TASK_WAIT_FOR_MOVEMENT:
{
BaseClass::RunTask( pTask );
if ( IsOnFire() && IsSprinting() )
{
StopSprint();
}
//Only do this if I have an enemy
if ( GetEnemy() )
{
if ( AllowedToSprint() == true )
{
Sprint( ( GetHealth() <= GetMaxHealth() * 0.5f ) );
return;
}
if ( HasGrenade() )
{
if ( IsSprinting() )
{
GetNavigator()->SetMovementActivity( (Activity)ACT_ZOMBINE_GRENADE_RUN );
}
else
{
GetNavigator()->SetMovementActivity( (Activity)ACT_ZOMBINE_GRENADE_WALK );
}
return;
}
if ( GetNavigator()->GetMovementActivity() != ACT_WALK )
{
if ( IsSprinting() == false )
{
GetNavigator()->SetMovementActivity( ACT_WALK );
}
}
}
else
{
GetNavigator()->SetMovementActivity( ACT_WALK );
}
break;
}
default:
{
BaseClass::RunTask( pTask );
break;
}
}
}
示例10: DeathSound
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void CNPC_Fisherman::DeathSound( const CTakeDamageInfo &info )
{
if (IsOnFire())
return;
// Sentences don't play on dead NPCs
SentenceStop();
}
示例11: AllowedToSprint
bool CNPC_Zombine::AllowedToSprint( void )
{
if ( IsOnFire() )
return false;
//If you're sprinting then there's no reason to sprint again.
if ( IsSprinting() )
return false;
int iChance = SPRINT_CHANCE_VALUE;
//Secobmod FixMe ?? also changed to HL2MPRules
CHL2_Player *pPlayer = dynamic_cast <CHL2_Player*> ( UTIL_GetNearestPlayer(GetAbsOrigin() ));
//CHL2MP_Player *pPlayer = dynamic_cast<CHL2MP_Player *>( UTIL_GetNearestPlayer(GetAbsOrigin() );
if ( pPlayer )
{
#ifdef MFS
if ( HL2MPRules()->IsAlyxInDarknessMode() && pPlayer->FlashlightIsOn() == false )
#else
if (IsAlyxInDarknessMode() && pPlayer->FlashlightIsOn() == false)
#endif
{
iChance = SPRINT_CHANCE_VALUE_DARKNESS;
}
//Bigger chance of this happening if the player is not looking at the zombie
if ( pPlayer->FInViewCone( this ) == false )
{
iChance *= 2;
}
}
if ( HasGrenade() )
{
iChance *= 4;
}
//Below 25% health they'll always sprint
if ( ( GetHealth() > GetMaxHealth() * 0.5f ) )
{
if ( IsStrategySlotRangeOccupied( SQUAD_SLOT_ZOMBINE_SPRINT1, SQUAD_SLOT_ZOMBINE_SPRINT2 ) == true )
return false;
if ( random->RandomInt( 0, 100 ) > iChance )
return false;
if ( m_flSprintRestTime > gpGlobals->curtime )
return false;
}
float flLength = ( GetEnemy()->WorldSpaceCenter() - WorldSpaceCenter() ).Length();
if ( flLength > MAX_SPRINT_DISTANCE )
return false;
return true;
}
示例12: info
bool CASW_Parasite::CheckInfestTarget( CBaseEntity *pOther )
{
if (m_flDamageImmuneUntil >= gpGlobals->curtime)
{
// no fair infesting while we're invulnerable.
return false;
}
CASW_Marine* pMarine = CASW_Marine::AsMarine( pOther );
if ( pMarine )
{
// if marine has electrified armour on, that protects him from infestation
if ( pMarine->IsElectrifiedArmorActive() )
{
CTakeDamageInfo info( NULL, NULL, Vector(0,0,0), GetAbsOrigin(), GetHealth() * 2, DMG_SHOCK );
TakeDamage(info);
return false;
}
if ( pMarine->m_takedamage == DAMAGE_NO )
{
// We're in the death cam... no fair infesting there
return false;
}
if ( IsOnFire() )
{
// don't actually infest if we're on fire, since we'll die very shortly
return false;
}
if ( pMarine->m_iJumpJetting.Get() != 0 )
{
// marine is in the middle of a jump jet or blink, don't infest him
return false;
}
return true;
}
else if ( pOther->Classify() == CLASS_ASW_COLONIST )
{
return !IsOnFire();
}
return false;
}
示例13: AddRandomDropItem
void cCow::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
unsigned int LootingLevel = 0;
if (a_Killer != nullptr)
{
LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
}
AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_LEATHER);
AddRandomDropItem(a_Drops, 1, 3 + LootingLevel, IsOnFire() ? E_ITEM_STEAK : E_ITEM_RAW_BEEF);
}
示例14: AddRandomDropItem
void cChicken::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
int LootingLevel = 0;
if (a_Killer != nullptr)
{
LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
}
AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_FEATHER);
AddRandomDropItem(a_Drops, 1, 1, IsOnFire() ? E_ITEM_COOKED_CHICKEN : E_ITEM_RAW_CHICKEN);
}
示例15: DeathSound
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void CNPC_Monk::DeathSound( const CTakeDamageInfo &info )
{
if (IsOnFire())
return;
// Sentences don't play on dead NPCs
SentenceStop();
Speak( TLK_DEATH );
}