summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHownaer <franzi.moos@googlemail.com>2014-08-28 23:02:20 +0200
committerHownaer <franzi.moos@googlemail.com>2014-08-28 23:02:20 +0200
commit240ec9b4bdd70f29aea3340f8f684818022122fd (patch)
tree34b48e1fd0c9d5a623c99ac86da1f7f9d1688608
parentFire can be destroyed with the sword in creative-mode (diff)
downloadcuberite-240ec9b4bdd70f29aea3340f8f684818022122fd.tar
cuberite-240ec9b4bdd70f29aea3340f8f684818022122fd.tar.gz
cuberite-240ec9b4bdd70f29aea3340f8f684818022122fd.tar.bz2
cuberite-240ec9b4bdd70f29aea3340f8f684818022122fd.tar.lz
cuberite-240ec9b4bdd70f29aea3340f8f684818022122fd.tar.xz
cuberite-240ec9b4bdd70f29aea3340f8f684818022122fd.tar.zst
cuberite-240ec9b4bdd70f29aea3340f8f684818022122fd.zip
-rw-r--r--src/ClientHandle.cpp2
-rw-r--r--src/Entities/EntityEffect.cpp41
-rw-r--r--src/Entities/EntityEffect.h4
3 files changed, 46 insertions, 1 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index f9c6a664c..5ad9dc644 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -1063,7 +1063,7 @@ void cClientHandle::HandleBlockDigStarted(int a_BlockX, int a_BlockY, int a_Bloc
(m_Player->GetWorld()->GetBlock(a_BlockX, a_BlockY, a_BlockZ) != E_BLOCK_FIRE)
)
{
- // Players can't destroy blocks with a Sword in the hand.
+ // Players can't destroy blocks with a sword in the hand.
return;
}
diff --git a/src/Entities/EntityEffect.cpp b/src/Entities/EntityEffect.cpp
index 3e28392f4..58b76b21b 100644
--- a/src/Entities/EntityEffect.cpp
+++ b/src/Entities/EntityEffect.cpp
@@ -233,6 +233,47 @@ void cEntityEffect::OnTick(cPawn & a_Target)
////////////////////////////////////////////////////////////////////////////////
+// cEntityEffectSpeed:
+
+void cEntityEffectSpeed::OnActivate(cPawn & a_Target)
+{
+ // TODO: Add SetMormalMaxSpeed to cMonster
+
+ if (!a_Target.IsPlayer())
+ {
+ return;
+ }
+ cPlayer * Player = (cPlayer*) &a_Target;
+
+ Player->SetNormalMaxSpeed(1.0 + 0.2 * m_Intensity);
+ Player->SetSprintingMaxSpeed(1.3 + 0.26 * m_Intensity);
+ Player->SetFlyingMaxSpeed(1.0 + 0.2 * m_Intensity);
+}
+
+
+
+
+
+void cEntityEffectSpeed::OnDeactivate(cPawn & a_Target)
+{
+ // TODO: Add SetMormalMaxSpeed to cMonster
+
+ if (!a_Target.IsPlayer())
+ {
+ return;
+ }
+ cPlayer * Player = (cPlayer*) &a_Target;
+
+ Player->SetNormalMaxSpeed(1.0);
+ Player->SetSprintingMaxSpeed(1.3);
+ Player->SetFlyingMaxSpeed(1.0);
+}
+
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
// cEntityEffectInstantHealth:
void cEntityEffectInstantHealth::OnActivate(cPawn & a_Target)
diff --git a/src/Entities/EntityEffect.h b/src/Entities/EntityEffect.h
index 47c298f57..e123a7f77 100644
--- a/src/Entities/EntityEffect.h
+++ b/src/Entities/EntityEffect.h
@@ -137,6 +137,10 @@ public:
super(a_Duration, a_Intensity, a_DistanceModifier)
{
}
+
+ virtual void OnActivate(cPawn & a_Target) override;
+
+ virtual void OnDeactivate(cPawn & a_Target) override;
};