2017-09-27 04:31:41 -03:00
|
|
|
#ifndef _ACTIONCOLLISION_H
|
|
|
|
#define _ACTIONCOLLISION_H
|
|
|
|
|
|
|
|
#include <src/servers/Server_Common/Common.h>
|
|
|
|
|
|
|
|
#include <src/servers/Server_Zone/Actor/Actor.h>
|
|
|
|
#include "Action.h"
|
|
|
|
|
|
|
|
namespace Core {
|
|
|
|
namespace Entity {
|
|
|
|
|
2017-10-01 21:50:09 -03:00
|
|
|
enum class TargetFilter
|
2017-09-27 04:31:41 -03:00
|
|
|
{
|
|
|
|
All, // All actors in the AoE are applicable for collision
|
|
|
|
Players, // Only players
|
|
|
|
Allies, // Only allies (players, ally NPCs)
|
|
|
|
Party, // Only party members
|
|
|
|
Enemies // Only enemies
|
|
|
|
};
|
|
|
|
|
|
|
|
class ActionCollision
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2017-10-01 21:50:09 -03:00
|
|
|
static bool isActorApplicable( ActorPtr actorPtr, TargetFilter targetFilter );
|
|
|
|
static std::set< ActorPtr > getActorsHitFromAction( Common::FFXIVARR_POSITION3 aoePosition, std::set< ActorPtr > actorsInRange, boost::shared_ptr< Data::ActionInfo > actionInfo, TargetFilter targetFilter );
|
2017-09-27 04:31:41 -03:00
|
|
|
|
|
|
|
private:
|
|
|
|
static bool radiusCollision( Common::FFXIVARR_POSITION3 actorPosition, Common::FFXIVARR_POSITION3 aoePosition, uint16_t radius );
|
|
|
|
static bool boxCollision( Common::FFXIVARR_POSITION3 actorPosition, Common::FFXIVARR_POSITION3 aoePosition, uint16_t width, uint16_t height );
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|