![]() |
Cuberite
A lightweight, fast and extensible game server for Minecraft
|
#include <EntityEffect.h>
Public Member Functions | |
cEntityEffectInvisibility (int a_Duration, short a_Intensity, double a_DistanceModifier=1) | |
virtual void | OnActivate (cPawn &a_Target) override |
Called when the effect is first added to an entity. More... | |
virtual void | OnDeactivate (cPawn &a_Target) override |
Called when the effect is removed from an entity. More... | |
![]() | |
cEntityEffect (void) | |
Creates an empty entity effect. More... | |
cEntityEffect (int a_Duration, short a_Intensity, double a_DistanceModifier=1) | |
Creates an entity effect of the specified type. More... | |
cEntityEffect (const cEntityEffect &a_OtherEffect) | |
Creates an entity effect by copying another. More... | |
double | GetDistanceModifier (void) const |
Returns the distance modifier for affecting potency. More... | |
int | GetDuration (void) const |
Returns the duration of the effect. More... | |
short | GetIntensity (void) const |
Returns how strong the effect will be applied. More... | |
int | GetTicks (void) const |
Returns how many ticks this effect has been active for. More... | |
virtual void | OnTick (cPawn &a_Target) |
Called on each tick. More... | |
cEntityEffect & | operator= (cEntityEffect a_OtherEffect) |
Creates an entity effect by copying another. More... | |
void | SetDistanceModifier (double a_DistanceModifier) |
void | SetDuration (int a_Duration) |
void | SetIntensity (short a_Intensity) |
void | SetTicks (int a_Ticks) |
virtual | ~cEntityEffect (void) |
Private Types | |
typedef cEntityEffect | super |
Static Private Member Functions | |
static void | BroadcastMetadata (cPawn &a_Target) |
Additional Inherited Members | |
![]() | |
enum | eType { effNoEffect = 0, effSpeed = 1, effSlowness = 2, effHaste = 3, effMiningFatigue = 4, effStrength = 5, effInstantHealth = 6, effInstantDamage = 7, effJumpBoost = 8, effNausea = 9, effRegeneration = 10, effResistance = 11, effFireResistance = 12, effWaterBreathing = 13, effInvisibility = 14, effBlindness = 15, effNightVision = 16, effHunger = 17, effWeakness = 18, effPoison = 19, effWither = 20, effHealthBoost = 21, effAbsorption = 22, effSaturation = 23 } |
All types of entity effects (numbers correspond to protocol / storage types) More... | |
![]() | |
static std::unique_ptr< cEntityEffect > | CreateEntityEffect (cEntityEffect::eType a_EffectType, int a_Duration, short a_Intensity, double a_DistanceModifier) |
Creates a pointer to the proper entity effect from the effect type. More... | |
static int | GetPotionColor (short a_ItemDamage) |
Returns the potion color (used by the client for visuals), based on the potion's damage value. More... | |
static int | GetPotionEffectDuration (short a_ItemDamage) |
Returns the effect duration, in ticks, based on the potion's damage value. More... | |
static short | GetPotionEffectIntensity (short a_ItemDamage) |
Retrieves the intensity level from the potion's damage value. More... | |
static cEntityEffect::eType | GetPotionEffectType (short a_ItemDamage) |
Translates the potion's damage value into the entity effect that the potion gives. More... | |
static bool | IsPotionDrinkable (short a_ItemDamage) |
Returns true if the potion with the given damage is drinkable. More... | |
![]() | |
double | m_DistanceModifier |
The distance modifier for affecting potency. More... | |
int | m_Duration |
How long this effect will last, in ticks. More... | |
short | m_Intensity |
How strong the effect will be applied. More... | |
int | m_Ticks |
How many ticks this effect has been active for. More... | |
Definition at line 340 of file EntityEffect.h.
|
private |
Definition at line 343 of file EntityEffect.h.
|
inline |
Definition at line 345 of file EntityEffect.h.
|
staticprivate |
Definition at line 411 of file EntityEffect.cpp.
|
inlineoverridevirtual |
Called when the effect is first added to an entity.
Reimplemented from cEntityEffect.
Definition at line 350 of file EntityEffect.h.
|
inlineoverridevirtual |
Called when the effect is removed from an entity.
Reimplemented from cEntityEffect.
Definition at line 351 of file EntityEffect.h.