Planeshift
ActiveSpell Class Reference

ActiveSpells. More...

#include <activespell.h>

Public Member Functions

 ActiveSpell (const csString &name, SPELL_TYPE type, csTicks duration)
 
 ActiveSpell (const csString &name, SPELL_TYPE type, csTicks duration, const csString &image)
 
void Add (iSpellModifier &mod, const char *fmt,...)
 
void Add (iCancelAction *action, const char *fmt,...)
 
bool Cancel ()
 If Cancel() returns true, you're responsible for freeing the ActiveSpell's memory. More...
 
bool CancelOnDeath ()
 
bool DamagesHP ()
 
csTicks Duration () const
 
csString GetImage ()
 
bool HasExpired () const
 
const csString & Image () const
 
void Link (ActiveSpell *other)
 
void MarkAsDamagingHP ()
 
const csString & Name () const
 
csString Persist () const
 Return (XML for) a ProgressionScript that would restore this spell effect. More...
 
void Register (gemActor *target)
 
csTicks RegistrationTime () const
 
void SetCancelOnDeath (bool x)
 
void SetImage (csString imageName)
 
SPELL_TYPE Type () const
 
 ~ActiveSpell ()
 

Protected Attributes

csPDelArray< iCancelActionactions
 Actions to take when cancelling (i.e. unattaching scripts). More...
 
bool cancelOnDeath
 Whether or not this spell should be cancelled on death. More...
 
bool damagesHP
 Whether or not this spell damages HP (for cancel on duel defeat) More...
 
csTicks duration
 How long this spell lasts. More...
 
csString image
 The icon representing the spell. More...
 
csArray< iSpellModifier * > modifiers
 The iSpellModifiers this ActiveSpell altered, for cancelling. More...
 
csString name
 The name of the spell. More...
 
csTicks registrationTime
 Timestamp when the spell was registered, for comparison with csGetTicks(). More...
 
csString script
 the contents of an <apply> node which recreates this effect More...
 
gemActortarget
 Who this spell is registered with. More...
 
SPELL_TYPE type
 Spell type - buff, debuff, etc. More...
 

Detailed Description

ActiveSpells.

A description of an active spell, containing all the information needed to

  • Cancel it, reverting all its effects
  • Persist it to the database (as a ProgressionScript that can recreate it).

These correspond to "applied mode" in ProgressionScripts - that is, the contents of <apply> nodes.

Definition at line 68 of file activespell.h.

Constructor & Destructor Documentation

ActiveSpell::ActiveSpell ( const csString &  name,
SPELL_TYPE  type,
csTicks  duration 
)
ActiveSpell::ActiveSpell ( const csString &  name,
SPELL_TYPE  type,
csTicks  duration,
const csString &  image 
)
ActiveSpell::~ActiveSpell ( )
inline

Definition at line 73 of file activespell.h.

Member Function Documentation

void ActiveSpell::Add ( iSpellModifier mod,
const char *  fmt,
  ... 
)
void ActiveSpell::Add ( iCancelAction action,
const char *  fmt,
  ... 
)
bool ActiveSpell::Cancel ( )

If Cancel() returns true, you're responsible for freeing the ActiveSpell's memory.

If it returns false, it ignored the (second) attempt to cancel it (due to links).

bool ActiveSpell::CancelOnDeath ( )
inline

Definition at line 86 of file activespell.h.

bool ActiveSpell::DamagesHP ( )
inline

Definition at line 95 of file activespell.h.

csTicks ActiveSpell::Duration ( ) const
inline

Definition at line 112 of file activespell.h.

csString ActiveSpell::GetImage ( )
bool ActiveSpell::HasExpired ( ) const
const csString& ActiveSpell::Image ( ) const
inline

Definition at line 104 of file activespell.h.

void ActiveSpell::Link ( ActiveSpell other)
void ActiveSpell::MarkAsDamagingHP ( )
inline

Definition at line 91 of file activespell.h.

const csString& ActiveSpell::Name ( ) const
inline

Definition at line 100 of file activespell.h.

csString ActiveSpell::Persist ( ) const

Return (XML for) a ProgressionScript that would restore this spell effect.

void ActiveSpell::Register ( gemActor target)
csTicks ActiveSpell::RegistrationTime ( ) const
inline

Definition at line 116 of file activespell.h.

void ActiveSpell::SetCancelOnDeath ( bool  x)
inline

Definition at line 82 of file activespell.h.

void ActiveSpell::SetImage ( csString  imageName)
SPELL_TYPE ActiveSpell::Type ( ) const
inline

Definition at line 108 of file activespell.h.

Member Data Documentation

csPDelArray<iCancelAction> ActiveSpell::actions
protected

Actions to take when cancelling (i.e. unattaching scripts).

Definition at line 150 of file activespell.h.

bool ActiveSpell::cancelOnDeath
protected

Whether or not this spell should be cancelled on death.

Definition at line 143 of file activespell.h.

bool ActiveSpell::damagesHP
protected

Whether or not this spell damages HP (for cancel on duel defeat)

Definition at line 144 of file activespell.h.

csTicks ActiveSpell::duration
protected

How long this spell lasts.

Definition at line 142 of file activespell.h.

csString ActiveSpell::image
protected

The icon representing the spell.

Definition at line 139 of file activespell.h.

csArray<iSpellModifier*> ActiveSpell::modifiers
protected

The iSpellModifiers this ActiveSpell altered, for cancelling.

Definition at line 149 of file activespell.h.

csString ActiveSpell::name
protected

The name of the spell.

Definition at line 138 of file activespell.h.

csTicks ActiveSpell::registrationTime
protected

Timestamp when the spell was registered, for comparison with csGetTicks().

Definition at line 147 of file activespell.h.

csString ActiveSpell::script
protected

the contents of an <apply> node which recreates this effect

Definition at line 141 of file activespell.h.

gemActor* ActiveSpell::target
protected

Who this spell is registered with.

Definition at line 146 of file activespell.h.

SPELL_TYPE ActiveSpell::type
protected

Spell type - buff, debuff, etc.

Definition at line 140 of file activespell.h.


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