hoa_global::GlobalStatusEffect Class Reference

Represents a status effect on an actor or other object. More...

#include <global_skills.h>

Collaboration diagram for hoa_global::GlobalStatusEffect:

Collaboration graph
[legend]
List of all members.

Public Member Functions

bool DecrementIntensity (uint8 amount)
 Decrements the status effect intensity by a specified amount.
 GlobalStatusEffect (GLOBAL_STATUS type, GLOBAL_INTENSITY intensity=GLOBAL_INTENSITY_NEUTRAL)
bool IncrementIntensity (uint8 amount)
 Increments the status effect intensity by a positive amount.
 ~GlobalStatusEffect ()
GLOBAL_INTENSITY GetIntensity () const
GLOBAL_STATUS GetType () const
 Class Member Access Functions.
void SetIntensity (GLOBAL_INTENSITY intensity)

Private Attributes

GLOBAL_INTENSITY _intensity
 The level of intensity of the status effect There are four levels of intensity, as indicated by the Status Effect Intensities constants. This member should only ever equal one of those values.
GLOBAL_STATUS _type
 The type (identifier) of status that the object represents Refer to the Status Effect Types for a list of the valid types and values that this member may be.

Detailed Description

Represents a status effect on an actor or other object.

****************************************************************************

Status effects are either aiding (boost to strength) or ailing (poisoned). An object of this class represents a single status effect (not mulitple). A feature unique to Allacrost is that status effects have different levels of intensity, four to be exact.

Todo:
Determine how we wish to handle status effects which are polar opposites of one another (i.e., increase in speed versus decrease in speed).
Todo:
Add a pointer to the script function to execute (if any) to apply the status effect. Note that some status effects will require periodic updates (e.g. poison) while others only need to be applied one time (e.g. increase in strength).

Definition at line 184 of file global_skills.h.


Constructor & Destructor Documentation

hoa_global::GlobalStatusEffect::GlobalStatusEffect ( GLOBAL_STATUS  type,
GLOBAL_INTENSITY  intensity = GLOBAL_INTENSITY_NEUTRAL 
) [inline]

Definition at line 186 of file global_skills.h.

hoa_global::GlobalStatusEffect::~GlobalStatusEffect (  )  [inline]

Definition at line 189 of file global_skills.h.


Member Function Documentation

bool hoa_global::GlobalStatusEffect::DecrementIntensity ( uint8  amount  ) 

Decrements the status effect intensity by a specified amount.

Parameters:
amount The number of intensity levels to decrement the status effect by
Returns:
False if the intensity level reaches GLOBAL_INTENSITY_INVALID (zero intensity)
Unlike the IncrementIntensity function, the user is advised to always check the return value of this function. When the intensity reaches zero, the user may wish to delete the StatusEffect object class as it no longer has any effect on the actor.

Definition at line 79 of file global_skills.cpp.

References _intensity, hoa_global::GLOBAL_DEBUG, hoa_global::GLOBAL_INTENSITY_INVALID, and hoa_global::GLOBAL_INTENSITY_NEUTRAL.

GLOBAL_INTENSITY hoa_global::GlobalStatusEffect::GetIntensity (  )  const [inline]

Definition at line 200 of file global_skills.h.

References _intensity.

GLOBAL_STATUS hoa_global::GlobalStatusEffect::GetType (  )  const [inline]

Class Member Access Functions.

Definition at line 197 of file global_skills.h.

References _type.

bool hoa_global::GlobalStatusEffect::IncrementIntensity ( uint8  amount  ) 

Increments the status effect intensity by a positive amount.

Parameters:
amount The number of intensity levels to increase the status effect by
Returns:
False if the intensity level could not fully be increased by the amount specified (upper bound limit)
Usually the return value of this function can be safely ignored. What happens is, for example, when the original intensity level is equal to "greater intensity level" and the function is given a parameter of "2", it will increment the intensity by one level (not two) to "extreme" (the maximum upper limit). It then returns false to indicate that the intensity could not fully be increased by the amount specified.

Note:
If this function does indeed change the intensity level, the _icon_image pointer will also be changed to reflect this.

Definition at line 45 of file global_skills.cpp.

References _intensity, hoa_global::GLOBAL_DEBUG, and hoa_global::GLOBAL_INTENSITY_POS_EXTREME.

void hoa_global::GlobalStatusEffect::SetIntensity ( GLOBAL_INTENSITY  intensity  )  [inline]

Definition at line 203 of file global_skills.h.

References _intensity.


Member Data Documentation

GLOBAL_INTENSITY hoa_global::GlobalStatusEffect::_intensity [private]

The level of intensity of the status effect There are four levels of intensity, as indicated by the Status Effect Intensities constants. This member should only ever equal one of those values.

Definition at line 242 of file global_skills.h.

Referenced by DecrementIntensity(), GetIntensity(), IncrementIntensity(), and SetIntensity().

GLOBAL_STATUS hoa_global::GlobalStatusEffect::_type [private]

The type (identifier) of status that the object represents Refer to the Status Effect Types for a list of the valid types and values that this member may be.

Definition at line 236 of file global_skills.h.

Referenced by GetType().


The documentation for this class was generated from the following files:
Generated on Fri Jul 6 23:14:24 2007 for Hero of Allacrost by  doxygen 1.5.1