mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-23 12:39:43 +00:00
Make Spells::mCorprusSpells private
This commit is contained in:
parent
26732bc228
commit
2cbe17ca0a
3 changed files with 19 additions and 15 deletions
|
@ -481,9 +481,9 @@ namespace MWMechanics
|
||||||
Spells & spells = creatureStats.getSpells();
|
Spells & spells = creatureStats.getSpells();
|
||||||
for (Spells::TIterator it = spells.begin(); it != spells.end(); ++it)
|
for (Spells::TIterator it = spells.begin(); it != spells.end(); ++it)
|
||||||
{
|
{
|
||||||
if (spells.mCorprusSpells.find(it->first) != spells.mCorprusSpells.end())
|
if (spells.getCorprusSpells().find(it->first) != spells.getCorprusSpells().end())
|
||||||
{
|
{
|
||||||
if (MWBase::Environment::get().getWorld()->getTimeStamp() >= spells.mCorprusSpells[it->first].mNextWorsening)
|
if (MWBase::Environment::get().getWorld()->getTimeStamp() >= spells.getCorprusSpells().at(it->first).mNextWorsening)
|
||||||
{
|
{
|
||||||
spells.worsenCorprus(it->first);
|
spells.worsenCorprus(it->first);
|
||||||
|
|
||||||
|
|
|
@ -255,6 +255,11 @@ namespace MWMechanics
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const std::map<std::string, Spells::CorprusStats> &Spells::getCorprusSpells() const
|
||||||
|
{
|
||||||
|
return mCorprusSpells;
|
||||||
|
}
|
||||||
|
|
||||||
bool Spells::canUsePower(const std::string &power) const
|
bool Spells::canUsePower(const std::string &power) const
|
||||||
{
|
{
|
||||||
std::map<std::string, MWWorld::TimeStamp>::const_iterator it = mUsedPowers.find(power);
|
std::map<std::string, MWWorld::TimeStamp>::const_iterator it = mUsedPowers.find(power);
|
||||||
|
|
|
@ -31,10 +31,17 @@ namespace MWMechanics
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
||||||
typedef std::map<std::string, std::map<const int, float> > TContainer; // ID, <effect index, normalised random magnitude>
|
typedef std::map<std::string, std::map<const int, float> > TContainer; // ID, <effect index, normalised random magnitude>
|
||||||
typedef TContainer::const_iterator TIterator;
|
typedef TContainer::const_iterator TIterator;
|
||||||
|
|
||||||
|
struct CorprusStats
|
||||||
|
{
|
||||||
|
static const int sWorseningPeriod = 24;
|
||||||
|
|
||||||
|
int mWorsenings;
|
||||||
|
MWWorld::TimeStamp mNextWorsening;
|
||||||
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
TContainer mSpells;
|
TContainer mSpells;
|
||||||
|
@ -44,22 +51,14 @@ namespace MWMechanics
|
||||||
|
|
||||||
std::map<std::string, MWWorld::TimeStamp> mUsedPowers;
|
std::map<std::string, MWWorld::TimeStamp> mUsedPowers;
|
||||||
|
|
||||||
public:
|
|
||||||
struct CorprusStats
|
|
||||||
{
|
|
||||||
static const int sWorseningPeriod = 24;
|
|
||||||
|
|
||||||
int mWorsenings;
|
|
||||||
MWWorld::TimeStamp mNextWorsening;
|
|
||||||
};
|
|
||||||
|
|
||||||
std::map<std::string, CorprusStats> mCorprusSpells;
|
std::map<std::string, CorprusStats> mCorprusSpells;
|
||||||
void worsenCorprus(const std::string &corpSpellId);
|
|
||||||
|
|
||||||
static bool hasCorprusEffect(const ESM::Spell *spell);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
void worsenCorprus(const std::string &corpSpellId);
|
||||||
|
static bool hasCorprusEffect(const ESM::Spell *spell);
|
||||||
|
const std::map<std::string, CorprusStats> & getCorprusSpells() const;
|
||||||
|
|
||||||
bool canUsePower (const std::string& power) const;
|
bool canUsePower (const std::string& power) const;
|
||||||
void usePower (const std::string& power);
|
void usePower (const std::string& power);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue