本文整理汇总了C++中CCharacter::IsDead方法的典型用法代码示例。如果您正苦于以下问题:C++ CCharacter::IsDead方法的具体用法?C++ CCharacter::IsDead怎么用?C++ CCharacter::IsDead使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCharacter
的用法示例。
在下文中一共展示了CCharacter::IsDead方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ObjectTouch
void WeaponItem::ObjectTouch(HOBJECT hObject)
{
if (!hObject) return;
// If we hit non-player objects, just ignore them...
if (IsPlayer(hObject))
{
CCharacter* pCharObj = (CCharacter*)g_pLTServer->HandleToObject(hObject);
if (pCharObj && !pCharObj->IsDead())
{
HMESSAGEWRITE hMessage = g_pLTServer->StartMessageToObject(this, hObject, MID_ADDWEAPON);
g_pLTServer->WriteToMessageByte(hMessage, m_nWeaponId);
g_pLTServer->WriteToMessageByte(hMessage, m_nAmmoId);
g_pLTServer->WriteToMessageFloat(hMessage, (LTFLOAT)m_nAmmo);
g_pLTServer->WriteToMessageByte(hMessage, m_bIsLevelPowerup);
g_pLTServer->EndMessage(hMessage);
}
}
}
示例2: ObjectTouch
void WeaponItem::ObjectTouch(HOBJECT hObject, bool bForcePickup/*=false*/)
{
if (!hObject) return;
// If we hit non-player objects, just ignore them...
if (IsPlayer(hObject))
{
CCharacter* pCharObj = (CCharacter*)g_pLTServer->HandleToObject(hObject);
if (pCharObj && !pCharObj->IsDead())
{
CAutoMessage cMsg;
cMsg.Writeuint32(MID_ADDWEAPON);
cMsg.Writeuint8(m_nWeaponId);
cMsg.Writeuint8(m_nAmmoId);
cMsg.Writeint32(m_nAmmo);
cMsg.Writebool(bForcePickup);
g_pLTServer->SendToObject(cMsg.Read(), m_hObject, hObject, MESSAGE_GUARANTEED);
}
}
}
示例3: ObjectTouch
void AmmoBox::ObjectTouch(HOBJECT hObject, bool bForcePickup/*=false*/)
{
if (!hObject) return;
// If we hit non-player objects, just ignore them...
if (IsPlayer(hObject))
{
CCharacter* pCharObj = (CCharacter*)g_pLTServer->HandleToObject(hObject);
if (pCharObj && !pCharObj->IsDead())
{
int nValidIds = 0;
for (int i=0; i < AB_MAX_TYPES; i++)
{
if (m_nAmmoId[i] != WMGR_INVALID_ID && m_nAmmoCount[i] > 0)
{
nValidIds++;
}
}
if (nValidIds)
{
CAutoMessage cMsg;
cMsg.Writeuint32(MID_AMMOBOX);
cMsg.Writeuint8(nValidIds);
for (int i=0; i < AB_MAX_TYPES; i++)
{
if (m_nAmmoId[i] != WMGR_INVALID_ID && m_nAmmoCount[i] > 0)
{
cMsg.Writeuint8(m_nAmmoId[i]);
cMsg.Writeint32(m_nAmmoCount[i]);
}
}
g_pLTServer->SendToObject(cMsg.Read(), m_hObject, hObject, MESSAGE_GUARANTEED);
}
}
}
}