Exemplo n.º 1
0
void CObjectActionFireNoReload::execute	()
{
	inherited::execute					();

	VERIFY						(m_item);
	VERIFY						(object().inventory().ActiveItem());
	VERIFY						(object().inventory().ActiveItem()->object().ID() == m_item->object().ID());

	if (m_fired) {
		if (!m_object->can_kill_member())
			return;

		object().inventory().Action	(kWPN_FIRE,	CMD_STOP);
//		m_fired					= false;
		return;
	}

	if (m_object->can_kill_member())
		return;

	CWeapon						*weapon = smart_cast<CWeapon*>(object().inventory().ActiveItem());
	if (!weapon || (weapon->GetState() != CWeapon::eFire))
		object().inventory().Action	(kWPN_FIRE,	CMD_START);

	if (weapon && (weapon->GetState() == CWeapon::eFire))
		m_fired					= true;
}
Exemplo n.º 2
0
bool  CCustomDetector::CheckCompatibilityInt(CHudItem* itm)
{
	if(itm==NULL)
		return true;

	CInventoryItem iitm				= itm->item();
	u32 slot						= iitm.GetSlot();
	bool bres = (slot==PISTOL_SLOT || slot==KNIFE_SLOT || slot==BOLT_SLOT);

	if(itm->GetState()!=CHUDState::eShowing)
		bres = bres && !itm->IsPending();

	if(bres)
	{
		CWeapon* W = smart_cast<CWeapon*>(itm);
		if(W)
			bres = bres && (W->GetState() != CHUDState::eBore) && (W->GetState() != CWeapon::eReload) &&
			(W->GetState() != CWeapon::eSwitch) && !W->IsZoomed();//+
	}
	return bres;
}
Exemplo n.º 3
0
void CCustomDetector::UpdateVisibility()
{


	//check visibility
	attachable_hud_item* i0		= g_player_hud->attached_item(0);
	if(i0 && HudItemData())
	{
		CWeapon* wpn			= smart_cast<CWeapon*>(i0->m_parent_hud_item);
		if(wpn)
		{
			u32 state			= wpn->GetState();
			bool bClimb			= ( (Actor()->MovingState()&mcClimb) != 0 );
			if(bClimb || wpn->IsZoomed() || state==CWeapon::eReload || state==CWeapon::eSwitch)
			{
				HideDetector		(true);
				m_bNeedActivation	= true;
			}
		}
	}else
	if(m_bNeedActivation)
	{
		attachable_hud_item* i0		= g_player_hud->attached_item(0);
		bool bClimb					= ( (Actor()->MovingState()&mcClimb) != 0 );
		if(!bClimb)
		{
			CWeapon* wpn			= (i0)?smart_cast<CWeapon*>(i0->m_parent_hud_item) : NULL;
			if(	!wpn || 
				(	!wpn->IsZoomed() && 
					wpn->GetState()!=CWeapon::eReload && 
					wpn->GetState()!=CWeapon::eSwitch
				)
			)
			{
				ShowDetector		(true);
			}
		}
	}
}
Exemplo n.º 4
0
void CObjectActionFire::execute			()
{
	inherited::execute					();

	VERIFY						(m_item);
	VERIFY						(object().inventory().ActiveItem());
	VERIFY						(object().inventory().ActiveItem()->object().ID() == m_item->object().ID());

	if (!m_object->can_kill_member()) {
		CWeapon					*weapon = smart_cast<CWeapon*>(object().inventory().ActiveItem());
		if (!weapon || (weapon->GetState() != CWeapon::eFire))
			object().inventory().Action	(kWPN_FIRE,	CMD_START);
	}
	else
		object().inventory().Action	(kWPN_FIRE,	CMD_STOP);
}
Exemplo n.º 5
0
void CObjectActionFireNoReload::initialize		()
{
	inherited::inherited::initialize	();

	VERIFY						(m_item);
	VERIFY						(object().inventory().ActiveItem());
	VERIFY						(object().inventory().ActiveItem()->object().ID() == m_item->object().ID());

	if (!m_object->can_kill_member())
		object().inventory().Action	(kWPN_FIRE,	CMD_START);
	else
		object().inventory().Action	(kWPN_FIRE,	CMD_STOP);

	CWeapon						*weapon = smart_cast<CWeapon*>(object().inventory().ActiveItem());
	if (weapon && (weapon->GetState() == CWeapon::eFire))
		m_fired					= true;
	else
		m_fired					= false;
}
Exemplo n.º 6
0
void COMMAND_EnterPassenger ( const char* szCmdLine )
{
    // HACK: we don't want them to enter a vehicle if they're in cursor mode
    if ( g_pClientGame && !g_pCore->IsCursorForcedVisible() )
    {
        // Disable passenger entry while reloading so it doesen't abort the animation
        CClientPlayer* pPlayer = g_pClientGame->GetPlayerManager ()->GetLocalPlayer ();
        if ( pPlayer )
        {
            CWeapon* pWeapon = pPlayer->GetWeapon ();
            if ( pWeapon )
            {
                if ( pWeapon->GetState() != WEAPONSTATE_RELOADING )
                {
                    g_pClientGame->ProcessVehicleInOutKey ( true );
                }
            }
        }
    }
}
Exemplo n.º 7
0
void DumpPlayer ( CClientPlayer* pPlayer, CFile *file )
{
    unsigned int uiIndex = 0;

    // Player
    file->Printf( "%s\n", "*** START OF PLAYER ***" );

    // Write the data
    file->Printf( "Nick: %s\n", pPlayer->GetNick () );
    
    CVector vecTemp;
    pPlayer->GetPosition ( vecTemp );
    file->Printf( "Position: %f %f %f\n", vecTemp.fX, vecTemp.fY, vecTemp.fZ );

    file->Printf( "Nametag text: %s\n", pPlayer->GetNametagText () );

    unsigned char ucR, ucG, ucB;
    pPlayer->GetNametagColor ( ucR, ucG, ucB );
    file->Printf( "Nametag color: %u %u %u\n", ucR, ucG, ucB );

    file->Printf( "Nametag show: %u\n", pPlayer->IsNametagShowing () );

    file->Printf( "Local player: %u\n", pPlayer->IsLocalPlayer () );
    file->Printf( "Dead: %u\n", pPlayer->IsDead () );

    file->Printf( "Exp aim: %u\n", pPlayer->IsExtrapolatingAim () );
    file->Printf( "Latency: %u\n", pPlayer->GetLatency () );

    file->Printf( "Last psync time: %u\n", pPlayer->GetLastPuresyncTime () );
    file->Printf( "Has con trouble: %u\n\n", pPlayer->HasConnectionTrouble () );

    CClientTeam* pTeam = pPlayer->GetTeam ();
    if ( pTeam )
        file->Printf( "Team: %s\n", pTeam->GetTeamName () );

    // Get the matrix
    RwMatrix matPlayer;
    pPlayer->GetMatrix ( matPlayer );

    file->Printf( "Matrix: vecRoll: %f %f %f\n", matPlayer.vRight.fX, matPlayer.vRight.fY, matPlayer.vRight.fZ );
    file->Printf( "        vecDir:  %f %f %f\n", matPlayer.vFront.fX, matPlayer.vFront.fY, matPlayer.vFront.fZ );
    file->Printf( "        vecWas:  %f %f %f\n", matPlayer.vUp.fX, matPlayer.vUp.fY, matPlayer.vUp.fZ );
    file->Printf( "        vecPos:  %f %f %f\n\n", matPlayer.vPos.fX, matPlayer.vPos.fY, matPlayer.vPos.fZ );

    file->Printf( "Euler rot: %f\n", pPlayer->GetCurrentRotation () );
    file->Printf( "Cam rot: %f\n", pPlayer->GetCameraRotation () );

    pPlayer->GetMoveSpeed ( vecTemp );
    file->Printf( "Move speed: %f %f %f\n", vecTemp.fX, vecTemp.fY, vecTemp.fZ );

    pPlayer->GetTurnSpeed ( vecTemp );
    file->Printf( "Turn speed: %f %f %f\n", vecTemp.fX, vecTemp.fY, vecTemp.fZ );

    CControllerState State;
    pPlayer->GetControllerState ( State );

    signed short* pController = reinterpret_cast < signed short* > ( &State );
    file->Printf( "CContr state: \n" );
    for ( uiIndex = 0; uiIndex < 36; uiIndex++ )
    {
        file->Printf( "State [%u] = %i\n", uiIndex, pController [uiIndex] );
    }

    pPlayer->GetLastControllerState ( State );

    pController = reinterpret_cast < signed short* > ( &State );
    file->Printf( "LContr state: \n" );
    for ( uiIndex = 0; uiIndex < 36; uiIndex++ )
    {
        file->Printf( "State [%u] = %i\n", uiIndex, pController [uiIndex] );
    }

    file->Printf( "\nVeh IO state: %i\n", pPlayer->GetVehicleInOutState () );
    file->Printf( "Visible: %u\n", pPlayer->IsVisible () );
    file->Printf( "Health: %f\n", pPlayer->GetHealth () );
    file->Printf( "Armor: %f\n", pPlayer->GetArmor () );
    file->Printf( "On screen: %u\n", pPlayer->IsOnScreen () );
    file->Printf( "Frozen: %u\n", pPlayer->IsFrozen () );
    file->Printf( "Respawn state: %i\n", pPlayer->GetRespawnState () );

    file->Printf( "Cur weapon slot: %i\n", static_cast < int > ( pPlayer->GetCurrentWeaponSlot () ) );
    file->Printf( "Cur weapon type: %i\n", static_cast < int > ( pPlayer->GetCurrentWeaponType () ) );

    CWeapon* pWeapon = pPlayer->GetWeapon ();
    if ( pWeapon )
    {
        file->Printf( "Cur weapon state: %i\n", static_cast < int > ( pWeapon->GetState () ) );
        file->Printf( "Cur weapon ammo clip: %u\n", pWeapon->GetAmmoInClip () );
        file->Printf( "Cur weapon ammo total: %u\n", pWeapon->GetAmmoTotal () );
    }

    CTaskManager* pTaskMgr = pPlayer->GetTaskManager ();
    if ( pTaskMgr )
    {
        // Primary task
        CTask* pTask = pTaskMgr->GetTask ( TASK_PRIORITY_PRIMARY );
        if ( pTask )
        {
            file->Printf( "Primary task name: %s\n", pTask->GetTaskName () );
            file->Printf( "Primary task type: %i\n", pTask->GetTaskType () );
        }
        else
            file->Printf( "Primary task: none\n" );

        // Physical response task
        pTask = pTaskMgr->GetTask ( TASK_PRIORITY_PHYSICAL_RESPONSE );
        if ( pTask )
        {
            file->Printf( "Physical response task name: %s\n", pTask->GetTaskName () );
            file->Printf( "Physical response task type: %i\n", pTask->GetTaskType () );
        }
        else
            file->Printf( "Physical response task: none\n" );

        // Event response task temp
        pTask = pTaskMgr->GetTask ( TASK_PRIORITY_EVENT_RESPONSE_TEMP );
        if ( pTask )
        {
            file->Printf( "Event rsp tmp task name: %s\n", pTask->GetTaskName () );
            file->Printf( "Event rsp tmp task type: %i\n", pTask->GetTaskType () );
        }
        else
            file->Printf( "Event rsp tmp task: none\n" );

        // Event response task nontemp
        pTask = pTaskMgr->GetTask ( TASK_PRIORITY_EVENT_RESPONSE_NONTEMP );
        if ( pTask )
        {
            file->Printf( "Event rsp nontmp task name: %s\n", pTask->GetTaskName () );
            file->Printf( "Event rsp nontmp task type: %i\n", pTask->GetTaskType () );
        }
        else
            file->Printf( "Event rsp nontmp task: none\n" );

        // Event response task nontemp
        pTask = pTaskMgr->GetTask ( TASK_PRIORITY_DEFAULT );
        if ( pTask )
        {
            file->Printf( "Default task name: %s\n", pTask->GetTaskName () );
            file->Printf( "Default task type: %i\n", pTask->GetTaskType () );
        }
        else
            file->Printf( "Default task: none\n" );

        // Secondary attack
        pTask = pTaskMgr->GetTaskSecondary ( TASK_SECONDARY_ATTACK );
        if ( pTask )
        {
            file->Printf( "Secondary attack task name: %s\n", pTask->GetTaskName () );
            file->Printf( "Secondary attack task type: %i\n", pTask->GetTaskType () );
        }
        else
            file->Printf( "Secondary attack task task: none\n" );

        // Secondary duck
        pTask = pTaskMgr->GetTaskSecondary ( TASK_SECONDARY_DUCK );
        if ( pTask )
        {
            file->Printf( "Secondary duck task name: %s\n", pTask->GetTaskName () );
            file->Printf( "Secondary duck task type: %i\n", pTask->GetTaskType () );
        }
        else
            file->Printf( "Secondary duck task task: none\n" );

        // Secondary say
        pTask = pTaskMgr->GetTaskSecondary ( TASK_SECONDARY_SAY );
        if ( pTask )
        {
            file->Printf( "Secondary say task name: %s\n", pTask->GetTaskName () );
            file->Printf( "Secondary say task type: %i\n", pTask->GetTaskType () );
        }
        else
            file->Printf( "Secondary say task task: none\n" );

        // Secondary facial complex
        pTask = pTaskMgr->GetTaskSecondary ( TASK_SECONDARY_FACIAL_COMPLEX );
        if ( pTask )
        {
            file->Printf( "Secondary facial task name: %s\n", pTask->GetTaskName () );
            file->Printf( "Secondary facial task type: %i\n", pTask->GetTaskType () );
        }
        else
            file->Printf( "Secondary facial task task: none\n" );

        // Secondary partial anim
        pTask = pTaskMgr->GetTaskSecondary ( TASK_SECONDARY_PARTIAL_ANIM );
        if ( pTask )
        {
            file->Printf( "Secondary partial anim task name: %s\n", pTask->GetTaskName () );
            file->Printf( "Secondary partial anim task type: %i\n", pTask->GetTaskType () );
        }
        else
            file->Printf( "Secondary partial anim task task: none\n" );

        // Secondary IK
        pTask = pTaskMgr->GetTaskSecondary ( TASK_SECONDARY_IK );
        if ( pTask )
        {
            file->Printf( "Secondary IK task name: %s\n", pTask->GetTaskName () );
            file->Printf( "Secondary IK task type: %i\n", pTask->GetTaskType () );
        }
        else
            file->Printf( "Secondary IK task task: none\n" );
    }

    float fX, fY;
    pPlayer->GetAim ( fX, fY );
    file->Printf( "Aim: %f %f\n", fX, fY );

    vecTemp = pPlayer->GetAimSource ();
    file->Printf( "Aim source: %f %f %f\n", vecTemp.fX, vecTemp.fY, vecTemp.fZ );

    vecTemp = pPlayer->GetAimTarget ();
    file->Printf( "Aim target: %f %f %f\n", vecTemp.fX, vecTemp.fY, vecTemp.fZ );

    file->Printf( "Veh aim anim: %u\n", pPlayer->GetVehicleAimAnim () );
    file->Printf( "Ducked: %u\n", pPlayer->IsDucked () );
    file->Printf( "Wearing googles: %u\n", pPlayer->IsWearingGoggles () );
    file->Printf( "Has jetpack: %u\n", pPlayer->HasJetPack () );
    file->Printf( "In water: %u\n", pPlayer->IsInWater () );
    file->Printf( "On ground: %u\n", pPlayer->IsOnGround () );
    file->Printf( "Is climbing: %u\n", pPlayer->IsClimbing () );
    file->Printf( "Interiour: %u\n", pPlayer->GetInterior () );
    file->Printf( "Fight style: %u\n", static_cast < int > ( pPlayer->GetFightingStyle () ) );
    file->Printf( "Satchel count: %u\n", pPlayer->CountProjectiles ( WEAPONTYPE_REMOTE_SATCHEL_CHARGE ) );

    CRemoteDataStorage* pRemote = pPlayer->GetRemoteData ();
    if ( pRemote )
    {
        vecTemp = pRemote->GetAkimboTarget ();
        file->Printf( "Akimbo target: %f %f %f\n", vecTemp.fX, vecTemp.fY, vecTemp.fZ );
        file->Printf( "Akimbo aim up: %u\n", pRemote->GetAkimboTargetUp () );
    }
    else
        file->Printf( "Remote: no\n" );

    file->Printf( "Using gun: %u\n", pPlayer->IsUsingGun () );
    file->Printf( "Entering veh: %u\n", pPlayer->IsEnteringVehicle () );
    file->Printf( "Getting jacked: %u\n", pPlayer->IsGettingJacked () );
    file->Printf( "Alpha: %u\n", pPlayer->GetAlpha () );
    

    file->Printf( "Stats:\n" );

    for ( uiIndex = 0; uiIndex < NUM_PLAYER_STATS; uiIndex++ )
    {
        file->Printf( "Stat [%u] = %f\n", uiIndex, pPlayer->GetStat ( uiIndex ) );
    }

    file->Printf( "Streamed in: %u\n", pPlayer->IsStreamedIn () );


    file->Printf( "Model: %u\n", pPlayer->GetModel () );

    // Write model data
    CModelInfo* pInfo = g_pGame->GetModelInfo ( pPlayer->GetModel () );
    file->Printf( "Model ref count: %i\n", pInfo->GetRefCount () );
    file->Printf( "Model loaded: %u\n", pInfo->IsLoaded () );
    file->Printf( "Model valid: %u\n", pInfo->IsValid () );

    // End of player
    file->Printf( "%s", "\n*** END OF PLAYER ***\n\n\n\n" );
}
Exemplo n.º 8
0
void CActor::g_SetAnimation( u32 mstate_rl )
{


	if (!g_Alive()) {
		if (m_current_legs||m_current_torso){
			SActorState*				ST = 0;
			if (mstate_rl&mcCrouch)		ST = &m_anims->m_crouch;
			else						ST = &m_anims->m_normal;
			mstate_real					= 0;
			m_current_legs.invalidate	();
			m_current_torso.invalidate	();

			smart_cast<CKinematicsAnimated*>(Visual())->PlayCycle(m_anims->m_dead_stop);
		}

		return;
	}
	STorsoWpn::eMovingState	moving_idx 		= STorsoWpn::eIdle;
	SActorState*					ST 		= 0;
	SAnimState*						AS 		= 0;
	
	if		(mstate_rl&mcCrouch)	ST 		= &m_anims->m_crouch;
	else if	(mstate_rl&mcClimb)		ST 		= &m_anims->m_climb;
	else							ST 		= &m_anims->m_normal;

	bool bAccelerated = isActorAccelerated(mstate_rl, IsZoomAimingMode());
	if ( bAccelerated ){
		AS							= &ST->m_run;
	}else{
		AS							= &ST->m_walk;
	}
	if(mstate_rl&mcAnyMove){
		if( bAccelerated )
			moving_idx				= STorsoWpn::eRun;
		else
			moving_idx				= STorsoWpn::eWalk;
	}
	// анимации
	MotionID 						M_legs;
	MotionID 						M_torso;
	MotionID 						M_head;

	//если мы просто стоим на месте
	bool is_standing = false;

	// Legs
	if		(mstate_rl&mcLanding)	M_legs	= ST->landing[0];
	else if (mstate_rl&mcLanding2)	M_legs	= ST->landing[1];
	else if ((mstate_rl&mcTurn)&&
			!(mstate_rl&mcClimb))	M_legs	= ST->legs_turn;
	else if (mstate_rl&mcFall)		M_legs	= ST->jump_idle;
	else if (mstate_rl&mcJump)		M_legs	= ST->jump_begin;
	else if (mstate_rl&mcFwd)		M_legs	= AS->legs_fwd;
	else if (mstate_rl&mcBack)		M_legs	= AS->legs_back;
	else if (mstate_rl&mcLStrafe)	M_legs	= AS->legs_ls;
	else if (mstate_rl&mcRStrafe)	M_legs	= AS->legs_rs;
	else is_standing = true;

	if(mstate_rl&mcSprint){
		g_SetSprintAnimation			(mstate_rl,M_head,M_torso,M_legs);
		moving_idx						= STorsoWpn::eSprint;
	}
	//---------------------------------------------------------------
	if (this == Level().CurrentViewEntity())
	{	
		if ((mstate_rl&mcSprint) != (mstate_old&mcSprint))
		{
			CHudItem* pHudItem = smart_cast<CHudItem*>(inventory().ActiveItem());	
			if (pHudItem) pHudItem->onMovementChanged(mcSprint);
		};
	};
	//-----------------------------------------------------------------------
	// Torso
	if(mstate_rl&mcClimb)
	{
		if		(mstate_rl&mcFwd)		M_torso	= AS->legs_fwd;
		else if (mstate_rl&mcBack)		M_torso	= AS->legs_back;
		else if (mstate_rl&mcLStrafe)	M_torso	= AS->legs_ls;
		else if (mstate_rl&mcRStrafe)	M_torso	= AS->legs_rs;
	}
	
	if(!M_torso)
	{
		CInventoryItem* _i = inventory().ActiveItem();
		CHudItem		*H = smart_cast<CHudItem*>(_i);
		CWeapon			*W = smart_cast<CWeapon*>(_i);
		CMissile		*M = smart_cast<CMissile*>(_i);
		CArtefact		*A = smart_cast<CArtefact*>(_i);
					
		if (H) {
			VERIFY(H->animation_slot() <= _total_anim_slots_);
			STorsoWpn* TW			= &ST->m_torso[H->animation_slot() - 1];
			if (!b_DropActivated&&!fis_zero(f_DropPower)){
				M_torso					= TW->drop;
				if (!M_torso)	
				{
					Msg("! drop animation for %s", *(H->object().cName()));
					M_torso = ST->m_torso_idle;
				};
				m_bAnimTorsoPlayed		= TRUE;
			}else{
				if (!m_bAnimTorsoPlayed) {
					if (W) {
						bool K	=inventory().GetActiveSlot() == KNIFE_SLOT;
						bool R3 = W->IsTriStateReload();
						
						if(K)
						{
							switch (W->GetState()){
							case CWeapon::eIdle:		M_torso	= TW->moving[moving_idx];		break;
							
							case CWeapon::eFire:	
								if(is_standing)
														M_torso = M_legs = M_head = TW->all_attack_0;
								else
														M_torso	= TW->attack_zoom;
								break;

							case CWeapon::eFire2:
								if(is_standing)
														M_torso = M_legs = M_head = TW->all_attack_1;
								else
														M_torso	= TW->fire_idle;
								break;

							case CWeapon::eJammed:
							case CWeapon::eReload:		M_torso	= TW->reload;					break;
							case CWeapon::eShowing:		M_torso	= TW->draw;						break;
							case CWeapon::eHiding:		M_torso	= TW->holster;					break;
							default				 :  	M_torso	= TW->moving[moving_idx];		break;
							}
						}
						else
						{
							switch (W->GetState()){
							case CWeapon::eIdle:		M_torso	= W->IsZoomed()?TW->zoom:TW->moving[moving_idx];	break;
							case CWeapon::eFire:		M_torso	= W->IsZoomed()?TW->attack_zoom:TW->attack;				break;
							case CWeapon::eFire2:		M_torso	= W->IsZoomed()?TW->attack_zoom:TW->attack;				break;
							case CWeapon::eJammed:
							case CWeapon::eReload:	
								if(!R3)
									M_torso	= TW->reload;
								else{
									CWeapon::EWeaponSubStates sub_st = W->GetReloadState();
									switch (sub_st){
										case CWeapon::eSubstateReloadBegin:			M_torso	= TW->reload;	break;
										case CWeapon::eSubstateReloadInProcess:		M_torso	= TW->reload_1; break;
										case CWeapon::eSubstateReloadEnd:			M_torso	= TW->reload_2; break;
										default:									M_torso	= TW->reload;	break;
									}
								}break;

							case CWeapon::eShowing:	M_torso	= TW->draw;					break;
							case CWeapon::eHiding:	M_torso	= TW->holster;				break;
							default				 :  M_torso	= TW->moving[moving_idx];	break;
							}
						}
					}
					else if (M) {
						if(is_standing)
						{
							switch (M->GetState()){
							case MS_SHOWING	 :		M_torso	= TW->draw;			break;
							case MS_HIDING	 :		M_torso	= TW->holster;		break;
							case MS_IDLE_SPRINT:   ;
							case MS_IDLE	 :		M_torso	= TW->moving[moving_idx];		break;							
							case MS_EMPTY	 :		M_torso	= TW->zoom;		break;
							case MS_THREATEN :		M_torso = M_legs = M_head = TW->all_attack_0;	break;
							case MS_READY	 :		M_torso = M_legs = M_head = TW->all_attack_1;	break;
							case MS_THROW	 :		M_torso = M_legs = M_head = TW->all_attack_2;	break;
							case MS_END		 :		M_torso = M_legs = M_head = TW->all_attack_2;	break;
							default			 :		M_torso	= TW->draw;			break; 
							}
						}
						else
						{
							switch (M->GetState()){
							case MS_SHOWING	 :		M_torso	= TW->draw;						break;
							case MS_HIDING	 :		M_torso	= TW->holster;					break;
							case MS_IDLE_SPRINT:   ;
							case MS_IDLE	 :		M_torso	= TW->moving[moving_idx];		break;
							case MS_EMPTY	 :		M_torso	= TW->moving[moving_idx];		break;
							case MS_THREATEN :		M_torso	= TW->attack_zoom;				break;
							case MS_READY	 :		M_torso	= TW->fire_idle;				break;
							case MS_THROW	 :		M_torso	= TW->fire_end;					break;
							case MS_END		 :		M_torso	= TW->fire_end;					break;
							default			 :		M_torso	= TW->draw;						break; 
							}
						}
					}
					else if (A){
							switch(A->GetState()){
								case CArtefact::eIdle		: M_torso	= TW->moving[moving_idx];	break; 
								case CArtefact::eShowing	: M_torso	= TW->draw;					break; 
								case CArtefact::eHiding		: M_torso	= TW->holster;				break; 
								case CArtefact::eActivating : M_torso	= TW->zoom;					break; 
							default							: M_torso	= TW->moving[moving_idx];
							}
					
					}
				}
			}
		}
	}

	if (!M_legs)
	{
		if((mstate_rl&mcCrouch)&&!isActorAccelerated(mstate_rl, IsZoomAimingMode()))//!(mstate_rl&mcAccel))
		{
			M_legs=smart_cast<CKinematicsAnimated*>(Visual())->ID_Cycle("cr_idle_1");
		}
		else 
			M_legs	= ST->legs_idle;
	}
	if (!M_head)					M_head	= ST->m_head_idle;
	if (!M_torso){				
		if (m_bAnimTorsoPlayed)		M_torso	= m_current_torso;
		else						M_torso = ST->m_torso_idle;
	}
	
	// есть анимация для всего - запустим / иначе запустим анимацию по частям
	if (m_current_torso!=M_torso){
		if (m_bAnimTorsoPlayed)		m_current_torso_blend = smart_cast<CKinematicsAnimated*>	(Visual())->PlayCycle(M_torso,TRUE,AnimTorsoPlayCallBack,this);
		else						/**/m_current_torso_blend = /**/smart_cast<CKinematicsAnimated*>	(Visual())->PlayCycle(M_torso);

		m_current_torso=M_torso;
	}
	if(m_current_head!=M_head)
	{
		if(M_head)smart_cast<CKinematicsAnimated*>(Visual())->PlayCycle(M_head);
		m_current_head=M_head;
	}
	if (m_current_legs!=M_legs){
		float pos					= 0.f;
		VERIFY						(!m_current_legs_blend || !fis_zero(m_current_legs_blend->timeTotal));
		if ((mstate_real&mcAnyMove)&&(mstate_old&mcAnyMove)&&m_current_legs_blend)
			pos						= fmod(m_current_legs_blend->timeCurrent,m_current_legs_blend->timeTotal)/m_current_legs_blend->timeTotal;
		m_current_legs_blend		= smart_cast<CKinematicsAnimated*>(Visual())->PlayCycle(M_legs,TRUE,legs_play_callback,this);
		if ((!(mstate_old&mcAnyMove))&&(mstate_real&mcAnyMove))
			pos						= 0.5f*Random.randI(2);
		if (m_current_legs_blend)
			m_current_legs_blend->timeCurrent = m_current_legs_blend->timeTotal*pos;
		m_current_legs				= M_legs;

		CStepManager::on_animation_start(M_legs, m_current_legs_blend);
	}



#ifdef _DEBUG
	if(bDebug){
		HUD().Font().pFontStat->OutSetI	(0,0);
		HUD().Font().pFontStat->OutNext("[%s]",mov_state[moving_idx]);
	}
#endif

#ifdef _DEBUG
	if ((Level().CurrentControlEntity() == this) && g_ShowAnimationInfo) {
		string128 buf;
		strcpy(buf,"");
		if (isActorAccelerated(mstate_rl, IsZoomAimingMode()))		strcat(buf,"Accel ");
		if (mstate_rl&mcCrouch)		strcat(buf,"Crouch ");
		if (mstate_rl&mcFwd)		strcat(buf,"Fwd ");
		if (mstate_rl&mcBack)		strcat(buf,"Back ");
		if (mstate_rl&mcLStrafe)	strcat(buf,"LStrafe ");
		if (mstate_rl&mcRStrafe)	strcat(buf,"RStrafe ");
		if (mstate_rl&mcJump)		strcat(buf,"Jump ");
		if (mstate_rl&mcFall)		strcat(buf,"Fall ");
		if (mstate_rl&mcTurn)		strcat(buf,"Turn ");
		if (mstate_rl&mcLanding)	strcat(buf,"Landing ");
		if (mstate_rl&mcLLookout)	strcat(buf,"LLookout ");
		if (mstate_rl&mcRLookout)	strcat(buf,"RLookout ");
		if (m_bJumpKeyPressed)		strcat(buf,"+Jumping ");
		HUD().Font().pFontStat->OutNext	("MSTATE:     [%s]",buf);
/*
		switch (m_PhysicMovementControl->Environment())
		{
		case CPHMovementControl::peOnGround:	strcpy(buf,"ground");			break;
		case CPHMovementControl::peInAir:		strcpy(buf,"air");				break;
		case CPHMovementControl::peAtWall:		strcpy(buf,"wall");				break;
		}
		HUD().Font().pFontStat->OutNext	(buf);
		HUD().Font().pFontStat->OutNext	("Accel     [%3.2f, %3.2f, %3.2f]",VPUSH(NET_SavedAccel));
		HUD().Font().pFontStat->OutNext	("V         [%3.2f, %3.2f, %3.2f]",VPUSH(m_PhysicMovementControl->GetVelocity()));
		HUD().Font().pFontStat->OutNext	("vertex ID   %d",ai_location().level_vertex_id());
		
		Game().m_WeaponUsageStatistic->Draw();
		*/
	};
#endif

	if (!m_current_torso_blend)
		return;

	CKinematicsAnimated		*skeleton_animated = PKinematicsAnimated(Visual());

	CMotionDef				*motion0 = skeleton_animated->LL_GetMotionDef(m_current_torso);
	VERIFY					(motion0);
	if (!(motion0->flags & esmSyncPart))
		return;

	if (!m_current_legs_blend)
		return;

	CMotionDef				*motion1 = skeleton_animated->LL_GetMotionDef(m_current_legs);
	VERIFY					(motion1);
	if (!(motion1->flags & esmSyncPart))
		return;

	m_current_torso_blend->timeCurrent	= m_current_legs_blend->timeCurrent/m_current_legs_blend->timeTotal*m_current_torso_blend->timeTotal;
}