2012-11-15 21:22:44 +00:00
|
|
|
#ifndef GAME_MWMECHANICS_AIACTIVATE_H
|
|
|
|
#define GAME_MWMECHANICS_AIACTIVATE_H
|
|
|
|
|
2020-05-17 20:10:36 +00:00
|
|
|
#include "typedaipackage.hpp"
|
2016-06-17 14:07:16 +00:00
|
|
|
|
2018-07-10 05:21:24 +00:00
|
|
|
/*
|
|
|
|
Start of tes3mp addition
|
|
|
|
|
|
|
|
Include additional headers for multiplayer purposes
|
|
|
|
*/
|
|
|
|
#include "../mwworld/ptr.hpp"
|
|
|
|
/*
|
|
|
|
End of tes3mp addition
|
|
|
|
*/
|
|
|
|
|
2014-04-01 18:15:55 +00:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "pathfinding.hpp"
|
|
|
|
|
2014-06-12 21:27:04 +00:00
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
namespace AiSequence
|
|
|
|
{
|
|
|
|
struct AiActivate;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-04-01 18:15:55 +00:00
|
|
|
namespace MWMechanics
|
2014-06-12 21:27:04 +00:00
|
|
|
{
|
|
|
|
/// \brief Causes actor to walk to activatable object and activate it
|
2014-05-14 00:32:29 +00:00
|
|
|
/** Will activate when close to object **/
|
2020-05-17 20:10:36 +00:00
|
|
|
class AiActivate final : public TypedAiPackage<AiActivate>
|
2012-11-16 17:38:15 +00:00
|
|
|
{
|
2014-06-12 21:27:04 +00:00
|
|
|
public:
|
|
|
|
/// Constructor
|
2014-04-30 03:40:59 +00:00
|
|
|
/** \param objectId Reference to object to activate **/
|
2020-10-22 21:57:53 +00:00
|
|
|
explicit AiActivate(const std::string &objectId);
|
2014-06-12 21:27:04 +00:00
|
|
|
|
2018-07-10 05:21:24 +00:00
|
|
|
/*
|
|
|
|
Start of tes3mp addition
|
|
|
|
|
|
|
|
Make it possible to initialize an AiActivate package with a specific Ptr
|
|
|
|
as the target, allowing for more fine-tuned activation of objects
|
|
|
|
*/
|
|
|
|
AiActivate(MWWorld::Ptr object);
|
|
|
|
/*
|
|
|
|
End of tes3mp addition
|
|
|
|
*/
|
|
|
|
|
2020-10-22 21:57:53 +00:00
|
|
|
explicit AiActivate(const ESM::AiSequence::AiActivate* activate);
|
2014-06-12 21:27:04 +00:00
|
|
|
|
2020-10-22 21:57:53 +00:00
|
|
|
bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) override;
|
2020-05-16 19:08:39 +00:00
|
|
|
|
2020-05-16 19:52:16 +00:00
|
|
|
static constexpr AiPackageTypeId getTypeId() { return AiPackageTypeId::Activate; }
|
2012-11-15 21:22:44 +00:00
|
|
|
|
2020-10-22 21:57:53 +00:00
|
|
|
void writeState(ESM::AiSequence::AiSequence& sequence) const override;
|
2014-06-12 21:27:04 +00:00
|
|
|
|
2014-04-01 18:15:55 +00:00
|
|
|
private:
|
2020-06-02 19:30:46 +00:00
|
|
|
const std::string mObjectId;
|
2018-07-10 05:21:24 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
Start of tes3mp addition
|
|
|
|
|
|
|
|
Track the object associated with this AiActivate package
|
|
|
|
*/
|
|
|
|
MWWorld::Ptr mObjectPtr;
|
|
|
|
/*
|
|
|
|
End of tes3mp addition
|
|
|
|
*/
|
2012-11-16 17:38:15 +00:00
|
|
|
};
|
2012-11-15 21:22:44 +00:00
|
|
|
}
|
|
|
|
#endif // GAME_MWMECHANICS_AIACTIVATE_H
|