diff options
author | madmaxoft <github@xoft.cz> | 2014-07-15 22:41:42 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-07-15 22:41:42 +0200 |
commit | cc452f51c8c4e1c886932d2f7965c7b3e4ab42fe (patch) | |
tree | a312110638939187d1e54e11761f883a22a50e1e /src/Entities/EntityEffect.h | |
parent | Only the cEntityEffect::effXXX constants are Lua-exported. (diff) | |
download | cuberite-cc452f51c8c4e1c886932d2f7965c7b3e4ab42fe.tar cuberite-cc452f51c8c4e1c886932d2f7965c7b3e4ab42fe.tar.gz cuberite-cc452f51c8c4e1c886932d2f7965c7b3e4ab42fe.tar.bz2 cuberite-cc452f51c8c4e1c886932d2f7965c7b3e4ab42fe.tar.lz cuberite-cc452f51c8c4e1c886932d2f7965c7b3e4ab42fe.tar.xz cuberite-cc452f51c8c4e1c886932d2f7965c7b3e4ab42fe.tar.zst cuberite-cc452f51c8c4e1c886932d2f7965c7b3e4ab42fe.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Entities/EntityEffect.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/Entities/EntityEffect.h b/src/Entities/EntityEffect.h index a06c1512d..ebd611ff0 100644 --- a/src/Entities/EntityEffect.h +++ b/src/Entities/EntityEffect.h @@ -7,7 +7,7 @@ class cEntityEffect { public: - /** All types of entity effects (numbers correspond to IDs) */ + /** All types of entity effects (numbers correspond to protocol / storage types) */ enum eType { effNoEffect = 0, @@ -66,21 +66,30 @@ public: static cEntityEffect * CreateEntityEffect(cEntityEffect::eType a_EffectType, int a_Duration, short a_Intensity, double a_DistanceModifier); /** Returns how many ticks this effect has been active for */ - int GetTicks() { return m_Ticks; } + int GetTicks(void) const { return m_Ticks; } + /** Returns the duration of the effect */ - int GetDuration() { return m_Duration; } + int GetDuration(void) const { return m_Duration; } + /** Returns how strong the effect will be applied */ - short GetIntensity() { return m_Intensity; } + short GetIntensity(void) const { return m_Intensity; } + /** Returns the distance modifier for affecting potency */ - double GetDistanceModifier() { return m_DistanceModifier; } + double GetDistanceModifier(void) const { return m_DistanceModifier; } void SetTicks(int a_Ticks) { m_Ticks = a_Ticks; } void SetDuration(int a_Duration) { m_Duration = a_Duration; } void SetIntensity(short a_Intensity) { m_Intensity = a_Intensity; } void SetDistanceModifier(double a_DistanceModifier) { m_DistanceModifier = a_DistanceModifier; } + /** Called on each tick. + By default increases the m_Ticks, descendants may override to provide additional processing. */ virtual void OnTick(cPawn & a_Target); + + /** Called when the effect is first added to an entity */ virtual void OnActivate(cPawn & a_Target) { } + + /** Called when the effect is removed from an entity */ virtual void OnDeactivate(cPawn & a_Target) { } protected: |