Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Member Functions | Private Types | List of all members
cEntityEffectSaturation Class Reference

#include <EntityEffect.h>

Inheritance diagram for cEntityEffectSaturation:
Inheritance graph
[legend]
Collaboration diagram for cEntityEffectSaturation:
Collaboration graph
[legend]

Public Member Functions

 cEntityEffectSaturation (int a_Duration, short a_Intensity, double a_DistanceModifier=1)
 
virtual void OnTick (cPawn &a_Target) override
 Called on each tick. More...
 
- Public Member Functions inherited from cEntityEffect
 cEntityEffect (const cEntityEffect &a_OtherEffect)
 Creates an entity effect by copying another. More...
 
 cEntityEffect (int a_Duration, short a_Intensity, double a_DistanceModifier=1)
 Creates an entity effect of the specified type. More...
 
 cEntityEffect (void)
 Creates an empty entity effect. 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 OnActivate (cPawn &a_Target)
 Called when the effect is first added to an entity. More...
 
virtual void OnDeactivate (cPawn &a_Target)
 Called when the effect is removed from an entity. More...
 
cEntityEffectoperator= (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)=default
 

Private Types

using Super = cEntityEffect
 

Additional Inherited Members

- Public Types inherited from cEntityEffect
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 Public Member Functions inherited from cEntityEffect
static std::unique_ptr< cEntityEffectCreateEntityEffect (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...
 
- Protected Attributes inherited from cEntityEffect
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...
 

Detailed Description

Definition at line 537 of file EntityEffect.h.

Member Typedef Documentation

◆ Super

Definition at line 540 of file EntityEffect.h.

Constructor & Destructor Documentation

◆ cEntityEffectSaturation()

cEntityEffectSaturation::cEntityEffectSaturation ( int  a_Duration,
short  a_Intensity,
double  a_DistanceModifier = 1 
)
inline

Definition at line 544 of file EntityEffect.h.

Member Function Documentation

◆ OnTick()

void cEntityEffectSaturation::OnTick ( cPawn a_Target)
overridevirtual

Called on each tick.

By default increases the m_Ticks, descendants may override to provide additional processing.

Reimplemented from cEntityEffect.

Definition at line 504 of file EntityEffect.cpp.


The documentation for this class was generated from the following files: