mirror of
https://github.com/OpenMW/openmw.git
synced 2025-12-12 18:43:08 +00:00
Remove dead code
This commit is contained in:
parent
0c6c71f6cb
commit
4e8a713819
4 changed files with 0 additions and 71 deletions
|
|
@ -193,15 +193,6 @@ namespace MWMechanics
|
||||||
mLevel = level;
|
mLevel = level;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreatureStats::modifyMagicEffects(const MagicEffects& effects)
|
|
||||||
{
|
|
||||||
bool recalc = effects.getOrDefault(ESM::MagicEffect::FortifyMaximumMagicka).getModifier()
|
|
||||||
!= mMagicEffects.getOrDefault(ESM::MagicEffect::FortifyMaximumMagicka).getModifier();
|
|
||||||
mMagicEffects.setModifiers(effects);
|
|
||||||
if (recalc)
|
|
||||||
recalculateMagicka();
|
|
||||||
}
|
|
||||||
|
|
||||||
void CreatureStats::setAiSetting(AiSetting index, Stat<int> value)
|
void CreatureStats::setAiSetting(AiSetting index, Stat<int> value)
|
||||||
{
|
{
|
||||||
mAiSettings[static_cast<std::underlying_type_t<AiSetting>>(index)] = value;
|
mAiSettings[static_cast<std::underlying_type_t<AiSetting>>(index)] = value;
|
||||||
|
|
|
||||||
|
|
@ -155,9 +155,6 @@ namespace MWMechanics
|
||||||
|
|
||||||
void setDynamic(int index, const DynamicStat<float>& value);
|
void setDynamic(int index, const DynamicStat<float>& value);
|
||||||
|
|
||||||
/// Set Modifier for each magic effect according to \a effects. Does not touch Base values.
|
|
||||||
void modifyMagicEffects(const MagicEffects& effects);
|
|
||||||
|
|
||||||
void setAttackingOrSpell(bool attackingOrSpell) { mAttackingOrSpell = attackingOrSpell; }
|
void setAttackingOrSpell(bool attackingOrSpell) { mAttackingOrSpell = attackingOrSpell; }
|
||||||
|
|
||||||
void setAttackType(std::string_view attackType) { mAttackType = attackType; }
|
void setAttackType(std::string_view attackType) { mAttackType = attackType; }
|
||||||
|
|
|
||||||
|
|
@ -121,11 +121,6 @@ namespace MWMechanics
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MagicEffects::remove(const EffectKey& key)
|
|
||||||
{
|
|
||||||
mCollection.erase(key);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MagicEffects::add(const EffectKey& key, const EffectParam& param)
|
void MagicEffects::add(const EffectKey& key, const EffectParam& param)
|
||||||
{
|
{
|
||||||
Collection::iterator iter = mCollection.find(key);
|
Collection::iterator iter = mCollection.find(key);
|
||||||
|
|
@ -145,19 +140,6 @@ namespace MWMechanics
|
||||||
mCollection[key].modifyBase(diff);
|
mCollection[key].modifyBase(diff);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MagicEffects::setModifiers(const MagicEffects& effects)
|
|
||||||
{
|
|
||||||
for (Collection::iterator it = mCollection.begin(); it != mCollection.end(); ++it)
|
|
||||||
{
|
|
||||||
it->second.setModifier(effects.getOrDefault(it->first).getModifier());
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Collection::const_iterator it = effects.begin(); it != effects.end(); ++it)
|
|
||||||
{
|
|
||||||
mCollection[it->first].setModifier(it->second.getModifier());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
EffectParam MagicEffects::getOrDefault(const EffectKey& key) const
|
EffectParam MagicEffects::getOrDefault(const EffectKey& key) const
|
||||||
{
|
{
|
||||||
return get(key).value_or(EffectParam());
|
return get(key).value_or(EffectParam());
|
||||||
|
|
@ -174,40 +156,6 @@ namespace MWMechanics
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
MagicEffects MagicEffects::diff(const MagicEffects& prev, const MagicEffects& now)
|
|
||||||
{
|
|
||||||
MagicEffects result;
|
|
||||||
|
|
||||||
// adding/changing
|
|
||||||
for (Collection::const_iterator iter(now.begin()); iter != now.end(); ++iter)
|
|
||||||
{
|
|
||||||
Collection::const_iterator other = prev.mCollection.find(iter->first);
|
|
||||||
|
|
||||||
if (other == prev.end())
|
|
||||||
{
|
|
||||||
// adding
|
|
||||||
result.add(iter->first, iter->second);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// changing
|
|
||||||
result.add(iter->first, iter->second - other->second);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// removing
|
|
||||||
for (Collection::const_iterator iter(prev.begin()); iter != prev.end(); ++iter)
|
|
||||||
{
|
|
||||||
Collection::const_iterator other = now.mCollection.find(iter->first);
|
|
||||||
if (other == now.end())
|
|
||||||
{
|
|
||||||
result.add(iter->first, EffectParam() - iter->second);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MagicEffects::writeState(ESM::MagicEffects& state) const
|
void MagicEffects::writeState(ESM::MagicEffects& state) const
|
||||||
{
|
{
|
||||||
for (const auto& [key, params] : mCollection)
|
for (const auto& [key, params] : mCollection)
|
||||||
|
|
|
||||||
|
|
@ -103,19 +103,12 @@ namespace MWMechanics
|
||||||
void writeState(ESM::MagicEffects& state) const;
|
void writeState(ESM::MagicEffects& state) const;
|
||||||
|
|
||||||
void add(const EffectKey& key, const EffectParam& param);
|
void add(const EffectKey& key, const EffectParam& param);
|
||||||
void remove(const EffectKey& key);
|
|
||||||
|
|
||||||
void modifyBase(const EffectKey& key, int diff);
|
void modifyBase(const EffectKey& key, int diff);
|
||||||
|
|
||||||
/// Copy Modifier values from \a effects, but keep original mBase values.
|
|
||||||
void setModifiers(const MagicEffects& effects);
|
|
||||||
|
|
||||||
EffectParam getOrDefault(const EffectKey& key) const;
|
EffectParam getOrDefault(const EffectKey& key) const;
|
||||||
std::optional<EffectParam> get(const EffectKey& key) const;
|
std::optional<EffectParam> get(const EffectKey& key) const;
|
||||||
///< This function can safely be used for keys that are not present.
|
///< This function can safely be used for keys that are not present.
|
||||||
|
|
||||||
static MagicEffects diff(const MagicEffects& prev, const MagicEffects& now);
|
|
||||||
///< Return changes from \a prev to \a now.
|
|
||||||
};
|
};
|
||||||
|
|
||||||
std::string getMagicEffectString(
|
std::string getMagicEffectString(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue