Esempio n. 1
0
void CWeapon::UpdateCL		()
{
	inherited::UpdateCL		();
	UpdateHUDAddonsVisibility();
	//подсветка от выстрела
	UpdateLight				();

	//нарисовать партиклы
	UpdateFlameParticles	();
	UpdateFlameParticles2	();

	if(!IsGameTypeSingle())
		make_Interpolation		();
	
	if( (GetNextState()==GetState()) && IsGameTypeSingle() && H_Parent()==Level().CurrentEntity())
	{
		CActor* pActor	= smart_cast<CActor*>(H_Parent());
		if(pActor && !pActor->AnyMove() && this==pActor->inventory().ActiveItem())
		{
			if (hud_adj_mode==0 && 
				GetState()==eIdle && 
				(Device.dwTimeGlobal-m_dw_curr_substate_time>20000) && 
				!IsZoomed()&&
				g_player_hud->attached_item(1)==NULL)
			{
				if(AllowBore())
					SwitchState		(eBore);

				ResetSubStateTime	();
			}
		}
	}

	if(m_zoom_params.m_pNight_vision && !need_renderable())
	{
		if(!m_zoom_params.m_pNight_vision->IsActive())
		{
			CActor *pA = smart_cast<CActor *>(H_Parent());
			R_ASSERT(pA);
			CTorch* pTorch = smart_cast<CTorch*>( pA->inventory().ItemFromSlot(TORCH_SLOT) );
			if ( pTorch && pTorch->GetNightVisionStatus() )
			{
				m_bRememberActorNVisnStatus = pTorch->GetNightVisionStatus();
				pTorch->SwitchNightVision(false, false);
			}
			m_zoom_params.m_pNight_vision->Start(m_zoom_params.m_sUseZoomPostprocess, pA, false);
		}

	}
	else if(m_bRememberActorNVisnStatus)
	{
		m_bRememberActorNVisnStatus = false;
		EnableActorNVisnAfterZoom();
	}

	if(m_zoom_params.m_pVision)
		m_zoom_params.m_pVision->Update();
}
Esempio n. 2
0
void CWeaponMagazinedWGrenade::PlayAnimIdle()
{
	if(IsGrenadeLauncherAttached())
	{
		if(IsZoomed())
		{
			if(m_bGrenadeMode)
				PlayHUDMotion("anm_idle_g_aim", FALSE, NULL, GetState());
			else
				PlayHUDMotion("anm_idle_w_gl_aim", TRUE, NULL, GetState());
		}else
		{
			int act_state = 0;
			CActor* pActor = smart_cast<CActor*>(H_Parent());
			if(pActor)
			{
				CEntity::SEntityState st;
				pActor->g_State(st);
				if(st.bSprint)
				{
					act_state = 1;
					PlayHUDMotion("anm_idle_sprint", TRUE, NULL,GetState());
				}else
				if(pActor->AnyMove())
				{
					act_state = 2;
					PlayHUDMotion("anm_idle_moving", TRUE, NULL, GetState());
				}
			}

			if(m_bGrenadeMode)
			{
				if(act_state==0)
					PlayHUDMotion("anm_idle_g", FALSE, NULL, GetState());
				else
				if(act_state==1)
					PlayHUDMotion("anm_idle_sprint_g", TRUE, NULL,GetState());
				else
				if(act_state==2)
					PlayHUDMotion("anm_idle_moving_g", TRUE, NULL,GetState());

			}else
			{
				if(act_state==0)
					PlayHUDMotion("anm_idle_w_gl", FALSE, NULL, GetState());
				else
				if(act_state==1)
					PlayHUDMotion("anm_idle_sprint_w_gl", TRUE, NULL,GetState());
				else
				if(act_state==2)
					PlayHUDMotion("anm_idle_moving_w_gl", TRUE, NULL,GetState());
			}
		
		}
	}
	else
		inherited::PlayAnimIdle();
}