2017-09-27 04:31:41 -03:00
|
|
|
#ifndef _ACTIONCOLLISION_H
|
|
|
|
#define _ACTIONCOLLISION_H
|
|
|
|
|
2017-12-18 12:36:52 +01:00
|
|
|
#include <common/Common.h>
|
2018-01-31 11:43:22 +01:00
|
|
|
#include <common/Exd/ExdDataGenerated.h>
|
2017-09-27 04:31:41 -03:00
|
|
|
|
2017-12-08 15:38:25 +01:00
|
|
|
#include "Actor/Actor.h"
|
2017-09-27 04:31:41 -03:00
|
|
|
#include "Action.h"
|
|
|
|
|
|
|
|
namespace Core {
|
2017-12-08 23:27:59 +01:00
|
|
|
namespace Entity {
|
|
|
|
|
|
|
|
enum class TargetFilter
|
|
|
|
{
|
|
|
|
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:
|
|
|
|
|
2018-02-10 01:21:31 +01:00
|
|
|
static bool isActorApplicable( Actor& actor, TargetFilter targetFilter );
|
2017-12-08 23:27:59 +01:00
|
|
|
static std::set< ActorPtr > getActorsHitFromAction( Common::FFXIVARR_POSITION3 aoePosition,
|
2018-02-19 22:00:32 +01:00
|
|
|
std::set< ActorPtr > actorsInRange,
|
2018-01-31 11:43:22 +01:00
|
|
|
boost::shared_ptr< Data::Action > actionInfo,
|
2017-12-08 23:27:59 +01:00
|
|
|
TargetFilter targetFilter );
|
|
|
|
|
|
|
|
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 );
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
2017-09-27 04:31:41 -03:00
|
|
|
}
|
|
|
|
|
2017-12-08 15:38:25 +01:00
|
|
|
#endif
|