From 347162a82f2cba75c4eb7739d4405ea78de4f0b5 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Tue, 12 Nov 2013 21:43:20 +0000 Subject: Bundled fixes [SEE DESC] * BoundingBox now returns FACE_NONE + Arrows can be picked up * Arrows dug up resume physics simulations * Added sound effects for bows, lava to stone, and arrows * Fixed SoundParticleEffect on <1.7 protocols --- source/Entities/ProjectileEntity.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'source/Entities/ProjectileEntity.h') diff --git a/source/Entities/ProjectileEntity.h b/source/Entities/ProjectileEntity.h index 547aa174e..359b0241b 100644 --- a/source/Entities/ProjectileEntity.h +++ b/source/Entities/ProjectileEntity.h @@ -53,6 +53,9 @@ public: /// Called by the physics blocktracer when the entity hits another entity virtual void OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos) {} + /// Called by Chunk when the projectile is eligible for player collection + virtual void CollectedBy(cPlayer * a_Dest); + // tolua_begin /// Returns the kind of the projectile (fast class identification) @@ -80,7 +83,7 @@ protected: /// True if the projectile has hit the ground and is stuck there bool m_IsInGround; - + // cEntity overrides: virtual void Tick(float a_Dt, cChunk & a_Chunk) override; virtual void HandlePhysics(float a_Dt, cChunk & a_Chunk) override; @@ -153,9 +156,20 @@ protected: /// If true, the arrow deals more damage bool m_IsCritical; + /// Timer for pickup collection animation or five minute timeout + float m_Timer; + + /// If true, the arrow is in the process of being collected - don't go to anyone else + bool m_bIsCollected; + + /// Stores the block position that arrow is lodged into, sets m_IsInGround to false if it becomes air + Vector3i m_HitBlockPos; + // cProjectileEntity overrides: virtual void OnHitSolidBlock(const Vector3d & a_HitPos, char a_HitFace) override; virtual void OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos) override; + virtual void CollectedBy(cPlayer * a_Player) override; + virtual void Tick(float a_Dt, cChunk & a_Chunk) override; // tolua_begin } ; -- cgit v1.2.3