2010-08-03 14:14:04 +02:00
|
|
|
#ifndef GAME_MWCLASS_WEAPON_H
|
|
|
|
#define GAME_MWCLASS_WEAPON_H
|
|
|
|
|
|
|
|
#include "../mwworld/class.hpp"
|
|
|
|
|
|
|
|
namespace MWClass
|
|
|
|
{
|
|
|
|
class Weapon : public MWWorld::Class
|
|
|
|
{
|
2012-07-25 17:18:17 +04:00
|
|
|
virtual MWWorld::Ptr
|
2015-12-18 16:24:24 +01:00
|
|
|
copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const;
|
2012-07-25 17:18:17 +04:00
|
|
|
|
2010-08-03 14:14:04 +02:00
|
|
|
public:
|
|
|
|
|
2015-01-12 11:29:56 +01:00
|
|
|
virtual void insertObjectRendering (const MWWorld::Ptr& ptr, const std::string& model, MWRender::RenderingInterface& renderingInterface) const;
|
2010-08-14 10:02:54 +02:00
|
|
|
///< Add reference into a cell for rendering
|
|
|
|
|
2015-05-10 01:09:00 +02:00
|
|
|
virtual void insertObject(const MWWorld::Ptr& ptr, const std::string& model, MWPhysics::PhysicsSystem& physics) const;
|
2011-11-11 23:01:12 -05:00
|
|
|
|
2015-12-18 15:27:06 +01:00
|
|
|
virtual std::string getName (const MWWorld::ConstPtr& ptr) const;
|
2010-08-03 17:11:41 +02:00
|
|
|
///< \return name (the one that is to be presented to the user; not the internal one);
|
|
|
|
/// can return an empty string.
|
|
|
|
|
2017-05-05 21:21:11 +02:00
|
|
|
virtual std::shared_ptr<MWWorld::Action> activate (const MWWorld::Ptr& ptr,
|
2012-04-23 15:27:03 +02:00
|
|
|
const MWWorld::Ptr& actor) const;
|
2010-08-07 20:25:17 +02:00
|
|
|
///< Generate action for activation
|
|
|
|
|
2015-12-19 16:13:00 +01:00
|
|
|
virtual bool hasToolTip (const MWWorld::ConstPtr& ptr) const;
|
2012-04-16 22:58:16 +02:00
|
|
|
///< @return true if this object has a tooltip when focused (default implementation: false)
|
|
|
|
|
2015-12-19 16:29:07 +01:00
|
|
|
virtual MWGui::ToolTipInfo getToolTipInfo (const MWWorld::ConstPtr& ptr, int count) const;
|
2012-04-16 22:58:16 +02:00
|
|
|
///< @return the content of the tool tip to be displayed. raises exception if the object has no tooltip.
|
|
|
|
|
2015-12-18 16:06:31 +01:00
|
|
|
virtual bool hasItemHealth (const MWWorld::ConstPtr& ptr) const;
|
2010-08-03 14:14:04 +02:00
|
|
|
///< \return Item health data available?
|
|
|
|
|
2015-12-18 15:27:06 +01:00
|
|
|
virtual int getItemMaxHealth (const MWWorld::ConstPtr& ptr) const;
|
2010-08-03 14:14:04 +02:00
|
|
|
///< Return item max health or throw an exception, if class does not have item health
|
|
|
|
|
2015-12-18 00:12:03 +01:00
|
|
|
virtual std::string getScript (const MWWorld::ConstPtr& ptr) const;
|
2010-08-05 15:40:03 +02:00
|
|
|
///< Return name of the script attached to ptr
|
|
|
|
|
2015-12-18 16:06:31 +01:00
|
|
|
virtual std::pair<std::vector<int>, bool> getEquipmentSlots (const MWWorld::ConstPtr& ptr) const;
|
2012-03-13 15:35:06 +01:00
|
|
|
///< \return first: Return IDs of the slot this object can be equipped in; second: can object
|
|
|
|
/// stay stacked when equipped?
|
|
|
|
|
2015-12-18 15:27:06 +01:00
|
|
|
virtual int getEquipmentSkill (const MWWorld::ConstPtr& ptr) const;
|
|
|
|
/// Return the index of the skill this item corresponds to when equipped or -1, if there is
|
2012-03-13 15:35:06 +01:00
|
|
|
/// no such skill.
|
|
|
|
|
2015-12-18 15:27:06 +01:00
|
|
|
virtual int getValue (const MWWorld::ConstPtr& ptr) const;
|
2012-04-07 19:53:49 +02:00
|
|
|
///< Return trade value of the object. Throws an exception, if the object can't be traded.
|
|
|
|
|
2010-08-03 14:14:04 +02:00
|
|
|
static void registerSelf();
|
2012-03-13 20:31:01 +02:00
|
|
|
|
2015-12-18 16:09:08 +01:00
|
|
|
virtual std::string getUpSoundId (const MWWorld::ConstPtr& ptr) const;
|
2012-03-13 20:31:01 +02:00
|
|
|
///< Return the pick up sound Id
|
|
|
|
|
2015-12-18 16:09:08 +01:00
|
|
|
virtual std::string getDownSoundId (const MWWorld::ConstPtr& ptr) const;
|
2012-03-13 20:31:01 +02:00
|
|
|
///< Return the put down sound Id
|
2012-04-15 17:52:39 +02:00
|
|
|
|
2015-12-18 15:53:47 +01:00
|
|
|
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
|
2012-04-15 17:52:39 +02:00
|
|
|
///< Return name of inventory icon.
|
|
|
|
|
2015-12-18 15:56:45 +01:00
|
|
|
virtual std::string getEnchantment (const MWWorld::ConstPtr& ptr) const;
|
2012-05-12 16:17:03 +02:00
|
|
|
///< @return the enchantment ID if the object is enchanted, otherwise an empty string
|
2012-05-16 16:08:55 +02:00
|
|
|
|
2015-12-18 16:43:11 +01:00
|
|
|
virtual std::string applyEnchantment(const MWWorld::ConstPtr &ptr, const std::string& enchId, int enchCharge, const std::string& newName) const;
|
2014-05-24 14:48:37 +02:00
|
|
|
///< Creates a new record using \a ptr as template, with the given name and the given enchantment applied to it.
|
2013-03-28 17:41:00 +01:00
|
|
|
|
2015-12-18 16:06:31 +01:00
|
|
|
virtual std::pair<int, std::string> canBeEquipped(const MWWorld::ConstPtr &ptr, const MWWorld::Ptr &npc) const;
|
2013-04-08 22:10:55 +02:00
|
|
|
///< Return 0 if player cannot equip item. 1 if can equip. 2 if it's twohanded weapon. 3 if twohanded weapon conflicts with that.
|
2013-04-15 02:56:23 +02:00
|
|
|
/// Second item in the pair specifies the error message
|
2013-04-05 15:42:05 +02:00
|
|
|
|
2018-07-09 19:31:40 +04:00
|
|
|
virtual std::shared_ptr<MWWorld::Action> use (const MWWorld::Ptr& ptr, bool force=false) const;
|
2012-05-16 16:08:55 +02:00
|
|
|
///< Generate action for using via inventory menu
|
|
|
|
|
2015-12-18 15:51:05 +01:00
|
|
|
virtual std::string getModel(const MWWorld::ConstPtr &ptr) const;
|
2013-03-16 19:00:14 +01:00
|
|
|
|
2015-12-18 15:58:23 +01:00
|
|
|
virtual bool canSell (const MWWorld::ConstPtr& item, int npcServices) const;
|
2013-04-07 21:38:53 +02:00
|
|
|
|
2015-12-18 16:00:50 +01:00
|
|
|
virtual float getWeight (const MWWorld::ConstPtr& ptr) const;
|
2013-05-11 18:38:27 +02:00
|
|
|
|
2015-12-18 16:48:19 +01:00
|
|
|
virtual int getEnchantmentPoints (const MWWorld::ConstPtr& ptr) const;
|
2010-08-03 14:14:04 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|