1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-10 15:39:02 +00:00
OpenMW/apps/openmw/mwworld/actionapply.cpp

29 lines
829 B
C++
Raw Normal View History

2012-07-13 07:41:38 +00:00
#include "actionapply.hpp"
#include "class.hpp"
namespace MWWorld
{
2012-07-27 10:00:10 +00:00
ActionApply::ActionApply (const Ptr& target, const std::string& id)
: Action (false, target), mId (id)
2012-07-13 07:41:38 +00:00
{}
2012-07-27 10:00:10 +00:00
void ActionApply::executeImp (const Ptr& actor)
2012-07-13 07:41:38 +00:00
{
MWWorld::Class::get (getTarget()).apply (getTarget(), mId, actor);
2012-07-13 07:41:38 +00:00
}
ActionApplyWithSkill::ActionApplyWithSkill (const Ptr& target, const std::string& id,
2012-07-27 10:00:10 +00:00
int skillIndex, int usageType)
: Action (false, target), mId (id), mSkillIndex (skillIndex), mUsageType (usageType)
2012-07-13 07:41:38 +00:00
{}
2012-07-27 10:00:10 +00:00
void ActionApplyWithSkill::executeImp (const Ptr& actor)
2012-07-13 07:41:38 +00:00
{
if (MWWorld::Class::get (getTarget()).apply (getTarget(), mId, actor) && mUsageType!=-1)
MWWorld::Class::get (getTarget()).skillUsageSucceeded (actor, mSkillIndex, mUsageType);
2012-07-13 07:41:38 +00:00
}
}