Esempio n. 1
0
void CShotgun::EndReload(int zoomed)
{
	CActor *pActor = m_pWeapon->GetOwnerActor();

	float speedOverride = 1.0f;

	if(m_reload_was_broken)
		speedOverride = 1.75f;

	uint32 animTime = 100;

	if(m_reload_pump && !m_reload_was_broken)
		m_pWeapon->PlayAction(g_pItemStrings->exit_reload_pump,0,false,CItem::eIPAF_Default,speedOverride);
	else
		m_pWeapon->PlayAction(g_pItemStrings->exit_reload_nopump,0,false,CItem::eIPAF_Default,speedOverride);

	animTime = m_pWeapon->GetCurrentAnimationTime(eIGS_FirstPerson);

	if(!m_reload_was_broken)
		m_pWeapon->GetScheduler()->TimerAction(animTime, CSchedulerAction<ReloadEndAction>::Create(ReloadEndAction(m_pWeapon, zoomed)), false);
	else
		m_pWeapon->GetScheduler()->TimerAction(100, CSchedulerAction<ReloadEndAction>::Create(ReloadEndAction(m_pWeapon, zoomed)), false);


}
Esempio n. 2
0
void CShotgun::EndReload(int zoomed)
{
	CActor *pActor = m_pWeapon->GetOwnerActor();

	float speedOverride = 1.0f;
	if (m_reload_was_broken)
	{
		speedOverride = m_fireParams->shotgunparams.endReloadSpeedOverride;
	}
	else
	{
		speedOverride = GetReloadSpeedMultiplier(pActor);
	}


	uint32 animTime = 100;
	uint32 reloadBreakTime = uint32(m_fireParams->shotgunparams.reloadBreakTime * 1000);

	const CTagDefinition* pTagDefinition = NULL;
	int fragmentID = m_pWeapon->GetFragmentID("exit_reload", &pTagDefinition);
	if(fragmentID != FRAGMENT_ID_INVALID)
	{
		TagState actionTags = TAG_STATE_EMPTY;
		if(pTagDefinition && m_reload_pump && !m_reload_was_broken)
		{
			CTagState fragTags(*pTagDefinition);
				
			fragTags.SetByCRC(CItem::sFragmentTagCRCs.ammo_empty, true);

			actionTags = fragTags.GetMask();
		}

		CItemAction* pAction = new CItemAction(PP_PlayerAction, fragmentID, actionTags);
		m_pWeapon->PlayFragment(pAction, speedOverride);
	}

	animTime = m_pWeapon->GetCurrentAnimationTime(eIGS_Owner);

	if(!m_reload_was_broken)
		m_pWeapon->GetScheduler()->TimerAction(animTime, CSchedulerAction<ReloadEndAction>::Create(ReloadEndAction(m_pWeapon, zoomed)), false);
	else
		m_pWeapon->GetScheduler()->TimerAction(reloadBreakTime, CSchedulerAction<ReloadEndAction>::Create(ReloadEndAction(m_pWeapon, zoomed)), false);

	m_pWeapon->SendEndReload();
}