TrinityCore
MovementDefines.h
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef TRINITY_MOVEMENTDEFINES_H
19#define TRINITY_MOVEMENTDEFINES_H
20
21#include "Common.h"
22#include "ObjectGuid.h"
23#include "Optional.h"
24
25#define SPEED_CHARGE 42.0f // assume it is 25 yard per 0.6 second
26
27// EnumUtils: DESCRIBE THIS
29{
30 IDLE_MOTION_TYPE = 0, // IdleMovementGenerator.h
31 RANDOM_MOTION_TYPE = 1, // RandomMovementGenerator.h
32 WAYPOINT_MOTION_TYPE = 2, // WaypointMovementGenerator.h
33 MAX_DB_MOTION_TYPE = 3, // Below motion types can't be set in DB.
34 CONFUSED_MOTION_TYPE = 4, // ConfusedMovementGenerator.h
35 CHASE_MOTION_TYPE = 5, // ChaseMovementGenerator.h
36 HOME_MOTION_TYPE = 6, // HomeMovementGenerator.h
37 FLIGHT_MOTION_TYPE = 7, // FlightPathMovementGenerator.h
38 POINT_MOTION_TYPE = 8, // PointMovementGenerator.h
39 FLEEING_MOTION_TYPE = 9, // FleeingMovementGenerator.h
40 DISTRACT_MOTION_TYPE = 10, // IdleMovementGenerator.h
41 ASSISTANCE_MOTION_TYPE = 11, // PointMovementGenerator.h
42 ASSISTANCE_DISTRACT_MOTION_TYPE = 12, // IdleMovementGenerator.h
43 TIMED_FLEEING_MOTION_TYPE = 13, // FleeingMovementGenerator.h
44 FOLLOW_MOTION_TYPE = 14, // FollowMovementGenerator.h
45 ROTATE_MOTION_TYPE = 15, // IdleMovementGenerator.h
47 SPLINE_CHAIN_MOTION_TYPE = 17, // SplineChainMovementGenerator.h
48 FORMATION_MOTION_TYPE = 18, // FormationMovementGenerator.h
49 MAX_MOTION_TYPE // SKIP
50};
51
53{
56};
57
59{
63};
64
66{
70};
71
73{
74 Default,
77};
78
80{
81 Finished, // Movement finished either by arriving at location or successfully continuing it for requested duration
83};
84
86{
89};
90
92{
93 ChaseRange(float range);
94 ChaseRange(float _minRange, float _maxRange);
95 ChaseRange(float _minRange, float _minTolerance, float _maxTolerance, float _maxRange);
96
97 // this contains info that informs how we should path!
98 float MinRange; // we have to move if we are within this range... (min. attack range)
99 float MinTolerance; // ...and if we are, we will move this far away
100 float MaxRange; // we have to move if we are outside this range... (max. attack range)
101 float MaxTolerance; // ...and if we are, we will move into this range
102};
103
105{
106 ChaseAngle(float angle, float _tolerance = M_PI_4);
107
108 float RelativeAngle; // we want to be at this angle relative to the target (0 = front, M_PI = back)
109 float Tolerance; // but we'll tolerate anything within +- this much
110
111 float UpperBound() const;
112 float LowerBound() const;
113 bool IsAngleOkay(float relativeAngle) const;
114};
115
117{
120};
121
123{
124 union
125 {
126 float Speed;
128 };
129
131
132 float JumpGravity = 0.0f;
133
137};
138
139inline bool IsInvalidMovementGeneratorType(uint8 const type) { return type == MAX_DB_MOTION_TYPE || type >= MAX_MOTION_TYPE; }
140inline bool IsInvalidMovementSlot(uint8 const slot) { return slot >= MAX_MOTION_SLOT; }
141
142#endif
#define M_PI_4
Definition: Common.h:119
#define TC_GAME_API
Definition: Define.h:123
uint8_t uint8
Definition: Define.h:144
uint32_t uint32
Definition: Define.h:142
bool IsInvalidMovementSlot(uint8 const slot)
MovementGeneratorMode
@ MOTION_MODE_DEFAULT
@ MOTION_MODE_OVERRIDE
RotateDirection
@ ROTATE_DIRECTION_RIGHT
@ ROTATE_DIRECTION_LEFT
MovementGeneratorPriority
@ MOTION_PRIORITY_HIGHEST
@ MOTION_PRIORITY_NONE
@ MOTION_PRIORITY_NORMAL
MovementSlot
@ MOTION_SLOT_ACTIVE
@ MAX_MOTION_SLOT
@ MOTION_SLOT_DEFAULT
MovementGeneratorType
@ TIMED_FLEEING_MOTION_TYPE
@ MAX_DB_MOTION_TYPE
@ FORMATION_MOTION_TYPE
@ ASSISTANCE_MOTION_TYPE
@ DISTRACT_MOTION_TYPE
@ IDLE_MOTION_TYPE
@ CHASE_MOTION_TYPE
@ SPLINE_CHAIN_MOTION_TYPE
@ MAX_MOTION_TYPE
@ ROTATE_MOTION_TYPE
@ WAYPOINT_MOTION_TYPE
@ FLEEING_MOTION_TYPE
@ CONFUSED_MOTION_TYPE
@ HOME_MOTION_TYPE
@ POINT_MOTION_TYPE
@ FLIGHT_MOTION_TYPE
@ FOLLOW_MOTION_TYPE
@ RANDOM_MOTION_TYPE
@ ASSISTANCE_DISTRACT_MOTION_TYPE
@ EFFECT_MOTION_TYPE
MovementWalkRunSpeedSelectionMode
bool IsInvalidMovementGeneratorType(uint8 const type)
MovementStopReason
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition: Optional.h:25
float RelativeAngle
float MaxTolerance
float MinTolerance
bool TreatSpeedAsMoveTimeSeconds
Optional< uint32 > ParabolicCurveId
Optional< uint32 > SpellVisualId
Optional< uint32 > ProgressCurveId