2010-08-03 09:14:57 +00:00
|
|
|
#include "class.hpp"
|
|
|
|
|
|
|
|
#include <stdexcept>
|
|
|
|
|
2012-07-25 13:18:17 +00:00
|
|
|
#include <components/esm/defs.hpp>
|
|
|
|
|
2013-08-09 05:34:53 +00:00
|
|
|
#include "../mwbase/environment.hpp"
|
|
|
|
#include "../mwbase/windowmanager.hpp"
|
2013-08-11 07:35:19 +00:00
|
|
|
#include "../mwbase/world.hpp"
|
2014-12-19 10:26:54 +00:00
|
|
|
#include "../mwworld/esmstore.hpp"
|
2013-08-09 05:34:53 +00:00
|
|
|
|
2010-08-03 09:49:12 +00:00
|
|
|
#include "ptr.hpp"
|
2012-07-25 13:18:17 +00:00
|
|
|
#include "refdata.hpp"
|
2010-08-03 16:20:15 +00:00
|
|
|
#include "nullaction.hpp"
|
2013-08-09 05:34:53 +00:00
|
|
|
#include "failedaction.hpp"
|
|
|
|
#include "actiontake.hpp"
|
2012-02-20 11:44:17 +00:00
|
|
|
#include "containerstore.hpp"
|
2010-08-03 09:49:12 +00:00
|
|
|
|
2012-07-03 11:15:20 +00:00
|
|
|
#include "../mwgui/tooltips.hpp"
|
2013-08-09 05:34:53 +00:00
|
|
|
|
2013-07-25 15:15:42 +00:00
|
|
|
#include "../mwmechanics/creaturestats.hpp"
|
2013-08-09 05:34:53 +00:00
|
|
|
#include "../mwmechanics/npcstats.hpp"
|
2013-07-25 15:15:42 +00:00
|
|
|
#include "../mwmechanics/magiceffects.hpp"
|
2012-07-03 11:15:20 +00:00
|
|
|
|
2010-08-03 09:14:57 +00:00
|
|
|
namespace MWWorld
|
|
|
|
{
|
|
|
|
std::map<std::string, boost::shared_ptr<Class> > Class::sClasses;
|
|
|
|
|
|
|
|
Class::Class() {}
|
|
|
|
|
|
|
|
Class::~Class() {}
|
|
|
|
|
2015-01-12 10:29:56 +00:00
|
|
|
void Class::insertObjectRendering (const Ptr& ptr, const std::string& mesh, MWRender::RenderingInterface& renderingInterface) const
|
2010-08-14 07:20:47 +00:00
|
|
|
{
|
|
|
|
|
2011-11-09 23:06:55 +00:00
|
|
|
}
|
2012-04-08 17:44:11 +00:00
|
|
|
|
2015-05-09 23:09:00 +00:00
|
|
|
void Class::insertObject(const Ptr& ptr, const std::string& mesh, MWPhysics::PhysicsSystem& physics) const
|
2012-04-08 17:44:11 +00:00
|
|
|
{
|
2011-11-09 23:06:55 +00:00
|
|
|
|
2010-08-14 07:20:47 +00:00
|
|
|
}
|
|
|
|
|
2012-07-13 06:50:46 +00:00
|
|
|
bool Class::apply (const MWWorld::Ptr& ptr, const std::string& id, const MWWorld::Ptr& actor) const
|
2012-06-24 14:23:43 +00:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2014-09-25 10:25:57 +00:00
|
|
|
void Class::skillUsageSucceeded (const MWWorld::Ptr& ptr, int skill, int usageType, float extraFactor) const
|
2012-07-13 07:03:17 +00:00
|
|
|
{
|
|
|
|
throw std::runtime_error ("class does not represent an actor");
|
|
|
|
}
|
|
|
|
|
2015-12-18 14:58:23 +00:00
|
|
|
bool Class::canSell (const MWWorld::ConstPtr& item, int npcServices) const
|
2013-04-07 19:38:53 +00:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-12-18 15:44:35 +00:00
|
|
|
int Class::getServices(const ConstPtr &actor) const
|
2013-05-11 16:38:27 +00:00
|
|
|
{
|
|
|
|
throw std::runtime_error ("class does not have services");
|
|
|
|
}
|
|
|
|
|
2010-08-03 09:49:12 +00:00
|
|
|
MWMechanics::CreatureStats& Class::getCreatureStats (const Ptr& ptr) const
|
|
|
|
{
|
|
|
|
throw std::runtime_error ("class does not have creature stats");
|
|
|
|
}
|
|
|
|
|
2010-08-19 10:49:13 +00:00
|
|
|
MWMechanics::NpcStats& Class::getNpcStats (const Ptr& ptr) const
|
|
|
|
{
|
|
|
|
throw std::runtime_error ("class does not have NPC stats");
|
|
|
|
}
|
|
|
|
|
2015-12-18 15:06:31 +00:00
|
|
|
bool Class::hasItemHealth (const ConstPtr& ptr) const
|
2010-08-03 12:14:04 +00:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-12-18 14:27:06 +00:00
|
|
|
int Class::getItemHealth(const ConstPtr &ptr) const
|
2014-05-25 12:13:07 +00:00
|
|
|
{
|
|
|
|
if (ptr.getCellRef().getCharge() == -1)
|
|
|
|
return getItemMaxHealth(ptr);
|
|
|
|
else
|
|
|
|
return ptr.getCellRef().getCharge();
|
|
|
|
}
|
|
|
|
|
2015-12-18 14:27:06 +00:00
|
|
|
int Class::getItemMaxHealth (const ConstPtr& ptr) const
|
2010-08-03 12:14:04 +00:00
|
|
|
{
|
|
|
|
throw std::runtime_error ("class does not have item health");
|
|
|
|
}
|
|
|
|
|
2015-06-26 03:15:07 +00:00
|
|
|
void Class::hit(const Ptr& ptr, float attackStrength, int type) const
|
2013-07-24 09:51:42 +00:00
|
|
|
{
|
2013-07-25 07:30:01 +00:00
|
|
|
throw std::runtime_error("class cannot hit");
|
2013-07-24 09:51:42 +00:00
|
|
|
}
|
|
|
|
|
2014-01-21 00:01:21 +00:00
|
|
|
void Class::block(const Ptr &ptr) const
|
|
|
|
{
|
|
|
|
throw std::runtime_error("class cannot block");
|
|
|
|
}
|
|
|
|
|
2013-07-28 13:48:25 +00:00
|
|
|
void Class::onHit(const Ptr& ptr, float damage, bool ishealth, const Ptr& object, const Ptr& attacker, bool successful) const
|
2013-07-26 10:21:54 +00:00
|
|
|
{
|
|
|
|
throw std::runtime_error("class cannot be hit");
|
|
|
|
}
|
|
|
|
|
2012-04-23 13:27:03 +00:00
|
|
|
boost::shared_ptr<Action> Class::activate (const Ptr& ptr, const Ptr& actor) const
|
2010-08-03 16:20:15 +00:00
|
|
|
{
|
|
|
|
return boost::shared_ptr<Action> (new NullAction);
|
|
|
|
}
|
|
|
|
|
2012-04-23 13:27:03 +00:00
|
|
|
boost::shared_ptr<Action> Class::use (const Ptr& ptr) const
|
2010-08-03 16:20:15 +00:00
|
|
|
{
|
|
|
|
return boost::shared_ptr<Action> (new NullAction);
|
|
|
|
}
|
|
|
|
|
2012-01-28 10:45:55 +00:00
|
|
|
ContainerStore& Class::getContainerStore (const Ptr& ptr) const
|
2010-08-04 12:37:23 +00:00
|
|
|
{
|
|
|
|
throw std::runtime_error ("class does not have a container store");
|
2010-08-06 20:20:20 +00:00
|
|
|
}
|
|
|
|
|
2012-03-10 11:49:54 +00:00
|
|
|
InventoryStore& Class::getInventoryStore (const Ptr& ptr) const
|
|
|
|
{
|
|
|
|
throw std::runtime_error ("class does not have an inventory store");
|
|
|
|
}
|
|
|
|
|
2014-01-19 10:42:58 +00:00
|
|
|
bool Class::hasInventoryStore(const Ptr &ptr) const
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2010-08-30 09:56:55 +00:00
|
|
|
void Class::lock (const Ptr& ptr, int lockLevel) const
|
|
|
|
{
|
|
|
|
throw std::runtime_error ("class does not support locking");
|
|
|
|
}
|
|
|
|
|
|
|
|
void Class::unlock (const Ptr& ptr) const
|
|
|
|
{
|
|
|
|
throw std::runtime_error ("class does not support unlocking");
|
|
|
|
}
|
|
|
|
|
2015-12-18 15:50:32 +00:00
|
|
|
bool Class::canLock(const ConstPtr &ptr) const
|
2015-08-04 15:33:34 +00:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2013-10-15 19:23:42 +00:00
|
|
|
void Class::setRemainingUsageTime (const Ptr& ptr, float duration) const
|
|
|
|
{
|
2013-10-16 19:14:35 +00:00
|
|
|
throw std::runtime_error ("class does not support time-based uses");
|
2013-10-15 19:23:42 +00:00
|
|
|
}
|
|
|
|
|
2015-12-18 14:27:06 +00:00
|
|
|
float Class::getRemainingUsageTime (const ConstPtr& ptr) const
|
2013-10-15 19:23:42 +00:00
|
|
|
{
|
2013-12-16 12:31:03 +00:00
|
|
|
return -1;
|
2013-10-15 19:23:42 +00:00
|
|
|
}
|
|
|
|
|
2015-12-17 23:12:03 +00:00
|
|
|
std::string Class::getScript (const ConstPtr& ptr) const
|
2010-08-05 13:40:03 +00:00
|
|
|
{
|
|
|
|
return "";
|
2010-08-04 12:37:23 +00:00
|
|
|
}
|
|
|
|
|
2011-01-18 09:45:29 +00:00
|
|
|
float Class::getSpeed (const Ptr& ptr) const
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-02-24 11:30:33 +00:00
|
|
|
float Class::getJump (const Ptr& ptr) const
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-12-18 15:48:19 +00:00
|
|
|
int Class::getEnchantmentPoints (const MWWorld::ConstPtr& ptr) const
|
2013-03-16 18:00:14 +00:00
|
|
|
{
|
|
|
|
throw std::runtime_error ("class does not support enchanting");
|
|
|
|
}
|
|
|
|
|
2011-02-03 10:37:17 +00:00
|
|
|
MWMechanics::Movement& Class::getMovementSettings (const Ptr& ptr) const
|
|
|
|
{
|
|
|
|
throw std::runtime_error ("movement settings not supported by class");
|
|
|
|
}
|
|
|
|
|
2015-06-03 17:41:19 +00:00
|
|
|
osg::Vec3f Class::getRotationVector (const Ptr& ptr) const
|
2013-03-31 08:29:24 +00:00
|
|
|
{
|
2015-06-03 17:41:19 +00:00
|
|
|
return osg::Vec3f (0, 0, 0);
|
2013-03-31 08:29:24 +00:00
|
|
|
}
|
|
|
|
|
2015-12-18 15:06:31 +00:00
|
|
|
std::pair<std::vector<int>, bool> Class::getEquipmentSlots (const ConstPtr& ptr) const
|
2012-03-13 12:45:50 +00:00
|
|
|
{
|
|
|
|
return std::make_pair (std::vector<int>(), false);
|
|
|
|
}
|
|
|
|
|
2015-12-18 14:27:06 +00:00
|
|
|
int Class::getEquipmentSkill (const ConstPtr& ptr) const
|
2012-03-13 13:12:07 +00:00
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2015-12-18 14:27:06 +00:00
|
|
|
int Class::getValue (const ConstPtr& ptr) const
|
2012-04-07 17:53:49 +00:00
|
|
|
{
|
|
|
|
throw std::logic_error ("value not supported by this class");
|
|
|
|
}
|
|
|
|
|
2012-05-15 20:31:52 +00:00
|
|
|
float Class::getCapacity (const MWWorld::Ptr& ptr) const
|
2012-05-15 19:17:00 +00:00
|
|
|
{
|
2012-05-15 19:34:00 +00:00
|
|
|
throw std::runtime_error ("capacity not supported by this class");
|
|
|
|
}
|
|
|
|
|
2015-12-18 15:00:50 +00:00
|
|
|
float Class::getWeight(const ConstPtr &ptr) const
|
2013-05-11 16:38:27 +00:00
|
|
|
{
|
|
|
|
throw std::runtime_error ("weight not supported by this class");
|
|
|
|
}
|
|
|
|
|
2012-05-15 19:34:00 +00:00
|
|
|
float Class::getEncumbrance (const MWWorld::Ptr& ptr) const
|
|
|
|
{
|
|
|
|
throw std::runtime_error ("encumbrance not supported by class");
|
2012-05-15 19:17:00 +00:00
|
|
|
}
|
|
|
|
|
2015-12-18 15:39:35 +00:00
|
|
|
bool Class::isEssential (const MWWorld::ConstPtr& ptr) const
|
2012-10-27 11:33:54 +00:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2013-03-17 21:29:12 +00:00
|
|
|
float Class::getArmorRating (const MWWorld::Ptr& ptr) const
|
|
|
|
{
|
|
|
|
throw std::runtime_error("Class does not support armor rating");
|
|
|
|
}
|
|
|
|
|
2010-08-03 09:14:57 +00:00
|
|
|
const Class& Class::get (const std::string& key)
|
|
|
|
{
|
2013-03-31 08:16:02 +00:00
|
|
|
if (key.empty())
|
|
|
|
throw std::logic_error ("Class::get(): attempting to get an empty key");
|
|
|
|
|
2010-08-03 09:14:57 +00:00
|
|
|
std::map<std::string, boost::shared_ptr<Class> >::const_iterator iter = sClasses.find (key);
|
|
|
|
|
|
|
|
if (iter==sClasses.end())
|
2013-03-31 08:16:02 +00:00
|
|
|
throw std::logic_error ("Class::get(): unknown class key: " + key);
|
2010-08-03 09:14:57 +00:00
|
|
|
|
|
|
|
return *iter->second;
|
|
|
|
}
|
|
|
|
|
2015-12-18 15:41:37 +00:00
|
|
|
bool Class::isPersistent(const ConstPtr &ptr) const
|
2013-05-16 16:50:26 +00:00
|
|
|
{
|
|
|
|
throw std::runtime_error ("class does not support persistence");
|
|
|
|
}
|
|
|
|
|
2013-08-16 11:18:48 +00:00
|
|
|
void Class::registerClass(const std::string& key, boost::shared_ptr<Class> instance)
|
2010-08-03 09:14:57 +00:00
|
|
|
{
|
2013-08-16 11:18:48 +00:00
|
|
|
instance->mTypeName = key;
|
|
|
|
sClasses.insert(std::make_pair(key, instance));
|
2010-08-03 09:14:57 +00:00
|
|
|
}
|
2012-03-13 16:05:38 +00:00
|
|
|
|
2015-12-18 15:09:08 +00:00
|
|
|
std::string Class::getUpSoundId (const ConstPtr& ptr) const
|
2012-03-13 16:05:38 +00:00
|
|
|
{
|
|
|
|
throw std::runtime_error ("class does not have an up sound");
|
|
|
|
}
|
|
|
|
|
2015-12-18 15:09:08 +00:00
|
|
|
std::string Class::getDownSoundId (const ConstPtr& ptr) const
|
2012-03-13 16:05:38 +00:00
|
|
|
{
|
|
|
|
throw std::runtime_error ("class does not have an down sound");
|
|
|
|
}
|
2012-04-15 18:56:45 +00:00
|
|
|
|
2013-07-18 06:58:21 +00:00
|
|
|
std::string Class::getSoundIdFromSndGen(const Ptr &ptr, const std::string &type) const
|
|
|
|
{
|
|
|
|
throw std::runtime_error("class does not support soundgen look up");
|
|
|
|
}
|
2012-05-11 08:40:40 +00:00
|
|
|
|
2015-12-18 14:53:47 +00:00
|
|
|
std::string Class::getInventoryIcon (const MWWorld::ConstPtr& ptr) const
|
2012-04-15 18:56:45 +00:00
|
|
|
{
|
|
|
|
throw std::runtime_error ("class does not have any inventory icon");
|
|
|
|
}
|
2012-05-11 08:40:40 +00:00
|
|
|
|
2015-12-18 14:27:06 +00:00
|
|
|
MWGui::ToolTipInfo Class::getToolTipInfo (const ConstPtr& ptr) const
|
2012-04-16 17:30:52 +00:00
|
|
|
{
|
|
|
|
throw std::runtime_error ("class does not have a tool tip");
|
|
|
|
}
|
|
|
|
|
2012-04-16 17:34:46 +00:00
|
|
|
bool Class::hasToolTip (const Ptr& ptr) const
|
2012-04-16 17:30:52 +00:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2012-05-12 14:17:03 +00:00
|
|
|
|
2015-12-18 14:56:45 +00:00
|
|
|
std::string Class::getEnchantment (const ConstPtr& ptr) const
|
2012-05-12 14:17:03 +00:00
|
|
|
{
|
|
|
|
return "";
|
|
|
|
}
|
2012-05-21 08:58:04 +00:00
|
|
|
|
2015-12-18 15:46:02 +00:00
|
|
|
void Class::adjustScale(const MWWorld::ConstPtr& ptr, osg::Vec3f& scale, bool rendering) const
|
2012-05-21 08:58:04 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2015-12-18 14:51:05 +00:00
|
|
|
std::string Class::getModel(const MWWorld::ConstPtr &ptr) const
|
2012-07-24 14:52:08 +00:00
|
|
|
{
|
|
|
|
return "";
|
|
|
|
}
|
2012-07-25 13:18:17 +00:00
|
|
|
|
2015-12-18 15:43:11 +00:00
|
|
|
std::string Class::applyEnchantment(const MWWorld::ConstPtr &ptr, const std::string& enchId, int enchCharge, const std::string& newName) const
|
2013-03-28 16:41:00 +00:00
|
|
|
{
|
|
|
|
throw std::runtime_error ("class can't be enchanted");
|
|
|
|
}
|
|
|
|
|
2015-12-18 15:06:31 +00:00
|
|
|
std::pair<int, std::string> Class::canBeEquipped(const MWWorld::ConstPtr &ptr, const MWWorld::Ptr &npc) const
|
2013-04-05 13:42:05 +00:00
|
|
|
{
|
2013-04-15 00:56:23 +00:00
|
|
|
return std::make_pair (1, "");
|
2013-04-05 13:42:05 +00:00
|
|
|
}
|
|
|
|
|
2014-07-31 02:24:45 +00:00
|
|
|
void Class::adjustPosition(const MWWorld::Ptr& ptr, bool force) const
|
2013-04-03 21:55:57 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-08-09 05:34:53 +00:00
|
|
|
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());
|
|
|
|
|
2014-05-22 18:37:22 +00:00
|
|
|
if(actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf())
|
2013-08-09 05:34:53 +00:00
|
|
|
{
|
2013-08-11 07:35:19 +00:00
|
|
|
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
|
|
|
const ESM::Sound *sound = store.get<ESM::Sound>().searchRandom("WolfItem");
|
|
|
|
|
2013-08-09 05:34:53 +00:00
|
|
|
boost::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction("#{sWerewolfRefusal}"));
|
2013-08-11 07:35:19 +00:00
|
|
|
if(sound) action->setSound(sound->mId);
|
|
|
|
|
2013-08-09 05:34:53 +00:00
|
|
|
return action;
|
|
|
|
}
|
|
|
|
|
|
|
|
boost::shared_ptr<MWWorld::Action> action(new ActionTake(ptr));
|
|
|
|
action->setSound(getUpSoundId(ptr));
|
|
|
|
|
|
|
|
return action;
|
|
|
|
}
|
|
|
|
|
2012-07-25 13:18:17 +00:00
|
|
|
MWWorld::Ptr
|
2015-12-18 15:24:24 +00:00
|
|
|
Class::copyToCellImpl(const ConstPtr &ptr, CellStore &cell) const
|
2012-07-25 13:18:17 +00:00
|
|
|
{
|
2015-12-18 15:24:24 +00:00
|
|
|
throw std::runtime_error("unable to copy class to cell");
|
2012-07-25 13:18:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
MWWorld::Ptr
|
2015-12-18 15:24:24 +00:00
|
|
|
Class::copyToCell(const ConstPtr &ptr, CellStore &cell) const
|
2012-07-25 13:18:17 +00:00
|
|
|
{
|
2012-07-26 12:14:11 +00:00
|
|
|
Ptr newPtr = copyToCellImpl(ptr, cell);
|
2014-08-30 16:25:13 +00:00
|
|
|
newPtr.getCellRef().unsetRefNum(); // This RefNum is only valid within the original cell of the reference
|
2012-07-25 13:18:17 +00:00
|
|
|
return newPtr;
|
|
|
|
}
|
|
|
|
|
|
|
|
MWWorld::Ptr
|
2015-12-18 15:24:24 +00:00
|
|
|
Class::copyToCell(const ConstPtr &ptr, CellStore &cell, const ESM::Position &pos) const
|
2012-07-25 13:18:17 +00:00
|
|
|
{
|
2012-07-26 12:14:11 +00:00
|
|
|
Ptr newPtr = copyToCell(ptr, cell);
|
2014-06-14 15:56:41 +00:00
|
|
|
newPtr.getRefData().setPosition(pos);
|
2012-07-25 13:18:17 +00:00
|
|
|
|
|
|
|
return newPtr;
|
|
|
|
}
|
2014-01-05 14:38:12 +00:00
|
|
|
|
2015-12-18 15:15:40 +00:00
|
|
|
bool Class::isBipedal(const ConstPtr &ptr) const
|
2014-03-15 21:09:14 +00:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-12-18 15:16:45 +00:00
|
|
|
bool Class::canFly(const ConstPtr &ptr) const
|
2014-03-15 21:09:14 +00:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-12-18 15:16:45 +00:00
|
|
|
bool Class::canSwim(const ConstPtr &ptr) const
|
2014-03-15 21:09:14 +00:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-12-18 15:16:45 +00:00
|
|
|
bool Class::canWalk(const ConstPtr &ptr) const
|
2014-01-05 14:38:12 +00:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-01-09 08:40:53 +00:00
|
|
|
bool Class::isPureWaterCreature(const MWWorld::Ptr& ptr) const
|
|
|
|
{
|
|
|
|
return canSwim(ptr) && !canWalk(ptr);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Class::isMobile(const MWWorld::Ptr& ptr) const
|
|
|
|
{
|
|
|
|
return canSwim(ptr) || canWalk(ptr) || canFly(ptr);
|
|
|
|
}
|
|
|
|
|
2014-01-15 14:50:45 +00:00
|
|
|
int Class::getSkill(const MWWorld::Ptr& ptr, int skill) const
|
|
|
|
{
|
|
|
|
throw std::runtime_error("class does not support skills");
|
|
|
|
}
|
|
|
|
|
2015-12-18 15:38:14 +00:00
|
|
|
int Class::getBloodTexture (const MWWorld::ConstPtr& ptr) const
|
2014-01-17 09:52:44 +00:00
|
|
|
{
|
|
|
|
throw std::runtime_error("class does not support gore");
|
|
|
|
}
|
2014-01-30 10:50:13 +00:00
|
|
|
|
|
|
|
void Class::readAdditionalState (const MWWorld::Ptr& ptr, const ESM::ObjectState& state) const {}
|
|
|
|
|
2015-12-17 23:18:06 +00:00
|
|
|
void Class::writeAdditionalState (const MWWorld::ConstPtr& ptr, ESM::ObjectState& state) const {}
|
2014-03-28 18:21:38 +00:00
|
|
|
|
2015-12-18 15:28:20 +00:00
|
|
|
int Class::getBaseGold(const MWWorld::ConstPtr& ptr) const
|
2014-03-28 21:27:23 +00:00
|
|
|
{
|
|
|
|
throw std::runtime_error("class does not support base gold");
|
|
|
|
}
|
2014-04-01 18:15:55 +00:00
|
|
|
|
2015-12-18 15:29:30 +00:00
|
|
|
bool Class::isClass(const MWWorld::ConstPtr& ptr, const std::string &className) const
|
2014-04-01 18:15:55 +00:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2014-05-14 23:58:44 +00:00
|
|
|
|
2015-12-19 14:57:37 +00:00
|
|
|
int Class::getDoorState (const MWWorld::ConstPtr &ptr) const
|
2014-05-14 23:58:44 +00:00
|
|
|
{
|
|
|
|
throw std::runtime_error("this is not a door");
|
|
|
|
}
|
|
|
|
|
|
|
|
void Class::setDoorState (const MWWorld::Ptr &ptr, int state) const
|
|
|
|
{
|
|
|
|
throw std::runtime_error("this is not a door");
|
|
|
|
}
|
2014-10-05 13:50:01 +00:00
|
|
|
|
|
|
|
float Class::getNormalizedEncumbrance(const Ptr &ptr) const
|
|
|
|
{
|
|
|
|
float capacity = getCapacity(ptr);
|
|
|
|
if (capacity == 0)
|
|
|
|
return 1.f;
|
|
|
|
|
|
|
|
return getEncumbrance(ptr) / capacity;
|
|
|
|
}
|
2014-10-12 12:06:08 +00:00
|
|
|
|
2015-12-18 15:11:03 +00:00
|
|
|
std::string Class::getSound(const MWWorld::ConstPtr&) const
|
2014-10-12 09:40:14 +00:00
|
|
|
{
|
|
|
|
return std::string();
|
|
|
|
}
|
2014-12-14 18:35:34 +00:00
|
|
|
|
2015-12-18 15:12:35 +00:00
|
|
|
int Class::getBaseFightRating(const ConstPtr &ptr) const
|
2014-12-14 18:35:34 +00:00
|
|
|
{
|
|
|
|
throw std::runtime_error("class does not support fight rating");
|
|
|
|
}
|
2015-01-27 16:32:21 +00:00
|
|
|
|
2015-12-18 15:33:54 +00:00
|
|
|
std::string Class::getPrimaryFaction (const MWWorld::ConstPtr& ptr) const
|
2015-01-27 16:32:21 +00:00
|
|
|
{
|
|
|
|
return std::string();
|
|
|
|
}
|
2015-12-18 15:33:54 +00:00
|
|
|
int Class::getPrimaryFactionRank (const MWWorld::ConstPtr& ptr) const
|
2015-01-27 16:32:21 +00:00
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
2015-03-01 18:28:20 +00:00
|
|
|
|
2015-12-18 14:27:06 +00:00
|
|
|
int Class::getEffectiveArmorRating(const ConstPtr &armor, const Ptr &actor) const
|
2015-03-01 18:28:20 +00:00
|
|
|
{
|
|
|
|
throw std::runtime_error("class does not support armor ratings");
|
|
|
|
}
|
2010-08-03 09:14:57 +00:00
|
|
|
}
|