mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-25 06:35:30 +00:00
Properly implement SetWerewolfAcrobatics
This commit is contained in:
parent
37ea0f3fb9
commit
2353ac1739
@ -389,6 +389,10 @@ namespace MWBase
|
||||
|
||||
/// Turn actor into werewolf or normal form.
|
||||
virtual void setWerewolf(const MWWorld::Ptr& actor, bool werewolf) = 0;
|
||||
|
||||
/// Sets the NPC's Acrobatics skill to match the fWerewolfAcrobatics GMST.
|
||||
/// It only applies to the current form the NPC is in.
|
||||
virtual void applyWerewolfAcrobatics(const MWWorld::Ptr& actor) = 0;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -393,6 +393,11 @@ void MWMechanics::NpcStats::setWerewolf (bool set)
|
||||
for(size_t i = 0;i < ESM::Skill::Length;i++)
|
||||
{
|
||||
mWerewolfSkill[i] = getSkill(i);
|
||||
|
||||
// Acrobatics is set separately for some reason.
|
||||
if(i == ESM::Skill::Acrobatics)
|
||||
continue;
|
||||
|
||||
// "Mercantile"! >_<
|
||||
std::string name = "fWerewolf"+((i==ESM::Skill::Mercantile) ? std::string("Merchantile") :
|
||||
ESM::Skill::sSkillNames[i]);
|
||||
|
@ -1076,8 +1076,8 @@ namespace MWScript
|
||||
|
||||
virtual void execute (Interpreter::Runtime& runtime)
|
||||
{
|
||||
// What to do? Stats (attributes, skills) are already set and unset with
|
||||
// BecomeWerewolf and UndoWerewolf.
|
||||
MWWorld::Ptr ptr = R()(runtime);
|
||||
MWBase::Environment::get().getWorld()->applyWerewolfAcrobatics(ptr);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1925,4 +1925,12 @@ namespace MWWorld
|
||||
mRendering->rebuildPtr(actor);
|
||||
}
|
||||
|
||||
void World::applyWerewolfAcrobatics(const Ptr &actor)
|
||||
{
|
||||
const Store<ESM::GameSetting> &gmst = getStore().get<ESM::GameSetting>();
|
||||
MWMechanics::NpcStats &stats = Class::get(actor).getNpcStats(actor);
|
||||
|
||||
stats.getSkill(ESM::Skill::Acrobatics).setModified(gmst.find("fWerewolfAcrobatics")->getFloat(), 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -432,6 +432,8 @@ namespace MWWorld
|
||||
virtual bool isTeleportingEnabled() const;
|
||||
|
||||
virtual void setWerewolf(const MWWorld::Ptr& actor, bool werewolf);
|
||||
|
||||
virtual void applyWerewolfAcrobatics(const MWWorld::Ptr& actor);
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user