OpenMW
|
Potion creation via alchemy skill. More...
#include <alchemy.hpp>
Public Types | |
enum | Result { Result_Success, Result_NoMortarAndPestle, Result_LessThanTwoIngredients, Result_NoName, Result_NoEffects, Result_RandomFailure } |
typedef std::vector< MWWorld::Ptr > | TToolsContainer |
typedef TToolsContainer::const_iterator | TToolsIterator |
typedef std::vector< MWWorld::Ptr > | TIngredientsContainer |
typedef TIngredientsContainer::const_iterator | TIngredientsIterator |
typedef std::vector < ESM::ENAMstruct > | TEffectsContainer |
typedef TEffectsContainer::const_iterator | TEffectsIterator |
Public Member Functions | |
Alchemy () | |
void | setAlchemist (const MWWorld::Ptr &npc) |
TToolsIterator | beginTools () const |
TToolsIterator | endTools () const |
TIngredientsIterator | beginIngredients () const |
TIngredientsIterator | endIngredients () const |
void | clear () |
Remove alchemist, tools and ingredients. More... | |
std::set< EffectKey > | listEffects () const |
List all effects shared by at least two ingredients. More... | |
int | addIngredient (const MWWorld::Ptr &ingredient) |
void | removeIngredient (int index) |
Remove ingredient from slot (calling this function on an empty slot is a no-op). More... | |
std::string | suggestPotionName () |
Suggest a name for the potion, based on the current effects. More... | |
Result | create (const std::string &name) |
Static Public Member Functions | |
static bool | knownEffect (unsigned int potionEffectIndex, const MWWorld::Ptr &npc) |
Does npc have sufficient alchemy skill to know about this potion effect? More... | |
Private Member Functions | |
void | applyTools (int flags, float &value) const |
void | updateEffects () |
const ESM::Potion * | getRecord (const ESM::Potion &toFind) const |
void | removeIngredients () |
void | addPotion (const std::string &name) |
Add a potion to the alchemist's inventory. More... | |
void | increaseSkill () |
Increase alchemist's skill. More... | |
float | getAlchemyFactor () const |
int | countIngredients () const |
TEffectsIterator | beginEffects () const |
TEffectsIterator | endEffects () const |
Private Attributes | |
MWWorld::Ptr | mAlchemist |
TToolsContainer | mTools |
TIngredientsContainer | mIngredients |
TEffectsContainer | mEffects |
int | mValue |
Potion creation via alchemy skill.
typedef std::vector<ESM::ENAMstruct> MWMechanics::Alchemy::TEffectsContainer |
typedef TEffectsContainer::const_iterator MWMechanics::Alchemy::TEffectsIterator |
typedef std::vector<MWWorld::Ptr> MWMechanics::Alchemy::TIngredientsContainer |
typedef TIngredientsContainer::const_iterator MWMechanics::Alchemy::TIngredientsIterator |
typedef std::vector<MWWorld::Ptr> MWMechanics::Alchemy::TToolsContainer |
typedef TToolsContainer::const_iterator MWMechanics::Alchemy::TToolsIterator |
MWMechanics::Alchemy::Alchemy | ( | ) |
int MWMechanics::Alchemy::addIngredient | ( | const MWWorld::Ptr & | ingredient | ) |
Add ingredient into the next free slot.
|
private |
Add a potion to the alchemist's inventory.
|
private |
|
private |
MWMechanics::Alchemy::TIngredientsIterator MWMechanics::Alchemy::beginIngredients | ( | ) | const |
MWMechanics::Alchemy::TToolsIterator MWMechanics::Alchemy::beginTools | ( | ) | const |
void MWMechanics::Alchemy::clear | ( | ) |
Remove alchemist, tools and ingredients.
|
private |
MWMechanics::Alchemy::Result MWMechanics::Alchemy::create | ( | const std::string & | name | ) |
Try to create a potion from the ingredients, place it in the inventory of the alchemist and adjust the skills of the alchemist accordingly.
name | must not be an empty string, or Result_NoName is returned |
|
private |
MWMechanics::Alchemy::TIngredientsIterator MWMechanics::Alchemy::endIngredients | ( | ) | const |
MWMechanics::Alchemy::TToolsIterator MWMechanics::Alchemy::endTools | ( | ) | const |
|
private |
|
private |
Try to find a potion record similar to toFind in the record store, or return 0 if not found
|
private |
Increase alchemist's skill.
|
static |
Does npc have sufficient alchemy skill to know about this potion effect?
std::set< MWMechanics::EffectKey > MWMechanics::Alchemy::listEffects | ( | ) | const |
List all effects shared by at least two ingredients.
void MWMechanics::Alchemy::removeIngredient | ( | int | index | ) |
Remove ingredient from slot (calling this function on an empty slot is a no-op).
|
private |
Remove selected ingredients from alchemist's inventory, cleanup selected ingredients and update effect list accordingly.
void MWMechanics::Alchemy::setAlchemist | ( | const MWWorld::Ptr & | npc | ) |
Set alchemist and configure alchemy setup accordingly. npc may be empty to indicate that there is no alchemist (alchemy session has ended).
std::string MWMechanics::Alchemy::suggestPotionName | ( | ) |
Suggest a name for the potion, based on the current effects.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |