|
|
|
@ -132,52 +132,60 @@ namespace ESM
|
|
|
|
|
esm.writeHNOString("DESC", mDescription);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
short MagicEffect::getResistanceEffect(short effect)
|
|
|
|
|
namespace
|
|
|
|
|
{
|
|
|
|
|
// Source https://wiki.openmw.org/index.php?title=Research:Magic#Effect_attribute
|
|
|
|
|
|
|
|
|
|
// <Effect, Effect providing resistance against first effect>
|
|
|
|
|
static std::map<short, short> effects;
|
|
|
|
|
if (effects.empty())
|
|
|
|
|
std::map<short, short> makeEffectsMap()
|
|
|
|
|
{
|
|
|
|
|
effects[DisintegrateArmor] = Sanctuary;
|
|
|
|
|
effects[DisintegrateWeapon] = Sanctuary;
|
|
|
|
|
std::map<short, short> effects;
|
|
|
|
|
|
|
|
|
|
for (int i = DrainAttribute; i <= DamageSkill; ++i)
|
|
|
|
|
effects[i] = ResistMagicka;
|
|
|
|
|
for (int i = AbsorbAttribute; i <= AbsorbSkill; ++i)
|
|
|
|
|
effects[i] = ResistMagicka;
|
|
|
|
|
for (int i = WeaknessToFire; i <= WeaknessToNormalWeapons; ++i)
|
|
|
|
|
effects[i] = ResistMagicka;
|
|
|
|
|
effects[MagicEffect::Effects::DisintegrateArmor] = MagicEffect::Effects::Sanctuary;
|
|
|
|
|
effects[MagicEffect::Effects::DisintegrateWeapon] = MagicEffect::Effects::Sanctuary;
|
|
|
|
|
|
|
|
|
|
for (int i = MagicEffect::Effects::DrainAttribute; i <= MagicEffect::Effects::DamageSkill; ++i)
|
|
|
|
|
effects[i] = MagicEffect::Effects::ResistMagicka;
|
|
|
|
|
for (int i = MagicEffect::Effects::AbsorbAttribute; i <= MagicEffect::Effects::AbsorbSkill; ++i)
|
|
|
|
|
effects[i] = MagicEffect::Effects::ResistMagicka;
|
|
|
|
|
for (int i = MagicEffect::Effects::WeaknessToFire; i <= MagicEffect::Effects::WeaknessToNormalWeapons; ++i)
|
|
|
|
|
effects[i] = MagicEffect::Effects::ResistMagicka;
|
|
|
|
|
|
|
|
|
|
effects[Burden] = ResistMagicka;
|
|
|
|
|
effects[Charm] = ResistMagicka;
|
|
|
|
|
effects[Silence] = ResistMagicka;
|
|
|
|
|
effects[Blind] = ResistMagicka;
|
|
|
|
|
effects[Sound] = ResistMagicka;
|
|
|
|
|
effects[MagicEffect::Effects::Burden] = MagicEffect::Effects::ResistMagicka;
|
|
|
|
|
effects[MagicEffect::Effects::Charm] = MagicEffect::Effects::ResistMagicka;
|
|
|
|
|
effects[MagicEffect::Effects::Silence] = MagicEffect::Effects::ResistMagicka;
|
|
|
|
|
effects[MagicEffect::Effects::Blind] = MagicEffect::Effects::ResistMagicka;
|
|
|
|
|
effects[MagicEffect::Effects::Sound] = MagicEffect::Effects::ResistMagicka;
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 2; ++i)
|
|
|
|
|
{
|
|
|
|
|
effects[CalmHumanoid + i] = ResistMagicka;
|
|
|
|
|
effects[FrenzyHumanoid + i] = ResistMagicka;
|
|
|
|
|
effects[DemoralizeHumanoid + i] = ResistMagicka;
|
|
|
|
|
effects[RallyHumanoid + i] = ResistMagicka;
|
|
|
|
|
effects[MagicEffect::Effects::CalmHumanoid + i] = MagicEffect::Effects::ResistMagicka;
|
|
|
|
|
effects[MagicEffect::Effects::FrenzyHumanoid + i] = MagicEffect::Effects::ResistMagicka;
|
|
|
|
|
effects[MagicEffect::Effects::DemoralizeHumanoid + i] = MagicEffect::Effects::ResistMagicka;
|
|
|
|
|
effects[MagicEffect::Effects::RallyHumanoid + i] = MagicEffect::Effects::ResistMagicka;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
effects[TurnUndead] = ResistMagicka;
|
|
|
|
|
effects[MagicEffect::Effects::TurnUndead] = MagicEffect::Effects::ResistMagicka;
|
|
|
|
|
|
|
|
|
|
effects[MagicEffect::Effects::FireDamage] = MagicEffect::Effects::ResistFire;
|
|
|
|
|
effects[MagicEffect::Effects::FrostDamage] = MagicEffect::Effects::ResistFrost;
|
|
|
|
|
effects[MagicEffect::Effects::ShockDamage] = MagicEffect::Effects::ResistShock;
|
|
|
|
|
effects[MagicEffect::Effects::Vampirism] = MagicEffect::Effects::ResistCommonDisease;
|
|
|
|
|
effects[MagicEffect::Effects::Corprus] = MagicEffect::Effects::ResistCorprusDisease;
|
|
|
|
|
effects[MagicEffect::Effects::Poison] = MagicEffect::Effects::ResistPoison;
|
|
|
|
|
effects[MagicEffect::Effects::Paralyze] = MagicEffect::Effects::ResistParalysis;
|
|
|
|
|
|
|
|
|
|
effects[FireDamage] = ResistFire;
|
|
|
|
|
effects[FrostDamage] = ResistFrost;
|
|
|
|
|
effects[ShockDamage] = ResistShock;
|
|
|
|
|
effects[Vampirism] = ResistCommonDisease;
|
|
|
|
|
effects[Corprus] = ResistCorprusDisease;
|
|
|
|
|
effects[Poison] = ResistPoison;
|
|
|
|
|
effects[Paralyze] = ResistParalysis;
|
|
|
|
|
return effects;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (effects.find(effect) != effects.end())
|
|
|
|
|
return effects[effect];
|
|
|
|
|
else
|
|
|
|
|
short MagicEffect::getResistanceEffect(short effect)
|
|
|
|
|
{
|
|
|
|
|
// Source https://wiki.openmw.org/index.php?title=Research:Magic#Effect_attribute
|
|
|
|
|
|
|
|
|
|
// <Effect, Effect providing resistance against first effect>
|
|
|
|
|
static const std::map<short, short> effects = makeEffectsMap();
|
|
|
|
|
|
|
|
|
|
if (const auto it = effects.find(effect); it != effects.end())
|
|
|
|
|
return it->second;
|
|
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|