1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-10-24 15:56:36 +00:00

Ignore resistances for base diseases

This commit is contained in:
Evil Eye 2025-05-06 20:09:48 +02:00
parent 0d27dc2336
commit d1196ea667
3 changed files with 8 additions and 6 deletions

View file

@ -267,7 +267,7 @@ namespace MWMechanics
if (spell->mData.mType != ESM::Spell::ST_Spell && spell->mData.mType != ESM::Spell::ST_Power
&& !isSpellActive(spell->mId))
{
mSpells.emplace_back(ActiveSpellParams{ spell, ptr });
mSpells.emplace_back(ActiveSpellParams{ spell, ptr, true });
mSpells.back().setActiveSpellId(MWBase::Environment::get().getESMStore()->generateId());
}
}
@ -506,9 +506,9 @@ namespace MWMechanics
mQueue.emplace_back(params);
}
void ActiveSpells::addSpell(const ESM::Spell* spell, const MWWorld::Ptr& actor)
void ActiveSpells::addSpell(const ESM::Spell* spell, const MWWorld::Ptr& actor, bool ignoreResistances)
{
mQueue.emplace_back(ActiveSpellParams{ spell, actor, true });
mQueue.emplace_back(ActiveSpellParams{ spell, actor, ignoreResistances });
}
void ActiveSpells::purge(ParamsPredicate predicate, const MWWorld::Ptr& ptr)

View file

@ -137,8 +137,8 @@ namespace MWMechanics
///
void addSpell(const ActiveSpellParams& params);
/// Bypasses resistances
void addSpell(const ESM::Spell* spell, const MWWorld::Ptr& actor);
/// Force resistances
void addSpell(const ESM::Spell* spell, const MWWorld::Ptr& actor, bool ignoreResistances = true);
/// Removes the active effects from this spell/potion/.. with \a id
void removeEffectsBySourceSpellId(const MWWorld::Ptr& ptr, const ESM::RefId& id);

View file

@ -66,7 +66,9 @@ namespace MWMechanics
if (Misc::Rng::rollDice(10000, prng) < x)
{
// Contracted disease!
actor.getClass().getCreatureStats(actor).getSpells().add(spell);
MWMechanics::CreatureStats& creatureStats = actor.getClass().getCreatureStats(actor);
creatureStats.getSpells().add(spell);
creatureStats.getActiveSpells().addSpell(spell, actor, false);
MWBase::Environment::get().getWorld()->applyLoopingParticles(actor);
std::string msg = MWBase::Environment::get()