diff options
author | Hownaer <franzi.moos@googlemail.com> | 2014-08-28 23:02:20 +0200 |
---|---|---|
committer | Hownaer <franzi.moos@googlemail.com> | 2014-08-28 23:02:20 +0200 |
commit | 240ec9b4bdd70f29aea3340f8f684818022122fd (patch) | |
tree | 34b48e1fd0c9d5a623c99ac86da1f7f9d1688608 /src/Entities/EntityEffect.cpp | |
parent | Fire can be destroyed with the sword in creative-mode (diff) | |
download | cuberite-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 |
Diffstat (limited to '')
-rw-r--r-- | src/Entities/EntityEffect.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
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) |