mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-20 22:11:33 +00:00
Merge branch 'creatures_be_creatures' into 'master'
Remove calm/rally/demoralize and turn undead from the wrong targets Closes #6184 See merge request OpenMW/openmw!1067
This commit is contained in:
commit
db8140a50f
3 changed files with 28 additions and 14 deletions
|
@ -26,6 +26,7 @@
|
||||||
Bug #6143: Capturing a screenshot makes engine to be a temporary unresponsive
|
Bug #6143: Capturing a screenshot makes engine to be a temporary unresponsive
|
||||||
Bug #6165: Paralyzed player character can pickup items when the inventory is open
|
Bug #6165: Paralyzed player character can pickup items when the inventory is open
|
||||||
Bug #6174: Spellmaking and Enchanting sliders differences from vanilla
|
Bug #6174: Spellmaking and Enchanting sliders differences from vanilla
|
||||||
|
Bug #6184: Command and Calm and Demoralize and Frenzy and Rally magic effects inconsistencies with vanilla
|
||||||
Feature #2554: Modifying an object triggers the instances table to scroll to the corresponding record
|
Feature #2554: Modifying an object triggers the instances table to scroll to the corresponding record
|
||||||
Feature #2780: A way to see current OpenMW version in the console
|
Feature #2780: A way to see current OpenMW version in the console
|
||||||
Feature #3616: Allow Zoom levels on the World Map
|
Feature #3616: Allow Zoom levels on the World Map
|
||||||
|
|
|
@ -1158,21 +1158,15 @@ namespace MWMechanics
|
||||||
|
|
||||||
// AI setting modifiers
|
// AI setting modifiers
|
||||||
int creature = !ptr.getClass().isNpc();
|
int creature = !ptr.getClass().isNpc();
|
||||||
if (creature && ptr.get<ESM::Creature>()->mBase->mData.mType == ESM::Creature::Humanoid)
|
Stat<int> stat = creatureStats.getAiSetting(CreatureStats::AI_Fight);
|
||||||
creature = false;
|
stat.setModifier(static_cast<int>(effects.get(ESM::MagicEffect::FrenzyHumanoid + creature).getMagnitude()
|
||||||
// Note: the Creature variants only work on normal creatures, not on daedra or undead creatures.
|
- effects.get(ESM::MagicEffect::CalmHumanoid+creature).getMagnitude()));
|
||||||
if (!creature || ptr.get<ESM::Creature>()->mBase->mData.mType == ESM::Creature::Creatures)
|
creatureStats.setAiSetting(CreatureStats::AI_Fight, stat);
|
||||||
{
|
|
||||||
Stat<int> stat = creatureStats.getAiSetting(CreatureStats::AI_Fight);
|
|
||||||
stat.setModifier(static_cast<int>(effects.get(ESM::MagicEffect::FrenzyHumanoid + creature).getMagnitude()
|
|
||||||
- effects.get(ESM::MagicEffect::CalmHumanoid+creature).getMagnitude()));
|
|
||||||
creatureStats.setAiSetting(CreatureStats::AI_Fight, stat);
|
|
||||||
|
|
||||||
stat = creatureStats.getAiSetting(CreatureStats::AI_Flee);
|
stat = creatureStats.getAiSetting(CreatureStats::AI_Flee);
|
||||||
stat.setModifier(static_cast<int>(effects.get(ESM::MagicEffect::DemoralizeHumanoid + creature).getMagnitude()
|
stat.setModifier(static_cast<int>(effects.get(ESM::MagicEffect::DemoralizeHumanoid + creature).getMagnitude()
|
||||||
- effects.get(ESM::MagicEffect::RallyHumanoid+creature).getMagnitude()));
|
- effects.get(ESM::MagicEffect::RallyHumanoid+creature).getMagnitude()));
|
||||||
creatureStats.setAiSetting(CreatureStats::AI_Flee, stat);
|
creatureStats.setAiSetting(CreatureStats::AI_Flee, stat);
|
||||||
}
|
|
||||||
if (creature && ptr.get<ESM::Creature>()->mBase->mData.mType == ESM::Creature::Undead)
|
if (creature && ptr.get<ESM::Creature>()->mBase->mData.mType == ESM::Creature::Undead)
|
||||||
{
|
{
|
||||||
Stat<int> stat = creatureStats.getAiSetting(CreatureStats::AI_Flee);
|
Stat<int> stat = creatureStats.getAiSetting(CreatureStats::AI_Flee);
|
||||||
|
|
|
@ -383,6 +383,25 @@ namespace MWMechanics
|
||||||
target.getClass().getCreatureStats(target).getActiveSpells().purgeAll(magnitude, true);
|
target.getClass().getCreatureStats(target).getActiveSpells().purgeAll(magnitude, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else if(target.getClass().isActor() && effectId >= ESM::MagicEffect::CalmHumanoid && effectId <= ESM::MagicEffect::RallyCreature)
|
||||||
|
{
|
||||||
|
// Treat X Humanoid spells on creatures and X Creature spells on NPCs as instant effects and remove their VFX
|
||||||
|
bool affectsCreatures = (effectId - ESM::MagicEffect::CalmHumanoid) & 1;
|
||||||
|
if(affectsCreatures == target.getClass().isNpc())
|
||||||
|
{
|
||||||
|
MWBase::Environment::get().getWorld()->getAnimation(target)->removeEffect(effectId);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(target.getClass().isActor() && effectId == ESM::MagicEffect::TurnUndead)
|
||||||
|
{
|
||||||
|
// Diverge from vanilla by giving scripts a chance to detect Turn Undead on non-undead, but still remove the effect and VFX
|
||||||
|
if(target.getClass().isNpc() || target.get<ESM::Creature>()->mBase->mData.mType != ESM::Creature::Undead)
|
||||||
|
{
|
||||||
|
MWBase::Environment::get().getWorld()->getAnimation(target)->removeEffect(effectId);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (target.getClass().isActor() && target == getPlayer())
|
else if (target.getClass().isActor() && target == getPlayer())
|
||||||
{
|
{
|
||||||
MWRender::Animation* anim = MWBase::Environment::get().getWorld()->getAnimation(mCaster);
|
MWRender::Animation* anim = MWBase::Environment::get().getWorld()->getAnimation(mCaster);
|
||||||
|
|
Loading…
Reference in a new issue