//----------------------------------------------------------------------------- // Purpose: // Input : time - //----------------------------------------------------------------------------- void CFire::Extinguish( float heat ) { if ( !m_bEnabled ) return; m_lastDamage = gpGlobals->curtime + 0.5; bool out = m_flHeatLevel > 0 ? true : false; m_flHeatLevel -= heat; m_flHeatAbsorb += fire_extabsorb.GetFloat() * heat; if ( m_flHeatAbsorb > fire_maxabsorb.GetFloat() ) { m_flHeatAbsorb = fire_maxabsorb.GetFloat(); } // drift toward the average attack time after being sprayed // some fires are heavily scripted so their attack looks weird // once interacted with. Basically, this blends out the scripting // as the fire is sprayed with the extinguisher. float averageAttackTime = m_flMaxHeat * (FIRE_NORMAL_ATTACK_TIME/FIRE_MAX_HEAT_LEVEL); m_flAttackTime = Approach( averageAttackTime, m_flAttackTime, 2 * gpGlobals->frametime ); if ( m_flHeatLevel <= 0 ) { m_flHeatLevel = 0; if ( out ) { GoOut(); } } }
int CQuiz::TeleportToQuizEvent( CUser* pUser, int nZone ) { if( !IsValidObj( pUser ) ) return TID_GAME_QUIZ_DO_NOT_TELEPORT; if( ZONE_1 <= nZone && nZone <= ZONE_4 ) { if( GetState() == QE_DROP_OUT || GetZoneType( (CMover*)pUser ) == ZONE_WATCHING ) return TID_GAME_QUIZ_DO_NOT_TELEPORT; } if( nZone == ZONE_QUIZ ) { if( GetState() != QE_OPEN && GetState() != QE_WATCHINGZONE_OPEN ) return TID_GAME_QUIZ_DO_NOT_TELEPORT; } if( nZone == ZONE_EXIT ) { GoOut( pUser ); return 0; } D3DXVECTOR3 vPos = GetTeleportPos( nZone ); if( vPos == D3DXVECTOR3( 0, 0, 0 ) ) return TID_GAME_QUIZ_DO_NOT_TELEPORT; int nRandx = xRandom(4) - 2; int nRandz = xRandom(4) - 2; vPos += D3DXVECTOR3( (float)( nRandx ), (float)( 0 ), (float)( nRandz ) ); pUser->REPLACE( g_uIdofMulti, WI_WORLD_QUIZ, vPos, REPLACE_NORMAL, nDefaultLayer ); return 0; }
void CFire::Disable() { m_bEnabled = false; if ( IsBurning() ) { GoOut(); } }
void People::GoInto(int64 SourceID,ROOM_SPACE& Room){ //先离开之前所在的空间,然后ROBOT设置新的地址 GoOut(); //如果没有注册 则注册为子空间,robot权利不变 int64 RoomID = Room.GetSpaceID(); SetID(RoomID); //ParentID int64& ChilID = *(int64*)GetData(0); ChilID = SourceID; SetSpaceType(ROBOT_VISITER); UpdateAll(TRUE); }
void CQuiz::CloseQuizEvent() { SetRun( FALSE ); SetNextTime( 0 ); SetState( QE_CLOSE ); m_bSelectLog = FALSE; m_nQuizCount = 0; Clear(); RemoveNPC(); g_dpDBClient.SendQuizEventState( QE_CLOSE, g_uIdofMulti, 0, m_nQuizCount ); CWorld* pWorld = g_WorldMng.GetWorld( WI_WORLD_QUIZ ); if( pWorld ) { for( DWORD i = 0; i < pWorld->m_dwObjNum; ++i ) { if( IsInQuizEventPlayer( pWorld, nDefaultLayer, i ) ) GoOut( static_cast<CUser*>( pWorld->m_apObject[i] ) ); } } }
void CFire::GoOutThink() { GoOut(); }
People::~People(){ if(m_AutoLeave){ GoOut(); } };