本文整理汇总了C++中CInventoryOwner类的典型用法代码示例。如果您正苦于以下问题:C++ CInventoryOwner类的具体用法?C++ CInventoryOwner怎么用?C++ CInventoryOwner使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CInventoryOwner类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddAvailableDialog
void CActor::UpdateAvailableDialogs (CPhraseDialogManager* partner)
{
m_AvailableDialogs.clear();
m_CheckedDialogs.clear();
if(CInventoryOwner::m_known_info_registry->registry().objects_ptr())
{
for(KNOWN_INFO_VECTOR::const_iterator it = CInventoryOwner::m_known_info_registry->registry().objects_ptr()->begin();
CInventoryOwner::m_known_info_registry->registry().objects_ptr()->end() != it; ++it)
{
//подгрузить кусочек информации с которым мы работаем
CInfoPortion info_portion;
info_portion.Load((*it).info_id);
for(u32 i = 0; i<info_portion.DialogNames().size(); i++)
AddAvailableDialog(*info_portion.DialogNames()[i], partner);
}
}
//добавить актерский диалог собеседника
CInventoryOwner* pInvOwnerPartner = smart_cast<CInventoryOwner*>(partner); VERIFY(pInvOwnerPartner);
for(u32 i = 0; i<pInvOwnerPartner->CharacterInfo().ActorDialogs().size(); i++)
AddAvailableDialog(pInvOwnerPartner->CharacterInfo().ActorDialogs()[i], partner);
CPhraseDialogManager::UpdateAvailableDialogs(partner);
}
示例2: DisableInfoPortion
bool CScriptGameObject::DisableInfoPortion(LPCSTR info_id)
{
CInventoryOwner* pInventoryOwner = smart_cast<CInventoryOwner*>(&object());
if(!pInventoryOwner) return false;
pInventoryOwner->TransferInfo(info_id, false);
return true;
}
示例3:
bool CScriptGameObject::DontHasInfo (LPCSTR info_id)
{
CInventoryOwner* pInventoryOwner = smart_cast<CInventoryOwner*>(&object());
if(!pInventoryOwner) return true;
return !pInventoryOwner->HasInfo(info_id);
}
示例4: VERIFY
void CScriptGameObject::GiveMoney(int money)
{
CInventoryOwner* pOurOwner = smart_cast<CInventoryOwner*>(&object()); VERIFY(pOurOwner);
pOurOwner->set_money (pOurOwner->get_money() + money, true );
}
示例5: H_Parent
void CPda::feel_touch_new(CObject* O)
{
if ( CInventoryOwner* pNewContactInvOwner = smart_cast<CInventoryOwner*>(O) )
{
CInventoryOwner* pOwner = smart_cast<CInventoryOwner*>( H_Parent() );VERIFY(pOwner);
pOwner->NewPdaContact (pNewContactInvOwner);
}
}
示例6: VERIFY
void CWeaponMagazined::state_Fire(float dt)
{
VERIFY(fTimeToFire > 0.f);
Fvector p1, d;
p1.set(get_LastFP());
d.set(get_LastFD());
if (!H_Parent()) return;
CInventoryOwner* io = smart_cast<CInventoryOwner*>(H_Parent());
if (NULL == io->inventory().ActiveItem())
{
Log("current_state", GetState());
Log("next_state", GetNextState());
Log("state_time", m_dwStateTime);
Log("item_sect", cNameSect().c_str());
Log("H_Parent", H_Parent()->cNameSect().c_str());
}
smart_cast<CEntity*> (H_Parent())->g_fireParams(this, p1, d);
if (m_iShotNum == 0)
{
m_vStartPos = p1;
m_vStartDir = d;
};
VERIFY(!m_magazine.empty());
// Msg("%d && %d && (%d || %d) && (%d || %d)", !m_magazine.empty(), fTime<=0, IsWorking(), m_bFireSingleShot, m_iQueueSize < 0, m_iShotNum < m_iQueueSize);
while (!m_magazine.empty() && fTime <= 0 && (IsWorking() || m_bFireSingleShot) && (m_iQueueSize < 0 || m_iShotNum < m_iQueueSize))
{
m_bFireSingleShot = false;
VERIFY(fTimeToFire > 0.f);
fTime += fTimeToFire;
++m_iShotNum;
OnShot();
static int i = 0;
if (i || m_iShotNum > m_iShootEffectorStart)
{
// Do Weapon Callback. (Cribbledirge)
StateSwitchCallback(GameObject::eOnActorWeaponFire, GameObject::eOnNPCWeaponFire);
FireTrace(p1, d);
}
else
{
FireTrace(m_vStartPos, m_vStartDir);
}
}
if (m_iShotNum == m_iQueueSize)
m_bStopedAfterQueueFired = true;
UpdateSounds();
}
示例7: Update
void CUIInventoryWnd::Update()
{
if(m_b_need_reinit)
InitInventory ();
CEntityAlive *pEntityAlive = smart_cast<CEntityAlive*>(Level().CurrentEntity());
if(pEntityAlive)
{
float v = pEntityAlive->conditions().GetHealth()*100.0f;
UIProgressBarHealth.SetProgressPos (v);
v = pEntityAlive->conditions().GetPsyHealth()*100.0f;
UIProgressBarPsyHealth.SetProgressPos (v);
v = pEntityAlive->conditions().GetRadiation()*100.0f;
UIProgressBarRadiation.SetProgressPos (v);
#ifdef INV_NEW_SLOTS_SYSTEM
if (GameID() == GAME_SINGLE){
CActor* m_pActor = smart_cast<CActor*>(Level().CurrentViewEntity());
v =(m_pActor->conditions().GetSatiety())*100.0f;
UIProgressBarSatiety.SetProgressPos (v);
}
#endif
CInventoryOwner* pOurInvOwner = smart_cast<CInventoryOwner*>(pEntityAlive);
u32 _money = 0;
if (GameID() != GAME_SINGLE){
game_PlayerState* ps = Game().GetPlayerByGameID(pEntityAlive->ID());
if (ps){
UIProgressBarRank.SetProgressPos(ps->experience_D*100);
_money = ps->money_for_round;
}
}else
{
_money = pOurInvOwner->get_money();
}
// update money
string64 sMoney;
//red_virus
sprintf_s (sMoney,"%d %s", _money, *CStringTable().translate("ui_st_money_regional"));
UIMoneyWnd.SetText (sMoney);
// update outfit parameters
CCustomOutfit* outfit = smart_cast<CCustomOutfit*>(pOurInvOwner->inventory().m_slots[OUTFIT_SLOT].m_pIItem);
UIOutfitInfo.Update (outfit);
}
UIStaticTimeString.SetText(*InventoryUtilities::GetGameTimeAsString(InventoryUtilities::etpTimeToMinutes));
CUIWindow::Update ();
}
示例8: SetSympathy
void CScriptGameObject::SetSympathy( float sympathy )
{
CInventoryOwner* pInventoryOwner = smart_cast<CInventoryOwner*>(&object());
if (!pInventoryOwner) {
ai().script_engine().script_log (ScriptStorage::eLuaMessageTypeError,"SetSympathy available only for InventoryOwner");
return ;
}
pInventoryOwner->CharacterInfo().SetSympathy( sympathy );
}
示例9: ai
CScriptGameObject *CScriptGameObject::GetCurrentOutfit() const
{
CInventoryOwner *inventoryOwner = smart_cast<CInventoryOwner*>(&object());
if (!inventoryOwner) {
ai().script_engine().script_log (ScriptStorage::eLuaMessageTypeError,"CInventoryOwner : cannot access class member GetCurrentOutfit!");
return (0);
}
CGameObject *current_equipment = inventoryOwner->GetCurrentOutfit() ? &inventoryOwner->GetCurrentOutfit()->object() : 0;
return (current_equipment ? current_equipment->lua_game_object() : 0);
}
示例10: sound_voice_prefix
LPCSTR CScriptGameObject::sound_voice_prefix () const
{
CInventoryOwner* pInventoryOwner = smart_cast<CInventoryOwner*>(&object());
if (!pInventoryOwner) {
ai().script_engine().script_log (ScriptStorage::eLuaMessageTypeError,"sound_voice_prefix available only for InventoryOwner");
return NULL;
}
return pInventoryOwner->SpecificCharacter().sound_voice_prefix();
}
示例11: GetSympathy
float CScriptGameObject::GetSympathy()
{
CInventoryOwner* pInventoryOwner = smart_cast<CInventoryOwner*>(&object());
if (!pInventoryOwner) {
ai().script_engine().script_log (ScriptStorage::eLuaMessageTypeError,"GetSympathy available only for InventoryOwner");
return 0.0f;
}
return pInventoryOwner->Sympathy();
}
示例12: ChangeGoodwill
void CScriptGameObject::ChangeGoodwill(int delta_goodwill, CScriptGameObject* pWhoToSet)
{
CInventoryOwner* pInventoryOwner = smart_cast<CInventoryOwner*>(&object());
if (!pInventoryOwner) {
ai().script_engine().script_log (ScriptStorage::eLuaMessageTypeError,"ChangeGoodwill available only for InventoryOwner");
return ;
}
RELATION_REGISTRY().ChangeGoodwill(pInventoryOwner->object_id(), pWhoToSet->object().ID(), delta_goodwill);
}
示例13: RELATION_REGISTRY
int CScriptGameObject::GetGoodwill(CScriptGameObject* pToWho)
{
CInventoryOwner* pInventoryOwner = smart_cast<CInventoryOwner*>(&object());
if (!pInventoryOwner) {
ai().script_engine().script_log (ScriptStorage::eLuaMessageTypeError,"GetGoodwill available only for InventoryOwner");
return 0;
}
return RELATION_REGISTRY().GetGoodwill(pInventoryOwner->object_id(), pToWho->object().ID());
}
示例14: xrTime
xrTime CScriptGameObject::GetInfoTime (LPCSTR info_id)
{
CInventoryOwner* pInventoryOwner = smart_cast<CInventoryOwner*>(&object());
if(!pInventoryOwner) return xrTime(0);
INFO_DATA info_data;
if(pInventoryOwner->GetInfo(info_id, info_data))
return xrTime(info_data.receive_time);
else
return xrTime(0);
}
示例15: SetCommunityGoodwill_obj
void CScriptGameObject::SetCommunityGoodwill_obj( LPCSTR community, int goodwill )
{
CInventoryOwner* pInventoryOwner = smart_cast<CInventoryOwner*>(&object());
if (!pInventoryOwner) {
ai().script_engine().script_log (ScriptStorage::eLuaMessageTypeError,"SetCommunityGoodwill available only for InventoryOwner");
return;
}
CHARACTER_COMMUNITY c;
c.set( community );
RELATION_REGISTRY().SetCommunityGoodwill( c.index(), pInventoryOwner->object_id(), goodwill );
}