27 virtual void Tick(std::chrono::milliseconds a_Dt,
cChunk & a_Chunk)
override;
101 typedef std::map<cEntityEffect::eType, std::unique_ptr<cEntityEffect>>
tEffectMap;
unsigned char BLOCKTYPE
The datatype used by blockdata.
eDamageType
Damage type, used in the TakeDamageInfo structure and related functions.
#define CLASS_PROTODEF(classname)
Represents two sets of coords, minimum and maximum for each direction.
cEntity(eEntityType a_EntityType, Vector3d a_Pos, float a_Width, float a_Height)
eType
All types of entity effects (numbers correspond to protocol / storage types)
void HandleFarmlandTrampling(double a_FallHeight, BLOCKTYPE a_BlockAtFoot, BLOCKTYPE a_BlockBelow)
Handles farmland trampling when hitting the ground.
void ClearEntityEffects(void)
Removes all currently applied entity effects (used when drinking milk)
bool DeductTotem(eDamageType a_DamageType)
Attempt to activate a Totem of Undying.
tEffectMap m_EntityEffects
std::map< cEntityEffect::eType, std::unique_ptr< cEntityEffect > > tEffectMap
virtual bool IsInvisible() const override
cEntityEffect * GetEntityEffect(cEntityEffect::eType a_EffectType) const
Returns the entity effect, if it is currently applied or nullptr if not.
virtual void ResetPosition(Vector3d a_NewPosition) override
Set the entities position and last sent position.
virtual void HandleFalling(void)
void TargetingMe(cMonster *a_Monster)
Add the monster to the list of monsters targeting this pawn.
void StopEveryoneFromTargetingMe()
Tells all pawns which are targeting us to stop targeting us.
std::map< cEntityEffect::eType, cEntityEffect * > GetEntityEffects() const
Returns all entity effects.
std::vector< cMonster * > m_TargetingMe
A list of all monsters that are targeting this pawn.
bool HasEntityEffect(cEntityEffect::eType a_EffectType) const
Returns true, if the entity effect is currently applied.
virtual void HandleAir(void) override
Called in each tick to handle air-related processing i.e.
void AddEntityEffect(cEntityEffect::eType a_EffectType, int a_EffectDurationTicks, short a_EffectIntensity, double a_DistanceModifier=1)
Applies an entity effect.
double m_LastGroundHeight
void RemoveEntityEffect(cEntityEffect::eType a_EffectType)
Removes a currently applied entity effect.
static bool FindTeleportDestination(cWorld &a_World, const int a_HeightRequired, const unsigned int a_NumTries, Vector3d &a_Destination, const Vector3i a_MinBoxCorner, const Vector3i a_MaxBoxCorner)
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
virtual void OnRemoveFromWorld(cWorld &a_World) override
Called when the entity is removed from a world.
cPawn(eEntityType a_EntityType, float a_Width, float a_Height)
virtual bool IsFireproof(void) const override
void NoLongerTargetingMe(cMonster *a_Monster)
Remove the monster from the list of monsters targeting this pawn.
virtual void KilledBy(TakeDamageInfo &a_TDI) override
Called when the health drops below zero.