2015-01-05 17:52:37 +00:00
|
|
|
#ifndef OPENMW_MECHANICS_SUMMONING_H
|
|
|
|
#define OPENMW_MECHANICS_SUMMONING_H
|
|
|
|
|
|
|
|
#include <set>
|
|
|
|
|
|
|
|
#include "../mwworld/ptr.hpp"
|
|
|
|
|
2020-08-28 18:43:22 +00:00
|
|
|
#include <components/esm/magiceffects.hpp>
|
|
|
|
|
2016-06-17 14:07:16 +00:00
|
|
|
#include "magiceffects.hpp"
|
|
|
|
|
2015-01-05 17:52:37 +00:00
|
|
|
namespace MWMechanics
|
|
|
|
{
|
|
|
|
class CreatureStats;
|
|
|
|
|
2020-04-04 14:45:03 +00:00
|
|
|
bool isSummoningEffect(int effectId);
|
|
|
|
|
2020-04-04 13:27:00 +00:00
|
|
|
std::string getSummonedCreature(int effectId);
|
|
|
|
|
2021-06-06 10:45:42 +00:00
|
|
|
void purgeSummonEffect(const MWWorld::Ptr& summoner, const std::pair<const ESM::SummonKey, int>& summon);
|
|
|
|
|
2015-01-05 17:52:37 +00:00
|
|
|
struct UpdateSummonedCreatures : public EffectSourceVisitor
|
|
|
|
{
|
|
|
|
UpdateSummonedCreatures(const MWWorld::Ptr& actor);
|
2020-04-04 13:27:00 +00:00
|
|
|
virtual ~UpdateSummonedCreatures() = default;
|
2015-01-05 17:52:37 +00:00
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
void visit (MWMechanics::EffectKey key, int effectIndex,
|
2020-06-08 11:19:25 +00:00
|
|
|
const std::string& sourceName, const std::string& sourceId, int casterActorId,
|
2020-10-16 18:18:54 +00:00
|
|
|
float magnitude, float remainingTime = -1, float totalTime = -1) override;
|
2015-01-05 17:52:37 +00:00
|
|
|
|
|
|
|
/// To call after all effect sources have been visited
|
2017-08-18 07:58:28 +00:00
|
|
|
void process(bool cleanup);
|
2015-01-05 17:52:37 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
MWWorld::Ptr mActor;
|
|
|
|
|
2020-08-28 18:43:22 +00:00
|
|
|
std::set<ESM::SummonKey> mActiveEffects;
|
2015-01-05 17:52:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|