这篇教程C++ GetActor函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetActor函数的典型用法代码示例。如果您正苦于以下问题:C++ GetActor函数的具体用法?C++ GetActor怎么用?C++ GetActor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetActor函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: Terminatevoid study::Handle(){ item* Literature = game::SearchItem(LiteratureID); if(!Literature || !Literature->Exists() || !Actor->IsOver(Literature)) { Terminate(false); return; } if(GetActor()->GetLSquareUnder()->IsDark() && !game::GetSeeWholeMapCheatMode()) { ADD_MESSAGE("It is too dark to read now."); Terminate(false); return; } if(game::CompareLightToInt(GetActor()->GetLSquareUnder()->GetLuminance(), 115) < 0) GetActor()->EditExperience(PERCEPTION, -50, 1 << 1); if(!Counter) { Terminate(true); return; } if(GetActor()->GetAttribute(INTELLIGENCE) >= Counter) Counter = 0; else Counter -= GetActor()->GetAttribute(INTELLIGENCE);}
开发者ID:harmonise,项目名称:ivan-f,代码行数:31,
示例2: GetItem//------------------------------------------------------------------------int CScriptBind_Item::OnUsed(IFunctionHandler *pH, ScriptHandle userId){ CItem *pItem = GetItem(pH); if (!pItem) return pH->EndFunction(); if (pItem->CanUse((EntityId)userId.n)) { CActor *pActor=GetActor((EntityId)userId.n); if (pActor) { pActor->UseItem(pItem->GetEntityId()); return pH->EndFunction(true); } } else if (pItem->CanPickUp((EntityId)userId.n)) { CActor *pActor=GetActor((EntityId)userId.n); if (pActor) { pActor->PickUpItem(pItem->GetEntityId(), true); return pH->EndFunction(true); } } return pH->EndFunction();}
开发者ID:AiYong,项目名称:CryGame,代码行数:28,
示例3: GetLastItem//------------------------------------------------------------------------void CInventory::HolsterItem(bool holster){ //CryLogAlways("%s::HolsterItem(%s)", GetEntity()->GetName(), holster?"true":"false"); if (!holster) { if (m_stats.holsteredItemId) { IItem* pItem = m_pGameFrameWork->GetIItemSystem()->GetItem(m_stats.holsteredItemId); if(pItem && pItem->CanSelect()) { m_pGameFrameWork->GetIItemSystem()->SetActorItem(GetActor(), m_stats.holsteredItemId, false); } else { m_pGameFrameWork->GetIItemSystem()->SetActorItem(GetActor(), GetLastItem(), false); } } m_stats.holsteredItemId = 0; } else if (m_stats.currentItemId && (!m_stats.holsteredItemId || m_stats.holsteredItemId == m_stats.currentItemId)) { m_stats.holsteredItemId = m_stats.currentItemId; m_pGameFrameWork->GetIItemSystem()->SetActorItem(GetActor(), (EntityId)0, false); }}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:29,
示例4: GetActorbool Client::Disconnect(){ // Make sure the advisor system knows this client is gone. if ( isAdvisor ) { psserver->GetAdviceManager()->RemoveAdvisor( this->GetClientNum(), 0); } if (GetActor() && GetActor()->InGroup()) { GetActor()->RemoveFromGroup(); } // Only save if an account has been found for this client. if (accountID.IsValid()) { SaveAccountData(); } /*we have to clear the challenges else the other players will be stuck in challenge mode */ if(GetDuelClientCount()) { ClearAllDuelClients(); } return true;}
开发者ID:garinh,项目名称:planeshift,代码行数:28,
示例5: GetActorvoid AIBrain::Update(float dt){ if( _brainStateTable.size() == 0 ) { GetActor()->InitializeBrain(); GetActor()->StartBrain(); } if( _current == _brainStateTable.end() ) return; (*_current).second->Update(dt);}
开发者ID:CmPons,项目名称:angel2d,代码行数:13,
示例6: ADD_MESSAGEvoid unconsciousness::Terminate(bool Finished){ if(Flags & TERMINATING) return; Flags |= TERMINATING; if(GetActor()->IsPlayer()) ADD_MESSAGE("You wake up."); else if(GetActor()->CanBeSeenByPlayer()) ADD_MESSAGE("%s wakes up.", GetActor()->CHAR_NAME(DEFINITE)); action::Terminate(Finished);}
开发者ID:harmonise,项目名称:ivan-f,代码行数:14,
示例7: PickUp//------------------------------------------------------------------void CLam::PickUp(EntityId pickerId, bool sound, bool select, bool keepHistory, const char *setup){ if(gEnv->bServer && m_lamparams.giveExtraAccessory) { CActor *pActor=GetActor(pickerId); if (pActor && pActor->IsPlayer()) { IInventory *pInventory=GetActorInventory(pActor); if (pInventory) { if (!m_lamparams.isLamRifle && !pInventory->HasAccessory(CItem::sLAMFlashLight) && gEnv->bMultiplayer) m_pItemSystem->GiveItem(pActor, m_lamparams.extraAccessoryName.c_str(), false, false, false); else if(m_lamparams.isLamRifle && !pInventory->HasAccessory(CItem::sLAMRifleFlashLight) && gEnv->bMultiplayer) m_pItemSystem->GiveItem(pActor, m_lamparams.extraAccessoryName.c_str(), false, false, false); } } } //FIX-ME!! //Scout beam needs to go into the inventory like a normal item, not accessory static IEntityClass* pBeamClass = gEnv->pEntitySystem->GetClassRegistry()->FindClass("ScoutSearchBeam"); if(GetEntity()->GetClass()==pBeamClass) CItem::PickUp(pickerId,sound,select,keepHistory,setup); else CAccessory::PickUp(pickerId,sound,select,keepHistory,setup);}
开发者ID:j30206868,项目名称:NetWars_cpp,代码行数:29,
示例8: GetActor//------------------------------------------------------------------------int CScriptBind_Actor::SetInventoryAmmo(IFunctionHandler *pH, const char *ammo, int amount){ CActor * pActor = GetActor(pH); if (!pActor) return pH->EndFunction(); IInventory *pInventory=pActor->GetInventory(); if (!pInventory) return pH->EndFunction(); IEntityClass* pClass = gEnv->pEntitySystem->GetClassRegistry()->FindClass(ammo); assert(pClass); int capacity = pInventory->GetAmmoCapacity(pClass); int current = pInventory->GetAmmoCount(pClass); if((!gEnv->IsEditor()) && (amount > capacity)) { //If still there's some place, full inventory to maximum... if(current<capacity) { pInventory->SetAmmoCount(pClass,capacity); if (gEnv->bServer) pActor->GetGameObject()->InvokeRMI(CActor::ClSetAmmo(), CActor::AmmoParams(ammo, amount), eRMI_ToRemoteClients); } } else { pInventory->SetAmmoCount(pClass, amount); if (gEnv->bServer) pActor->GetGameObject()->InvokeRMI(CActor::ClSetAmmo(), CActor::AmmoParams(ammo, amount), eRMI_ToRemoteClients); } return pH->EndFunction();}
开发者ID:kitnet,项目名称:crynegine,代码行数:35,
示例9: GetWeaponPos//------------------------------------------------------------------------bool CGunTurret::IsTargetShootable(IEntity *pTarget){ // raycast shootability check Vec3 pos = m_fireHelper.empty() ? GetWeaponPos() : GetSlotHelperPos(eIGS_ThirdPerson, m_fireHelper.c_str(), true); Vec3 tpos = GetTargetPos(pTarget); Vec3 dir = tpos - pos; bool shootable = RayCheck(pTarget, pos, dir); if(!shootable) { // fallback for actors // todo: also use this for shooting pos! CActor *pActor = GetActor(pTarget->GetId()); if(pActor && pActor->GetMovementController()) { SMovementState state; pActor->GetMovementController()->GetMovementState(state); dir = state.eyePosition - pos; shootable = RayCheck(pTarget, pos, dir); } } return shootable;}
开发者ID:super-nova,项目名称:NovaRepo,代码行数:27,
示例10: GetActorbool CHeavyWeapon::CanUse(EntityId userId) const{#if USE_PC_PREMATCH if(CGameRules * pGameRules = g_pGame->GetGameRules()) { if(pGameRules->GetPrematchState() != CGameRules::ePS_Match) { return false; } }#endif //USE_PC_PREMATCH EntityId ownerId = m_owner.GetId(); if (ownerId == 0) { CActor* pActor = GetActor(userId); if (pActor && pActor->IsSwimming()) return false; if (pActor && pActor->IsPlayer() && !pActor->IsSwimming()) { bool alreadyCarringHeavyWeapon = static_cast<CPlayer*>(pActor)->HasHeavyWeaponEquipped(); if (alreadyCarringHeavyWeapon) return false; } } return m_sharedparams->params.usable && m_properties.usable;}
开发者ID:eBunny,项目名称:EmberProject,代码行数:29,
示例11: GetTargetClass//------------------------------------------------------------------------CGunTurret::ETargetClass CGunTurret::GetTargetClass(IEntity *pTarget)const{ IActor *pActor=GetActor(pTarget->GetId()); if(!pActor) { if(IsTACBullet(pTarget)) return eTC_TACProjectile; return eTC_NotATarget; } if(IsTargetDead(pActor)) return eTC_NotATarget; if(!IsTargetHostile(pActor)) return eTC_NotATarget; if(IsTargetSpectating(pActor)) return eTC_NotATarget; bool vehicle = pActor->GetLinkedVehicle()!=0; //Vehicles only check if(m_turretparams.vehicles_only && !vehicle) return eTC_NotATarget; if(vehicle) return eTC_Vehicle; if(IsTargetCloaked(pActor)) return eTC_NotATarget; return eTC_Player;}
开发者ID:super-nova,项目名称:NovaRepo,代码行数:36,
示例12: ProcessEvent void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo ) { if(eFE_Activate == event) { const bool bAttach = IsPortActive(pActInfo, EIP_ATTACH); const bool bDetach = IsPortActive(pActInfo, EIP_DETACH); if (!bAttach && !bDetach) return; IActor* pActor = GetActor(pActInfo); if (pActor == 0) return; const string& className = GetPortString(pActInfo, EIP_WEAPON); CWeapon* pWeapon = static_cast<CWeapon*> ( className.empty() ? GetWeapon(pActor) : GetWeapon(pActor, className.c_str()) ); if (pWeapon != 0) { ItemString acc = ItemString(GetPortString(pActInfo, EIP_ACCESSORY)); if (bAttach && pWeapon->GetAccessory(acc) == 0) { pWeapon->SwitchAccessory(acc); ActivateOutput(pActInfo, EOP_ATTACHED, true); } else if (bDetach && pWeapon->GetAccessory(acc) != 0) { pWeapon->SwitchAccessory(acc); ActivateOutput(pActInfo, EOP_DETACHED, true); } } } }
开发者ID:RenEvo,项目名称:dead6,代码行数:32,
示例13: GetEntity//------------------------------------------------------------------------bool CGunTurret::RayCheck(IEntity *pTarget, const Vec3 &pos, const Vec3 &dir) const{ ray_hit rayhit; IPhysicalEntity *pSkipEnts[1]; pSkipEnts[0] = GetEntity()->GetPhysics(); int nSkip = 1; //make sure you are not inside geometry when casting Vec3 newPos = pos + 0.3f*dir; if(gEnv->pPhysicalWorld->RayWorldIntersection(newPos, dir, ent_all, rwi_stop_at_pierceable|rwi_colltype_any, &rayhit, 1, pSkipEnts, nSkip)) { if(rayhit.pCollider) { IEntity *pEntity = (IEntity *)rayhit.pCollider->GetForeignData(PHYS_FOREIGN_ID_ENTITY); if(pEntity==pTarget) return true; else if(CActor *pActor = GetActor(pTarget->GetId())) { IVehicle *pLinkedVehicle=pActor->GetLinkedVehicle(); if(pLinkedVehicle && pLinkedVehicle->GetEntity()==pEntity) return true; } } return false; } return true;}
开发者ID:super-nova,项目名称:NovaRepo,代码行数:32,
示例14: GetActorbool CJaw::CanPickUp(EntityId userId) const{ CActor *pActor = GetActor(userId); IInventory *pInventory=GetActorInventory(pActor); if (m_sharedparams->params.pickable && m_stats.pickable && !m_stats.flying && (!m_owner.GetId() || m_owner.GetId()==userId) && !m_stats.selected && !GetEntity()->IsHidden()) { if (pInventory && pInventory->FindItem(GetEntityId())!=-1) return false; } else return false; if(GetAmmoCount(m_fm->GetAmmoType())<=0) { return false; } uint8 uniqueId = m_pItemSystem->GetItemUniqueId(GetEntity()->GetClass()->GetName()); int maxNumRockets = GetWeaponSharedParams()->ammoParams.capacityAmmo[0].count; if(pInventory && (pInventory->GetCountOfUniqueId(uniqueId)>=maxNumRockets)) { if(pActor->IsClient()) { SHUDEventWrapper::DisplayInfo(eInfo_Warning, 0.5f, "@mp_CannotCarryMoreLAW"); } return false; } return true; }
开发者ID:amrhead,项目名称:eaascode,代码行数:34,
示例15: GetActor//------------------------------------------------------------------------int CScriptBind_Actor::CheckVirtualInventoryRestrictions(IFunctionHandler *pH, SmartScriptTable inventory, const char *itemClassName){ CActor *pActor = GetActor(pH); if (!pActor) return pH->EndFunction(); static std::vector<string> virtualInventory; virtualInventory.reserve(inventory->Count()); IScriptTable::Iterator it=inventory->BeginIteration(); while(inventory->MoveNext(it)) { const char *itemClass=0; it.value.CopyTo(itemClass); if (itemClass && itemClass[0]) virtualInventory.push_back(itemClass); } inventory->EndIteration(it); bool result=pActor->CheckVirtualInventoryRestrictions(virtualInventory, itemClassName); virtualInventory.resize(0); if (result) return pH->EndFunction(1); return pH->EndFunction();}
开发者ID:mrwonko,项目名称:CrysisVR,代码行数:30,
示例16: GetActorint NFCAsyMysqlClusterModule::ApplyRequest(NF_SHARE_PTR<SMysqlParam> pParam){ NFIActorManager* pActorManager = pPluginManager->GetActorManager(); if (NULL == pActorManager) { return -1; } int nAcotrID = GetActor(); if (nAcotrID <= 0) { return -2; } std::string arg; const int nEvetID = ACOTERMYSQLEVENT_USEDB; if (!pParam->PackParam(arg)) { return -3; } if (!mReqList.AddElement(pParam->nReqID, pParam)) { return -4; } if (!pActorManager->SendMsgToActor(nAcotrID, pParam->self, nEvetID, arg)) { mReqList.RemoveElement(pParam->nReqID); return -5; } return 0;}
开发者ID:715703148,项目名称:NoahGameFrame,代码行数:35,
示例17: GetActor//=========================================bool CRocketLauncher::CanPickUp(EntityId userId) const{ CActor *pActor = GetActor(userId); IInventory *pInventory=GetActorInventory(pActor); if (m_sharedparams->params.pickable && m_stats.pickable && !m_stats.flying && !m_frozen &&(!m_ownerId || m_ownerId==userId) && !m_stats.selected && !GetEntity()->IsHidden()) { if (pInventory && pInventory->FindItem(GetEntityId())!=-1) return false; } else return false; uint8 uniqueId = m_pItemSystem->GetItemUniqueId(GetEntity()->GetClass()->GetName()); //Can not pick up a LAW while I have one already if(pInventory && (pInventory->GetCountOfUniqueId(uniqueId)>0)) { if(pActor->IsClient()) g_pGame->GetGameRules()->OnTextMessage(eTextMessageCenter, "@mp_CannotCarryMoreLAW"); return false; } return true; }
开发者ID:nhnam,项目名称:Seasons,代码行数:27,
示例18: IMPLEMENT_RMI// RMI receiver in the server to remove all items from the inventory. changes are automatically propagated to the clientsIMPLEMENT_RMI(CInventory, SvReq_RemoveAllItems){ IItemSystem* pItemSystem = CCryAction::GetCryAction()->GetIItemSystem(); IItem* pItem = pItemSystem->GetItem( GetCurrentItem() ); if (pItem) { pItem->Select(false); pItemSystem->SetActorItem( GetActor(), (EntityId)0, false ); } Destroy(); if (gEnv->bMultiplayer) { TRMIInventory_Dummy Info; GetGameObject()->InvokeRMI( Cl_RemoveAllAmmo(), Info, eRMI_ToAllClients); } else { ResetAmmo(); } return true;}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:26,
示例19: GetActorbool CHeavyMountedWeapon::CanUse(EntityId userId) const{ EntityId ownerId = m_owner.GetId(); if (m_rippedOff) { CActor* pActor = GetActor(userId); if (pActor && pActor->IsSwimming()) return false; if (ownerId == 0 || ownerId == userId) return true; } else if(IActor* pActor = gEnv->pGame->GetIGameFramework()->GetIActorSystem()->GetActor(userId)) { IItem* pItem = pActor->GetCurrentItem(false); if(pItem) { if(pItem->IsBusy()) { return false; } if(IWeapon* pWeapon = pItem->GetIWeapon()) { if(pWeapon->IsReloading()) { return false; } } } } return BaseClass::CanUse(userId);}
开发者ID:Xydrel,项目名称:Infected,代码行数:34,
示例20: GetActorvoid WindowGlobalChild::HandleAsyncMessage(const nsString& aActorName, const nsString& aMessageName, StructuredCloneData& aData) { if (NS_WARN_IF(mIPCClosed)) { return; } // Force creation of the actor if it hasn't been created yet. IgnoredErrorResult rv; RefPtr<JSWindowActorChild> actor = GetActor(aActorName, rv); if (NS_WARN_IF(rv.Failed())) { return; } // Get the JSObject for the named actor. JS::RootedObject obj(RootingCx(), actor->GetWrapper()); if (NS_WARN_IF(!obj)) { // If we don't have a preserved wrapper, there won't be any receiver // method to call. return; } RefPtr<JSWindowActorService> actorSvc = JSWindowActorService::GetSingleton(); if (NS_WARN_IF(!actorSvc)) { return; } actorSvc->ReceiveMessage(actor, obj, aMessageName, aData);}
开发者ID:jasonLaster,项目名称:gecko-dev,代码行数:29,
示例21: GetActorvoid consume::Terminate(bool Finished){ if(Flags & TERMINATING) return; Flags |= TERMINATING; item* Consuming = game::SearchItem(ConsumingID); character* Actor = GetActor(); if(Actor->IsPlayer()) ADD_MESSAGE("You %s %s.", Finished ? "finish" : "stop", Description.CStr()); else if(Actor->CanBeSeenByPlayer()) ADD_MESSAGE("%s %s %s.", Actor->CHAR_NAME(DEFINITE), Finished ? "finishes" : "stops", Description.CStr()); if(Finished) { if(Consuming->Exists() && !game::IsInWilderness() && (!Actor->IsPlayer() || ivanconfig::GetAutoDropLeftOvers())) { Consuming->RemoveFromSlot(); Actor->GetStackUnder()->AddItem(Consuming); Actor->DexterityAction(2); } } else if(Consuming && Consuming->Exists()) { material* ConsumeMaterial = Consuming->GetConsumeMaterial(Actor); if(ConsumeMaterial) ConsumeMaterial->FinishConsuming(Actor); } action::Terminate(Finished);}
开发者ID:harmonise,项目名称:ivan-f,代码行数:33,
示例22: pResponseHttpEventvoid RemoteNetworkView::GenerateNewPositionActor(IEventDataPtr pEventData) { char response[4]; std::string httpinmsg; IEventDataPtr pResponseHttpEvent(CREATE_EVENT(EventData_ResponseHTTP::sk_EventType)); std::shared_ptr<EventData_GetNewPositionActor> pCastEventData = std::static_pointer_cast<EventData_GetNewPositionActor>(pEventData); std::string name = pCastEventData->VGetActorName(); unsigned int ip = pCastEventData->VGetIp(); //look for actor data in actor manager by ip / actor name StrongActorPtr pActor = m_ActorManager->GetActorByName(ip, name); if (pActor == NULL) { _itoa_s(http_response_code_t::NOTFOUND, response, 10); httpinmsg.append(response); std::istrstream in(httpinmsg.c_str(), httpinmsg.size()); pResponseHttpEvent->VDeserialize(in); IEventManager::Get()->VTriggerEvent(pResponseHttpEvent); return; } // calculate new coord random (great AI !) int random = rand(); Vec3 newPosition; newPosition.x = random % 512; newPosition.y = random % 480; newPosition.z = 0; pActor->SetPosition(newPosition); // send back all data GetActor(pEventData);}
开发者ID:amoscovitz,项目名称:samplegameserver,代码行数:33,
示例23: GetClassint Game_Actor::GetBattleAnimationId() const { if (Player::IsRPG2k()) { return 0; } int anim = 0; if (GetData().battler_animation <= 0) { // Earlier versions of EasyRPG didn't save this value correctly // The battle animation of the class only matters when the class was // changed by event "Change Class" if ((GetData().class_id > 0) && GetClass()) { anim = GetClass()->battler_animation; } else { const RPG::BattlerAnimation* anima = ReaderUtil::GetElement(Data::battleranimations, GetActor().battler_animation); if (!anima) { Output::Warning("Actor %d: Invalid battle animation ID %d", GetId(), GetActor().battler_animation); return 0; } anim = anima->ID; } } else { anim = GetData().battler_animation; } if (anim == 0) { // Chunk was missing, set to proper default return 1; } return anim;}
开发者ID:Ghabry,项目名称:easyrpg-player,代码行数:34,
示例24: AddAsActor2Listener void AddAsActor2Listener() { CActor2* pActor = GetActor( m_smartObjectId ); if (pActor) { pActor->RegisterListener( this ); } }
开发者ID:aronarts,项目名称:FireNET,代码行数:8,
注:本文中的GetActor函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetActorForwardVector函数代码示例 C++ GetActivity函数代码示例 |