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