You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
|
|
|
#include "actionapply.hpp"
|
|
|
|
|
|
|
|
#include "class.hpp"
|
|
|
|
|
|
|
|
namespace MWWorld
|
|
|
|
{
|
|
|
|
ActionApply::ActionApply (const Ptr& target, const std::string& id, const Ptr& actor)
|
|
|
|
: mTarget (target), mId (id), mActor (actor)
|
|
|
|
{}
|
|
|
|
|
|
|
|
void ActionApply::execute()
|
|
|
|
{
|
|
|
|
MWWorld::Class::get (mTarget).apply (mTarget, mId, mActor);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ActionApplyWithSkill::ActionApplyWithSkill (const Ptr& target, const std::string& id,
|
|
|
|
const Ptr& actor, int skillIndex, int usageType)
|
|
|
|
: mTarget (target), mId (id), mActor (actor), mSkillIndex (skillIndex), mUsageType (usageType)
|
|
|
|
{}
|
|
|
|
|
|
|
|
void ActionApplyWithSkill::execute()
|
|
|
|
{
|
|
|
|
if (MWWorld::Class::get (mTarget).apply (mTarget, mId, mActor) && mUsageType!=-1)
|
|
|
|
MWWorld::Class::get (mTarget).skillUsageSucceeded (mActor, mSkillIndex, mUsageType);
|
|
|
|
}
|
|
|
|
}
|