Пример #1
0
void CWeaponMagazined::OnStateSwitch	(u32 S)
{
	inherited::OnStateSwitch(S);
	switch (S)
	{
	case eIdle:
		switch2_Idle	();
		break;
	case eFire:
		switch2_Fire	();
		break;
	case eFire2:
		switch2_Fire2	();
		break;
	case eMisfire:
		if(smart_cast<CActor*>(this->H_Parent()) && (Level().CurrentViewEntity()==H_Parent()) )
			HUD().GetUI()->AddInfoMessage("gun_jammed");
		break;
	case eMagEmpty:
		switch2_Empty	();
		break;
	case eReload:
		switch2_Reload	();
		break;
	case eShowing:
		switch2_Showing	();
		break;
	case eHiding:
		switch2_Hiding	();
		break;
	case eHidden:
		switch2_Hidden	();
		break;
	}
}
Пример #2
0
void CWeaponMagazined::OnStateSwitch(u32 S)
{
	inherited::OnStateSwitch(S);
	switch (S)
	{
	case eIdle:
		switch2_Idle();
		break;
	case eFire:
		switch2_Fire();
		break;
	case eFire2:
		switch2_Fire2();
		break;
	case eMisfire:
		if (smart_cast<CActor*>(this->H_Parent()) && (Level().CurrentViewEntity() == H_Parent()))
			HUD().GetUI()->AddInfoMessage("gun_jammed");
		// Callbacks added by Cribbledirge.
		StateSwitchCallback(GameObject::eOnActorWeaponJammed, GameObject::eOnNPCWeaponJammed);
		break;
	case eMagEmpty:
		switch2_Empty();
		// Callbacks added by Cribbledirge.
		StateSwitchCallback(GameObject::eOnActorWeaponEmpty, GameObject::eOnNPCWeaponEmpty);
		break;
	case eReload:
		switch2_Reload();
		// Callbacks added by Cribbledirge.
		StateSwitchCallback(GameObject::eOnActorWeaponReload, GameObject::eOnNPCWeaponReload);
		break;
	case eShowing:
		switch2_Showing();
		break;
	case eHiding:
		switch2_Hiding();
		break;
	case eHidden:
		switch2_Hidden();
		break;
	}
}
Пример #3
0
void CWeaponKnife::OnStateSwitch	(u32 S)
{
	inherited::OnStateSwitch(S);
	switch (S)
	{
	case eIdle:
		switch2_Idle	();
		break;
	case eShowing:
		switch2_Showing	();
		break;
	case eHiding:
		switch2_Hiding	();
		break;
	case eHidden:
		switch2_Hidden	();
		break;
	case eFire:
		{
			//-------------------------------------------
			m_eHitType		= m_eHitType_1;
			//fHitPower		= fHitPower_1;
			if (ParentIsActor())
			{
				if (GameID() == eGameIDSingle)
				{
					fCurrentHit			= fvHitPower_1[g_SingleGameDifficulty];
					fCurrentHitCritical	= fvHitPowerCritical_1[g_SingleGameDifficulty];
				}
				else
				{
					fCurrentHit			= fvHitPower_1[egdMaster];
					fCurrentHitCritical	= fvHitPowerCritical_1[egdMaster];
				}
			}
			else
			{
				fCurrentHit			= fvHitPower_1[egdMaster];
				fCurrentHitCritical	= fvHitPowerCritical_1[egdMaster];
			}
			fHitImpulse_cur	= fHitImpulse_1;
			//-------------------------------------------
			switch2_Attacking	(S);
		}break;
	case eFire2:
		{
			//-------------------------------------------
			m_eHitType		= m_eHitType_2;
			//fHitPower		= fHitPower_2;
			if (ParentIsActor())
			{
				if (GameID() == eGameIDSingle)
				{
					fCurrentHit			= fvHitPower_2[g_SingleGameDifficulty];
					fCurrentHitCritical	= fvHitPowerCritical_2[g_SingleGameDifficulty];
				}
				else
				{
					fCurrentHit			= fvHitPower_2[egdMaster];
					fCurrentHitCritical	= fvHitPowerCritical_2[egdMaster];
				}
			}
			else
			{
				fCurrentHit			= fvHitPower_2[egdMaster];
				fCurrentHitCritical	= fvHitPowerCritical_2[egdMaster];
			}
			fHitImpulse_cur	= fHitImpulse_2;
			//-------------------------------------------
			switch2_Attacking	(S);
		}break;
	}
}