mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-19 17:09:40 +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();
|
||||
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);
|
||||
|
||||
|
|
|
@ -255,6 +255,11 @@ namespace MWMechanics
|
|||
return false;
|
||||
}
|
||||
|
||||
const std::map<std::string, Spells::CorprusStats> &Spells::getCorprusSpells() const
|
||||
{
|
||||
return mCorprusSpells;
|
||||
}
|
||||
|
||||
bool Spells::canUsePower(const std::string &power) const
|
||||
{
|
||||
std::map<std::string, MWWorld::TimeStamp>::const_iterator it = mUsedPowers.find(power);
|
||||
|
|
|
@ -31,10 +31,17 @@ namespace MWMechanics
|
|||
{
|
||||
public:
|
||||
|
||||
|
||||
typedef std::map<std::string, std::map<const int, float> > TContainer; // ID, <effect index, normalised random magnitude>
|
||||
typedef TContainer::const_iterator TIterator;
|
||||
|
||||
struct CorprusStats
|
||||
{
|
||||
static const int sWorseningPeriod = 24;
|
||||
|
||||
int mWorsenings;
|
||||
MWWorld::TimeStamp mNextWorsening;
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
TContainer mSpells;
|
||||
|
@ -44,22 +51,14 @@ namespace MWMechanics
|
|||
|
||||
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;
|
||||
void worsenCorprus(const std::string &corpSpellId);
|
||||
|
||||
static bool hasCorprusEffect(const ESM::Spell *spell);
|
||||
|
||||
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;
|
||||
void usePower (const std::string& power);
|
||||
|
||||
|
|
Loading…
Reference in a new issue