1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-01 04:45:34 +00:00

Move isSummoningEffect to summoning

This commit is contained in:
Capostrophic 2020-04-04 17:45:03 +03:00
parent 5535a7fb44
commit 5973285446
5 changed files with 11 additions and 12 deletions

View file

@ -27,6 +27,7 @@
#include "actorutil.hpp"
#include "aifollow.hpp"
#include "weapontype.hpp"
#include "summoning.hpp"
namespace MWMechanics
{
@ -1104,15 +1105,6 @@ namespace MWMechanics
return static_cast<int>((result < 1) ? 1 : result);
}
bool isSummoningEffect(int effectId)
{
return ((effectId >= ESM::MagicEffect::SummonScamp
&& effectId <= ESM::MagicEffect::SummonStormAtronach)
|| effectId == ESM::MagicEffect::SummonCenturionSphere
|| (effectId >= ESM::MagicEffect::SummonFabricant
&& effectId <= ESM::MagicEffect::SummonCreature05));
}
bool disintegrateSlot (MWWorld::Ptr ptr, int slot, float disintegrate)
{
if (ptr.getClass().hasInventoryStore(ptr))

View file

@ -27,8 +27,6 @@ namespace MWMechanics
float calcEffectCost(const ESM::ENAMstruct& effect, const ESM::MagicEffect* magicEffect = nullptr);
bool isSummoningEffect(int effectId);
/**
* @param spell spell to cast
* @param actor calculate spell success chance for this actor (depends on actor's skills)

View file

@ -18,6 +18,7 @@
#include "spellcasting.hpp"
#include "weapontype.hpp"
#include "combat.hpp"
#include "summoning.hpp"
namespace
{

View file

@ -13,13 +13,19 @@
#include "../mwrender/animation.hpp"
#include "spellcasting.hpp"
#include "creaturestats.hpp"
#include "aifollow.hpp"
namespace MWMechanics
{
bool isSummoningEffect(int effectId)
{
return ((effectId >= ESM::MagicEffect::SummonScamp && effectId <= ESM::MagicEffect::SummonStormAtronach)
|| (effectId == ESM::MagicEffect::SummonCenturionSphere)
|| (effectId >= ESM::MagicEffect::SummonFabricant && effectId <= ESM::MagicEffect::SummonCreature05));
}
std::string getSummonedCreature(int effectId)
{
static const std::map<int, std::string> summonMap

View file

@ -11,6 +11,8 @@ namespace MWMechanics
{
class CreatureStats;
bool isSummoningEffect(int effectId);
std::string getSummonedCreature(int effectId);
struct UpdateSummonedCreatures : public EffectSourceVisitor