2013-03-28 16:41:00 +00:00
|
|
|
#ifndef GAME_MWMECHANICS_ENCHANTING_H
|
|
|
|
#define GAME_MWMECHANICS_ENCHANTING_H
|
2016-06-17 14:07:16 +00:00
|
|
|
|
2013-03-28 16:41:00 +00:00
|
|
|
#include <string>
|
2016-06-17 14:07:16 +00:00
|
|
|
|
2013-03-28 16:41:00 +00:00
|
|
|
#include <components/esm/effectlist.hpp>
|
2019-12-27 07:21:19 +00:00
|
|
|
#include <components/esm/loadench.hpp>
|
2016-06-17 14:07:16 +00:00
|
|
|
|
|
|
|
#include "../mwworld/ptr.hpp"
|
|
|
|
|
2013-03-28 16:41:00 +00:00
|
|
|
namespace MWMechanics
|
|
|
|
{
|
|
|
|
class Enchanting
|
|
|
|
{
|
|
|
|
MWWorld::Ptr mOldItemPtr;
|
|
|
|
MWWorld::Ptr mSoulGemPtr;
|
|
|
|
MWWorld::Ptr mEnchanter;
|
2013-03-31 21:18:23 +00:00
|
|
|
|
2013-05-27 12:42:08 +00:00
|
|
|
int mCastStyle;
|
2013-03-28 16:41:00 +00:00
|
|
|
|
2013-03-30 18:08:42 +00:00
|
|
|
bool mSelfEnchanting;
|
|
|
|
|
2013-03-28 16:41:00 +00:00
|
|
|
ESM::EffectList mEffectList;
|
|
|
|
|
|
|
|
std::string mNewItemName;
|
|
|
|
std::string mObjectType;
|
2019-10-20 10:30:52 +00:00
|
|
|
int mWeaponType;
|
2013-03-31 21:18:23 +00:00
|
|
|
|
2019-12-27 07:21:19 +00:00
|
|
|
const ESM::Enchantment* getRecord(const ESM::Enchantment& newEnchantment) const;
|
|
|
|
|
2013-03-28 16:41:00 +00:00
|
|
|
public:
|
2013-03-30 18:08:42 +00:00
|
|
|
Enchanting();
|
2017-04-20 11:36:14 +00:00
|
|
|
void setEnchanter(const MWWorld::Ptr& enchanter);
|
2013-03-30 18:08:42 +00:00
|
|
|
void setSelfEnchanting(bool selfEnchanting);
|
2017-04-20 11:36:14 +00:00
|
|
|
void setOldItem(const MWWorld::Ptr& oldItem);
|
2014-01-22 12:04:36 +00:00
|
|
|
MWWorld::Ptr getOldItem() { return mOldItemPtr; }
|
|
|
|
MWWorld::Ptr getGem() { return mSoulGemPtr; }
|
2013-04-01 15:12:47 +00:00
|
|
|
void setNewItemName(const std::string& s);
|
2017-04-20 11:36:14 +00:00
|
|
|
void setEffect(const ESM::EffectList& effectList);
|
|
|
|
void setSoulGem(const MWWorld::Ptr& soulGem);
|
2013-04-01 15:12:47 +00:00
|
|
|
bool create(); //Return true if created, false if failed.
|
2013-05-27 12:42:08 +00:00
|
|
|
void nextCastStyle(); //Set enchant type to next possible type (for mOldItemPtr object)
|
|
|
|
int getCastStyle() const;
|
2019-05-13 22:40:04 +00:00
|
|
|
float getEnchantPoints(bool precise = true) const;
|
2015-01-07 03:28:56 +00:00
|
|
|
int getBaseCastCost() const; // To be saved in the enchantment's record
|
|
|
|
int getEffectiveCastCost() const; // Effective cost taking player Enchant skill into account, used for preview purposes in the UI
|
2013-04-02 18:46:48 +00:00
|
|
|
int getEnchantPrice() const;
|
2014-12-10 16:30:33 +00:00
|
|
|
int getMaxEnchantValue() const;
|
2013-04-01 15:12:47 +00:00
|
|
|
int getGemCharge() const;
|
2019-05-13 22:40:04 +00:00
|
|
|
int getEnchantChance() const;
|
2019-12-27 07:21:19 +00:00
|
|
|
int getEnchantItemsCount() const;
|
|
|
|
float getTypeMultiplier() const;
|
2013-04-01 15:12:47 +00:00
|
|
|
bool soulEmpty() const; //Return true if empty
|
|
|
|
bool itemEmpty() const; //Return true if empty
|
2013-04-02 18:46:48 +00:00
|
|
|
void payForEnchantment() const;
|
2013-03-28 16:41:00 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|