Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

ogs::magic::MetamagicFeat Class Reference

A feat that enhances spells. More...

#include <MetamagicFeat.h>

Inheritance diagram for ogs::magic::MetamagicFeat:

Inheritance graph
[legend]
Collaboration diagram for ogs::magic::MetamagicFeat:

Collaboration graph
[legend]
List of all members.

Public Types

typedef SpellLevel Cost
 The number of spell levels added by a metamagic feat.


Public Member Functions

Cost getCost () const
 Determine the cost of this metamagic feat.

virtual bool attachSpell (Spell &spell)
 Attach this metamagic feat to a spell.

virtual bool detachSpell ()
 Detach this metamagic feat from a spell.

SpellgetSpell () const
 Detemine the spell that this feat is attached to.


Protected Member Functions

 MetamagicFeat (Cost cost)
 Create a new metamagic feat.

virtual bool canAttachSpell (Spell &spell) const
 Determine if this metamagic feat can be attached to a spell.

virtual bool canDetachSpell () const
 Determine if this metamagic feat can be detached from a spell.


Detailed Description

The cost of using a metamagic feat however is that it increases the spell level of the spell. This requires that spell casters use a higher slot in their daily allowance of spells.

Todo:
Could modify the Attachable operations to accept both creatures and spells and perform the correct behavior appropriate to that class.


Constructor & Destructor Documentation

ogs::magic::MetamagicFeat::MetamagicFeat Cost  cost  )  [inline, protected]
 

Parameters:
cost Cost of using a metamagic feat.


Member Function Documentation

bool MetamagicFeat::attachSpell Spell spell  )  [virtual]
 

This method should always be called first by derived objects that override this function.

Parameters:
spell A spell instance.
Returns:
True if this metamagic feat is attached to the spell

Reimplemented in ogs::magic::feats::EmpowerSpell, ogs::magic::feats::EnlargeSpell, ogs::magic::feats::ExtendSpell, ogs::magic::feats::HeightenSpell, ogs::magic::feats::MaximizeSpell, ogs::magic::feats::QuickenSpell, ogs::magic::feats::SilentSpell, and ogs::magic::feats::StillSpell.

bool ogs::magic::MetamagicFeat::canAttachSpell Spell spell  )  const [inline, protected, virtual]
 

A metamagic feat can only be attached to a spell if it is not already attached.

bool ogs::magic::MetamagicFeat::canDetachSpell  )  const [inline, protected, virtual]
 

Metamagic feats can not be detached from spells by default.

Returns:
True if the feature is detached from the object.

bool MetamagicFeat::detachSpell  )  [virtual]
 

This function resets the spell pointer to null. Derived classes that override this function should therefore call the getObject() function before calling this function.

Returns:
True if this feat is detached from the spell.

MetamagicFeat::Cost ogs::magic::MetamagicFeat::getCost  )  const [inline]
 

Returns:
Cost of this metamagic feat.

Spell * ogs::magic::MetamagicFeat::getSpell  )  const [inline]
 

Returns:
Spell that this feat is attached to or NULL if not attached.


The documentation for this class was generated from the following files:
Generated on Sun Apr 20 03:40:04 2003 for Open Gaming System (OGS) by doxygen1.3