summaryrefslogtreecommitdiffstats
path: root/src/Entities/SplashPotionEntity.h
diff options
context:
space:
mode:
authorarchshift <admin@archshift.com>2014-06-08 06:56:01 +0200
committerarchshift <admin@archshift.com>2014-06-17 20:39:20 +0200
commit58f35af6e71f11844b9c6c1d1ebd2d7390439cca (patch)
treeba93d854c83bebfc32f691be795564c975a734cc /src/Entities/SplashPotionEntity.h
parentEntity: only fire critical hit if damage type is physical (diff)
downloadcuberite-58f35af6e71f11844b9c6c1d1ebd2d7390439cca.tar
cuberite-58f35af6e71f11844b9c6c1d1ebd2d7390439cca.tar.gz
cuberite-58f35af6e71f11844b9c6c1d1ebd2d7390439cca.tar.bz2
cuberite-58f35af6e71f11844b9c6c1d1ebd2d7390439cca.tar.lz
cuberite-58f35af6e71f11844b9c6c1d1ebd2d7390439cca.tar.xz
cuberite-58f35af6e71f11844b9c6c1d1ebd2d7390439cca.tar.zst
cuberite-58f35af6e71f11844b9c6c1d1ebd2d7390439cca.zip
Diffstat (limited to 'src/Entities/SplashPotionEntity.h')
-rw-r--r--src/Entities/SplashPotionEntity.h30
1 files changed, 27 insertions, 3 deletions
diff --git a/src/Entities/SplashPotionEntity.h b/src/Entities/SplashPotionEntity.h
index d82a7bfcd..b64b668a5 100644
--- a/src/Entities/SplashPotionEntity.h
+++ b/src/Entities/SplashPotionEntity.h
@@ -5,7 +5,8 @@
#pragma once
#include "ProjectileEntity.h"
-
+#include "EntityEffects.h"
+#include "../World.h"
@@ -13,7 +14,7 @@
// tolua_begin
class cSplashPotionEntity :
-public cProjectileEntity
+ public cProjectileEntity
{
typedef cProjectileEntity super;
@@ -23,7 +24,7 @@ public:
CLASS_PROTODEF(cSplashPotionEntity);
- cSplashPotionEntity(cEntity * a_Creator, double a_X, double a_Y, double a_Z, const Vector3d & a_Speed);
+ cSplashPotionEntity(cEntity * a_Creator, double a_X, double a_Y, double a_Z, const Vector3d & a_Speed, cEntityEffect::eType a_EntityEffectType, cEntityEffect a_EntityEffect, int a_PotionName);
protected:
@@ -31,4 +32,27 @@ protected:
virtual void OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace) override;
virtual void OnHitEntity (cEntity & a_EntityHit, const Vector3d & a_HitPos) override;
+ /** Splashes the potion, fires its particle effects and sounds
+ * @param a_HitPos The position where the potion will splash
+ */
+ void Splash(const Vector3d & a_HitPos);
+
+ cEntityEffect::eType m_EntityEffectType;
+ cEntityEffect m_EntityEffect;
+ int m_PotionName;
+
+ class cSplashPotionCallback :
+ public cPlayerListCallback
+ {
+ public:
+ cSplashPotionCallback(const Vector3d & a_HitPos, cEntityEffect::eType &a_EntityEffectType, cEntityEffect &a_EntityEffect);
+
+ virtual bool Item(cPlayer * a_Player) override;
+
+ private:
+ const Vector3d &m_HitPos;
+ cEntityEffect::eType &m_EntityEffectType;
+ cEntityEffect &m_EntityEffect;
+ };
+
} ; // tolua_export