mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 00:49:54 +00:00
c4950f1beb
When determining actors siding with someone, also check the team members of DedicatedPlayers, not just those of the LocalPlayer. Don't set players as each other's hitAttemptActor if they are team members. Don't run startCombat() for DedicatedPlayers who get attacked.
55 lines
2.1 KiB
C++
55 lines
2.1 KiB
C++
#ifndef OPENMW_MECHANICSHELPER_HPP
|
|
#define OPENMW_MECHANICSHELPER_HPP
|
|
|
|
#include <components/openmw-mp/Base/BaseStructs.hpp>
|
|
|
|
#include "../mwworld/containerstore.hpp"
|
|
|
|
#include <osg/Vec3f>
|
|
|
|
|
|
namespace MechanicsHelper
|
|
{
|
|
osg::Vec3f getLinearInterpolation(osg::Vec3f start, osg::Vec3f end, float percent);
|
|
ESM::Position getPositionFromVector(osg::Vec3f vector);
|
|
|
|
void spawnLeveledCreatures(MWWorld::CellStore* cellStore);
|
|
|
|
bool isUsingRangedWeapon(const MWWorld::Ptr& ptr);
|
|
|
|
mwmp::Attack *getLocalAttack(const MWWorld::Ptr& ptr);
|
|
mwmp::Attack *getDedicatedAttack(const MWWorld::Ptr& ptr);
|
|
|
|
mwmp::Cast *getLocalCast(const MWWorld::Ptr& ptr);
|
|
mwmp::Cast *getDedicatedCast(const MWWorld::Ptr& ptr);
|
|
|
|
MWWorld::Ptr getPlayerPtr(const mwmp::Target& target);
|
|
|
|
mwmp::Item getItem(const MWWorld::Ptr& itemPtr, int count);
|
|
mwmp::Target getTarget(const MWWorld::Ptr& ptr);
|
|
void clearTarget(mwmp::Target& target);
|
|
bool isEmptyTarget(const mwmp::Target& target);
|
|
|
|
void assignAttackTarget(mwmp::Attack* attack, const MWWorld::Ptr& target);
|
|
void resetAttack(mwmp::Attack* attack);
|
|
void resetCast(mwmp::Cast* cast);
|
|
|
|
// See whether playerChecked belongs to playerWithTeam's team
|
|
// Note: This is not supposed to also check if playerWithTeam is on playerChecked's
|
|
// team, because it should technically be possible to be allied to someone
|
|
// who isn't mutually allied to you
|
|
bool isTeamMember(const MWWorld::Ptr& playerChecked, const MWWorld::Ptr& playerWithTeam);
|
|
|
|
bool getSpellSuccess(std::string spellId, const MWWorld::Ptr& caster);
|
|
|
|
void processAttack(mwmp::Attack attack, const MWWorld::Ptr& attacker);
|
|
void processCast(mwmp::Cast cast, const MWWorld::Ptr& caster);
|
|
|
|
bool doesEffectListContainEffect(const ESM::EffectList& effectList, short effectId, short attributeId = -1, short skillId = -1);
|
|
void unequipItemsByEffect(const MWWorld::Ptr& ptr, short enchantmentType, short effectId, short attributeId = -1, short skillId = -1);
|
|
|
|
MWWorld::Ptr getItemPtrFromStore(const mwmp::Item& item, MWWorld::ContainerStore& store);
|
|
}
|
|
|
|
|
|
#endif //OPENMW_MECHANICSHELPER_HPP
|