Being Class Reference

#include <being.hpp>

Inheritance diagram for Being:

MovingObject Object Thing Character Monster List of all members.

Detailed Description

Generic Being (living object).

Used for characters & monsters (all animated objects).

Definition at line 114 of file being.hpp.

Public Types

enum  Action {
  STAND, WALK, ATTACK, SIT,
  DEAD, HURT
}
 Moves enum for beings and actors for others players vision. More...

Public Member Functions

 Being (int type, int id)
 Proxy constructor.
 ~Being ()
Damage getPhysicalAttackDamage ()
 Creates a damage structure for a normal melee attack based on the current being stats and equipment.
void fillHitpoints ()
 Sets the hit points to maximum.
void damage (Damage)
 Takes a damage structure, computes the real damage based on the stats, deducts the result from the hitpoints and adds the result to the HitsTaken list.
virtual void die ()
 Kills the being.
Hits const & getHitsTaken () const
 Gets the damage list.
void clearHitsTaken ()
 Clears the damage list.
void performAttack (MapComposite *)
 Performs an attack.
virtual void setAction (Action action)
 Sets the current action.
virtual Action getAction () const
 Sets the current action.
virtual void move ()
 Moves the being toward its destination.
void setAttribute (int attributeNumber, unsigned short value)
 Sets an attribute (doesn't work on derived attributes).
unsigned short getAttribute (int attributeNumber) const
 Gets an attribute.

Protected Member Functions

void calculateDerivedAttributes ()
 Calculates all derived attributes of a beings.
virtual WeaponStats getWeaponStats ()
 Gets the stats of the currently equipped weapon that are relevant for damage calculation.

Protected Attributes

int mHitpoints
 Hitpoints of the being.
Action mAction
std::vector< unsigned short > mAttributes

Private Member Functions

 Being (Being const &rhs)
Beingoperator= (Being const &rhs)

Private Attributes

Hits mHitsTaken
 List of punches taken since last update.


Member Enumeration Documentation

enum Being::Action
 

Moves enum for beings and actors for others players vision.

WARNING: Has to be in sync with the same enum in the Being class of the client!

Enumeration values:
STAND 
WALK 
ATTACK 
SIT 
DEAD 
HURT 

Definition at line 123 of file being.hpp.


Constructor & Destructor Documentation

Being::Being int  type,
int  id
 

Proxy constructor.

Definition at line 30 of file being.cpp.

Being::~Being  ) 
 

Definition at line 37 of file being.cpp.

Being::Being Being const &  rhs  )  [private]
 


Member Function Documentation

void Being::calculateDerivedAttributes  )  [protected]
 

Calculates all derived attributes of a beings.

Reimplemented in Character, and Monster.

Definition at line 159 of file being.cpp.

void Being::clearHitsTaken  )  [inline]
 

Clears the damage list.

Definition at line 172 of file being.hpp.

void Being::damage Damage   ) 
 

Takes a damage structure, computes the real damage based on the stats, deducts the result from the hitpoints and adds the result to the HitsTaken list.

Definition at line 40 of file being.cpp.

void Being::die  )  [virtual]
 

Kills the being.

Reimplemented in Monster.

Definition at line 77 of file being.cpp.

void Being::fillHitpoints  )  [inline]
 

Sets the hit points to maximum.

Definition at line 148 of file being.hpp.

virtual Action Being::getAction  )  const [inline, virtual]
 

Sets the current action.

Definition at line 188 of file being.hpp.

unsigned short Being::getAttribute int  attributeNumber  )  const [inline]
 

Gets an attribute.

Definition at line 208 of file being.hpp.

Hits const& Being::getHitsTaken  )  const [inline]
 

Gets the damage list.

Definition at line 166 of file being.hpp.

Damage Being::getPhysicalAttackDamage  ) 
 

Creates a damage structure for a normal melee attack based on the current being stats and equipment.

Definition at line 182 of file being.cpp.

WeaponStats Being::getWeaponStats  )  [protected, virtual]
 

Gets the stats of the currently equipped weapon that are relevant for damage calculation.

Reimplemented in Character, and Monster.

Definition at line 197 of file being.cpp.

void Being::move  )  [virtual]
 

Moves the being toward its destination.

Reimplemented from MovingObject.

Definition at line 85 of file being.cpp.

Being& Being::operator= Being const &  rhs  )  [private]
 

void Being::performAttack MapComposite  ) 
 

Performs an attack.

Definition at line 101 of file being.cpp.

void Being::setAction Action  action  )  [virtual]
 

Sets the current action.

Definition at line 149 of file being.cpp.

void Being::setAttribute int  attributeNumber,
unsigned short  value
[inline]
 

Sets an attribute (doesn't work on derived attributes).

Definition at line 199 of file being.hpp.


Member Data Documentation

Action Being::mAction [protected]
 

Definition at line 224 of file being.hpp.

std::vector<unsigned short> Being::mAttributes [protected]
 

Definition at line 226 of file being.hpp.

int Being::mHitpoints [protected]
 

Hitpoints of the being.

Definition at line 223 of file being.hpp.

Hits Being::mHitsTaken [private]
 

List of punches taken since last update.

Definition at line 233 of file being.hpp.


The documentation for this class was generated from the following files:
Generated on Fri Mar 30 15:39:18 2007 for TMW Server by  doxygen 1.3.9.1