5 #include "../EffectID.h"
20 Super(pkSplashPotion, a_Creator, a_Pos, a_Speed, 0.25f, 0.25f),
40 if (!a_Entity.IsPawn())
46 double SplashDistance = (a_Entity.GetPosition() - a_HitPos).Length();
47 double Reduction = -0.25 * SplashDistance + 1.0;
48 Reduction = std::max(Reduction, 0.0);
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc.
void Destroy()
Destroys the entity, schedules it for memory freeing and broadcasts the DestroyEntity packet.
void TakeDamage(cEntity &a_Attacker)
Makes this pawn take damage from an attack by a_Attacker.
static int GetPotionEffectDuration(short a_ItemDamage)
Returns the effect duration, in ticks, based on the potion's damage value.
static int GetPotionColor(short a_ItemDamage)
Returns the potion color (used by the client for visuals), based on the potion's damage value.
short GetIntensity(void) const
Returns how strong the effect will be applied.
int GetDuration(void) const
Returns the duration of the effect.
static short GetPotionEffectIntensity(short a_ItemDamage)
Retrieves the intensity level from the potion's damage value.
static cEntityEffect::eType GetPotionEffectType(short a_ItemDamage)
Translates the potion's damage value into the entity effect that the potion gives.
virtual void OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace)
Called by the physics blocktracer when the entity hits a solid block, the hit position and the face h...
virtual void OnHitEntity(cEntity &a_EntityHit, Vector3d a_HitPos)
Called by the physics blocktracer when the entity hits another entity.
cEntityEffect m_EntityEffect
cEntityEffect::eType m_EntityEffectType
void Splash(Vector3d a_HitPos)
Splashes the potion, fires its particle effects and sounds.
virtual void OnHitEntity(cEntity &a_EntityHit, Vector3d a_HitPos) override
Called by the physics blocktracer when the entity hits another entity.
virtual void OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace) override
Called by the physics blocktracer when the entity hits a solid block, the hit position and the face h...
cSplashPotionEntity(cEntity *a_Creator, Vector3d a_Pos, Vector3d a_Speed, const cItem &a_Item)
Vector3< T > addedY(T a_AddY) const
Returns a copy of this vector moved by the specified amount on the y axis.
Vector3< int > Floor(void) const
Returns a new Vector3i with coords set to std::floor() of this vector's coords.
virtual bool ForEachEntityInBox(const cBoundingBox &a_Box, cEntityCallback a_Callback) override
Calls the callback for each entity that has a nonempty intersection with the specified boundingbox.
virtual void BroadcastSoundParticleEffect(const EffectID a_EffectID, Vector3i a_SrcPos, int a_Data, const cClientHandle *a_Exclude=nullptr) override