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

ogs::spells::conjurations::CureWounds Class Reference

A spell that heals damage to living creatures. More...

#include <CureWounds.h>

Inheritance diagram for ogs::spells::conjurations::CureWounds:

Inheritance graph
[legend]
Collaboration diagram for ogs::spells::conjurations::CureWounds:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ogs::core::XP::Level CasterLevel
 Level of caster.

typedef ogs::core::EntityTarget
 Target of cure wounds spell.

enum  Degree {
  MINOR, LIGHT, MODERATE, SERIOUS,
  CRITICAL
}
 Determines how much damage is healed (or dealt). More...


Public Member Functions

const ogs::magic::SchoolgetSchool () const
 Determine the school (or subschool) for this type of spell.

ogs::magic::Spell::Components getComponents () const
 Determine the components needed to cast this spell.

ogs::magic::Range getRange () const
 Determine the range of this spell.

Degree getDegree () const
 Determine the degree of this cure wounds spell.

Target getTarget () const
 Determine the target of this spell.

void setTarget (Target target)
 Change the target of this spell.

bool inflictsWounds () const
 Determine if this spell inflicts wounds instead of curing wounds.

void castSpell ()
 Cast this spell.


Static Public Member Functions

CureWounds * createMinor (CasterLevel casterLevel, bool inflict=false)
 Create a new Cure Minor Wounds spell.

CureWounds * createLight (CasterLevel casterLevel, bool inflict=false)
 Create a new Cure Light Wounds spell.

CureWounds * createModerate (CasterLevel casterLevel, bool inflict=false)
 Create a new Cure Moderate Wounds spell.

CureWounds * createSerious (CasterLevel casterLevel, bool inflict=false)
 Create a new Cure Serious Wounds spell.

CureWounds * createCritical (CasterLevel casterLevel, bool inflict=false)
 Create a new Cure Critical Wounds spell.


Protected Member Functions

 CureWounds (CasterLevel casterLevel, Degree degree, bool inflict=false)
 Create a new cure wounds spell.


Detailed Description

Cure wounds spells have the opposite effect on undead creatures: the spell causes damage to undead creatures instead of curing it. Cure wounds spells can have different degrees. The degree of the spell determines how much damage is healed (or dealt in the case of undead creatures). The level of the spell caster also increases the amount of damage cured (or inflicted) by the spell.

The opposite version of this spell inflicts wounds instead of curing damage to living creatures and heals undead creatures.

Todo:
Determine effects of metamagic feats and implement them.


Member Enumeration Documentation

enum ogs::spells::conjurations::CureWounds::Degree
 

Enumeration values:
MINOR  Cures 1 point of damage.
LIGHT  Cures 1d8 points of damage plus 1 per caster level (up to 5).
MODERATE  Cures 2d8 points of damage plus 1 per caster level (up to 10).
SERIOUS  Cures 3d8 points of damage plus 1 per caster level (up to 15).
CRITICAL  Cures 4d8 points of damage plus 1 per caster level (up to 20).


Constructor & Destructor Documentation

CureWounds::CureWounds CasterLevel  casterLevel,
Degree  degree,
bool  inflict = false
[protected]
 

Parameters:
casterLevel Level of caster.
degree Degree of cure wounds spell.
inflict True if this spell inflicts wounds instead.


Member Function Documentation

void CureWounds::castSpell  ) 
 

When a cure wounds spell is cast, this function first checks to see if there is a target. If there is not target, nothing happens. (In other words, this function does nothing). Otherwise, the target is checked to see if it is a creature. If the target is not a creature, nothing happens. If the target is a creature, this function rolls a random number of hit points according to the degree of spell. Next, the creature is checked to see if it is undead. If it is, a Will save is rolled for the undead creature. If the save fails, the points are subtracted from the current hit points of the undead creature. If the creature is not undead, the points are added to the current hit points of the creature (up to its maximum points).

Todo:
Implement inflict wounds behavior.

CureWounds * ogs::spells::conjurations::CureWounds::createCritical CasterLevel  casterLevel,
bool  inflict = false
[inline, static]
 

Parameters:
casterLevel Level of spell caster.
inflict True if this spell inflicts wounds instead.
Returns:
A new Cure Critical Wounds spell.

CureWounds * ogs::spells::conjurations::CureWounds::createLight CasterLevel  casterLevel,
bool  inflict = false
[inline, static]
 

Parameters:
casterLevel Level of spell caster.
inflict True if this spell inflicts wounds instead.
Returns:
A new Cure Light Wounds spell.

CureWounds * ogs::spells::conjurations::CureWounds::createMinor CasterLevel  casterLevel,
bool  inflict = false
[inline, static]
 

Parameters:
casterLevel Level of spell caster.
inflict True if this spell inflicts wounds instead.
Returns:
A new Cure Minor Wounds spell.

CureWounds * ogs::spells::conjurations::CureWounds::createModerate CasterLevel  casterLevel,
bool  inflict = false
[inline, static]
 

Parameters:
casterLevel Level of spell caster.
inflict True if this spell inflicts wounds instead.
Returns:
A new Cure Moderate Wounds spell.

CureWounds * ogs::spells::conjurations::CureWounds::createSerious CasterLevel  casterLevel,
bool  inflict = false
[inline, static]
 

Parameters:
casterLevel Level of spell caster.
inflict True if this spell inflicts wounds instead.
Returns:
A new Cure Serious Wounds spell.

ogs::magic::Spell::Components CureWounds::getComponents  )  const [virtual]
 

The components of a cure wounds spell are normally verbal and somantic. Silence Spell and Still spell feats however may negate one or both of these components.

Returns:
Array of components for this spell.

Implements ogs::magic::Spell.

CureWounds::Degree ogs::spells::conjurations::CureWounds::getDegree  )  const [inline]
 

#return Degree of cure wounds spell.

ogs::magic::Range ogs::spells::conjurations::CureWounds::getRange  )  const [inline, virtual]
 

Cure wounds spells always have touch range.

Returns:
Touch range.

Implements ogs::magic::Spell.

const ogs::magic::School & ogs::spells::conjurations::CureWounds::getSchool  )  const [inline, virtual]
 

All cure wounds spells are in the Healing subschool of the Conjuration school.

Returns:
Healing subshool of the Conjuration school.

Reimplemented from ogs::spells::Conjuration.

CureWounds::Target ogs::spells::conjurations::CureWounds::getTarget  )  const [inline]
 

The target of this spell is the entity that will be healed (or damaged). If the entity is not a creature, the spell does nothing. If the spell does not yet have a target, the function returns NULL.

Returns:
Target of spell or NULL if spell is not targeted.

bool ogs::spells::conjurations::CureWounds::inflictsWounds  )  const [inline]
 

Returns:
True if the spell inflicts wounds instead.

void ogs::spells::conjurations::CureWounds::setTarget Target  target  )  [inline]
 

Parameters:
target Target of this spell.
Todo:
Complete the implementation of this function.


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