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