107 virtual void Tick(std::chrono::milliseconds a_Dt,
cChunk & a_Chunk)
override;
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc.
#define CLASS_PROTODEF(classname)
double m_DamageCoeff
The coefficient applied to the damage that the arrow will deal, based on the bow enchantment.
bool m_IsCritical
If true, the arrow deals more damage.
ePickupState m_PickupState
Determines when the arrow can be picked up by players.
virtual bool DoesPreventBlockPlacement(void) const override
Returns whether blocks can be placed intersecting this entities' hitbox.
cArrowEntity(cEntity *a_Creator, Vector3d a_Pos, Vector3d a_Speed)
Creates a new arrow with psNoPickup state and default damage modifier coeff.
std::chrono::milliseconds m_Timer
Timer for pickup collection animation or five minute timeout.
bool CanPickup(const cPlayer &a_Player) const
Returns true if the specified player can pick the arrow up.
bool m_bIsCollected
If true, the arrow is in the process of being collected - don't go to anyone else.
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...
void SetPickupState(ePickupState a_PickupState)
Sets a new pickup state.
void SetIsCritical(bool a_IsCritical)
Sets the IsCritical flag.
ePickupState GetPickupState(void) const
Returns whether the arrow can be picked up by players.
virtual void OnHitEntity(cEntity &a_EntityHit, Vector3d a_HitPos) override
Called by the physics blocktracer when the entity hits another entity.
void SetDamageCoeff(double a_DamageCoeff)
Sets the damage modifier coeff.
bool IsCritical(void) const
Returns true if the arrow is set as critical.
double GetDamageCoeff(void) const
Returns the damage modifier coeff.
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
ePickupState
Determines when the arrow can be picked up (depending on player gamemode).
Vector3i GetBlockHit(void) const
Gets the block arrow is in.
virtual void CollectedBy(cPlayer &a_Player) override
Called by Chunk when the projectile is eligible for player collection.
static constexpr float ARROW_WATER_FRICTION
Value used to calculate arrow speed in water.
Vector3i m_HitBlockPos
Stores the block position that arrow is lodged into, sets m_IsInGround to false if it becomes air.
void SetBlockHit(const Vector3i &a_BlockHit)
Sets the block arrow is in.
cProjectileEntity(eKind a_Kind, cEntity *a_Creator, Vector3d a_Pos, float a_Width, float a_Height)