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