summaryrefslogtreecommitdiffstats
path: root/src/Entities/ExpOrb.cpp
diff options
context:
space:
mode:
authorAlexander Harkness <bearbin@gmail.com>2014-02-16 08:05:11 +0100
committerAlexander Harkness <bearbin@gmail.com>2014-02-16 08:05:11 +0100
commit233f0add2930f316c5fafce9e29a12f2e4f007bc (patch)
tree8007f9a88f30eb7b209c68e9ab2a88bb290d382b /src/Entities/ExpOrb.cpp
parentRemoved the unnecessary LoopPlayersAndBroadcastChat() functions. (diff)
parentReplace random Float Generation and broadcast the Exp Pickup Sound (diff)
downloadcuberite-233f0add2930f316c5fafce9e29a12f2e4f007bc.tar
cuberite-233f0add2930f316c5fafce9e29a12f2e4f007bc.tar.gz
cuberite-233f0add2930f316c5fafce9e29a12f2e4f007bc.tar.bz2
cuberite-233f0add2930f316c5fafce9e29a12f2e4f007bc.tar.lz
cuberite-233f0add2930f316c5fafce9e29a12f2e4f007bc.tar.xz
cuberite-233f0add2930f316c5fafce9e29a12f2e4f007bc.tar.zst
cuberite-233f0add2930f316c5fafce9e29a12f2e4f007bc.zip
Diffstat (limited to 'src/Entities/ExpOrb.cpp')
-rw-r--r--src/Entities/ExpOrb.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Entities/ExpOrb.cpp b/src/Entities/ExpOrb.cpp
index 04ee85823..41b60cc3b 100644
--- a/src/Entities/ExpOrb.cpp
+++ b/src/Entities/ExpOrb.cpp
@@ -51,6 +51,11 @@ void cExpOrb::Tick(float a_Dt, cChunk & a_Chunk)
{
LOGD("Player %s picked up an ExpOrb. His reward is %i", a_ClosestPlayer->GetName().c_str(), m_Reward);
a_ClosestPlayer->DeltaExperience(m_Reward);
+
+ float r1 = (float) (0.75 + ((float)((GetUniqueID() * 23) % 32)) / 64); // Random Float Value
+ float r2 = (float) (0.75 + ((float)((GetUniqueID() * 23) % 32)) / 64); // Random Float Value
+ m_World->BroadcastSoundEffect("random.orb", (int) (GetPosX() * 8.0F), (int) (GetPosY() * 8.0F), (int) (GetPosZ() * 8.0F), 0.1F, 0.5F * ((r1 - r2) * 0.7F + 1.8F));
+
Destroy(true);
}
a_Distance.Normalize();
@@ -61,4 +66,4 @@ void cExpOrb::Tick(float a_Dt, cChunk & a_Chunk)
BroadcastMovementUpdate();
}
HandlePhysics(a_Dt, a_Chunk);
-} \ No newline at end of file
+}