本文整理汇总了C++中CClientWeapon::GetWeaponRecord方法的典型用法代码示例。如果您正苦于以下问题:C++ CClientWeapon::GetWeaponRecord方法的具体用法?C++ CClientWeapon::GetWeaponRecord怎么用?C++ CClientWeapon::GetWeaponRecord使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CClientWeapon
的用法示例。
在下文中一共展示了CClientWeapon::GetWeaponRecord方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleBlocked
void CClientMeleeCollisionController::HandleBlocked(HOBJECT hTarget, const LTVector& vPos, const LTVector& vDir)
{
// Get the proper weapon record...
CClientWeapon* pClientWeapon = g_pClientWeaponMgr->GetCurrentClientWeapon();
HWEAPON hWeapon = pClientWeapon ? pClientWeapon->GetWeaponRecord() : NULL; //!!ARL: Use Attacker's weapon instead? (will need to be sent from server - probably along with block info)
HWEAPONDATA hWeaponData = g_pWeaponDB->GetWeaponData(hWeapon, !USE_AI_DATA);
// Spawn a block effect for it...
const char* pszBlockFX = g_pWeaponDB->GetString(hWeaponData, "BlockFX");
CLIENTFX_CREATESTRUCT fxcs(pszBlockFX, 0, LTRigidTransform(vPos, LTRotation(vDir, LTVector(0,1,0))));
g_pGameClientShell->GetSimulationTimeClientFXMgr().CreateClientFX(NULL, fxcs, true);
// Let the server objects know they've blocked / been blocked.
CAutoMessage cMsg;
cMsg.Writeuint8(MID_OBJECT_MESSAGE);
cMsg.WriteObject(m_hObject);
cMsg.Writeuint32(MID_MELEEBLOCK);
cMsg.WriteObject(hTarget);
g_pLTClient->SendToServer(cMsg.Read(), MESSAGE_GUARANTEED);
// Disable attacker's collision (i.e. stop attacking).
DisableCollisions();
// For local player attackers, send a BlockRecoil stimulus so a proper animation can be played.
if (m_hObject == g_pPlayerMgr->GetMoveMgr()->GetObject())
{
CPlayerBodyMgr::Instance().HandleAnimationStimulus("CS_RecoilFromBlock");
}
}
示例2: GetClientWeapon
CClientWeapon* CClientWeaponMgr::GetClientWeapon( HWEAPON hDesiredWeapon ) const
{
for( uint32 iWeapon=0; iWeapon < m_nMaxWeapons; ++iWeapon )
{
CClientWeapon* pCur = m_apClientWeapon[iWeapon];
if( pCur->GetWeaponRecord() == hDesiredWeapon )
return m_apClientWeapon[iWeapon];
}
return NULL;
}
示例3: GetCustomWeaponDeselectStimulus
const char* CClientWeaponMgr::GetCustomWeaponDeselectStimulus()
{
CClientWeapon* pWeapon = GetVisibleCustomWeapon();
if (pWeapon)
{
HWEAPON hWeapon = pWeapon->GetWeaponRecord();
HWEAPONDATA hWpnData = g_pWeaponDB->GetWeaponData(hWeapon, !USE_AI_DATA);
return g_pWeaponDB->GetString( hWpnData, "CustomDeselectStimulus" );
}
return "";
}
示例4: InitCustomWeapons
void CClientWeaponMgr::InitCustomWeapons()
{
for ( int i = 0; i < m_nMaxWeapons; ++i )
{
CClientWeapon* pWeapon = m_apClientWeapon[ i ];
if ( pWeapon )
{
// check to see if this is a custom weapon by check for a custom select stimulus
// which is used to bring the custom weapon up.
HWEAPON hWeapon = pWeapon->GetWeaponRecord();
HWEAPONDATA hWpnData = g_pWeaponDB->GetWeaponData(hWeapon, !USE_AI_DATA);
const char* pszCustomSelect = g_pWeaponDB->GetString(hWpnData, WDB_WEAPON_CustomSelectStimulus);
bool bCustomWeapon = !LTStrEmpty(pszCustomSelect) && LTStrCmp(pszCustomSelect, "None")!=0;
if (bCustomWeapon)
{
pWeapon->Activate();
pWeapon->SetDisable(false);
pWeapon->SetVisible(false);
}
}
}
}
示例5: Update
void CAutoTargetMgr::Update()
{
//remember whether we were locked on last frame
bool bWasLocked = m_bLockOn;
m_bLockOn = false;
//no auto-aim while zoomed in
if (g_pPlayerMgr->GetPlayerCamera()->IsZoomed())
return;
// Get our weapon.
CClientWeaponMgr *pClientWeaponMgr = g_pPlayerMgr->GetClientWeaponMgr();
CClientWeapon* pClientWeapon = pClientWeaponMgr->GetCurrentClientWeapon();
if (!pClientWeapon) return;
HWEAPONDATA hWpnData = g_pWeaponDB->GetWeaponData(pClientWeapon->GetWeaponRecord(), !USE_AI_DATA);
AutoTargetType eUseAutoTarget = (AutoTargetType)g_pWeaponDB->GetInt32( hWpnData, WDB_WEAPON_nUseAutoTarget );
if (eUseAutoTarget == AT_NEVER || (eUseAutoTarget == AT_EASY && g_pGameClientShell->GetDifficulty() != GD_EASY) )
return;
// Check if they want to manually aim.
if( g_pPlayerMgr->IsManualAim( ))
return;
m_fAngle = g_pWeaponDB->GetFloat( hWpnData, WDB_WEAPON_fAutoTargetAngle );
m_fRangeSqr = g_pWeaponDB->GetFloat( hWpnData, WDB_WEAPON_fAutoTargetRange );
m_fRangeSqr *= m_fRangeSqr;
// Get the camera position and set up the vectors
m_vFirePos = g_pPlayerMgr->GetPlayerCamera()->GetCameraPos( );
LTRotation const& rRot = g_pPlayerMgr->GetPlayerCamera()->GetCameraRotation( );
m_vForward = rRot.Forward();
// if we weren't locked last frame, reset our current aim
if (!bWasLocked)
m_vCurTarget = m_vForward;
CSFXMgr* psfxMgr = g_pGameClientShell->GetSFXMgr();
if(psfxMgr)
{
//Generate array of chars sorted by distance
GenerateCharArray();
//using this list of chars, generate an array of node positions
GenerateNodeArray();
//add any aim magnets to the array
AddMagnets();
// sort array proximity to the center of the screen
qsort(m_NodeArray, m_nNodeCount, sizeof(AutoTargetNode), CompareTargetNodes);
//find the visible node closest to the center
m_vTarget = m_vForward;
m_bLockOn = FindNode();
if (m_bLockOn)
InterpolateAim();
}
}