std::shared_ptr<MWWorld::Action> Armor::use (const MWWorld::Ptr& ptr, bool force) const { std::shared_ptr<MWWorld::Action> action(new MWWorld::ActionEquip(ptr, force)); action->setSound(getUpSoundId(ptr)); return action; }
boost::shared_ptr<MWWorld::Action> Light::use (const MWWorld::Ptr& ptr) const { boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionEquip(ptr)); action->setSound(getUpSoundId(ptr)); return action; }
std::shared_ptr<MWWorld::Action> Clothing::use (const MWWorld::Ptr& ptr) const { std::shared_ptr<MWWorld::Action> action(new MWWorld::ActionEquip(ptr)); action->setSound(getUpSoundId(ptr)); return action; }
boost::shared_ptr<MWWorld::Action> Probe::activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const { MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWSound::Play_NoTrack); return boost::shared_ptr<MWWorld::Action> ( new MWWorld::ActionTake (ptr)); }
boost::shared_ptr<MWWorld::Action> Weapon::activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor, const MWWorld::Environment& environment) const { environment.mSoundManager->playSound3D (ptr, getUpSoundId(ptr, environment), 1.0, 1.0, false, true); return boost::shared_ptr<MWWorld::Action> ( new MWWorld::ActionTake (ptr)); }
boost::shared_ptr<MWWorld::Action> Lockpick::activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const { boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTake (ptr)); action->setSound(getUpSoundId(ptr)); return action; }
boost::shared_ptr<MWWorld::Action> Armor::activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const { if (!MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory)) return boost::shared_ptr<MWWorld::Action> (new MWWorld::NullAction ()); boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTake (ptr)); action->setSound(getUpSoundId(ptr)); return action; }
boost::shared_ptr<MWWorld::Action> Light::activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const { MWWorld::LiveCellRef<ESM::Light> *ref = ptr.get<ESM::Light>(); if (!(ref->base->data.flags & ESM::Light::Carry)) return boost::shared_ptr<MWWorld::Action> (new MWWorld::NullAction); MWBase::Environment::get().getSoundManager()->playSound3D (ptr, getUpSoundId(ptr), 1.0, 1.0, MWSound::Play_NoTrack); return boost::shared_ptr<MWWorld::Action> ( new MWWorld::ActionTake (ptr)); }
boost::shared_ptr<MWWorld::Action> Light::activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const { if (!MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory)) return boost::shared_ptr<MWWorld::Action> (new MWWorld::NullAction ()); MWWorld::LiveCellRef<ESM::Light> *ref = ptr.get<ESM::Light>(); if (!(ref->mBase->mData.mFlags & ESM::Light::Carry)) return boost::shared_ptr<MWWorld::Action> (new MWWorld::FailedAction); boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionTake (ptr)); action->setSound(getUpSoundId(ptr)); return action; }
boost::shared_ptr<Action> Class::defaultItemActivate(const Ptr &ptr, const Ptr &actor) const { if(!MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory)) return boost::shared_ptr<Action>(new NullAction()); if(actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf()) { const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); const ESM::Sound *sound = store.get<ESM::Sound>().searchRandom("WolfItem"); boost::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction("#{sWerewolfRefusal}")); if(sound) action->setSound(sound->mId); return action; } boost::shared_ptr<MWWorld::Action> action(new ActionTake(ptr)); action->setSound(getUpSoundId(ptr)); return action; }
boost::shared_ptr<MWWorld::Action> Light::use (const MWWorld::Ptr& ptr) const { MWBase::Environment::get().getSoundManager()->playSound (getUpSoundId(ptr), 1.0, 1.0); return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionEquip(ptr)); }